/* ═══════════════════════════════════════════════════════════════════
   AURELIA ACADEMY — Design System v2.0
   Palette:  Navy #0a1628 / Slate #1e3a5f / Gold #d97706 / Ash #f1f5f9
   Type:     Inter (body/data) · Source Serif 4 (display)
   Signature: gold left-border accent on active nav items, 
              smooth FLIP card transitions on stat blocks
═══════════════════════════════════════════════════════════════════ */

/* ─── Fonts ─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Source+Serif+4:wght@400;600;700&display=swap');

/* ─── Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --au-navy:       #0a1628;
  --au-navy-mid:   #1e3a5f;
  --au-navy-light: #2d5282;
  --au-gold:       #d97706;
  --au-gold-light: #fbbf24;
  --au-gold-pale:  #fef3c7;

  /* Surface */
  --au-bg:         #f0f4f8;
  --au-surface:    #ffffff;
  --au-surface-2:  #f8fafc;
  --au-border:     #e2e8f0;
  --au-border-dark:#cbd5e1;

  /* Text */
  --au-text:       #0f172a;
  --au-text-2:     #475569;
  --au-text-3:     #94a3b8;

  /* Status */
  --au-success:    #059669;
  --au-danger:     #dc2626;
  --au-warning:    #d97706;
  --au-info:       #0284c7;

  /* Sidebar */
  --sidebar-w:     268px;
  --topbar-h:      64px;

  /* Radius / Shadow */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);

  /* Animation */
  --ease: cubic-bezier(.4,0,.2,1);
  --dur:  200ms;
}

/* Dark mode */
[data-theme="dark"] {
  --au-bg:       #0a0f1e;
  --au-surface:  #111827;
  --au-surface-2:#1f2937;
  --au-border:   #1f2937;
  --au-text:     #f1f5f9;
  --au-text-2:   #94a3b8;
  --au-text-3:   #475569;
}

/* ─── Reset / Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--au-text);
  background: var(--au-bg);
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--au-text);
}

.display-heading {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
}

/* ─── Sidebar ────────────────────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--au-navy);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform var(--dur) var(--ease);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-decoration: none;
  position: relative;
}

.sidebar-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  flex-shrink: 0;
  border: none;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.7);
  font-size: 15px;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.sidebar-close-btn:hover { background: rgba(255,255,255,.12); color: #fff; }

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--au-gold-light), var(--au-gold));
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: var(--au-navy);
  flex-shrink: 0;
  letter-spacing: -.5px;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-brand-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 500;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}

.sidebar-scroll::-webkit-scrollbar { width: 3px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }

.nav-section {
  padding: 16px 20px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
}

.nav-item-au {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  position: relative;
}

.nav-item-au i {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: .7;
  transition: opacity var(--dur);
}

.nav-item-au:hover {
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.05);
  border-left-color: rgba(255,255,255,.15);
}

.nav-item-au:hover i { opacity: 1; }

.nav-item-au.active {
  color: #fff;
  background: rgba(217,119,6,.12);
  border-left-color: var(--au-gold);
  font-weight: 600;
}

.nav-item-au.active i {
  opacity: 1;
  color: var(--au-gold-light);
}

/* Collapsible nav groups */
.nav-group-toggle {
  cursor: pointer;
  user-select: none;
}

.nav-group-toggle::after {
  content: '\f282';
  font-family: 'bootstrap-icons';
  margin-left: auto;
  font-size: 10px;
  opacity: .4;
  transition: transform var(--dur);
}

.nav-group-toggle.collapsed::after { transform: rotate(-90deg); }

.nav-sub {
  overflow: hidden;
  transition: max-height .25s var(--ease);
}

.nav-sub .nav-item-au {
  padding-left: 48px;
  font-size: 12.5px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--dur);
}

.sidebar-user:hover { background: rgba(255,255,255,.06); }

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--au-gold-light), var(--au-gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--au-navy);
  flex-shrink: 0;
  object-fit: cover;
}

.sidebar-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  line-height: 1.2;
}

.sidebar-user-role {
  font-size: 10.5px;
  color: rgba(255,255,255,.35);
  text-transform: capitalize;
}

/* ─── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: var(--au-surface);
  border-bottom: 1px solid var(--au-border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  z-index: 1030;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,.92);
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--au-text-2);
}

.topbar-breadcrumb .page-name {
  font-weight: 600;
  color: var(--au-text);
}

.topbar-spacer { flex: 1; }

.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--au-gold-pale);
  color: var(--au-warning);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid rgba(217,119,6,.2);
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--au-border);
  border-radius: var(--r-md);
  background: var(--au-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  position: relative;
  color: var(--au-text-2);
  font-size: 15px;
}

.topbar-icon-btn:hover {
  background: var(--au-surface-2);
  border-color: var(--au-border-dark);
  color: var(--au-text);
}

.topbar-notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--au-danger);
  border-radius: 50%;
  border: 1.5px solid white;
}

/* ─── Main wrapper ───────────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin var(--dur) var(--ease);
}

.content-body {
  flex: 1;
  padding: 28px 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ─── Page header ────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--au-text);
  margin: 0;
  letter-spacing: -.3px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--au-text-3);
  margin: 3px 0 0;
}

/* ─── Cards ──────────────────────────────────────────────────────── */
.au-card {
  background: var(--au-surface);
  border: 1px solid var(--au-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease);
  overflow: hidden;
}

.au-card:hover { box-shadow: var(--shadow-md); }

.au-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--au-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--au-surface);
}

.au-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--au-text);
  margin: 0;
}

.au-card-body { padding: 20px; }
.au-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--au-border);
  background: var(--au-surface-2);
}

/* Stat cards */
.stat-card {
  background: var(--au-surface);
  border: 1px solid var(--au-border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--stat-color, var(--au-navy-light));
  opacity: 0;
  transition: opacity var(--dur);
}

.stat-card:hover { 
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--stat-bg, #f1f5f9);
  color: var(--stat-color, var(--au-navy-light));
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--au-text);
  letter-spacing: -.5px;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--au-text-3);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.stat-delta {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-delta.up   { color: var(--au-success); }
.stat-delta.down { color: var(--au-danger); }

/* Colour presets */
.stat-blue   { --stat-color: #2563eb; --stat-bg: #eff6ff; }
.stat-green  { --stat-color: #059669; --stat-bg: #ecfdf5; }
.stat-gold   { --stat-color: #d97706; --stat-bg: #fffbeb; }
.stat-red    { --stat-color: #dc2626; --stat-bg: #fef2f2; }
.stat-purple { --stat-color: #7c3aed; --stat-bg: #f5f3ff; }
.stat-teal   { --stat-color: #0d9488; --stat-bg: #f0fdfa; }

/* ─── Tables ─────────────────────────────────────────────────────── */
.au-table-wrap {
  border-radius: var(--r-lg);
  border: 1px solid var(--au-border);
  overflow-x: auto;
  background: var(--au-surface);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.au-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.au-table thead th {
  padding: 11px 16px;
  background: var(--au-surface-2);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--au-text-2);
  border-bottom: 1px solid var(--au-border);
  white-space: nowrap;
}

.au-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--au-border);
  color: var(--au-text);
  vertical-align: middle;
}

.au-table tbody tr:last-child td { border-bottom: none; }

.au-table tbody tr {
  transition: background var(--dur) var(--ease);
}

.au-table tbody tr:hover { background: var(--au-surface-2); }

.au-table tbody tr.row-paid  { background: #f0fdf4; }
.au-table tbody tr.row-overdue { background: #fff5f5; }

/* ─── Badges ─────────────────────────────────────────────────────── */
.au-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  border: 1px solid transparent;
}

.au-badge-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.au-badge-danger  { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.au-badge-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.au-badge-info    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.au-badge-neutral { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.au-badge-purple  { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }

/* ─── Buttons ────────────────────────────────────────────────────── */
.au-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.au-btn:focus-visible {
  outline: 2px solid var(--au-gold);
  outline-offset: 2px;
}

.au-btn-primary {
  background: var(--au-navy);
  color: #fff;
  border-color: var(--au-navy);
}
.au-btn-primary:hover {
  background: var(--au-navy-mid);
  border-color: var(--au-navy-mid);
  color: #fff;
}

.au-btn-gold {
  background: var(--au-gold);
  color: #fff;
  border-color: var(--au-gold);
}
.au-btn-gold:hover { background: #b45309; border-color: #b45309; color: #fff; }

.au-btn-outline {
  background: transparent;
  color: var(--au-text-2);
  border-color: var(--au-border-dark);
}
.au-btn-outline:hover { background: var(--au-surface-2); color: var(--au-text); }

.au-btn-danger {
  background: var(--au-danger);
  color: #fff;
  border-color: var(--au-danger);
}
.au-btn-danger:hover { background: #b91c1c; color: #fff; }

.au-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--au-text-2);
}
.au-btn-ghost:hover { background: var(--au-surface-2); color: var(--au-text); }

.au-btn-sm { padding: 5px 11px; font-size: 12px; }
.au-btn-lg { padding: 11px 22px; font-size: 14.5px; }

.au-btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  border-radius: var(--r-md);
  justify-content: center;
}

/* ─── Forms ──────────────────────────────────────────────────────── */
.au-form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--au-text-2);
  margin-bottom: 5px;
  letter-spacing: .01em;
}

.au-form-control {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--au-text);
  background: var(--au-surface);
  border: 1.5px solid var(--au-border-dark);
  border-radius: var(--r-md);
  transition: border-color var(--dur), box-shadow var(--dur);
  font-family: inherit;
  line-height: 1.5;
  -webkit-appearance: none;
}

.au-form-control::placeholder { color: var(--au-text-3); }

.au-form-control:focus {
  outline: none;
  border-color: var(--au-navy-light);
  box-shadow: 0 0 0 3px rgba(45,82,130,.15);
}

.au-form-control.is-invalid {
  border-color: var(--au-danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

.au-form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 32px;
  cursor: pointer;
}

.au-form-hint {
  font-size: 11.5px;
  color: var(--au-text-3);
  margin-top: 4px;
}

.au-form-error {
  font-size: 11.5px;
  color: var(--au-danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.au-field { margin-bottom: 18px; }

/* Search field */
.au-search {
  position: relative;
}
.au-search i {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--au-text-3);
  font-size: 14px;
  pointer-events: none;
}
.au-search .au-form-control { padding-left: 34px; }

/* ─── Alerts ─────────────────────────────────────────────────────── */
.au-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  border: 1px solid transparent;
  margin-bottom: 16px;
}

.au-alert i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.au-alert-success { background: #f0fdf4; color: #14532d; border-color: #bbf7d0; }
.au-alert-success i { color: var(--au-success); }

.au-alert-danger  { background: #fff1f2; color: #881337; border-color: #fecdd3; }
.au-alert-danger i { color: var(--au-danger); }

.au-alert-warning { background: #fffbeb; color: #78350f; border-color: #fde68a; }
.au-alert-warning i { color: var(--au-warning); }

.au-alert-info    { background: #eff6ff; color: #1e3a8a; border-color: #bfdbfe; }
.au-alert-info i { color: var(--au-info); }

/* ─── Empty states ───────────────────────────────────────────────── */
.au-empty {
  padding: 60px 32px;
  text-align: center;
  color: var(--au-text-3);
}

.au-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: .3;
}

.au-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--au-text-2);
  margin-bottom: 6px;
}

.au-empty-text { font-size: 13px; }

/* ─── Progress bars ──────────────────────────────────────────────── */
.au-progress {
  height: 6px;
  background: var(--au-border);
  border-radius: 3px;
  overflow: hidden;
}

.au-progress-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--au-navy-light);
  transition: width .4s var(--ease);
}

/* ─── Avatar ─────────────────────────────────────────────────────── */
.au-avatar {
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: linear-gradient(135deg, var(--au-navy-mid), var(--au-navy));
  color: #fff;
  flex-shrink: 0;
}

.au-avatar-sm  { width: 28px; height: 28px; font-size: 11px; }
.au-avatar-md  { width: 36px; height: 36px; font-size: 13px; }
.au-avatar-lg  { width: 48px; height: 48px; font-size: 16px; }
.au-avatar-xl  { width: 64px; height: 64px; font-size: 22px; }

/* ─── Tabs ───────────────────────────────────────────────────────── */
.au-tabs {
  display: flex;
  gap: 2px;
  background: var(--au-surface-2);
  border-radius: var(--r-md);
  padding: 3px;
  border: 1px solid var(--au-border);
  width: fit-content;
  margin-bottom: 20px;
}

.au-tab {
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--au-text-2);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  border: none;
  background: transparent;
  text-decoration: none;
}

.au-tab:hover { color: var(--au-text); background: rgba(0,0,0,.04); }

.au-tab.active {
  background: var(--au-surface);
  color: var(--au-text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ─── Dropdown ───────────────────────────────────────────────────── */
.au-dropdown {
  background: var(--au-surface);
  border: 1px solid var(--au-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 180px;
  animation: dropFade .15s var(--ease);
}

@keyframes dropFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.au-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--au-text);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur);
  border: none;
  background: transparent;
  width: 100%;
}

.au-dropdown-item:hover { background: var(--au-surface-2); }
.au-dropdown-item.danger { color: var(--au-danger); }
.au-dropdown-item.danger:hover { background: #fff1f2; }
.au-dropdown-divider { height: 1px; background: var(--au-border); margin: 4px 0; }

/* ─── Toast / Snackbar ───────────────────────────────────────────── */
.au-toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.au-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--au-text);
  color: #fff;
  border-radius: var(--r-lg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  animation: toastIn .2s var(--ease);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.au-toast.exiting { animation: toastOut .2s var(--ease) forwards; }

@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

.au-toast-icon { font-size: 16px; flex-shrink: 0; }
.au-toast-close { margin-left: auto; cursor: pointer; opacity: .6; font-size: 16px; }
.au-toast-close:hover { opacity: 1; }

.au-toast.success .au-toast-icon { color: #4ade80; }
.au-toast.danger  .au-toast-icon { color: #f87171; }
.au-toast.info    .au-toast-icon { color: #60a5fa; }

/* ─── Skeleton loading ───────────────────────────────────────────── */
.au-skeleton {
  background: linear-gradient(90deg, var(--au-surface-2) 25%, var(--au-border) 50%, var(--au-surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
  height: 16px;
}

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

/* ─── Print ──────────────────────────────────────────────────────── */
@media print {
  #sidebar, .topbar, .au-toast-container { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .au-card { box-shadow: none !important; border: 1px solid #ccc; }
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 991px) {
  #sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }
  #sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .content-body { padding: 20px 16px; }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1035;
    backdrop-filter: blur(2px);
  }
  .sidebar-overlay.active { display: block; }
  .sidebar-close-btn { display: flex; }
}

@media (max-width: 575px) {
  .content-body { padding: 16px 12px; }
  .stat-value { font-size: 22px; }
  .topbar { padding: 0 16px; }
}

/* ─── Utility helpers ────────────────────────────────────────────── */
.text-navy    { color: var(--au-navy); }
.text-gold    { color: var(--au-gold); }
.text-muted-au { color: var(--au-text-3); font-size: 12.5px; }
.bg-navy      { background: var(--au-navy); }
.bg-surface   { background: var(--au-surface); }
.border-au    { border: 1px solid var(--au-border); }
.rounded-au   { border-radius: var(--r-lg); }
.fw-800       { font-weight: 800; }
.ls-tight     { letter-spacing: -.3px; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
