/* Win Desk – felles finpuss på tvers av modulene.
   Lastes etter modulens egen CSS og bruker `html`-prefiks for å vinne over like selektorer der modulene har sklidd fra
   hverandre. Fargene kommer fra modulens variabler (og skin.js), så BCM og Tieto ser riktig ut begge steder. */

html { -webkit-text-size-adjust: 100%; scrollbar-color: color-mix(in srgb, var(--muted, #777) 45%, transparent) transparent; }
html body { text-rendering: optimizeLegibility; }
html ::selection { background: color-mix(in srgb, var(--accent, var(--primary, #8a6d1f)) 22%, transparent); }
html *::-webkit-scrollbar { width: 10px; height: 10px; }
html *::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted, #777) 40%, transparent); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
html *::-webkit-scrollbar-track { background: transparent; }

/* Tastaturfokus: synlig og likt overalt */
html :focus-visible { outline: 2px solid var(--accent, var(--primary, #8a6d1f)); outline-offset: 2px; border-radius: 6px; }
html .btn:focus-visible, html .input:focus-visible, html select:focus-visible, html textarea:focus-visible { outline-offset: 1px; }

/* Knapper: samme høyde, radius og tilstander */
html .btn { min-height: 34px; border-radius: 8px; font-weight: 600; line-height: 1.2; transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s, transform .06s; }
html .btn.sm { min-height: 28px; }
html .btn:not(:disabled):active { transform: translateY(1px); }
html .btn:disabled { opacity: .55; cursor: not-allowed; }
html .btn .spinner { vertical-align: -2px; }

/* Innfelt */
html .input, html select.input, html textarea.input { border-radius: 8px; }
html .input::placeholder, html textarea::placeholder { color: color-mix(in srgb, var(--muted, #777) 80%, transparent); }

/* Sidemeny og sidefot */
html .nav a, html .rail nav a { border-radius: 8px; padding: 9px 10px; font-weight: 500; transition: background-color .12s, color .12s; }
html .nav a .count, html .rail nav a .count, html .nav a .n, html .rail nav a .n { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
html .side-foot a, html #sidefoot a, html .me a, html .side-foot button.linkish, html #sidefoot button.linkish, html .me button.linkish { text-decoration: none; color: var(--muted); font-weight: 500; }
html .side-foot a:hover, html #sidefoot a:hover, html .me a:hover, html .side-foot button.linkish:hover, html #sidefoot button.linkish:hover, html .me button.linkish:hover { color: var(--ink); text-decoration: underline; }

html .side-foot .btn.sm, html .me .btn.sm, html .me-links .btn.sm { min-height: 26px; padding: 3px 7px; font-weight: 500; font-size: 12.5px; }

/* Toppkort (hero): samme luft og kantradius */
html .hero { border-radius: 16px; padding: 22px 26px; }
html .hero h1 { font-size: 26px; line-height: 1.15; margin: 0; }
html .hero p { max-width: 68ch; }
@media (max-width: 720px) { html .hero { padding: 18px; border-radius: 14px; } html .hero h1 { font-size: 22px; } }

/* Nøkkeltall: én sammenhengende linje med like ruter */
html .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
html .stat { background: var(--surface); border: 0; border-radius: 0; padding: 14px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
html .stat b, html .stat .v { font-family: inherit; font-size: 26px; line-height: 1.1; font-weight: 600; font-variant-numeric: tabular-nums; }
html .stat span, html .stat .l { font-size: 12.5px; color: var(--muted); }
html .stat.alert b, html .stat.warn b, html .stat.alert .v, html .stat.warn .v { color: var(--bad, var(--red, #b3261e)); }
html .tile { border-radius: 10px; }
html .tile .v { font-size: 26px; line-height: 1.1; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Segmentvelger: valgt = myk aksentfarge */
html .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
html .seg button { border: 0; background: var(--surface); padding: 6px 11px; cursor: pointer; font-weight: 500; color: var(--muted); min-height: 32px; }
html .seg button + button { border-left: 1px solid var(--line); }
html .seg button:hover { color: var(--ink); }
html .seg button.on { background: var(--accent-soft, var(--primary-soft, #f1ebdb)); color: var(--accent, var(--primary, #8a6d1f)); }
html .hero .seg button.on { background: var(--accent, var(--primary, #8a6d1f)); color: var(--accent-ink, var(--primary-ink, #fff)); }

/* Paneler og tabeller */
html .panel { border-radius: 12px; }
html .panel-h h2, html .panel-h h3 { margin: 0; line-height: 1.25; }
html .panel-h h3 { font-size: 15px; }
html table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
html table td, html table th { vertical-align: top; }
html .pill { font-variant-numeric: tabular-nums; }

/* Tomme tilstander og hint: samme tone */
html .empty, html .hint.empty { color: var(--muted); font-size: 13px; line-height: 1.45; }

/* Modaler: luft og maksbredde */
html .modal { border-radius: 14px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
/* Dialoger med topp/innhold/bunn (Cold Calling): bare innholdet ruller, så toppen og knappene står fast og den hvite bakgrunnen følger hele innholdet */
html .modal:has(> .modal-b) { display: flex; flex-direction: column; overflow: hidden; }
html .modal > .modal-h, html .modal > .modal-f { flex: 0 0 auto; }
html .modal > .modal-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
html .backdrop > .modal { max-height: calc(100vh - 12vh); max-height: calc(100dvh - 12vh); }

/* Mindre bevegelse for dem som ber om det */
@media (prefers-reduced-motion: reduce) { html *, html *::before, html *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* Utskrift: skjul navigasjon og knapper */
@media print { html .side, html .rail, html .mhead, html .top, html .btn, html .toast { display: none !important; } html .main, html main { margin: 0 !important; padding: 0 !important; } }
