:root {
  --eve-gold: #c8a951;
  --eve-dark: #0d1117;
  --eve-panel: #111827;
  --eve-border: #1f2937;
  --sidebar-width: 220px;
  --sidebar-bg: #0d1117;
  --mobile-topbar-height: 52px;
}

body {
  background-color: var(--eve-dark);
  color: #e2e8f0;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.25rem 1rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--eve-gold);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.sidebar-nav {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  flex: 1;
}

.sidebar-nav li {
  margin: 2px 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.07);
  color: #e2e8f0;
}

.sidebar-link.active {
  background: rgba(200, 169, 81, 0.12);
  color: var(--eve-gold);
  border-left: 3px solid var(--eve-gold);
  padding-left: calc(0.75rem - 3px);
}

.sidebar-link i {
  font-size: 1rem;
  flex-shrink: 0;
  width: 1.1rem;
  text-align: center;
}

.sidebar-link-toggle {
  cursor: pointer;
}

.sidebar-chevron {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.sidebar-link-toggle[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(180deg);
}

.sidebar-subnav {
  list-style: none;
  padding: 0;
  margin: 0 0 4px 0;
}

.sidebar-sublink {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem 0.35rem 2.1rem;
  border-radius: 6px;
  color: #64748b;
  text-decoration: none;
  font-size: 0.84rem;
  transition: background 0.15s, color 0.15s;
  margin: 1px 8px;
  white-space: nowrap;
}

.sidebar-sublink:hover {
  background: rgba(255,255,255,0.07);
  color: #e2e8f0;
}

.sidebar-sublink.active {
  color: var(--eve-gold);
  background: rgba(200, 169, 81, 0.08);
}

.sidebar-sublink i {
  font-size: 0.85rem;
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
}

.sidebar-footer {
  padding: 0.75rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-links {
  font-size: 0.75rem;
}

.sidebar-user-links a {
  color: #64748b;
  text-decoration: none;
}

.sidebar-user-links a:hover {
  color: #e2e8f0;
}

/* ── Main content offset ─────────────────────────────────── */

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* ── Mobile ──────────────────────────────────────────────── */

.mobile-topbar {
  height: var(--mobile-topbar-height);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--eve-border);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.sidebar-toggle-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1039;
}

@media (max-width: 991.98px) {
  .sidebar {
    top: var(--mobile-topbar-height);
    height: calc(100vh - var(--mobile-topbar-height));
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding-top: 0;
  }
}

/* ── Cards ───────────────────────────────────────────────── */

.card {
  background-color: var(--eve-panel);
  border: none;
}

.card-header {
  background-color: rgba(255,255,255,0.05);
  border: none;
}

/* ── Fuel status ─────────────────────────────────────────── */

.badge-fuel-ok { background-color: #16a34a; }
.badge-fuel-warning { background-color: #d97706; }
.badge-fuel-critical { background-color: #dc2626; }
.badge-fuel-empty { background-color: #6b7280; }
.badge-fuel-unknown { background-color: #374151; }

.fuel-critical { border-left: 4px solid #dc2626; }
.fuel-warning  { border-left: 4px solid #d97706; }
.fuel-ok       { border-left: 4px solid #16a34a; }

/* ── Event type chips ────────────────────────────────────── */

.badge-fleet { background-color: #1d4ed8; }
.badge-moon  { background-color: #7c3aed; }

/* ── Portrait thumbnails ─────────────────────────────────── */

.portrait-sm { width: 32px; height: 32px; border-radius: 4px; }
.portrait-md { width: 64px; height: 64px; border-radius: 6px; }

/* ── Tables ──────────────────────────────────────────────── */

.table-dark td, .table-dark th {
  border-color: var(--eve-border);
}

/* ── Event list ──────────────────────────────────────────── */

.event-list .event-item {
  border-left: 3px solid #374151;
  padding-left: 1rem;
  margin-bottom: 1rem;
}

.event-list .event-item.fleet { border-color: #1d4ed8; }
.event-list .event-item.moon  { border-color: #7c3aed; }

/* ── Hours remaining ─────────────────────────────────────── */

.hours-critical { color: #f87171; font-weight: 700; }
.hours-warning  { color: #fbbf24; font-weight: 600; }
.hours-ok       { color: #4ade80; }
