/* H&P QA client portal – app shell (sidebar) + split-screen sign-in.
   Brand: navy + orange (same as hpqa.cz). --accent comes from /tenant.css (client colour). */
:root {
  --accent: #f07c1e;
  --navy: #0a1b2e;
  --navy-2: #12283f;
  --orange: #f07c1e;
  --orange-ink: #b4520a;
  --paper: #ffffff;
  --canvas: #f4f6f9;
  --ink: #0a1b2e;
  --muted: #5a687c;
  --rule: #e1e6ed;
  --rule-2: #cfd7e1;
  --ok: #17775c;   --ok-bg: #e6f5ef;
  --warn: #8a5300; --warn-bg: #fff2dd;
  --bad: #b3261e;  --bad-bg: #fdecea;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Helvetica Neue", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --side: 15.5rem;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 .975rem/1.55 var(--sans); }
a { color: var(--orange-ink); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 50; background: #fff; padding: .5rem .8rem; }
h1, h2 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; text-wrap: balance; color: var(--navy); }
h1 { font-size: clamp(1.7rem, 2.6vw, 2.15rem); line-height: 1.12; }
h2 { font-size: 1.05rem; line-height: 1.3; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono, code { font-family: var(--mono); font-size: .88em; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font: 700 .72rem/1 var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--orange-ink); }
.eyebrow::before { content: ""; width: .5rem; height: .5rem; background: var(--orange); }
.eyebrow a { color: inherit; }

.brand { display: inline-flex; align-items: flex-end; gap: .15rem; text-decoration: none; font: 800 1.3rem/1 var(--display); letter-spacing: -0.03em; color: #fff; }
.brand i { width: .38rem; height: .38rem; background: var(--orange); margin-bottom: .16rem; }

/* ---------- App shell ---------- */
.has-shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100%; }
.side { background: var(--navy); color: #c9d4e0; display: flex; flex-direction: column; gap: 1.5rem; padding: 1.5rem 1rem 1.25rem; position: sticky; top: 0; height: 100vh; }
.side .brand { padding-inline: .6rem; }
.zone-chip { display: flex; align-items: center; gap: .6rem; margin-inline: .2rem; padding: .7rem .8rem; background: var(--navy-2); border: 1px solid rgba(255,255,255,.08); color: #fff; font-weight: 600; font-size: .9rem; line-height: 1.25; }
.zone-chip .dot { flex: none; width: .7rem; height: .7rem; background: var(--accent); box-shadow: 0 0 0 2px rgba(255,255,255,.15); }
.side-nav { display: grid; gap: .15rem; }
.side-nav a, .side-out { display: flex; align-items: center; gap: .75rem; padding: .65rem .8rem; color: #c9d4e0; text-decoration: none; font: 500 .95rem/1.2 var(--sans); border-left: 3px solid transparent; background: none; border-top: 0; border-right: 0; border-bottom: 0; width: 100%; cursor: pointer; text-align: left; }
.side-nav a:hover, .side-out:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-nav a[aria-current] { background: rgba(240,124,30,.12); color: #fff; border-left-color: var(--orange); }
.side-nav a[aria-current] .ico { color: var(--orange); }
.ico { flex: none; }
.side-foot { margin-top: auto; display: grid; gap: .6rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.1); }
.who { padding-inline: .8rem; color: #fff; font-weight: 600; font-size: .9rem; display: grid; }
.who small { color: #8fa1b6; font-weight: 400; font-size: .78rem; overflow-wrap: anywhere; }
.side-out { font-size: .9rem; }

.content { display: flex; flex-direction: column; min-width: 0; }
.has-shell .main { flex: 1; width: 100%; max-width: 76rem; padding: 2.25rem clamp(1rem, 3vw, 2.5rem) 3rem; display: grid; gap: 1.5rem; align-content: start; }
.has-shell .main > * { min-width: 0; }
.has-shell .foot { max-width: 76rem; padding: 1.25rem clamp(1rem, 3vw, 2.5rem) 1.75rem; }

@media (max-width: 900px) {
  .has-shell { grid-template-columns: minmax(0, 1fr); }
  .side, .side-nav { min-width: 0; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; padding: .7rem 1rem; }
  .zone-chip { margin: 0; padding: .35rem .6rem; font-size: .8rem; background: transparent; }
  .side-nav { order: 3; width: 100%; display: flex; overflow-x: auto; gap: .25rem; }
  .side-nav a { border-left: 0; border-bottom: 2px solid transparent; padding: .5rem .6rem; white-space: nowrap; font-size: .88rem; }
  .side-nav a[aria-current] { border-bottom-color: var(--orange); background: none; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .who { display: none; }
  .side-out { padding: .4rem .5rem; }
  .side-out span { display: none; }
}

/* ---------- Page header + panels ---------- */
.hello { display: grid; gap: .55rem; padding-bottom: .25rem; }
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: clamp(1.15rem, 2.5vw, 1.6rem); display: grid; gap: 1rem; align-content: start; min-width: 0; box-shadow: 0 1px 2px rgba(10,27,46,.04); }
.panel > * { min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.panel-head a { font-weight: 600; text-decoration: none; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.grid-2.wide-first { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-2 > * { min-width: 0; }
@media (max-width: 1100px) { .grid-2, .grid-2.wide-first { grid-template-columns: 1fr; } }
.narrow { max-width: 26rem; width: 100%; }
.narrow-l { max-width: 36rem; }

/* KPI tiles */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; }
.tile { position: relative; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 1.1rem 1.15rem 1rem; text-decoration: none; color: var(--ink); display: grid; gap: .25rem; overflow: hidden; transition: border-color .15s, transform .15s; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--rule-2); }
.tile:hover { border-color: var(--rule-2); transform: translateY(-1px); }
.tile:hover::before { background: var(--orange); }
.tile b { font: 700 1.9rem/1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--navy); }
.tile span { font-size: .85rem; color: var(--muted); }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Tables */
.table-scroll { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .75rem .75rem .75rem 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; padding-top: 0; }
tbody th { font-weight: 600; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover > * { background: #fafbfc; }
tr.off { opacity: .5; }
.docs { min-width: 30rem; }
.ext { display: inline-grid; place-items: center; width: 2.4rem; height: 1.6rem; margin-right: .7rem; font: 700 .62rem/1 var(--mono); letter-spacing: .04em; background: #fff4ea; color: var(--orange-ink); border: 1px solid #f6d8bd; border-radius: 3px; vertical-align: middle; }
.dl { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; text-decoration: none; white-space: nowrap; padding: .35rem .6rem; border: 1px solid var(--rule-2); border-radius: 4px; color: var(--navy); }
.dl:hover { border-color: var(--navy); background: var(--navy); color: #fff; }
.actions { white-space: normal; }
.actions form { display: block; }
.actions form + form { margin-top: .25rem; }

.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: .22rem .55rem; border-radius: 999px; background: var(--canvas); color: var(--muted); white-space: nowrap; }
.tag-timesheet { background: #e8eef8; color: #1d4a8a; }
.tag-invoice { background: var(--warn-bg); color: var(--warn); }
.tag-contract { background: #eee9f9; color: #55379b; }
.tag-deliverable { background: var(--ok-bg); color: var(--ok); }
.tag-on { background: var(--ok-bg); color: var(--ok); }
.tag-off { background: var(--canvas); color: var(--muted); }
.tag-warn { background: var(--bad-bg); color: var(--bad); }

.filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.filters a { text-decoration: none; color: var(--ink); background: var(--paper); border: 1px solid var(--rule-2); padding: .4rem .85rem; font-size: .88rem; font-weight: 600; border-radius: 999px; }
.filters a:hover { border-color: var(--navy); }
.filters a[aria-current] { background: var(--navy); color: #fff; border-color: var(--navy); }

.contact { background: var(--navy); color: #c9d4e0; border: 0; position: relative; overflow: hidden; }
.contact::after { content: ""; position: absolute; right: 1.25rem; top: 1.25rem; width: .6rem; height: .6rem; background: var(--orange); }
.contact h2 { color: #fff; }
.contact .big { font: 700 1.2rem/1.3 var(--display); color: #fff; }
.contact a { color: #fff; }

.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.person { grid-template-columns: 3.25rem 1fr; gap: 1rem; }
.initials { width: 3.25rem; height: 3.25rem; display: grid; place-items: center; background: var(--navy); color: var(--orange); font: 700 1rem/1 var(--display); border-radius: 50%; }

/* Forms */
.form { display: grid; gap: .4rem; }
.form label { font-size: .82rem; font-weight: 600; margin-top: .5rem; color: var(--navy); }
.form label.check { display: flex; gap: .55rem; align-items: center; font-weight: 500; font-size: .93rem; }
input, select { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule-2); padding: .7rem .8rem; width: 100%; min-width: 0; border-radius: 4px; }
input:focus, select:focus { border-color: var(--navy); outline: 2px solid rgba(240,124,30,.35); outline-offset: 0; }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--orange); }
input[type=color] { padding: .2rem; height: 2.7rem; }
input[type=file] { padding: .5rem; }
input[aria-invalid] { border-color: var(--bad); }
.otp { font: 600 1.4rem/1 var(--mono); letter-spacing: .3em; max-width: 12rem; }
.suffix { display: flex; }
.suffix input { border-radius: 4px 0 0 4px; }
.suffix span { display: flex; align-items: center; padding-inline: .8rem; background: var(--canvas); border: 1px solid var(--rule-2); border-left: 0; border-radius: 0 4px 4px 0; color: var(--muted); font-family: var(--mono); font-size: .88rem; white-space: nowrap; }
.form.row { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); align-items: end; gap: .75rem; }
.form.row label { margin-top: 0; display: block; margin-bottom: .35rem; }
.form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; }
.form .row label { display: block; margin-bottom: .35rem; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: .5rem; font: 700 .95rem/1 var(--sans); background: var(--orange); color: var(--navy); border: 0; border-radius: 4px; padding: .85rem 1.25rem; cursor: pointer; text-decoration: none; margin-top: .7rem; justify-self: start; }
.btn:hover { background: var(--navy); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.form.row .btn { margin-top: 0; height: 2.85rem; }
.linkish { font: inherit; background: none; border: 0; padding: 0; color: var(--orange-ink); cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.danger { color: var(--bad); }
.inline { display: inline; }

.alert { background: var(--bad-bg); color: var(--bad); padding: .75rem 1rem; border-left: 4px solid var(--bad); border-radius: 4px; }
.ok { background: var(--ok-bg); color: var(--ok); padding: .75rem 1rem; border-left: 4px solid var(--ok); border-radius: 4px; }
.linkbox { border-left: 4px solid var(--orange); }
.key { display: block; word-break: break-all; background: var(--canvas); padding: .6rem .75rem; border: 1px solid var(--rule); border-radius: 4px; font-size: .86rem; }
.qr-row { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.qr { border: 1px solid var(--rule); background: #fff; padding: .5rem; border-radius: 4px; }

.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem; font-size: .8rem; color: var(--muted); }

/* ---------- Split-screen sign-in ---------- */
.no-shell { background: var(--paper); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.split-brand { background: var(--navy); color: #c9d4e0; padding: clamp(1.75rem, 4vw, 3.5rem); display: flex; flex-direction: column; gap: 2rem; position: relative; overflow: hidden; }
.split-brand::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--orange) 0 30%, var(--accent) 30% 100%); }
.split-copy { display: grid; gap: .9rem; max-width: 26rem; margin-top: auto; }
.kicker { font: 700 .75rem/1 var(--sans); text-transform: uppercase; letter-spacing: .16em; color: var(--orange); }
.claim { font: 700 clamp(1.6rem, 2.6vw, 2.3rem)/1.15 var(--display); letter-spacing: -0.02em; color: #fff; text-wrap: balance; }
.split-art { width: min(100%, 22rem); opacity: .9; }
.split-facts { list-style: none; margin: 0 0 auto; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .85rem; }
.split-facts li::before { content: ""; display: inline-block; width: .45rem; height: .45rem; background: var(--orange); margin-right: .5rem; vertical-align: 1px; }
.split-form { display: flex; flex-direction: column; padding: clamp(1.25rem, 4vw, 3rem); }
.split-form .main { flex: 1; display: grid; align-content: center; justify-items: start; }
.split-form .panel { border: 0; box-shadow: none; padding: 0; max-width: 26rem; width: 100%; }
.split-form .foot { padding-top: 1.5rem; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; min-height: 0; }
  .split-brand { gap: 1rem; padding: 1.25rem 1rem 1.5rem; }
  .split-art, .split-facts { display: none; }
  .split-copy { margin-top: .5rem; }
  .claim { font-size: 1.35rem; }
  .split-form { padding: 1.75rem 1rem; }
}

.docs tbody th { min-width: 13rem; }
.side { align-self: start; }
.grid-2 .c-size { display: none; }
.actions { min-width: 7.5rem; }
.actions button { white-space: nowrap; }
@media (max-width: 1400px) { .grid-2.wide-first { grid-template-columns: 1fr; } }
