:root {
  --bg: #0a0e1a;
  --bg-card: #111827;
  --bg-input: #1f2937;
  --border: #374151;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gold: #B99B17;
  --navy: #001D54;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--bg-card); border-right: 1px solid var(--border); padding: 1rem 0; position: fixed; height: 100vh; overflow-y: auto; }
.main { margin-left: 240px; flex: 1; padding: 2rem; min-height: 100vh; }

/* Sidebar */
.sidebar-logo { padding: 0.5rem 1.5rem 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.sidebar-logo h2 { font-size: 1rem; color: var(--gold); }
.sidebar-logo small { color: var(--text-muted); font-size: 0.75rem; }
.nav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1.5rem; color: var(--text-muted); font-size: 0.875rem; transition: all 0.15s; cursor: pointer; border-left: 3px solid transparent; }
.nav-item:hover { background: rgba(59,130,246,0.1); color: var(--text); text-decoration: none; }
.nav-item.active { color: var(--primary); background: rgba(59,130,246,0.1); border-left-color: var(--primary); }
.nav-divider { height: 1px; background: var(--border); margin: 0.75rem 1.5rem; }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.card-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.5rem; }

/* Stat Cards Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { text-align: center; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Status badges */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-info { background: rgba(59,130,246,0.15); color: var(--primary); }

/* Gauge */
.gauge { width: 100%; height: 8px; background: var(--bg-input); border-radius: 4px; overflow: hidden; margin-top: 0.5rem; }
.gauge-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.gauge-green { background: var(--success); }
.gauge-orange { background: var(--warning); }
.gauge-red { background: var(--danger); }

/* Forms */
input, select, textarea { background: var(--bg-input); border: 1px solid var(--border); color: var(--text); padding: 0.6rem 0.75rem; border-radius: var(--radius); font-size: 0.875rem; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59,130,246,0.2); }
label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.form-group { margin-bottom: 1rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.6rem 1.25rem; border-radius: var(--radius); font-size: 0.875rem; font-weight: 500; border: none; cursor: pointer; transition: all 0.15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--text-muted); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th { text-align: left; padding: 0.6rem; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border); font-size: 0.75rem; text-transform: uppercase; }
td { padding: 0.6rem; border-bottom: 1px solid var(--border); }
tr:hover { background: rgba(255,255,255,0.02); }

/* Page header */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; }
.page-header p { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.25rem; }

/* Decision tree */
.tree-card { cursor: pointer; transition: all 0.2s; border: 2px solid transparent; }
.tree-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.tree-card .severity { font-size: 0.7rem; font-weight: 700; }
.tree-wizard { max-width: 640px; margin: 0 auto; }
.tree-question { font-size: 1.1rem; font-weight: 600; margin: 1.5rem 0 1rem; }
.tree-option { display: block; width: 100%; text-align: left; padding: 0.75rem 1rem; margin-bottom: 0.5rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); cursor: pointer; font-size: 0.9rem; transition: all 0.15s; }
.tree-option:hover { border-color: var(--primary); background: rgba(59,130,246,0.1); }
.breadcrumbs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; font-size: 0.8rem; }
.breadcrumb { padding: 0.2rem 0.5rem; background: var(--bg-input); border-radius: 4px; cursor: pointer; color: var(--text-muted); }
.breadcrumb:hover { color: var(--text); }
.breadcrumb.active { color: var(--primary); background: rgba(59,130,246,0.1); }
.solution-box { background: rgba(34,197,94,0.1); border: 1px solid var(--success); border-radius: var(--radius); padding: 1.25rem; }
.escalation-box { background: rgba(239,68,68,0.1); border: 1px solid var(--danger); border-radius: var(--radius); padding: 1.25rem; }

/* Iframe container */
.iframe-container { width: 100%; height: 500px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.iframe-container iframe { width: 100%; height: 100%; border: none; }

/* Login page */
.login-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; }
.login-box { width: 100%; max-width: 400px; }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo h1 { color: var(--gold); font-size: 1.5rem; }
.login-logo p { color: var(--text-muted); font-size: 0.85rem; }
.login-error { background: rgba(239,68,68,0.1); border: 1px solid var(--danger); color: var(--danger); padding: 0.6rem 0.75rem; border-radius: var(--radius); font-size: 0.85rem; margin-bottom: 1rem; display: none; }

/* Search */
.search-box { position: relative; margin-bottom: 1rem; }
.search-box input { padding-left: 2.25rem; }
.search-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* Log viewer */
.log-entry { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.8rem; padding: 0.3rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); line-height: 1.4; }
.log-timestamp { color: var(--text-muted); margin-right: 0.5rem; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
