/* ═══════════════════════════════════════════════════════════════════
   AURA Business Admin — admin.css
   Dark theme. Syne + Inter + DM Mono. On-brand with AURA Neural.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Dark theme (default) ───────────────────────────────────────── */
:root,
[data-theme="dark"] {
  --bg:        #07080f;
  --bg2:       #0d0f1a;
  --surface:   #111520;
  --surface2:  #181c2e;
  --surface3:  #1e2338;
  --border:    rgba(255,255,255,.07);
  --border2:   rgba(255,255,255,.12);
  --text:      #e8eaf2;
  --text2:     rgba(232,234,242,.6);
  --text3:     rgba(232,234,242,.32);
  --teal:      #2dd4bf;
  --teal2:     #0d9488;
  --teal-dim:  rgba(45,212,191,.12);
  --accent:    #818cf8;
  --accent2:   #6d28d9;
  --red:       #f87171;
  --orange:    #fb923c;
  --green:     #4ade80;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.55);
  --auth-bg:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(45,212,191,.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 80% 80%, rgba(129,140,248,.06) 0%, transparent 60%),
    var(--bg);
}

/* ── Light theme ────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:        #f4f5fb;
  --bg2:       #ecedf7;
  --surface:   #ffffff;
  --surface2:  #f0f1f8;
  --surface3:  #e8e9f4;
  --border:    rgba(0,0,0,.08);
  --border2:   rgba(0,0,0,.14);
  --text:      #0f1120;
  --text2:     rgba(15,17,32,.6);
  --text3:     rgba(15,17,32,.38);
  --teal:      #0d9488;
  --teal2:     #0f766e;
  --teal-dim:  rgba(13,148,136,.1);
  --accent:    #6d28d9;
  --accent2:   #5b21b6;
  --red:       #dc2626;
  --orange:    #ea580c;
  --green:     #16a34a;
  --shadow:    0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.12);
  --auth-bg:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(13,148,136,.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 80% 80%, rgba(109,40,217,.05) 0%, transparent 60%),
    var(--bg);
}

/* ── Shared tokens ──────────────────────────────────────────────── */
:root {
  --mono:      'DM Mono', monospace;
  --head:      'Syne', sans-serif;
  --body:      'Inter', sans-serif;
  --radius:    12px;
  --radius-sm: 8px;
  --sidebar-w: 220px;
  --transition: .18s ease;
}

/* ── Light theme overrides for specific components ──────────────── */
[data-theme="light"] .badge--green  { background: #dcfce7; color: #15803d; }
[data-theme="light"] .badge--blue   { background: #dbeafe; color: #1d4ed8; }
[data-theme="light"] .badge--purple { background: #ede9fe; color: #5b21b6; }
[data-theme="light"] .badge--orange { background: #ffedd5; color: #c2410c; }
[data-theme="light"] .badge--red    { background: #fee2e2; color: #b91c1c; }
[data-theme="light"] .badge--grey   { background: #e2e8f0; color: #64748b; }
[data-theme="light"] .flash--success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
[data-theme="light"] .flash--error   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
[data-theme="light"] .flash--info    { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }
[data-theme="light"] .form-error     { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
[data-theme="light"] .stat-card--warn { background: #fff7ed; }
[data-theme="light"] .card--warn      { background: #fffbeb; }
[data-theme="light"] .auth-error   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
[data-theme="light"] .auth-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--text); }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ── Shell ──────────────────────────────────────────────────────── */
.shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar__logo {
  font-size: 22px;
  color: var(--teal);
  line-height: 1;
}
.sidebar__name {
  font-family: var(--head);
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
}
.sidebar__sub {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-top: 1px;
}

.sidebar__nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text2);
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}
.sidebar__link:hover {
  background: var(--surface2);
  color: var(--text);
}
.sidebar__link.is-active {
  background: rgba(45,212,191,.1);
  color: var(--teal);
}
.sidebar__icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar__footer {
  padding: 16px 16px 20px;
  border-top: 1px solid var(--border);
}
.sidebar__admin {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.sidebar__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--head);
  font-size: 13px; font-weight: 800;
  color: var(--bg);
  flex-shrink: 0;
}
.sidebar__admin-name { font-size: 13px; font-weight: 600; color: var(--text); }
.sidebar__admin-email { font-size: 11px; color: var(--text3); }
.sidebar__logout {
  font-size: 12px;
  color: var(--text3);
  display: block;
  padding: 6px 0;
}
.sidebar__logout:hover { color: var(--red); }

/* ── Main ───────────────────────────────────────────────────────── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 32px 36px;
  max-width: 1300px;
}

/* ── Flash messages ─────────────────────────────────────────────── */
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}
.flash--success { background: rgba(74,222,128,.1); color: var(--green); border: 1px solid rgba(74,222,128,.2); }
.flash--error   { background: rgba(248,113,113,.1); color: var(--red);  border: 1px solid rgba(248,113,113,.2); }
.flash--info    { background: rgba(129,140,248,.1); color: var(--accent); border: 1px solid rgba(129,140,248,.2); }
.flash__close   { background: none; border: none; color: inherit; cursor: pointer; opacity: .6; font-size: 16px; }
.flash__close:hover { opacity: 1; }

/* ── Page header ────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--head);
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.03em;
  flex: 1;
}
.page-sub {
  font-size: 13px;
  color: var(--text3);
  margin-top: 3px;
  font-family: var(--mono);
}
.page-header__actions { display: flex; gap: 8px; }

/* ── Stats grid ─────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border2); }
.stat-card--accent { border-color: rgba(45,212,191,.2); background: rgba(45,212,191,.04); }
.stat-card--warn   { border-color: rgba(251,146,60,.2); background: rgba(251,146,60,.04); }

.stat-card__icon {
  font-size: 18px;
  color: var(--text3);
  margin-bottom: 12px;
}
.stat-card--accent .stat-card__icon { color: var(--teal); }
.stat-card--warn   .stat-card__icon { color: var(--orange); }

.stat-card__value {
  font-family: var(--head);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-card__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}
.stat-card__sub {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--mono);
}

/* ── Grid layouts ───────────────────────────────────────────────── */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.grid-3col {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .grid-2col { grid-template-columns: 1fr; }
  .grid-3col { grid-template-columns: 1fr 1fr; }
}

/* ── Card ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.card--form { padding: 28px; }
.card--warn { border-color: rgba(251,146,60,.25); background: rgba(251,146,60,.03); }

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card__title {
  font-family: var(--head);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.card__link {
  font-size: 12px;
  color: var(--teal);
  font-family: var(--mono);
}

/* ── Info cards ─────────────────────────────────────────────────── */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.info-card__label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; font-family: var(--mono); }
.info-card__value { font-family: var(--head); font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.03em; }

/* ── Table ──────────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table--hover tbody tr:hover td { background: var(--surface2); }
.table__primary   { font-weight: 500; color: var(--text); }
.table__secondary { font-size: 12px; color: var(--text3); font-family: var(--mono); }
.table__link      { color: var(--text); font-weight: 500; }
.table__link:hover { color: var(--teal); }
.table__empty     { text-align: center; padding: 32px 16px; color: var(--text3); font-style: italic; }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge--green  { background: rgba(74,222,128,.12);  color: #4ade80; }
.badge--blue   { background: rgba(96,165,250,.12);  color: #60a5fa; }
.badge--purple { background: rgba(129,140,248,.12); color: var(--accent); }
.badge--orange { background: rgba(251,146,60,.12);  color: var(--orange); }
.badge--red    { background: rgba(248,113,113,.12); color: var(--red); }
.badge--grey   { background: rgba(255,255,255,.07); color: var(--text3); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn--full    { width: 100%; }
.btn--sm      { padding: 6px 13px; font-size: 12px; }
.btn--primary { background: linear-gradient(90deg, var(--teal), var(--accent)); color: var(--bg); border-color: transparent; }
.btn--primary:hover { opacity: .88; transform: translateY(-1px); color: var(--bg); }
.btn--secondary { background: var(--surface2); color: var(--text2); border-color: var(--border2); }
.btn--secondary:hover { color: var(--text); border-color: var(--teal); }
.btn--ghost   { background: transparent; color: var(--text3); border-color: var(--border); }
.btn--ghost:hover { color: var(--text); border-color: var(--border2); }
.btn--danger  { color: var(--red); border-color: rgba(248,113,113,.3); }
.btn--danger:hover { background: rgba(248,113,113,.1); }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-section { margin-bottom: 28px; }
.form-section__title {
  font-family: var(--head);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-group   { display: flex; flex-direction: column; gap: 6px; }
.form-label   { font-size: 12px; font-weight: 600; color: var(--text2); }
.form-input {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
.form-input:focus { border-color: var(--teal); }
.form-input:disabled { opacity: .5; cursor: not-allowed; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-error  { background: rgba(248,113,113,.1); color: var(--red); border: 1px solid rgba(248,113,113,.2); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 16px; border-top: 1px solid var(--border); margin-top: 8px; }
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--text2); }
.checkbox-label input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--teal); }

/* ── Filters bar ────────────────────────────────────────────────── */
.filters { margin-bottom: 16px; }
.filters__form { display: flex; gap: 10px; flex-wrap: wrap; }
.filters__search { flex: 1; min-width: 200px; max-width: 360px; }
.filters__select { width: 160px; }

/* ── Plans grid ─────────────────────────────────────────────────── */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .plans-grid { grid-template-columns: 1fr 1fr; } }
.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition);
}
.plan-card:hover { border-color: var(--border2); }
.plan-card--inactive { opacity: .55; }
.plan-card__header { display: flex; align-items: center; justify-content: space-between; }
.plan-card__name  { font-family: var(--head); font-size: 17px; font-weight: 800; }
.plan-card__price { font-family: var(--head); font-size: 26px; font-weight: 800; color: var(--teal); letter-spacing: -.04em; }
.plan-card__per   { font-size: 13px; color: var(--text3); font-family: var(--body); font-weight: 400; }
.plan-card__seats { font-family: var(--mono); font-size: 11px; color: var(--text3); }
.plan-card__feat  { font-size: 12.5px; color: var(--text2); }
.plan-card__feat--off { color: var(--text3); opacity: .5; }
.plan-card__footer { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); margin-top: auto; }

/* ── Detail list ────────────────────────────────────────────────── */
.detail-list { padding: 16px 20px; }
.detail-list dt { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); margin-top: 14px; }
.detail-list dt:first-child { margin-top: 0; }
.detail-list dd { font-size: 14px; color: var(--text); margin-top: 3px; }

.notes-box {
  margin: 0 20px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text2);
}
.notes-box strong { display: block; color: var(--text3); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; font-family: var(--mono); }

/* ── Usage rows ─────────────────────────────────────────────────── */
.usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.usage-row:last-child { border-bottom: none; }
.usage-row__label { font-size: 13.5px; color: var(--text2); }
.usage-row__stats { display: flex; align-items: center; gap: 10px; }

/* ── Expiry rows ────────────────────────────────────────────────── */
.expiry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}
.expiry-row:last-child { border-bottom: none; }
.expiry-row__date { font-family: var(--mono); font-size: 11px; color: var(--orange); font-weight: 700; }

/* ── Audit list ─────────────────────────────────────────────────── */
.audit-list { padding: 8px 0; }
.audit-row { padding: 9px 20px; border-bottom: 1px solid var(--border); }
.audit-row:last-child { border-bottom: none; }
.audit-row__action { font-family: var(--mono); font-size: 12px; color: var(--teal); }
.audit-row__meta   { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── Pagination ─────────────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pagination__item {
  min-width: 34px;
  height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text2);
  transition: all var(--transition);
}
.pagination__item:hover { border-color: var(--teal); color: var(--teal); }
.pagination__item.is-active { background: var(--teal); color: var(--bg); border-color: var(--teal); font-weight: 700; }

/* ── Misc helpers ───────────────────────────────────────────────── */
.mono { font-family: var(--mono); }

/* ── Auth pages ─────────────────────────────────────────────────── */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(45,212,191,.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 80% 80%, rgba(129,140,248,.06) 0%, transparent 60%),
    var(--bg);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.auth-logo {
  font-size: 32px;
  color: var(--teal);
  margin-bottom: 12px;
  text-align: center;
}
.auth-title {
  font-family: var(--head);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  letter-spacing: -.03em;
  margin-bottom: 6px;
}
.auth-sub {
  font-size: 13px;
  color: var(--text3);
  text-align: center;
  font-family: var(--mono);
  margin-bottom: 24px;
}
.auth-form { margin-top: 24px; display: flex; flex-direction: column; gap: 16px; }
.auth-error   { background: rgba(248,113,113,.1); color: var(--red); border: 1px solid rgba(248,113,113,.2); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-top: 16px; }
.auth-success { background: rgba(74,222,128,.1); color: var(--green); border: 1px solid rgba(74,222,128,.2); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-top: 16px; }
.auth-link { text-align: center; font-size: 12px; color: var(--text3); }
.auth-link:hover { color: var(--teal); }

/* ── Theme toggle ───────────────────────────────────────────────── */
.theme-toggle {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 100px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--text2);
  transition: all var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--teal); border-color: var(--teal); }
