/* ============================================================================
   MAGIC MESSAGE — Dark Premium design system (v3)
   Deliberately distinct from ManyChat (flat green/dark) and QuickDM: a true
   dark-navy canvas throughout (not just the sidebar), a violet→pink gradient
   identity, glowing accent borders instead of hard shadows, geometric display
   type, and small entrance animations - reads as a premium, AI-native product.
   ============================================================================ */

:root {
  --ink: #05060D;          /* deepest navy - sidebar */
  --ink-border: rgba(255,255,255,0.08);

  --bg: #0B0D18;            /* main canvas - dark navy */
  --surface: #12142380;
  --surface-solid: #131529;
  --surface-2: #1B1D36;     /* elevated / hover surface */
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);

  --accent-1: #8B5CF6;      /* violet */
  --accent-2: #EC4899;      /* pink */
  --accent-3: #FF4FA0;      /* hot pink - alerts / highlights */
  --accent-cyan: #22D3EE;
  --accent-warn: #FBBF24;
  --accent-green: #34D399;

  --text: #F3F4FA;
  --muted: #9497B8;
  --faint: #6C6F92;

  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;

  --shadow-sm: 0 2px 14px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.55);
  --glow-violet: 0 0 0 1px rgba(139,92,246,0.35), 0 8px 30px rgba(139,92,246,0.18);

  --gradient-brand: linear-gradient(120deg, #7C4DFF 0%, #A855F7 45%, #EC4899 100%);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 8% 0%, rgba(139,92,246,0.10) 0%, transparent 40%),
    radial-gradient(circle at 95% 30%, rgba(236,72,153,0.08) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text);
}

h1, h2, h3, h4, h5, .display-font { font-family: 'Space Grotesk', 'Inter', sans-serif; letter-spacing: -0.01em; color: var(--text); }

a { color: var(--accent-1); }
.text-muted { color: var(--muted) !important; }
.text-dark { color: var(--text) !important; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeSlideUp .45s ease both; }
.fade-in-1 { animation-delay: .05s; }
.fade-in-2 { animation-delay: .12s; }
.fade-in-3 { animation-delay: .19s; }
.fade-in-4 { animation-delay: .26s; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; position: relative; }

.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--ink);
  color: rgba(255,255,255,0.66);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 200;
  border-right: 1px solid var(--ink-border);
}

.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 6px 10px 24px; }

.brand-badge {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--gradient-brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; box-shadow: 0 4px 20px rgba(139,92,246,0.55);
}
.brand-badge-lg { width: 60px; height: 60px; border-radius: 18px; font-size: 1.8rem; }

.brand-text { color: #fff; font-weight: 700; font-size: 1.1rem; font-family: 'Space Grotesk', sans-serif; }
.brand-sub { color: rgba(255,255,255,0.4); font-size: 0.68rem; text-transform: uppercase; letter-spacing: .08em; margin-top: -2px; }

.sidebar-nav { list-style: none; padding: 0; margin: 0 0 4px; }
.sidebar-nav-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: .09em;
  color: rgba(255,255,255,0.28); padding: 14px 14px 6px;
}
.sidebar-nav-bottom { margin-top: auto; border-top: 1px solid var(--ink-border); padding-top: 10px; }

.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 13px; border-radius: 12px;
  color: rgba(255,255,255,0.62); text-decoration: none;
  font-weight: 500; font-size: 0.9rem; margin-bottom: 2px;
  transition: background .15s, color .15s;
  position: relative;
}
.sidebar-nav .nav-link i { font-size: 1.02rem; width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav .nav-link.active {
  background: linear-gradient(90deg, rgba(139,92,246,0.28), rgba(236,72,153,0.10));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent-1);
}
.sidebar-nav .disabled-link { opacity: .35; cursor: not-allowed; }
.nav-badge {
  margin-left: auto; font-size: .64rem; font-weight: 700; padding: 2px 7px;
  border-radius: 999px; background: var(--accent-cyan); color: #06231F;
}

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(2,2,8,0.7); z-index: 190; }

/* ---------- Main / Topbar ---------- */
.app-main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 70px;
  background: rgba(11,13,24,0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  padding: 0 30px; position: sticky; top: 0; z-index: 100;
}

.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-solid); border: 1px solid var(--border);
  border-radius: 999px; padding: 9px 16px; width: 340px; color: var(--muted);
}
.topbar-search input { border: none; background: transparent; outline: none; width: 100%; font-size: 0.9rem; font-family: inherit; color: var(--text); }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-solid); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.sidebar-toggle { border: 1px solid var(--border); }
.icon-btn-sm { width: 28px; height: 28px; border-radius: 8px; border: none; background: transparent; color: var(--muted); }
.icon-btn-sm:hover { color: var(--accent-3); }

.user-chip {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--border);
  background: var(--surface-solid); padding: 5px 12px 5px 6px; border-radius: 999px;
}
.user-chip:hover { border-color: var(--border-strong); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-avatar-fallback { background: var(--gradient-brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.user-name { font-weight: 600; font-size: 0.88rem; color: var(--text); }

.app-content { padding: 30px 34px 64px; max-width: 1480px; }

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.page-header h1 { font-size: 1.65rem; font-weight: 700; margin-bottom: 3px; }
.page-header .eyebrow { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--accent-2); margin-bottom: 4px; display: block; }


.btn-brand {
  background: var(--gradient-brand); border: none; color: #fff; font-weight: 600;
  padding: 10px 20px; border-radius: 12px; box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .12s;
}
.btn-brand:hover { color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline-secondary { border-radius: 12px; border-color: var(--border-strong); color: var(--muted); font-weight: 600; }
.btn-outline-secondary:hover { background: var(--bg); border-color: var(--border-strong); color: var(--text); }
.btn-outline-danger { border-radius: 12px; font-weight: 600; }

/* ---------- Hero / Command Center banner ---------- */
.hero-banner {
  background: var(--ink);
  border-radius: var(--radius-lg);
  padding: 34px 36px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 26px;
  box-shadow: var(--shadow-lg);
}
.hero-banner::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(139,92,246,0.5) 0%, rgba(139,92,246,0) 45%),
    radial-gradient(circle at 85% 85%, rgba(236,72,153,0.32) 0%, rgba(236,72,153,0) 50%);
}
.hero-banner > * { position: relative; z-index: 1; }
.hero-banner h1 { color: #fff; }
.hero-banner p { color: rgba(255,255,255,0.68); }
.hero-banner .btn-light-ghost {
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22);
  color: #fff; font-weight: 600; border-radius: 12px; padding: 10px 18px;
  backdrop-filter: blur(6px);
}
.hero-banner .btn-light-ghost:hover { background: rgba(255,255,255,0.2); color: #fff; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
  padding: 5px 12px; border-radius: 999px; font-size: .76rem; font-weight: 600; color: #fff;
}

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.stat-card {
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm); transition: box-shadow .18s, transform .18s, border-color .18s;
}
.stat-card:hover { box-shadow: var(--glow-violet); transform: translateY(-2px); border-color: rgba(139,92,246,0.4); }

.stat-icon {
  width: 48px; height: 48px; border-radius: 15px; display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; color: #fff; flex-shrink: 0;
}
.stat-icon-green  { background: linear-gradient(135deg,#22D3EE,#34D399); }
.stat-icon-blue   { background: linear-gradient(135deg,#7C4DFF,#A855F7); }
.stat-icon-purple { background: linear-gradient(135deg,#A855F7,#EC4899); }
.stat-icon-orange { background: linear-gradient(135deg,#FBBF24,#FB923C); }

.stat-value { font-size: 1.55rem; font-weight: 700; line-height: 1.1; font-family: 'Space Grotesk', sans-serif; }
.stat-value-sub { font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.stat-label { color: var(--muted); font-size: 0.83rem; margin-top: 3px; font-weight: 500; }
.stat-trend { font-size: .74rem; font-weight: 700; margin-left: auto; }
.stat-trend.up { color: var(--accent-green); }
.stat-trend.down { color: var(--accent-3); }

/* ---------- Panels ---------- */
.panel { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.panel-header h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.panel-header p.subtitle { font-size: .82rem; color: var(--muted); margin: 2px 0 0; }
.panel-link { font-size: 0.85rem; color: var(--accent-2); text-decoration: none; font-weight: 700; }

.app-table { margin-bottom: 0; color: var(--text); }
.app-table thead th {
  border-bottom: 1px solid var(--border); color: var(--faint); font-size: 0.74rem;
  text-transform: uppercase; letter-spacing: .05em; font-weight: 700; padding-bottom: 10px;
}
.app-table td { vertical-align: middle; padding: 13px 8px; border-color: var(--border); font-size: 0.9rem; }

.badge { font-weight: 700; padding: 5px 12px; border-radius: 999px; font-size: 0.72rem; letter-spacing: .01em; }
.badge-active { background: rgba(52,211,153,0.15); color: #4ADE80; }
.badge-paused { background: rgba(251,191,36,0.15); color: #FBBF24; }
.badge-draft  { background: rgba(255,255,255,0.08); color: var(--muted); }
.badge-tag    { background: rgba(139,92,246,0.18); color: #C4B5FD; }
.badge-hot    { background: rgba(236,72,153,0.18); color: #F9A8D4; }
.badge-warm   { background: rgba(251,191,36,0.15); color: #FBBF24; }
.badge-cold   { background: rgba(255,255,255,0.08); color: var(--faint); }

.empty-state { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty-state i { font-size: 2.4rem; margin-bottom: 12px; display: block; color: var(--accent-1); opacity: .6; }

.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.contact-list li:last-child { border-bottom: none; }
.contact-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--gradient-brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}

/* ---------- Card grids (templates, media, generic) ---------- */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.template-card {
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); transition: box-shadow .18s, transform .18s, border-color .18s;
}
.template-card:hover { box-shadow: var(--glow-violet); transform: translateY(-2px); border-color: rgba(139,92,246,0.4); }
.template-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.template-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.template-card p { font-size: 0.85rem; margin-bottom: 14px; min-height: 40px; color: var(--muted); }
.template-card-footer { border-top: 1px solid var(--border); padding-top: 10px; }

/* ---------- Instagram connection ---------- */
.connect-hero {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(139,92,246,0.06) 0%, transparent 100%);
  padding: 50px 24px; text-align: center;
}
.connect-hero .ig-icon {
  width: 66px; height: 66px; border-radius: 22px;
  background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7);
  color: #fff; font-size: 1.9rem; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px; box-shadow: var(--shadow-md);
}
.ig-account-card { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.ig-status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-green); display: inline-block; margin-right: 6px; box-shadow: 0 0 0 3px rgba(52,211,153,0.2); }
.ig-avatar-ring {
  width: 60px; height: 60px; border-radius: 50%; padding: 2.5px;
  background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7);
  display: flex; align-items: center; justify-content: center;
}
.ig-avatar-ring img, .ig-avatar-ring .user-avatar-fallback { width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--ink); }

/* ---------- Login page ---------- */
.login-body {
  background:
    radial-gradient(circle at 15% 15%, rgba(139,92,246,0.55), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(236,72,153,0.4), transparent 45%),
    var(--ink);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif;
}
.login-wrapper { padding: 20px; width: 100%; max-width: 420px; }
.login-card { background: #fff; border-radius: var(--radius-lg); padding: 42px 34px; text-align: center; box-shadow: var(--shadow-lg); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 6px; }
.login-brand h1 { font-size: 1.55rem; font-weight: 700; margin: 0; color: #14151F; }
.login-subtitle { color: #6E7180; font-size: 0.92rem; margin-bottom: 28px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 13px;
  border: 1.5px solid #DCDEF0; border-radius: 12px; font-weight: 700; color: #14151F;
  text-decoration: none; transition: box-shadow .15s, border-color .15s;
}
.google-btn:hover { box-shadow: var(--shadow-sm); border-color: var(--accent-1); color: #14151F; }
.login-fineprint { margin-top: 24px; font-size: 0.78rem; color: #A2A4B8; }
.login-fineprint a { color: #6E7180; }

/* ---------- Builder ---------- */
.step-badge {
  width: 28px; height: 28px; border-radius: 10px; background: rgba(139,92,246,0.18); color: #C4B5FD;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; margin-right: 8px;
}
.phone-preview { border: 6px solid var(--ink); border-radius: 32px; overflow: hidden; max-width: 300px; margin: 0 auto; box-shadow: var(--shadow-lg); background: #fff; }

/* ---------- AI-native components (new) ---------- */

/* Smart Inbox */
.inbox-shell { display: grid; grid-template-columns: 320px 1fr; gap: 0; background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); min-height: 560px; }
.inbox-list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 720px; }
.inbox-list-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; transition: background .12s; }
.inbox-list-item:hover { background: var(--surface-2); }
.inbox-list-item.active { background: rgba(139,92,246,0.16); }
.inbox-thread { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 72%; padding: 11px 15px; border-radius: 16px; font-size: .9rem; line-height: 1.45; }
.bubble-in { background: var(--surface-2); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; color: var(--text); }
.bubble-out { background: var(--gradient-brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble-meta { font-size: .68rem; color: var(--faint); margin-top: 4px; }

/* Copilot suggestion card */
.copilot-card {
  border: 1px solid rgba(139,92,246,0.35); background: linear-gradient(180deg, rgba(139,92,246,0.10) 0%, rgba(236,72,153,0.05) 100%);
  border-radius: var(--radius); padding: 16px 18px;
}
.copilot-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700;
  color: #C4B5FD; background: rgba(139,92,246,0.2); padding: 4px 10px; border-radius: 999px; margin-bottom: 10px;
}

/* Lead score ring */
.score-ring {
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem; color: #fff; flex-shrink: 0;
}

/* Radar list item urgency bar */
.urgency-bar { width: 4px; border-radius: 4px; align-self: stretch; flex-shrink: 0; }

/* Keyword chips (Comment Intelligence) */
.keyword-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; margin: 3px; color: var(--text); }
.keyword-chip .count { color: var(--accent-2); font-weight: 700; }

/* ---------- Upgrade modal ---------- */
.upgrade-modal .modal-content {
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  color: var(--text); overflow: hidden;
}
.upgrade-modal-hero {
  background: var(--gradient-brand); padding: 34px 30px 26px; text-align: center; position: relative;
}
.upgrade-modal-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 0%, rgba(255,255,255,0.25), transparent 60%);
}
.upgrade-modal-hero > * { position: relative; z-index: 1; }
.upgrade-modal-icon {
  width: 64px; height: 64px; border-radius: 20px; background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: #fff;
  margin: 0 auto 14px; backdrop-filter: blur(6px);
}
.upgrade-modal-hero h3 { color: #fff; font-weight: 700; margin-bottom: 6px; }
.upgrade-modal-hero p { color: rgba(255,255,255,0.85); margin-bottom: 0; font-size: .92rem; }
.upgrade-plan-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px;
  transition: border-color .15s, background .15s;
}
.upgrade-plan-row:hover { border-color: rgba(139,92,246,0.5); background: rgba(139,92,246,0.06); }
.upgrade-plan-row.featured { border-color: var(--accent-1); background: rgba(139,92,246,0.1); }

/* ---------- Usage meters (limits shown clearly) ---------- */
.usage-meter-label { display: flex; justify-content: space-between; font-size: .82rem; font-weight: 600; margin-bottom: 6px; }
.usage-meter-label .count { color: var(--muted); font-weight: 500; }
.usage-meter-track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.usage-meter-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .inbox-shell { grid-template-columns: 1fr; }
  .inbox-list { max-height: 320px; }
}

@media (max-width: 768px) {
  .sidebar { position: fixed; left: -280px; transition: left .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { left: 0; }
  .sidebar-overlay.show { display: block; }
  .app-content { padding: 18px; }
  .stat-grid { grid-template-columns: 1fr; }
  .topbar-search { width: 150px; }
  .topbar { padding: 0 16px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero-banner { padding: 26px 20px; }
}

/* ---------- Admin: accounts & limits (scoped - nothing else is affected) ---------- */
.admin-page .admin-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 26px 0 18px; }
.admin-page .admin-search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 10px;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; color: var(--muted);
}
.admin-page .admin-search input { background: transparent; border: none; outline: none; color: var(--text); width: 100%; font-size: .92rem; }
.admin-page .admin-search:focus-within { border-color: rgba(139,92,246,0.55); box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }

.admin-filter { display: inline-flex; gap: 6px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 14px; padding: 4px; }
.admin-filter button {
  background: transparent; border: none; color: var(--muted); font-weight: 600; font-size: .82rem;
  padding: 7px 14px; border-radius: 10px; transition: background .15s, color .15s;
}
.admin-filter button:hover { color: var(--text); }
.admin-filter button.active { background: var(--gradient-brand); color: #fff; }

.account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 18px; }

.account-card {
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow-sm); transition: border-color .18s, box-shadow .18s, transform .18s;
}
.account-card:hover { border-color: rgba(139,92,246,0.4); box-shadow: var(--glow-violet); transform: translateY(-2px); }
.account-card.is-pending { border-style: dashed; border-color: var(--border-strong); }

.account-head { display: flex; align-items: center; gap: 14px; }
.account-avatar {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--gradient-brand); color: #fff; font-weight: 700; font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem;
}
.account-card.is-pending .account-avatar { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border-strong); }
.account-identity { min-width: 0; flex-grow: 1; }
.account-name { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-email { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.meter-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.meter-label { display: flex; justify-content: space-between; font-size: .76rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; gap: 8px; }
.meter-label strong { color: var(--text); font-weight: 700; }
.meter-track { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--gradient-brand); transition: width .4s ease; }
.meter-fill.warn { background: var(--accent-warn); }
.meter-fill.full { background: var(--accent-3); }

.limit-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.limit-form label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 5px; }

.admin-page .form-control, .admin-modal .form-control {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; font-size: .9rem;
}
.admin-page .form-control::placeholder, .admin-modal .form-control::placeholder { color: var(--faint); }
.admin-page .form-control:focus, .admin-modal .form-control:focus {
  background: var(--surface-2); color: var(--text); border-color: rgba(139,92,246,0.6); box-shadow: 0 0 0 3px rgba(139,92,246,0.18);
}

.account-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.account-actions .btn { font-size: .78rem; padding: 6px 12px; }
.account-actions form { margin: 0; }
.account-pending-note { color: var(--muted); font-size: .8rem; display: flex; align-items: center; gap: 8px; }

.admin-modal .modal-content { background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); color: var(--text); }
.admin-modal .modal-header, .admin-modal .modal-footer { border-color: var(--border); }
.admin-modal .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }
.admin-modal .form-check-input { background-color: var(--surface-2); border-color: var(--border-strong); }
.admin-modal .form-check-input:checked { background-color: var(--accent-1); border-color: var(--accent-1); }
.admin-modal label.form-label { font-size: .78rem; font-weight: 700; color: var(--muted); }

.admin-empty { grid-column: 1 / -1; }

@media (max-width: 992px) { .account-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .meter-pair { grid-template-columns: 1fr; }
  .limit-form { grid-template-columns: 1fr 1fr; }
  .limit-form .btn { grid-column: 1 / -1; }
  .account-head { flex-wrap: wrap; }
  .account-badges { justify-content: flex-start; width: 100%; }
}

/* ---------- Admin: three limits per account, trial line (override earlier 2-column layout) ---------- */
.admin-page .meter-pair { grid-template-columns: 1fr; gap: 12px; }
.admin-page .limit-form { grid-template-columns: repeat(3, 1fr); }
.admin-page .limit-form .btn { grid-column: 1 / -1; }
.account-trial-line {
  display: flex; gap: 8px; align-items: flex-start; font-size: .78rem; color: var(--muted);
  background: rgba(34,211,238,0.07); border: 1px solid rgba(34,211,238,0.18); border-radius: 12px; padding: 9px 12px;
}
.account-trial-line i { color: var(--accent-cyan); margin-top: 2px; }
.account-trial-line.ended { background: rgba(236,72,153,0.08); border-color: rgba(236,72,153,0.22); }
.account-trial-line.ended i { color: var(--accent-3); }
@media (max-width: 520px) { .admin-page .limit-form { grid-template-columns: 1fr; } }

/* ---------- Free-trial banner ---------- */
.trial-banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(120deg, rgba(34,211,238,0.10), rgba(139,92,246,0.14));
  border: 1px solid rgba(34,211,238,0.28); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 22px;
}
.trial-banner.warn { background: linear-gradient(120deg, rgba(251,191,36,0.10), rgba(139,92,246,0.14)); border-color: rgba(251,191,36,0.35); }
.trial-banner.ended { background: linear-gradient(120deg, rgba(236,72,153,0.14), rgba(139,92,246,0.14)); border-color: rgba(236,72,153,0.4); }
.trial-banner-icon {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--gradient-brand); color: #fff; font-size: 1.1rem;
}
.trial-banner-body { flex: 1 1 260px; min-width: 0; }
.trial-banner-title { font-weight: 700; font-family: 'Space Grotesk', sans-serif; color: var(--text); }
.trial-banner-text { font-size: .84rem; color: var(--muted); margin-top: 2px; }
.trial-progress { height: 5px; border-radius: 999px; background: rgba(255,255,255,0.08); margin-top: 9px; overflow: hidden; max-width: 360px; }
.trial-progress > div { height: 100%; background: var(--gradient-brand); border-radius: 999px; }
@media (max-width: 576px) { .trial-banner .btn { width: 100%; } }
