/* ============================================================
   Kolec Ops — tech-platform console
   ============================================================ */

:root {
  /* Phosphor-dark palette */
  --bg-0: #06080c;
  --bg-1: #0b0f17;
  --bg-2: #11161f;
  --bg-3: #171d28;
  --bg-hover: #1c2434;
  --border: #1f2a3d;
  --border-strong: #2a3a56;
  --border-glow: rgba(0, 229, 255, 0.25);

  --text: #e6f1ff;
  --text-muted: #7d8aa3;
  --text-dim: #4a556a;

  --accent: #00e5ff;
  --accent-hover: #5aefff;
  --accent-dim: rgba(0, 229, 255, 0.12);
  --accent-glow: rgba(0, 229, 255, 0.45);
  --accent-2: #a855f7;  /* purple accent for secondary */

  --ok: #22d175;
  --ok-bg: rgba(34, 209, 117, 0.14);
  --ok-glow: rgba(34, 209, 117, 0.4);
  --warn: #f5b041;
  --warn-bg: rgba(245, 176, 65, 0.14);
  --err: #ff4d6d;
  --err-bg: rgba(255, 77, 109, 0.14);
  --err-glow: rgba(255, 77, 109, 0.4);
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.14);

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;

  --shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 0 1px var(--border-glow), 0 10px 40px rgba(0, 229, 255, 0.08);

  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --sidebar-w: 230px;
  --statusbar-h: 28px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.55;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Grid background pattern — the ops console look */
body {
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 0;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); text-shadow: 0 0 6px var(--accent-glow); }

::selection { background: var(--accent-dim); color: var(--accent-hover); }

/* ============================================================
   Icon safety net — SVG icons must never balloon.
   The macro also sets width/height attributes; this guarantees
   that even inherited sizing can't exceed sane bounds.
   ============================================================ */
svg.icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  vertical-align: -2px;
  display: inline-block;
}
.empty svg.icon { width: 44px; height: 44px; }
.sidebar nav a svg.icon { width: 15px; height: 15px; }
.brand svg { width: 26px; height: 26px; flex-shrink: 0; }
.sidebar .userbox svg.icon,
.sidebar .userbox a svg { width: 12px; height: 12px; opacity: 0.6; }
.btn svg.icon { width: 13px; height: 13px; }
.btn.sm svg.icon { width: 11px; height: 11px; }
.badge svg.icon { width: 10px; height: 10px; }
.alert svg.icon, .flash svg.icon { width: 16px; height: 16px; }

/* ============================================================
   Layout
   ============================================================ */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  padding-bottom: var(--statusbar-h);
}

.sidebar {
  background: var(--bg-1);
  background-image: linear-gradient(180deg, rgba(0, 229, 255, 0.03), transparent 300px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: calc(100vh - var(--statusbar-h));
  overflow-y: auto;
}

.brand {
  padding: 16px 18px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.brand::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
}
.brand svg {
  width: 26px; height: 26px; flex-shrink: 0;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
.brand .brand-text {
  display: flex; flex-direction: column; gap: 1px;
}
.brand .brand-text strong {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-shadow: 0 0 4px var(--accent-glow);
}
.brand .brand-text small {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.sidebar nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  position: relative;
  transition: all var(--transition);
  font-family: var(--mono);
}
.sidebar nav a svg {
  width: 15px; height: 15px; flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--transition);
}
.sidebar nav a:hover {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}
.sidebar nav a:hover svg { opacity: 1; }
.sidebar nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
}
.sidebar nav a.active svg { opacity: 1; color: var(--accent); }
.sidebar nav a .count {
  margin-left: auto;
  font-size: 10px;
  background: var(--bg-3);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 2px;
  font-weight: 600;
  font-family: var(--mono);
}
.sidebar nav a.active .count {
  background: var(--accent); color: var(--bg-0);
}

/* Live event feed in sidebar footer */
.event-feed {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 10.5px;
  max-height: 180px;
  overflow-y: auto;
}
.event-feed .event-header {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 9px;
  margin-bottom: 6px;
}
.event-feed .event-header .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 6px var(--ok-glow);
  animation: pulse-glow 2s ease-in-out infinite;
}
.event-feed .event {
  padding: 2px 0; color: var(--text-muted);
  display: flex; gap: 6px; align-items: baseline;
  border-left: 1px solid var(--border); padding-left: 8px; margin-left: 2px;
}
.event-feed .event time { color: var(--text-dim); font-size: 9px; }
.event-feed .event.ok { color: var(--ok); }
.event-feed .event.warn { color: var(--warn); }
.event-feed .event.err { color: var(--err); }

.sidebar .userbox {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-family: var(--mono);
}
.sidebar .avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--bg-0); font-weight: 700; font-size: 11px;
  text-transform: uppercase;
  box-shadow: 0 0 10px var(--accent-glow);
}
.sidebar .userbox .user-info { flex: 1; min-width: 0; }
.sidebar .userbox .user-info div { color: var(--text); font-weight: 500; }
.sidebar .userbox .user-info a { font-size: 10px; color: var(--text-dim); }

.content {
  padding: 20px 28px 40px;
  max-width: 1600px;
  width: 100%;
}

/* ============================================================
   Status bar (bottom)
   ============================================================ */

.statusbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--statusbar-h);
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-muted);
  z-index: 100;
  letter-spacing: 0.03em;
}
.statusbar .sb-item {
  display: flex; align-items: center; gap: 6px;
}
.statusbar .sb-item strong { color: var(--text); font-weight: 500; }
.statusbar .sb-dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.statusbar .sb-dot.ok { background: var(--ok); box-shadow: 0 0 6px var(--ok-glow); }
.statusbar .sb-dot.warn { background: var(--warn); }
.statusbar .sb-dot.err { background: var(--err); box-shadow: 0 0 6px var(--err-glow); }
.statusbar .sb-sep { color: var(--text-dim); }
.statusbar .spacer { flex: 1; }
.statusbar kbd {
  font-family: var(--mono); font-size: 10px;
  background: var(--bg-3); color: var(--text);
  padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--border);
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  gap: 14px;
  flex-wrap: wrap;
}
.topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-family: var(--mono);
}
.topbar h1 .prompt {
  color: var(--accent); opacity: 0.6; font-weight: 400;
  text-shadow: 0 0 6px var(--accent-glow);
}
.topbar h1 small {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 3px;
  letter-spacing: 0.02em;
  font-family: var(--mono);
}
.topbar .spacer { flex: 1; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-family: var(--mono);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb svg { width: 11px; height: 11px; opacity: 0.5; }

/* ============================================================
   Flash messages
   ============================================================ */

.flash-stack {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 400px;
}
.flash {
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; gap: 10px; align-items: flex-start;
  font-family: var(--mono);
  font-size: 12px;
  animation: slide-in 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.flash.ok { border-left: 2px solid var(--ok); box-shadow: 0 0 20px var(--ok-glow); }
.flash.warn { border-left: 2px solid var(--warn); }
.flash.err { border-left: 2px solid var(--err); box-shadow: 0 0 20px var(--err-glow); }
.flash.info { border-left: 2px solid var(--info); }
.flash svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.flash.ok svg { color: var(--ok); }
.flash.warn svg { color: var(--warn); }
.flash.err svg { color: var(--err); }
.flash .close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 2px; margin-left: auto;
  font-family: var(--mono);
}

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   Cards & grids
   ============================================================ */

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1200px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .grid.cols-3 { grid-template-columns: repeat(2,1fr); }
  .grid.cols-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 700px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { flex-direction: row; overflow-x: auto; padding: 6px; }
  .sidebar nav a { white-space: nowrap; }
  .brand { padding: 10px 14px; }
  .content { padding: 14px; }
  .topbar h1 { font-size: 18px; }
  .statusbar { padding: 0 10px; gap: 8px; font-size: 10px; }
}

.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
}
.card:hover { border-color: var(--border-strong); }
.card.compact { padding: 12px 14px; }
.card h2 {
  margin: 0 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--mono);
}
.card h2.with-icon {
  display: flex; align-items: center; gap: 8px;
}
.card h2.with-icon svg {
  width: 14px; height: 14px; color: var(--accent);
}

/* Stat card — the tech panel look */
.stat {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.stat::before {
  content: ""; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--border);
  transition: background var(--transition);
}
.stat:hover { border-color: var(--border-strong); }
.stat:hover::before { background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.stat .stat-label {
  color: var(--text-dim);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono);
}
.stat .stat-label svg { width: 12px; height: 12px; opacity: 0.7; }
.stat .stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 4px;
  font-family: var(--mono);
  font-feature-settings: 'tnum';
  color: var(--text);
}
.stat .stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: var(--mono);
}
.stat.accent-ok::before { background: var(--ok); box-shadow: 0 0 8px var(--ok-glow); }
.stat.accent-warn::before { background: var(--warn); }
.stat.accent-err::before { background: var(--err); box-shadow: 0 0 8px var(--err-glow); }
.stat.accent-info::before { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

/* ============================================================
   Badges / pills
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-3);
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--mono);
  border: 1px solid transparent;
}
.badge svg { width: 10px; height: 10px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(34,209,117,0.3); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(245,176,65,0.3); }
.badge.err { background: var(--err-bg); color: var(--err); border-color: rgba(255,77,109,0.3); }
.badge.info { background: var(--info-bg); color: var(--info); border-color: rgba(6,182,212,0.3); }
.badge.accent { background: var(--accent-dim); color: var(--accent); border-color: rgba(0,229,255,0.3); }
.badge.lg { font-size: 11px; padding: 3px 9px; }

/* Status dot */
.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  background: var(--text-dim);
}
.dot.ok, .dot.up { background: var(--ok); box-shadow: 0 0 6px var(--ok-glow); }
.dot.warn, .dot.degraded { background: var(--warn); box-shadow: 0 0 6px rgba(245,176,65,0.5); }
.dot.err, .dot.unreachable { background: var(--err); box-shadow: 0 0 6px var(--err-glow); }
.dot.pulse { animation: pulse-glow 2s ease-in-out infinite; }

/* ============================================================
   Tables
   ============================================================ */

.table-wrap {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12.5px;
}
th, td {
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-strong);
}
tr:last-child td { border-bottom: none; }
tr { transition: background var(--transition); }
tbody tr:hover td { background: var(--bg-hover); }

/* ============================================================
   Forms
   ============================================================ */

form.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
form.row .full { grid-column: 1 / -1; }
@media (max-width: 700px) { form.row { grid-template-columns: 1fr; } }

label {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  font-family: var(--mono);
}

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=url],
input[type=search], input[type=tel],
select, textarea {
  width: 100%;
  background: var(--bg-0);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 12.5px;
  font-family: var(--mono);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-1);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
select {
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300e5ff' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
  appearance: none;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn, button[type=submit], button[type=button] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: var(--bg-0);
  border: 1px solid transparent;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 11.5px;
  font-family: var(--mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover, button[type=submit]:hover, button[type=button]:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 12px var(--accent-glow);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 13px; height: 13px; }

.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn.ghost:hover {
  background: var(--bg-hover); color: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.btn.subtle {
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border);
}
.btn.subtle:hover { background: var(--bg-hover); border-color: var(--border-strong); }

.btn.danger { background: var(--err); color: var(--bg-0); }
.btn.danger:hover { background: #ff6a85; box-shadow: 0 0 12px var(--err-glow); }

.btn.success { background: var(--ok); color: var(--bg-0); }
.btn.success:hover { box-shadow: 0 0 12px var(--ok-glow); }

.btn.sm { padding: 4px 9px; font-size: 10.5px; }
.btn.sm svg { width: 11px; height: 11px; }
.btn.lg { padding: 10px 16px; font-size: 13px; }
.btn.icon-only { padding: 6px; }

.btn-group {
  display: flex; gap: 7px; align-items: center; flex-wrap: wrap;
}
.inline-form { display: inline-block; }

/* ============================================================
   Alerts
   ============================================================ */

.alert {
  padding: 11px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12.5px;
  border: 1px solid transparent;
  font-family: var(--mono);
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(34,209,117,0.3); }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(245,176,65,0.3); }
.alert.err { background: var(--err-bg); color: var(--err); border-color: rgba(255,77,109,0.3); }
.alert.info { background: var(--info-bg); color: var(--info); border-color: rgba(6,182,212,0.3); }
.alert code {
  background: rgba(0, 0, 0, 0.4); padding: 1px 6px; border-radius: 3px;
  font-size: 11px; color: inherit;
}
.alert .alert-body { flex: 1; }

/* ============================================================
   Progress bars
   ============================================================ */

.bar {
  background: var(--bg-3);
  height: 5px;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
  position: relative;
}
.bar > .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 300ms ease;
  box-shadow: 0 0 6px var(--accent-glow);
}
.bar > .fill.ok { background: var(--ok); box-shadow: 0 0 6px var(--ok-glow); }
.bar > .fill.warn { background: var(--warn); box-shadow: 0 0 6px rgba(245,176,65,0.5); }
.bar > .fill.err { background: var(--err); box-shadow: 0 0 6px var(--err-glow); }

/* Sparklines */
.spark { display: block; width: 100%; height: 36px; }
.spark .spark-area { fill: var(--accent-dim); }
.spark .spark-line { stroke: var(--accent); stroke-width: 1.5; fill: none; filter: drop-shadow(0 0 2px var(--accent-glow)); }
.spark.ok .spark-line { stroke: var(--ok); filter: drop-shadow(0 0 2px var(--ok-glow)); }
.spark.ok .spark-area { fill: var(--ok-bg); }
.spark.warn .spark-line { stroke: var(--warn); }
.spark.warn .spark-area { fill: var(--warn-bg); }
.spark.err .spark-line { stroke: var(--err); filter: drop-shadow(0 0 2px var(--err-glow)); }
.spark.err .spark-area { fill: var(--err-bg); }

/* ============================================================
   Chat (agent IA)
   ============================================================ */

.chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-1);
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.msg { display: flex; gap: 10px; max-width: 86%; }
.msg .avatar-chat {
  width: 28px; height: 28px;
  border-radius: 4px;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}
.msg.user { margin-left: auto; flex-direction: row-reverse; }
.msg.user .avatar-chat {
  background: var(--accent); color: var(--bg-0);
  box-shadow: 0 0 8px var(--accent-glow);
}
.msg.assistant .avatar-chat {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: var(--bg-0);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}
.msg .msg-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg .who {
  font-size: 10px; color: var(--text-dim);
  font-weight: 600; display: flex; gap: 6px;
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em;
}
.msg .bubble {
  background: var(--bg-2);
  padding: 10px 14px;
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--border);
}
.msg.user .bubble {
  background: var(--accent-dim); border-color: rgba(0,229,255,0.3);
  color: var(--text);
}
.chat-input {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  display: flex; gap: 10px;
  background: var(--bg-1);
}
.chat-input textarea {
  flex: 1; min-height: 42px; max-height: 150px;
  border-radius: var(--radius); padding: 10px 12px;
}
.chat-input button { align-self: flex-end; }

.suggestions {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}
.suggestion {
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 2px;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--mono);
  transition: all var(--transition);
}
.suggestion:hover {
  color: var(--accent); border-color: var(--accent);
  background: var(--bg-hover); box-shadow: 0 0 8px var(--accent-glow);
}

/* ============================================================
   Login page
   ============================================================ */

.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at top, rgba(0, 229, 255, 0.08), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(168, 85, 247, 0.06), transparent 50%),
    linear-gradient(rgba(0, 229, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.02) 1px, transparent 1px),
    var(--bg-0);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px, 100% 100%;
}
.login-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow-glow);
  position: relative;
}
.login-card::before {
  content: ""; position: absolute; top: -1px; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.login-card .brand-login {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 22px;
}
.login-card .brand-login svg {
  width: 30px; height: 30px;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}
.login-card .brand-login strong {
  font-family: var(--mono);
  font-size: 18px; font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-shadow: 0 0 8px var(--accent-glow);
}
.login-card h1 {
  text-align: center; margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 14px; font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.15em;
}
.login-card .subtitle {
  text-align: center; color: var(--text-dim);
  margin-bottom: 22px;
  font-size: 11px; font-family: var(--mono);
}
.login-card button { width: 100%; margin-top: 12px; padding: 10px 14px; }
.login-card .field { margin-bottom: 12px; }

/* Terminal boot sequence */
.boot-lines {
  font-family: var(--mono); font-size: 11px;
  color: var(--text-dim); margin-bottom: 22px;
  min-height: 70px;
  line-height: 1.6;
}
.boot-lines .boot-line { display: block; }
.boot-lines .boot-ok { color: var(--ok); }
.boot-lines .boot-cursor::after {
  content: "▊"; color: var(--accent);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   Empty states
   ============================================================ */

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--mono);
}
.empty svg {
  width: 44px; height: 44px;
  opacity: 0.25;
  margin-bottom: 10px;
  color: var(--accent);
}
.empty h3 {
  margin: 0 0 4px;
  color: var(--text); font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.empty p { margin: 0 0 14px; font-size: 11.5px; }

/* ============================================================
   Command palette
   ============================================================ */

.palette-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  align-items: flex-start; justify-content: center;
  padding-top: 15vh;
}
.palette-backdrop.open { display: flex; }
.palette {
  width: 100%; max-width: 540px;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow), 0 20px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.palette-input {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.palette-input svg { width: 16px; height: 16px; color: var(--accent); }
.palette-input input {
  flex: 1; background: none; border: none;
  color: var(--text); font-size: 15px; font-family: var(--mono);
}
.palette-input input:focus { outline: none; box-shadow: none; background: none; }
.palette-input kbd {
  background: var(--bg-3); color: var(--text-muted);
  padding: 2px 6px; border-radius: 3px; font-size: 10px;
  font-family: var(--mono); border: 1px solid var(--border);
}
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--mono); font-size: 12px;
  color: var(--text);
}
.palette-item.active, .palette-item:hover {
  background: var(--accent-dim); color: var(--accent);
}
.palette-item svg { width: 14px; height: 14px; opacity: 0.7; flex-shrink: 0; }
.palette-item .kind {
  margin-left: auto; font-size: 10px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* ============================================================
   Observatory (live monitoring page)
   ============================================================ */

.live-panel {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.live-panel-head {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-muted); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.12em;
  font-family: var(--mono); margin-bottom: 10px;
}
.live-panel-head .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 6px var(--ok-glow);
  animation: pulse-glow 2s ease-in-out infinite;
}
.terminal {
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--mono); font-size: 11.5px;
  color: var(--ok);
  line-height: 1.5;
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
}
.terminal .ts { color: var(--text-dim); margin-right: 10px; }
.terminal .lvl-ok { color: var(--ok); }
.terminal .lvl-warn { color: var(--warn); }
.terminal .lvl-err { color: var(--err); }
.terminal .lvl-info { color: var(--accent); }
.terminal .srv { color: var(--accent-2); }

/* ============================================================
   Utilities
   ============================================================ */

.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.small { font-size: 11px; }
.xs { font-size: 10px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 11.5px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.mt-sm { margin-top: 6px; }
.mt { margin-top: 14px; }
.mt-lg { margin-top: 20px; }
.mb-sm { margin-bottom: 6px; }
.mb { margin-bottom: 14px; }
.mb-lg { margin-bottom: 20px; }
h2.section-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 24px 0 10px;
  font-family: var(--mono);
  display: flex; align-items: center; gap: 10px;
}
h2.section-head::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}
hr {
  border: 0; border-top: 1px solid var(--border); margin: 20px 0;
}
.section-head-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 10px;
}
.section-head-row h2 {
  margin: 0; font-size: 11px; font-weight: 600;
  color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.14em; font-family: var(--mono);
}

kbd {
  font-family: var(--mono); font-size: 10px;
  background: var(--bg-3); color: var(--text-muted);
  padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--border);
}

/* subtle hover elevation for list items */
.list-item {
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: all var(--transition);
}
.list-item:hover {
  background: var(--bg-hover); border-left: 2px solid var(--accent);
  padding-left: 8px;
}

/* ============================================================
   v1.3 — polish pass: readability, warmth, micro-interactions
   ============================================================ */

/* --- Softer page background with aurora glow --- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(0, 229, 255, 0.06), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 100%, rgba(168, 85, 247, 0.05), transparent 60%);
}
.layout { position: relative; z-index: 1; }

/* --- Typography breathing room --- */
html, body {
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.005em;
}
.content { padding: 24px 36px 48px; }
h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.015em; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.005em; margin: 24px 0 14px; }
h3 { font-size: 13px; font-weight: 600; letter-spacing: 0.03em; margin: 14px 0 10px; }

/* --- Cards: softer edges, warm hover with glow --- */
.card {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 2px 10px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition: transform 220ms cubic-bezier(0.2, 0, 0, 1),
              border-color 220ms, box-shadow 220ms;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 10px 32px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(0, 229, 255, 0.04);
}

/* --- Stat big numbers: lively gradient --- */
.card .big {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text), var(--accent-hover));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin: 4px 0 2px;
}
.card .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 4px;
}

/* --- Tables: readable rows with subtle alternation --- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
table { border-collapse: collapse; width: 100%; font-size: 13px; }
thead th {
  background: var(--bg-2);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-strong);
  text-align: left;
  position: sticky; top: 0; z-index: 2;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 150ms; }
tbody tr:nth-child(even) { background: rgba(255,255,255,0.012); }
tbody tr:hover { background: var(--bg-hover); }
tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
tbody strong { color: var(--text); font-weight: 600; }

/* --- Badges: pill with soft shadow and icon alignment --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--bg-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  line-height: 1.3;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(34,209,117,0.25); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(245,176,65,0.25); }
.badge.err { background: var(--err-bg); color: var(--err); border-color: rgba(255,77,109,0.25); }
.badge.info { background: var(--info-bg); color: var(--info); border-color: rgba(6,182,212,0.25); }
.badge.accent { background: var(--accent-dim); color: var(--accent); border-color: var(--border-glow); }
.badge.lg { padding: 5px 12px; font-size: 11.5px; }

/* --- Buttons: more depth + micro bounce --- */
.btn, button[type=submit], button.btn {
  background: linear-gradient(180deg, #00e5ff, #00bcd4);
  color: #042029;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 2px 10px rgba(0,229,255,0.15), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform 120ms, box-shadow 180ms, background 180ms;
}
.btn:hover, button[type=submit]:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4), 0 6px 18px rgba(0,229,255,0.3), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--bg-hover); border-color: var(--border-strong); transform: none; }
.btn.success { background: linear-gradient(180deg, #22d175, #15b863); color: #04200f; }
.btn.danger { background: linear-gradient(180deg, #ff4d6d, #e63a5a); color: #fff; }

/* --- Forms: softer inputs, focus glow --- */
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], select, textarea {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--sans);
  transition: border-color 160ms, box-shadow 160ms, background 160ms;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-1);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}
label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 5px;
}

/* --- Sidebar refinements --- */
.sidebar nav a {
  margin: 1px 4px;
  border-radius: 6px;
}
.sidebar nav a.active {
  background: linear-gradient(90deg, var(--accent-dim), transparent);
  box-shadow: inset 2px 0 0 var(--accent), 0 0 24px -8px rgba(0,229,255,0.3);
}

/* --- Chat refinements --- */
.chat {
  box-shadow:
    0 0 0 1px rgba(0, 229, 255, 0.15),
    0 10px 60px -20px rgba(0, 229, 255, 0.08),
    0 20px 40px -20px rgba(0, 0, 0, 0.6);
}
.msg .bubble {
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.03);
  animation: msgIn 240ms cubic-bezier(0.2,0,0,1);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg.assistant .bubble {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border-left: 2px solid var(--accent-2);
}

/* --- Empty states: elegant --- */
.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty svg.icon {
  width: 44px; height: 44px;
  opacity: 0.3;
  margin-bottom: 14px;
  color: var(--accent);
  filter: drop-shadow(0 0 20px var(--accent-glow));
}
.empty h3 {
  margin: 0 0 6px;
  color: var(--text); font-size: 14px; font-weight: 600;
  text-transform: none; letter-spacing: 0;
  font-family: var(--sans);
}
.empty p {
  margin: 0 auto;
  font-size: 12.5px;
  max-width: 420px;
  line-height: 1.6;
}

/* --- Animations: fade-in content --- */
.content > * { animation: contentIn 280ms cubic-bezier(0.2,0,0,1) backwards; }
.content > *:nth-child(1) { animation-delay: 0ms; }
.content > *:nth-child(2) { animation-delay: 40ms; }
.content > *:nth-child(3) { animation-delay: 80ms; }
.content > *:nth-child(4) { animation-delay: 120ms; }
.content > *:nth-child(5) { animation-delay: 160ms; }
@keyframes contentIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Topbar polish --- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.topbar h1 { margin: 0; }
.topbar small { display: block; margin-top: 2px; }

/* --- Breadcrumbs refined --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
  font-family: var(--mono);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

/* --- Dots & indicators --- */
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok-glow); }
.dot.err { background: var(--err); box-shadow: 0 0 8px var(--err-glow); }
.dot.warn { background: var(--warn); box-shadow: 0 0 8px rgba(245,176,65,0.4); }
.stat-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.stat-dot.up { background: var(--ok); box-shadow: 0 0 8px var(--ok-glow); animation: pulse-glow 3s ease-in-out infinite; }
.stat-dot.degraded { background: var(--warn); box-shadow: 0 0 8px rgba(245,176,65,0.4); }
.stat-dot.unreachable { background: var(--err); box-shadow: 0 0 8px var(--err-glow); }
.stat-dot.unknown { background: var(--text-dim); }
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 6px var(--ok-glow); opacity: 1; }
  50% { box-shadow: 0 0 14px var(--ok-glow); opacity: 0.8; }
}

/* --- Progress bars: smoother --- */
.bar {
  background: var(--bg-0);
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid var(--border);
}
.bar > .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  box-shadow: 0 0 8px rgba(0,229,255,0.3);
  transition: width 400ms cubic-bezier(0.2,0,0,1);
}
.bar > .fill.warn { background: linear-gradient(90deg, var(--warn), #ffcc66); box-shadow: 0 0 8px rgba(245,176,65,0.3); }
.bar > .fill.err { background: linear-gradient(90deg, var(--err), #ff7a90); box-shadow: 0 0 8px rgba(255,77,109,0.3); }

/* --- Status bar polish --- */
.statusbar {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  backdrop-filter: blur(10px);
}

/* --- Live events: more legible --- */
.event-feed .event {
  padding: 4px 0 4px 10px;
  line-height: 1.4;
}
.event-feed .event time {
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}

/* --- Accessibility: focus-visible --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible, a:focus-visible { outline-offset: 3px; }

/* --- Scrollbar styling --- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 5px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* --- Markdown rendering polish --- */
.markdown-content {
  font-size: 13.5px;
  line-height: 1.65;
}
.markdown-content table {
  margin: 8px 0;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.markdown-content th {
  background: var(--bg-3);
  padding: 6px 10px;
  font-size: 10.5px;
}
.markdown-content td { padding: 6px 10px; border-bottom: 1px solid var(--border); }

/* --- Autonomous agent badge/pulse --- */
.agent-pulse {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--text-muted); letter-spacing: 0.1em;
  text-transform: uppercase;
}
.agent-pulse .live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse-glow 1.8s ease-in-out infinite;
}


/* ============================================================
   Search bar + pagination (list toolbars)
   ============================================================ */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.list-toolbar .search-input {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 520px;
}
.list-toolbar .search-input svg.icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.list-toolbar .search-input input {
  padding-left: 34px;
  padding-right: 32px;
  background: var(--bg-0);
  border-radius: 8px;
  font-family: var(--sans);
}
.list-toolbar .search-input input:focus { background: var(--bg-1); }
.list-toolbar .search-input .clear-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; line-height: 1;
  text-decoration: none;
  transition: all 150ms;
}
.list-toolbar .search-input .clear-search:hover {
  background: var(--err);
  color: #fff;
  text-decoration: none;
  text-shadow: none;
}
.list-toolbar select {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  min-width: 140px;
}
.list-toolbar select:hover { border-color: var(--border-strong); }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 12px;
}
.pager-info { color: var(--text-muted); }
.pager-info strong { color: var(--text); font-weight: 600; }
.pager-controls {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  min-width: 36px;
  transition: all 150ms;
}
.pager-btn:hover:not(.disabled) {
  background: var(--bg-hover);
  color: var(--accent);
  border-color: var(--border-strong);
  text-decoration: none;
  text-shadow: 0 0 6px var(--accent-glow);
}
.pager-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}
.pager-cur {
  padding: 0 10px;
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.05em;
}
.pager-cur strong {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}
.per-page-form {
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}
.per-page-form select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 24px 5px 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}

/* Keyboard shortcut hint on search */
.list-toolbar .search-input::after {
  content: "/";
  position: absolute;
  right: 36px; top: 50%; transform: translateY(-50%);
  background: var(--bg-3); color: var(--text-dim);
  font-family: var(--mono); font-size: 10px;
  padding: 1px 6px; border-radius: 3px;
  border: 1px solid var(--border);
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms;
}
.list-toolbar .search-input:not(:focus-within)::after { opacity: 0.5; }
.list-toolbar .search-input input:placeholder-shown ~ .clear-search { display: none; }


/* ============================================================
   Health table — compact resource rows + site chips
   ============================================================ */
.health-table table { font-size: 12.5px; }
.health-table td { vertical-align: top; padding: 10px 12px; }

/* Compact resource lines (CPU/MEM/DSK stacked) */
.res-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 11.5px;
}
.res-row strong { min-width: 32px; font-variant-numeric: tabular-nums; }
.res-row .res-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  min-width: 24px;
  font-weight: 700;
}
.res-row .bar { height: 4px; margin: 0; }
.res-row .small { font-size: 10.5px; white-space: nowrap; }

/* Site chips — compact rounded tags */
.site-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}
.site-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--mono);
  text-decoration: none;
  max-width: 140px;
  transition: all 120ms;
}
.site-chip:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--border-glow);
  text-decoration: none;
  text-shadow: none;
}
.site-chip .dot {
  width: 5px; height: 5px;
  margin: 0;
  flex-shrink: 0;
}
.site-chip .chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-chip.chip-more {
  background: var(--bg-3);
  color: var(--text-dim);
  font-weight: 600;
}

/* Shrink icons inside dense table cells */
.health-table td svg.icon { width: 11px; height: 11px; }
.health-table td .badge { font-size: 10px; padding: 2px 7px; }
.health-table td .badge svg.icon { width: 9px; height: 9px; }

/* Allow the table to use more horizontal space on this page */
.health-table { overflow-x: auto; }


/* ============================================================
   Search input polish — visible text, nicer presentation
   ============================================================ */

/* Belt-and-suspenders color enforcement for all inputs */
input, select, textarea { color: var(--text) !important; }
input::placeholder, textarea::placeholder { color: var(--text-dim); opacity: 0.75; }
input[type=search]::-webkit-search-cancel-button { display: none; }

.list-toolbar .search-input input[type=search] {
  background: linear-gradient(180deg, var(--bg-0), rgba(6, 8, 12, 0.6));
  color: var(--text) !important;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 11px 36px 11px 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 180ms;
  caret-color: var(--accent);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.02);
}
.list-toolbar .search-input input[type=search]::placeholder {
  color: var(--text-dim);
  font-weight: 400;
  font-style: italic;
  opacity: 0.6;
}
.list-toolbar .search-input input[type=search]:hover {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
.list-toolbar .search-input input[type=search]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-1);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.3),
    0 0 0 3px rgba(0, 229, 255, 0.15),
    0 0 24px -6px rgba(0, 229, 255, 0.25);
}
.list-toolbar .search-input input[type=search]:focus::placeholder {
  opacity: 0.3;
}
.list-toolbar .search-input svg.icon {
  width: 18px; height: 18px;
  color: var(--text-muted);
  transition: color 180ms;
}
.list-toolbar .search-input:focus-within svg.icon {
  color: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

/* Nicer selects next to the search */
.list-toolbar select {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  color: var(--text) !important;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 32px 10px 14px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300e5ff' stroke-width='2.5' stroke-linecap='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}
.list-toolbar select:hover {
  border-color: var(--border-strong);
  background-color: var(--bg-hover);
}
.list-toolbar select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}
.list-toolbar select option {
  background: var(--bg-1);
  color: var(--text);
}


/* ============================================================
   LIVE SYSTEM — freshness indicator + update flash
   ============================================================ */

/* Status-bar indicator */
.live-indicator {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  height: 100%;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  border-left: 1px solid var(--border);
}
.live-indicator .live-pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 300ms;
}
.live-indicator.live-ok .live-pulse-dot {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok-glow);
  animation: live-breath 2s ease-in-out infinite;
}
.live-indicator.live-updating .live-pulse-dot {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: live-spin 0.6s linear infinite;
}
.live-indicator.live-stale .live-pulse-dot {
  background: var(--warn);
  box-shadow: 0 0 8px rgba(245,176,65,0.4);
  animation: live-blink 1s ease-in-out infinite;
}
.live-indicator.live-error .live-pulse-dot {
  background: var(--err);
  box-shadow: 0 0 8px var(--err-glow);
}
.live-indicator.live-ok .live-text { color: var(--ok); }
.live-indicator.live-stale .live-text { color: var(--warn); }
.live-indicator.live-error .live-text { color: var(--err); }
.live-indicator.live-updating .live-text { color: var(--accent); }

@keyframes live-breath {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}
@keyframes live-spin {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(360deg) scale(1); }
}
@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Flash when a cell updates to a new value */
@keyframes live-flash {
  0%   { background-color: rgba(0, 229, 255, 0.22); box-shadow: 0 0 12px rgba(0,229,255,0.3); }
  40%  { background-color: rgba(0, 229, 255, 0.12); }
  100% { background-color: transparent; box-shadow: none; }
}
.live-flash {
  animation: live-flash 900ms ease-out;
  border-radius: 4px;
}
/* Avoid overflow glow on tiny inline spans */
td .live-flash, strong.live-flash, span.live-flash {
  padding: 1px 4px;
  margin: -1px -4px;
}

/* Freshness subtle grid overlay — pulse the whole page briefly on first update */
body.live-first-tick::before { animation: live-first 500ms ease-out; }
@keyframes live-first {
  0%   { opacity: 0.9; }
  100% { opacity: 1; }
}


/* ============================================================
   Fix autofill — Chrome/Safari apply their own white bg + black
   text to pre-filled or autofilled inputs. Override everywhere.
   ============================================================ */

/* All autofill variants: keep our dark bg + light text */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 100px var(--bg-0) inset !important;
          box-shadow: 0 0 0 100px var(--bg-0) inset !important;
  caret-color: var(--accent) !important;
  border-color: var(--border) !important;
  background-color: var(--bg-0) !important;
  background-image: none !important;
  transition: background-color 999999s ease-in-out 0s,
              color 999999s ease-in-out 0s;
}

/* Firefox autofill handling */
input:autofill,
textarea:autofill,
select:autofill {
  background-color: var(--bg-0) !important;
  color: var(--text) !important;
  filter: none;
}

/* Belt-and-suspenders: force readable text on ALL form controls, every state */
input, textarea, select {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--accent);
}
input::placeholder, textarea::placeholder {
  color: var(--text-muted) !important;
  -webkit-text-fill-color: var(--text-muted) !important;
  opacity: 0.75;
}
input:focus::placeholder, textarea:focus::placeholder { opacity: 0.4; }

/* Native inputs on dark theme — ensure spin buttons/arrows are visible */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  filter: invert(0.5);
}
input[type=date]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}
input[type=search]::-webkit-search-cancel-button {
  filter: invert(0.6);
}

/* Make sure focused inputs are clearly readable */
input:focus, textarea:focus, select:focus {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  background-color: var(--bg-1) !important;
}

/* Disabled/readonly must still be legible */
input:disabled, textarea:disabled, select:disabled,
input[readonly], textarea[readonly] {
  color: var(--text-muted) !important;
  -webkit-text-fill-color: var(--text-muted) !important;
  background-color: var(--bg-2) !important;
  opacity: 0.7;
}

/* Autofill on the search bar specifically keeps its gradient bg */
.list-toolbar .search-input input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 100px var(--bg-0) inset !important;
}


/* ============================================================
   STRONG autofill override — final boss
   The box-shadow inset trick is the only way to override Chrome's
   autofill background. Combined with -webkit-text-fill-color for
   the text, this must be the LAST rule in the stylesheet so no
   other rule overrides it.
   ============================================================ */

/* Universal background enforcement for every text-like input, every state */
input:not([type=button]):not([type=submit]):not([type=reset]):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]),
textarea,
select {
  background-color: var(--bg-0) !important;
  background-image: none !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--accent) !important;
}

/* The box-shadow trick: Chrome ignores background-color on autofilled
   inputs, but it respects box-shadow inset. 100px covers the whole input. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-0) inset !important;
          box-shadow: 0 0 0 1000px var(--bg-0) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  color: var(--text) !important;
  caret-color: var(--accent) !important;
  border-color: var(--border) !important;
  transition: background-color 999999999s ease 0s,
              color 999999999s ease 0s !important;
}

/* Focused autofilled: lighter bg */
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-1) inset,
                      0 0 0 3px rgba(0, 229, 255, 0.15) !important;
}

/* Firefox autofill */
input:autofill,
textarea:autofill {
  background-color: var(--bg-0) !important;
  color: var(--text) !important;
  filter: none !important;
  box-shadow: 0 0 0 1000px var(--bg-0) inset !important;
}

/* Fallback: force text-shadow technique for any stubborn case
   (makes the real text re-render on top) */
input, textarea, select {
  text-shadow: 0 0 0 var(--text);
}


/* ============================================================
   UNIFIED input style — every input must look like the "22" one.
   This is the final/winning rule; appears last in the stylesheet.
   ============================================================ */

/* The baseline — applied to every form control */
input:not([type=button]):not([type=submit]):not([type=reset]):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]),
textarea,
select {
  box-sizing: border-box !important;
  width: 100% !important;
  height: auto !important;
  min-height: 38px !important;
  background: var(--bg-0) !important;
  background-image: none !important;
  background-color: var(--bg-0) !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 9px 12px !important;
  font-family: var(--sans) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  letter-spacing: 0.01em !important;
  caret-color: var(--accent) !important;
  outline: none;
  transition: border-color 160ms, background-color 160ms, box-shadow 160ms;
  /* Fallback text layer: makes glyphs visible even if autofill overlay sneaks in */
  text-shadow: 0 0 0 var(--text);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Textarea: taller baseline */
textarea {
  min-height: 90px !important;
  resize: vertical;
  font-family: var(--mono) !important;
  font-size: 12.5px !important;
}

/* Select: keep the custom arrow */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d8aa3' stroke-width='2.5' stroke-linecap='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
  cursor: pointer;
}

/* Hover: subtle lift */
input:not([type=button]):not([type=submit]):hover,
textarea:hover,
select:hover {
  border-color: var(--border-strong) !important;
}

/* Focus: accent glow */
input:not([type=button]):not([type=submit]):focus,
textarea:focus,
select:focus {
  border-color: var(--accent) !important;
  background: var(--bg-1) !important;
  background-color: var(--bg-1) !important;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15) !important;
}

/* Placeholder — always visible */
input::placeholder, textarea::placeholder {
  color: var(--text-muted) !important;
  -webkit-text-fill-color: var(--text-muted) !important;
  opacity: 0.6 !important;
  font-style: italic;
  font-weight: 400;
}

/* Autofill — Chrome's ninja override, defeated for real this time */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-0) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  background-color: var(--bg-0) !important;
  background-image: none !important;
  caret-color: var(--accent) !important;
  border: 1px solid var(--border) !important;
  transition: background-color 999999s ease-in-out 0s,
              color 999999s ease-in-out 0s !important;
}
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-1) inset,
                      0 0 0 3px rgba(0, 229, 255, 0.15) !important;
}

/* Firefox */
input:autofill, textarea:autofill, select:autofill {
  background: var(--bg-0) !important;
  color: var(--text) !important;
  filter: none !important;
}

/* Date/time pickers — matching look */
input[type=date], input[type=time], input[type=datetime-local] {
  font-family: var(--mono) !important;
}
input[type=date]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator,
input[type=datetime-local]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(0.3) saturate(2) hue-rotate(150deg);
  cursor: pointer;
  opacity: 0.6;
}
input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Number spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  filter: invert(0.5);
  opacity: 0.5;
}

/* Disabled */
input:disabled, textarea:disabled, select:disabled, input[readonly] {
  color: var(--text-muted) !important;
  -webkit-text-fill-color: var(--text-muted) !important;
  background: var(--bg-2) !important;
  background-color: var(--bg-2) !important;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Search-input in list toolbar — keep its icon padding + gradient */
.list-toolbar .search-input input[type=search] {
  padding-left: 38px !important;
  padding-right: 36px !important;
  background: linear-gradient(180deg, var(--bg-0), rgba(6, 8, 12, 0.6)) !important;
}
.list-toolbar .search-input input[type=search]:focus {
  background: var(--bg-1) !important;
}


/* ============ Sauvegardes ============ */
.bk-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--text-dim); flex: none; vertical-align: middle; margin: 0 3px; }
.bk-dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok-glow); }
.bk-dot.warn { background: var(--warn); }
.bk-dot.err { background: var(--err); box-shadow: 0 0 8px var(--err-glow); }
.bk-dot.new { background: transparent; border: 2px solid var(--accent); width: 8px; height: 8px; }
.bk-dot.idle { background: var(--border-strong); }
.bk-dot.run { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); animation: bkpulse 1.2s infinite; }
@keyframes bkpulse { 50% { opacity: .35; } }
.bk-of { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.stat .stat-value.bk-sm { font-size: 18px; line-height: 1.35; }
.bk-meter { height: 6px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; margin: 8px 0 4px; }
.bk-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #a855f7); }
.err-t { color: var(--err); } .warn-t { color: var(--warn); }
.bk-alerts .bk-alert { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.bk-alerts .bk-alert:first-of-type { border-top: 0; }
.bk-alert-t { flex: 1; min-width: 0; }
.bk-prof summary, details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
.bk-prof-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.bk-prof-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; background: var(--bg-hover); display: flex; flex-direction: column; gap: 6px; }
.bk-prof-card.rec { border-color: var(--border-glow); box-shadow: var(--shadow-glow); }
.bk-prof-card p { margin: 0; }
.bk-mini { width: 100%; font-size: 11.5px; border-collapse: collapse; }
.bk-mini td { padding: 3px 4px 3px 0; border: 0; vertical-align: top; }
.bk-mini svg { width: 12px; height: 12px; vertical-align: -2px; opacity: .7; }
.bk-prof-f { display: flex; gap: 6px; margin-top: auto; }
.bk-prof-f select { flex: 1; min-width: 0; font-size: 12px; }
.bk-srv-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.bk-srv-h .bk-dot { width: 12px; height: 12px; }
.bk-srv-t { flex: 1; min-width: 220px; }
.bk-srv-t h2 { margin: 0; }
.bk-srv-k { text-align: right; line-height: 1.5; }
.bk-doms { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.bk-doms span { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--accent-dim); color: var(--accent); font-family: var(--mono); }
.bk-table td { vertical-align: top; }
.bk-name { min-width: 220px; }
.bk-off td { opacity: .5; }
.bk-table tr[hidden] { display: none !important; }
.bk-strip { display: grid; grid-template-columns: repeat(30, 6px); gap: 2px; }
.bk-strip i { display: block; height: 14px; border-radius: 1px; background: var(--bg-hover); }
.bk-strip i.ok { background: var(--ok); } .bk-strip i.fail { background: var(--err); }
.bk-strip.lg { grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 4px; }
.bk-strip.lg i { height: 26px; border-radius: 3px; }
.bk-lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-left: 8px; background: var(--bg-hover); }
.bk-lg.ok { background: var(--ok); } .bk-lg.fail { background: var(--err); }
.bk-bars { display: flex; align-items: flex-end; gap: 1px; height: 26px; margin-top: 4px; }
.bk-bars i { display: block; width: 4px; background: var(--accent); opacity: .55; border-radius: 1px 1px 0 0; }
.bk-acts { white-space: nowrap; }
.bk-acts .btn, .bk-acts form { margin-left: 2px; }
.bk-ed td { background: var(--bg-hover); }
.bk-ed-f { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.bk-ed-f label { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.bk-ed-f .bk-ret { display: inline-flex; gap: 10px; }
.bk-ed-f .bk-ret[hidden], .bk-ed-f .bk-cron[hidden] { display: none; }
.bk-ed-f input[type=number] { width: 80px; }
.bk-ed-f .bk-chk { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }
.bk-ed-f .bk-ex { flex-basis: 100%; }
.bk-ed-b { flex-basis: 100%; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bk-key { padding: 10px 12px; border: 1px dashed var(--warn); border-radius: var(--radius); background: var(--warn-bg); word-break: break-all; user-select: all; }
.bk-restore { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.bk-restore > div { min-width: 0; }
.bk-restore code, .bk-code { display: block; max-width: 100%; margin-top: 6px; padding: 6px 8px; background: var(--bg-hover); border-radius: var(--radius-sm); font-size: 11.5px; overflow-x: auto; white-space: pre; }
@media (max-width: 1100px) { .bk-prof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bk-restore { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .bk-prof-grid { grid-template-columns: 1fr; }
  .bk-srv-k { text-align: left; }
  .bk-table thead { display: none; }
  .bk-table table, .bk-table tbody, .bk-table tr, .bk-table td { display: block; width: 100%; }
  .bk-table tr { position: relative; padding: 10px 12px 10px 30px; border-bottom: 1px solid var(--border); }
  .bk-table td { padding: 3px 0; border: 0; }
  .bk-table td:first-child { position: absolute; left: 8px; top: 12px; width: auto; }
  .bk-table td.bk-acts { text-align: left; padding-top: 6px; }
  .bk-table tr.bk-ed { padding-left: 12px; }
  .bk-table tr.bk-ed td:first-child { display: none; }
  .bk-strip { grid-template-columns: repeat(30, minmax(0, 1fr)); }
}
/* Mise en page : la colonne de contenu ne s'élargit plus au-delà de l'écran (tableaux larges, menu mobile défilant) */
.layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.content { min-width: 0; }
.topbar { flex-wrap: wrap; gap: 10px; }
.topbar .btn-group { flex-wrap: wrap; }
@media (max-width: 700px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-width: 0; max-width: 100vw; }
  .statusbar { overflow: hidden; max-width: 100vw; }
}

/* ============ Paiements ============ */
.pay-alerts .pay-alert { padding: 7px 0; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 12.5px; }
.pay-alerts .pay-alert:first-of-type { border-top: 0; }
.pay-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 170px; margin-top: 10px; }
.pay-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; color: var(--text-muted); text-decoration: none; }
.pay-col:hover { color: var(--text); text-decoration: none; }
.pay-val { font-family: var(--mono); font-size: 10.5px; white-space: nowrap; }
.pay-bar { width: 100%; max-width: 46px; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; background: var(--bg-hover); }
.pay-bar i { display: block; min-height: 2px; }
.pay-m { font-size: 11px; text-align: center; line-height: 1.2; }
.pay-m small { color: var(--text-dim); }
.k-serveur { background: var(--accent); } .k-domaine { background: #a855f7; } .k-stockage { background: var(--ok); } .k-mail { background: var(--warn); } .k-autre { background: var(--text-dim); }
.pay-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.pay-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.pay-months { margin-top: 12px; }
.pay-months summary { cursor: pointer; color: var(--accent); }
.pay-month h3 { margin: 14px 0 6px; font-size: 13px; display: flex; justify-content: space-between; }
.pay-mini { width: 100%; border-collapse: collapse; }
.pay-mini td, .pay-mini th { padding: 5px 6px; border-bottom: 1px solid var(--border); text-align: left; font-size: 12.5px; }
.pay-mini svg { width: 12px; height: 12px; opacity: .7; vertical-align: -2px; }
.pay-gh { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pay-gh h2 { margin: 0; }
.pay-table td { vertical-align: top; }
.pay-off td { opacity: .5; }
.pay-acts { white-space: nowrap; }
.pay-acts form, .pay-acts .btn { margin-left: 2px; }
.pay-ed td { background: var(--bg-hover); }
.pay-ed-f { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; align-items: end; margin-bottom: 10px; }
.pay-ed-f label { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.pay-ed-f .pay-wide { grid-column: span 2; }
.pay-chk { flex-direction: row !important; align-items: center; gap: 6px; }
.pay-num { width: 90px; }
.pay-table tr[hidden] { display: none !important; }
@media (max-width: 900px) { .pay-ed-f { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .pay-chart { gap: 3px; height: 150px; } .pay-val { font-size: 8.5px; } .pay-m { font-size: 9.5px; }
  .pay-table thead { display: none; }
  .pay-table table, .pay-table tbody, .pay-table tr, .pay-table td { display: block; width: 100%; }
  .pay-table tr { padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .pay-table td { padding: 3px 0; border: 0; }
  .pay-table td.pay-acts { text-align: left; padding-top: 6px; }
  .pay-ed-f { grid-template-columns: 1fr; } .pay-ed-f .pay-wide { grid-column: auto; }
}

/* ============ Disponibilité ============ */
.ok-t { color: var(--ok); }
.bk-strip i.part { background: var(--warn); }
.up-table td { vertical-align: top; }
@media (max-width: 640px) {
  .up-table thead { display: none; }
  .up-table table, .up-table tbody, .up-table tr, .up-table td { display: block; width: 100%; }
  .up-table tr { position: relative; padding: 10px 12px 10px 30px; border-bottom: 1px solid var(--border); }
  .up-table td { padding: 2px 0; border: 0; }
  .up-table td:first-child { position: absolute; left: 8px; top: 13px; width: auto; }
}

/* ============================================================
   Security module — gauge, grade badges, baseline checklist
   ============================================================ */

.sec-gauge { padding: 20px; }
.gauge-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 8px auto 12px;
}
.gauge-svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.gauge-track {
  fill: none;
  stroke: var(--bg-3);
  stroke-width: 10;
}
.gauge-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 283;
  transition: stroke-dashoffset 800ms cubic-bezier(0.3, 0, 0, 1);
  filter: drop-shadow(0 0 10px currentColor);
}
.gauge-fill.grade-a { stroke: var(--ok); color: var(--ok); }
.gauge-fill.grade-b { stroke: #86d1b0; color: #86d1b0; }
.gauge-fill.grade-c { stroke: var(--warn); color: var(--warn); }
.gauge-fill.grade-d { stroke: #f5861f; color: #f5861f; }
.gauge-fill.grade-f { stroke: var(--err); color: var(--err); }

.gauge-text, .gauge-sub {
  fill: var(--text);
  font-family: var(--mono);
  font-weight: 700;
  text-anchor: middle;
  transform: rotate(90deg);
  transform-origin: 60px 60px;
}
.gauge-text {
  font-size: 32px;
  dominant-baseline: central;
}
.gauge-sub {
  font-size: 10px;
  fill: var(--text-dim);
  font-weight: 500;
  dominant-baseline: central;
}

/* Grade badge */
.sec-grade {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--bg-0);
}
.sec-grade.grade-a { background: var(--ok); box-shadow: 0 0 10px var(--ok-glow); }
.sec-grade.grade-b { background: #86d1b0; }
.sec-grade.grade-c { background: var(--warn); }
.sec-grade.grade-d { background: #f5861f; color: #fff; }
.sec-grade.grade-f { background: var(--err); color: #fff; box-shadow: 0 0 10px var(--err-glow); }

/* Baseline checklist cells */
.sec-check {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  cursor: help;
}
.sec-check.pass { background: var(--ok-bg); color: var(--ok); border: 1px solid rgba(34,209,117,0.3); }
.sec-check.fail { background: var(--err-bg); color: var(--err); border: 1px solid rgba(255,77,109,0.3); }
.sec-check.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(245,176,65,0.3); }
.sec-check.unknown { background: var(--bg-3); color: var(--text-dim); border: 1px solid var(--border); }

/* Center helper */
.center { text-align: center; }

