/* TEKAN ADS — Design System */
@import url("/static/fonts/estedad/estedad.css");

:root {
  --bg: #05070B;
  --surface-1: #0B1220;
  --surface-2: #111827;
  --card: #161F2F;
  --panel: #161F2F;
  --panel2: #1c2740;
  --primary: #7C3AED;
  --primary-2: #A855F7;
  --accent: #FACC15;
  --accent2: #7C3AED;
  --text: #FFFFFF;
  --text-secondary: #BFC3CF;
  --muted: #81889A;
  --text-disabled: #5D6373;
  --success: #38BDF8;
  --danger: #F472B6;
  --warning: #FACC15;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 24px;
  --radius-sm: 16px;
  --radius-pill: 999px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.25);
  --font-main: "Estedad Variable", "Estedad", system-ui, sans-serif;
  --fs-scale: 1.12;
  --glass: rgba(22, 31, 47, 0.72);
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: calc(16px * var(--fs-scale));
  font-family: var(--font-main);
}

body {
  margin: 0;
  direction: rtl;
  text-align: right;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 430;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  background: var(--bg);
  color: var(--text-secondary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Ambient background glows */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-glow::before,
.bg-glow::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.18;
}
.bg-glow::before {
  width: 520px;
  height: 520px;
  background: var(--primary);
  top: -120px;
  left: -80px;
}
.bg-glow::after {
  width: 420px;
  height: 420px;
  background: var(--accent);
  bottom: -100px;
  right: 10%;
}

/* Campaign list */
.campaign-list-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; font-weight: 430; line-height: 1.55; }
.campaign-list-table th, .campaign-list-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: top;
}
.campaign-list-table th { color: var(--muted); font-weight: 500; font-size: 0.8125rem; }
.campaign-list-table tr.selected { background: rgba(124, 58, 237, 0.12); }
.campaign-list-table .recipients-col { max-width: 280px; color: var(--muted); font-size: 0.8125rem; line-height: 1.5; }
.campaign-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.35;
}
.campaign-status.status-active { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }
.campaign-status.status-waiting { background: rgba(250, 204, 21, 0.15); color: #fde047; }
.campaign-status.status-completed { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.campaign-status.status-paused { background: rgba(244, 114, 182, 0.12); color: #f9a8d4; }
.campaign-status.status-inactive { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }
.placeholder-btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.placeholder-btn-row .btn-sm { padding: 5px 10px; font-size: 0.85rem; }

input, textarea, select, button, .btn, .nav-btn {
  font-family: inherit;
}


h1 {
  font-size: 2.125rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

h2 {
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: -0.006em;
  color: var(--text-secondary);
}

h3 {
  font-size: 0.9375rem;
  font-weight: 560;
  line-height: 1.4;
  color: var(--text-secondary);
}

.brand {
  font-weight: 560;
  letter-spacing: 0;
}

.btn, .nav-btn {
  font-weight: 560;
  letter-spacing: 0;
}

code, pre, kbd, samp {
  font-family: var(--font-main);
}

.layout {
  display: flex;
  min-height: 100vh;
  direction: rtl;
  position: relative;
  z-index: 1;
}

/* ─── Sidebar ─── */
.sidebar {
  width: 280px;
  margin: 16px;
  margin-left: 0;
  padding: 24px 16px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 8px 10px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 14px;
  box-shadow: var(--shadow-glow);
  object-fit: cover;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand small,
.brand-sub {
  display: block;
  color: var(--muted);
  font-weight: 420;
  font-size: 0.75rem;
  line-height: 1.45;
}

#user-badge {
  font-size: 0.8125rem;
  font-weight: 420;
  color: var(--muted);
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  line-height: 1.6;
}

.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: right;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 450;
  line-height: 1.35;
  transition: all var(--transition);
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.75;
}

.nav-btn:hover {
  background: rgba(124, 58, 237, 0.1);
  color: var(--text);
  border-color: rgba(124, 58, 237, 0.2);
  transform: translateX(-2px);
}

.nav-btn:hover svg { opacity: 1; }

.nav-group {
  margin-bottom: 6px;
}

.nav-group-toggle {
  justify-content: flex-start;
}

.nav-group-toggle .nav-chevron {
  margin-right: auto;
  width: 16px;
  height: 16px;
  transition: transform var(--transition);
}

.nav-group.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-submenu {
  display: none;
  padding-right: 8px;
  margin-bottom: 4px;
}

.nav-group.open .nav-submenu {
  display: block;
}

.nav-btn.nav-sub {
  font-size: 0.8125rem;
  font-weight: 450;
  padding: 10px 14px 10px 12px;
  margin-bottom: 4px;
}

.nav-btn.nav-sub svg {
  width: 18px;
  height: 18px;
}

#nav-finance-group .nav-submenu {
  padding-right: 12px;
}

.nav-btn.nav-sub--nested {
  font-size: 0.8125rem;
  font-weight: 420;
  padding: 8px 12px 8px 10px;
}

.nav-group .nav-group-toggle.nav-sub {
  margin-bottom: 4px;
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35) 0%, rgba(168, 85, 247, 0.2) 100%);
  border-color: rgba(124, 58, 237, 0.45);
  color: var(--text-primary);
  font-weight: 560;
  box-shadow: none;
}

.nav-btn.active svg {
  opacity: 1;
  color: var(--primary-2);
}

.nav-btn--logout {
  margin-top: auto;
  color: var(--danger) !important;
}

.nav-btn--logout:hover {
  background: rgba(244, 114, 182, 0.12);
  border-color: rgba(244, 114, 182, 0.3);
}

/* ─── Main & Header ─── */
.main-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px 16px 16px 0;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  margin-bottom: 20px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
  position: relative;
  z-index: 4000;
}

.app-header-search {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
  position: relative;
}

.app-header-search input {
  width: 100%;
  padding: 12px 44px 12px 16px;
  background: rgba(5, 7, 11, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.app-header-search input:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.app-header-search svg {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.channel-status-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(5, 7, 11, 0.35);
}

.channel-icon-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.channel-icon-halo {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--transition), box-shadow var(--transition);
  pointer-events: none;
}

.channel-icon-wrap.is-connected .channel-icon-halo {
  opacity: 1;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.35) 0%, rgba(52, 211, 153, 0.08) 55%, transparent 72%);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.55);
}

.channel-icon-wrap.is-disconnected .channel-icon-halo {
  opacity: 1;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.28) 0%, rgba(244, 114, 182, 0.06) 55%, transparent 72%);
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.45);
}

.channel-icon {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter var(--transition), transform var(--transition);
}

.channel-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.channel-icon--whatsapp svg path { fill: #25D366; }
.channel-icon--telegram svg path { fill: #2AABEE; }
.channel-icon--bale svg path { fill: #2DB782; }

.channel-icon-wrap.is-disconnected .channel-icon {
  filter: grayscale(1) opacity(0.42);
}

.channel-icon-wrap.is-connected .channel-icon {
  filter: none;
}

.channel-icon-wrap:hover .channel-icon {
  transform: scale(1.08);
}

.channel-icon-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  box-shadow: var(--shadow);
  z-index: 10;
}

.channel-icon-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(15, 23, 42, 0.96);
}

.channel-icon-wrap:hover .channel-icon-tooltip,
.channel-icon-wrap:focus-within .channel-icon-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(5, 7, 11, 0.4);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.icon-btn:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.4);
  transform: scale(1.05);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 10px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
}

.user-chip-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
  font-size: 0.75rem;
  color: var(--bg);
}

.status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
}

.status-chip.offline {
  background: rgba(244, 114, 182, 0.1);
  border-color: rgba(244, 114, 182, 0.25);
}

.status-chip.proxy-direct {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}

.status-chip.proxy-direct .pulse-dot {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

.main {
  flex: 1;
  overflow: auto;
  position: relative;
  z-index: 1;
}

.main > section {
  animation: fadeInUp 0.4s ease both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.header h1 {
  margin: 0;
  font-size: 2.125rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.dashboard-section-title {
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.28;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.dashboard-section-title--platform {
  color: var(--primary-2);
}

/* ─── Cards & Panels ─── */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.panel h2 {
  margin-top: 0;
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: -0.006em;
  color: var(--text-secondary);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: linear-gradient(145deg, var(--surface-2) 0%, var(--card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeInUp 0.45s ease both;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: -20px;
  left: -20px;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), transparent);
  opacity: 0.25;
  border-radius: 50%;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.stat-card .stat-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(124, 58, 237, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-2);
}

.stat-card .stat-trend {
  font-size: 0.75rem;
  color: var(--success);
  padding: 4px 8px;
  background: rgba(56, 189, 248, 0.12);
  border-radius: var(--radius-pill);
}

.stat-card .label {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 560;
  line-height: 1.4;
  margin-bottom: 6px;
}

.stat-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.stat-card .sub {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  margin-top: 8px;
}

/* ─── Campaign Hero ─── */
.campaign-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(22, 31, 47, 0.9) 50%);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.campaign-ring {
  width: 100px;
  height: 100px;
  position: relative;
}

.campaign-ring svg {
  transform: rotate(-90deg);
}

.campaign-ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.campaign-hero-meta h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.campaign-hero-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.campaign-hero-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.campaign-hero-stat strong {
  font-size: 1rem;
}

.campaign-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.chip--active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--success);
  border-color: rgba(56, 189, 248, 0.3);
}

.chip--paused {
  background: rgba(250, 204, 21, 0.12);
  color: var(--accent);
  border-color: rgba(250, 204, 21, 0.3);
}

.chip--off {
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
}

.campaign-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─── Info boxes ─── */
.info-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
}

.info-label {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.info-value {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: pre-line;
}

.countdown-timer {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.012em;
  color: var(--primary-2);
  margin-top: 8px;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* ─── Charts ─── */
.dashboard-charts-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.chart-cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  min-height: 300px;
}

.chart-cell--pie { min-height: 300px; }

.chart-title {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.chart-pie-wrap,
.apex-chart {
  min-height: 260px;
}

/* ─── System widgets ─── */
.system-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.sys-widget {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  transition: transform var(--transition);
}

.sys-widget:hover { transform: translateY(-2px); }

.sys-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sys-widget-title {
  font-size: 0.88rem;
  font-weight: 600;
}

.sys-widget-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

.pulse-dot.off { background: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.5); }
  50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
}

.pulse-dot.off { animation-name: pulseOff; }

@keyframes pulseOff {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(244, 114, 182, 0.5); }
  50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(244, 114, 182, 0); }
}

.sys-widget-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
}

/* ─── Buttons ─── */
.btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 24px;
  cursor: pointer;
  font-weight: 560;
  font-size: 0.875rem;
  line-height: 1.35;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.btn:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.45);
}

.btn.success,
.btn.danger {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.btn.secondary,
.btn.success.secondary,
.btn.danger.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(250, 204, 21, 0.4);
  box-shadow: none;
}

.btn.secondary:hover,
.btn.success.secondary:hover,
.btn.danger.secondary:hover {
  background: rgba(250, 204, 21, 0.1);
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.15);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ─── Forms ─── */
label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 8px;
}

input, textarea, select {
  width: 100%;
  background: rgba(5, 7, 11, 0.5);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 430;
  line-height: 1.55;
  transition: border-color var(--transition);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  font-weight: 420;
  opacity: 0.75;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.5);
}

textarea { min-height: 110px; resize: vertical; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 16px;
}

.perm-grid label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.perm-grid input[type="checkbox"] {
  margin-top: 3px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.test-message-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.dashboard-future-quick-grid {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 2fr minmax(180px, 1fr);
  gap: 12px;
  align-items: start;
}

.dashboard-future-quick textarea {
  min-height: 72px;
}

.test-content-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.test-image-picker {
  padding-top: 2px;
}

.test-caption-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(5, 7, 11, 0.42);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.test-caption-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.test-caption-row input[type="checkbox"] {
  width: auto;
  accent-color: var(--primary);
}

.test-caption-help {
  display: block;
  padding-inline-start: 28px;
}

.test-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.campaign-message-editor {
  display: grid;
  grid-template-columns: 1fr;
}

.rotation-variants-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rotation-variant-item label {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--muted);
}

.rotation-variant-item textarea {
  width: 100%;
  min-height: 100px;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  resize: vertical;
}

.hidden { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 8, 16, 0.72);
  backdrop-filter: blur(4px);
}
.modal.hidden { display: none !important; pointer-events: none; }
.modal-content {
  width: min(520px, 95vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}


/* ─── Tables ─── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-weight: 430;
  line-height: 1.55;
}

th, td {
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8125rem;
  line-height: 1.35;
}

td {
  font-weight: 430;
}

tr:hover td { background: rgba(124, 58, 237, 0.04); }

/* ─── Badges ─── */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.35;
}

.badge.lead { background: rgba(124, 58, 237, 0.2); color: var(--primary-2); }
.badge.invalid { background: rgba(244, 114, 182, 0.15); color: var(--danger); }
.badge.blacklist { background: rgba(148, 163, 184, 0.15); color: var(--muted); }
.badge.ok { background: rgba(56, 189, 248, 0.15); color: var(--success); }

/* ─── Status dot ─── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 6px;
}

.status-dot.on { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.off { background: var(--danger); }

/* ─── Notifications ─── */
.notif-wrap { position: relative; z-index: 4100; }
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.notif-panel {
  position: fixed;
  width: min(360px, 90vw);
  max-height: 420px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  z-index: 50000;
}
.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0;
}
.status-mode-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.status-datetime-preview {
  margin: 8px 0 0;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--muted);
  min-height: 1.4em;
}
.status-datetime-preview.is-past {
  color: var(--warning);
}
input[type="datetime-local"] {
  min-width: 220px;
}
.notif-list {
  overflow-y: auto;
  max-height: 360px;
}
.notif-item {
  display: block;
  width: 100%;
  text-align: right;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  background: transparent;
  color: inherit;
  font: inherit;
  transition: background var(--transition), border-color var(--transition);
}
.notif-item--link {
  cursor: pointer;
  text-align: right;
}
.notif-item--link .notif-item-title {
  color: var(--text);
}
.notif-item--link:hover .notif-item-title {
  color: var(--accent);
}
.notif-item--link:hover {
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.12);
}
.notif-item--link:focus-visible {
  outline: 2px solid rgba(124, 58, 237, 0.45);
  outline-offset: -2px;
}
.notif-item:hover { background: rgba(124, 58, 237, 0.08); }
.notif-item.unread { background: rgba(124, 58, 237, 0.06); }
.notif-item--link.unread .notif-item-title { color: var(--accent); }
.notif-item-title { font-weight: 600; font-size: 0.88rem; margin-bottom: 4px; }
.notif-item-body { color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.notif-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.notif-item-time { color: var(--muted); font-size: 0.72rem; }
.notif-item-action {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.notif-item--link:hover .notif-item-action { text-decoration: underline; }
.notif-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 0.85rem; }

tr.row-highlight td {
  background: rgba(250, 204, 21, 0.12);
  animation: row-highlight-pulse 1.2s ease 2;
}
@keyframes row-highlight-pulse {
  0%, 100% { background: rgba(250, 204, 21, 0.12); }
  50% { background: rgba(250, 204, 21, 0.22); }
}

.payment-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.payment-status.pending { background: rgba(250, 204, 21, 0.15); color: #facc15; }
.payment-status.approved { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.payment-status.rejected { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* ─── Subscription plans grid ─── */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1024px) {
  .plans-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .plans-grid { grid-template-columns: 1fr; }
}
.plan-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(145deg, var(--surface-2) 0%, var(--card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: right;
}
.plan-card-body { flex: 1 1 auto; }
.plan-card-name {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}
.plan-card-price-main {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
}
.plan-card-price-sub {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}
.plan-card-discount {
  color: var(--accent);
  font-size: 0.8rem;
  min-height: 1.4em;
  margin-bottom: 10px;
}
.plan-card-desc {
  color: var(--muted);
  font-size: 0.85rem;
  min-height: 40px;
  margin: 0 0 10px;
}
.plan-card-features {
  color: var(--muted);
  font-size: 0.82rem;
  padding-right: 18px;
  margin: 0 0 12px;
}
.plan-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.plan-card-footer .btn {
  width: 100%;
}

/* ─── Support tickets ─── */
.ticket-thread {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding: 4px 0;
}
.ticket-msg {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.6;
}
.ticket-msg.admin {
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.25);
  margin-left: 24px;
}
.ticket-msg.user {
  background: rgba(255,255,255,0.03);
  margin-right: 24px;
}
.ticket-msg-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.ticket-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.ticket-status.open { background: rgba(33,150,243,0.15); color: #64b5f6; }
.ticket-status.in_progress { background: rgba(255,193,7,0.15); color: #ffd54f; }
.ticket-status.closed { background: rgba(158,158,158,0.15); color: #bdbdbd; }

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  z-index: 9999;
  font-size: 0.9rem;
}

/* ─── Calendar / misc ─── */
.day-chip, .country-chip {
  display: inline-block;
  padding: 8px 14px;
  margin: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
}

.day-chip.active, .country-chip.active {
  background: rgba(124, 58, 237, 0.25);
  border-color: var(--primary);
  color: var(--text);
}

.segment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent);
  font-size: 0.82rem;
  background: rgba(0, 200, 150, 0.08);
}

.segment-chip--sm {
  padding: 2px 8px;
  font-size: 0.78rem;
}

.ajax-multi-select {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg, var(--card));
  padding: 6px 8px;
  min-height: 42px;
}

.ajax-multi-select-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.ajax-multi-select-chips:empty {
  margin-bottom: 0;
}

.ajax-multi-select-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent);
  font-size: 0.82rem;
  background: rgba(0, 200, 150, 0.1);
}

.ajax-multi-select-chip button {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 2px;
  font-size: 1rem;
  line-height: 1;
}

.ajax-multi-select-chip button:hover {
  color: var(--danger, #ff6b6b);
}

.ajax-multi-select-input-wrap {
  position: relative;
}

.ajax-multi-select-input-wrap input {
  border: none;
  background: transparent;
  width: 100%;
  padding: 4px 2px;
  outline: none;
}

.ajax-multi-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.ajax-multi-select-dropdown li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.88rem;
}

.ajax-multi-select-dropdown li:hover,
.ajax-multi-select-dropdown li.active {
  background: rgba(124, 58, 237, 0.15);
}

.ajax-multi-select-dropdown li.muted {
  color: var(--muted);
  cursor: default;
}

.ajax-multi-select-dropdown li.muted:hover {
  background: transparent;
}

.field-suggest-wrap {
  position: relative;
}

.field-suggest-dropdown {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.field-suggest-dropdown li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
}

.field-suggest-dropdown li:hover,
.field-suggest-dropdown li.active {
  background: rgba(99, 102, 241, 0.12);
}

.field-suggest-dropdown li.muted {
  color: var(--muted);
  cursor: default;
}

.field-suggest-dropdown li.muted:hover {
  background: transparent;
}

.field-suggest-dropdown .suggest-count {
  color: var(--muted);
  font-size: 0.82rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.cal-day {
  min-height: 108px;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition);
}

.cal-day:hover { border-color: var(--primary); }

.cal-day.empty {
  opacity: 0.2;
  pointer-events: none;
  min-height: 0;
  background: transparent;
}

.cal-day.today {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.35);
}

.cal-day.posted { border-color: rgba(56, 189, 248, 0.45); }

.cal-day .num {
  font-weight: 700;
  font-size: 0.82rem;
  text-align: center;
}

.cal-day .date-line {
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
}

.cal-day-thumbs,
.cal-table-thumbs {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}

.cal-day-thumbs { margin-top: 2px; }

.cal-thumb {
  flex: 1;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--muted);
  position: relative;
}

.cal-table-thumbs .cal-thumb {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  aspect-ratio: auto;
}

.cal-thumb img,
.cal-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cal-thumb.empty { opacity: 0.45; }

.chp-form-thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  min-width: 96px;
  max-width: 96px;
  aspect-ratio: 1;
}

.chp-form-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.cal-thumb-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  font-size: 0.55rem;
  line-height: 1;
}

.cal-day-meta {
  margin-top: auto;
  text-align: center;
  font-size: 0.68rem;
  color: var(--muted);
}

.cal-day .badge {
  align-self: center;
  font-size: 0.62rem;
  padding: 2px 8px;
  white-space: nowrap;
}

.status-cal-table-wrap {
  overflow: auto;
  max-height: 420px;
}

.status-cal-table {
  table-layout: fixed;
  width: 100%;
}

.status-cal-table th,
.status-cal-table td {
  vertical-align: top;
}

.status-cal-table .col-day { width: 72px; }
.status-cal-table .col-date { width: 110px; }
.status-cal-table .col-media { width: 148px; }
.status-cal-table .col-status { width: 96px; }
.status-cal-table .col-actions { width: 110px; }

.status-cal-table .status-edit-btn {
  padding: 4px 8px;
  font-size: 0.75rem;
  margin: 2px;
  display: inline-block;
}

.cal-caption-cell {
  font-size: 0.82rem;
  line-height: 1.5;
  max-height: 130px;
  overflow-y: auto;
  word-break: break-word;
}

.cal-day.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.mode-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  cursor: pointer;
}

.mode-option input {
  width: auto;
  accent-color: var(--primary);
}

.campaign-channel-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
  padding: 14px 16px;
  background: rgba(5, 7, 11, 0.42);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.campaign-channel-card .mode-option {
  color: var(--text);
  font-weight: 700;
  margin: 0;
}

#cal-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 11, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#cal-modal:not(.hidden) { display: flex; }
#cal-modal.hidden { pointer-events: none; }

#chp-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 11, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#chp-modal:not(.hidden) { display: flex; }
#chp-modal.hidden { pointer-events: none; }

#cust-edit-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 11, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#cust-edit-modal:not(.hidden) { display: flex; }
#cust-edit-modal.hidden { pointer-events: none; }

#status-item-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 11, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

#status-item-modal:not(.hidden) { display: flex; }
#status-item-modal.hidden { pointer-events: none; }

.status-cal-table [data-edit-status-day],
.status-cal-table .cal-thumb[data-edit-status-day] {
  cursor: pointer;
}

.status-cal-table .cal-caption-cell .btn-link {
  text-align: right;
  width: 100%;
}

.status-item-preview-click {
  cursor: pointer;
  max-width: 220px;
}

.status-item-preview-click .cal-thumb {
  min-height: 120px;
  border: 2px dashed var(--border);
  transition: border-color 0.15s;
}

.status-item-preview-click:hover .cal-thumb {
  border-color: var(--accent);
}

.cal-modal-panel {
  width: 420px;
  max-width: 95vw;
  pointer-events: auto;
}

.cal-modal-wide { width: min(720px, 95vw); }

.cal-items-editor { max-height: 50vh; overflow: auto; }

.cal-item-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
}

.cal-row-today { background: rgba(124, 58, 237, 0.08); }

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ─── Login page ─── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: min(440px, 92vw);
  background: var(--glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
}

.login-card .brand { margin-bottom: 24px; }

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  .dashboard-charts-row { grid-template-columns: 1fr; }
  .campaign-hero { grid-template-columns: 1fr; text-align: center; }
  .campaign-hero-actions { flex-direction: row; justify-content: center; }
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
    min-height: 100vh;
  }

  .dashboard-future-quick-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .test-message-grid { grid-template-columns: 1fr; }
  .test-caption-row { gap: 6px; }
  .test-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .test-actions .btn { width: 100%; }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .main-shell {
    width: 100%;
    max-width: 100%;
    padding: 8px 12px 12px;
    flex: 1;
    min-width: 0;
  }

  body.mobile-nav-open .main-shell {
    pointer-events: none;
  }

  .mobile-top-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 200;
    margin-bottom: 10px;
  }

  .app-header {
    z-index: 20;
    position: relative;
    padding: 10px 12px;
    margin-bottom: 12px;
    gap: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .app-header-search {
    order: 2;
    min-width: 0;
    max-width: none;
    width: 100%;
    flex: 1 1 auto;
  }

  .app-header-actions {
    order: 1;
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .app-header-search input {
    font-size: 0.8125rem;
    padding: 10px 40px 10px 12px;
  }

  .channel-status-icons {
    gap: 4px;
    padding: 2px 6px;
  }

  .channel-icon-wrap {
    width: 34px;
    height: 34px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    bottom: 0;
    width: min(320px, 92vw);
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: 56px 16px 24px;
    z-index: 10020;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    border-radius: 0;
    border: none;
    border-left: 1px solid var(--border);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.5);
    transform: translate3d(100%, 0, 0);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s;
    overflow-y: auto;
    overflow-x: hidden;
    visibility: hidden;
    pointer-events: none;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10010;
  }

  body.mobile-nav-open .sidebar {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-sidebar-close {
    display: inline-flex;
    top: 12px;
    left: 12px;
    right: auto;
  }

  .nav-btn {
    width: 100%;
    flex: none;
    min-width: 0;
  }

  .nav-btn span {
    flex: 1;
    min-width: 0;
    text-align: right;
  }

  .nav-group-toggle .nav-chevron {
    flex-shrink: 0;
  }

  .brand {
    margin-bottom: 14px;
    padding-top: 4px;
  }

  .page-loading-skeleton:not(.hidden) {
    display: block;
  }
}

@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .test-message-panel {
    border-radius: 18px;
    padding: 18px;
  }
  .test-message-grid,
  .test-content-box,
  .test-image-picker {
    width: 100%;
  }
  .test-caption-row label {
    white-space: normal;
  }
  .test-caption-help {
    padding-inline-start: 0;
  }

  .page-skeleton-cards {
    grid-template-columns: 1fr;
  }

  .user-chip span,
  #header-user-name {
    display: none;
  }

  .proxy-direct {
    display: none !important;
  }
}

.media-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.media-file-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}
.media-file-preview {
  aspect-ratio: 4 / 3;
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-file-preview img,
.media-file-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-doc-icon {
  font-size: 2.5rem;
}
.media-file-meta {
  padding: 10px;
}
.media-file-name {
  font-size: 0.85rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-file-size {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

/* ─── Feature gates & upsell ─── */
.feature-upgrade-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 32px 20px;
}
.feature-upgrade-card {
  max-width: 420px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.feature-upgrade-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: rgba(124, 58, 237, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.feature-upgrade-card h2 { margin: 0 0 10px; font-size: 1.15rem; }
.feature-upgrade-card p { color: var(--muted); line-height: 1.8; margin: 0 0 8px; }
.feature-upgrade-hint { font-size: 0.85rem; color: var(--accent); margin-bottom: 20px !important; }
.feature-upsell-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.feature-upsell-head h2 { margin: 0 0 6px; font-size: 1.05rem; }
.feature-upsell-head p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.feature-upsell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.feature-upsell-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px dashed rgba(124, 58, 237, 0.35);
  border-radius: var(--radius);
  background: rgba(124, 58, 237, 0.05);
}
.feature-upsell-lock { font-size: 1.25rem; flex-shrink: 0; }
.feature-upsell-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.feature-upsell-body strong { font-size: 0.92rem; }
.feature-upsell-body span { color: var(--muted); font-size: 0.78rem; }
.invoice-summary { margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); }
.invoice-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 0.9rem; }
.invoice-line--discount strong { color: var(--accent); }
.invoice-line--total { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 0.95rem; }
.invoice-line--total strong { color: var(--success, #22c55e); }

/* ─── Mobile navigation & page transitions ─── */
@media (min-width: 901px) {
  .mobile-top-bar,
  .mobile-nav-backdrop,
  .mobile-sidebar-close,
  .page-loading-skeleton {
    display: none !important;
  }
}

.mobile-top-bar {
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(124, 58, 237, 0.12);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}

.mobile-menu-btn:hover {
  background: rgba(124, 58, 237, 0.22);
  border-color: rgba(124, 58, 237, 0.35);
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

.mobile-top-bar__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mobile-page-label {
  font-size: 0.6875rem;
  color: var(--muted);
  font-weight: 420;
}

.mobile-page-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10010;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.mobile-nav-backdrop:not(.hidden) {
  display: block;
  pointer-events: auto;
}

body.mobile-nav-open .mobile-nav-backdrop:not(.hidden) {
  opacity: 1;
}

.mobile-sidebar-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  z-index: 5;
  transition: all var(--transition);
}

.mobile-sidebar-close:hover {
  color: var(--text);
  background: rgba(124, 58, 237, 0.15);
}

.mobile-sidebar-close svg {
  width: 18px;
  height: 18px;
}

.page-loading-skeleton {
  padding: 16px;
  margin-bottom: 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.page-skeleton-line,
.page-skeleton-card {
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    rgba(124, 58, 237, 0.08) 0%,
    rgba(168, 85, 247, 0.18) 50%,
    rgba(124, 58, 237, 0.08) 100%
  );
  background-size: 200% 100%;
  animation: pageSkeletonShimmer 1.3s ease-in-out infinite;
}

.page-skeleton-line {
  height: 12px;
  margin-bottom: 10px;
}

.page-skeleton-line--title {
  height: 18px;
  width: 42%;
  margin-bottom: 14px;
}

.page-skeleton-line--wide { width: 88%; }
.page-skeleton-line--short { width: 56%; margin-bottom: 16px; }

.page-skeleton-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.page-skeleton-card {
  height: 72px;
}

.main > section.page-enter {
  animation: pageFadeIn 0.34s ease;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pageSkeletonShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
