/* Cortex Admin — Stripe-inspired design system */
:root {
  --bg: #f6f9fc;
  --bg-elevated: #ffffff;
  --text: #0a2540;
  --text-secondary: #425466;
  --muted: #697386;
  --border: #e3e8ee;
  --border-subtle: #f0f4f8;
  --accent: #635bff;
  --accent-hover: #5851ea;
  --accent-soft: rgba(99, 91, 255, 0.08);
  --accent-glow: rgba(99, 91, 255, 0.25);
  --ok: #30b566;
  --ok-bg: #e6f9ef;
  --warn: #df1b41;
  --warn-bg: #ffe7e7;
  --warn-amber: #b45309;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.2s var(--ease);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Page enter */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-enter { animation: pageIn 0.45s var(--ease) forwards; }

/* Stagger cards */
@keyframes cardFade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.stagger > .card, .stagger > .metric-card {
  opacity: 0;
  animation: cardFade 0.5s var(--ease) forwards;
}
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* Skeleton */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--border-subtle) 25%, #fff 50%, var(--border-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: var(--radius-sm);
  min-height: 1.5rem;
}

/* App shell */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.sidebar-brand .logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #8b85ff);
  box-shadow: 0 4px 12px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.sidebar-brand span { color: var(--accent); }

.sidebar-nav { flex: 1; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.25rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
}
.sidebar-nav a:hover {
  background: var(--border-subtle);
  color: var(--text);
}
.sidebar-nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.sidebar-nav .nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--border-subtle);
  color: var(--muted);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.status-pill.live {
  background: var(--ok-bg);
  color: #1a7f4b;
  border-color: rgba(48, 181, 102, 0.3);
}
.status-pill .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.status-pill.live .pulse {
  background: var(--ok);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.75rem 2.5rem;
  width: 100%;
}

.page-header { margin-bottom: 1.75rem; }
.page-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}
.page-header .muted { font-size: 0.95rem; }

h2.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--text);
}

.muted { color: var(--muted); }

/* Grid */
.grid { display: grid; gap: 1rem; margin: 1rem 0; }
.cards-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

/* Cards */
.card, .metric-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.card:hover, .metric-card:hover {
  box-shadow: var(--shadow);
  border-color: #d8dee6;
}
.metric-card .card-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.metric-card .card-value {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.metric-card .card-sub { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }

.chart-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text-secondary);
}
.chart-card canvas { max-height: 200px; }

/* Service status badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-ok { background: var(--ok-bg); color: #1a7f4b; }
.badge-warn { background: #fef3c7; color: var(--warn-amber); }
.badge-err { background: var(--warn-bg); color: var(--warn); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.1rem;
  font-weight: 500;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s var(--ease), box-shadow var(--transition), background var(--transition);
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border-subtle); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--accent-soft); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8125rem; }
.btn-danger { background: var(--warn); color: #fff; }

.btn-group { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

/* Forms */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}
input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-elevated);
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 0.85rem;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field { margin-bottom: 1.1rem; }
.hint { font-size: 0.75rem; color: var(--muted); display: block; margin-top: -0.5rem; margin-bottom: 0.75rem; }
.tag {
  font-size: 0.65rem;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
}

/* Alerts */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  animation: pageIn 0.3s var(--ease);
}
.alert-error { background: var(--warn-bg); color: #9b1c31; border: 1px solid rgba(223, 27, 65, 0.2); }
.alert-success { background: var(--ok-bg); color: #1a7f4b; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.table tr:hover td { background: var(--border-subtle); }

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 1.5rem;
  padding-bottom: 0.25rem;
}
.tabs a {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}
.tabs a:hover { border-color: var(--accent); color: var(--accent); }
.tabs a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Log / pre */
.pre, .log, .mini {
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  overflow: auto;
  max-height: 220px;
  border: 1px solid var(--border-subtle);
  font-family: ui-monospace, monospace;
}
.ok { color: var(--ok); }
.err { color: var(--warn); }
.warn { color: var(--warn-amber); }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* Network meter */
.net-meter {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 52px;
  margin-top: 0.75rem;
}
.net-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--accent), #a5b4fc);
  border-radius: 4px;
  transition: height 0.35s var(--ease);
  min-height: 4px;
}

/* Login */
body.login-page {
  min-height: 100vh;
  overflow: hidden;
}
.login-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.login-visual {
  position: relative;
  background: linear-gradient(145deg, #0a2540 0%, #1a365d 50%, #635bff 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  color: #fff;
  overflow: hidden;
}
.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(99, 91, 255, 0.45), transparent),
    radial-gradient(ellipse 60% 40% at 80% 70%, rgba(14, 165, 233, 0.25), transparent);
  animation: meshMove 12s ease-in-out infinite alternate;
}
@keyframes meshMove {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.08) translate(-2%, 2%); }
}
.login-visual-content { position: relative; z-index: 1; max-width: 420px; }
.login-visual h2 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  line-height: 1.2;
}
.login-visual p { opacity: 0.85; font-size: 1.05rem; line-height: 1.6; }

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  animation: pageIn 0.6s var(--ease);
}
.login-card .logo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.login-card .logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #8b85ff);
  box-shadow: 0 8px 24px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.login-card h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}
.login-card .subtitle { color: var(--muted); margin: 0.25rem 0 1.75rem; font-size: 0.95rem; }

.password-wrap { position: relative; }
.password-wrap input { margin-bottom: 1.25rem; }

/* Mobile */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 1.1rem;
}

@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-wrap { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
}

@media (max-width: 600px) {
  .container { padding: 1rem; }
  .cards-4 { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 1rem; }
}

/* Toast for actions */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.85rem 1.25rem;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: pageIn 0.3s var(--ease);
  max-width: 360px;
}

/* —— Calm / minimal pages —— */
.page-calm .stagger > .card,
.page-calm .stagger > .metric-card,
.page-calm .page-enter {
  animation: none;
  opacity: 1;
  transform: none;
}
.page-calm .card:hover,
.page-calm .metric-card:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}
.page-home .container {
  padding-top: 2rem;
  padding-bottom: 3rem;
}
.page-header-minimal h1 {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}
.page-lead {
  margin: 0 0 1.75rem;
  font-size: 0.9rem;
}
.metric-card-minimal {
  border: none;
  box-shadow: none;
  background: var(--bg-elevated);
  padding: 1.25rem 1.35rem;
}
.metric-card-minimal .card-label {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}
.metric-card-minimal .card-value {
  font-size: 1.65rem;
}
.card-value-sm {
  font-size: 1.05rem !important;
  font-weight: 600;
  line-height: 1.35;
}
.card-flat {
  border: none;
  box-shadow: var(--shadow-sm);
}
.kpi-row {
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.service-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  align-items: center;
  padding: 1rem 1.35rem;
  margin-bottom: 2rem;
}
.svc {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.svc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}
.svc-dot.ok { background: var(--ok); }
.svc-dot.warn { background: var(--warn-amber); }
.svc-dot.err { background: var(--warn); }
.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin-top: 2.5rem;
}
.detail-link {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.detail-link:hover {
  color: var(--accent);
}
.status-pill-static {
  background: var(--border-subtle);
  color: var(--muted);
}
.status-pill-static .pulse {
  display: none;
}
.progress-wrap {
  height: 6px;
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  margin-top: 0.65rem;
  overflow: hidden;
}
.progress-wrap-inline {
  max-width: 200px;
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.5rem;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 0.35s var(--ease);
}
.progress-fill-blue { background: #0ea5e9; }
.progress-fill-muted { background: #94a3b8; }
.sys-meta {
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
}
.meta-sep {
  margin: 0 0.5rem;
  color: var(--border);
}
.section-title-quiet {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}
.chart-card-single canvas {
  max-height: 260px;
}
.card-title-sm {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.text-sm { font-size: 0.875rem; }
.table-compact th,
.table-compact td {
  padding: 0.4rem 0.35rem;
  font-size: 0.82rem;
}
.list-compact {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.875rem;
}
.accordion,
.chart-expand {
  margin-top: 2rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  padding: 0.5rem 1rem;
}
.accordion summary,
.chart-expand summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 0.25rem;
  color: var(--text-secondary);
  list-style: none;
}
.accordion summary::-webkit-details-marker,
.chart-expand summary::-webkit-details-marker {
  display: none;
}
.accordion-body {
  padding: 0.5rem 0.25rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
}
.page-calm .status-pill.live .pulse {
  animation: none;
  opacity: 0.85;
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  background: #fff;
  border: 1px solid var(--border, #e6ebf1);
}
.status-strip.status-ok { border-left: 4px solid #30b566; }
.status-strip.status-warn { border-left: 4px solid #f59e0b; }
.status-strip.status-err { border-left: 4px solid #df1b41; }
.status-strip .status-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #30b566;
}
.status-strip.status-warn .status-dot { background: #f59e0b; }
.status-strip.status-err .status-dot { background: #df1b41; }
.quick-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.quick-link {
  padding: 0.5rem 1rem;
  background: #fff;
  border: 1px solid #e6ebf1;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text, #1a1f36);
  font-weight: 500;
  font-size: 0.9rem;
}
.quick-link:hover { border-color: #635bff; color: #635bff; }

.progress-inline { height: 6px; background: #e6ebf1; border-radius: 99px; min-width: 80px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.progress-inline .progress-fill { height: 100%; background: #635bff; border-radius: 99px; transition: width 0.4s ease; }
.progress-inline .progress-fill.warn, td.warn .progress-fill { background: #f59e0b; }

.sparkline { width: 100%; height: 36px; display: block; margin-top: 0.5rem; }

.ring-wrap { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0; }
.ring-item { text-align: center; }
.ring-svg { width: 100px; height: 100px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #e6ebf1; stroke-width: 8; }
.ring-fg { fill: none; stroke: #635bff; stroke-width: 8; stroke-linecap: round; stroke-dasharray: 283; stroke-dashoffset: 283; transition: stroke-dashoffset 0.5s ease; }
.ring-fg.ram { stroke: #0ea5e9; }
.ring-lbl { font-size: 1.25rem; font-weight: 700; margin-top: 0.35rem; }

.stat-gauge { text-align: center; padding: 1rem; }
.stat-gauge .gauge-num { font-size: 2rem; font-weight: 700; color: var(--primary, #635bff); }
.stat-gauge .gauge-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.backup-timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid #e6ebf1; margin-left: 0.5rem; }
.backup-timeline li { padding: 0.75rem 0 0.75rem 1.25rem; position: relative; }
.backup-timeline li::before { content: ''; position: absolute; left: -6px; top: 1.1rem; width: 10px; height: 10px; border-radius: 50%; background: #635bff; }

.log-terminal { background: #0a2540; color: #a8d4ff; padding: 1rem; border-radius: 8px; font-family: ui-monospace, monospace; font-size: 0.78rem; max-height: 420px; overflow: auto; line-height: 1.45; }
.log-terminal .log-line { display: block; }

.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.service-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; padding: 0.85rem; border: 1px solid var(--border, #e6ebf1); border-radius: 10px; text-decoration: none; color: inherit; background: #fff; transition: border-color 0.15s; }
.service-tile:hover { border-color: #635bff; }
.service-tile .svc-icon { width: 28px; height: 28px; color: #635bff; }

.env-textarea { font-family: ui-monospace, monospace; font-size: 0.85rem; line-height: 1.5; background: #0a2540; color: #e8f0fe; border: none; border-radius: 8px; padding: 1rem; width: 100%; min-height: 280px; }

.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; color: #fff; padding: 0.85rem 1.25rem; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); z-index: 9999; font-weight: 500; max-width: 360px; }

.grid.cards-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
@media (max-width: 1200px) { .grid.cards-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .grid.cards-6 { grid-template-columns: 1fr 1fr; } }

.alert-stack { display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0; }
.alert-banner { display: flex; align-items: center; gap: 0.65rem; padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.9rem; animation: pageIn 0.4s var(--ease); }
.alert-warn { background: #fff8e6; border: 1px solid #f5d90a; color: var(--warn-amber); }
.alert-err { background: var(--warn-bg); border: 1px solid #ffc4c4; color: var(--warn); }
.alert-info { background: var(--accent-soft); border: 1px solid #c4c0ff; color: var(--accent); }

.service-grid-rich { grid-template-columns: repeat(3, 1fr); }
.service-tile-rich { flex-direction: column; align-items: flex-start; gap: 0.35rem; min-height: 110px; }
.svc-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); }
.value-flash { animation: pageIn 0.35s var(--ease); }

.core-bars { display: grid; gap: 0.5rem; }
.core-bar { display: grid; grid-template-columns: 52px 1fr 40px; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.accordion-advanced summary { cursor: pointer; font-weight: 600; padding: 0.25rem 0; }

.banned-scroll { max-height: 200px; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.5rem; background: var(--border-subtle); border-radius: var(--radius-sm); }
.ip-chip { font-family: ui-monospace, monospace; font-size: 0.8rem; padding: 0.2rem 0.5rem; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.ufw-rules { margin: 0.75rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; }

.timeline-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.timeline-card { position: relative; }
.timeline-badge { position: absolute; top: 0.75rem; right: 0.75rem; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; color: var(--accent); }
.timeline-path { font-size: 0.75rem; word-break: break-all; display: block; margin-top: 0.5rem; }

.log-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.log-tab { border: 1px solid var(--border); background: #fff; padding: 0.45rem 0.85rem; border-radius: var(--radius-pill); cursor: pointer; font-weight: 500; font-size: 0.85rem; transition: var(--transition); }
.log-tab.active, .log-tab:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-logs .log-terminal { min-height: 420px; max-height: 70vh; }
.toggle-auto { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; margin-left: 1rem; }

.boot-checklist { display: grid; gap: 0.5rem; }
.boot-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 1rem; }
.boot-row code { flex: 1; }

.empty-state { text-align: center; padding: 2rem 1rem; }
.empty-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; opacity: 0.7; }
tr.row-hot td { color: var(--warn); font-weight: 600; }
.path-mini { font-size: 0.8rem; max-width: 220px; display: inline-block; overflow: hidden; text-overflow: ellipsis; }

/* —— Inicio dense dashboard —— */
.page-inicio .container { max-width: 1280px; }
.page-inicio .inicio-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}
.page-inicio .inicio-title { margin: 0; font-size: 1.15rem; letter-spacing: -0.02em; }
.page-inicio .inicio-sub { margin: 0.15rem 0 0; font-size: 11px; }
.inicio-row { margin-bottom: 0.55rem; }
.status-strip-compact {
  padding: 0.35rem 0.65rem;
  margin: 0;
  font-size: 11px;
  border-radius: 8px;
}
.pulse-soft { animation: pulse-soft 2s ease-in-out infinite; }
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.kpi-micro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.4rem;
}
.kpi-micro {
  background: #fff;
  border: 1px solid var(--border, #e6ebf1);
  border-radius: 10px;
  padding: 0.4rem 0.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.kpi-micro:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 91, 255, 0.08);
  border-color: rgba(99, 91, 255, 0.35);
}
.kpi-lbl {
  font-size: 11px;
  color: var(--muted, #697386);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.kpi-val {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: 0.1rem;
}
.kpi-val-sm { font-size: 15px; }
.kpi-muted { font-size: 12px; font-weight: 500; color: var(--muted); }
.value-flash { animation: kpi-flash 0.45s ease; }
@keyframes kpi-flash {
  0% { color: #635bff; transform: scale(1.04); }
  100% { color: inherit; transform: scale(1); }
}

.health-chip-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.35rem;
}
.health-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem;
  background: #fff;
  border: 1px solid var(--border, #e6ebf1);
  border-radius: 9px;
  font-size: 11px;
  transition: border-color 0.15s, background 0.15s;
}
.health-chip:hover { border-color: #635bff; background: #fafaff; }
.health-chip-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #eef0ff, #f6f9fc);
  flex-shrink: 0;
}
.health-chip-body { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.health-chip-name { font-weight: 600; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-chip-metric { font-size: 10px; color: var(--muted); }
.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(48, 181, 102, 0.2);
}
.health-dot.dot-ok { background: #30b566; box-shadow: 0 0 0 2px rgba(48, 181, 102, 0.25); }
.health-dot.dot-warn { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25); }
.health-dot.dot-err { background: #df1b41; box-shadow: 0 0 0 2px rgba(223, 27, 65, 0.2); }

.alert-pill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 4.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}
.alert-pill {
  font-size: 11px;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
  animation: pill-in 0.35s ease;
}
@keyframes pill-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.alert-pill.alert-ok { background: #e8f8ef; color: #1b5e20; border-color: #c8e6d0; }
.alert-pill.alert-warn { background: #fff8e6; color: #92400e; border-color: #fde68a; }
.alert-pill.alert-err { background: #fde8ec; color: #9f1239; border-color: #fecdd3; }
.alert-pill.alert-info { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.alert-pill.alert-muted { background: #f6f9fc; color: #697386; border-color: #e6ebf1; }

.spark-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}
@media (max-width: 720px) { .spark-row { grid-template-columns: 1fr; } }
.spark-card {
  background: #fff;
  border: 1px solid var(--border, #e6ebf1);
  border-radius: 10px;
  padding: 0.35rem 0.45rem 0.25rem;
}
.spark-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.spark-mini { width: 100%; height: 60px; display: block; margin-top: 0.15rem; }

.inicio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.action-icon-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 72px;
  padding: 0.4rem 0.5rem;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid var(--border, #e6ebf1);
  border-radius: 10px;
  background: #fff;
  color: var(--text, #1a1f36);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.action-icon-btn:hover {
  border-color: #635bff;
  color: #635bff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 91, 255, 0.12);
}
.action-icon-btn .act-glyph { font-size: 16px; line-height: 1; }

.sites-compact {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border, #e6ebf1);
  border-radius: 10px;
  overflow: hidden;
}
.sites-compact th,
.sites-compact td { padding: 0.35rem 0.55rem; text-align: left; border-bottom: 1px solid #eef2f6; }
.sites-compact th { font-size: 10px; text-transform: uppercase; color: var(--muted); background: #fafbfc; }
.sites-compact tr:last-child td { border-bottom: none; }
