/* =====================================================
   Asna Network OS — UI Redesign v2
   Theme: Dark Glass / Deep Space
   Fonts: Syne (display) + Outfit (body) + JetBrains Mono
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ───────────────────────────────── */
:root {
  /* Base palette */
  --bg:            #080c14;
  --bg-2:          #0d1220;
  --surface:       rgba(255,255,255,.04);
  --surface-2:     rgba(255,255,255,.07);
  --surface-3:     rgba(255,255,255,.11);
  --surface-solid: #111827;

  /* Borders */
  --border:        rgba(255,255,255,.08);
  --border-2:      rgba(255,255,255,.13);
  --border-accent: rgba(99,102,241,.4);

  /* Text */
  --text:          #f0f2f8;
  --text-2:        #8b92a9;
  --text-3:        #4b5268;
  --text-inv:      #080c14;

  /* Accent — electric indigo */
  --accent:        #6366f1;
  --accent-2:      #818cf8;
  --accent-dark:   #4f52d4;
  --accent-glow:   rgba(99,102,241,.25);
  --accent-soft:   rgba(99,102,241,.12);

  /* Semantic colors */
  --green:         #10b981;
  --green-soft:    rgba(16,185,129,.12);
  --red:           #f43f5e;
  --red-soft:      rgba(244,63,94,.12);
  --blue:          #38bdf8;
  --blue-soft:     rgba(56,189,248,.12);
  --orange:        #f59e0b;
  --orange-soft:   rgba(245,158,11,.12);
  --purple:        #a78bfa;
  --purple-soft:   rgba(167,139,250,.12);
  --teal:          #2dd4bf;
  --teal-soft:     rgba(45,212,191,.12);

  /* Layout */
  --sidebar-w:     260px;
  --topbar-h:      64px;
  --radius:        10px;
  --radius-lg:     14px;
  --radius-xl:     20px;

  /* Shadows / Glows */
  --shadow:        0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.05) inset;
  --glow-accent:   0 0 24px rgba(99,102,241,.2);

  /* Fonts */
  --font:          'Outfit', sans-serif;
  --font-display:  'Syne', sans-serif;
  --mono:          'JetBrains Mono', monospace;

  --ease:          cubic-bezier(.4,0,.2,1);
  --transition:    all .2s var(--ease);
}

/* ── Reset ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  /* Subtle grid texture */
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(99,102,241,.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(45,212,191,.05) 0%, transparent 50%);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* ── Layout ──────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: rgba(8,12,20,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform .3s var(--ease);
}

/* Glowing edge on sidebar right */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: -1px; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--accent) 40%, var(--teal) 70%, transparent);
  opacity: .3;
}

.sidebar-header {
  padding: 26px 22px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo { display: flex; align-items: center; gap: 12px; }

.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
  box-shadow: 0 0 16px rgba(99,102,241,.4);
  flex-shrink: 0;
}

.logo-text { display: flex; flex-direction: column; }
.logo-name {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -.02em;
}
.logo-tagline {
  font-size: .65rem;
  color: var(--text-3);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 14px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-label {
  display: block;
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-3);
  padding: 12px 10px 6px;
  margin-top: 4px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: .86rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
}
.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transform: scaleY(0);
  transition: transform .2s var(--ease);
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-item:hover::before { transform: scaleY(.5); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-2);
  border: 1px solid var(--border-accent);
}
.nav-item.active::before { transform: scaleY(1); }

.nav-icon {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
  opacity: .7;
  transition: opacity .2s;
}
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.user-card:hover { background: var(--surface-2); border-color: var(--border-2); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(99,102,241,.3);
}

.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role { font-size: .68rem; color: var(--text-3); }

.logout-btn {
  background: none; border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  font-size: .9rem;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.logout-btn:hover { color: var(--red); background: var(--red-soft); }

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────── */
.topbar {
  background: rgba(8,12,20,.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}
.page-subtitle {
  font-size: .75rem;
  color: var(--text-3);
  margin-top: 1px;
}
.topbar-actions {
  display: flex; align-items: center; gap: 10px;
}

/* ── Page Body ───────────────────────────────────── */
.page-body {
  padding: 28px 32px;
  flex: 1;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: .01em;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  background: rgba(255,255,255,.08);
  transition: opacity .15s;
}
.btn:hover::after { opacity: 1; }

.btn-primary {
  background: var(--text);
  color: var(--text-inv);
  border-color: var(--text);
}
.btn-primary:hover { background: #d0d4e8; }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
.btn-accent:hover { box-shadow: 0 0 24px rgba(99,102,241,.4); }

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

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(244,63,94,.3);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm  { padding: 5px 13px; font-size: .79rem; }
.btn-xs  { padding: 3px 9px;  font-size: .74rem; border-radius: 7px; }
.w-full  { width: 100%; justify-content: center; }

/* ================================================================
   FLASH MESSAGES
   ================================================================ */
.flash {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: .86rem;
  font-weight: 500;
  animation: slideDown .3s var(--ease);
  backdrop-filter: blur(8px);
}
.flash-success { background: var(--green-soft); color: var(--green); border: 1px solid rgba(16,185,129,.25); }
.flash-error   { background: var(--red-soft);   color: var(--red);   border: 1px solid rgba(244,63,94,.25); }
.flash-info    { background: var(--blue-soft);   color: var(--blue);  border: 1px solid rgba(56,189,248,.25); }
.flash-warning { background: var(--orange-soft); color: var(--orange);border: 1px solid rgba(245,158,11,.25); }
.flash-close {
  margin-left: auto; background: none; border: none;
  cursor: pointer; opacity: .5; font-size: 1rem; padding: 0 4px; color: inherit;
}
.flash-close:hover { opacity: 1; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color .2s, box-shadow .2s;
}
.card:hover { border-color: var(--border-2); }

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}
.card-body   { padding: 22px; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.15);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ================================================================
   STAT CARDS
   ================================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  cursor: default;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.stat-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-lg), var(--glow-accent);
  transform: translateY(-2px);
}
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.stat-icon-amber  { background: var(--orange-soft); color: var(--orange); }
.stat-icon-green  { background: var(--green-soft);  color: var(--green);  }
.stat-icon-blue   { background: var(--blue-soft);   color: var(--blue);   }
.stat-icon-orange { background: var(--orange-soft); color: var(--orange); }
.stat-icon-purple { background: var(--purple-soft); color: var(--purple); }
.stat-icon-teal   { background: var(--teal-soft);   color: var(--teal);   }
.stat-icon-accent { background: var(--accent-soft); color: var(--accent-2); }

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -.04em;
}
.stat-label {
  font-size: .73rem;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* ================================================================
   TABLES
   ================================================================ */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: .85rem; }

thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.2);
  white-space: nowrap;
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
  transition: background .15s;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); color: var(--text); }

.td-actions { display: flex; gap: 5px; align-items: center; }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .03em;
}
.badge-success { background: var(--green-soft);  color: var(--green);  border: 1px solid rgba(16,185,129,.2); }
.badge-warning { background: var(--orange-soft); color: var(--orange); border: 1px solid rgba(245,158,11,.2); }
.badge-neutral { background: var(--surface-2);   color: var(--text-2); border: 1px solid var(--border); }
.badge-blue    { background: var(--blue-soft);   color: var(--blue);   border: 1px solid rgba(56,189,248,.2); }
.badge-accent  { background: var(--accent-soft); color: var(--accent-2);border: 1px solid var(--border-accent); }
.badge-purple  { background: var(--purple-soft); color: var(--purple); border: 1px solid rgba(167,139,250,.2); }

.type-badge {
  font-family: var(--mono);
  font-size: .67rem;
  padding: 2px 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-3);
  letter-spacing: .04em;
}

/* ================================================================
   PROGRESS BARS
   ================================================================ */
.progress-wrap { display: flex; flex-direction: column; gap: 5px; min-width: 130px; }

.progress-bar {
  height: 6px;
  background: var(--surface-3);
  border-radius: 20px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .7s var(--ease);
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3));
}
.progress-fill.complete { background: linear-gradient(90deg, var(--green), var(--teal)); }
.progress-fill.low      { background: linear-gradient(90deg, var(--red), #fb7185); }

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .71rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ================================================================
   FORMS
   ================================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .08em;
}
.form-label .required { color: var(--red); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 9px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .86rem;
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control::placeholder { color: var(--text-3); }
textarea.form-control { resize: vertical; min-height: 88px; }

/* Style select options */
.form-control option {
  background: var(--surface-solid);
  color: var(--text);
}

.form-hint { font-size: .73rem; color: var(--text-3); margin-top: 5px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-section-title {
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-3);
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  margin-top: 6px;
}

/* ================================================================
   SEARCH BAR
   ================================================================ */
.search-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-input-wrap { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: .9rem; pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 8px 13px 8px 33px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .84rem;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus { border-color: var(--accent); background: var(--surface-3); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ================================================================
   GRID LAYOUTS
   ================================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* ================================================================
   ENTITY CARDS
   ================================================================ */
.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.entity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.entity-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(99,102,241,.05), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.entity-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--glow-accent);
}
.entity-card:hover::before { opacity: 1; }

.entity-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.entity-card-name  { font-size: .92rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.entity-card-desc  { font-size: .8rem; color: var(--text-2); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entity-card-meta  { display: flex; align-items: center; gap: 10px; font-size: .75rem; color: var(--text-3); padding-top: 8px; border-top: 1px solid var(--border); }
.entity-card-actions { display: flex; gap: 6px; margin-top: 2px; }

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(99,102,241,.1);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(.97);
  transition: transform .25s var(--ease);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}
.modal-close {
  background: var(--surface-2); border: 1px solid var(--border);
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem; color: var(--text-2);
  transition: var(--transition);
}
.modal-close:hover { background: var(--red-soft); color: var(--red); border-color: rgba(244,63,94,.3); }

.modal-body   { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.2);
  display: flex; justify-content: flex-end; gap: 10px;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ================================================================
   BREADCRUMB
   ================================================================ */
.breadcrumb {
  display: flex; align-items: center; gap: 7px;
  font-size: .77rem; color: var(--text-3);
  margin-bottom: 18px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-2); transition: color .15s; }
.breadcrumb a:hover { color: var(--accent-2); }
.breadcrumb-sep { color: var(--text-3); font-size: .7rem; }
.breadcrumb-current { color: var(--text); font-weight: 600; }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 64px 30px; text-align: center; gap: 12px;
}
.empty-icon  { font-size: 3rem; opacity: .2; filter: grayscale(1); }
.empty-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--text); }
.empty-desc  { font-size: .83rem; color: var(--text-2); max-width: 280px; line-height: 1.6; }

/* ================================================================
   DASHBOARD SPECIFIC
   ================================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
}

.activity-item {
  display: flex; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 7px; flex-shrink: 0;
  box-shadow: 0 0 6px var(--accent);
}

.activity-text { font-size: .83rem; color: var(--text-2); line-height: 1.45; }
.activity-time { font-size: .72rem; color: var(--text-3); margin-top: 3px; }

.hierarchy-link {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .8rem; color: var(--accent-2); font-weight: 600;
  transition: color .15s;
}
.hierarchy-link:hover { color: var(--accent); }

/* ================================================================
   AUTH PAGES
   ================================================================ */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 50% at 30% 20%, rgba(99,102,241,.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 70% 80%, rgba(45,212,191,.08) 0%, transparent 50%);
  padding: 20px;
}

.auth-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(99,102,241,.08);
  width: 100%; max-width: 400px;
  padding: 40px;
}

.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; justify-content: center; }
.auth-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 6px; letter-spacing: -.03em; }
.auth-subtitle { font-size: .85rem; color: var(--text-2); text-align: center; margin-bottom: 28px; }

/* ================================================================
   TABS
   ================================================================ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab-btn {
  padding: 9px 18px; font-size: .83rem; font-weight: 600;
  color: var(--text-3); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: var(--transition); margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-2); }
.tab-btn.active { color: var(--accent-2); border-bottom-color: var(--accent); }

/* ================================================================
   UTILITY CLASSES
   ================================================================ */
.text-muted   { color: var(--text-2); }
.text-small   { font-size: .8rem; }
.text-center  { text-align: center; }
.font-mono    { font-family: var(--mono); font-size: .83em; }
.font-display { font-family: var(--font-display); }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ================================================================
   MOBILE HAMBURGER
   ================================================================ */
.hamburger {
  display: none; background: none; border: none;
  cursor: pointer; padding: 6px;
  flex-direction: column; gap: 5px;
  border-radius: 7px; transition: background .15s;
}
.hamburger:hover { background: var(--surface-2); }
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text-2); border-radius: 2px; transition: var(--transition);
}
@media (max-width: 900px) { .hamburger { display: flex; } }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px); z-index: 99;
}
@media (max-width: 900px) { .sidebar-overlay.active { display: block; } }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-body { padding: 18px 16px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 600px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .entity-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   GLOW PING ANIMATION (for live indicators)
   ================================================================ */
@keyframes ping {
  0%   { transform: scale(1); opacity: .8; }
  100% { transform: scale(2.2); opacity: 0; }
}
.glow-ping::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  animation: ping 1.5s ease-out infinite;
}

/* ================================================================
   SKELETON LOADER
   ================================================================ */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
