:root {
  --bg-0: #080d1b;
  --bg-1: #0c1326;
  --bg-2: #131b34;
  --glass-strong: rgba(15, 23, 41, 0.74);
  --glass-soft: rgba(22, 34, 59, 0.48);
  --glass-elev: rgba(29, 42, 70, 0.64);
  --stroke: rgba(255, 255, 255, 0.24);
  --stroke-soft: rgba(255, 255, 255, 0.13);
  --text: #f4f7ff;
  --muted: #afbdd9;
  --accent: #4ca5ff;
  --accent-2: #7b6dff;
  --danger: #ff6b7a;
  --ok: #56d7a5;
  --focus-ring: rgba(90, 181, 255, 0.32);
  --control-bg: rgba(255, 255, 255, 0.1);
  --control-bg-focus: rgba(255, 255, 255, 0.15);
  --shadow-sm: 0 6px 14px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 22px 45px rgba(0, 0, 0, 0.36);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.28);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --control-h: 44px;
  --liquid-rim: rgba(201, 230, 255, 0.36);
  --liquid-top: rgba(255, 255, 255, 0.2);
  --liquid-bottom: rgba(25, 48, 95, 0.24);
  --scroll-track: rgba(255, 255, 255, 0.04);
  --scroll-thumb: linear-gradient(180deg, rgba(128, 201, 255, 0.78), rgba(94, 142, 255, 0.72));
  --scroll-thumb-hover: linear-gradient(180deg, rgba(153, 214, 255, 0.9), rgba(112, 159, 255, 0.84));
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(121, 176, 255, 0.75) var(--scroll-track);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "SF Pro Display", "SF Pro Text", "Avenir Next", "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 650px at -10% -10%, rgba(76, 165, 255, 0.26), transparent 62%),
    radial-gradient(900px 550px at 120% -20%, rgba(123, 109, 255, 0.2), transparent 58%),
    radial-gradient(1000px 700px at 50% 120%, rgba(49, 214, 255, 0.13), transparent 62%),
    linear-gradient(140deg, var(--bg-0), var(--bg-1) 46%, var(--bg-2));
  background-attachment: fixed;
}

.liquid-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.03), transparent 32%),
    linear-gradient(310deg, rgba(255, 255, 255, 0.02), transparent 44%);
  mix-blend-mode: screen;
  opacity: 0.85;
  z-index: -1;
  animation: bg-drift 18s ease-in-out infinite alternate;
}

.bg-layer::before,
.bg-layer::after {
  content: "";
  position: absolute;
  width: 45vmax;
  height: 45vmax;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.2;
}

.bg-layer::before {
  left: -12vmax;
  top: -8vmax;
  background: radial-gradient(circle, rgba(92, 185, 255, 0.8), transparent 60%);
}

.bg-layer::after {
  right: -14vmax;
  bottom: -12vmax;
  background: radial-gradient(circle, rgba(121, 124, 255, 0.66), transparent 60%);
}

@keyframes bg-drift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(0, -8px, 0);
  }
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

.app-header {
  padding: 26px 28px 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.brand-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: 34px;
}

.brand-header .brand-logo {
  height: clamp(32px, 3.2vw, 42px);
}

body.auth-mode .app-header > div {
  display: flex;
  justify-content: center;
}

body.auth-mode .brand-header {
  width: 100%;
  justify-content: center;
}

.brand-text {
  color: #3b82f6;
  font-size: clamp(1rem, 1.55vw, 1.2rem);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-left: -5px;
  margin-top: -15px;
}

.subtitle {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.95rem;
}

.layout {
  padding: 14px 24px 24px;
}

.card {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
    radial-gradient(120% 120% at 0% 0%, rgba(255, 255, 255, 0.08), transparent 40%);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  padding: 18px 18px 16px;
  display: grid;
  gap: 12px;
  align-content: start;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.subcard {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03)),
    radial-gradient(120% 120% at 0% 0%, rgba(255, 255, 255, 0.08), transparent 42%);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-lg);
  padding: 14px 14px 13px;
  display: grid;
  gap: 11px;
  align-content: start;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.card::before,
.subcard::before,
.sidebar::before,
.main-toolbar::before,
.popup-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(95% 55% at 50% -10%, var(--liquid-top), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 52%);
  pointer-events: none;
  z-index: 0;
}

.card::after,
.subcard::after,
.sidebar::after,
.main-toolbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, var(--liquid-bottom));
  pointer-events: none;
  z-index: 0;
}

.card > *,
.subcard > *,
.sidebar > *,
.main-toolbar > *,
.popup-modal > * {
  position: relative;
  z-index: 1;
}

.auth-card {
  max-width: 960px;
  margin: 0 auto;
}

.auth-single {
  margin-top: 0;
  display: flex;
  justify-content: center;
}

.auth-pane {
  width: min(460px, 100%);
}

.auth-pane h3 {
  text-align: center;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
  margin-bottom: 2px;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  min-height: calc(100vh - 86px);
  align-items: stretch;
}

.sidebar {
  background: linear-gradient(160deg, var(--glass-strong), rgba(19, 28, 48, 0.66));
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 14px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.sidebar-top {
  display: grid;
  gap: 8px;
  padding: 0 14px 13px;
  border-bottom: 1px solid var(--stroke-soft);
}

.brand-sidebar .brand-logo {
  height: 30px;
}

.brand-sidebar .brand-text {
  font-size: 1rem;
}

.sidebar-subtitle {
  color: var(--muted);
  font-size: 0.84rem;
}

.sidebar-user {
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-md);
  padding: 9px;
  color: #eff4ff;
  font-size: 0.84rem;
  line-height: 1.4;
  white-space: pre-line;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
  padding: 8px 8px 0;
}

.menu-tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #eef3ff;
  padding: 11px 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  border-radius: 14px;
  font-size: 14px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.menu-tab-btn:hover {
  border-color: var(--stroke-soft);
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.menu-tab-btn.active {
  background: linear-gradient(160deg, rgba(76, 165, 255, 0.26), rgba(123, 109, 255, 0.24));
  border-color: rgba(137, 194, 255, 0.55);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(76, 165, 255, 0.2);
}

.tab-icon {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(154, 209, 255, 0.72);
  background: linear-gradient(160deg, rgba(103, 187, 255, 0.56), rgba(66, 109, 226, 0.44));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset 0 -10px 14px rgba(23, 66, 140, 0.34),
    0 6px 12px rgba(44, 115, 219, 0.3);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.tab-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 2px;
  height: 42%;
  border-radius: 8px 8px 6px 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.tab-icon-svg {
  position: relative;
  z-index: 1;
  width: 17px;
  height: 17px;
  filter: drop-shadow(0 1px 0 rgba(14, 46, 106, 0.42));
}

.menu-tab-btn:hover .tab-icon {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.54),
    inset 0 -11px 16px rgba(24, 72, 154, 0.38),
    0 8px 14px rgba(56, 133, 244, 0.35);
}

.menu-tab-btn.active .tab-icon {
  background: linear-gradient(160deg, rgba(120, 208, 255, 0.82), rgba(77, 130, 255, 0.72));
  border-color: rgba(202, 233, 255, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -12px 16px rgba(28, 81, 170, 0.44),
    0 10px 18px rgba(73, 148, 255, 0.42);
}

.sidebar-bottom {
  margin-top: auto;
  padding: 12px 14px 0;
  border-top: 1px solid var(--stroke-soft);
}

.dashboard-main {
  min-width: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.main-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 2px 14px;
  background: linear-gradient(160deg, var(--glass-soft), rgba(22, 33, 56, 0.44));
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-lg);
  padding: 11px 12px;
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.main-toolbar h2 {
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.icon-btn {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 11px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.tab-pane {
  animation: pane-in 0.2s ease;
}

@keyframes pane-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(340px, 1fr));
  gap: 14px;
}

.subcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.subcard-head .btn {
  flex-shrink: 0;
}

.admin-users-section + .admin-users-section {
  margin-top: 12px;
}

.campaigns-grid {
  display: block;
}

.campaigns-grid > .card {
  width: min(100%, 66.666%);
  margin-right: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 2px;
}

.full-row {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(198, 222, 255, 0.22);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07)),
    var(--control-bg);
  color: var(--text);
  border-radius: var(--radius-sm);
  min-height: var(--control-h);
  height: var(--control-h);
  line-height: 1.2;
  padding: 10px 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -10px 15px rgba(20, 40, 79, 0.16);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(223, 231, 248, 0.62);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(170, 219, 255, 0.95);
  background: var(--control-bg-focus);
  box-shadow:
    0 0 0 4px var(--focus-ring),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -12px 16px rgba(27, 54, 106, 0.2);
  outline: none;
  transform: translateY(-1px);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 38px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23d9e6ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    linear-gradient(165deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07)),
    var(--control-bg);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: 14px 14px, auto, auto;
  background-position: right 12px center, 0 0, 0 0;
}

select:focus {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    linear-gradient(165deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07)),
    var(--control-bg-focus);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: 14px 14px, auto, auto;
  background-position: right 12px center, 0 0, 0 0;
}

textarea {
  resize: vertical;
  height: auto;
  min-height: 112px;
}

.inline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 11px 0;
}

.inline-controls label {
  min-width: 220px;
  flex: 1 1 220px;
}

.inline-controls .btn {
  align-self: end;
}

.targets-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
}

.audience-member-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.audience-member-controls label {
  grid-column: auto;
  min-width: 0;
}

.audience-member-controls #addSelectedTargetsBtn {
  grid-column: auto;
  width: 100%;
}

.audience-member-controls #showAudienceMembersBtn {
  grid-column: auto;
  width: 100%;
}

#targetsTable th:first-child,
#targetsTable td:first-child {
  width: 44px;
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}

#targetsIntegrationFilter,
#targetsSearch,
#audienceSelectForMembers {
  min-height: var(--control-h);
  height: var(--control-h);
  padding: 10px 12px;
  line-height: 1.2;
}

#loadTargetsBtn,
#addSelectedTargetsBtn,
#showAudienceMembersBtn {
  min-height: var(--control-h);
  height: var(--control-h);
  padding: 10px 13px;
}

.btn {
  border: 1px solid var(--stroke);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
  color: #e9f1ff;
  border-radius: 14px;
  min-height: var(--control-h);
  height: var(--control-h);
  padding: 10px 13px;
  cursor: pointer;
  line-height: 1.1;
  font-weight: 560;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 2px;
  height: 48%;
  border-radius: 11px 11px 9px 9px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  pointer-events: none;
  z-index: 0;
}

.btn > * {
  position: relative;
  z-index: 1;
}

.btn:hover {
  border-color: rgba(138, 198, 255, 0.5);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.22);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn:disabled:hover {
  border-color: var(--stroke);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
}

.btn.primary {
  background: linear-gradient(145deg, rgba(76, 165, 255, 0.85), rgba(91, 115, 255, 0.84));
  border-color: rgba(132, 191, 255, 0.9);
  color: #ffffff;
  font-weight: 620;
  box-shadow: 0 8px 18px rgba(76, 165, 255, 0.24);
}

.btn.primary:hover {
  background: linear-gradient(145deg, rgba(90, 173, 255, 0.95), rgba(108, 129, 255, 0.95));
  border-color: rgba(157, 205, 255, 1);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.06);
}

.btn.danger {
  border-color: rgba(255, 107, 122, 0.62);
  color: #ffc8cf;
  background: rgba(255, 107, 122, 0.08);
}

.btn.danger:hover {
  background: rgba(255, 107, 122, 0.18);
  border-color: rgba(255, 136, 149, 0.8);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  margin-top: 4px;
  border: 1px solid var(--stroke-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -16px 20px rgba(18, 36, 77, 0.18);
}

.table-wrap.compact {
  max-height: 320px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 11px 12px;
  font-size: 0.89rem;
  white-space: nowrap;
}

th {
  color: #f5f8ff;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

.table-wrap .btn {
  min-height: var(--control-h);
  height: var(--control-h);
  border-radius: 11px;
  padding: 10px 13px;
  font-size: 0.82rem;
  box-shadow: none;
}

#pendingUsersTable .pending-user-actions-cell {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.campaign-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hint {
  color: var(--muted);
  font-size: 0.86rem;
}

.help-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  color: #e6efff;
  line-height: 1.4;
  font-size: 0.9rem;
}

.help-list li::marker {
  color: #95c8ff;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  color: var(--text);
  border: 1px solid var(--stroke);
  border-left: 4px solid var(--accent);
  border-radius: 13px;
  padding: 10px 12px;
  z-index: 200;
  max-width: 330px;
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
}

.popup-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 10, 20, 0.56);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 2100;
}

.popup-modal {
  width: min(430px, 100%);
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background:
    linear-gradient(160deg, rgba(28, 43, 74, 0.88), rgba(19, 30, 52, 0.84)),
    radial-gradient(120% 100% at 0% 0%, rgba(255, 255, 255, 0.12), transparent 45%);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.45);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.popup-title {
  font-size: 1.1rem;
  font-weight: 640;
  color: #f4f8ff;
}

.popup-message {
  color: #c8d6f1;
  font-size: 0.96rem;
  line-height: 1.4;
}

.popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}

.popup-actions .btn {
  min-width: 110px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 13, 27, 0.58);
  z-index: 1100;
}

body.app-mode .layout {
  height: 100dvh;
  padding-top: 10px;
  padding-bottom: 10px;
  min-height: 0;
  overflow: hidden;
}

body.app-mode {
  height: 100dvh;
  overflow: hidden;
}

body.app-mode #appSection {
  height: 100%;
  min-height: 0;
}

body.auth-mode {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

body.auth-mode .app-header {
  padding: 0 0 14px;
}

body.auth-mode .layout {
  width: min(560px, 92vw);
  padding: 0;
  min-height: auto;
  display: block;
}

body.auth-mode .auth-card {
  width: 100%;
  margin: 0;
}

body.auth-mode .auth-single {
  margin-top: 0;
}

body.auth-mode .auth-pane .btn {
  width: 100%;
}

body.app-mode .dashboard-shell {
  height: 100%;
  min-height: 0;
}

body.app-mode .sidebar,
body.app-mode .dashboard-main {
  height: 100%;
  min-height: 100%;
}

body.app-mode .dashboard-main {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .app-header {
    padding: 16px 13px 7px;
  }

  .layout {
    padding: 8px 12px 14px;
  }

  .dashboard-shell {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: auto;
  }

  body.app-mode .dashboard-shell {
    min-height: auto;
  }

  .icon-btn {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 316px);
    z-index: 1200;
    border-radius: 0 22px 22px 0;
    transform: translateX(-103%);
    transition: transform 0.23s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .dashboard-main {
    padding: 0;
  }

  .main-toolbar {
    position: static;
  }

  .dashboard-grid,
  .auth-single,
  .form-grid {
    display: block;
  }

  .targets-controls,
  .audience-member-controls {
    display: block;
  }

  .form-grid > * + * {
    margin-top: 10px;
  }

  .form-grid > .btn {
    margin-top: 14px;
  }

  #targetsIntegrationFilter,
  #targetsSearch,
  #audienceSelectForMembers {
    min-height: var(--control-h);
    height: var(--control-h);
    padding: 10px 12px;
  }

  #loadTargetsBtn,
  #addSelectedTargetsBtn,
  #showAudienceMembersBtn {
    min-height: var(--control-h);
    height: var(--control-h);
    padding: 10px 13px;
  }

  .campaigns-grid > .card {
    width: 100%;
  }

  .card + .card {
    margin-top: 10px;
  }

  th,
  td {
    font-size: 0.83rem;
  }

  .campaigns-table thead {
    display: none;
  }

  .campaigns-table,
  .campaigns-table tbody,
  .campaigns-table tr,
  .campaigns-table td {
    display: block;
    width: 100%;
  }

  .campaigns-wrap {
    border: none;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    margin-top: 8px;
  }

  .campaigns-table tbody {
    border: 1px solid var(--stroke-soft);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
  }

  .campaigns-table tr {
    border: none;
    border-bottom: 1px solid var(--stroke-soft);
    padding: 10px;
    margin: 0;
    background: rgba(255, 255, 255, 0.04);
  }

  .campaigns-table tr:first-child {
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
  }

  .campaigns-table tr:last-child {
    border-bottom: none;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
  }

  #pendingUsersTable thead {
    display: none;
  }

  #allUsersTable thead,
  #integrationsTable thead {
    display: none;
  }

  #allUsersTable,
  #allUsersTable tbody,
  #allUsersTable tr,
  #allUsersTable td,
  #integrationsTable,
  #integrationsTable tbody,
  #integrationsTable tr,
  #integrationsTable td {
    display: block;
    width: 100%;
  }

  #allUsersTable tr,
  #integrationsTable tr {
    border: none;
    border-bottom: 1px solid var(--stroke-soft);
    padding: 10px;
    margin: 0;
    background: rgba(255, 255, 255, 0.04);
  }

  #allUsersTable tr:last-child,
  #integrationsTable tr:last-child {
    border-bottom: none;
  }

  #allUsersTable td,
  #integrationsTable td {
    border-bottom: none;
    padding: 4px 0;
    white-space: normal;
  }

  #allUsersTable td::before,
  #integrationsTable td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 2px;
  }

  #integrationsTable .integration-actions-cell {
    display: grid;
    gap: 8px;
    padding-top: 8px;
  }

  #integrationsTable .integration-actions-cell .btn {
    width: 100%;
  }

  #pendingUsersTable,
  #pendingUsersTable tbody,
  #pendingUsersTable tr,
  #pendingUsersTable td {
    display: block;
    width: 100%;
  }

  #pendingUsersTable tr {
    border: none;
    border-bottom: 1px solid var(--stroke-soft);
    padding: 10px;
    margin: 0;
    background: rgba(255, 255, 255, 0.04);
  }

  #pendingUsersTable tr:last-child {
    border-bottom: none;
  }

  #pendingUsersTable td {
    border-bottom: none;
    padding: 4px 0;
    white-space: normal;
  }

  #pendingUsersTable td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 2px;
  }

  #pendingUsersTable .pending-user-actions-cell {
    padding-top: 8px;
    display: grid;
    gap: 8px;
  }

  #pendingUsersTable .pending-user-actions-cell .btn {
    width: 100%;
  }

  .campaigns-table tr:only-child {
    border-radius: 14px;
  }

  .campaigns-table td {
    border: none;
    padding: 5px 0;
    white-space: normal;
  }

  .campaigns-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    margin-bottom: 2px;
  }

  .campaigns-table td[data-label="Действия"] {
    margin-top: 6px;
  }

  .campaigns-table td[colspan] {
    text-align: center;
    padding: 6px 0;
  }

  .campaigns-table .campaign-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .campaigns-table .campaign-actions .btn {
    width: 100%;
    min-height: 36px;
  }

  .popup-overlay {
    padding: 14px;
  }

  .popup-modal {
    width: min(100%, 390px);
    border-radius: 16px;
    padding: 14px;
  }

  .popup-actions .btn {
    min-width: 98px;
  }
}
