/* Panoul HELQ: o unealtă de lucru. Date dese, lizibile; o singură culoare de accent
   (chihlimbarul aplicației), folosită doar pentru „unde ești” și pentru ce se poate schimba. */
:root {
  --bg: #f2f4f6; --panel: #fff; --ink: #151a21; --soft: #5b6573; --line: #d8dde4; --line-soft: #e9ecf0;
  --mark: #ffc53d; --mark-ink: #7a5200; --bad: #b3261e; --bad-bg: #fdecea; --good: #1c6b45; --good-bg: #e7f4ec;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1 { font-size: 20px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 14px; margin: 24px 0 8px; font-weight: 650; }
p { margin: 0 0 10px; max-width: 72ch; }
.soft { color: var(--soft); }
.mono { font-family: var(--mono); font-size: 13px; }

/* intrare */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login form { width: min(360px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.login .brand { font-weight: 800; font-size: 26px; letter-spacing: 0.02em; }
.login .brand i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--mark); margin-left: 3px; }
.login p { color: var(--soft); margin: 4px 0 22px; }
label { display: block; font-weight: 600; margin: 14px 0 5px; }
input[type=email], input[type=password], input[type=text], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #aab2bd; border-radius: 6px; background: #fff;
}
textarea { font-family: var(--mono); font-size: 13px; resize: vertical; }
.btn { padding: 8px 14px; border-radius: 6px; border: 1px solid #aab2bd; background: #fff; cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--ink); }
.btn.main { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.main:hover { background: #2a323d; }
.btn.warn { background: var(--mark); border-color: #d9a21f; color: #3b2800; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.link { border: 0; background: none; padding: 0; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.login .btn { width: 100%; margin-top: 20px; }
.note { padding: 10px 12px; border-radius: 6px; margin: 12px 0; max-width: 90ch; }
.note.bad { background: var(--bad-bg); color: var(--bad); }
.note.good { background: var(--good-bg); color: var(--good); }
.note.info { background: #fff6dc; color: var(--mark-ink); }

/* cadru */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100%; }
nav { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
nav .brand { font-weight: 800; font-size: 18px; padding: 0 16px 12px; letter-spacing: 0.02em; }
nav .brand i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mark); margin-left: 2px; }
nav .brand span { font-weight: 500; color: var(--soft); font-size: 13px; margin-left: 6px; letter-spacing: 0; }
nav h3 { font-size: 12px; font-weight: 600; color: var(--soft); margin: 18px 16px 4px; }
nav a { display: block; padding: 5px 16px; color: var(--ink); text-decoration: none; border-left: 3px solid transparent; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav a:hover { background: var(--bg); }
nav a.on { border-left-color: var(--mark); background: #fff8e3; font-weight: 600; }
nav a small { color: var(--soft); font-weight: 400; margin-left: 6px; }
nav .find { margin: 6px 12px; width: calc(100% - 24px); padding: 5px 8px; }
nav .who { padding: 14px 16px 0; margin-top: 16px; border-top: 1px solid var(--line-soft); color: var(--soft); font-size: 13px; overflow-wrap: anywhere; }
main { padding: 22px 26px 60px; min-width: 0; }
.head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.head .soft { font-size: 13px; }

/* stare */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; max-width: 1000px; }
.facts div { background: var(--panel); padding: 12px 14px; }
.facts dt { color: var(--soft); font-size: 13px; }
.facts dd { margin: 2px 0 0; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.facts dd.small { font-size: 14px; font-weight: 500; }
.facts dd.bad { color: var(--bad); }

/* tabele */
.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.bar select, .bar input { width: auto; }
.bar .grow { flex: 1; }
.bar.top { margin-top: 10px; }
.bar label { margin: 0; font-weight: 500; }
.bar input[type=number] { width: 90px; }
.grid { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: auto; max-height: calc(100vh - 210px); }
table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: 12.5px; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; max-width: 340px; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
th { position: sticky; top: 0; background: #f7f8fa; font-family: var(--sans); font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); z-index: 1; }
th button { all: unset; cursor: pointer; }
th button:focus-visible { outline: 2px solid var(--ink); }
th small { display: block; font-weight: 400; color: var(--soft); font-family: var(--mono); font-size: 11px; }
tr:hover td { background: #fafbfc; }
td.null { color: #9aa3ae; font-style: italic; }
td.num { text-align: right; }
td.edit { cursor: pointer; box-shadow: inset 0 -2px 0 #ffe7a6; }
td.edit:hover { background: #fff8e3; }
td.wrap { white-space: pre-wrap; max-width: 640px; overflow-wrap: anywhere; }
.empty { padding: 28px; color: var(--soft); font-family: var(--sans); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-family: var(--sans); font-size: 12px; font-weight: 600; }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.good { background: var(--good-bg); color: var(--good); }

/* fereastra de modificare */
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 22px; width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(21, 26, 33, .45); }
dialog h2 { margin: 0 0 4px; font-size: 16px; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
dialog label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin-top: 10px; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  nav { position: static; height: auto; max-height: 46vh; border-right: 0; border-bottom: 1px solid var(--line); }
  main { padding: 16px; }
}
@media (prefers-reduced-motion: no-preference) { nav a, .btn { transition: background-color .12s, border-color .12s; } }
