/* ============================================================
   DisasterAI — Aero Command UI
   Redesigned: Premium UAV/Satellite dark command center
   Fonts: Rajdhani (headers) · Nunito Sans (body) · JetBrains Mono (data)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Nunito+Sans:ital,opsz,wght@0,6..12,300;0,6..12,400;0,6..12,600;0,6..12,700;1,6..12,400&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg:       #060a12;
  --bg2:      #0c1220;
  --bg3:      #121a2e;
  --surface:  rgba(14,22,40,0.85);
  --surface2: rgba(20,30,55,0.7);
  --glass:    rgba(16,26,48,0.55);
  --border:   rgba(56,140,255,0.15);
  --border2:  rgba(255,255,255,0.06);
  --border-glow: rgba(56,140,255,0.35);
  --accent:   #388cff;
  --accent2:  #1b6ee0;
  --accent3:  #00e5c8;
  --red:      #ff4d6a;
  --green:    #00e5a0;
  --amber:    #ffb84d;
  --cyan:     #00d4ff;
  --text:     #e8ecf4;
  --text2:    #8a9ab5;
  --text3:    #4a5a78;
  --shadow:   0 4px 32px rgba(0,0,0,0.55);
  --shadow2:  0 8px 48px rgba(0,0,0,0.7);
  --glow:     0 0 30px rgba(56,140,255,0.25);
  --glow-accent: 0 0 40px rgba(56,140,255,0.3);
  --mono:     'JetBrains Mono', monospace;
  --head:     'Rajdhani', sans-serif;
  --body:     'Nunito Sans', sans-serif;
  --radius:   8px;
  --radius-lg: 14px;
}

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

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

/* ATMOSPHERIC BACKGROUND */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse at 10% 80%, rgba(56,140,255,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 20%, rgba(0,229,200,0.04) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(56,140,255,0.02) 0%, transparent 70%);
  pointer-events: none;
}

/* ═══ HEADER ═══ */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(6,10,18,0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent3) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 20px rgba(56,140,255,0.3), inset 0 1px 1px rgba(255,255,255,0.2);
}
.logo-text {
  font-family: var(--head); font-size: 22px; font-weight: 700;
  color: #fff; letter-spacing: 2px; line-height: 1;
  background: linear-gradient(135deg, #fff 60%, var(--accent3));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-sub {
  font-family: var(--mono); font-size: 9px; color: var(--text3);
  font-weight: 400; margin-top: 2px; letter-spacing: 1.5px; text-transform: uppercase;
}

.header-right { display: flex; align-items: center; gap: 16px; }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--green); }
  50% { opacity: 0.4; box-shadow: none; }
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); animation: pulse 2.5s ease-in-out infinite;
}
.status-label {
  font-family: var(--mono); font-size: 10px; color: var(--green);
  letter-spacing: 1px; font-weight: 500;
}
.time-display {
  font-family: var(--mono); font-size: 11px; color: var(--cyan);
  background: rgba(0,212,255,0.06);
  padding: 5px 14px; border: 1px solid rgba(0,212,255,0.15);
  border-radius: 6px; letter-spacing: 0.8px;
}

/* ═══ SIDEBAR NAV ═══ */
.sidebar {
  position: fixed; top: 56px; left: 0; bottom: 0;
  width: 240px; z-index: 150;
  background: rgba(8,14,26,0.95);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.nav-section {
  padding: 0 12px; margin-bottom: 4px;
}
.nav-section-title {
  font-family: var(--mono); font-size: 9px; font-weight: 500;
  color: var(--text3); letter-spacing: 2px; text-transform: uppercase;
  padding: 12px 12px 8px; display: flex; align-items: center; gap: 8px;
}
.nav-section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer; border-radius: var(--radius);
  font-family: var(--body); font-size: 13px; font-weight: 400;
  color: var(--text2); transition: all 0.2s; margin: 1px 0;
  border: 1px solid transparent; position: relative;
}
.nav-item:hover {
  background: rgba(56,140,255,0.06); color: var(--text);
  border-color: rgba(56,140,255,0.1);
}
.nav-item.active {
  background: rgba(56,140,255,0.1); color: #fff;
  border-color: rgba(56,140,255,0.2);
  box-shadow: 0 0 20px rgba(56,140,255,0.08);
}
.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 50%;
  transform: translateY(-50%); width: 3px; height: 20px;
  background: var(--accent); border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px rgba(56,140,255,0.5);
}
.nav-item-icon {
  font-size: 15px; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; opacity: 0.65;
}
.nav-item.active .nav-item-icon { opacity: 1; }
.nav-uc {
  font-family: var(--mono); font-size: 9px; font-weight: 500;
  color: var(--accent); opacity: 0.6; margin-left: auto;
  letter-spacing: 0.5px;
}
.nav-item.active .nav-uc { opacity: 1; }

/* ═══ LAYOUT ═══ */
.app { padding-top: 56px; padding-left: 240px; min-height: 100vh; position: relative; z-index: 1; }
main { padding: 24px 28px; max-width: 1280px; margin: 0 auto; }
.page { display: none; animation: fadeSlide 0.3s ease; }
.page.active { display: block; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══ PAGE HEADER ═══ */
.page-header { margin-bottom: 24px; }
.page-title {
  font-family: var(--head); font-size: 32px; font-weight: 700;
  color: #fff; letter-spacing: 1px; line-height: 1.1;
}
.page-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.uc-badge {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  background: rgba(56,140,255,0.1); color: var(--accent);
  border: 1px solid rgba(56,140,255,0.2);
  padding: 3px 10px; border-radius: 4px; letter-spacing: 1.5px;
}
.page-desc {
  font-family: var(--body); font-size: 13px; color: var(--text2);
  font-weight: 400;
}

/* ═══ CARDS ═══ */
.card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px; margin-bottom: 18px;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.card:hover {
  border-color: rgba(56,140,255,0.25);
  box-shadow: var(--shadow), 0 0 30px rgba(56,140,255,0.05);
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56,140,255,0.3), rgba(0,229,200,0.2), transparent);
}

.card-title {
  font-family: var(--head); font-size: 14px; font-weight: 600;
  color: var(--accent); letter-spacing: 1px; margin-bottom: 16px;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.card-title::before {
  content: ''; display: inline-block; width: 3px; height: 14px;
  background: linear-gradient(180deg, var(--accent), var(--accent3));
  border-radius: 2px; flex-shrink: 0;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }

/* ═══ STAT BOX ═══ */
.stat-box {
  background: var(--surface2);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px 18px; text-align: center;
  position: relative; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.stat-box::after {
  content: ''; position: absolute; bottom: 0; left: 20%; right: 20%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 2px; opacity: 0.4;
}
.stat-value {
  font-family: var(--head); font-size: 38px; font-weight: 700;
  color: var(--accent); letter-spacing: 1px; line-height: 1;
}
.stat-value.red { color: var(--red); text-shadow: 0 0 24px rgba(255,77,106,0.3); }
.stat-value.green { color: var(--green); text-shadow: 0 0 24px rgba(0,229,160,0.3); }
.stat-value.cyan { color: var(--cyan); text-shadow: 0 0 24px rgba(0,212,255,0.3); }
.stat-label {
  font-family: var(--mono); font-size: 9px; font-weight: 500;
  color: var(--text3); margin-top: 8px; letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ═══ FORM ELEMENTS ═══ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-family: var(--mono); font-size: 10px; font-weight: 500;
  color: var(--text3); letter-spacing: 1.5px; margin-bottom: 6px;
  text-transform: uppercase;
}
.form-input, .form-select, .form-textarea {
  width: 100%; background: rgba(12,18,32,0.8);
  border: 1px solid var(--border2); border-radius: var(--radius);
  color: var(--text); padding: 10px 14px;
  font-family: var(--mono); font-size: 12px;
  outline: none; transition: all 0.25s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,140,255,0.1), 0 0 20px rgba(56,140,255,0.08);
  background: rgba(16,24,44,0.9);
}
.form-select option { background: var(--bg3); color: var(--text); }
.form-textarea { min-height: 80px; resize: vertical; font-family: var(--mono); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="file"] { display: none; }

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border: 1px solid transparent;
  border-radius: var(--radius); cursor: pointer;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 1px; text-transform: uppercase;
  transition: all 0.25s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(56,140,255,0.3), inset 0 1px 1px rgba(255,255,255,0.15);
}
.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(56,140,255,0.45), inset 0 1px 1px rgba(255,255,255,0.2);
  transform: translateY(-1px);
}
.btn-secondary {
  background: transparent; color: var(--text2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.btn-secondary:hover {
  border-color: var(--accent); color: var(--accent);
  background: rgba(56,140,255,0.06);
}
.btn-danger {
  background: rgba(255,77,106,0.08); color: var(--red);
  border: 1px solid rgba(255,77,106,0.2); border-radius: var(--radius);
}
.btn-danger:hover { background: rgba(255,77,106,0.14); box-shadow: 0 0 20px rgba(255,77,106,0.15); }
.btn-success {
  background: rgba(0,229,160,0.08); color: var(--green);
  border: 1px solid rgba(0,229,160,0.2); border-radius: var(--radius);
}
.btn-success:hover { background: rgba(0,229,160,0.14); box-shadow: 0 0 20px rgba(0,229,160,0.15); }

/* UPLOAD BOX */
.btn-upload {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; min-height: 220px;
  background: rgba(12,18,32,0.6);
  border: 2px dashed rgba(56,140,255,0.2); border-radius: var(--radius-lg);
  color: var(--text2); cursor: pointer;
  transition: all 0.3s; padding: 36px 24px; text-align: center;
  position: relative; overflow: hidden;
}
.btn-upload:hover {
  border-color: var(--accent); background: rgba(56,140,255,0.04);
  color: var(--accent);
  box-shadow: 0 0 40px rgba(56,140,255,0.08);
}
.btn-upload .upload-icon { font-size: 48px; margin-bottom: 14px; }
.btn-upload .upload-title {
  font-family: var(--head); font-size: 20px; font-weight: 600;
  letter-spacing: 2px; margin-bottom: 6px;
}
.btn-upload .upload-sub {
  font-family: var(--mono); font-size: 11px; opacity: 0.5;
  letter-spacing: 0.3px; line-height: 1.8;
}

.btn-sm { padding: 6px 14px; font-size: 10px; }

/* ═══ BADGES ═══ */
.badge {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  padding: 3px 10px; letter-spacing: 0.8px; text-transform: uppercase;
  border-radius: 4px;
}
.badge-critical { background: rgba(255,77,106,0.12); color: var(--red); border: 1px solid rgba(255,77,106,0.2); }
.badge-high { background: rgba(255,184,77,0.12); color: var(--amber); border: 1px solid rgba(255,184,77,0.2); }
.badge-medium { background: rgba(0,212,255,0.1); color: var(--cyan); border: 1px solid rgba(0,212,255,0.15); }
.badge-online { background: rgba(0,229,160,0.1); color: var(--green); border: 1px solid rgba(0,229,160,0.15); }
.badge-none { background: var(--bg3); color: var(--text3); border: 1px solid var(--border2); }

/* ═══ TABLES ═══ */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  color: var(--accent); letter-spacing: 1.5px; text-align: left;
  padding: 10px 14px; border-bottom: 1px solid rgba(56,140,255,0.15);
  text-transform: uppercase;
}
td {
  padding: 11px 14px; border-bottom: 1px solid var(--border2);
  color: var(--text2); font-size: 12px;
}
tr:hover td { background: rgba(56,140,255,0.03); color: var(--text); }

/* ═══ PROGRESS ═══ */
.progress-bar {
  background: rgba(12,18,32,0.8);
  border: 1px solid var(--border2); border-radius: 6px;
  height: 6px; overflow: hidden; margin-top: 6px;
}
.progress-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width 0.5s;
  box-shadow: 0 0 12px rgba(56,140,255,0.4);
}
.progress-fill.green { background: linear-gradient(90deg, #009973, var(--green)); box-shadow: 0 0 12px rgba(0,229,160,0.4); }
.progress-fill.red { background: linear-gradient(90deg, #cc3d55, var(--red)); box-shadow: 0 0 12px rgba(255,77,106,0.4); }

/* ═══ METRIC ROW ═══ */
.metric-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border2); }
.metric-row:last-child { border-bottom: none; }
.metric-name { font-family: var(--body); font-size: 12px; color: var(--text3); }
.metric-val { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--accent); }

/* ═══ TERMINAL ═══ */
.terminal {
  background: rgba(4,8,16,0.9); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 14px; font-family: var(--mono); font-size: 11px;
  line-height: 1.9; max-height: 200px; overflow-y: auto;
}
.log-info { color: #60aaff; }
.log-warn { color: var(--amber); }
.log-err { color: var(--red); }
.log-success { color: var(--green); }

/* ═══ HEATMAP ═══ */
.heatmap { display: grid; grid-template-columns: repeat(10,1fr); gap: 2px; }
.heatmap-cell { aspect-ratio: 1; border-radius: 3px; cursor: pointer; transition: all 0.2s; }
.heatmap-cell:hover { opacity: 0.7; transform: scale(1.1); }
.heat-0 { background: var(--bg3); border: 1px solid var(--border2); }
.heat-1 { background: rgba(0,212,255,0.3); }
.heat-2 { background: rgba(255,184,77,0.5); }
.heat-3 { background: rgba(255,77,106,0.7); box-shadow: 0 0 6px rgba(255,77,106,0.4); }

/* ═══ RESULT PANEL ═══ */
.result-panel {
  background: rgba(0,229,160,0.05); border: 1px solid rgba(0,229,160,0.15);
  border-left: 3px solid var(--green); border-radius: var(--radius); padding: 14px;
}
.result-panel.error { background: rgba(255,77,106,0.04); border-color: rgba(255,77,106,0.15); border-left-color: var(--red); }
.result-panel.warning { background: rgba(255,184,77,0.04); border-color: rgba(255,184,77,0.15); border-left-color: var(--amber); }

/* ═══ RANGE DISPLAY ═══ */
.range-display {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 9px; color: var(--text3);
  margin-top: 4px;
}

.compare-winner { background: rgba(0,229,160,0.03); }
.tag {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  background: rgba(0,212,255,0.08); color: var(--cyan);
  border: 1px solid rgba(0,212,255,0.15); border-radius: 4px;
  padding: 2px 8px; margin: 1px;
}

/* SPINNER */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  display: inline-block; box-shadow: 0 0 12px rgba(56,140,255,0.15);
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(56,140,255,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(56,140,255,0.4); }

/* ═══ LOGIN PAGE ═══ */
#loginPage {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: stretch;
  background: var(--bg);
}
.login-brand {
  flex: 1; display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start;
  padding: 60px 64px;
  background: linear-gradient(rgba(12, 18, 32, 0.75), rgba(6, 10, 18, 0.9)), url('bg.png') center/cover no-repeat;
  border-right: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.login-brand::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(56,140,255,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0,229,200,0.05) 0%, transparent 40%);
  pointer-events: none;
}
.login-brand-content { position: relative; z-index: 1; max-width: 480px; }
.login-logo-hex {
  width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 28px;
  box-shadow: var(--glow), inset 0 1px 1px rgba(255,255,255,0.2);
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { box-shadow: var(--glow); }
  50% { box-shadow: 0 0 50px rgba(56,140,255,0.4); }
}
.login-brand-title {
  font-family: var(--head); font-size: 56px; font-weight: 700;
  letter-spacing: 3px; line-height: 1; margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 60%, var(--accent3));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.login-brand-sub {
  font-family: var(--mono); font-size: 11px; color: var(--text3);
  letter-spacing: 2.5px; text-transform: uppercase; margin-bottom: 36px;
}
.login-divider {
  width: 56px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  margin-bottom: 36px;
}
.login-feature-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.login-feature {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--body); font-size: 13px; color: var(--text2);
  animation: featureFadeIn 0.4s ease both;
}
.login-feature:nth-child(1) { animation-delay: 0.1s; }
.login-feature:nth-child(2) { animation-delay: 0.2s; }
.login-feature:nth-child(3) { animation-delay: 0.3s; }
.login-feature:nth-child(4) { animation-delay: 0.4s; }
@keyframes featureFadeIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.login-feature-icon {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px;
  background: rgba(56,140,255,0.08); border: 1px solid rgba(56,140,255,0.15);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.login-version-badge {
  position: absolute; bottom: 36px; left: 64px;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 9px; color: var(--text3); letter-spacing: 1px;
}
.login-version-badge::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite;
}

.login-form-panel {
  width: 440px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 48px;
  background: var(--surface);
  backdrop-filter: blur(16px);
}
.login-form-inner { width: 100%; }
.login-form-title {
  font-family: var(--head); font-size: 30px; font-weight: 700;
  letter-spacing: 2px; color: #fff; margin-bottom: 4px;
}
.login-form-desc {
  font-family: var(--mono); font-size: 10px; color: var(--text3);
  letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 36px;
}
.login-error {
  background: rgba(255,77,106,0.06); border: 1px solid rgba(255,77,106,0.2);
  border-left: 3px solid var(--red); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 16px;
  font-family: var(--mono); font-size: 11px; color: var(--red); display: none;
}
.login-btn {
  width: 100%; padding: 14px; margin-top: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none; border-radius: var(--radius); cursor: pointer;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  box-shadow: 0 4px 24px rgba(56,140,255,0.35);
  transition: all 0.25s;
}
.login-btn:hover:not(:disabled) {
  box-shadow: 0 6px 36px rgba(56,140,255,0.5);
  transform: translateY(-1px);
}
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.login-hint {
  font-family: var(--mono); font-size: 10px; color: var(--text3);
  margin-top: 22px; text-align: center; line-height: 1.8;
  border-top: 1px solid var(--border2); padding-top: 18px;
}

/* Header user */
.header-user { display: flex; align-items: center; gap: 10px; }
.header-user-name { font-family: var(--body); font-size: 13px; color: var(--text2); font-weight: 600; }
.header-user-role {
  font-family: var(--mono); font-size: 9px; font-weight: 500;
  color: var(--accent); background: rgba(56,140,255,0.08);
  border: 1px solid rgba(56,140,255,0.15); border-radius: 4px;
  padding: 2px 8px; letter-spacing: 1px;
}
.logout-btn {
  font-family: var(--mono); font-size: 10px; color: var(--text3);
  letter-spacing: 0.8px; background: transparent;
  border: 1px solid var(--border2); border-radius: var(--radius);
  padding: 5px 14px; cursor: pointer; transition: all 0.2s;
}
.logout-btn:hover { color: var(--red); border-color: rgba(255,77,106,0.25); }

/* Toast */
#toastNotif {
  position: fixed; bottom: 24px; right: 24px; z-index: 3000;
  font-family: var(--mono); font-size: 12px;
  padding: 12px 20px; border-radius: var(--radius);
  background: var(--surface); backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green); color: var(--text);
  opacity: 0; transform: translateY(10px);
  transition: all 0.3s ease; pointer-events: none; max-width: 380px;
}
#toastNotif.show { opacity: 1; transform: translateY(0); }
#toastNotif.error { border-left-color: var(--red); }
#toastNotif.warning { border-left-color: var(--amber); }

/* ═══ PIPELINE STEPPER ═══ */
.pipeline-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 80px; position: relative; z-index: 1;
}
.pipeline-step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg3); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 14px; font-weight: 700;
  color: var(--text3); transition: all 0.3s;
}
.pipeline-step-label {
  font-family: var(--mono); font-size: 10px; color: var(--text3);
  letter-spacing: 1px; text-transform: uppercase; transition: color 0.3s;
}
.pipeline-step.active .pipeline-step-num {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: var(--accent); color: #fff;
  box-shadow: 0 0 20px rgba(56,140,255,0.35);
}
.pipeline-step.active .pipeline-step-label { color: var(--accent); }
.pipeline-step.done .pipeline-step-num {
  background: var(--green); border-color: var(--green); color: #fff;
  box-shadow: 0 0 16px rgba(0,229,160,0.3);
}
.pipeline-step.done .pipeline-step-label { color: var(--green); }
.pipeline-connector {
  height: 2px; flex: 1; min-width: 40px; max-width: 80px;
  background: var(--border2); margin-top: -20px; transition: background 0.3s;
}
.pipeline-connector.done { background: var(--green); box-shadow: 0 0 8px rgba(0,229,160,0.3); }
.pipeline-panel { animation: fadeSlide 0.3s ease; }

/* Admin-only nav items */
.nav-item.admin-only.hidden-nav { display: none; }

/* ═══ HAMBURGER BUTTON ═══ */
.hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 40px; height: 40px;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; flex-shrink: 0;
  transition: border-color 0.2s;
}
.hamburger:hover { border-color: var(--accent); }
.hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text2); border-radius: 2px; transition: all 0.25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══ SIDEBAR OVERLAY (mobile) ═══ */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 140;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ═══ TABLE WRAPPERS (mobile scroll) ═══ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
  .hamburger { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    z-index: 160;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .app { padding-left: 0; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .header-status { display: none; }
  .time-display { display: none; }
}

@media (max-width: 768px) {
  /* Login */
  #loginPage { min-height: 100dvh; }
  .login-brand { display: none; }
  .login-form-panel { width: 100%; padding: 32px 24px; min-height: 100dvh; }

  /* Header */
  header { padding: 0 14px; }
  .logo-sub { display: none; }
  .logo-text { font-size: 18px; }
  .header-pwd-btn { display: none; }
  .logout-btn { font-size: 9px; padding: 4px 10px; }
  .header-user-role { display: none; }
  .header-user-name { font-size: 12px; }

  /* Layout */
  main { padding: 12px; }
  .page-title { font-size: 22px; }
  .page-meta { flex-wrap: wrap; gap: 6px; }

  /* Grids */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* Cards */
  .card { padding: 16px; }
  .stat-value { font-size: 28px; }

  /* iOS Safari: prevent zoom on input focus (needs 16px minimum) */
  .form-input, .form-select, .form-textarea {
    font-size: 16px;
  }
  .login-btn { font-size: 14px; }

  /* Touch targets */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .nav-item { padding: 12px; min-height: 44px; }

  /* Tables — horizontal scroll */
  table { min-width: 520px; }
  .card > table, .card > div > table { overflow-x: auto; display: block; }

  /* Pipeline stepper — allow wrapping */
  .pipeline-connector { min-width: 16px; max-width: 32px; }

  /* Toast */
  #toastNotif { left: 16px; right: 16px; bottom: 16px; }
}
