/* ==========================================================================
   Namoja UI — design tokens + components
   Single source of truth for colors, type, spacing and components.
   Load AFTER trongate.css (or instead of it) on every app page.
   Dark theme is the default. Light theme: <html data-theme="light">.
   ========================================================================== */

/* ---------- Fonts (Latin Extended: ąčęėįšųūž) ---------- */
/* Self-hosted fonts (public/fonts, OFL); CSP allows font-src 'self' only. */
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("../fonts/inter-tight-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("../fonts/inter-tight-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- 1. Tokens ---------- */
:root {
  /* Base surfaces (dark, green-tinted black) */
  --bg:            #050B09;
  --bg-elevated:   #0A1411;
  --surface:       #0F1A17;
  --surface-2:     #15231F;
  --surface-3:     #1B2C27;
  --line:          #1F2F2A;
  --line-strong:   #2C4740;

  /* Text */
  --text:          #F2F7F5;
  --text-muted:    #A3B5AF;
  --text-subtle:   #7E918B;
  --text-on-mint:  #04130F;

  /* Brand */
  --mint:          #6EE7C8;   /* highlights, active tab, focus, links */
  --mint-strong:   #3FCFA8;   /* hover on mint */
  --mint-soft:     rgba(110, 231, 200, 0.12);
  --deep:          #0F3B31;   /* primary button fill */
  --deep-2:        #0A2620;   /* primary button gradient end */
  --deep-border:   #2F8A70;   /* primary button border */
  --hero-top:      #2F7F6A;   /* gradient start (login, CTA banners only) */
  --primary:       #076B62;   /* deep teal from the glow backdrop; white text ≥ 4.5:1 */
  --primary-2:     #044B46;
  --primary-border:#27A798;
  --button-surface:      #092C29;
  --button-surface-hover:#103E38;
  --button-border:       #287C72;
  --button-accent:       #58DFD0;
  --button-accent-hover: #32C9BA;

  /* Status — compliance and data states (always with icon + label) */
  --ok:            #4FD1A5;
  --ok-soft:       rgba(79, 209, 165, 0.14);
  --warn:          #F5B547;
  --warn-urgent:   #FFA366;
  --warn-soft:     rgba(245, 181, 71, 0.14);
  --danger:        #F2727A;
  --danger-soft:   rgba(242, 114, 122, 0.14);
  --info:          #7AB8F5;
  --info-soft:     rgba(122, 184, 245, 0.14);
  --neutral-soft:  rgba(163, 181, 175, 0.12);

  /* Type */
  --font-head: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-display: 2.5rem;   /* 40 — login / empty hero only */
  --fs-h1:      1.75rem;  /* 28 — page title */
  --fs-h2:      1.375rem; /* 22 — section title */
  --fs-h3:      1.125rem; /* 18 — card title */
  --fs-body:    1rem;     /* 16 */
  --fs-sm:      0.875rem; /* 14 — table cells, meta */
  --fs-xs:      0.8125rem;/* 13 — eyebrow, captions (min) */
  --lh-tight: 1.15;
  --lh-body: 1.55;

  /* Spacing (4px base) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  /* Shape */
  --r-xs: 6px;    /* pills, tags, checkboxes */
  --r-sm: 10px;   /* buttons, inputs */
  --r-md: 14px;   /* cards, table wrapper, modals */
  --r-lg: 20px;   /* hero panels, login card */

  /* Elevation */
  --shadow-pop: 0 20px 50px -18px rgba(0, 0, 0, 0.75);
  --glow-mint:  0 0 0 1px rgba(110, 231, 200, 0.25), 0 8px 24px -8px rgba(63, 207, 168, 0.35);
  --focus-ring: 0 0 0 3px rgba(110, 231, 200, 0.35);

  /* Layout */
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --content-max: 1280px;

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 160ms;

  color-scheme: dark;
}

/* Light theme — for long reading and owner portal if preferred */
@media (min-width: 961px) { body { background-attachment: fixed; } }
:root[data-theme="light"] body { background-image: none; }
:root[data-theme="light"] {
  --bg:           #F5F8F7;
  --bg-elevated:  #FFFFFF;
  --surface:      #FFFFFF;
  --surface-2:    #EEF3F1;
  --surface-3:    #E3EBE8;
  --line:         #DCE5E2;
  --line-strong:  #BCCBC6;
  --text:         #07130F;
  --text-muted:   #44564F;
  --text-subtle:  #5C6E68;
  --mint:         #0E8F6E;   /* darker for contrast on white */
  --mint-strong:  #0B7559;
  --mint-soft:    rgba(14, 143, 110, 0.10);
  --deep:         #0F3B31;
  --deep-2:       #0F3B31;
  --deep-border:  #0F3B31;
  --primary-border: #076B62;
  --button-surface:       #E5F4F0;
  --button-surface-hover: #D2EBE4;
  --button-border:        #397D72;
  --ok:           #0E8F6E;
  --warn:         #A86500;
  --warn-urgent:  #A34500;
  --danger:       #C23B45;
  --info:         #2563B8;
  --shadow-pop: 0 18px 40px -18px rgba(7, 19, 15, 0.25);
  color-scheme: light;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  /* Brand glow backdrop (public/images/namoja-glow.jpg); cards keep solid surfaces for contrast. */
  background: var(--bg) url("../images/namoja-glow.jpg") center top / cover no-repeat;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: var(--lh-tight); letter-spacing: -0.02em; margin: 0; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--mint); text-underline-offset: 3px; }
a:hover { color: var(--mint-strong); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.num, td.num, .money { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Eyebrow — small section marker (Fexiva "■ LABEL"). Use only on section groups, not every heading. */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.eyebrow::before { content: ""; width: 6px; height: 6px; background: var(--mint); border-radius: 1px; }

/* ---------- 3. App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg-elevated); border-right: 1px solid var(--line); padding: var(--s-5) var(--s-3); display: flex; flex-direction: column; gap: var(--s-6); }
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 0 var(--s-2); font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; }
.sidebar__logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(160deg, var(--deep), var(--deep-2)); border: 1px solid var(--deep-border); color: var(--mint); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__label { padding: var(--s-4) var(--s-3) var(--s-2); font-size: var(--fs-xs); color: var(--text-subtle); font-weight: 600; }
.nav__item { display: flex; align-items: center; gap: var(--s-3); min-height: 40px; padding: 0 var(--s-3); border-radius: var(--r-sm); color: var(--text-muted); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.nav__item svg { width: 18px; height: 18px; flex: none; }
.nav__item:hover { background: var(--surface-2); color: var(--text); }
.nav__item[aria-current="page"] { background: var(--mint-soft); color: var(--text); box-shadow: inset 2px 0 0 var(--mint); }
.nav__count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--danger-soft); color: var(--danger); }
/* Association shell (namoja_shell.php): sidebar, then a page header holding .page-head and the role menu. */
.app__body { min-width: 0; display: flex; flex-direction: column; }
.app .main { margin-inline: auto; }
.sidebar__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.sidebar .sidebar__close, .topbar .sidebar__open, .sidebar__backdrop, .topnav-drawer { display: none; }
.sidebar__burger, .sidebar__burger::before, .sidebar__burger::after { display: block; width: 18px; height: 2px; border-radius: 1px; background: currentColor; }
.sidebar__burger { position: relative; }
.sidebar__burger::before, .sidebar__burger::after { content: ""; position: absolute; left: 0; }
.sidebar__burger::before { top: -6px; }
.sidebar__burger::after { top: 6px; }
.topbar.topbar--page { position: sticky; top: 0; height: auto; min-height: var(--topbar-h); padding: var(--s-5) var(--s-8); align-items: center; background: color-mix(in srgb, var(--bg) 50%, transparent); }
.app .sidebar { background: color-mix(in srgb, var(--bg-elevated) 50%, transparent); backdrop-filter: blur(12px); }
.topbar.topbar--page .page-head { flex: 1; min-width: 0; margin: 0; align-items: center; }

.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: var(--s-4); padding: 0 var(--s-8); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
/* Floating glass header for module screens (logo · divider · navigation · aside). */
.topbar--float { top: var(--s-4); max-width: var(--content-max); margin: var(--s-4) auto 0; height: 72px; padding: 0 var(--s-4); border: 1px solid color-mix(in srgb, var(--mint) 14%, var(--line)); border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 72%, transparent); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .04); }
.topbar__logo { width: 40px; height: 40px; flex: none; border-radius: 11px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--mint) 30%, transparent), 0 6px 18px -6px rgba(63, 207, 168, .45); }
.topbar__divider { width: 1px; height: 32px; flex: none; background: var(--line-strong); }
.topbar__aside { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); }
/* Signed-in user's own role(s) in this association (server-rendered, display only). */
.topbar__role { display: inline-flex; align-items: center; gap: var(--s-3); padding: var(--s-1) var(--s-4) var(--s-1) var(--s-1); border: 1px solid var(--line-strong); border-radius: 999px; background: color-mix(in srgb, var(--surface-2) 80%, transparent); color: var(--text); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
.topbar__role-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--mint-soft); color: var(--mint); }
.topbar__role-icon svg { width: 16px; height: 16px; }
/* User menu on the role badge (native <details>, no script). */
.usermenu { position: relative; }
.usermenu__toggle { cursor: pointer; list-style: none; }
.usermenu__toggle::-webkit-details-marker { display: none; }
.usermenu__toggle:hover { border-color: color-mix(in srgb, var(--mint) 40%, var(--line-strong)); }
.usermenu__toggle:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.usermenu__chevron { display: inline-flex; color: var(--text-muted); transition: transform var(--dur) var(--ease); }
.usermenu__chevron svg { width: 14px; height: 14px; transform: rotate(90deg); }
.usermenu[open] .usermenu__chevron { transform: rotate(180deg); }
.usermenu__panel { position: absolute; right: 0; top: calc(100% + var(--s-2)); z-index: 30; min-width: 220px; padding: var(--s-2); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--bg-elevated); box-shadow: var(--shadow-pop); }
.usermenu__panel form { margin: 0; }
.usermenu__item { display: flex; width: 100%; align-items: center; gap: var(--s-3); min-height: 44px; padding: 0 var(--s-3); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); font: 500 var(--fs-sm) var(--font-body); text-decoration: none; text-align: left; cursor: pointer; }
.usermenu__item:hover, .usermenu__item:focus-visible { background: var(--surface-2); color: var(--text); }
.usermenu__item svg { width: 18px; height: 18px; flex: none; color: var(--text-muted); }
.topbar__spacer { flex: 1; }
.topbar__brand { display: inline-flex; align-items: center; gap: var(--s-3); font-family: var(--font-head); font-weight: 700; font-size: 1.375rem; letter-spacing: -0.02em; color: var(--text); text-decoration: none; margin-right: var(--s-6); }
.topbar--float .topbar__brand { margin-right: var(--s-2); }
.topbar__brand:hover { color: var(--text); }
/* Top navigation (module screens without sidebar) */
.topnav { display: flex; align-items: center; gap: var(--s-2); min-width: 0; overflow-x: auto; }
.topnav__item { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-4); border: 1px solid transparent; border-radius: var(--r-sm); color: var(--text-muted); font-size: var(--fs-body); font-weight: 500; text-decoration: none; white-space: nowrap; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.topnav__item:hover { color: var(--text); background: var(--surface-2); }
.topnav__item svg { width: 18px; height: 18px; flex: none; margin-right: var(--s-2); }
.topnav__item:not([aria-current="page"]) svg { color: var(--text-subtle); }
.topbar__actions { display: flex; align-items: center; gap: var(--s-2); }
@media (max-width: 640px) {
  .topbar__aside .btn { padding: 0 var(--s-3); }
  .topbar__aside .btn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.topnav__item[aria-current="page"] { color: var(--text); font-weight: 600; background: color-mix(in srgb, var(--mint) 12%, var(--surface-2)); border-color: color-mix(in srgb, var(--mint) 40%, transparent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.main { padding: var(--s-8); max-width: var(--content-max); width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-8); }
.page-head__sub { margin-top: 6px; color: var(--text-muted); font-size: 1.125rem; }
.page-head__meta { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--text-subtle); }

/* Shared date-only calendar; display yyyy.mm.dd, submit ISO yyyy-mm-dd. */
.date-picker { display: flex; align-items: stretch; min-width: 0; }
.date-picker > .input { min-width: 0; border-start-end-radius: 0; border-end-end-radius: 0; }
.date-picker__trigger { display: inline-flex; flex: 0 0 calc(var(--s-1) * 11); align-items: center; justify-content: center; min-height: calc(var(--s-1) * 11); border: 1px solid var(--line-strong); border-inline-start: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-2); color: var(--text); cursor: pointer; }
.date-picker__trigger svg { width: var(--s-5); height: var(--s-5); }
.date-picker__trigger:disabled { opacity: .5; cursor: default; }
.date-picker__dialog { box-sizing: border-box; width: min(calc(var(--s-12) * 8), calc(100vw - var(--s-8))); max-width: none; max-height: calc(100dvh - var(--s-8)); margin: auto; padding: var(--s-4); overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
.date-picker__dialog::backdrop { background: color-mix(in srgb, var(--bg) 45%, transparent); }
.date-picker__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-1); margin-bottom: var(--s-3); }
.date-picker__period { display: flex; align-items: center; justify-content: center; min-width: 0; gap: var(--s-1); }
.date-picker__month, .date-picker__year { min-width: 0; min-height: calc(var(--s-1) * 11); padding: var(--s-1); border: 1px solid transparent; border-radius: var(--r-xs); background: var(--surface); color: var(--text); font: 600 var(--fs-body) var(--font-body); }
.date-picker__month { flex: 1; max-width: calc(var(--s-12) * 3); }
.date-picker__year { width: calc(var(--s-4) * 5); }
.date-picker__nav, .date-picker__day { display: inline-flex; align-items: center; justify-content: center; min-height: calc(var(--s-1) * 11); padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); font: 500 var(--fs-body) var(--font-body); cursor: pointer; }
.date-picker__nav { flex: 0 0 calc(var(--s-1) * 11); font-size: var(--fs-h1); }
.date-picker__nav:hover, .date-picker__day:hover:not(:disabled) { background: var(--button-surface-hover); }
.date-picker__grid { width: 100%; border: 0; border-collapse: collapse; table-layout: fixed; }
.date-picker__grid th { padding: var(--s-2) 0; color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500; text-align: center; }
.date-picker__grid td { padding: 0; border: 0; text-align: center; }
.date-picker__day { position: relative; width: 100%; font-variant-numeric: tabular-nums; }
.date-picker__day--outside { color: var(--text-subtle); }
.date-picker__day--selected, .date-picker__day--selected:hover:not(:disabled) { background: var(--mint); color: var(--text-on-mint); font-weight: 700; }
.date-picker__day[aria-current="date"]::after { content: ''; position: absolute; bottom: var(--s-1); width: var(--s-1); height: var(--s-1); border-radius: 50%; background: currentColor; }
.date-picker__day:disabled, .date-picker__nav:disabled { opacity: .35; cursor: default; }
.date-picker__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-1); margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.date-picker__actions [hidden] { display: none; }
/* Skip link: visible only on keyboard focus */
.skip-link { position: absolute; left: var(--s-4); top: -100px; z-index: 60; padding: var(--s-2) var(--s-4); border-radius: var(--r-sm); background: var(--mint); color: var(--text-on-mint); font-weight: 600; }
.skip-link:focus { top: var(--s-2); color: var(--text-on-mint); }
/* Stack of page sections */
.stack { display: grid; gap: var(--s-6); }
.stack > * { min-width: 0; }

/* Association switcher (multi-association managers) */
.switcher { display: inline-flex; align-items: center; gap: var(--s-2); height: 40px; padding: 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: 500 var(--fs-sm) var(--font-body); cursor: pointer; }
.switcher:hover { border-color: var(--line-strong); }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); transform: translateX(-100%); transition: transform var(--dur) var(--ease); z-index: 50; }
  .sidebar[data-open="true"], .sidebar:target { transform: none; box-shadow: var(--shadow-pop); }
  .sidebar .sidebar__close, .topbar .sidebar__open { display: inline-flex; flex: none; }
  /* Owner top bar: the nav moves into an off-canvas drawer opened by ☰ (#meniu). */
  .topbar--drawer .topnav, .topbar--drawer .topbar__aside form { display: none; }
  .topbar--drawer .topbar__aside { margin-left: auto; }
  .topnav-drawer { display: flex; flex-direction: column; gap: var(--s-1); position: fixed; inset: 0 0 0 auto; width: min(86vw, 300px); padding: var(--s-4); overflow-y: auto; background: var(--bg-elevated); border-left: 1px solid var(--line); transform: translateX(100%); visibility: hidden; transition: transform var(--dur) var(--ease), visibility var(--dur); z-index: 50; }
  .topnav-drawer:target { transform: none; visibility: visible; box-shadow: var(--shadow-pop); }
  .topnav-drawer__logout { margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--line); }
  .topnav-drawer__logout .topnav__item { width: 100%; background: none; font: inherit; font-size: var(--fs-body); cursor: pointer; }
  .topnav-drawer__close { align-self: flex-end; margin-bottom: var(--s-2); }
  .topnav-drawer .topnav__item { min-height: 48px; font-size: var(--fs-body); }
  .topnav-drawer:target + .sidebar__backdrop,
  .sidebar:target + .sidebar__backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 70%, transparent); }
  .topbar.topbar--page { position: relative; padding: var(--s-3) var(--s-4); align-items: flex-start; }
  .topbar, .main { padding-inline: var(--s-4); }
  .topbar { height: auto; min-height: var(--topbar-h); flex-wrap: wrap; gap: var(--s-2); padding-block: var(--s-2); }
  .topbar__brand { margin-right: var(--s-2); }
  .topnav { width: 100%; order: 3; }
  .topbar--float { top: var(--s-2); margin: var(--s-2) var(--s-2) 0; height: auto; padding: var(--s-3); border-radius: var(--r-md); }
  .topbar--float .topbar__divider { display: none; }
  .topbar--float .topbar__aside { order: 2; }
  .topbar__role { padding-right: var(--s-3); font-size: var(--fs-xs); }
  .topnav__item { padding: 0 var(--s-3); font-size: var(--fs-sm); }
}

/* ---------- 4. Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-5); border-radius: var(--r-sm); border: 1px solid transparent; font: 600 var(--fs-sm)/1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.btn svg { width: 18px; height: 18px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
/* Primary — deep teal from the glow backdrop, with a turquoise edge */
.btn--primary { color: #FFFFFF; background: linear-gradient(180deg, var(--primary), var(--primary-2)); border-color: var(--primary-border); box-shadow: inset 0 1px 0 rgba(255,255,255,.14); }
.btn--primary:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 85%, var(--button-accent)), var(--primary)); box-shadow: var(--glow-mint); color: #FFFFFF; }
/* Accent — turquoise glow, max one per screen (key call to action) */
.btn--accent { color: var(--text-on-mint); background: var(--button-accent); }
.btn--accent:hover { background: var(--button-accent-hover); color: var(--text-on-mint); }
.btn--secondary { color: var(--text); background: var(--button-surface); border-color: var(--button-border); }
.btn--secondary:hover { background: var(--button-surface-hover); color: var(--text); }
.btn--ghost { color: var(--text-muted); background: transparent; }
/* Quiet — row actions ("Peržiūrėti →"): filled surface, no border */
.btn--quiet { color: var(--text); background: var(--button-surface); }
.btn--quiet:hover { color: var(--text); background: var(--button-surface-hover); }
.btn--ghost:hover { color: var(--text); background: var(--button-surface-hover); }
.btn--danger { color: #FFFFFF; background: #9E2C35; border-color: #C9434D; }
.btn--danger:hover { background: #B7333D; color: #FFFFFF; }
.btn--sm { min-height: 36px; padding: 0 var(--s-3); font-size: var(--fs-xs); }
.btn--icon { width: 44px; padding: 0; }
.btn--block { width: 100%; }
.btn--lg { min-height: 52px; padding: 0 var(--s-6); font-size: var(--fs-body); }

/* ---------- 5. Status pill (compliance + data states) ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-xs); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.pill svg { width: 12px; height: 12px; }
.pill--ok      { background: var(--ok-soft);     color: var(--ok); }
.pill--warn    { background: var(--warn-soft);   color: var(--warn); }
.pill--danger  { background: var(--danger-soft); color: var(--danger); }
.pill--info    { background: var(--info-soft);   color: var(--info); }
.pill--neutral { background: var(--neutral-soft); color: var(--text-muted); }

/* Role / tag badge (non-status) */
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--r-xs); border: 1px solid var(--line-strong); color: var(--text-muted); font-size: 12px; font-weight: 500; }

/* Record state (Aktyvus / Neaktyvus): dot + label, optional muted second line. Not for compliance states (use .pill). */
.state { display: inline-flex; flex-direction: column; gap: 2px; }
.state__label { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 500; color: var(--text); }
.state__label::before { content: ""; width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--text-subtle); }
.state--ok .state__label::before { background: var(--ok); }
.state--warn .state__label::before { background: var(--warn); }
.state--danger .state__label::before { background: var(--danger); }
.state__note { padding-left: 18px; font-size: var(--fs-xs); color: var(--text-muted); }

/* Type chip: icon tile + label (Butas, Komercinė, Kita) */
.chip { display: inline-flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-3) 0 0; min-height: 36px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
.chip__icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text); }
.chip__icon svg { width: 18px; height: 18px; }

/* ---------- 6. Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-6); }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-4); }
.card__head--bordered { margin: 0; padding: var(--s-4) var(--s-6); border-bottom: 1px solid var(--line); }
.card__title { font-size: 1.25rem; }
.card__sub { margin-top: var(--s-1); font-size: var(--fs-sm); color: var(--text-muted); }
.card__intro { margin-bottom: var(--s-6); }
.card--feature { background: radial-gradient(120% 120% at 100% 0%, rgba(47,127,106,.45), transparent 55%), var(--surface); }
.grid { display: grid; gap: var(--s-5); }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }

/* Stat card */
.stat__label { font-size: var(--fs-sm); color: var(--text-muted); }
.stat__value { margin-top: var(--s-2); font-family: var(--font-head); font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat__meta { margin-top: var(--s-1); font-size: var(--fs-xs); color: var(--text-subtle); }

/* Progress */
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress__bar { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--mint-strong), var(--mint)); }

/* ---------- 7. Lists: checklist / obligations / documents ---------- */
.list { display: flex; flex-direction: column; }
.list__item { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-4) var(--s-6); border-top: 1px solid var(--line); }
.list__item:first-child { border-top: 0; }
.list__item:hover { background: var(--surface-2); }
.list__icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface-2); color: var(--mint); }
.list__body { flex: 1; min-width: 0; }
.list__title { font-weight: 600; font-size: var(--fs-sm); }
.list__meta { font-size: var(--fs-xs); color: var(--text-muted); }
.list__aside { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; justify-content: flex-end; }

/* Date chip for obligations */
.datechip { width: 52px; flex: none; text-align: center; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 4px 0; line-height: 1.1; }
.datechip__day { font-family: var(--font-head); font-size: 20px; font-weight: 600; }
.datechip__mon { font-size: 11px; color: var(--text-muted); }

/* ---------- 8. Data table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { position: sticky; top: 0; background: var(--surface); text-align: left; font-weight: 500; font-size: var(--fs-sm); color: var(--text-muted); padding: var(--s-5) var(--s-6); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: var(--s-4) var(--s-6); height: 72px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: var(--fs-body); }
.table td.actions, .table th.actions { text-align: right; width: 1%; white-space: nowrap; }
.table td.actions .btn + .btn, .table td.actions .btn + form { margin-left: var(--s-2); }
.table--compact td { height: auto; padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); }
.table--compact th { padding: var(--s-3) var(--s-4); }
/* Document versions keep the approval action beside compact file details. */
.document-versions { table-layout: fixed; }
.document-versions th:first-child { width: calc(var(--s-12) + var(--s-4)); }
.document-versions th:nth-child(2) { width: 36%; }
.document-versions td { min-width: 0; overflow-wrap: anywhere; }
.document-versions .pill { height: auto; min-height: var(--s-6); white-space: normal; }
.document-versions .btn { white-space: normal; }

@media (max-width: 600px) {
  .document-versions thead { display: none; }
  .document-versions, .document-versions tbody { display: block; }
  .document-versions tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: var(--s-2); border-bottom: 1px solid var(--line); }
  .document-versions tr:last-child { border-bottom: 0; }
  .document-versions.table td { display: block; height: auto; border: 0; padding: var(--s-2); }
  .document-versions td::before { content: attr(data-label); display: block; margin-bottom: var(--s-1); color: var(--text-muted); font-size: var(--fs-xs); }
  .document-versions .document-versions__file, .document-versions .document-versions__approval { grid-column: 1 / -1; }
}
.table__empty { text-align: center; color: var(--text-muted); }
.card--flush > .table-wrap { border: 0; border-radius: 0; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; }
.table .is-negative { color: var(--danger); }
.table .is-positive { color: var(--ok); }
.table__toolbar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; margin-bottom: var(--s-4); }
/* Toolbar: wide search (Enter submits) + filters + clear */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.toolbar .search { flex: 1 1 280px; min-width: 0; }
.toolbar .input { min-height: 52px; background: var(--surface); }
.toolbar .btn { min-height: 52px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-6); border-top: 1px solid var(--line); font-size: var(--fs-body); color: var(--text-muted); }
.pager { display: flex; align-items: center; gap: var(--s-2); }
.pager__btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-muted); text-decoration: none; }
.pager__btn:hover { color: var(--text); background: var(--surface-3); }
.pager__btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.pager__btn svg { width: 18px; height: 18px; }
.pager__current { min-width: 44px; height: 44px; display: grid; place-items: center; padding: 0 var(--s-3); border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--mint) 45%, transparent); background: var(--mint-soft); color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 9. Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: var(--s-5); }
.label { display: inline-flex; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); font-weight: 600; }
.label svg { width: 18px; height: 18px; flex: none; color: var(--text-muted); }
.req { color: var(--danger); margin-left: calc(var(--s-2) * -1); }
.hint { font-size: var(--fs-xs); color: var(--text-muted); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 0 var(--s-3); border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: 400 var(--fs-body) var(--font-body); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.textarea { padding: var(--s-3); min-height: 112px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input[readonly], .textarea[readonly], .select:disabled { color: var(--text-muted); background: var(--surface); }
/* Select with drawn chevron (no image: CSP blocks data URIs) */
.select { appearance: none; -webkit-appearance: none; padding-right: var(--s-10); cursor: pointer; }
.select-wrap { position: relative; display: block; }
.select-wrap::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 1.75px solid var(--text-muted); border-bottom: 1.75px solid var(--text-muted); transform: rotate(45deg); pointer-events: none; }
/* Status select: dot follows the chosen option (requires option values active / inactive) */
.select-wrap--state .select { padding-left: 40px; }
.select-wrap--state::before { content: ""; position: absolute; left: 16px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--text-subtle); pointer-events: none; }
.select-wrap--state:has(option[value="active"]:checked)::before { background: var(--ok); }
/* Input with unit suffix (m²) */
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.input-group__addon { display: grid; place-items: center; min-width: 56px; padding: 0 var(--s-3); border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-3); color: var(--text-muted); font-size: var(--fs-sm); }
/* Form layout: 3-column grid that collapses; .field--wide spans the row, .field--span-2 two columns */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6) var(--s-8); align-items: start; }
@media (max-width: 960px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); } }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.form-grid .field + .field { margin-top: 0; }
.form-grid > .note { align-self: end; }
.field--wide { grid-column: 1 / -1; }
.field--span-2 { grid-column: span 2; }
@media (max-width: 960px) { .field--span-2 { grid-column: 1 / -1; } }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-8); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--mint); box-shadow: var(--focus-ring); }
.field--error .input, .field--error .select, .field--error .textarea { border-color: var(--danger); }
.error-text { font-size: var(--fs-xs); color: var(--danger); }
.check { display: inline-flex; align-items: flex-start; gap: var(--s-3); font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--mint); }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--text-subtle); pointer-events: none; }
.search .input { padding-left: 40px; }

/* File dropzone (document upload, imports) */
.dropzone { margin-block: 1rem; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-3); min-height: calc(var(--s-12) * 5); padding: var(--s-10) var(--s-6); border: var(--s-1) dashed var(--line-strong); border-radius: var(--r-lg); background: var(--bg-elevated); text-align: center; color: var(--text-muted); cursor: pointer; }
.dropzone__icon { display: grid; place-items: center; margin-bottom: var(--s-3); }
.dropzone__icon svg { width: calc(var(--s-12) + var(--s-4)); height: calc(var(--s-12) + var(--s-4)); }
.dropzone__title { color: var(--text); font-family: var(--font-head); font-size: var(--fs-h2); font-weight: 600; }
.dropzone__meta { font-size: var(--fs-body); }
.dropzone__limit { white-space: nowrap; }
.dropzone + .note { margin-top: var(--s-4); }
.dropzone__input { max-width: 100%; font: inherit; }
.dropzone__status { max-width: 100%; overflow-wrap: anywhere; font-size: var(--fs-sm); }
.dropzone__status:empty { display: none; }
.dropzone--enhanced .dropzone__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone:focus-within, .dropzone[data-drag="true"] { border-color: var(--mint); background: var(--surface-2); }
.dropzone:focus-within { outline: var(--s-1) solid var(--mint); outline-offset: var(--s-1); }
@media (max-width: 640px) { .dropzone { padding: var(--s-8) var(--s-4); } .dropzone__title { font-size: var(--fs-h3); } }


/* ---------- 10. Tabs (Fexiva underline style) ---------- */
.tabs { display: flex; gap: var(--s-6); border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tab { position: relative; flex: none; padding: var(--s-3) 2px; background: none; border: 0; color: var(--text-muted); font: 600 var(--fs-sm) var(--font-body); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
a.tab { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
a.tab[aria-current="page"] { color: var(--text); }
a.tab[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--mint); border-radius: 2px; }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--mint); border-radius: 2px; }

/* Segmented control (Monthly / Yearly style) */
.segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--r-sm); background: var(--surface-2); }
.segmented button { min-height: 36px; padding: 0 var(--s-4); border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font: 600 var(--fs-sm) var(--font-body); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--mint); color: var(--text-on-mint); }

/* ---------- 11. Stepper (onboarding, import wizard) ---------- */
.stepper { display: flex; gap: var(--s-2); list-style: none; margin: 0; padding: 0; counter-reset: step; flex-wrap: wrap; }
.stepper li { flex: 1 1 120px; padding-top: var(--s-3); border-top: 2px solid var(--line-strong); font-size: var(--fs-xs); color: var(--text-subtle); counter-increment: step; }
.stepper li::before { content: counter(step) ". "; font-weight: 700; }
.stepper li[data-state="done"] { border-color: var(--ok); color: var(--text-muted); }
.stepper li[aria-current="step"] { border-color: var(--mint); color: var(--text); font-weight: 600; }

/* ---------- 12. Alerts / banners ---------- */
.alert { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4) var(--s-5); border-radius: var(--r-md); border: 1px solid; font-size: var(--fs-body); color: var(--text); }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert__title { font-weight: 600; margin-bottom: 2px; }
.alert--info   { background: var(--info-soft);   border-color: color-mix(in srgb, var(--info) 45%, transparent);   }
.alert--warn   { background: var(--warn-soft);   border-color: color-mix(in srgb, var(--warn) 55%, transparent);   }
.alert--danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.alert--ok     { background: var(--ok-soft);     border-color: color-mix(in srgb, var(--ok) 35%, transparent);     }
.alert--info svg { color: var(--info); } .alert--warn svg { color: var(--warn); }
.alert--danger svg { color: var(--danger); } .alert--ok svg { color: var(--ok); }
/* Note: quiet explanatory panel (form rules, counting rules). Neutral, not a status. */
.note { display: flex; gap: var(--s-4); align-items: center; padding: var(--s-4) var(--s-5); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-elevated); color: var(--text-muted); font-size: var(--fs-sm); }
.note svg { width: 22px; height: 22px; flex: none; color: var(--text-muted); }
.note--mint { border-color: color-mix(in srgb, var(--mint) 25%, transparent); background: color-mix(in srgb, var(--mint) 5%, var(--surface)); }
.note--mint svg { color: var(--mint); }

/* ---------- 13. Modal / drawer / toast ---------- */
.modal { border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--bg-elevated); color: var(--text); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); }
.modal::backdrop { background: rgba(2, 6, 5, .7); backdrop-filter: blur(2px); }
.modal__head, .modal__foot { padding: var(--s-5) var(--s-6); }
.modal__body { padding: 0 var(--s-6) var(--s-6); }
.modal__foot { display: flex; justify-content: flex-end; gap: var(--s-3); border-top: 1px solid var(--line); margin-top: var(--s-4); }
/* Trongate MX modal (mx-build-modal). MX's inline style attributes are blocked by the CSP, so layout lives here.
   MX's own close icon uses an inline onclick (also blocked): pass "renderCloseIcon":"false" and put a
   .modal__close[data-modal-close] button in modalHeading; the page script calls closeModal(). Esc and outside click work natively. */
#overlay { position: fixed; inset: 0; z-index: 40; background: rgba(2, 6, 5, .7); backdrop-filter: blur(2px); }
#modal-container { position: fixed; inset: 0; z-index: 41; display: flex; align-items: flex-start; justify-content: center; padding: 0 var(--s-4); overflow-y: auto; pointer-events: none; }
#modal-container > .modal { pointer-events: auto; opacity: 0; max-height: 85vh; display: flex; flex-direction: column; margin-bottom: var(--s-8); transition: opacity var(--dur) var(--ease); }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-5) var(--s-6); font-family: var(--font-head); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.modal-body { padding: 0 var(--s-6) var(--s-5); overflow-y: auto; }
.modal__close { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; color: var(--text-muted); cursor: pointer; }
.modal__close:hover { color: var(--text); background: var(--surface-2); }
.modal__close svg { width: 18px; height: 18px; }
.spinner { width: 28px; height: 28px; margin: var(--s-6) auto; border: 3px solid var(--line-strong); border-top-color: var(--mint); border-radius: 50%; animation: namoja-spin .8s linear infinite; }
@keyframes namoja-spin { to { transform: rotate(360deg); } }
.toast-stack { position: fixed; right: var(--s-6); bottom: var(--s-6); display: flex; flex-direction: column; gap: var(--s-2); z-index: 100; }
.toast { display: flex; gap: var(--s-3); align-items: center; min-width: 280px; max-width: 420px; padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); font-size: var(--fs-sm); }

/* ---------- 14. Empty state ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-3); padding: var(--s-12) var(--s-6); }
.empty__icon { width: 56px; height: 56px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--mint-soft); color: var(--mint); }
.empty p { max-width: 44ch; color: var(--text-muted); }

/* ---------- 15. Audit timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }
.timeline li { position: relative; padding: 0 0 var(--s-5) var(--s-8); font-size: var(--fs-sm); }
.timeline li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--mint); }
.timeline time { display: block; font-size: var(--fs-xs); color: var(--text-subtle); }

/* ---------- 16. Auth (Smart-ID / Mobile-ID) ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s-6); background: radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--hero-top) 55%, transparent), transparent 70%); }
.auth__card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-8); box-shadow: var(--shadow-pop); }
.auth__code { font-family: var(--font-head); font-size: 2.5rem; font-weight: 700; letter-spacing: .12em; text-align: center; padding: var(--s-5); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-strong); font-variant-numeric: tabular-nums; }

/* QR code and secret on auth cards */
.auth__brand { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-6); font-family: var(--font-head); font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.auth__card h1 { margin-bottom: var(--s-3); }
.auth__card > p { color: var(--text-muted); }
.auth__card form { margin-top: var(--s-6); }
.auth__card .btn--block { margin-top: var(--s-6); }
.auth__actions { display: grid; gap: var(--s-3); margin-top: var(--s-6); }
.auth__actions form { margin: 0; }
.qr { display: block; width: min(100%, 240px); height: auto; margin: var(--s-6) auto var(--s-4); padding: var(--s-3); border-radius: var(--r-md); background: #FFFFFF; }
.auth__card .note, .auth__card .alert { margin-top: var(--s-4); }
.auth__steps { margin-bottom: var(--s-6); flex-wrap: nowrap; }
.auth__steps li { flex: 1 1 0; min-width: 0; }
.input--code { font-family: var(--font-head); font-size: 1.5rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.secret { display: block; margin-top: var(--s-2); padding: var(--s-3); border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-strong); font-size: var(--fs-sm); letter-spacing: .08em; overflow-wrap: anywhere; color: var(--text); }

/* ---------- 17. Description list (record details, audit changes) ---------- */
.dl { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: var(--s-2) var(--s-6); margin: 0; font-size: var(--fs-sm); }
.dl dt { color: var(--text-muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: var(--s-3); } }

/* Disclosure (inline secondary forms) */
.disclosure { border-top: 1px solid var(--line); padding-top: var(--s-4); margin-top: var(--s-4); }
.disclosure > summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); color: var(--mint); min-height: 44px; display: flex; align-items: center; }
.disclosure[open] > summary { margin-bottom: var(--s-4); }

/* ---------- 18. Avatar ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 700; flex: none; }
