/* Generated by scripts/build_frontend_assets.py; do not edit. */

/* static/ds/tokens/colors.css */
/* Invictus Flugtechnik — Color tokens
   Base palette from brand_spec.json. Aviation blue + amber on navy.
   "dark" in this brand means: for use on dark/navy backgrounds. */
:root {
  /* ---- Brand base palette ---- */
  --ift-blue: #0B72FF;          /* Invictus Blue — primary, light backgrounds */
  --ift-blue-dark: #3B8EFF;     /* Blue lifted for navy backgrounds (WCAG) */
  --ift-amber: #FF9B00;         /* Amber — origin node, rules, highlight */
  --ift-navy: #0A1628;          /* Navy — primary dark surface */
  --ift-hangar: #2D2A26;        /* Warm near-black */
  --ift-cloud-muted: #8FA0B5;   /* Muted blue-gray — secondary text on navy */
  --ift-editor-gray: #888888;   /* JSON gray on light */
  --ift-legal-muted: #5C564E;   /* Warm gray — legal fine print */
  --ift-ink-dark: #EBE4D8;      /* Warm off-white — text on navy */
  --ift-white: #FFFFFF;
  --ift-ink: #0A1628;           /* Body ink on light = navy */

  /* Tints / surfaces derived from navy (technical, cool) */
  --ift-navy-700: #12233D;      /* Card / panel on navy */
  --ift-navy-600: #1B2F4D;      /* Raised surface / hover on navy */
  --ift-hairline-dark: #25364F; /* Borders / grid lines on navy */
  --ift-cloud-050: #F4F6F9;     /* Lightest cool gray — page bg light */
  --ift-cloud-100: #E7ECF2;     /* Light surface / hairline on light */
  --ift-cloud-200: #D4DCE6;     /* Border on light */

  /* Semantic status (kept close to brand hues) */
  --ift-success: #1E9E5A;
  --ift-warning: #FF9B00;       /* reuses amber */
  --ift-danger:  #E5484D;
  --ift-info:    #0B72FF;       /* reuses blue */

  /* ---- Semantic aliases (light context = default) ---- */
  --color-bg: var(--ift-cloud-050);
  --color-surface: var(--ift-white);
  --color-surface-raised: var(--ift-white);
  --color-surface-sunken: var(--ift-cloud-050);
  --color-border: var(--ift-cloud-200);
  --color-hairline: var(--ift-cloud-100);

  --color-text: var(--ift-ink);
  --color-text-muted: #5E6B7E;
  --color-text-faint: #8A97A8;
  --color-text-legal: var(--ift-legal-muted);
  --color-text-on-accent: var(--ift-white);

  --color-primary: var(--ift-blue);
  --color-primary-hover: #0961D8;
  --color-primary-active: #0850B5;
  --color-accent: var(--ift-amber);
  --color-accent-hover: #E68A00;

  --color-link: var(--ift-blue);
  --color-rule: var(--ift-amber);       /* the signature amber divider */
  --color-code-key: var(--ift-amber);   /* JSON keys */
  --color-code-string: var(--ift-blue); /* JSON values */
  --color-code-punct: var(--ift-editor-gray);

  --color-success: var(--ift-success);
  --color-warning: var(--ift-warning);
  --color-danger: var(--ift-danger);
}

/* ---- Dark / navy context ---- */
.ift-dark,
[data-theme="dark"] {
  --color-bg: var(--ift-navy);
  --color-surface: var(--ift-navy-700);
  --color-surface-raised: var(--ift-navy-600);
  --color-surface-sunken: #0C1A2F;
  --color-border: var(--ift-hairline-dark);
  --color-hairline: #1C2D45;

  --color-text: var(--ift-ink-dark);
  --color-text-muted: var(--ift-cloud-muted);
  --color-text-faint: #5E7088;
  --color-text-legal: var(--ift-cloud-muted);
  --color-text-on-accent: var(--ift-navy);

  --color-primary: var(--ift-blue-dark);
  --color-primary-hover: #5BA2FF;
  --color-primary-active: #2C7FF0;
  --color-accent: var(--ift-amber);
  --color-accent-hover: #FFB13A;

  --color-link: var(--ift-blue-dark);
  --color-code-key: var(--ift-amber);
  --color-code-string: var(--ift-blue-dark);
  --color-code-punct: var(--ift-cloud-muted);
}


/* static/ds/tokens/typography.css */
/* Invictus Flugtechnik — Typography tokens
   Jost for everything UI + wordmark; JetBrains Mono for data, JSON, coordinates,
   contact details. */
:root {
  /* Families */
  --font-sans: "Jost", "Century Gothic", "Futura", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Jost", "Futura", "Century Gothic", "Helvetica Neue", sans-serif;
  --font-mono: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;

  /* Weights (Jost ships 400 + 500 in this kit) */
  --weight-regular: 400;
  --weight-medium: 500;

  /* Type scale */
  --text-2xs: 11px;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-md: 18px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 30px;
  --text-3xl: 38px;
  --text-4xl: 48px;
  --text-5xl: 64px;
  --text-6xl: 84px;
  --text-display: 112px;

  /* Line heights */
  --leading-tight: 1.08;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* Letter spacing — wide tracking is a brand signature for caps/labels */
  --tracking-tightest: -0.02em;
  --tracking-tight: -0.01em;
  --tracking-normal: 0;
  --tracking-wide: 0.04em;
  --tracking-wider: 0.12em;     /* INVICTUS wordmark */
  --tracking-widest: 0.34em;    /* FLUGTECHNIK / overline labels */

  /* ---- Semantic roles ---- */
  --text-wordmark-1: var(--weight-medium) var(--text-2xl) / 1 var(--font-display);
  --text-display-role: var(--weight-medium) var(--text-display) / var(--leading-tight) var(--font-display);
  --text-h1: var(--weight-medium) var(--text-4xl) / var(--leading-tight) var(--font-display);
  --text-h2: var(--weight-medium) var(--text-3xl) / var(--leading-tight) var(--font-display);
  --text-h3: var(--weight-medium) var(--text-2xl) / var(--leading-snug) var(--font-display);
  --text-h4: var(--weight-medium) var(--text-xl) / var(--leading-snug) var(--font-sans);
  --text-body: var(--weight-regular) var(--text-base) / var(--leading-relaxed) var(--font-sans);
  --text-body-sm: var(--weight-regular) var(--text-sm) / var(--leading-normal) var(--font-sans);
  --text-label: var(--weight-medium) var(--text-xs) / 1 var(--font-sans);
  --text-mono: var(--weight-medium) var(--text-sm) / var(--leading-normal) var(--font-mono);
  --text-tagline: italic var(--weight-regular) var(--text-md) / var(--leading-snug) var(--font-sans);
}


/* static/ds/tokens/spacing.css */
/* Invictus Flugtechnik — Spacing & layout tokens. 4px base grid. */
:root {
  --space-0: 0;
  --space-px: 1px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* Container widths */
  --container-sm: 640px;
  --container-md: 880px;
  --container-lg: 1120px;
  --container-xl: 1280px;

  /* Page gutters */
  --gutter: var(--space-6);
  --gutter-lg: var(--space-16);

  /* Blueprint grid module (the signature background grid) */
  --grid-module: 48px;
}


/* static/ds/tokens/effects.css */
/* Invictus Flugtechnik — Radii, borders, shadows, motion. */
:root {
  /* Corner radii */
  --radius-none: 0;
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;
  --radius-circle: 50%;

  /* Border widths */
  --border-hairline: 1px;
  --border-thin: 1.5px;
  --border-thick: 2px;
  --rule-weight: 2px;            /* amber divider rule */

  /* Shadows — cool, soft, navy-tinted */
  --shadow-xs: 0 1px 2px rgba(10, 22, 40, 0.06);
  --shadow-sm: 0 1px 3px rgba(10, 22, 40, 0.08), 0 1px 2px rgba(10, 22, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(10, 22, 40, 0.10), 0 1px 3px rgba(10, 22, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(10, 22, 40, 0.14), 0 2px 8px rgba(10, 22, 40, 0.06);
  --shadow-xl: 0 24px 60px rgba(10, 22, 40, 0.20);

  /* Focus ring — blue, generous */
  --focus-ring: 0 0 0 3px rgba(11, 114, 255, 0.32);
  --focus-ring-amber: 0 0 0 3px rgba(255, 155, 0, 0.36);

  /* Glow for nodes / active data points on navy */
  --glow-blue: 0 0 0 4px rgba(59, 142, 255, 0.18);
  --glow-amber: 0 0 0 4px rgba(255, 155, 0, 0.20);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0.05, 0.36, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 360ms;
  --transition-base: all var(--duration-base) var(--ease-out);

  /* Blueprint grid background (navy) */
  --blueprint-line: rgba(143, 160, 181, 0.07);
}

[data-theme="dark"],
.ift-dark {
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.40);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 28px 70px rgba(0, 0, 0, 0.65);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
  }
}


/* static/ds/tokens/base.css */
/* Invictus Flugtechnik — Base element styling & brand utilities. */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font: var(--text-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--color-text); text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: rgba(11, 114, 255, 0.18); }

/* ---- Brand utilities ---- */

.ift-wordmark {
  font-family: var(--font-display);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  color: var(--color-primary);
  text-transform: uppercase;
  line-height: 1;
}
.ift-wordmark > .sub {
  display: block;
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-widest);
  color: var(--color-accent);
  font-size: 0.5em;
  margin-top: 0.35em;
}

.ift-overline {
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.ift-rule {
  border: 0;
  height: var(--rule-weight);
  width: 64px;
  background: var(--color-rule);
  margin: var(--space-4) 0;
}

.ift-tagline { font: var(--text-tagline); color: var(--color-text-muted); }

.ift-json { font-family: var(--font-mono); font-size: var(--text-sm); line-height: var(--leading-normal); }
.ift-json .p { color: var(--color-code-punct); }
.ift-json .k { color: var(--color-code-key); }
.ift-json .s { color: var(--color-code-string); }

.ift-blueprint {
  background-color: var(--ift-navy);
  background-image:
    linear-gradient(var(--blueprint-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--blueprint-line) 1px, transparent 1px);
  background-size: var(--grid-module) var(--grid-module);
}

.ift-blueprint-light {
  background-color: var(--ift-cloud-050);
  background-image:
    linear-gradient(rgba(10, 22, 40, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 22, 40, 0.05) 1px, transparent 1px);
  background-size: var(--grid-module) var(--grid-module);
}

.ift-coord {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-faint);
  text-transform: uppercase;
}


/* static/css/app.css */
/* Invictus Flugtechnik · Buchhaltung — application shell & components.
   Everything visual sources the v4.0 design-system tokens. */

html, body { height: 100%; }
body { font-family: var(--font-sans); }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  transform: translateY(-160%); padding: 10px 14px; border-radius: 8px;
  background: var(--color-surface); color: var(--color-text);
  border: 2px solid var(--color-primary); box-shadow: var(--shadow-md);
}
.skip-link:focus { transform: translateY(0); }

:where(a, button, summary, [role="button"], [tabindex]):focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

[x-cloak] { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
/* htmx swaps `htmx-request` onto the indicator's owner while a request is in flight */
.htmx-indicator { opacity: 0; transition: opacity var(--duration-base) var(--ease-out); }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.ift-icon { display: inline-block; vertical-align: middle; flex: none; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }

/* ===== App shell ===== */
.ift-app {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
}
.ift-app *::-webkit-scrollbar { width: 10px; height: 10px; }
.ift-app *::-webkit-scrollbar-thumb {
  background: var(--color-border); border-radius: 6px; border: 3px solid var(--color-bg);
}
.ift-app *::-webkit-scrollbar-track { background: transparent; }

/* ===== Sidebar (always navy) ===== */
.sidebar {
  width: 252px;
  flex: none;
  background: var(--ift-navy);
  border-right: 1px solid var(--ift-hairline-dark);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-backdrop, .mobile-nav-toggle { display: none; }
.sidebar-brand {
  display: flex; align-items: center;
  padding: 16px 16px 12px;
}
.brand-lockup { width: 100%; max-width: 200px; height: auto; display: block; }

.context-chip {
  margin: 4px 14px 12px;
  padding: 9px 11px; border-radius: 9px;
  background: var(--ift-navy-700); border: 1px solid var(--ift-hairline-dark);
  display: flex; flex-direction: column; gap: 3px; position: relative;
}
.context-chip .cy { color: var(--ift-ink-dark); font-size: 12px; font-weight: 500; }
.context-chip .cm {
  font-family: var(--font-mono); font-size: 9.5px; color: var(--ift-cloud-muted);
  letter-spacing: 0.03em;
}
.context-chip .q-pill {
  position: absolute; top: 9px; right: 11px;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
  color: var(--ift-navy); background: var(--ift-amber);
  padding: 2px 6px; border-radius: 20px;
}

.nav-groups { flex: 1; padding: 0 10px 12px; }
.nav-group-label {
  font-family: var(--font-mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--ift-blue-dark); padding: 14px 8px 6px;
}
.nav-group-en { display: block; color: var(--ift-amber); font-weight: 400; margin-top: 2px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 8px;
  color: var(--ift-cloud-muted); text-decoration: none;
  border-left: 3px solid transparent; margin-bottom: 1px;
  transition: background var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
  position: relative;
}
.nav-btn:hover { background: rgba(143,160,181,0.10); text-decoration: none; }
.nav-btn .ni { color: var(--ift-cloud-muted); flex: none; }
.nav-btn .nt { line-height: 1.15; flex: 1; min-width: 0; }
.nav-btn .nt .main { display: block; font-size: 13.5px; font-weight: 500; color: var(--ift-ink-dark); }
.nav-btn .nt .sub { display: block; font-size: 10.5px; color: var(--ift-cloud-muted); margin-top: 1px; }
.nav-btn.active {
  background: rgba(11,114,255,0.22);
  border-left: 3px solid var(--ift-amber);
  box-shadow: inset 0 0 0 1px rgba(59,142,255,0.22),
              -1px 0 10px -2px rgba(255,155,0,0.45);
}
.nav-btn.active .main { color: #fff; font-weight: 650; letter-spacing: 0.005em; }
.nav-btn.active .sub { color: var(--ift-amber); }
.nav-btn.active .ni { color: var(--ift-amber); }
.nav-badge {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
  background: var(--ift-amber); color: var(--ift-navy);
  border-radius: 20px; padding: 1px 6px; flex: none;
}

.sidebar-footer {
  border-top: 1px solid var(--ift-hairline-dark);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
}
.sidebar-identity {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  padding: 5px; margin: -5px; border-radius: 8px; text-decoration: none;
  transition: background var(--duration-base) var(--ease-out);
}
.sidebar-identity:hover { background: rgba(143,160,181,0.12); text-decoration: none; }
.sidebar-identity:focus-visible { outline: 2px solid var(--ift-amber); outline-offset: 2px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(150deg, #3B8EFF, #0B72FF);
  color: #fff; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-footer .who { flex: 1; min-width: 0; line-height: 1.2; }
.sidebar-footer .who .n { font-size: 12px; color: var(--ift-ink-dark); font-weight: 500; }
.sidebar-footer .who .r { font-size: 10px; color: var(--ift-cloud-muted); }
.gobd { font-family: var(--font-mono); font-size: 9px; color: var(--ift-success); display: flex; align-items: center; gap: 4px; }
.gobd::before { content: "●"; font-size: 8px; }
.gobd-warn { color: var(--ift-amber); }

/* ===== Main column ===== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 62px; flex: none;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-hairline);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
}
.topbar .titles { flex: 1; min-width: 0; }
.topbar .titles .t { font-size: 17px; font-weight: 600; color: var(--color-text); line-height: 1.2; }
.topbar .titles .s { font-family: var(--font-mono); font-size: 12px; color: var(--color-text-faint); }
.search {
  width: 220px; display: flex; align-items: center; gap: 8px; position: relative;
  background: var(--color-surface-sunken); border: 1px solid var(--color-border);
  border-radius: 8px; padding: 7px 10px; color: var(--color-text-faint);
}
.search-dropdown:empty { display: none; }
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; width: 340px; z-index: 60;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.14);
  padding: 6px; max-height: 60vh; overflow-y: auto;
}
.search-group {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--color-text-faint); padding: 8px 8px 3px;
}
.search-hit {
  display: flex; flex-direction: column; gap: 1px; padding: 6px 8px;
  border-radius: 7px; text-decoration: none; color: var(--color-text);
}
.search-hit:hover { background: var(--color-surface-sunken); }
.search-hit .sh-label { font-size: 12.5px; }
.search-hit .sh-sub { font-size: 10.5px; color: var(--color-text-faint); }
.search-empty { padding: 10px 8px; font-size: 12px; color: var(--color-text-faint); }
.search input {
  border: 0; background: transparent; outline: none; flex: 1; min-width: 0;
  min-height: 0; padding: 4px 0; border-radius: 0;
  font-family: var(--font-sans); font-size: 12.5px; color: var(--color-text);
}
.search .kbd {
  font-family: var(--font-mono); font-size: 10px; color: var(--color-text-faint);
  border: 1px solid var(--color-border); border-radius: 4px; padding: 1px 5px;
}
.period-chip {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--color-primary); background: rgba(11,114,255,0.10);
  border: 1px solid rgba(11,114,255,0.20); border-radius: 8px; padding: 6px 10px;
}
select.period-chip { cursor: pointer; -webkit-appearance: none; appearance: none; padding-right: 22px;
  background-image: linear-gradient(45deg, transparent 50%, var(--color-primary) 50%), linear-gradient(135deg, var(--color-primary) 50%, transparent 50%);
  background-position: calc(100% - 11px) 11px, calc(100% - 7px) 11px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.theme-toggle {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: var(--color-surface-sunken); }

.content { flex: 1; overflow-y: auto; padding: 24px; }
.view { max-width: 1180px; margin: 0 auto; animation: fade-in var(--duration-base) var(--ease-out); }
.view-narrow { max-width: 1000px; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ===== Cards & components ===== */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 12px; box-shadow: var(--shadow-xs); padding: 20px;
}
.card-navy {
  background: var(--ift-navy-700); border: 1px solid var(--ift-hairline-dark);
  border-radius: 12px; padding: 20px; color: var(--ift-ink-dark);
}
/* Outline buttons sit on the dark navy card — force readable light contrast
   (the default uses page text colour, which is near-invisible in light mode). */
.card-navy .btn-outline {
  color: #fff; border-color: rgba(255,255,255,0.40);
  background: rgba(255,255,255,0.08);
}
.card-navy .btn-outline:hover { background: rgba(255,255,255,0.18); text-decoration: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--color-text); }

.overline {
  font-family: var(--font-mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.18em; color: var(--color-text-muted);
}

/* KPI grid — responsive: 4 → 2 → 1 columns, never overflows */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
/* Dashboard 2-column area: stacks below 880px */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-top: 18px; }
@media (max-width: 880px) { .dash-grid { grid-template-columns: 1fr; } }
.view, .view-narrow { width: 100%; }
.kpi .kpi-label { display: flex; align-items: center; gap: 6px; }
.kpi .dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.kpi .kpi-value {
  font-family: var(--font-mono); font-size: 23px; font-weight: 600;
  color: var(--color-text); white-space: nowrap; margin-top: 10px;
}
.kpi .kpi-sub { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; }
/* A KPI that leads somewhere, like the to-do rows */
.kpi.is-link { display: block; text-decoration: none; color: inherit; }
.kpi.is-link:hover { border-color: var(--color-primary); text-decoration: none; }
.kpi .kpi-label { justify-content: flex-start; }
.kpi .kpi-go { margin-left: auto; color: var(--color-primary); font-size: 13px; }

/* Cashflow bar chart */
.legend { display: flex; gap: 16px; align-items: center; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--color-text-muted); }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.cashflow { height: 180px; display: flex; align-items: flex-end; gap: 18px; padding-top: 12px; }
.bar-pair { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 5px; height: 100%; }
.bar-pair .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; flex: 1; }
.bar { width: 100%; max-width: 18px; border-radius: 4px 4px 0 0; min-height: 3px; }
.bar.ein { background: linear-gradient(180deg, #3B8EFF, #0B72FF); }
.bar.aus { background: rgba(255,155,0,0.85); }
.bar-month { font-family: var(--font-mono); font-size: 9px; color: var(--color-text-faint); margin-top: 7px; }
.cf-stats { display: flex; gap: 24px; border-top: 1px solid var(--color-hairline); margin-top: 14px; padding-top: 14px; }
.cf-stats .st .l { font-size: 10px; color: var(--color-text-muted); }
.cf-stats .st .v { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--color-text); }
.cf-stats .st .v.pos { color: var(--ift-success); }

/* To-do list */
.todo-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--color-hairline); }
.todo-row:last-child { border-bottom: 0; }
.todo-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.todo-row .tx { flex: 1; }
.todo-row .tx .ti { font-size: 13px; color: var(--color-text); }
.todo-row .tx .su { font-size: 11px; color: var(--color-text-muted); }
.todo-row .due { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-faint); }

/* JSON payload card */
.json-payload { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; }
.json-payload .k { color: var(--ift-amber); }
.json-payload .s { color: var(--ift-blue-dark); }
.json-payload .p { color: var(--ift-cloud-muted); }

/* Buttons */
.btn {
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  border-radius: 8px; padding: 9px 16px; cursor: pointer;
  border: 1px solid transparent; display: inline-flex; align-items: center; gap: 8px;
  transition: var(--transition-base); text-decoration: none;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); text-decoration: none; }
.btn-outline { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn-outline:hover { background: var(--color-surface-sunken); text-decoration: none; }
/* A header button whose panel is currently open */
.btn-outline.active { border-color: var(--color-primary); color: var(--color-primary); background: rgba(11,114,255,0.08); }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-surface-sunken); text-decoration: none; }
.btn-amber { background: var(--color-accent); color: var(--ift-navy); }
.btn-amber:hover { background: var(--color-accent-hover); text-decoration: none; }
.btn-block { width: 100%; justify-content: center; }

/* Document filter bar — responsive grid so controls never wrap awkwardly. */
.doc-filter {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; align-items: end; margin-bottom: 10px;
}
.doc-filter .field { margin-bottom: 0; }
.doc-filter-wide { grid-column: span 2; }
.doc-filter-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }

/* Document category "folders" (landing view) — same footprint as the doc cards:
   a big centred folder, label + count below. */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.folder-card {
  display: block; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-xs);
  text-decoration: none; color: inherit; transition: var(--transition-base);
}
.folder-card:hover { border-color: var(--color-primary); }
.folder-thumb {
  height: 104px; background: var(--color-surface-sunken); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
}
.folder-body { padding: 12px 14px; text-align: center; }
.folder-body .fk { font-size: 12.5px; font-weight: 500; line-height: 1.25; }
.folder-body .fc { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); margin-top: 4px; }

/* Status pills — German over English, centred. */
.pill {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; line-height: 1.15;
  border-radius: 12px; padding: 3px 9px; text-align: center;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.pill small { font-size: 0.82em; font-weight: 400; opacity: 0.7; letter-spacing: 0; }
.pill-green { background: rgba(30,158,90,0.14); color: var(--ift-success); }
.pill-blue  { background: rgba(11,114,255,0.12); color: var(--color-primary); }
.pill-amber { background: rgba(255,155,0,0.16); color: #B26B00; }
.pill-purple{ background: rgba(122,91,214,0.12); color: #7A5BD6; }
.pill-gray  { background: var(--color-surface-sunken); color: var(--color-text-muted); }

/* Forms */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12px; font-weight: 500; color: var(--color-text-muted);
  margin-bottom: 6px;
}
/* One consistent control style for EVERY input/select/textarea so they always
   line up — same height, padding, radius and font, whether inside .field or in a
   tight grid row. Wrapped in :where() so it is a ZERO-specificity baseline that
   any component rule (.search, .period-chip, .field-sm, inline styles) overrides. */
:where(input[type="text"], input[type="search"], input[type="date"], input[type="number"],
input[type="email"], input[type="password"], input[type="tel"], input:not([type]),
select, textarea) {
  box-sizing: border-box; font-family: var(--font-sans); font-size: 14px;
  line-height: 1.35; padding: 10px 12px; min-height: 42px; border-radius: 8px;
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text); outline: none; -webkit-appearance: none; appearance: none;
}
:where(textarea) { min-height: 66px; line-height: 1.45; }
/* Native chrome removed above → give selects a consistent chevron. */
:where(select) {
  cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237b8794' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
:where(input, select, textarea):focus {
  border-color: var(--color-primary); box-shadow: var(--focus-ring);
}
.field input, .field select, .field textarea { width: 100%; }
.field .help { font-size: 11px; color: var(--color-text-faint); margin-top: 5px; }
.field .err { font-size: 12px; color: var(--ift-danger); margin-top: 5px; }
.errorlist {
  margin: 6px 0 0; padding: 0; list-style: none;
  color: var(--ift-danger); font-size: 12px;
}
:where(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--ift-danger); box-shadow: 0 0 0 3px rgba(208, 55, 67, 0.16);
}
.field input.mono, input.mono, .mono > input { font-family: var(--font-mono); letter-spacing: 0.15em; }
/* Compact variant for dense grid rows (e.g. allocation lines). */
.ctl-sm, .field-sm input, .field-sm select { font-size: 12.5px; padding: 7px 10px; min-height: 36px; }
.ctl-sm[type="text"], .field-sm input[type="text"] { min-height: 36px; }
/* Checkboxes/radios must not inherit the full-width text-input styling. */
input[type="checkbox"], input[type="radio"] {
  box-sizing: border-box; width: auto; min-height: 0; padding: 0; margin: 0;
  vertical-align: middle; accent-color: var(--color-primary); cursor: pointer;
  -webkit-appearance: auto; appearance: auto;
}

/* Messages */
.messages-host { display: contents; }
.messages { position: fixed; top: 16px; right: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary); border-radius: 8px;
  padding: 11px 14px; box-shadow: var(--shadow-md); font-size: 13px; max-width: 360px;
  display: flex; align-items: flex-start; gap: 10px;
}
.toast.success { border-left-color: var(--ift-success); }
.toast.warning { border-left-color: var(--ift-amber); }
.toast.error { border-left-color: var(--ift-danger); }
.toast-msg { flex: 1 1 auto; min-width: 0; }
.toast-x {
  flex: 0 0 auto; background: none; border: 0; cursor: pointer; padding: 0 2px;
  font-size: 13px; line-height: 1.2; color: var(--color-text-faint);
}
.toast-x:hover { color: var(--color-text); }

/* Transactions · Matching */
.tx-layout { display: flex; flex-wrap: wrap; gap: 18px; }
.tx-list { flex: 2 1 400px; min-width: 0; }
.tx-detail { flex: 1 1 320px; min-width: 300px; position: sticky; top: 0; align-self: flex-start;
  max-height: calc(100vh - 96px); overflow-y: auto; }
.tx-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tx-tab {
  font-size: 12px; padding: 6px 12px; border-radius: 8px; text-decoration: none;
  border: 1px solid var(--color-border); color: var(--color-text-muted); background: var(--color-surface);
}
.tx-tab.active { border-color: var(--color-primary); color: var(--color-primary); background: rgba(11,114,255,0.08); }
.tx-chip {
  font-family: var(--font-mono); font-size: 10px; padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--color-border); color: var(--color-text-muted); text-decoration: none;
}
.tx-chip.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.tx-acct-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.tx-acct-head .iban { font-family: var(--font-mono); font-size: 10.5px; color: var(--color-text-faint); }
.tx-colhead, .tx-row {
  display: grid; grid-template-columns: 52px minmax(0,1fr) 116px; gap: 10px; align-items: start;
}
.tx-colhead { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--color-text-faint); padding: 8px 12px; border-bottom: 1px solid var(--color-hairline); }
.tx-colhead .r, .tx-row .r { text-align: right; }
.tx-row {
  padding: 11px 12px; border-bottom: 1px solid var(--color-hairline); cursor: pointer; text-decoration: none;
}
.tx-row:hover { background: var(--color-surface-sunken); }
.tx-row.sel { background: var(--color-surface-sunken); box-shadow: inset 3px 0 0 var(--color-primary); }
.journal-grid {
  grid-template-columns: 62px 78px minmax(180px, 1fr) 104px 250px;
  min-width: 720px;
}
/* VAT rate pills (booking pane, inside the selected treatment row) */
.vat-pill { padding: 5px 11px; border-radius: 999px; font-size: 12px; cursor: pointer; line-height: 1.2;
  border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-muted); }
.vat-pill:hover { border-color: var(--color-primary); }
.vat-pill.active { border-color: var(--color-primary); background: rgba(11,114,255,0.10); color: var(--color-primary); font-weight: 600; }
/* Two-way segmented control (Beleg buchen: with or without a bank line) */
.seg { display: flex; border: 1px solid var(--color-border); border-radius: 9px;
  overflow: hidden; margin-bottom: 10px; }
.seg button { flex: 1; padding: 8px; border: 0; background: var(--color-surface);
  color: var(--color-text-muted); font-size: 12px; cursor: pointer; font-family: inherit; }
.seg button.active { background: rgba(11,114,255,0.10); color: var(--color-primary); font-weight: 600; }
/* Compact VAT picker (one per row): the same eight treatments as two-line chips */
.vat-pop { position: absolute; right: 0; top: calc(100% + 5px); z-index: 30; width: 340px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  border: 1px solid var(--color-primary); border-radius: 9px; padding: 8px;
  background: var(--color-surface); box-shadow: var(--shadow-lg); }
.vat-chip { text-align: left; border: 1px solid var(--color-border); background: var(--color-surface);
  border-radius: 7px; padding: 5px 8px; cursor: pointer; font-family: inherit; }
.vat-chip:hover { border-color: var(--color-primary); }
.vat-chip.sel { border-color: var(--color-primary); background: rgba(11,114,255,0.08); }
.vat-chip.sel .t { color: var(--color-primary); }
.vat-chip .t { display: block; font-size: 11px; font-weight: 600; }
.vat-chip .s { display: block; font-size: 9px; color: var(--color-text-faint); }
/* The German rate, revealed inside the popover when `inland` is the choice */
.vat-pop-rate { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; padding-top: 4px; }
/* VAT treatment picker: the detected-treatment banner and the flat list of all eight */
.detect-banner { border: 1px solid rgba(11,114,255,0.35); background: rgba(11,114,255,0.05);
  border-radius: 10px; padding: 11px 13px; }
.detect-evidence { font-size: 10px; line-height: 1.6; margin-top: 8px;
  background: var(--ift-navy); border-radius: 7px; padding: 7px 10px; }
.detect-none { background: var(--color-surface-sunken); border: 1px dashed var(--color-border);
  border-radius: 10px; padding: 9px 12px; }
.detect-none .mono { font-size: 10px; color: var(--color-text-faint); line-height: 1.6; }
.treat-row { border-radius: 9px; padding: 8px 11px; cursor: pointer;
  border: 1px solid var(--color-border); background: var(--color-surface);
  transition: border-color var(--duration-base) var(--ease-out); }
.treat-row:hover { border-color: var(--color-primary); }
.treat-row.sel { border-color: var(--color-primary); background: rgba(11,114,255,0.06); }
.treat-dot { flex: none; width: 8px; height: 8px; border-radius: 999px; align-self: center;
  border: 1.5px solid var(--color-border); }
.treat-dot.on { border-color: var(--color-primary); background: var(--color-primary); }
.treat-en { font-size: 10.5px; color: var(--color-text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* "· 12 Buchungen ansehen ▸" — opens the bookings behind a UStVA Kennziffer */
.kz-drill { font-size: 10px; color: var(--color-primary); background: none; border: 0;
  padding: 0; cursor: pointer; font-family: var(--font-mono); }
.kz-drill:hover { text-decoration: underline; }
.kz-chip { font-family: var(--font-mono); font-size: 9.5px; color: var(--color-text-muted);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 10px; padding: 2px 7px; }
.ustva-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
.ustva-period-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.ustva-period-label { flex: 0 1 160px; min-width: 130px; text-align: center; font-size: 14px; font-weight: 600; }
.ustva-period-spacer { flex: 1 1 24px; }
.ustva-table { border-radius: 0; }
.ustva-grid { display: grid; grid-template-columns: 60px minmax(180px, 1fr) 130px 120px; min-width: 520px; gap: 6px; }
.ustva-code-row { align-items: start; padding: 8px 0; border-bottom: 1px solid var(--color-hairline); }
.ustva-payable { display: grid; grid-template-columns: 60px minmax(0, 1fr) 120px; gap: 6px; align-items: center;
  background: var(--color-surface-sunken); margin-top: 10px; padding: 12px 10px; border-radius: 8px; }
.ustva-totals { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 10px; }
.audit-grid { grid-template-columns: 116px 168px minmax(180px, 1fr) 150px; min-width: 650px; cursor: default; align-items: start; }
/* Keyboard hints under the Posteingang worklist */
.kbd-hint { font-size: 10px; color: var(--color-text-faint); }
.kbd-hint kbd { font: inherit; border: 1px solid var(--color-border); border-radius: 4px; padding: 1px 5px; }
.tx-date { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-muted); }
.tx-party { font-size: 12.5px; font-weight: 500; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-purpose { font-size: 11px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-acctline { font-family: var(--font-mono); font-size: 10px; color: var(--color-primary); margin-top: 2px; }
.tx-acctline .vat { color: var(--ift-amber); }
.tx-right { text-align: right; }
.tx-amount { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--color-text); white-space: nowrap; }
.tx-amount.pos { color: var(--ift-success); }
.soll-haben { display: grid; grid-template-columns: 40px 1fr 92px; gap: 6px; align-items: center; font-size: 12px; padding: 6px 0; }
.sh-letter { font-family: var(--font-mono); font-weight: 600; text-align: center; }
.sh-s { color: var(--color-primary); } .sh-h { color: var(--ift-amber); }
.sh-amt { font-family: var(--font-mono); text-align: right; }
.detail-doc {
  background: #fff; border: 1px solid var(--color-border); border-radius: 10px; padding: 16px;
  box-shadow: var(--shadow-md); color: #0A1628;
}
.detail-doc.empty { background: transparent; border: 1.5px dashed var(--color-border); box-shadow: none;
  text-align: center; color: var(--color-text-faint); font-size: 12px; padding: 28px 16px; }
.confidence-row { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.flightprogress { flex: 1; height: 6px; border-radius: 4px; background: var(--color-surface-sunken); overflow: hidden; }
.flightprogress > span { display: block; height: 100%; background: linear-gradient(90deg,#FF9B00,#0B72FF); }

/* Import wizard */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 22px; }
.stepper .step { display: flex; align-items: center; gap: 8px; }
.stepper .num {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: flex;
  align-items: center; justify-content: center; font-family: var(--font-mono);
  font-size: 12px; border: 1.5px solid var(--color-border); color: var(--color-text-faint);
  background: var(--color-surface);
}
.stepper .step.active .num { border-color: var(--color-primary); color: var(--color-primary); background: rgba(11,114,255,0.08); }
.stepper .step.done .num { border-color: var(--ift-success); color: #fff; background: var(--ift-success); }
.stepper .lbl { font-size: 12.5px; color: var(--color-text-muted); }
.stepper .step.active .lbl { color: var(--color-text); font-weight: 500; }
.stepper .conn { flex: 1; height: 1.5px; background: var(--color-border); margin: 0 12px; min-width: 24px; }
.dropzone {
  border: 1.5px dashed var(--color-border); border-radius: 12px; padding: 44px 24px;
  text-align: center; color: var(--color-text-muted); cursor: pointer;
  transition: var(--transition-base); background: var(--color-surface-sunken);
}
.dropzone.drag { border-color: var(--color-primary); background: rgba(11,114,255,0.06); color: var(--color-primary); }
.dropzone .ico { color: var(--color-text-faint); margin-bottom: 10px; }
.preview-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.preview-table th { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-text-faint); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--color-hairline); }
.preview-table td { font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--color-hairline); }
.preview-table td.mono { font-family: var(--font-mono); }
.preview-table td.r { text-align: right; }
.table-scroll {
  max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain;
  border-radius: inherit;
}
.table-scroll:focus-visible { outline-offset: 2px; }
.table-scroll > .preview-table { min-width: 620px; }
.stat-row { display: flex; gap: 24px; margin: 14px 0; }
.stat-row .st .l { font-size: 10px; color: var(--color-text-muted); }
.stat-row .st .v { font-family: var(--font-mono); font-size: 18px; font-weight: 600; color: var(--color-text); }

/* Document grid (Belege) */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
/* Landing view: center the recents + category cards instead of left-stretching.
   Flexbox (not grid auto-fill, which reserves full-width tracks) so the last
   partial row centers too. */
.doc-grid.is-centered, .folder-grid.is-centered {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
}
.doc-grid.is-centered > *, .folder-grid.is-centered > * { width: 220px; flex: 0 0 220px; }
.doc-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-xs); }
.doc-thumb { height: 104px; background: var(--color-surface-sunken); display: flex; align-items: center; justify-content: center; color: var(--color-text-faint); position: relative; }
.doc-thumb .pill { position: absolute; top: 8px; right: 8px; }
.doc-body { padding: 12px 14px; }
.doc-body .fn { font-family: var(--font-mono); font-size: 11px; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-body .meta { font-size: 11px; color: var(--color-text-muted); margin-top: 3px; }
.doc-body .row { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; }
.doc-body .row .amt { font-family: var(--font-mono); font-weight: 600; }

/* Settings */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .set-grid { grid-template-columns: 1fr; } }
.set-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--color-hairline); font-size: 12.5px; }
.set-row:last-child { border-bottom: 0; }
.set-row .k { color: var(--color-text-muted); }
.set-row .v { font-family: var(--font-mono); color: var(--color-text); text-align: right; }

/* ===== Payroll breakdown (per-run, explained) ===== */
.bd-row { display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--color-hairline); font-size: 12.5px; }
.bd-row:last-child { border-bottom: 0; }
.bd-lbl { min-width: 0; }
.bd-en { color: var(--color-text-faint); font-size: 11px; }
.bd-expl { font-family: var(--font-mono); font-size: 10px; line-height: 1.45;
  color: var(--color-text-faint); margin-top: 4px; max-width: 42ch; }
.bd-row .v { font-family: var(--font-mono); color: var(--color-text); text-align: right; white-space: nowrap; }
.bd-sv { display: grid; grid-template-columns: 1fr 94px 94px 94px; gap: 10px; align-items: center; }
.bd-sv-head { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em;
  color: var(--color-text-faint); text-transform: uppercase; padding-bottom: 7px;
  border-bottom: 1px solid var(--color-hairline); }
.bd-sv-row { padding: 10px 0; border-bottom: 1px solid var(--color-hairline); }
.bd-sv-row .mono { font-size: 11.5px; }
.bd-sv-total { padding: 11px 0 2px; font-weight: 600; font-size: 12.5px; }
.bd-sv .r { text-align: right; }
.ps-row { display: grid; grid-template-columns: 1fr 96px 96px; gap: 10px; align-items: baseline;
  padding: 7px 0; font-size: 12.5px; }
.ps-row .k { color: var(--color-text-muted); min-width: 0; }
.ps-row .r { text-align: right; white-space: nowrap; }

/* DATEV code preview */
.code-block { background: var(--ift-navy); color: var(--ift-cloud-muted); border-radius: 10px; padding: 16px; overflow-x: auto; }
.code-block pre { margin: 0; font-family: var(--font-mono); font-size: 10.5px; line-height: 1.7; white-space: pre; color: var(--ift-blue-dark); }

/* Reports */
.report-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; }
@media (max-width: 820px) { .report-layout { grid-template-columns: 1fr; } }
.report-list a { display: block; padding: 11px 13px; border-radius: 8px; text-decoration: none; color: var(--color-text); border: 1px solid var(--color-border); margin-bottom: 8px; background: var(--color-surface); }
.report-list a.active { border-color: var(--color-primary); box-shadow: inset 3px 0 0 var(--color-primary); }
.report-list a .t { font-size: 13px; font-weight: 500; }
.report-list a .s { font-size: 11px; color: var(--color-text-muted); }

/* Stub / empty */
.stub {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 80px 24px; color: var(--color-text-muted);
}
.stub .ico { color: var(--color-text-faint); }
.stub h2 { font-size: 18px; color: var(--color-text); }

/* ===== Auth (centered, navy blueprint) ===== */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 408px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 32px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.auth-card h1 { font-size: 20px; font-weight: 600; margin-top: 18px; }
.auth-card .lead { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }
.auth-foot { font-size: 12px; color: var(--color-text-faint); margin-top: 18px; text-align: center; }
.recovery-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0;
}
.recovery-grid code {
  font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.08em;
  background: var(--color-surface-sunken); border: 1px solid var(--color-border);
  border-radius: 6px; padding: 9px 12px; text-align: center; color: var(--color-text);
}
.qr-box {
  display: flex; justify-content: center; padding: 16px;
  background: #fff; border: 1px solid var(--color-border); border-radius: 10px; margin: 8px 0 4px;
}
.qr-box svg, .qr-box img { width: 188px; height: 188px; }

/* Narrow screens and browser zoom both reduce the CSS viewport. The shell uses
   the same off-canvas treatment for each, keeping the main content at one
   readable column without a page-level horizontal scrollbar. */
@media (max-width: 900px) {
  .ift-app { height: 100dvh; min-height: 100vh; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 110;
    width: min(320px, calc(100vw - 48px)); height: 100dvh;
    transform: translateX(-105%);
    transition: transform var(--duration-base) var(--ease-out);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 100;
    width: 100%; height: 100%; padding: 0; border: 0;
    background: rgba(5, 14, 28, 0.62); cursor: pointer;
  }
  .mobile-nav-toggle { display: inline-flex; }
  .main { width: 100%; }
  .topbar {
    height: auto; min-height: 62px; padding: 10px 12px;
    gap: 8px; flex-wrap: wrap;
  }
  .topbar .titles { min-width: 140px; }
  .search { order: 10; width: 100%; flex-basis: 100%; }
  .search-dropdown { width: min(340px, calc(100vw - 24px)); }
  .content { padding: 16px; }
  .messages { top: 8px; right: 8px; left: 8px; }
  .toast { max-width: none; }
  .card-head { align-items: flex-start; flex-wrap: wrap; }
  .tx-detail {
    flex: 1 1 100%; min-width: 0; width: 100%; position: static;
    max-height: none; overflow: visible;
  }
  .stat-row { flex-wrap: wrap; gap: 14px 24px; }
  .doc-filter-wide { grid-column: 1 / -1; }
  .ustva-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .content { padding: 12px; }
  .card, .card-navy { padding: 16px; }
  .topbar .titles .t { font-size: 15px; }
  .topbar .titles .s { font-size: 10px; }
  .search .kbd { display: none; }
  .period-chip { max-width: 92px; }
  .stepper .lbl { display: none; }
  .stepper .conn { min-width: 12px; margin-inline: 6px; }
  .recovery-grid { grid-template-columns: 1fr; }
  .auth-wrap { padding: 12px; }
  .auth-card { padding: 22px 18px; }
  .ustva-period-spacer { display: none; }
  .ustva-period-label { flex-basis: 130px; }
  .ustva-payable { grid-template-columns: 48px minmax(0, 1fr); }
  .ustva-payable .sh-amt { grid-column: 1 / -1; justify-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
  .view { animation: none; }
}

@media (forced-colors: active) {
  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
  .search:focus-within {
    outline: 2px solid CanvasText !important;
    outline-offset: 2px;
  }
}

