:root {
  --bg: #f3f4f7; --panel: #ffffff; --line: #dfe2e8; --text: #1b1e24; --muted: #646b78; --side: #171a21; --side-text: #c9ced8;
  --accent: #2f5fd0; --accent-soft: #e6edfb; --ok: #18794e; --ok-soft: #ddf3e6; --warn: #8a5a00; --warn-soft: #fdefc8; --bad: #b3261e; --bad-soft: #fbe0de;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111318; --panel: #1b1e25; --line: #2d313b; --text: #e7e9ee; --muted: #9aa1ae; --side: #0c0d11; --side-text: #b9bfca;
    --accent: #7ea2f5; --accent-soft: #1f2b47; --ok: #5fcf96; --ok-soft: #173326; --warn: #f0bf55; --warn-soft: #3a2e12; --bad: #f08b84; --bad-soft: #3d1c1a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 system-ui, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 21px; margin: 0 0 4px; } h2 { font-size: 16px; margin: 0 0 10px; } h3 { font-size: 14px; margin: 14px 0 6px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .right { text-align: right; } .nowrap { white-space: nowrap; }

.layout { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; }
.brand { color: #fff; font-weight: 650; font-size: 15px; padding: 4px 10px 14px; }
.brand span { display: block; font-weight: 400; font-size: 12px; color: var(--side-text); }
.nav a { display: flex; justify-content: space-between; align-items: center; color: var(--side-text); padding: 8px 10px; border-radius: 7px; margin: 1px 0; }
.nav a:hover { background: #ffffff14; text-decoration: none; } .nav a.on { background: #ffffff22; color: #fff; }
.nav .count { background: var(--bad); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; }
.side .foot { margin-top: auto; padding: 10px; font-size: 12.5px; }
.side .foot button { margin-top: 6px; width: 100%; }
.main { padding: 22px 26px 60px; min-width: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.banner { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.grid { display: grid; gap: 12px; } .g4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } .g2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); } .g3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.tile .n { font-size: 26px; font-weight: 650; line-height: 1.2; } .tile .l { color: var(--muted); font-size: 12.5px; }
.tile.alert .n { color: var(--bad); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 7px 8px; border-bottom: 1px solid var(--line); }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; } tr.click { cursor: pointer; } tr.click:hover td { background: var(--accent-soft); }
.scroll { overflow-x: auto; }

.b { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--line); color: var(--text); white-space: nowrap; }
.b.ok { background: var(--ok-soft); color: var(--ok); } .b.warn { background: var(--warn-soft); color: var(--warn); } .b.bad { background: var(--bad-soft); color: var(--bad); } .b.info { background: var(--accent-soft); color: var(--accent); }

button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 7px; padding: 6px 12px; cursor: pointer; }
button:hover { border-color: var(--accent); } button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; } button.good { background: var(--ok); border-color: var(--ok); color: #fff; } button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
@media (prefers-color-scheme: dark) { button.primary, button.good, button.danger { color: #111; } }
button.sm { padding: 3px 9px; font-size: 12.5px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; max-width: 100%; }
textarea { width: 100%; min-height: 120px; resize: vertical; } input[type=text], input[type=password] { width: 100%; }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 10px 0 3px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .row > .grow { flex: 1; min-width: 160px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: 5px 12px; border-radius: 16px; border: 1px solid var(--line); color: var(--text); background: var(--panel); }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }
@media (prefers-color-scheme: dark) { .tabs a.on { color: #111; } }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow: auto; max-height: 420px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; margin: 6px 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 110px; }
.bars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; min-width: 0; }
.bars .bar { width: 100%; max-width: 26px; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; } .bars .bar.t { background: var(--line); }
.bars .d { font-size: 10.5px; color: var(--muted); }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; } .switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 20px; cursor: pointer; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--ok); } .switch input:checked + span::before { transform: translateX(16px); }
.agent { display: flex; flex-direction: column; gap: 6px; } .agent .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.agent .name { font-weight: 600; } .agent .num { color: var(--muted); font-weight: 400; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; } .login .card { width: 100%; max-width: 360px; padding: 24px; }
.err { color: var(--bad); margin-top: 8px; min-height: 20px; }
.modal { position: fixed; inset: 0; background: #0009; display: grid; place-items: start center; padding: 40px 14px; overflow: auto; z-index: 20; } .modal[hidden] { display: none; }
.modal-box { background: var(--panel); border-radius: 12px; padding: 20px 22px; width: 100%; max-width: 820px; position: relative; }
.modal .x { position: absolute; right: 10px; top: 8px; border: 0; font-size: 22px; background: none; }
.toast { position: fixed; right: 18px; bottom: 18px; background: var(--side); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 30; max-width: 380px; } .toast.bad { background: var(--bad); }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; } .side { position: static; height: auto; padding: 10px; } .side .foot { margin-top: 8px; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; } .nav a { padding: 6px 9px; } .main { padding: 16px 14px 50px; } .kv { grid-template-columns: 1fr; }
}

/* pagina Costuri: culorile seriilor si graficele */
:root { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; }
@media (prefers-color-scheme: dark) { :root { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; } }
.chart { margin-top: 8px; min-height: 60px; overflow: hidden; } .chart svg { display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; } .chart .axis { stroke: var(--muted); stroke-width: 1; opacity: .6; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; } .chart .hit { fill: transparent; } .chart .hit:hover { fill: var(--muted); fill-opacity: .12; }
.chart .ring { stroke: var(--panel); stroke-width: 2; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); } .legend span { display: inline-flex; align-items: center; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; flex: none; } .dash { display: inline-block; width: 16px; border-top: 2px dashed; margin-right: 6px; }
.hb { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 7px 10px; align-items: center; }
.hbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hbt { height: 14px; background: var(--bg); border-radius: 0 4px 4px 0; } .hbf { height: 100%; border-radius: 0 4px 4px 0; }
.hbv { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.ctip { position: fixed; z-index: 40; pointer-events: none; background: var(--side); color: #fff; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; line-height: 1.45; max-width: 300px; box-shadow: 0 4px 14px #0004; } .ctip[hidden] { display: none; }
.tile .up { color: var(--bad); } .tile .down { color: var(--ok); } .tile .l .dot { vertical-align: -1px; }
input[type=date] { padding: 4px 8px; }

/* ---- inbox de suport ---- */
.dot-new { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.msgs { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; padding: 2px; }
.msg { max-width: 88%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--bg); align-self: flex-start; }
.msg.out { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.msg.note { align-self: stretch; max-width: 100%; background: var(--warn-soft); border-color: transparent; }
.msg .mh { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 3px; }
.msg .mb { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 900px) { .grid.g2[style*="2fr"] { grid-template-columns: 1fr !important; } .layout { grid-template-columns: 1fr; } .side { position: static; height: auto; } }