@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0b0d10;
  --bg-elev: #14171c;
  --bg-elev2: #1a1e25;
  --border: #262b34;
  --text: #e6e8ec;
  --text-dim: #9aa1ad;
  --muted: #6b727f;
  --ok: #22c55e;
  --warn: #f59e0b;
  --fail: #ef4444;
  --accent: #22c55e;
  --shadow: 0 4px 20px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.muted { color: var(--text-dim); }
.small { font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ===== Login ===== */
.login-body {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at 20% 10%, rgba(34,197,94,.08), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(99,102,241,.06), transparent 40%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

.login-header { text-align: center; margin-bottom: 24px; }
.login-header h1 { margin: 10px 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.login-header p { margin: 0; }

.logo-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  display: inline-block;
  margin: 0 auto;
}

form label {
  display: block;
  margin-bottom: 14px;
}
form label span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}
form input {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  outline: none;
  transition: border-color .15s;
}
form input:focus { border-color: var(--accent); }

form button {
  width: 100%;
  margin-top: 6px;
  background: var(--accent);
  color: #06120a;
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s;
}
form button:hover { filter: brightness(1.1); }

.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.alert-error { background: rgba(239,68,68,.12); color: #fda4af; border: 1px solid rgba(239,68,68,.3); }

.login-card footer { text-align: center; margin-top: 18px; }

/* ===== Topbar ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
@media (max-width: 640px) {
  .topbar { padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); flex-wrap: wrap; gap: 6px; }
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-weight: 700; letter-spacing: -.01em; }
.brand-sub { color: var(--text-dim); font-size: 13px; }

.topbar-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn-link {
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all .15s;
}
.btn-link:hover { color: var(--text); border-color: var(--text-dim); }

/* Larger touch targets on mobile */
@media (max-width: 640px) {
  .btn-link { padding: 10px 16px; min-height: 44px; display: inline-flex; align-items: center; }
  .topbar-meta { gap: 10px; }
  .brand-name { font-size: 16px; }
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
}
.pill-ok   { background: rgba(34,197,94,.15);  color: #4ade80; }
.pill-warn { background: rgba(245,158,11,.15); color: #fbbf24; }
.pill-fail { background: rgba(239,68,68,.15);  color: #f87171; }
.pill-unknown { background: rgba(107,114,128,.18); color: #9ca3af; }

/* ===== Cards on mobile: larger ===== */
@media (max-width: 640px) {
  .card { padding: 16px; }
  .card h2 { font-size: 14px; }
}

/* ===== Login card on mobile ===== */
@media (max-width: 640px) {
  .login-card { max-width: 100%; margin: 0 14px; padding: 28px 20px; }
}

/* ===== Landing page cards fill width on mobile ===== */
@media (max-width: 640px) {
  .landing-card { width: 100%; max-width: 100%; padding: 2rem 1.5rem; }
  .landing-grid { padding: 0 14px; gap: 1rem; }
}

/* ===== Grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 22px 24px;
  max-width: 1320px;
  margin: 0 auto;
}
.span-2 { grid-column: span 2; }
@media (max-width: 1024px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: span 2; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; padding: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .span-2 { grid-column: span 1; }
}

/* ===== Larger text on mobile ===== */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .big-num { font-size: 30px; }
  .mini-table { font-size: 14px; }
  .mini-table th, .mini-table td { padding: 10px 6px; }
  .svc { padding: 14px; }
  .metric { padding: 14px; }
  .bug { padding: 12px; }
}

/* ===== Footer safe area ===== */
@media (max-width: 640px) {
  .footer { padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}
.card h2 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ===== Services ===== */
.services { display: flex; flex-direction: column; gap: 8px; }
.svc {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.svc-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.svc-ok   .svc-dot { background: var(--ok);   box-shadow: 0 0 8px var(--ok); }
.svc-warn .svc-dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.svc-fail .svc-dot { background: var(--fail); box-shadow: 0 0 8px var(--fail); }
.svc-unknown .svc-dot { background: var(--muted); }

.svc-body { flex: 1; min-width: 0; }
.svc-name { font-weight: 500; }
.svc-detail { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.svc-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
}
.svc-ok   .svc-status { color: var(--ok); }
.svc-warn .svc-status { color: var(--warn); }
.svc-fail .svc-status { color: var(--fail); }
.svc-unknown .svc-status { color: var(--muted); }

/* ===== VPS ===== */
.vps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.metric {
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.metric-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-weight: 500;
}
.metric-val { font-variant-numeric: tabular-nums; font-weight: 600; }

.bar {
  height: 6px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.bar-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.bar-ok   { background: linear-gradient(90deg, var(--ok), #4ade80); }
.bar-warn { background: linear-gradient(90deg, var(--warn), #fbbf24); }
.bar-fail { background: linear-gradient(90deg, var(--fail), #f87171); }

/* ===== Bugs ===== */
.bug-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.bug {
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: 6px;
  padding: 10px 12px;
}
.bug-high { border-left-color: var(--fail); }
.bug-med  { border-left-color: var(--warn); }
.bug-low  { border-left-color: var(--ok); }

.bug-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.bug-sev {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: .04em;
}
.sev-high { background: rgba(239,68,68,.18); color: #f87171; }
.sev-med  { background: rgba(245,158,11,.18); color: #fbbf24; }
.sev-low  { background: rgba(34,197,94,.18); color: #4ade80; }

.bug-client { font-weight: 500; }
.bug-id { font-size: 11px; color: var(--text-dim); }
.bug-date { margin-left: auto; }
.bug-title { color: var(--text-dim); font-size: 13px; }

/* ===== Mini tables ===== */
.big-num {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 0;
  color: var(--accent);
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}
.mini-table th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: .04em;
  padding: 8px 8px;
  border-bottom: 1px solid var(--border);
}
.mini-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--border);
}
.mini-table tr:last-child td { border-bottom: 0; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* ===== Suppliers Page ===== */
.sup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px 0;
  max-width: 1320px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 16px;
}
.sup-header h1 { margin: 0; font-size: 1.5rem; }
.sup-header p { margin: 4px 0 0; }

.sup-total-box {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 28px;
  text-align: center;
}
.sup-total-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.sup-total-amount {
  display: block;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.sup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 22px 24px;
  max-width: 1320px;
  margin: 0 auto;
}
.sup-card-wide { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .sup-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sup-grid { padding: 14px; gap: 14px; }
  .sup-header { padding: 14px 14px 0; }
  .sup-total-box { padding: 14px 20px; width: 100%; }
  .sup-total-amount { font-size: 26px; }
}

/* Category bars */
.sup-cat-list { display: flex; flex-direction: column; gap: 10px; }
.sup-cat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.sup-cat-name { font-weight: 500; flex: 1; }
.sup-cat-pct { color: var(--text-dim); font-size: 12px; min-width: 36px; text-align: right; }
.sup-cat-amount { min-width: 72px; font-variant-numeric: tabular-nums; }

.sup-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.sup-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .5s ease;
}
.sup-bar-infra { background: linear-gradient(90deg, #6366f1, #818cf8); }
.sup-bar-api { background: linear-gradient(90deg, #22c55e, #4ade80); }
.sup-bar-software { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.sup-bar-telecom { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.sup-bar-fintech { background: linear-gradient(90deg, #ec4899, #f472b6); }
.sup-bar-other { background: linear-gradient(90deg, #6b7280, #9ca3af); }

/* Supplier rows */
.sup-supplier-list { display: flex; flex-direction: column; gap: 6px; }
.sup-supplier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: 8px;
  gap: 8px;
}
.sup-supplier-head { flex: 1; min-width: 0; }
.sup-supplier-name { font-weight: 500; display: block; }
.sup-supplier-cat { display: block; margin-top: 2px; }
.sup-supplier-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Expense table description truncation */
.sup-desc {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .sup-desc { max-width: 120px; }
}

/* ===== Metrics Page ===== */
.accent { color: var(--accent); }
.warn { color: var(--warn); }

.margin-pct {
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}
.margin-pct.positive { color: var(--accent); }

/* Trend bar chart */
.trend-chart {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  gap: 24px;
  padding: 20px 0 10px;
  min-height: 200px;
}
.trend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 120px;
}
.trend-label {
  margin-bottom: 8px;
  font-weight: 500;
}
.trend-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  width: 100%;
}
.trend-bar-group {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 180px;
}
.trend-bar-revenue {
  width: 28px;
  background: linear-gradient(180deg, var(--accent), #4ade80);
  border-radius: 4px 4px 0 0;
  transition: height .5s ease;
  min-height: 4px;
}
.trend-bar-expense {
  width: 28px;
  background: linear-gradient(180deg, var(--warn), #fbbf24);
  border-radius: 4px 4px 0 0;
  transition: height .5s ease;
  min-height: 4px;
}
.trend-value {
  margin-top: 6px;
  font-size: 11px;
}
.trend-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
}
.trend-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}
.trend-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* Pie chart */
.pie-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.pie {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid var(--border);
}
.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.pie-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pie-client-name { flex: 1; font-weight: 500; }
.pie-client-pct { color: var(--text-dim); min-width: 40px; text-align: right; }
.pie-client-amount { font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }

/* Cash flow */
.cashflow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.cashflow-box {
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cashflow-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-dim);
}
.cashflow-amount {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.cashflow-amount.positive { color: var(--accent); }
.cashflow-amount.pending { color: var(--warn); }
.cashflow-count { font-size: 11px; }

@media (max-width: 640px) {
  .cashflow-grid { grid-template-columns: 1fr; }
  .trend-chart { gap: 12px; padding: 14px 0; }
  .trend-bar-revenue, .trend-bar-expense { width: 22px; }
  .pie { width: 120px; height: 120px; }
}

/* ===== PWA Native Feel ===== */

/* No tap flash on iOS */
* { -webkit-tap-highlight-color: transparent; }

/* No rubber-banding, no 300ms tap delay */
body {
  touch-action: manipulation;
  overscroll-behavior: none;
}

/* Smooth scrolling */
html { scroll-behavior: smooth; }

/* Press-effect on touchable interactive elements */
.landing-card,
.btn-link,
form button {
  transition: transform 0.12s ease, filter 0.15s, box-shadow 0.12s ease;
  will-change: transform;
}

.landing-card:active,
.btn-link:active,
form button:active {
  transform: scale(0.97);
}

/* ===== Skeleton / Loading Shimmer ===== */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.loading-shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-elev2) 0%,
    var(--bg-elev) 40%,
    var(--bg-elev2) 80%,
    var(--bg-elev2) 100%
  );
  background-size: 800px 100%;
  background-repeat: no-repeat;
  animation: shimmer 1.6s infinite ease-in-out;
  border-radius: 6px;
  color: transparent;
  pointer-events: none;
  user-select: none;
}

/* ===== View Transitions (progressive enhancement) ===== */
@supports (view-transition-name: none) {
  ::view-transition-old(root) {
    animation: 0.25s ease-out both fadeOut;
  }
  ::view-transition-new(root) {
    animation: 0.25s ease-out both fadeIn;
  }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Fade-in on page load for main content */
main {
  animation: fadeIn 0.2s ease-out;
}

/* ===== SW Update Toast ===== */
#sw-update-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1e25;
  color: #e6e8ec;
  border: 1px solid #262b34;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

#sw-update-toast:hover {
  background: #262b34;
}

/* ===== Offline page enhancements ===== */
.offline-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 1.5rem;
  align-items: center;
}
.offline-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev2);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.offline-btn:hover,
.offline-btn:active {
  background: var(--bg-elev);
  border-color: var(--text-dim);
}
.offline-btn:active {
  transform: scale(0.97);
}
.offline-status {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.offline-status.online {
  color: var(--ok);
}

/* ============================================================
   Monitoring dashboard (redesigned 2026-05-16)
   Phone-shaped column, glanceable in 2 seconds.
   ============================================================ */

.dash-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: fadeIn 0.2s ease-out;
}
@media (max-width: 640px) {
  .dash-main { padding: 18px 16px 32px; gap: 22px; }
}

/* Brand dot reflects overall health */
.logo-ok      { background: var(--ok);   box-shadow: 0 0 12px var(--ok); }
.logo-warn    { background: var(--warn); box-shadow: 0 0 12px var(--warn); }
.logo-fail    { background: var(--fail); box-shadow: 0 0 12px var(--fail); }
.logo-unknown { background: var(--muted); }

/* ===== Banner ===== */
.banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
}
.banner-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.banner-title { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.banner-sub { line-height: 1.4; }

.banner-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.banner-ok {
  background:
    radial-gradient(circle at 0% 0%, rgba(34,197,94,.10), transparent 50%),
    var(--bg-elev);
  border-color: rgba(34,197,94,.28);
}
.banner-ok .banner-dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.banner-warn {
  background:
    radial-gradient(circle at 0% 0%, rgba(245,158,11,.10), transparent 50%),
    var(--bg-elev);
  border-color: rgba(245,158,11,.28);
}
.banner-warn .banner-dot { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.banner-fail {
  background:
    radial-gradient(circle at 0% 0%, rgba(239,68,68,.12), transparent 50%),
    var(--bg-elev);
  border-color: rgba(239,68,68,.32);
}
.banner-fail .banner-dot {
  background: var(--fail);
  box-shadow: 0 0 10px var(--fail);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1;    box-shadow: 0 0 10px var(--fail); }
  50%      { opacity: .55;  box-shadow: 0 0 4px var(--fail); }
}

/* ===== Block ===== */
.block { display: flex; flex-direction: column; gap: 12px; }
.block-title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 4px;
}

/* ===== Status list (Sistemes) ===== */
.status-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.status-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.status-row:last-child { border-bottom: 0; }

.status-name { font-weight: 500; font-size: 15px; letter-spacing: -.005em; }

.status-dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block;
}
.status-ok      .status-dot { background: var(--ok);   box-shadow: 0 0 8px var(--ok); }
.status-warn    .status-dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.status-fail    .status-dot { background: var(--fail); box-shadow: 0 0 8px var(--fail); animation: pulse-dot 2s ease-in-out infinite; }
.status-unknown .status-dot { background: var(--muted); }

.status-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}
.status-ok      .status-label { color: var(--ok); }
.status-warn    .status-label { color: var(--warn); }
.status-fail    .status-label { color: var(--fail); }
.status-unknown .status-label { color: var(--muted); }

/* ===== Assistants ===== */
.assistant-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assistant {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: 14px;
  padding: 18px 20px;
}
.assistant-active { border-left-color: var(--ok); }
.assistant-low    { border-left-color: var(--warn); }
.assistant-silent { border-left-color: var(--fail); }

.assistant-active .status-dot { background: var(--ok);   box-shadow: 0 0 8px var(--ok); }
.assistant-low    .status-dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.assistant-silent .status-dot { background: var(--fail); box-shadow: 0 0 8px var(--fail); animation: pulse-dot 2s ease-in-out infinite; }

.assistant-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.assistant-name {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -.01em;
}

.assistant-stats {
  display: flex;
  gap: 36px;
  margin-bottom: 10px;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
  line-height: 1;
  color: var(--text);
}
.assistant-active .stat-num { color: var(--ok); }
.assistant-silent .stat-num { color: var(--text-dim); }

.stat-label {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 10px;
  font-weight: 600;
}

.assistant-since { line-height: 1.4; }

/* Footer kept minimal */
.dash-main + .footer {
  margin-top: 0;
  border-top: 0;
  padding-top: 4px;
}

