/* ============================================================
   VPS Monitor — stil dashboard
   Paletă proprie (nu template generic):
     fundal   #0a0e14  (albastru-noapte foarte închis)
     panou    #111722
     linie    #1e2733
     text     #c7d0dd / muted #6b7688
     verde    #34d399  roșu #f4526b  cyan #38bdf8  chihlimbar #f0b429
   Tipografie: cifre monospace (ledger), UI sans compact.
   ============================================================ */

:root {
  --bg:      #0a0e14;
  --panel:   #111722;
  --panel-2: #0e141d;
  --line:    #1e2733;
  --line-2:  #2a3644;
  --text:    #c7d0dd;
  --muted:   #6b7688;
  --green:   #34d399;
  --green-d: #10b981;
  --red:     #f4526b;
  --cyan:    #38bdf8;
  --amber:   #f0b429;
  --violet:  #a78bfa;
  --radius:  10px;
  --mono: "SF Mono", "JetBrains Mono", "Fira Code", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.center { text-align: center; }
.num { text-align: right; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(180deg, #0d131c, var(--panel-2));
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.brand-mark { color: var(--cyan); font-size: 18px; }
.brand-title { font-weight: 650; letter-spacing: .3px; }
.sep { color: var(--line-2); }

.badge {
  font-size: 10px; font-weight: 700; letter-spacing: .8px;
  padding: 3px 7px; border-radius: 5px;
}
.badge-ro { color: var(--amber); background: rgba(240,180,41,.12); border: 1px solid rgba(240,180,41,.3); }

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); display: inline-block;
  transition: background .3s;
}
.status-dot.ok  { background: var(--green); box-shadow: 0 0 8px rgba(52,211,153,.7); }
.status-dot.bad { background: var(--red);   box-shadow: 0 0 8px rgba(244,82,107,.7); }

.btn-ghost {
  color: var(--muted); text-decoration: none; font-size: 13px;
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px;
  transition: all .15s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--line-2); }

/* ---------- KPI row ---------- */
.kpi-row {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 12px; padding: 16px 20px;
}
.kpi {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.kpi-value { font-size: 24px; font-weight: 640; margin-top: 4px; line-height: 1.1; }
.kpi-unit { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.kpi-foot { font-size: 11px; color: var(--muted); margin-top: 4px; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* ---------- Grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; padding: 0 20px 20px;
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; overflow: hidden;
}
.card-wide { grid-column: span 2; }
.card-full { grid-column: span 4; }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 10px;
}
.card-head h2 { font-size: 13px; font-weight: 600; margin: 0; color: var(--text); letter-spacing: .2px; }

.range-tabs { display: flex; gap: 2px; background: var(--panel-2); border-radius: 6px; padding: 2px; }
.range-tabs button {
  background: none; border: none; color: var(--muted);
  font-size: 11px; padding: 3px 9px; border-radius: 4px; cursor: pointer;
  font-family: var(--sans); transition: all .12s;
}
.range-tabs button:hover { color: var(--text); }
.range-tabs button.active { background: var(--line); color: var(--text); }

.legend { display: flex; gap: 12px; margin-left: auto; margin-right: 8px; font-size: 11px; }
.lg { position: relative; padding-left: 14px; color: var(--muted); }
.lg::before { content: ""; position: absolute; left: 0; top: 5px; width: 9px; height: 3px; border-radius: 2px; }
.lg-cpu::before { background: var(--cyan); }
.lg-ram::before { background: var(--violet); }

.chart { width: 100%; display: block; }

/* ---------- Tabel boți ---------- */
.table-wrap { overflow-x: auto; }
.bots-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bots-table th {
  text-align: left; font-weight: 500; color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.bots-table th.num { text-align: right; }
.bots-table td { padding: 10px; border-bottom: 1px solid var(--line); }
.bots-table tr:last-child td { border-bottom: none; }
.bots-table tr:hover td { background: rgba(255,255,255,.015); }

.bot-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.bot-icon {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #0a0e14;
}

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.pill-active { color: var(--green); background: rgba(52,211,153,.1); }
.pill-active::before { background: var(--green); }
.pill-stale  { color: var(--amber); background: rgba(240,180,41,.1); }
.pill-stale::before { background: var(--amber); }
.pill-stopped,.pill-unknown { color: var(--muted); background: rgba(107,118,136,.12); }
.pill-stopped::before,.pill-unknown::before { background: var(--muted); }
.pill-paused { color: var(--red); background: rgba(244,82,107,.1); }
.pill-paused::before { background: var(--red); }

.yes { color: var(--green); font-weight: 600; }
.no  { color: var(--muted); }
.side-long  { color: var(--green); font-weight: 600; }
.side-short { color: var(--red); font-weight: 600; }

/* ---------- Liste servicii / kv ---------- */
.svc-list, .kv-list { display: flex; flex-direction: column; gap: 2px; }
.svc-row, .kv-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 4px; border-bottom: 1px solid var(--line);
}
.svc-row:last-child, .kv-row:last-child { border-bottom: none; }
.svc-name { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.svc-val { font-size: 12px; }
.kv-key { color: var(--muted); font-size: 12px; }
.kv-val { font-size: 13px; }

.dot-ok   { color: var(--green); }
.dot-warn { color: var(--amber); }
.dot-bad  { color: var(--red); }
.dot-off  { color: var(--muted); }

/* ---------- Footer ---------- */
.footer { padding: 16px 20px 28px; text-align: center; font-size: 12px; border-top: 1px solid var(--line); }

/* ---------- Login ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  width: 340px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand .brand-mark { font-size: 26px; }
.brand-sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12px; color: var(--muted); }
.field input {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 10px 12px; color: var(--text);
  font-size: 14px; font-family: var(--sans); transition: border .15s;
}
.field input:focus { outline: none; border-color: var(--cyan); }
.btn-primary {
  margin-top: 6px; background: var(--cyan); color: #06121c;
  border: none; border-radius: 7px; padding: 11px; font-size: 14px;
  font-weight: 650; cursor: pointer; transition: filter .15s;
}
.btn-primary:hover { filter: brightness(1.08); }
.login-error {
  background: rgba(244,82,107,.1); border: 1px solid rgba(244,82,107,.3);
  color: var(--red); padding: 9px 12px; border-radius: 7px;
  font-size: 13px; margin-bottom: 16px;
}
.login-foot { margin-top: 18px; font-size: 11px; color: var(--muted); text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(4, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card-wide { grid-column: span 2; }
  .card-full { grid-column: span 2; }
}
@media (max-width: 680px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .card-wide, .card-full { grid-column: span 1; }
  .topbar-right .sep, #clock { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
