/* OLT Monitor — single stylesheet, no build step (works on cPanel as-is) */
:root {
  color-scheme: dark;
  --bg: #121211;
  --surface-1: #1a1a19;
  --surface-2: #222220;
  --surface-3: #2c2c29;
  --border: #33332f;
  --text-primary: #f0efec;
  --text-secondary: #c3c2b7;
  --text-muted: #8f8e85;
  --accent: #3987e5;
  --series-1: #3987e5;   /* In / RX  (categorical slot 1, dark) */
  --series-2: #d95926;   /* Out / TX (categorical slot 2, dark) */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --radius: 10px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Noto Sans Bengali", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text-primary); font: 14px/1.45 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.mono, code { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--surface-1); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 15px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; font-size: 13px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-secondary); padding: 8px 10px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text-primary); text-decoration: none; }
.nav a.active { background: var(--surface-3); color: var(--text-primary); }
.nav .count { background: var(--critical); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.side-foot { margin-top: auto; padding: 10px; font-size: 12px; color: var(--text-muted); }
.main { padding: 22px 26px 60px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.grid { display: grid; gap: 14px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-21 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .g-4 { grid-template-columns: repeat(2, 1fr); } .g-3, .g-21 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; } .side-foot { display: none; } .g-4, .g-2 { grid-template-columns: 1fr; } .main { padding: 16px; } }

/* cards */
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.stat .label { color: var(--text-muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 28px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .value small { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.stat .foot { margin-top: 6px; font-size: 12.5px; color: var(--text-secondary); display: flex; gap: 12px; flex-wrap: wrap; }
.mb { margin-bottom: 14px; }

/* status: color + icon + label, never color alone */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-primary); white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.pill.up::before, .pill.good::before { background: var(--good); }
.pill.weak::before, .pill.warning::before, .pill.degraded::before { background: var(--warning); }
.pill.high::before, .pill.serious::before { background: var(--serious); }
.pill.down::before, .pill.critical::before, .pill.offline::before { background: var(--critical); }
.pill.down::before, .pill.critical::before { box-shadow: 0 0 0 3px rgba(208,59,59,.25); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.good { background: var(--good); } .dot.weak { background: var(--warning); } .dot.critical { background: var(--critical); } .dot.high { background: var(--serious); } .dot.unknown { background: var(--text-muted); }
.sev-icon { font-weight: 800; width: 18px; display: inline-block; text-align: center; }
.sev-critical { color: var(--critical); } .sev-warning { color: var(--warning); } .sev-info { color: var(--accent); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.r, th.r { text-align: right; }
.empty { padding: 26px; text-align: center; color: var(--text-muted); }

/* signal band bar (stacked, 2px surface gaps) */
.band { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; background: var(--surface-1); }
.band > span { display: block; height: 100%; min-width: 3px; }
.band .good { background: var(--good); } .band .weak { background: var(--warning); } .band .critical { background: var(--critical); } .band .high { background: var(--serious); } .band .unknown { background: var(--surface-3); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; color: var(--text-secondary); }
.legend b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.util { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.util > span { display: block; height: 100%; background: var(--series-1); border-radius: 3px; }

/* forms & buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-3); color: var(--text-primary); border: 1px solid var(--border); padding: 7px 13px; border-radius: 8px; font: 500 13px var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: #383835; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #2a78d6; }
.btn.danger { color: #ff8a8a; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }
label { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 5px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; background: var(--bg); color: var(--text-primary); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: 14px var(--font); }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text-primary); font-size: 14px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters > div { min-width: 140px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.seg button, .seg a { background: none; border: 0; color: var(--text-secondary); padding: 4px 10px; border-radius: 6px; font: 500 12.5px var(--font); cursor: pointer; }
.seg .on { background: var(--surface-3); color: var(--text-primary); }

/* flash */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.flash.ok { border-left: 4px solid var(--good); }
.flash.error { border-left: 4px solid var(--critical); }

/* charts */
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.chart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-secondary); }
.chart-legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; border-radius: 1px; }
.chart-empty { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: var(--text-muted); font-size: 13px; text-align: center; padding: 20px; }

/* olt cards */
.olt-card { display: block; color: inherit; }
.olt-card:hover { border-color: #4a4a45; text-decoration: none; }
.olt-card .kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.olt-card .kv div span { display: block; font-size: 11.5px; color: var(--text-muted); }
.olt-card .kv div b { font-size: 15px; font-variant-numeric: tabular-nums; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 360px; }

.pagination { display: flex; gap: 4px; list-style: none; padding: 0; margin: 14px 0 0; flex-wrap: wrap; }
.pagination li > * { display: block; padding: 5px 10px; border-radius: 6px; background: var(--surface-2); color: var(--text-secondary); font-size: 13px; }
.pagination li.active > * { background: var(--accent); color: #fff; }
.pagination li.disabled > * { opacity: .4; }
