/* Niyyasoft Storage Sizer — web UI */
:root {
  --navy: #1b2a41; --accent: #0f6cbd; --ink: #1b2430; --muted: #5b6675; --line: #e1e5ea;
  --bg: #f3f5f8; --card: #fff; --hl: #eaf3fc;
  --error: #c50f1f; --warning: #c26a00; --info: #0f6cbd; --pass: #107c10;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
h3 { margin: 0 0 10px; font-size: 15px; }
h4 { margin: 12px 0 4px; font-size: 13px; }
a { color: var(--accent); }

/* Header */
.top { background: var(--navy); color: #fff; padding: 14px 20px 0; }
.brandbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { flex: none; }
.company { color: #8fb3de; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.brand h1 { margin: 0; font-size: 20px; font-weight: 600; }
.subtitle { color: #afc3db; font-size: 12px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn { font: inherit; color: #fff; background: #2c3e5a; border: 1px solid #3e5475; border-radius: 4px; padding: 7px 12px; cursor: pointer; }
.btn:hover { filter: brightness(1.12); }
.btn.accent { background: var(--accent); border-color: #3b8edb; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { background: #fff; color: var(--accent); border-color: #b9d3ee; }
.btn:disabled { opacity: .45; cursor: default; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18); min-width: 240px; padding: 4px; }
.menu-list button { display: block; width: 100%; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; padding: 8px 10px; border-radius: 4px; cursor: pointer; }
.menu-list button:hover:not(:disabled) { background: var(--hl); }
.menu-list button:disabled { color: #9aa3ae; cursor: not-allowed; }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.modes { display: flex; gap: 4px; margin-top: 12px; }
.mode { font: 600 13px "Segoe UI", system-ui, sans-serif; color: #afc3db; background: transparent; border: 0; border-radius: 6px 6px 0 0; padding: 9px 18px; cursor: pointer; }
.mode:hover { background: #2c3e5a; }
.mode.active { background: var(--bg); color: var(--ink); }

/* Layout */
main { flex: 1; padding: 14px; }
.view { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .view { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin: 0 0 10px; }
fieldset.card { min-width: 0; }
legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
.row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 8px; margin: 5px 0; }
.row > span { color: var(--muted); }
.row.indent { grid-template-columns: 132px minmax(0, 1fr); margin-left: 18px; }
input, select { font: inherit; color: var(--ink); background: #fff; border: 1px solid #c8cfd8; border-radius: 4px; padding: 5px 7px; width: 100%; min-width: 0; }
input:disabled, select:disabled { background: #f1f3f5; color: #8a94a3; }
input[type=radio] { width: auto; }
input[type=range] { padding: 0; border: 0; }
select.full { margin: 2px 0; }
.check { display: flex; align-items: center; gap: 6px; margin: 5px 0; }
.check.split { justify-content: space-between; }
.check .small, input.small { width: 80px; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.hint.bad { color: var(--error); }
.mirror { margin-top: 8px; }
.mirror label { display: flex; justify-content: space-between; color: var(--muted); }
.mirror output { color: var(--ink); font-weight: 600; }

/* Results */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.tab { font: inherit; background: #e9edf2; border: 1px solid var(--line); border-bottom: 0; border-radius: 4px 4px 0 0; padding: 6px 12px; cursor: pointer; color: var(--ink); }
.tab.active { background: #fff; font-weight: 600; }
.panel { display: none; }
.panel.active { display: block; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 10px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; }
.kpi .label, .kpi .note { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 24px; font-weight: 600; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.accent .value { color: var(--accent); }
.kpi.bad .value { color: var(--error); }
.bar { display: flex; height: 32px; border-radius: 4px; overflow: hidden; background: #edf0f3; }
.bar div { color: #fff; font-size: 11.5px; font-weight: 600; display: flex; align-items: center; padding: 0 6px; white-space: nowrap; overflow: hidden; }
.legend { margin: 8px 0 10px; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.req { border-left: 4px solid var(--line); }
.req.ok { border-left-color: var(--pass); }
.req.no { border-left-color: var(--error); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-head h3 { margin: 0; }
.code { background: #0f1720; color: #dbe7f3; font: 12px/1.5 Consolas, "Cascadia Mono", monospace; padding: 12px; border-radius: 6px; overflow: auto; max-height: 520px; margin: 0; white-space: pre; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { background: #f7f9fb; text-align: left; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: 6px 8px; border-bottom: 1px solid #edf0f3; vertical-align: top; }
table.grid td.n, table.grid th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid tr.total td, table.grid tr.current td { background: var(--hl); font-weight: 600; }
table.grid tr.muted td { color: #8a94a3; }
table.grid tr.bad td { color: var(--error); }
table.grid tbody tr.selectable { cursor: pointer; }
table.grid tbody tr.selected td { background: #d7e8f8; }
.table-wrap { overflow-x: auto; }
td .note { display: block; color: var(--muted); font-size: 12px; }

.checks .item { display: flex; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; }
.badge { flex: none; width: 70px; text-align: center; color: #fff; font-size: 11px; font-weight: 600; border-radius: 4px; padding: 2px 0; height: fit-content; }
.badge.error { background: var(--error); } .badge.warning { background: var(--warning); } .badge.info { background: var(--info); } .badge.pass { background: var(--pass); }
.checks .area { font-weight: 600; }
.checks a { font-size: 12px; }

.editor { display: grid; grid-template-columns: 1.1fr 1.2fr 2.2fr .9fr .9fr; gap: 6px; }
.editor label span { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 700px) { .editor { grid-template-columns: 1fr 1fr; } .editor .wide { grid-column: span 2; } }
.editor-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.prose ol { padding-left: 20px; } .prose li { margin: 6px 0; } .links { font-size: 13px; }

.status { display: flex; justify-content: space-between; gap: 16px; background: #fff; border-top: 1px solid var(--line); padding: 6px 16px; color: var(--muted); font-size: 12px; }
.status .bad { color: var(--error); }
