/* ============================================================
   arch-theme.css — Arch Suite shared design system
   Served at /shared/arch-theme.css by every project via ArchShared.
   ============================================================ */

/* ── Fonts ─────────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

@font-face {
  font-family: "Algoran Script";
  src: url("/shared/fonts/Algoran_Script.ttf") format("truetype");
  font-weight: normal; font-style: normal; font-display: swap;
}

/* ── Design tokens — dark (default) ────────────────────── */
:root {
  /* Core backgrounds */
  --arch-bg:        #04040e;
  --arch-surface:   #0c0c1e;
  --arch-surface2:  #111128;
  --arch-sidebar:   #030312;
  --arch-sidebar2:  rgba(3,3,18,.96);

  /* Borders */
  --arch-border:    rgba(139,71,255,.2);
  --arch-border2:   rgba(0,216,255,.15);

  /* Text */
  --arch-text:      #dde4f0;
  --arch-muted:     rgba(255,255,255,.38);

  /* Brand accent — cyan/purple */
  --arch-cyan:      #00d8ff;
  --arch-purple:    #8b47ff;
  --arch-gradient:  linear-gradient(135deg, #8b47ff 0%, #00d8ff 100%);
  --arch-glow-c:    0 0 24px rgba(0,216,255,.22);
  --arch-glow-p:    0 0 24px rgba(139,71,255,.22);

  /* Gold — kept for rank/hierarchy UI in community apps */
  --arch-gold:      #c9a84c;
  --arch-gold-light:#e8c87a;
  --arch-gold-dim:  #8a6f32;

  /* Status */
  --arch-danger:    #ef4444;
  --arch-warning:   #f59e0b;
  --arch-success:   #22c55e;
  --arch-info:      #00d8ff;

  /* Primary/accent aliases (modules use these) */
  --arch-primary:   var(--arch-purple);
  --arch-accent:    var(--arch-cyan);

  /* Backward compat — old unprefixed aliases */
  --bg:         var(--arch-bg);
  --surface:    var(--arch-surface);
  --surface2:   var(--arch-surface2);
  --border:     var(--arch-border);
  --sidebar:    var(--arch-sidebar);
  --text:       var(--arch-text);
  --muted:      var(--arch-muted);
  --gold:       var(--arch-gold);
  --gold-light: var(--arch-gold-light);
  --primary:    var(--arch-primary);
  --accent:     var(--arch-accent);
  --danger:     var(--arch-danger);
  --warning:    var(--arch-warning);
  --success:    var(--arch-success);

  /* Bootstrap overrides */
  --bs-body-bg:              var(--arch-bg);
  --bs-body-color:           var(--arch-text);
  --bs-border-color:         rgba(139,71,255,.2);
  --bs-card-bg:              var(--arch-surface);
  --bs-modal-bg:             var(--arch-surface);
  --bs-dropdown-bg:          var(--arch-surface2);
  --bs-dropdown-color:       var(--arch-text);
  --bs-dropdown-link-color:  var(--arch-text);
  --bs-dropdown-link-hover-bg: rgba(139,71,255,.1);
  --bs-input-bg:             var(--arch-surface2);
  --bs-input-color:          var(--arch-text);
  --bs-input-border-color:   rgba(139,71,255,.2);
  --bs-table-bg:             transparent;
  --bs-table-striped-bg:     rgba(255,255,255,.025);
  --bs-table-hover-bg:       rgba(139,71,255,.06);
  --bs-table-color:          var(--arch-text);
  --bs-table-border-color:   rgba(139,71,255,.15);
  --bs-link-color:           var(--arch-cyan);
  --bs-link-hover-color:     #33e5ff;
  --bs-focus-ring-color:     rgba(139,71,255,.35);
  /* Bootstrap 5.3 additional tokens */
  --bs-secondary-bg:         var(--arch-surface2);
  --bs-tertiary-bg:          var(--arch-surface2);
  --bs-secondary-color:      var(--arch-muted);
  --bs-tertiary-color:       var(--arch-muted);
  --bs-list-group-bg:        var(--arch-surface);
  --bs-list-group-border-color: var(--arch-border);
  --bs-list-group-color:     var(--arch-text);
  --bs-card-border-color:    var(--arch-border);
  --bs-modal-border-color:   var(--arch-border);
  color-scheme: dark;
}

/* ArchAdmin compat — [data-theme="dark"] mirrors :root */
[data-theme="dark"] {
  --arch-bg:        #04040e;
  --arch-surface:   #0c0c1e;
  --arch-surface2:  #111128;
  --arch-sidebar:   #030312;
  --arch-sidebar2:  rgba(3,3,18,.96);
  --arch-border:    rgba(139,71,255,.2);
  --arch-border2:   rgba(0,216,255,.15);
  --arch-text:      #dde4f0;
  --arch-muted:     rgba(255,255,255,.38);
  --arch-cyan:      #00d8ff;
  --arch-purple:    #8b47ff;
  --arch-gradient:  linear-gradient(135deg, #8b47ff 0%, #00d8ff 100%);
  --arch-glow-c:    0 0 24px rgba(0,216,255,.22);
  --arch-glow-p:    0 0 24px rgba(139,71,255,.22);
  --arch-gold:      #c9a84c;
  --arch-gold-light:#e8c87a;
  --arch-gold-dim:  #8a6f32;
  --arch-danger:    #ef4444;
  --arch-warning:   #f59e0b;
  --arch-success:   #22c55e;
  --arch-primary:   var(--arch-purple);
  --arch-accent:    var(--arch-cyan);
  --bg: var(--arch-bg); --surface: var(--arch-surface); --surface2: var(--arch-surface2);
  --border: var(--arch-border); --sidebar: var(--arch-sidebar); --text: var(--arch-text);
  --muted: var(--arch-muted); --gold: var(--arch-gold); --gold-light: var(--arch-gold-light);
  --primary: var(--arch-primary); --accent: var(--arch-accent);
  --danger: var(--arch-danger); --warning: var(--arch-warning); --success: var(--arch-success);
  --bs-body-bg: var(--arch-bg); --bs-body-color: var(--arch-text);
  --bs-border-color: rgba(139,71,255,.2); --bs-card-bg: var(--arch-surface);
  --bs-modal-bg: var(--arch-surface); --bs-dropdown-bg: var(--arch-surface2);
  --bs-dropdown-color: var(--arch-text); --bs-dropdown-link-color: var(--arch-text);
  --bs-dropdown-link-hover-bg: rgba(139,71,255,.1);
  --bs-input-bg: var(--arch-surface2); --bs-input-color: var(--arch-text);
  --bs-input-border-color: rgba(139,71,255,.2); --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255,255,255,.025); --bs-table-hover-bg: rgba(139,71,255,.06);
  --bs-table-color: var(--arch-text); --bs-table-border-color: rgba(139,71,255,.15);
  --bs-link-color: var(--arch-cyan); --bs-link-hover-color: #33e5ff;
  --bs-focus-ring-color: rgba(139,71,255,.35);
  --bs-secondary-bg: var(--arch-surface2); --bs-tertiary-bg: var(--arch-surface2);
  --bs-secondary-color: var(--arch-muted); --bs-tertiary-color: var(--arch-muted);
  --bs-list-group-bg: var(--arch-surface); --bs-list-group-border-color: var(--arch-border);
  --bs-list-group-color: var(--arch-text);
  --bs-card-border-color: var(--arch-border); --bs-modal-border-color: var(--arch-border);
  color-scheme: dark;
}

/* ── Light theme ───────────────────────────────────────── */
[data-theme="light"] {
  --arch-bg:        #f0f0f8;
  --arch-surface:   #fafaff;
  --arch-surface2:  #eaeaf5;
  --arch-sidebar:   #12003a;
  --arch-sidebar2:  #0d0028;
  --arch-border:    rgba(139,71,255,.18);
  --arch-border2:   rgba(0,180,220,.18);
  --arch-text:      #1a1030;
  --arch-muted:     rgba(20,10,50,.45);
  --arch-cyan:      #0097b2;
  --arch-purple:    #6d22e0;
  --arch-gradient:  linear-gradient(135deg, #6d22e0 0%, #0097b2 100%);
  --arch-glow-c:    0 0 16px rgba(0,180,220,.18);
  --arch-glow-p:    0 0 16px rgba(109,34,224,.18);
  --arch-gold:      #a07828;
  --arch-gold-light:#c9a84c;
  --arch-gold-dim:  #c9a84c;
  --arch-danger:    #dc2626;
  --arch-warning:   #d97706;
  --arch-success:   #16a34a;
  --arch-primary:   var(--arch-purple);
  --arch-accent:    var(--arch-cyan);
  --bg: var(--arch-bg); --surface: var(--arch-surface); --surface2: var(--arch-surface2);
  --border: var(--arch-border); --sidebar: var(--arch-sidebar); --text: var(--arch-text);
  --muted: var(--arch-muted); --gold: var(--arch-gold); --gold-light: var(--arch-gold-light);
  --primary: var(--arch-primary); --accent: var(--arch-accent);
  --danger: var(--arch-danger); --warning: var(--arch-warning); --success: var(--arch-success);
  --bs-body-bg: var(--arch-bg); --bs-body-color: var(--arch-text);
  --bs-border-color: rgba(139,71,255,.18); --bs-card-bg: var(--arch-surface);
  --bs-modal-bg: var(--arch-surface); --bs-dropdown-bg: var(--arch-surface);
  --bs-dropdown-color: var(--arch-text); --bs-dropdown-link-color: var(--arch-text);
  --bs-dropdown-link-hover-bg: var(--arch-surface2);
  --bs-input-bg: var(--arch-surface); --bs-input-color: var(--arch-text);
  --bs-input-border-color: rgba(139,71,255,.25); --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(0,0,0,.02); --bs-table-hover-bg: rgba(109,34,224,.04);
  --bs-table-color: var(--arch-text); --bs-table-border-color: rgba(139,71,255,.15);
  --bs-link-color: var(--arch-purple); --bs-link-hover-color: #8b47ff;
  --bs-focus-ring-color: rgba(109,34,224,.25);
  --bs-secondary-bg: var(--arch-surface2); --bs-tertiary-bg: var(--arch-surface2);
  --bs-secondary-color: var(--arch-muted); --bs-tertiary-color: var(--arch-muted);
  --bs-list-group-bg: var(--arch-surface); --bs-list-group-border-color: var(--arch-border);
  --bs-list-group-color: var(--arch-text);
  --bs-card-border-color: var(--arch-border); --bs-modal-border-color: var(--arch-border);
  color-scheme: light;
}

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

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--arch-bg);
  color: var(--arch-text);
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Deep space grid background */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(139,71,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,71,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Ambient glow blobs */
body::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 55% 40% at 10% 15%, rgba(139,71,255,.08) 0%, transparent 65%),
    radial-gradient(ellipse 45% 35% at 90% 85%, rgba(0,216,255,.06) 0%, transparent 65%);
}

[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(109,34,224,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109,34,224,.025) 1px, transparent 1px);
  background-size: 48px 48px;
}
[data-theme="light"] body::after {
  background:
    radial-gradient(ellipse 55% 40% at 10% 15%, rgba(109,34,224,.05) 0%, transparent 65%),
    radial-gradient(ellipse 45% 35% at 90% 85%, rgba(0,150,180,.04) 0%, transparent 65%);
}

/* Ensure content sits above pseudo-elements */
#app, .app-shell, #sidebar, #content,
.arch-topnav, main, .main-content { position: relative; z-index: 1; }

/* ── Brand / logo text ─────────────────────────────────── */
.arch-brand,
.brand-text > div:first-child,
#sidebar .brand-name,
#topnav .brand-name,
.ab-nav .brand-name {
  font-family: "Algoran Script", serif;
  background: var(--arch-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar,
#sidebar {
  background: rgba(3,3,18,.96);
  border-right: 1px solid var(--arch-border);
  backdrop-filter: blur(20px);
  position: relative;
}

/* Gradient accent line on sidebar right edge */
.sidebar::after,
#sidebar::after {
  content: "";
  position: absolute; top: 0; right: -1px; bottom: 0; width: 1px;
  background: var(--arch-gradient); opacity: .5;
  pointer-events: none;
}

[data-theme="light"] .sidebar,
[data-theme="light"] #sidebar {
  background: rgba(18,0,58,.97);
}

/* ── Sidebar nav links ─────────────────────────────────── */
.sidebar .nav-link,
#sidebar .nav-link {
  color: rgba(255,255,255,.42);
  border-radius: 7px;
  padding: .42rem .75rem;
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  text-decoration: none;
  position: relative;
}
.sidebar .nav-link:hover,
#sidebar .nav-link:hover {
  background: rgba(139,71,255,.1);
  color: rgba(255,255,255,.85);
}
.sidebar .nav-link.active,
#sidebar .nav-link.active,
.sidebar .nav-link[aria-current="page"],
#sidebar .nav-link[aria-current="page"] {
  background: rgba(139,71,255,.14);
  color: var(--arch-purple);
  font-weight: 600;
}
.sidebar .nav-link.active::before,
#sidebar .nav-link.active::before,
.sidebar .nav-link[aria-current="page"]::before,
#sidebar .nav-link[aria-current="page"]::before {
  content: "";
  position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 2.5px; border-radius: 2px;
  background: var(--arch-gradient);
}
.sidebar .nav-link i,
#sidebar .nav-link i {
  width: 16px; text-align: center; flex-shrink: 0;
}

/* Nav section label */
.nav-section,
.sidebar-section-label {
  font-size: .58rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.18); padding: .65rem .75rem .2rem;
}

/* ── Topbar ────────────────────────────────────────────── */
#topbar, .arch-topbar {
  background: rgba(3,3,18,.85);
  border-bottom: 1px solid var(--arch-border);
  backdrop-filter: blur(20px);
}
[data-theme="light"] #topbar,
[data-theme="light"] .arch-topbar {
  background: rgba(240,240,248,.92);
  border-bottom-color: rgba(139,71,255,.15);
}

/* ── Cards / panels ────────────────────────────────────── */
.panel,
.asc-card,
.arch-card {
  background: rgba(255,255,255,.026);
  border: 1px solid var(--arch-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  backdrop-filter: blur(8px);
  transition: border-color .2s;
}
.panel:hover,
.asc-card:hover,
.arch-card:hover { border-color: rgba(139,71,255,.38); }

[data-theme="light"] .panel,
[data-theme="light"] .asc-card,
[data-theme="light"] .arch-card {
  background: rgba(255,255,255,.7);
  border-color: rgba(139,71,255,.18);
}

.asc-card-title,
.arch-card-title,
.panel-title {
  font-size: .63rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: rgba(255,255,255,.26); margin-bottom: .75rem;
}
[data-theme="light"] .asc-card-title,
[data-theme="light"] .arch-card-title,
[data-theme="light"] .panel-title {
  color: var(--arch-muted);
}

/* ── Stat cards ────────────────────────────────────────── */
.stat-card {
  background: rgba(255,255,255,.026);
  border: 1px solid var(--arch-border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  backdrop-filter: blur(8px);
  position: relative; overflow: hidden;
  transition: border-color .2s, transform .15s;
}
.stat-card:hover { border-color: rgba(0,216,255,.3); transform: translateY(-2px); }
.stat-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--arch-gradient); opacity: .55;
}
[data-theme="light"] .stat-card {
  background: rgba(255,255,255,.75);
  border-color: rgba(139,71,255,.2);
}

/* ── Tables ────────────────────────────────────────────── */
.table {
  color: var(--arch-text) !important;
  border-color: rgba(139,71,255,.15) !important;
  /* Bootstrap 5.3 sets --bs-table-color locally on .table; override it here */
  --bs-table-color: var(--arch-text);
  --bs-table-striped-color: var(--arch-text);
}
/* Bootstrap 5.3 applies color to each cell via :not(caption)>*>* — must override */
.table > :not(caption) > * > * {
  color: var(--arch-text) !important;
}
.table th {
  color: rgba(255,255,255,.38);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid rgba(139,71,255,.2) !important;
  background: rgba(255,255,255,.02);
}
.table td {
  border-color: rgba(139,71,255,.1) !important;
  vertical-align: middle;
}
.table-hover tbody tr:hover td {
  background: rgba(139,71,255,.06) !important;
}
[data-theme="light"] .table {
  --bs-table-color: var(--arch-text);
  --bs-table-striped-color: var(--arch-text);
}
[data-theme="light"] .table > :not(caption) > * > * {
  color: var(--arch-text) !important;
}
[data-theme="light"] .table th {
  color: var(--arch-muted);
  background: var(--arch-surface2);
  border-bottom-color: rgba(139,71,255,.15) !important;
}
[data-theme="light"] .table td {
  border-color: rgba(139,71,255,.12) !important;
}

/* ── Forms ─────────────────────────────────────────────── */
.form-control,
.form-select {
  background: rgba(255,255,255,.05) !important;
  color: var(--arch-text) !important;
  border-color: rgba(139,71,255,.2) !important;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--arch-purple) !important;
  box-shadow: 0 0 0 .2rem rgba(139,71,255,.25) !important;
  background: rgba(255,255,255,.07) !important;
}
.form-control::placeholder { color: rgba(255,255,255,.2); }
.form-label { color: var(--arch-muted); font-size: .85rem; }
[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
  background: var(--arch-surface) !important;
  color: var(--arch-text) !important;
  border-color: rgba(139,71,255,.25) !important;
}
[data-theme="light"] .form-control::placeholder { color: var(--arch-muted); }
[data-theme="light"] .form-label { color: var(--arch-muted); }

/* ── Modals ────────────────────────────────────────────── */
.modal-content {
  background: rgba(12,12,30,.96) !important;
  border: 1px solid rgba(139,71,255,.25) !important;
  color: var(--arch-text);
  backdrop-filter: blur(20px);
}
.modal-header { border-bottom-color: rgba(139,71,255,.2) !important; }
.modal-footer { border-top-color: rgba(139,71,255,.2) !important; }
[data-theme="light"] .modal-content {
  background: rgba(250,250,255,.96) !important;
  border-color: rgba(139,71,255,.2) !important;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn-arch-primary,
.btn-gradient {
  background: var(--arch-gradient);
  color: #fff;
  border: none;
  font-weight: 600;
  transition: opacity .15s, box-shadow .15s;
}
.btn-arch-primary:hover,
.btn-gradient:hover {
  opacity: .9;
  color: #fff;
  box-shadow: 0 4px 20px rgba(139,71,255,.4);
}
.btn-arch-outline {
  background: transparent;
  border: 1.5px solid var(--arch-purple);
  color: var(--arch-purple);
  font-weight: 600;
  transition: all .15s;
}
.btn-arch-outline:hover {
  background: var(--arch-purple);
  color: #fff;
  box-shadow: 0 0 16px rgba(139,71,255,.4);
}
/* Legacy gold accent button (ArchAdmin etc.) */
.btn-accent {
  background: var(--arch-gradient);
  color: #fff;
  border: none;
  font-weight: 600;
}
.btn-accent:hover {
  opacity: .9;
  color: #fff;
}
.btn-outline-secondary {
  border-color: rgba(139,71,255,.25) !important;
  color: rgba(255,255,255,.5) !important;
}
.btn-outline-secondary:hover {
  background: rgba(139,71,255,.1) !important;
  color: rgba(255,255,255,.85) !important;
}

/* ── Dropdowns ─────────────────────────────────────────── */
.dropdown-menu {
  background: rgba(12,12,30,.96) !important;
  border: 1px solid rgba(139,71,255,.2) !important;
  backdrop-filter: blur(12px);
}
.dropdown-item {
  color: var(--arch-text) !important;
}
.dropdown-item:hover {
  background: rgba(139,71,255,.1) !important;
  color: #fff !important;
}
.dropdown-divider { border-color: rgba(139,71,255,.15) !important; }

/* ── Nav tabs ──────────────────────────────────────────── */
.nav-tabs {
  border-bottom-color: rgba(139,71,255,.2) !important;
}
.nav-tabs .nav-link {
  color: rgba(255,255,255,.38);
  border-color: transparent;
  font-size: .85rem;
}
.nav-tabs .nav-link:hover {
  color: rgba(255,255,255,.75);
  border-color: transparent;
}
.nav-tabs .nav-link.active {
  background: transparent;
  color: var(--arch-cyan);
  border-color: transparent !important;
  border-bottom: 2px solid var(--arch-cyan) !important;
}
[data-theme="light"] .nav-tabs .nav-link { color: var(--arch-muted); }
[data-theme="light"] .nav-tabs .nav-link.active { color: var(--arch-purple); border-bottom-color: var(--arch-purple) !important; }

/* ── View routing (ArchAdmin pattern) ──────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ── Status dots ───────────────────────────────────────── */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.status-dot.active    { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.5); }
.status-dot.trial     { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,.5); }
.status-dot.free      { background: var(--arch-cyan); box-shadow: var(--arch-glow-c); }
.status-dot.suspended { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.5); }
.status-dot.revoked   { background: #6b7280; }
.status-dot.unknown   { background: #6b7280; }

/* ── Badges ────────────────────────────────────────────── */
.badge-arch {
  padding: .25em .6em; border-radius: 5px;
  font-size: .72rem; font-weight: 600;
}
.badge-active    { background: rgba(34,197,94,.12);   color: #4ade80;            border: 1px solid rgba(34,197,94,.25); }
.badge-trial     { background: rgba(245,158,11,.1);   color: #fbbf24;            border: 1px solid rgba(245,158,11,.25); }
.badge-suspended { background: rgba(239,68,68,.1);    color: #f87171;            border: 1px solid rgba(239,68,68,.2); }
.badge-revoked   { background: rgba(107,114,128,.1);  color: #9ca3af;            border: 1px solid rgba(107,114,128,.2); }
.badge-rank      { background: rgba(201,168,76,.12);  color: var(--arch-gold);   border: 1px solid rgba(201,168,76,.25); }
.badge-online    { background: rgba(34,197,94,.12);   color: #4ade80;            border: 1px solid rgba(34,197,94,.25); }
.badge-offline   { background: rgba(107,114,128,.1);  color: #9ca3af;            border: 1px solid rgba(107,114,128,.2); }
.badge-loa       { background: rgba(245,158,11,.1);   color: #fbbf24;            border: 1px solid rgba(245,158,11,.25); }
.badge-inactive  { background: rgba(239,68,68,.1);    color: #f87171;            border: 1px solid rgba(239,68,68,.2); }
.badge-pending   { background: rgba(139,71,255,.12);  color: var(--arch-purple); border: 1px solid rgba(139,71,255,.25); }
.badge-approved  { background: rgba(34,197,94,.12);   color: #4ade80;            border: 1px solid rgba(34,197,94,.25); }
.badge-denied    { background: rgba(239,68,68,.1);    color: #f87171;            border: 1px solid rgba(239,68,68,.2); }
.badge-open      { background: rgba(0,216,255,.08);   color: var(--arch-cyan);   border: 1px solid rgba(0,216,255,.2); }
.badge-closed    { background: rgba(107,114,128,.1);  color: #9ca3af;            border: 1px solid rgba(107,114,128,.2); }
.badge-upheld    { background: rgba(239,68,68,.1);    color: #f87171;            border: 1px solid rgba(239,68,68,.2); }
.badge-overturned{ background: rgba(34,197,94,.12);   color: #4ade80;            border: 1px solid rgba(34,197,94,.25); }
.badge-present   { background: rgba(34,197,94,.12);   color: #4ade80;            border: 1px solid rgba(34,197,94,.25); }
.badge-excused   { background: rgba(245,158,11,.1);   color: #fbbf24;            border: 1px solid rgba(245,158,11,.25); }
.badge-absent    { background: rgba(239,68,68,.1);    color: #f87171;            border: 1px solid rgba(239,68,68,.2); }
.badge-met       { background: rgba(34,197,94,.12);   color: #4ade80;            border: 1px solid rgba(34,197,94,.25); }
.badge-unmet     { background: rgba(239,68,68,.1);    color: #f87171;            border: 1px solid rgba(239,68,68,.2); }
.badge-clocked-in  { background: rgba(34,197,94,.12); color: #4ade80;            border: 1px solid rgba(34,197,94,.25); }
.badge-terminated  { background: rgba(239,68,68,.1);  color: #f87171;            border: 1px solid rgba(239,68,68,.2); }

/* Shared padding for all badge-* classes */
[class*="badge-"] { padding: .25em .55em; border-radius: 4px; font-size: .72rem; font-weight: 600; }

/* ── Rank groups / member cards ────────────────────────── */
.rank-header {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--arch-cyan); font-weight: 700;
  padding: .35rem .5rem;
  border-bottom: 1px solid var(--arch-border);
  margin-bottom: .5rem;
}
.rank-group {
  background: rgba(255,255,255,.026);
  border: 1px solid var(--arch-border);
  border-radius: 8px; overflow: hidden;
  backdrop-filter: blur(6px);
}
[data-theme="light"] .rank-group {
  background: rgba(255,255,255,.7);
  border-color: rgba(139,71,255,.2);
}
.member-card {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--arch-border);
  display: flex; align-items: center; gap: .6rem;
  font-size: .875rem; transition: background .12s;
}
.member-card:last-child { border-bottom: none; }
.member-card:hover { background: rgba(139,71,255,.06); }
.member-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.member-avatar-placeholder {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--arch-surface2);
  border: 1px solid var(--arch-border);
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; color: var(--arch-muted); flex-shrink: 0;
}

/* ── Empty states ──────────────────────────────────────── */
.no-content, .no-dept, .no-biz {
  text-align: center; padding: 3rem 1rem; color: var(--arch-muted);
}
.no-content i, .no-dept i, .no-biz i {
  font-size: 2.5rem; display: block; margin-bottom: .75rem; opacity: .4;
}

/* ── Toast notifications ───────────────────────────────── */
#toast-container,
#toast-area {
  position: fixed; bottom: 1.25rem; right: 1.25rem;
  z-index: 9999; display: flex; flex-direction: column;
  gap: .5rem; pointer-events: none;
}
.toast-msg,
.asc-toast,
.arch-toast {
  background: rgba(12,12,30,.92);
  border: 1px solid var(--arch-border);
  border-left: 3px solid var(--arch-purple);
  color: var(--arch-text);
  padding: .65rem 1rem; border-radius: 9px;
  font-size: .875rem; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.4), var(--arch-glow-p);
  pointer-events: auto;
  animation: arch-fadeIn .2s ease;
  min-width: 220px; max-width: 360px;
  backdrop-filter: blur(12px);
}
.toast-msg.toast-error,  .asc-toast.err { border-left-color: var(--arch-danger); }
.toast-msg.toast-success,.asc-toast.ok  { border-left-color: var(--arch-success); }
.toast-msg.toast-warn                   { border-left-color: var(--arch-warning); }
@keyframes arch-fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Theme toggle button ───────────────────────────────── */
.theme-btn {
  background: transparent;
  border: 1px solid var(--arch-border);
  color: var(--arch-muted);
  border-radius: 6px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .85rem;
  transition: color .15s, border-color .15s;
}
.theme-btn:hover { color: var(--arch-cyan); border-color: var(--arch-border2); }

/* ── Section titles ────────────────────────────────────── */
.section-title {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,.25); font-weight: 700; margin-bottom: .75rem;
}
[data-theme="light"] .section-title { color: var(--arch-muted); }
.muted { color: var(--arch-muted) !important; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: rgba(139,71,255,.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139,71,255,.5); }

/* ── Limit bars ────────────────────────────────────────── */
.limit-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; font-size: .8125rem; }
.limit-label { min-width: 130px; color: var(--arch-muted); }
.limit-bar-wrap { flex: 1; background: rgba(255,255,255,.06); border-radius: 999px; height: 5px; overflow: hidden; }
.limit-bar-fill { height: 100%; border-radius: 999px; background: var(--arch-gradient); transition: width .4s; }
.limit-val { min-width: 70px; text-align: right; color: rgba(255,255,255,.35); font-size: .72rem; }

/* ── Public portal top-nav ─────────────────────────────── */
.arch-topnav {
  background: rgba(3,3,18,.92);
  border-bottom: 1px solid var(--arch-border);
  padding: .6rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  backdrop-filter: blur(16px);
}
.arch-topnav .nav-link {
  color: rgba(255,255,255,.42);
  font-size: .875rem; text-decoration: none;
  padding: .3rem .6rem; border-radius: 5px;
  transition: color .15s, background .15s;
}
.arch-topnav .nav-link:hover { color: rgba(255,255,255,.85); background: rgba(139,71,255,.1); }
.arch-topnav .nav-link.active { color: var(--arch-cyan); }

/* ── Department/business banner ────────────────────────── */
.arch-banner {
  background: linear-gradient(135deg, var(--arch-surface2) 0%, var(--arch-surface) 100%);
  border-bottom: 1px solid var(--arch-border);
  min-height: 120px;
  display: flex; align-items: flex-end;
  padding: 1.25rem 1.5rem;
  background-size: cover; background-position: center;
  position: relative;
}
.arch-banner::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(4,4,14,.9) 0%, rgba(4,4,14,.3) 100%);
}
.arch-banner-content { position: relative; z-index: 1; }

/* ── Community indicator in module headers ─────────────── */
.arch-community-badge {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .72rem; color: rgba(255,255,255,.35);
  background: rgba(139,71,255,.1); border: 1px solid rgba(139,71,255,.2);
  border-radius: 6px; padding: .25rem .65rem;
  white-space: nowrap;
}
.arch-community-badge .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--arch-cyan); box-shadow: 0 0 5px rgba(0,216,255,.6);
}
