/* ═══════════════════════════════════════════════════════════════════
   AURA Portal — portal.css
   HR self-service portal. Light + Dark theme. Syne + Inter + DM Mono.
   ═══════════════════════════════════════════════════════════════════ */

/* ── 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,.13);
  --text:      #e8eaf2;
  --text2:     rgba(232,234,242,.65);
  --text3:     rgba(232,234,242,.35);
  --teal:      #2dd4bf;
  --teal-dim:  rgba(45,212,191,.15);
  --accent:    #818cf8;
  --red:       #f87171;
  --orange:    #fb923c;
  --green:     #4ade80;
  --shadow:    0 4px 24px rgba(0,0,0,.45);
  --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;
  --teal-dim:  rgba(13,148,136,.1);
  --accent:    #6d28d9;
  --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:  230px;
  --transition: .18s ease;
}

/* ── 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.55;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text); }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

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

/* ── 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;
  transition: background var(--transition), border-color var(--transition);
}

.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: 2px; }

.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: var(--teal-dim); 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__user { 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: #fff; flex-shrink: 0;
}
.sidebar__user-name  { font-size: 13px; font-weight: 600; color: var(--text); }
.sidebar__user-org   { font-size: 11px; color: var(--text3); font-family: var(--mono); }
.sidebar__footer-actions { display: flex; align-items: center; justify-content: space-between; }
.sidebar__logout { font-size: 12px; color: var(--text3); }
.sidebar__logout:hover { color: var(--red); }

/* ── Main ───────────────────────────────────────────────────────── */
.main { flex: 1; margin-left: var(--sidebar-w); padding: 32px 36px; max-width: 1200px; }
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 20px 16px; }
}

/* ── 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,.22); }
.flash--error   { background: rgba(248,113,113,.1); color: var(--red);   border: 1px solid rgba(248,113,113,.22); }
.flash--info    { background: rgba(129,140,248,.1); color: var(--accent); border: 1px solid rgba(129,140,248,.22); }
[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; }
.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); } }
@media (max-width: 500px)  { .stats-grid { grid-template-columns: 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), background var(--transition);
}
.stat-card:hover { border-color: var(--border2); }
.stat-card--accent { border-color: rgba(45,212,191,.2); background: var(--teal-dim); }
.stat-card--warn   { border-color: rgba(251,146,60,.2); }
[data-theme="light"] .stat-card--warn { background: #fff7ed; }

.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); }

/* ── Card ───────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; transition: background var(--transition), border-color var(--transition); }
.card--form { padding: 28px; }
.card--warn { border-color: rgba(251,146,60,.3); }
[data-theme="light"] .card--warn { background: #fffbeb; }

.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); }

/* ── Seat usage bar ─────────────────────────────────────────────── */
.seat-bar { margin-bottom: 20px; }
.seat-bar__header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.seat-bar__label  { font-size: 13px; font-weight: 600; color: var(--text2); }
.seat-bar__count  { font-family: var(--mono); font-size: 12px; color: var(--teal); }
.seat-bar__track  { height: 8px; background: var(--surface3); border-radius: 100px; overflow: hidden; }
.seat-bar__fill   { height: 100%; background: linear-gradient(90deg, var(--teal), var(--accent)); border-radius: 100px; transition: width .4s ease; }
.seat-bar__fill--warn { background: linear-gradient(90deg, var(--orange), var(--red)); }

/* ── 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; }
.table__secondary { font-size: 12px; color: var(--text3); font-family: var(--mono); }
.table__empty     { text-align: center; padding: 40px 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: var(--surface3);       color: var(--text3); }

[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; }

/* ── 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: #fff; }
.btn--primary:hover { opacity: .88; transform: translateY(-1px); color: #fff; }
.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); background: transparent; }
.btn--danger:hover { background: rgba(248,113,113,.1); }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-group   { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label   { font-size: 12px; font-weight: 600; color: var(--text2); }
.form-hint    { font-size: 11px; color: var(--text3); font-family: var(--mono); }
.form-input {
  background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius-sm);
  padding: 10px 13px; color: var(--text); font-size: 14px; outline: none; width: 100%;
  transition: border-color var(--transition), background var(--transition);
}
.form-input:focus   { border-color: var(--teal); background: var(--surface); }
.form-input:disabled { opacity: .5; cursor: not-allowed; }
.form-error   { background: rgba(248,113,113,.08); 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; }
[data-theme="light"] .form-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* ── Grid ───────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Empty state ────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state__icon  { font-size: 40px; margin-bottom: 16px; opacity: .3; }
.empty-state__title { font-family: var(--head); font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state__text  { font-size: 13px; color: var(--text3); margin-bottom: 24px; }

/* ── Subscription banner ────────────────────────────────────────── */
.sub-banner {
  background: linear-gradient(135deg, rgba(45,212,191,.08), rgba(129,140,248,.08));
  border: 1px solid rgba(45,212,191,.2);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
[data-theme="light"] .sub-banner { background: linear-gradient(135deg, #f0fdfa, #f5f3ff); border-color: rgba(13,148,136,.2); }
.sub-banner__plan   { font-family: var(--head); font-size: 22px; font-weight: 800; color: var(--teal); letter-spacing: -.03em; }
.sub-banner__status { flex: 1; }
.sub-banner__label  { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); margin-bottom: 4px; }
.sub-banner__value  { font-size: 14px; color: var(--text); font-weight: 500; }

/* ── Auth ───────────────────────────────────────────────────────── */
.auth-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--auth-bg);
  padding: 24px;
  transition: background var(--transition);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  transition: background var(--transition), border-color var(--transition);
}
.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: 4px; }
.auth-org    { font-size: 13px; color: var(--teal); font-weight: 600; text-align: center; margin-bottom: 4px; font-family: var(--mono); }
.auth-sub    { font-size: 12px; color: var(--text3); text-align: center; font-family: var(--mono); margin-bottom: 24px; }
.auth-form   { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.auth-error  { background: rgba(248,113,113,.08); color: var(--red); border: 1px solid rgba(248,113,113,.2); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-top: 12px; }
.auth-success { background: rgba(74,222,128,.08); color: var(--green); border: 1px solid rgba(74,222,128,.2); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-top: 12px; }
.auth-link   { text-align: center; font-size: 12px; color: var(--text3); cursor: pointer; }
.auth-link a { color: var(--teal); }
.auth-card__theme { display: flex; justify-content: flex-end; margin-bottom: 8px; }
[data-theme="light"] .auth-error   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
[data-theme="light"] .auth-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }

/* ── 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: #fff; border-color: var(--teal); font-weight: 700; }

/* ── Misc ───────────────────────────────────────────────────────── */
.mono { font-family: var(--mono); }
.text-muted { color: var(--text3); }
