/* ─── Design Tokens ─────────────────────────────────────────────── */
:root {
  --sidebar-bg:          #ffffff;
  --sidebar-border:      #e8ecf0;
  --sidebar-text:        #4a5568;
  --sidebar-active-bg:   #fff4ec;
  --sidebar-active-text: #f58220;
  --sidebar-hover-bg:    #f7f8fa;
  --sidebar-hover-text:  #2d3748;
  --card:                #ffffff;
  --bg:                  #f5f6fa;
  --bg-soft:             #f9fafc;
  --border:              #e2e8f0;
  --border-soft:         #edf0f5;
  --text:                #2d3748;
  --text-secondary:      #718096;
  --heading:             #1a202c;
  --muted:               #a0aec0;
  --accent:              #f58220;
  --accent-2:            #e0721a;
  --accent-soft:         #fff4ec;
  --accent-dark:         #d96b10;
  --success-bg:          #f0fdf4;
  --success-text:        #166534;
  --danger-bg:           #fef2f2;
  --danger-text:         #991b1b;
  --shadow-sm:           0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:              0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:           0 10px 30px rgba(0,0,0,0.10);
  --radius-sm:           6px;
  --radius:              10px;
  --radius-lg:           14px;
  --radius-xl:           18px;
  --transition:          0.15s ease;
}

/* ─── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Login ──────────────────────────────────────────────────────── */
.login-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #fff4ec 0%, #ffffff 50%, #fff8f3 100%);
}
.login-card {
  width: min(440px, 95vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.login-card .form-grid { grid-template-columns: 1fr; gap: 16px; padding: 0; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-brand img { width: 46px; height: 46px; border-radius: var(--radius); object-fit: cover; }
.login-brand h1 { margin: 0; font-size: 24px; font-weight: 700; color: var(--heading); }

/* ─── Layout ─────────────────────────────────────────────────────── */
.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

/* ─── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  width: 230px;
  min-width: 230px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.brand img { width: 36px; height: 36px; border-radius: var(--radius-sm); object-fit: cover; }
.brand-copy strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--heading);
}
.brand-copy span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.admin-email {
  display: none;
}
.admin-email-bottom {
  margin: 0;
  padding: 8px 16px 4px;
  font-size: 11px;
  color: var(--text-secondary);
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.8;
}
.admin-email-bottom::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}
.nav-spacer {
  flex: 1;
  min-height: 8px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 8px;
  flex: 1;
}
.nav a {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav a:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-hover-text);
  text-decoration: none;
}
.nav a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}
.nav > a:last-child { margin-top: auto; }
.nav > a:last-child:hover { color: #fc8181; background: rgba(220,38,38,0.15); }
.nav a { color: var(--sidebar-text); }


/* ─── New nav section labels and nav-items ───────────────────────── */
.nav-section-label {
  padding: 10px 16px 3px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-top: 2px;
}
.nav-item {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 6px 14px !important;
  border-radius: 8px;
  color: var(--sidebar-text) !important;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  margin: 0;
}
.nav-item:hover {
  background: var(--sidebar-hover-bg) !important;
  color: var(--sidebar-hover-text) !important;
  text-decoration: none;
}
.nav-item.active {
  background: var(--sidebar-active-bg) !important;
  color: var(--sidebar-active-text) !important;
  font-weight: 600;
}
.nav-icon { font-size: 14px; flex-shrink: 0; width: 18px; text-align: center; }
.nav-text { flex: 1; }
.nav-bottom { margin-top: 8px; }
.nav-logout { color: #dc2626 !important; }
.nav-logout:hover { background: #fef2f2 !important; color: #dc2626 !important; }



/* ─── listing-toolbar-v2: Left | Center | Right layout ─────────── */
.listing-toolbar-v2 {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 12px;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ltb-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: #6b7280;
  white-space: nowrap;
  flex: 1;
}
.ltb-left strong { color: #111827; }
.ltb-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
}
.ltb-center .search-input {
  flex: 1;
  min-width: 0;
  max-width: 340px;
}
.ltb-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 1;
}
.ltb-right .per-page-select {
  height: 34px;
  padding: 0 8px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.83rem;
  background: #fff;
  min-width: 56px;
  cursor: pointer;
}

/* ─── Table loading overlay ──────────────────────────────────────── */
.table-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 50;
  border-radius: inherit;
  min-height: 80px;
}
.table-loading-spinner {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: tl-bounce 1.2s infinite ease-in-out;
}
.tl-dot:nth-child(1) { animation-delay: 0s; }
.tl-dot:nth-child(2) { animation-delay: 0.2s; }
.tl-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes tl-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}
.tl-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* ─── Main Content ───────────────────────────────────────────────── */
.content {
  padding: 24px 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.page-intro { margin-bottom: 0; }
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  width: 100%;
}
.topbar h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--heading);
}
.page-subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 860px;
}

/* ─── CTA Row ────────────────────────────────────────────────────── */
.cta-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex-shrink: 0; }

/* ─── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.card-header h2, .card > h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--heading);
}

/* ─── Flash Messages ─────────────────────────────────────────────── */
.flash {
  border-radius: var(--radius);
  padding: 11px 40px 11px 14px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid;
  position: relative;
  transition: opacity .2s;
}
.flash.success { background: var(--success-bg); border-color: #bbf7d0; color: var(--success-text); }
.flash.error   { background: var(--danger-bg);  border-color: #fecaca; color: var(--danger-text); }
.flash-close {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 18px; line-height: 1;
  opacity: .5; padding: 2px 6px; border-radius: 4px; color: inherit;
}
.flash-close:hover { opacity: 1; background: rgba(0,0,0,.06); }

/* ─── Stats Grid ─────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(200px, 1fr)); gap: 14px; }
.stats-grid-2 { grid-template-columns: repeat(2, minmax(200px, 1fr)); }
.stats-grid-3 { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.stat-card {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card--tokens { background: linear-gradient(135deg, #fffbf7 0%, #fff4ec 100%); }
.stat-card__label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card__link { font-size: 12.5px; font-weight: 600; color: var(--accent-dark); margin-top: 4px; display: inline-block; }
.stat-value { font-size: 34px; font-weight: 800; margin: 4px 0; color: var(--heading); letter-spacing: -1px; line-height: 1; }
.muted { color: var(--muted); font-size: 12.5px; }

/* ─── Forms ──────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 16px; }
.form-full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; color: var(--heading); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13.5px;
  background: #fff;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.12);
}
textarea { min-height: 110px; resize: vertical; }

/* ─── Buttons ────────────────────────────────────────────────────── */
button, .button-link {
  width: auto;
  min-width: 110px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform 0.1s;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(245,130,32,0.25);
}
button:hover, .button-link:hover {
  background: var(--accent-2);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(245,130,32,0.30);
  transform: translateY(-1px);
}
button:active, .button-link:active { transform: translateY(0); }
.button-link.secondary, button.secondary {
  background: #fff;
  color: var(--text-secondary);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.button-link.secondary:hover, button.secondary:hover {
  background: var(--bg-soft);
  border-color: #cbd5e0;
  transform: translateY(-1px);
}
.button-link.ghost { background: var(--accent-soft); color: var(--accent-dark); border-color: #fcd3a8; box-shadow: none; }
.button-link.ghost:hover { background: #ffe5cc; box-shadow: none; }
.button-link.small-btn, button.small-btn {
  min-width: 0;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  box-shadow: none;
}
.button-link.small-btn:hover, button.small-btn:hover { transform: none; box-shadow: none; }
.inline { display: inline-flex; margin-right: 0; }
.inline button { width: auto; min-width: 0; }

/* ─── Filter Bar ─────────────────────────────────────────────────── */
.filter-card { padding: 16px 20px; background: var(--bg-soft); border-color: var(--border-soft); }
.filter-grid {
  display: grid;
  grid-template-columns: 2fr repeat(2, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.filter-grid.compact { grid-template-columns: repeat(2, minmax(160px, 1fr)) auto; }
.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.helper-text { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.filter-summary strong { color: var(--text); }

/* ─── Table ──────────────────────────────────────────────────────── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
}
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th, td {
  border-bottom: 1px solid var(--border-soft);
  padding: 10px 14px;
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
}
th {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--bg-soft);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fffbf7; }
.small { font-size: 12px; color: var(--muted); }
.url-cell { max-width: 220px; }
.url-link {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  font-size: 12.5px;
  color: var(--accent-dark);
}
.token-cell {
  display: inline-block;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 11.5px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 1px 6px;
}
/* Actions always on one row */
.table-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.table-actions a {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-dark);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  transition: background var(--transition);
  white-space: nowrap;
}
.table-actions a:hover { background: var(--accent-soft); text-decoration: none; border-color: #fcd3a8; }

/* ─── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1px;
  white-space: nowrap;
}
.badge.success { background: #dcfce7; color: #15803d; }
.badge.danger  { background: #fee2e2; color: #b91c1c; }
.badge.info    { background: #eff6ff; color: #1d4ed8; }
.badge.warning { background: #fef9c3; color: #854d0e; }

/* ─── Pagination ─────────────────────────────────────────────────── */
.pagination { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pagination a, .pagination span {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12.5px;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}
.pagination a:hover { background: var(--accent-soft); border-color: #fcd3a8; color: var(--accent-dark); }
.pagination .pg-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .pg-disabled { color: var(--muted); pointer-events: none; border-color: var(--border-soft); }
.pagination .pg-dots { border-color: transparent; background: transparent; min-width: 20px; padding: 0; color: var(--muted); }

/* ─── Empty State ────────────────────────────────────────────────── */
.empty-state { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 13px; }

/* ─── Misc ───────────────────────────────────────────────────────── */
.stat-small { font-size: 22px; font-weight: 700; line-height: 1.2; word-break: break-word; }
.helper-inline { margin-top: 6px; color: var(--muted); font-size: 12px; }

/* ─── Topic display in table ─────────────────────────────────────── */
/* Topics shown as comma-separated text with colour per status */
.topics-cell { font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }
.topic-name--sent    { color: #15803d; font-weight: 500; }
.topic-name--failed  { color: #b91c1c; font-weight: 500; }
.topic-name--pending { color: #1d4ed8; font-weight: 500; }

/* Sent count */
.sent-count { font-size: 12.5px; white-space: nowrap; }
.sent-count .ok  { color: #15803d; font-weight: 600; }
.sent-count .err { color: #b91c1c; font-weight: 600; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .content { padding: 20px 20px 30px; gap: 14px; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .filter-grid .action-col { grid-column: 1 / -1; }
  .stats-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; border-top: 1px solid var(--border); }
  .nav a { padding: 7px 11px; font-size: 13px; }
  .content { padding: 14px; gap: 12px; }
  .topbar { flex-direction: column; align-items: stretch; }
  .cta-row { width: 100%; }
  .stats-grid, .stats-grid-2, .stats-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar h1 { font-size: 20px; }
  .form-grid, .filter-grid, .filter-grid.compact { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .button-link, button { width: 100%; }
  .form-actions .button-link, .form-actions button,
  .table-actions a, .table-actions button,
  .cta-row .button-link,
  .filter-actions .button-link, .filter-actions button { width: auto; }
}

/* ─── Unified Filter Bar ─────────────────────────────────────────── */
.filter-bar { display: flex; flex-direction: column; gap: 0; }

/* each row inside the filter bar */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  flex-wrap: nowrap;   /* NEVER wrap — keep everything on one line */
}
.filter-row + .filter-row { border-top: 1px solid #e8eaed; }

.filter-label {
  font-weight: 600; font-size: .875rem; color: var(--text);
  white-space: nowrap; flex-shrink: 0; min-width: 70px;
}

/* date inputs */
.filter-row input[type="text"] {
  width: 138px; flex-shrink: 0;
  padding: 7px 10px; border: 1px solid #d0d5dd; border-radius: 6px;
  font-size: .875rem; color: var(--text); background: #fff;
  transition: border-color .15s;
}
.filter-row input[type="text"]:focus { outline: none; border-color: #f07a1a; }
.filter-row input[type="date"] {
  width: 148px; flex-shrink: 0;
  padding: 7px 8px; border: 1px solid #d0d5dd; border-radius: 6px;
  font-size: .875rem; color: var(--text); background: #fff;
  transition: border-color .15s;
}
.filter-row input[type="date"]:focus { outline: none; border-color: #f07a1a; }

/* search input — takes remaining space */
.filter-row input.search-input {
  width: auto; flex: 1 1 0; min-width: 160px; max-width: 420px;
}

.btn-submit {
  flex-shrink: 0;
  background: #f07a1a; color: #fff; border: none; border-radius: 6px;
  padding: 8px 22px; font-size: .875rem; font-weight: 600; cursor: pointer;
  transition: background .15s; white-space: nowrap;
}
.btn-submit:hover { background: #d96a0e; }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }

.btn-reset {
  flex-shrink: 0;
  background: #f07a1a; color: #fff; border: none; border-radius: 6px;
  padding: 8px 22px; font-size: .875rem; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-block;
  transition: background .15s; white-space: nowrap;
}
.btn-reset:hover { background: #d96a0e; }

/* quick-range radio pills */
.filter-row.quick-row { gap: 8px; }
.quick-radio-label {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid #d0d5dd; border-radius: 6px;
  padding: 6px 14px; font-size: .85rem; font-weight: 500;
  cursor: pointer; user-select: none; white-space: nowrap; flex-shrink: 0;
  transition: border-color .15s, background .15s;
  color: var(--text);
}
.quick-radio-label input[type="radio"] {
  accent-color: #9b59b6; cursor: pointer;
  flex-shrink: 0; margin: 0;
}
.quick-radio-label:hover { background: #fafafa; border-color: #aab; }
.quick-radio-label:has(input:checked) {
  border-color: #9b59b6; background: #f7f2fd;
}

/* processing indicator */
.filter-processing {
  display: none; align-items: center; gap: 7px;
  font-size: .82rem; color: #888; font-style: italic; flex-shrink: 0;
}
.filter-processing.visible { display: flex; }
.filter-processing .spinner {
  width: 13px; height: 13px; border: 2px solid #ddd;
  border-top-color: #f07a1a; border-radius: 50%;
  animation: filterSpin .6s linear infinite; flex-shrink: 0;
}
@keyframes filterSpin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .filter-row { flex-wrap: wrap; }
  .filter-row input[type="text"],
  .filter-row input[type="date"],
  .filter-row input.search-input { width: 100%; flex: 1 1 100%; max-width: none; }
  .quick-radio-label { flex: 1 1 calc(50% - 8px); justify-content: flex-start; }
}

/* ─── Filter Polish Overrides ───────────────────────────────────── */
.filter-card {
  padding: 18px 22px;
  overflow: visible;
}
.filter-bar { gap: 0; }
.filter-row {
  width: 100%;
  min-width: 0;
  gap: 12px;
}
.filter-row input[type="text"] {
  width: 150px;
  min-width: 150px;
  height: 38px;
}
.filter-row input[type="date"] {
  width: 148px;
  min-width: 148px;
  height: 38px;
}
.filter-row input.search-input {
  min-width: 260px;
  max-width: 520px;
  height: 38px;
}
.filter-row.quick-row {
  align-items: stretch;
  flex-wrap: wrap;
  gap: 10px;
}
.quick-radio-label {
  min-width: 132px;
  height: 38px;
  padding: 8px 14px;
  justify-content: center;
  gap: 8px;
  line-height: 1;
  overflow: visible;
}
.quick-radio-label input[type="radio"] {
  width: auto !important;
  min-width: 0 !important;
  height: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}
.quick-radio-label:has(input:checked) {
  color: #7c3aed;
  font-weight: 700;
}
.btn-submit,
.btn-reset {
  height: 38px;
  min-width: 104px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(245,130,32,0.24);
}
.filter-processing { min-height: 38px; }
.stat-value[title] { cursor: help; }
@media (max-width: 980px) {
  .filter-row { flex-wrap: wrap; }
  .filter-row input[type="text"],
  .filter-row input[type="date"],
  .filter-row input.search-input {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: 1 1 220px;
  }
}
@media (max-width: 520px) {
  .quick-radio-label { flex: 1 1 100%; justify-content: flex-start; }
  .btn-submit,
  .btn-reset { width: 100%; }
}

/* ─── Centered listing filters ───────────────────────────────────── */
.filter-card .filter-bar {
  width: 100%;
}
.filter-card .filter-row {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
}
.filter-card .filter-row.quick-row {
  justify-content: center;
  gap: 18px;
}
.filter-card .quick-radio-label {
  margin: 0 2px;
}
@media (min-width: 1100px) {
  .filter-card .filter-row.quick-row {
    gap: 22px;
  }
}

/* ─── Listing filter alignment updates ───────────────────────────── */
.filter-card .filter-row.date-row,
.filter-card .filter-row.quick-row {
  max-width: 1050px;
  margin-left: auto;
  margin-right: auto;
}
.filter-card .filter-row.quick-row {
  justify-content: center;
  gap: 4rem;
}
.filter-card .filter-row.search-row {
  max-width: 1050px;
  margin-left: auto;
  margin-right: auto;
  justify-content: flex-end;
  gap: 12px;
}
.filter-row.search-row .search-input {
  flex: 0 1 520px;
  max-width: 520px;
}
.per-page-select {
  height: 36px;
  width: auto;
  min-width: 110px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}
.per-page-select.country-select {
  width: 220px;
  min-width: 200px;
  max-width: 240px;
  flex: 0 0 220px;
  font-weight: 500;
}
@media (max-width: 980px) {
  .filter-card .filter-row.quick-row { justify-content: center; }
  .filter-card .filter-row.search-row { justify-content: stretch; }
  .filter-row.search-row .search-input { flex: 1 1 100%; max-width: none; }
}



/* ─── Tokens listing unified filter ──────────────────────────────── */
.tokens-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 0;
}
.tokens-filter-row--top {
  justify-content: space-between;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.tokens-filter-row--filters {
  gap: 16px;
  flex-wrap: wrap;
}
.tokens-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.tokens-meta strong { color: var(--text); }
.tokens-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.token-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.token-filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
}
.token-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
  margin-top: 4px;
}

/* ─── OR divider between filter rows ─────────────────────────────── */
.filter-or-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.filter-or-row::before,
.filter-or-row::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}
.filter-or-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.06em;
}

/* ─── Listing toolbar: totals on left, search/per-page on right ───── */
.listing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.listing-summary-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  min-width: 220px;
}
.listing-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 1 1 520px;
  max-width: 760px;
  margin-left: auto;
}
.listing-controls .search-input {
  height: 38px;
  flex: 1 1 360px;
  min-width: 260px;
  max-width: 560px;
  padding: 7px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: .875rem;
  color: var(--text);
  background: #fff;
}
.listing-controls .search-input:focus {
  outline: none;
  border-color: #f07a1a;
}
.listing-controls .per-page-select {
  min-width: 110px;
  width: auto;
}
.listing-controls .clear-search {
  min-width: 74px;
  height: 38px;
  padding-left: 14px;
  padding-right: 14px;
}
@media (max-width: 980px) {
  .listing-toolbar { align-items: stretch; }
  .listing-summary-meta { width: 100%; }
  .listing-controls {
    width: 100%;
    max-width: none;
    margin-left: 0;
    flex: 1 1 100%;
  }
  .listing-controls .search-input {
    min-width: 0;
    max-width: none;
  }
}
@media (max-width: 640px) {
  .listing-controls { flex-wrap: wrap; }
  .listing-controls .search-input { flex: 1 1 100%; }
  .listing-controls .btn-submit { flex: 1 1 auto; }
}

/* Prevent orange glow on checkbox/radio focus — only text inputs need it */
input[type="checkbox"]:focus,
input[type="radio"]:focus {
  box-shadow: none;
  border-color: var(--border);
  outline: revert;
}

/* ── Icon Buttons (added for action columns) ── */
.icon-btn {
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; border-radius:7px; border:1px solid #e5e7eb;
  background:#fff; color:#374151; cursor:pointer; font-size:15px;
  text-decoration:none; transition:background .12s, border-color .12s;
  vertical-align:middle;
}
.icon-btn:hover { background:#f3f4f6; border-color:#d1d5db; text-decoration:none; }
.icon-btn.primary { background:#4f46e5; color:#fff; border-color:#4f46e5; }
.icon-btn.primary:hover { background:#4338ca; }
.icon-btn.danger { background:#fee2e2; color:#991b1b; border-color:#fecaca; }
.icon-btn.danger:hover { background:#fecaca; }
.table-actions { display:flex; align-items:center; gap:6px; flex-wrap:nowrap; }

/* ─── Country Stats Topbar (summary left + filters right) ─────── */
/* ─── Country Stats header row (stats left + filters right) ─────── */
.cs-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cs-stat-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cs-inline-item {
  font-size: 0.9rem;
  color: #374151;
}
.cs-inline-item strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}
.cs-inline-sep {
  color: #d1d5db;
  font-size: 1rem;
  font-weight: 300;
}
.cs-stat-boxes {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}
.cs-summary-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 24px;
  min-width: 130px;
}
.cs-summary-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #9ca3af;
}
.cs-summary-val {
  font-size: 1.6rem;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}
.cs-filter-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}
/* Country dropdown — wider so names aren't truncated */
.cs-select-country {
  height: 38px;
  padding: 0 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.86rem;
  background: #fff;
  min-width: 220px;
  max-width: 260px;
  cursor: pointer;
}
/* Source dropdown — compact */
.cs-select-source {
  height: 38px;
  padding: 0 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.86rem;
  background: #fff;
  min-width: 140px;
  max-width: 160px;
  cursor: pointer;
}
.cs-select-country:focus,
.cs-select-source:focus { outline: none; border-color: #4f46e5; }
.cs-btn-search {
  height: 38px;
  padding: 0 22px;
  background: #f97316;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.86rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s;
}
.cs-btn-search:hover { background: #ea580c; }
.cs-btn-reset {
  height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  background: #f3f4f6;
  color: #374151;
  border-radius: 8px;
  font-size: 0.86rem;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s;
}
.cs-btn-reset:hover { background: #e5e7eb; text-decoration: none; }

/* ─── Tokens listing filter bar ─────────────────────────────────── */
.tok-filter-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.tok-filter-left {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}
.tok-filter-right {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.tok-filter-grp {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tok-filter-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
}
.tok-filter-grp select {
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.84rem;
  background: #fff;
  min-width: 120px;
  cursor: pointer;
}
.tok-filter-grp select:focus { outline: none; border-color: #4f46e5; }
.tok-apply-btn {
  height: 36px;
  padding: 0 18px;
  background: #f97316;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  align-self: flex-end;
  transition: background .15s;
}
.tok-apply-btn:hover { background: #ea580c; }
.tok-reset-btn {
  height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  background: #f3f4f6;
  color: #374151;
  border-radius: 8px;
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  align-self: flex-end;
  transition: background .15s;
}
.tok-reset-btn:hover { background: #e5e7eb; text-decoration: none; }
.tok-per-page {
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.85rem;
  background: #fff;
  min-width: 60px;
  cursor: pointer;
}
.tok-per-page:focus { outline: none; border-color: #4f46e5; }

/* ─── Country Stats toolbar ─────────────────────────────────────── */
.cs-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cs-filter-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}
.cs-perpage-form {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.cs-sel {
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.85rem;
  background: #fff;
  cursor: pointer;
}
.cs-sel:focus { outline: none; border-color: #4f46e5; }
.cs-sel-src { min-width: 130px; }
.cs-sel-pp  { min-width: 60px; }
.cs-filter-center .cs-sel { min-width: 200px; }
.cs-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  color: #374151;
  flex-shrink: 0;
  text-decoration: none;
  transition: background .12s, border-color .12s;
}
.cs-icon-btn[type="submit"] { background: #f97316; border-color: #f97316; color: #fff; }
.cs-icon-btn[type="submit"]:hover { background: #ea580c; }
.cs-reset-btn { color: #ef4444; border-color: #fecaca; background: #fff; }
.cs-reset-btn:hover { background: #fee2e2; text-decoration: none; }

/* ─── Dashboard — Metric Cards ───────────────────────────────────── */
.metrics-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:24px; }
@media(max-width:1100px){ .metrics-grid{ grid-template-columns:repeat(2,1fr); } }
@media(max-width:600px){ .metrics-grid{ grid-template-columns:1fr; } }
.metric-card {
  background:#fff; border:1px solid #f0f0f0; border-radius:12px;
  padding:18px 20px; text-decoration:none; color:inherit; display:block;
  transition:box-shadow .15s, transform .12s;
}
.metric-card:hover { box-shadow:0 4px 18px rgba(0,0,0,.08); transform:translateY(-2px); text-decoration:none; }
.metric-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.metric-icon { width:36px; height:36px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.metric-icon.violet  { background:#ede9fe; }
.metric-icon.emerald { background:#d1fae5; }
.metric-icon.sky     { background:#e0f2fe; }
.metric-icon.orange  { background:#ffedd5; }
.metric-trend { font-size:0.72rem; font-weight:700; padding:3px 8px; border-radius:20px; }
.metric-trend.up      { background:#d1fae5; color:#065f46; }
.metric-trend.neutral { background:#f3f4f6; color:#6b7280; }
.metric-value { font-size:1.9rem; font-weight:700; color:#111827; line-height:1; margin-bottom:4px; }
.metric-label { font-size:0.82rem; color:#374151; font-weight:700; }
.metric-sub   { font-size:0.72rem; color:#9ca3af; margin-top:3px; }

/* ─── Dashboard — Charts Row ─────────────────────────────────────── */
.charts-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-bottom:16px; }
@media(max-width:1100px){ .charts-row{ grid-template-columns:1fr 1fr; } }
@media(max-width:700px){ .charts-row{ grid-template-columns:1fr; } }
.chart-panel { background:#fff; border:1px solid #f0f0f0; border-radius:12px; padding:20px 22px; }
.chart-panel-header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:18px; }
.chart-panel-title { font-size:0.92rem; font-weight:700; color:#111827; margin:0 0 2px; }
.chart-panel-sub   { font-size:0.72rem; color:#9ca3af; font-weight:600; }
.chart-link {
  font-size:0.75rem; font-weight:600; color:#4f46e5; text-decoration:none;
  white-space:nowrap; padding:4px 10px; border:1px solid #e0e7ff; border-radius:7px; transition:background .12s;
}
.chart-link:hover { background:#ede9fe; text-decoration:none; }

/* ─── Dashboard — Bar Chart ──────────────────────────────────────── */
.bar-area { display:flex; align-items:flex-end; gap:5px; height:200px; }
.bar-col  { display:flex; flex-direction:column; align-items:center; flex:1; }
.bar-fill { width:100%; border-radius:4px 4px 0 0; min-height:3px; cursor:default; position:relative; transition:opacity .12s; }
.bar-fill:hover { opacity:.82; }
.bar-fill::after {
  content:attr(data-tip); display:none; position:absolute;
  bottom:calc(100% + 4px); left:50%; transform:translateX(-50%);
  background:#111827; color:#fff; font-size:0.68rem; font-weight:600;
  padding:3px 7px; border-radius:5px; white-space:nowrap; pointer-events:none;
}
.bar-fill:hover::after { display:block; }
.bar-label { font-size:0.62rem; color:#9ca3af; margin-top:5px; text-align:center; }
.bars-blue  .bar-fill { background:#4f46e5; }
.bars-green .bar-fill { background:#059669; }
.bars-amber .bar-fill { background:#d97706; }

/* ─── Dashboard — Recent Notifications Table ─────────────────────── */
.recent-panel { background:#fff; border:1px solid #f0f0f0; border-radius:12px; padding:20px 22px; margin-bottom:24px; }
.recent-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.recent-title-with-sub { display:flex; flex-direction:column; gap:2px; }
.recent-title { font-size:0.92rem; font-weight:700; color:#111827; }
.title-cell   { max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:0.84rem; }
.recent-table { width:100%; border-collapse:collapse; }
.recent-table th { font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:#6b7280; padding:0 10px 10px 0; text-align:left; border-bottom:1px solid #f3f4f6; }
.recent-table td { padding:11px 10px 11px 0; border-bottom:1px solid #f9f9f9; vertical-align:middle; }
.recent-table tr:last-child td { border-bottom:none; }
.recent-table td:first-child { font-size:0.85rem; font-weight:500; color:#111827; max-width:260px; }
.recent-table td.num   { font-size:0.82rem; color:#374151; font-weight:600; }
.recent-table td.muted { font-size:0.78rem; color:#9ca3af; }
.status-pill { display:inline-block; padding:2px 9px; border-radius:20px; font-size:0.7rem; font-weight:600; }
.pill-sent    { background:#d1fae5; color:#065f46; }
.pill-pending { background:#fef3c7; color:#92400e; }
.pill-failed  { background:#fee2e2; color:#991b1b; }

/* ─── Dashboard — Bottom Two-Column Row ──────────────────────────── */
.bottom-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media(max-width:900px){ .bottom-row{ grid-template-columns:1fr; } }
.mini-panel { background:#fff; border:1px solid #f0f0f0; border-radius:12px; padding:20px 22px; }
.mini-panel-title { font-size:0.88rem; font-weight:700; color:#111827; margin-bottom:14px; }
.pie-wrap { position:relative; height:200px; display:flex; align-items:center; justify-content:center; }
.pie-legend { margin-top:10px; display:flex; flex-wrap:wrap; gap:6px 14px; }
.pie-legend-item { display:flex; align-items:center; gap:5px; font-size:0.74rem; color:#374151; font-weight:500; }
.pie-legend-dot  { width:10px; height:10px; border-radius:50%; flex-shrink:0; }

/* ─── Media input: URL / OR / Upload stack ───────────────────────── */
.media-pair { display:flex; flex-direction:column; gap:0; border:1.5px solid #e5e7eb; border-radius:10px; overflow:hidden; }
.media-url-field { padding:12px 14px 14px; background:#fff; }
.media-url-field input { margin-bottom:0 !important; }
.media-or-divider { display:flex; align-items:center; gap:10px; padding:0 14px; height:30px; background:#fafafa; border-top:1px solid #e5e7eb; border-bottom:1px solid #e5e7eb; }
.media-or-divider::before, .media-or-divider::after { content:""; flex:1; height:1px; background:#e5e7eb; }
.media-or-divider span { font-size:0.68rem; font-weight:700; color:#9ca3af; letter-spacing:.06em; }
.media-upload-field { padding:12px 14px 14px; background:#fff; }
.media-sub-label { font-size:0.78rem; color:#6b7280; margin-bottom:4px; display:block; }

/* ─── Stats summary grid (notification stats pages) ─────────────── */
.stats-summary-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:16px; margin-bottom:4px; }
.stat-box { background:#f8f9fb; border:1px solid #e8eaed; border-radius:10px; padding:16px 20px; text-align:center; }
.stat-box .stat-value { font-size:1.75rem; font-weight:700; line-height:1.1; color:var(--text); }
.stat-box .stat-value.success { color:#1a8a3c; }
.stat-box .stat-value.danger  { color:#c0392b; }
.stat-box .stat-value.info    { color:#1a6fa8; }
.stat-box .stat-label { font-size:.78rem; font-weight:600; letter-spacing:.03em; text-transform:uppercase; color:#888; margin-top:4px; }
.stat-box .stat-hint  { font-size:.7rem; color:#bbb; margin-top:2px; }

/* ─── Country bar chart rows ────────────────────────────────────── */
.chart-bar-row { display:flex; align-items:center; gap:10px; margin-bottom:7px; }
.chart-bar-label { width:140px; font-size:.82rem; font-weight:600; text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--text); flex-shrink:0; }
.chart-bar-track { flex:1; background:#f0f2f5; border-radius:6px; height:22px; overflow:hidden; }
.chart-bar-fill  { height:100%; border-radius:6px; background:#4f46e5; }
.chart-bar-count { width:50px; font-size:.82rem; font-weight:700; color:#555; }
.chart-bar-row:nth-child(1)  .chart-bar-fill { background:#4f46e5; }
.chart-bar-row:nth-child(2)  .chart-bar-fill { background:#0ea5e9; }
.chart-bar-row:nth-child(3)  .chart-bar-fill { background:#10b981; }
.chart-bar-row:nth-child(4)  .chart-bar-fill { background:#f59e0b; }
.chart-bar-row:nth-child(5)  .chart-bar-fill { background:#ef4444; }
.chart-bar-row:nth-child(6)  .chart-bar-fill { background:#8b5cf6; }
.chart-bar-row:nth-child(7)  .chart-bar-fill { background:#ec4899; }
.chart-bar-row:nth-child(8)  .chart-bar-fill { background:#14b8a6; }
.chart-bar-row:nth-child(9)  .chart-bar-fill { background:#f97316; }
.chart-bar-row:nth-child(10) .chart-bar-fill { background:#6366f1; }

/* ─── Shared form helpers ────────────────────────────────────────── */
.form-label { display:block; font-size:13px; font-weight:600; color:#374151; margin-bottom:6px; }
.form-input { width:100%; border:1px solid #d1d5db; border-radius:8px; padding:9px 12px; font-size:13.5px; background:#fff; color:var(--text); transition:border-color .15s, box-shadow .15s; }
.form-input:focus { outline:none; border-color:#4f46e5; box-shadow:0 0 0 3px rgba(79,70,229,.1); }
textarea.form-input { min-height:100px; resize:vertical; }
.form-field { margin-bottom:0; }
.preview-img { max-height:80px; border-radius:8px; margin-top:8px; display:none; }

/* ─── Duration radio selector (create notification forms) ────────── */
.duration-radios { display:flex; gap:24px; margin-bottom:14px; flex-wrap:wrap; }
.duration-radios label { display:flex; align-items:center; gap:7px; font-size:.9rem; font-weight:500; color:#374151; cursor:pointer; }
.duration-radios input[type="radio"] { cursor:pointer; width:16px; height:16px; accent-color:#4f46e5; width:auto !important; min-width:0 !important; }
#duration-input-wrap { max-width:320px; }

/* ─── Back arrow button (stats / detail pages) ───────────────────── */
.back-arrow-btn { display:inline-flex; align-items:center; gap:6px; font-size:0.88rem; font-weight:600; color:#6b7280; text-decoration:none; padding:6px 0; margin-bottom:8px; transition:color .15s; }
.back-arrow-btn:hover { color:#111827; text-decoration:none; }
.back-arrow-btn svg { width:18px; height:18px; }
