:root {
  --sidebar-w: 240px;
  /* Rydal brand accent (royal blue, sampled from the Rydal logo/favicon).
     Change these to re-tint the whole portal. */
  --accent:     #2563ab;
  --accent-2:   #1d4e8a;   /* darker — hover/active */
  --accent-ink: #ffffff;   /* text on top of the accent */
  --accent-rgb: 37, 99, 171;
}

body { background: #0b0f17; }

/* Bootstrap primary → Rydal blue (buttons, links use the brand accent) */
.btn-primary {
  --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-2); --bs-btn-hover-border-color: var(--accent-2);
  --bs-btn-active-bg: var(--accent-2); --bs-btn-active-border-color: var(--accent-2);
  --bs-btn-color: var(--accent-ink); --bs-btn-hover-color: var(--accent-ink); --bs-btn-active-color: var(--accent-ink);
}
.btn-outline-primary {
  --bs-btn-color: #6ea8e6; --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--accent); --bs-btn-active-border-color: var(--accent);
}
a { color: #6ea8e6; }
a:hover { color: #9ac2f0; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: #0f1523; border-right: 1px solid #1e293b;
  display: flex; flex-direction: column; padding: 14px 10px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: block; padding: 6px 8px 18px; }
.brand-logo { width: 150px; max-width: 100%; height: auto; display: block; }
.brand-sub  { font-size: .58rem; letter-spacing: .18em; color: #64748b; margin-top: 7px; padding-left: 2px; }
/* Small brand mark (favicon) — used on the login card */
.brand-mark {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; overflow: hidden;
}
.brand-mark img { width: 30px; height: 30px; }

.sidebar-nav { gap: 2px; }
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 10px;
  color: #94a3b8; border-radius: 8px; padding: 8px 12px; font-size: .9rem;
}
.sidebar-nav .nav-link:hover { background: #1a2234; color: #e2e8f0; }
.sidebar-nav .nav-link.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.sidebar-nav .nav-link.disabled { color: #475569; }
.sidebar-nav .badge { font-size: .6rem; }
.sidebar-nav .nav-sub { padding: 5px 12px 5px 34px; font-size: .82rem; }
.sidebar-nav .nav-sub .bi { font-size: .85rem; }

.sidebar-footer { margin-top: auto; border-top: 1px solid #1e293b; padding-top: 10px; font-size: .82rem; }
.sidebar-footer .user-line { color: #cbd5e1; padding: 4px 8px; }
.footer-link { display: inline-flex; align-items: center; gap: 6px; color: #94a3b8; text-decoration: none; padding: 4px 8px; }
.footer-link:hover { color: var(--accent); }

/* ── Content ────────────────────────────────────────────────────────────────── */
.content { flex: 1; padding: 22px 26px; min-width: 0; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; color: #f1f5f9; margin: 0; }

.card { background: #111827; border: 1px solid #1f2937; }

/* Spacious data table (Routers etc.) */
.router-table thead th {
  text-transform: uppercase; font-size: .68rem; letter-spacing: .05em;
  color: #64748b; font-weight: 600; border-bottom: 1px solid #1f2937;
}
.router-table td, .router-table th { padding: .7rem .75rem; }
.router-table tbody tr { border-top: 1px solid #161e2e; }
.router-table tbody td { border: 0; }

/* ── Dashboard ──────────────────────────────────────────────────────────────── */
.kpi { display: flex; align-items: center; gap: 14px; }
.kpi-icon {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
  background: rgba(var(--accent-rgb), .14); color: var(--accent);
}
.kpi-icon.amber  { background: rgba(245, 158, 11, .14); color: #f59e0b; }
.kpi-icon.green  { background: rgba(18, 184, 134, .14); color: #12b886; }
.kpi-icon.violet { background: rgba(139, 92, 246, .14); color: #a78bfa; }
.kpi-icon.slate  { background: rgba(148, 163, 184, .14); color: #94a3b8; }
.kpi-value { font-size: 1.7rem; font-weight: 800; line-height: 1; color: #f1f5f9; }
.kpi-label { font-size: .78rem; color: #64748b; margin-top: 3px; }

.res-bar-track { height: 8px; border-radius: 6px; background: #1b2436; overflow: hidden; }
.res-bar-fill  { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.res-row + .res-row { margin-top: 12px; }

/* ── Login ──────────────────────────────────────────────────────────────────── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 100%; max-width: 360px; background: #111827; border: 1px solid #1f2937; border-radius: 14px; padding: 28px; }
.login-brand { text-align: center; font-weight: 700; color: #fff; margin-bottom: 22px; }
.login-brand .bi { color: var(--accent); }
.login-brand span { color: #94a3b8; font-weight: 500; }

@media (max-width: 640px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar-nav { flex-direction: row !important; width: 100%; }
  .sidebar-footer { margin: 0 0 0 auto; border: 0; padding: 0; }
}
