﻿:root {
  --bg: #0f172a; --surface: #1e293b; --surface-2: #334155;
  --border: #475569; --text: #f1f5f9; --muted: #94a3b8;
  --primary: #3b82f6; --primary-hover: #2563eb;
  --success: #22c55e; --warning: #f59e0b; --danger: #ef4444;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }
.container { display: flex; width: 100%; }
.sidebar { width: 240px; background: var(--surface); padding: 20px; border-right: 1px solid var(--border); min-height: 100vh; }
.brand { font-size: 18px; font-weight: 700; margin-bottom: 24px; }
.brand small { font-size: 12px; color: var(--muted); font-weight: 400; }
.nav-item { display: block; padding: 10px 14px; color: var(--muted); text-decoration: none; border-radius: 6px; margin-bottom: 4px; cursor: pointer; }
.nav-item:hover, .nav-item.active { background: var(--surface-2); color: var(--text); }
.main { flex: 1; padding: 24px; overflow-y: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.topbar-actions { display: flex; gap: 8px; }
.btn-primary { background: var(--primary); color: #fff; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); padding: 8px 16px; border-radius: 6px; cursor: pointer; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.kpi-value { font-size: 28px; font-weight: 700; }
.kpi-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat-list { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.stat-row { display: flex; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.stat-row:last-child { border-bottom: none; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 8px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.badge { padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.badge.active, .badge.ACTIVE, .badge.AVAILABLE, .badge.DEPLOYED { background: #065f46; color: #6ee7b7; }
.badge.inactive, .badge.IN_MAINTENANCE { background: #451a03; color: #fcd34d; }
.badge.RETIRED, .badge.OUT_OF_SERVICE { background: #7f1d1d; color: #fca5a5; }
.badge.SCHEDULED { background: #1e3a5f; color: #93c5fd; }
.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin-top: 12px; }
.detail-card p { margin: 4px 0; font-size: 14px; }
.empty { text-align: center; padding: 20px; color: var(--muted); font-size: 14px; }
.overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; }
.modal { background: var(--surface); padding: 24px; border-radius: 12px; max-width: 480px; width: 90%; }
.modal h2 { margin-bottom: 16px; }
.modal label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.modal input, .modal select { width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); margin-top: 4px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.error { color: var(--danger); padding: 20px; text-align: center; }
[data-theme="light"] {
  --bg: #f1f5f9; --surface: #ffffff; --surface-2: #e2e8f0;
  --border: #cbd5e1; --text: #0f172a; --muted: #64748b;
}
/* Mobile baseline */
@media (max-width: 768px) {
  .container { flex-direction: column; }
  .sidebar { width: 100%; min-height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .main { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); }
}
