/* The shapes of the look (tokens.css says its colours): shadcn's geometry on
   the classes this application already had, the grouped menu, and where
   Basecoat's components (vendor/basecoat/) are wanted different here.

   Loaded after every other stylesheet but print.css, because it began as a
   layer over them while three looks were being compared; a rule here is the
   current word on its selector, and the older rule it overrides is to be
   deleted when its component is next worked on. */
/* ---- the gallery's rows (/izgled, /internal/styleguide) ---- */
.sg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; }
.sg-skel { display: grid; gap: 8px; width: 260px; }
.sg-skel-a { height: 16px; width: 70%; }
.sg-skel-b { height: 12px; }
.sg-skel-c { height: 12px; width: 85%; }
.sg-progress { display: grid; gap: 6px; width: 240px; font: var(--text-body-small); color: var(--ink-muted); }

/* ---- the page ---- */
::selection { background: color-mix(in srgb, var(--brand) 20%, transparent); }
body { font: var(--text-body); }
h1, h2 { letter-spacing: -0.015em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.main { padding: 28px 36px 48px; }
.page-head { margin-bottom: 20px; }
.page-sub { color: var(--ink-muted); }

/* ---- the menu ---- */
.sidebar { background: var(--side-bg); border-right-color: var(--side-border); padding: 14px 10px 10px; }
.sidebar .brand { flex-direction: row; align-items: center; gap: 9px; padding: 4px 8px 14px; font: 600 15px/20px var(--font-sans); color: var(--side-ink-strong); }
.sidebar .brand-logo { width: 26px; height: 28px; background: var(--side-chip); border-radius: 6px; }
.sidebar .brand-logo { padding: 2px; }
.sidebar .brand-name span, .topbar .brand-name span { color: inherit; }
.nav2 { display: flex; flex-direction: column; }
.nav2-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.nav2-label { font: 500 12px/16px var(--font-sans); color: var(--side-label); padding: 16px 10px 6px; }
.nav2-item { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 5px 10px; border-radius: var(--radius-md); font: 500 13.5px/20px var(--font-sans); color: var(--side-ink); transition: background-color var(--dur-hover), color var(--dur-hover); }
.nav2-item:hover { text-decoration: none; background: var(--side-hover); color: var(--side-ink-strong); }
.nav2-item[aria-current] { background: var(--side-active-bg); color: var(--side-active-ink); font-weight: 600; }
.nav2-item:active { background: var(--side-active-bg); }
.nav2-off { color: var(--side-label); }
/* A locked item is told apart by more than its tone: a small padlock, drawn
   from a file so that it takes the item's own colour. */
.nav2-off::after { content: ""; flex: none; width: 12px; height: 12px; margin-left: auto; background: currentColor; -webkit-mask: url(/static/img/lock.svg) center / contain no-repeat; mask: url(/static/img/lock.svg) center / contain no-repeat; }
.nav2-count { margin-left: auto; font: 600 11px/16px var(--font-sans); padding: 0 7px; border-radius: 999px; background: var(--side-active-bg); color: var(--side-active-ink); }
.nav2-addons { margin-top: 10px; }
.nav2-addons summary { display: flex; align-items: center; gap: 8px; font: 500 12px/16px var(--font-sans); color: var(--side-label); padding: 8px 10px; border-radius: var(--radius-md); cursor: pointer; }
.nav2-addons summary:hover { background: var(--side-hover); color: var(--side-ink-strong); }
.nav2-bottom { margin-top: auto; padding-top: 10px; }
.sidebar .userblock { border-top: 1px solid color-mix(in srgb, var(--side-ink) 22%, transparent); margin-top: 8px; padding: 12px 8px 4px; }
.sidebar .userblock-name { color: var(--side-ink-strong); }
.sidebar .userblock-links, .sidebar .userblock-links a { color: var(--side-ink); }
.sidebar .avatar { border-radius: 999px; background: var(--side-active-bg); color: var(--side-active-ink); }
.topbar { background: var(--side-bg); border-bottom-color: var(--side-border); }
.topbar .brand, .topbar .menu > summary { color: var(--side-ink-strong); }
.topbar .brand-logo { background: var(--side-chip); border-radius: 6px; padding: 2px; }
.menu > summary { border-color: var(--outline-border); font-weight: 500; min-height: 36px; padding: 7px 14px; }
.topbar .menu > summary { border-color: color-mix(in srgb, var(--side-ink) 45%, transparent); }
.topbar .menu[open] > summary { background: var(--side-active-bg); }
.topbar .avatar { background: var(--side-active-bg); color: var(--side-active-ink); }
.menu-panel { padding: 8px 12px 76px; }
.menu-panel .nav2-label { color: var(--ink-faint); }
.menu-panel .nav2-search { background: var(--surface-100); border-color: var(--border); color: var(--ink-muted); min-height: 40px; }
.menu-panel .nav2-item { color: var(--ink-muted); min-height: 40px; }
.menu-panel .nav2-item:hover { background: var(--surface-sunk); color: var(--ink); }
.menu-panel .nav2-item[aria-current] { background: var(--brand-soft); color: var(--brand); }
.menu-panel .nav2-count { background: var(--brand-soft); color: var(--brand); }

/* ---- the palette's button in the menu ---- */
.nav2-search { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; margin: 0 0 6px; padding: 6px 8px 6px 10px; border: 1px solid var(--side-field-border); border-radius: var(--radius-md); background: var(--side-field); color: var(--side-label); font: 400 13px/18px var(--font-sans); text-align: left; transition: border-color var(--dur-hover), color var(--dur-hover); }
.nav2-search:hover { color: var(--side-ink-strong); border-color: var(--side-label); }
.nav2-search svg { flex: none; }
.nav2-search .kbd { margin-left: auto; background: transparent; color: inherit; border: 1px solid var(--side-field-border); }

/* ---- Basecoat's components in this application ----
   Their own rules come from vendor/basecoat/basecoat.css, already on our
   tokens. What follows is only where this application wants them different. */
.command-dialog > .command { max-width: min(560px, calc(100% - 2rem)); top: 16%; box-shadow: var(--shadow-md); }
.command > header { height: 40px; }
.command > header:focus-within { border-color: var(--brand); }
.command > header input:focus-visible, .command [role="menuitem"]:focus-visible, .dropdown-menu [role="menu"]:focus-visible, .dropdown-menu [role^="menuitem"]:focus-visible { outline: 0; }
/* A plain dim behind a dialog; the blur Basecoat puts there costs a repaint
   of the whole page and says nothing the dim does not. */
.dialog::backdrop, .alert-dialog::backdrop, .command-dialog::backdrop { background: color-mix(in srgb, var(--ink) 34%, transparent); backdrop-filter: none; -webkit-backdrop-filter: none; }
.command [role="menu"] { max-height: min(56vh, 440px); }
.command [role="menuitem"], .dropdown-menu [role^="menuitem"] { cursor: pointer; }
.command [role="menu"]:not(:has([role="menuitem"]:not([aria-hidden="true"])))::before { content: attr(data-empty); display: block; color: var(--ink-muted); }
.dialog > *, .alert-dialog > * { box-shadow: var(--shadow-md); }
.alert-dialog > * > header > p { white-space: pre-line; }
.popover > [data-popover] { width: max-content; max-width: min(340px, calc(100vw - 32px)); }
progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 999px; background: var(--surface-sunk); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--surface-sunk); }
progress::-webkit-progress-value { background: var(--brand); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--brand); border-radius: 999px; }

/* ---- buttons ---- */
.btn { min-height: 36px; padding: 0 14px; border-radius: var(--radius-md); font: 500 14px/20px var(--font-sans); box-shadow: var(--shadow-xs); transition: background-color var(--dur-hover), border-color var(--dur-hover), color var(--dur-hover); }
.btn-secondary { border-color: var(--outline-border); }
.btn-secondary:hover { background: var(--surface-sunk); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; line-height: 18px; }
.btn-lg { min-height: 42px; padding: 0 22px; font-size: 15px; }
.btn-link { min-height: 24px; padding: 0; box-shadow: none; }
.btn[disabled], .btn[aria-disabled="true"] { box-shadow: none; opacity: 0.6; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---- fields ---- */
.input, .select, .textarea { min-height: 36px; padding: 7px 12px; border-radius: var(--radius-md); box-shadow: var(--shadow-xs); transition: border-color var(--dur-hover), box-shadow var(--dur-hover); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.field > label, .field > .label { font: 500 13px/18px var(--font-sans); color: var(--ink); }
/* Tick boxes and radio buttons of our own (the owner, 16.11.2026: no
   system controls). The input stays the input - the form, the label, the
   keyboard and the screen reader are untouched - it only draws itself. */
input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: none; appearance: none; flex: none; display: inline-grid; place-content: center;
  width: 18px; height: 18px; margin: 0; vertical-align: -4px; cursor: pointer;
  border: 1.5px solid var(--control-border); border-radius: 5px; background: var(--surface-200);
  transition: background-color var(--dur-hover), border-color var(--dur-hover);
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]::before {
  content: ""; width: 12px; height: 12px; background: var(--on-brand); transform: scale(0);
  -webkit-mask: url(/static/img/check.svg) center / contain no-repeat; mask: url(/static/img/check.svg) center / contain no-repeat;
}
input[type="radio"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); transform: scale(0); }
input[type="checkbox"]:checked { background: var(--brand); border-color: var(--brand); }
input[type="radio"]:checked { border-color: var(--brand); }
input[type="checkbox"]:checked::before, input[type="radio"]:checked::before { transform: scale(1); }
input[type="checkbox"]:hover:not(:disabled), input[type="radio"]:hover:not(:disabled) { border-color: var(--brand); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: var(--focus); outline-offset: 2px; }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { cursor: default; background: var(--surface-sunk); border-color: var(--disabled-ink-strong); }
input[type="checkbox"]:disabled:checked { background: var(--disabled-ink-strong); }
@media (prefers-reduced-motion: no-preference) {
  input[type="checkbox"]::before, input[type="radio"]::before { transition: transform 120ms ease-out; }
}
@media (forced-colors: active) {
  input[type="checkbox"], input[type="radio"] { -webkit-appearance: auto; appearance: auto; }
  input[type="checkbox"]::before, input[type="radio"]::before { content: none; }
}

/* ---- surfaces ---- */
.card, .kpi { border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card { padding: 20px 24px; }
.card-tight { padding: 18px 20px; }
.card-title { font: 600 14px/20px var(--font-sans); margin-bottom: 10px; }
.alert { border: 1px solid transparent; border-radius: var(--radius-lg); padding: 11px 16px; }
.alert-ok { border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.alert-err { border-color: color-mix(in srgb, var(--danger) 26%, transparent); }
.alert-warn { border-color: color-mix(in srgb, var(--warning) 26%, transparent); }
.badge { border-radius: 6px; font: 500 12px/16px var(--font-sans); padding: 2px 8px; }
.toast { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }

/* ---- lists ----
   The cell rules sit at the weight of the rules they replace (:where adds
   none), so the phone cards, the compact panels and the print sheet, which
   already override those, keep doing so. */
.table-wrap { border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
table.data { font-variant-numeric: tabular-nums; }
table.data th { text-transform: none; letter-spacing: 0; font: 500 13px/18px var(--font-sans); padding: 11px 16px; background: color-mix(in srgb, var(--surface-100) 70%, transparent); }
table.data td { padding: 13px 16px; }
.pills { gap: 2px; padding: 3px; background: var(--surface-sunk); border-radius: 10px; display: inline-flex; }
.pill { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; color: var(--ink-muted); }
.pill:hover { background: color-mix(in srgb, var(--surface-200) 60%, transparent); color: var(--ink); }
.pill[aria-current] { background: var(--surface-200); color: var(--ink); box-shadow: var(--shadow-xs); }
.tabs { gap: 20px; }
.tabs a { font-weight: 500; }
.pager { margin: 14px 0; }
.empty { border-radius: var(--radius-lg); }
.cl-item { padding: 16px 12px; }
.cl-tag { border-radius: 6px; font: 400 12px/16px var(--font-sans); }
.cl-quote blockquote { border-left: 1px solid var(--border-firm); border-radius: 0; }

@media screen and (max-width: 719px) {
  table.data.cards tr { border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
}
@media (max-width: 859px) {
  .main { padding: 16px; }
}
