/* ---- fleet ---- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi-card { padding: 14px 16px; }

.bento { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }

.srv-card {
  position: relative; cursor: pointer;
  box-shadow: inset 3px 0 0 var(--hue, var(--accent)), var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .16s, transform .16s;
}
.srv-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.srv-card .top { display: flex; align-items: flex-start; gap: 10px; }
.srv-card .name { font-size: 14.5px; font-weight: 600; }
.srv-card .host { font-size: 12px; color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-card .dot-status { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.srv-card .dot-status.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(127,174,90,.12); }
.srv-card .dot-status.off { background: var(--danger); box-shadow: 0 0 0 4px rgba(226,96,122,.12); }
.srv-card .err { font-size: 11.5px; color: #E9A396; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.srv-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric { display: flex; flex-direction: column; gap: 4px; }
.metric .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.metric .val { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric .val small { font-size: 11px; color: var(--muted); font-weight: 500; }

.srv-spark { height: 46px; margin: 0 -2px; }
.srv-spark svg { width: 100%; height: 100%; display: block; }
.srv-foot { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }

/* ---- server detail ---- */
.detail-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.detail-head .avatar {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(201,131,193,.25);
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(340px, 1fr); gap: 14px; }
@media (max-width: 1100px) { .grid-main, .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.chart-card { padding: 14px 16px 8px; }
.chart-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.chart-head .v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-head .u { font-size: 12px; color: var(--muted); }
.chart { width: 100%; height: 120px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .axis { fill: var(--muted-2); font-size: 9.5px; font-family: var(--mono); }

.ring-wrap { display: flex; align-items: center; gap: 14px; }
.ring { width: 84px; height: 84px; flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring text { fill: var(--text); font-size: 17px; font-weight: 600; font-family: var(--mono); }
.ring .track { stroke: #2b4753; }
.legend { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.legend b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.list-row:last-child { border-bottom: 0; }
.list-row .mono { color: var(--muted); }
.list-row .spacer { flex: 1; }

.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11.5px; padding: 3px 8px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  font-family: var(--mono);
}
.chip.bad { color: #E9A396; border-color: rgba(226,96,122,.3); }
.chip.ok { color: var(--ok); border-color: rgba(127,174,90,.3); }

/* ---- auth screens ---- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(430px, 100%); padding: 26px; }
.auth-card .brand { justify-content: center; margin-bottom: 6px; font-size: 17px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.auth-card .btn { width: 100%; height: 38px; }
.auth-err { color: #E9A396; font-size: 12.5px; margin-top: 4px; min-height: 16px; }
.totp-input { letter-spacing: .5em; text-align: center; font-family: var(--mono); font-size: 18px; }

/* ---- access matrix ---- */
table.matrix { border-collapse: separate; border-spacing: 0; }
table.matrix th, table.matrix td { border-bottom: 1px solid var(--border); }
table.matrix th.srv-col { min-width: 108px; text-align: center; }
table.matrix .srv-th { display: flex; align-items: center; gap: 6px; justify-content: center; }
table.matrix .srv-th .nm { font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 600;
  max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.matrix .srv-th .dot-status { width: 6px; height: 6px; border-radius: 50%; flex: none; }
table.matrix .srv-th .dot-status.on { background: var(--ok); }
table.matrix .srv-th .dot-status.off { background: var(--danger); }
table.matrix td.matrix-cell { text-align: center; padding: 6px; }
table.matrix .cell {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  display: inline-grid; place-items: center;
  border: 1px solid var(--border-strong); background: #14232b; color: var(--muted-2);
  transition: background .12s, border-color .12s, color .12s;
}
table.matrix .cell:hover { border-color: var(--accent); background: var(--accent-soft); }
table.matrix .cell.on { background: rgba(143, 180, 154, .24); border-color: rgba(143, 180, 154, .65); color: #B7D6BF; }
table.matrix .cell.on:hover { background: rgba(196, 112, 95, .18); border-color: rgba(196, 112, 95, .6); color: #EFB3A8; }
table.matrix .cell.failed { background: rgba(221, 174, 130, .14); border-color: rgba(221, 174, 130, .5); color: var(--warn); }
table.matrix .cell.login { box-shadow: inset 0 0 0 2px rgba(169, 174, 203, .55); }
table.matrix .cell.busy { opacity: .5; }
table.matrix .cell .ico { width: 15px; height: 15px; }
.keydot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted-2); }
.keydot[data-loc="kuca"] { background: var(--ok); }
.keydot[data-loc="posao"] { background: var(--accent); }
.keydot[data-loc="vps"] { background: var(--violet); }
.keydot[data-loc="panel"] { background: var(--warn); }

/* ---- diff ---- */
.diff { font-family: var(--mono); font-size: 12px; }
.diff .ln { padding: 1px 8px; white-space: pre-wrap; word-break: break-all; }
.diff .add { background: rgba(127,174,90,.10); color: #C9E2CE; }
.diff .del { background: rgba(226,96,122,.10); color: #EFB3A8; }
.diff .same { color: var(--muted); }

/* ---- login/graph helpers ---- */
.sparkline-empty { color: var(--muted-2); font-size: 11.5px; }
.scroll-y { max-height: 320px; overflow-y: auto; }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); overflow-wrap: anywhere; }

/* per-server key rows */
.key-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.key-row:last-child { border-bottom: 0; }
.key-main { flex: 1; min-width: 0; }
.key-name { font-weight: 600; font-size: 13px; }
.key-fp { margin-top: 4px; font-size: 10.5px; word-break: break-all; line-height: 1.4; }
.code-inline.wrap { white-space: normal; }
.code-inline.wrap span { white-space: pre-wrap; word-break: break-all; font-size: 11px; line-height: 1.5; }
