/* ═══════════════════════════════════════════════════════════════════
   REDTEAM FRAMEWORK MANAGER — TACTICAL OPS THEME
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg-0:        #04080c;
  --bg-1:        #080d12;
  --bg-2:        #0d1520;
  --bg-3:        #111d2b;
  --bg-card:     #0b1219;
  --border:      #1a2a3a;
  --border-glow: #1e3a5f;

  --red:         #e63950;
  --red-dim:     #8b1a27;
  --red-glow:    rgba(230, 57, 80, 0.15);
  --green:       #00e5a0;
  --green-dim:   #00704e;
  --amber:       #f5a623;
  --blue:        #3b9eff;
  --cyan:        #00d4e8;

  --text-primary:   #dce8f5;
  --text-secondary: #7a9bb5;
  --text-muted:     #3d5a72;
  --text-label:     #4a7a9b;

  --font-mono:  'Share Tech Mono', monospace;
  --font-ui:    'Exo 2', sans-serif;
  --font-title: 'Rajdhani', sans-serif;

  --sidebar-w:  260px;
  --header-h:   56px;

  --risk-critique: #ff2d55;
  --risk-eleve:    #ff6b35;
  --risk-moyen:    #f5a623;
  --risk-faible:   #00e5a0;
  --risk-info:     #3b9eff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: var(--font-ui);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.06) 2px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ─── SCROLLBAR ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--border-glow); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

/* ─── BOOT SCREEN ─────────────────────────────────────────────────── */
.boot-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg-0);
}
.boot-text {
  font-family: var(--font-mono);
  color: var(--green);
  font-size: 1rem;
  letter-spacing: 0.1em;
}
.blink { animation: blink 1s step-end infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* ─── LOGIN ───────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #0d1e30 0%, var(--bg-0) 70%);
  padding: 1rem;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--red);
  padding: 2.5rem 2rem;
  position: relative;
  box-shadow: 0 0 60px rgba(230, 57, 80, 0.08), 0 40px 80px rgba(0,0,0,0.6);
}
.login-card::before {
  content: '// CLASSIFIED //';
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--red);
  letter-spacing: 0.15em;
  position: absolute;
  top: -0.85rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  padding: 0 0.75rem;
  white-space: nowrap;
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo .logo-icon {
  width: 52px;
  height: 52px;
  background: var(--red-glow);
  border: 1px solid var(--red-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.4rem;
}
.login-logo h1 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-transform: uppercase;
}
.login-logo p {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  margin-top: 0.25rem;
}
.login-error {
  background: rgba(230, 57, 80, 0.1);
  border: 1px solid var(--red-dim);
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
  display: none;
}
.login-error.visible { display: block; }

/* ─── APP SHELL ───────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── SIDEBAR ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  position: relative;
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--red) 30%, var(--red) 70%, transparent);
  opacity: 0.3;
}
.sidebar-logo {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-logo .s-icon {
  width: 34px;
  height: 34px;
  background: var(--red-glow);
  border: 1px solid var(--red-dim);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.sidebar-logo .s-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1.2;
}
.sidebar-logo .s-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.sidebar-user {
  padding: 0.75rem 1.25rem;
  background: rgba(59, 158, 255, 0.05);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.user-avatar {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--bg-0);
  flex-shrink: 0;
}
.user-info .u-name {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-primary);
}
.user-info .u-role {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.role-admin { color: var(--red) !important; }

.sidebar-nav { padding: 0.75rem 0; flex: 1; }
.nav-section-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.5rem 1.25rem 0.25rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  position: relative;
  user-select: none;
}
.nav-item:hover {
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
}
.nav-item.active {
  border-left-color: var(--red);
  background: rgba(230, 57, 80, 0.07);
  color: var(--text-primary);
}
.nav-item .nav-icon { font-size: 0.9rem; width: 18px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 0.75rem;
}
.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 4px;
}
.btn-logout:hover {
  border-color: var(--red-dim);
  color: var(--red);
  background: var(--red-glow);
}

/* ─── MAIN CONTENT ────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-0);
  display: flex;
  flex-direction: column;
}
.page-header {
  padding: 1.25rem 1.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.page-header-left .page-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-header-left .page-subtitle {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-top: 0.15rem;
}
.page-body { padding: 1.5rem 1.75rem; flex: 1; }

/* ─── STAT CARDS ──────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.stat-card.s-total::before   { background: var(--blue); }
.stat-card.s-active::before  { background: var(--amber); }
.stat-card.s-done::before    { background: var(--green); }
.stat-card.s-critical::before { background: var(--red); }

.stat-card:hover { border-color: var(--border-glow); }
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.stat-value {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}
.stat-card.s-total .stat-value   { color: var(--blue); }
.stat-card.s-active .stat-value  { color: var(--amber); }
.stat-card.s-done .stat-value    { color: var(--green); }
.stat-card.s-critical .stat-value { color: var(--red); }
.stat-icon {
  position: absolute;
  bottom: 0.75rem; right: 1rem;
  font-size: 1.75rem;
  opacity: 0.08;
}

/* ─── FILTERS BAR ─────────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s;
}
.search-box input:focus { border-color: var(--border-glow); }
.search-box::before {
  content: '🔍';
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  pointer-events: none;
}
.filter-select {
  padding: 0.55rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
  min-width: 130px;
}
.filter-select:focus { border-color: var(--border-glow); }

/* ─── TABLE ───────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.ops-table thead {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.ops-table th {
  padding: 0.7rem 0.85rem;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  border-right: 1px solid var(--border);
}
.ops-table th:last-child { border-right: none; }
.ops-table tbody tr {
  border-bottom: 1px solid rgba(26,42,58,0.6);
  transition: background 0.12s;
  cursor: pointer;
}
.ops-table tbody tr:hover { background: rgba(59, 158, 255, 0.04); }
.ops-table td {
  padding: 0.65rem 0.85rem;
  color: var(--text-secondary);
  border-right: 1px solid rgba(26,42,58,0.4);
  vertical-align: middle;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ops-table td:last-child { border-right: none; }
.ops-table td.td-name {
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-ui);
  max-width: 200px;
}
.ops-table .td-id {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}
.ops-table .td-actions {
  white-space: nowrap;
  width: 90px;
}

/* ─── BADGES ──────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-statut-planifie   { background: rgba(59,158,255,0.12); color: var(--blue); border: 1px solid rgba(59,158,255,0.25); }
.badge-statut-en-cours   { background: rgba(245,166,35,0.12); color: var(--amber); border: 1px solid rgba(245,166,35,0.25); }
.badge-statut-termine    { background: rgba(0,229,160,0.12); color: var(--green); border: 1px solid rgba(0,229,160,0.25); }
.badge-statut-bloque     { background: rgba(230,57,80,0.12); color: var(--red); border: 1px solid rgba(230,57,80,0.25); }
.badge-statut-annule     { background: rgba(122,155,181,0.1); color: var(--text-muted); border: 1px solid rgba(122,155,181,0.2); }

.badge-risk-critique { background: rgba(255,45,85,0.15); color: #ff2d55; border: 1px solid rgba(255,45,85,0.3); }
.badge-risk-eleve    { background: rgba(255,107,53,0.15); color: #ff6b35; border: 1px solid rgba(255,107,53,0.3); }
.badge-risk-moyen    { background: rgba(245,166,35,0.15); color: var(--amber); border: 1px solid rgba(245,166,35,0.3); }
.badge-risk-faible   { background: rgba(0,229,160,0.12); color: var(--green); border: 1px solid rgba(0,229,160,0.25); }
.badge-risk-info     { background: rgba(59,158,255,0.12); color: var(--blue); border: 1px solid rgba(59,158,255,0.25); }

/* ─── BUTTONS ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.03em;
}
.btn-primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-primary:hover { background: #c0392b; border-color: #c0392b; box-shadow: 0 0 12px rgba(230,57,80,0.3); }
.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--border-glow); color: var(--text-primary); background: rgba(255,255,255,0.03); }
.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: var(--red-dim);
}
.btn-danger:hover { background: var(--red-glow); }
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.3rem 0.5rem;
  font-size: 1rem;
}
.btn-ghost:hover { color: var(--text-primary); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.76rem; }
.btn-icon { padding: 0.35rem; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; transition: all 0.15s; border-radius: 3px; font-size: 0.9rem; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; }
.btn-icon:hover { border-color: var(--blue); color: var(--blue); }
.btn-icon.danger:hover { border-color: var(--red); color: var(--red); }

/* ─── FORM ────────────────────────────────────────────────────────── */
.form-page { max-width: 1100px; }
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.form-section-header {
  background: var(--bg-2);
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.form-section-header .sec-icon { font-size: 0.9rem; }
.form-section-header .sec-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  flex: 1;
}
.form-section-header .sec-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
}
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-label);
}
.form-label .req { color: var(--red); margin-left: 2px; }
.form-control {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(59, 158, 255, 0.08);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; font-family: var(--font-ui); line-height: 1.5; }
select.form-control { cursor: pointer; }
select.form-control option { background: var(--bg-2); }
input[type="number"].form-control { appearance: textfield; }

.cvss-row { display: flex; align-items: center; gap: 0.75rem; }
.cvss-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.cvss-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s, background 0.3s;
}
.cvss-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: bold;
  width: 32px;
  text-align: right;
}

.cia-grid { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.cia-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.cia-check input { display: none; }
.cia-box {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: bold;
  transition: all 0.15s;
  color: var(--text-muted);
}
.cia-check input:checked + .cia-box {
  border-color: var(--green);
  background: rgba(0,229,160,0.1);
  color: var(--green);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-top: 0.5rem;
  flex-wrap: wrap;
}

/* ─── DETAIL VIEW ─────────────────────────────────────────────────── */
.detail-page { max-width: 1000px; }
.detail-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 2px solid var(--red);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.detail-op-id {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  margin-bottom: 0.25rem;
}
.detail-op-name {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.detail-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.detail-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.detail-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 0.85rem;
  overflow: hidden;
}
.detail-section-title {
  background: var(--bg-2);
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.detail-section-title span:first-child {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0;
}
.detail-field {
  padding: 0.75rem 1rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.detail-field:last-child { border-right: none; }
.detail-field-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.detail-field-value {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}
.detail-text-field {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.detail-text-field:last-child { border-bottom: none; }
.detail-text-field .detail-field-value {
  margin-top: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
}
.empty-val { color: var(--text-muted) !important; font-style: italic; font-size: 0.78rem !important; }
.mitre-tag {
  display: inline-block;
  background: rgba(0,212,232,0.08);
  border: 1px solid rgba(0,212,232,0.2);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  margin: 0.15rem 0.25rem 0.15rem 0;
  border-radius: 2px;
}

/* ─── USERS PAGE ──────────────────────────────────────────────────── */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.user-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: border-color 0.15s;
}
.user-card:hover { border-color: var(--border-glow); }
.user-card-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
  color: var(--bg-0);
  flex-shrink: 0;
}
.user-card-avatar.is-admin { background: linear-gradient(135deg, var(--red), #ff6b6b); }
.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-weight: 600; color: var(--text-primary); margin-bottom: 0.15rem; }
.user-card-role {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.user-card-role.is-admin { color: var(--red); }
.user-card-date {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.add-user-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.25rem;
}
.add-user-form h3 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.add-user-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.75rem; align-items: end; }

/* ─── ALERT / TOAST ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-primary);
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: slideIn 0.2s ease, fadeOut 0.3s ease 2.7s forwards;
  pointer-events: all;
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* ─── MODAL ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,8,12,0.85);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeInOverlay 0.15s ease;
}
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--red);
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
  animation: slideUp 0.2s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.modal p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.5; margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ─── EMPTY STATE ─────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state p { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.08em; }

/* ─── CHANGE PASSWORD FORM ────────────────────────────────────────── */
.pwd-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.25rem;
  max-width: 420px;
}
.pwd-form h3 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

/* ─── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 220px; }
  .page-body { padding: 1rem; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .add-user-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 580px) {
  .sidebar { display: none; }
  .main-content { width: 100%; }
}
