/* MySmartInvoice 2 – Lumen shell + simple-mode components. Loaded after app.css, uses only tokens from theme.css.
   Rules (docs/REQUIREMENTS.md §2, Sajjad's design rules): one main action per page, advanced options folded away,
   no all-caps labels, no thick coloured left borders, big readable numbers, mobile first for the on-the-road flows. */

/* ---------- shell: quiet sidebar, 7 main items ---------- */
.sidebar { background: var(--sidebar-bg); }
.sidebar .brand { padding: 22px 20px 14px; }
.nav { padding: 6px 12px 16px; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px; color: var(--sidebar-fg); font-weight: 500; font-size: 15px; text-decoration: none; }
.nav a:hover { background: var(--sidebar-hover); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-fg); font-weight: 600; box-shadow: none; }
.nav a .ico { width: 20px; height: 20px; }
.nav .nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--err-bg); color: var(--err); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.sidebar .side-new { display: block; margin: 4px 16px 14px; }
.sidebar .side-new .btn { display: flex; width: 100%; height: 44px; }
.sidebar .side-foot { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 12px 14px; margin-top: auto; border-top: 1px solid var(--sidebar-border); }
.sidebar .side-foot a { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--sidebar-fg-muted); font-size: 14px; }
.side-foot a:hover { background: var(--sidebar-hover); color: var(--text); text-decoration: none; }
.side-foot a.active { color: var(--sidebar-active-fg); background: var(--sidebar-active-bg); }
.topbar { border-bottom: 1px solid transparent; }
.topbar .search { max-width: 420px; flex: 1; }
.content { padding: 24px 28px 48px; max-width: none; margin: 0; }   /* full width – no empty side margins (Sajjad 20.10.2026) */
@media (max-width: 700px) { .content { padding: 18px 16px 96px; } }

/* ---------- mobile: bottom tab bar (Übersicht · Verkauf · + · Ausgaben · Mehr) ---------- */
.tabbar { display: none; }
@media (max-width: 900px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: 600 11px/1 var(--font); color: var(--text-3); background: none; border: 0; text-decoration: none; cursor: pointer; }
  .tabbar a.active { color: var(--accent-text); }
  .tabbar .ico { width: 22px; height: 22px; }
  .tabbar .tab-plus span.plus { width: 48px; height: 48px; border-radius: 16px; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow); margin-top: -10px; }
  .tabbar .tab-plus .ico { width: 24px; height: 24px; }
  .footer-legal { padding-bottom: 80px; }
}

/* ---------- page header: title + one main action ---------- */
.page-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-top h1 { font-size: 28px; font-weight: 700; }
.page-top .sub { color: var(--text-3); margin-top: 4px; }
.page-top .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) { .page-top h1 { font-size: 23px; } .page-top .actions { margin-left: 0; width: 100%; } .page-top .actions .btn-primary { flex: 1; } }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 14px; margin-bottom: 10px; }
.back-link:hover { color: var(--text); text-decoration: none; }

/* ---------- big stat tiles (Übersicht) ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--text); text-decoration: none; }
a.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow); text-decoration: none; }
.stat .lbl { color: var(--text-3); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.stat .lbl .ico { width: 16px; height: 16px; }
.stat .val { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere; }
.stat .foot { font-size: 13px; color: var(--text-3); }
.stat.good .val { color: var(--success); } .stat.bad .val { color: var(--err); } .stat.warn .val { color: var(--warning); }
@media (max-width: 700px) { .stat { padding: 14px 16px; } .stat .val { font-size: 22px; } }

/* ---------- to-do list ("Zu tun") ---------- */
.todo { display: flex; flex-direction: column; }
.todo-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.todo-item:last-child { border-bottom: 0; }
.todo-item:hover { background: var(--surface-2); text-decoration: none; }
.todo-item .t-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-50); color: var(--accent-text); flex: none; }
.todo-item.warn .t-ico { background: var(--warn-bg); color: var(--warn); } .todo-item.bad .t-ico { background: var(--err-bg); color: var(--err); } .todo-item.good .t-ico { background: var(--ok-bg); color: var(--ok); }
.todo-item .t-txt { flex: 1; min-width: 0; } .todo-item .t-txt b { display: block; font-weight: 600; } .todo-item .t-txt span { color: var(--text-3); font-size: 14px; }
.todo-done { padding: 22px 20px; color: var(--text-3); display: flex; gap: 10px; align-items: center; }

/* ---------- simple list rows (instead of wide tables) ---------- */
.rows { display: flex; flex-direction: column; }
.rowx { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; cursor: pointer; }
.rowx:last-child { border-bottom: 0; }
.rowx:hover { background: var(--surface-2); text-decoration: none; }
.rowx .r-main { min-width: 0; } .rowx .r-main b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowx .r-main span { color: var(--text-3); font-size: 14px; }
.rowx .r-side { text-align: right; } .rowx .r-side .amt { font-weight: 700; font-variant-numeric: tabular-nums; display: block; }

/* ---------- filter chips (same look as the status pills: soft accent when on, count as a small badge) ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 12px 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 600 14px/1 var(--font); cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.chip:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip.on { background: var(--accent-50); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-text); box-shadow: none; }
.chip .n { font: 700 12px/1 var(--font); min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text-3); }
.chip.on .n { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
/* search fields in filter bars (contacts, articles, sales, expenses): same height, soft surface, clear focus */
.ct-bar .input-icon input, .sales-search input, .xtoolbar .input-icon input, .toolbar .input-icon input { background: var(--surface); box-shadow: var(--shadow-sm); border-color: var(--border); }
.ct-bar .input-icon input:hover:not(:focus), .sales-search input:hover:not(:focus), .xtoolbar .input-icon input:hover:not(:focus) { border-color: var(--border-strong); }
.ct-bar { padding: 2px 0; }

/* ---------- status dot + word (never colour only) ---------- */
.stx { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.stx::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent); }
.stx.ok { color: var(--ok); } .stx.ok::before { background: var(--ok); }
.stx.warn { color: var(--warn); } .stx.warn::before { background: var(--warning-fill, var(--warn)); }
.stx.bad { color: var(--err); } .stx.bad::before { background: var(--err); }
.stx.info { color: var(--info); } .stx.info::before { background: var(--info); }
.stx.muted { color: var(--text-3); }

/* ---------- "Weitere Optionen" (advanced mode, folded) ---------- */
details.more { border-top: 1px solid var(--border); margin-top: 8px; }
details.more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 14px 0; color: var(--accent-text); font-weight: 600; font-size: 15px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .ico { transition: transform var(--dur) var(--ease); }
details.more[open] > summary .ico { transform: rotate(90deg); }
details.more > .more-body { padding: 4px 0 12px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- timeline (Vorgang) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; display: flex; gap: 14px; padding: 0 0 18px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .tl-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); flex: none; position: relative; z-index: 1; }
.timeline .tl-dot .ico { width: 16px; height: 16px; }
.timeline li.done .tl-dot { background: var(--ok-bg); color: var(--ok); }
.timeline li.now .tl-dot { background: var(--accent); color: #fff; }
.timeline li.next .tl-dot { background: var(--surface); border: 2px dashed var(--border-strong); }
.timeline .tl-body { flex: 1; min-width: 0; padding-top: 5px; }
.timeline .tl-body b { font-weight: 600; } .timeline .tl-body .tl-meta { color: var(--text-3); font-size: 14px; }

/* ---------- next step box ---------- */
.next-step { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: var(--radius-lg); background: var(--accent-50); border: 1px solid var(--accent-100); flex-wrap: wrap; }
.next-step .ns-txt { flex: 1; min-width: 200px; } .next-step .ns-txt b { display: block; }

/* ---------- choice tiles (onboarding, "+ Neu", settings toggles) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; text-decoration: none; }
.tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow); text-decoration: none; }
.tile.on, .tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-50); }
.tile .tile-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.tile.on .tile-ico { background: var(--accent); color: #fff; }
.tile b { font-weight: 600; } .tile span { color: var(--text-3); font-size: 14px; }

/* ---------- module switch rows (settings → "Ablauf anpassen") ---------- */
.switch-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: 0; }
.switch-row .sw-txt { flex: 1; min-width: 0; } .switch-row .sw-txt b { display: block; font-weight: 600; } .switch-row .sw-txt span { color: var(--text-3); font-size: 14px; }

/* ---------- wizard (onboarding) ---------- */
.wizard { max-width: 640px; margin: 0 auto; }
.wizard-steps { display: flex; gap: 6px; margin-bottom: 22px; }
.wizard-steps i { flex: 1; height: 5px; border-radius: 99px; background: var(--surface-3); }
.wizard-steps i.on { background: var(--accent); }

/* ---------- document editor (simple) ---------- */
.doc-lines { display: flex; flex-direction: column; gap: 10px; }
.doc-line { display: grid; grid-template-columns: minmax(0, 1fr) 90px 120px 120px 36px; gap: 10px; align-items: start; }
.doc-line .lt { font-weight: 700; text-align: right; padding-top: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .doc-line { grid-template-columns: 1fr 1fr; } .doc-line > :first-child { grid-column: 1 / -1; } .doc-line .lt { text-align: left; } }
.totals { margin-left: auto; width: min(360px, 100%); display: flex; flex-direction: column; gap: 6px; }
.totals div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.totals .grand { font-size: 20px; font-weight: 700; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 10; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
@media (max-width: 900px) { .sticky-actions { bottom: calc(64px + env(safe-area-inset-bottom)); } .sticky-actions .btn-primary { flex: 1; } }

/* ---------- combobox (customer / article picker with "create new") ---------- */
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto; }
.combo-list button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 10px 12px; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.combo-list button:hover, .combo-list button.sel { background: var(--surface-3); }
.combo-list button .xs { margin-left: auto; }

/* ---------- section card with title ---------- */
.sec-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.sec-card > h2, .sec-card > .sc-head { font-size: 17px; font-weight: 600; padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.sec-card > .sc-body { padding: 18px 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- explain hint for technical words ---------- */
.explain { color: var(--text-3); font-size: 13px; }
.term { border-bottom: 1px dotted var(--text-3); cursor: help; }

/* ---------- simple bar chart (CSS, Einnahmen/Ausgaben) ---------- */
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; align-items: end; height: 180px; padding-top: 8px; }
.bars .b { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .b .pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bars .b i { display: block; width: 40%; max-width: 16px; border-radius: 4px 4px 0 0; background: var(--accent); min-height: 2px; }
.bars .b i.out { background: var(--border-strong); }
.bars .b small { font-size: 11px; color: var(--text-3); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); margin-right: 6px; vertical-align: -1px; }
.legend i.out { background: var(--border-strong); }

/* ---------- Lumen navigation: groups + sub-pages on a thin guide line (sub-pages shown for the active item) ---------- */
.nav-sec { padding: 16px 12px 6px; font-size: 12.5px; font-weight: 600; color: var(--sidebar-fg-muted); letter-spacing: .01em; }
.nav-sec:first-child { padding-top: 4px; }
.nav-item { display: flex; flex-direction: column; }
.nav-item > a { position: relative; }
.nav-item > a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-sub { display: none; flex-direction: column; margin: 2px 0 6px 21px; padding-left: 0; border-left: 1px solid var(--border-strong); }
.nav-item.open .nav-sub { display: flex; }
.nav .nav-sub a { position: relative; height: 34px; padding: 0 12px 0 18px; margin-left: 0; border-radius: 0 8px 8px 0; font-size: 14px; font-weight: 500; color: var(--sidebar-fg-muted); gap: 0; }
.nav .nav-sub a:hover { background: var(--sidebar-hover); color: var(--text); }
.nav .nav-sub a.active { color: var(--sidebar-active-fg); background: transparent; font-weight: 600; }
.nav .nav-sub a.active::before { content: ""; position: absolute; left: -1px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--accent); }

/* =====================================================================
   DESIGN CONCEPTS (Lumen idea: same app, different product directions) – <html data-concept="…">, chosen per user
   saas = calm, airy, light top bar (default) · enterprise = dark app bar, compact, governed · glass = translucent layers,
   gradient hero, big radius · mobile = touch first, big targets, bottom tab bar also on desktop
   ===================================================================== */
/* enterprise */
[data-concept="enterprise"] { --pad: 13px; --row-h: 44px; --ctrl-h: 40px; --radius-card: 8px; --radius-control: 6px; --radius-button: 6px; --radius-lg: 8px; --radius: 6px; --radius-btn: 6px; }
[data-concept="enterprise"] .topbar { background: #0F172A; border-bottom: 0; color: #E2E8F0; height: 56px; }
[data-concept="enterprise"] .topbar .search { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #CBD5E1 !important; }
[data-concept="enterprise"] .topbar .btn-ghost { color: #E2E8F0; } [data-concept="enterprise"] .topbar .btn-ghost:hover { background: rgba(255, 255, 255, .1); }
[data-concept="enterprise"] .topbar .kbd { background: transparent; color: #CBD5E1; border-color: rgba(255, 255, 255, .3); }
[data-concept="enterprise"] .sidebar .brand { background: #0F172A; padding: 13px 20px; }
[data-concept="enterprise"] .sidebar .brand .logo { --logo-word: #fff; --logo-word-2: #F7B500; }
[data-concept="enterprise"] .nav a { height: 36px; font-size: 14px; }
[data-concept="enterprise"] .content { padding-top: 22px; }
[data-concept="enterprise"] .page-top h1 { font-size: 24px; }
[data-concept="enterprise"] .stat .val { font-size: 24px; }
[data-concept="enterprise"] .rowx { padding: 10px 16px; }
/* glass */
[data-concept="glass"] { --radius-card: 20px; --radius-lg: 20px; --radius-button: 999px; --radius-btn: 999px; --radius-control: 14px; --radius: 14px; }
[data-concept="glass"] body { background: radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
  radial-gradient(900px 500px at -10% 30%, color-mix(in srgb, var(--brand-teal) 16%, transparent), transparent 60%), var(--bg); background-attachment: fixed; }
[data-concept="glass"] .sidebar { background: color-mix(in srgb, var(--surface) 62%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-right-color: color-mix(in srgb, var(--border) 60%, transparent); }
[data-concept="glass"] .topbar { background: transparent; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
[data-concept="glass"] .sec-card, [data-concept="glass"] .stat, [data-concept="glass"] .card, [data-concept="glass"] .tile { background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: color-mix(in srgb, var(--border) 70%, transparent); box-shadow: 0 8px 30px rgba(15, 23, 42, .06); }
[data-concept="glass"] .stats .stat:first-child { background: var(--brand-gradient); color: #fff; border: 0; }
[data-concept="glass"] .stats .stat:first-child .lbl, [data-concept="glass"] .stats .stat:first-child .foot { color: rgba(255, 255, 255, .85); }
[data-concept="glass"] .stat .val { font-size: 32px; }
[data-concept="glass"] .page-top h1 { font-size: 32px; letter-spacing: -.03em; }
/* mobile first */
[data-concept="mobile"] { --ctrl-h: 50px; --row-h: 60px; --fs: 17px; --radius-card: 16px; --radius-lg: 16px; }
[data-concept="mobile"] .nav a { height: 50px; font-size: 16px; }
[data-concept="mobile"] .btn { min-height: 48px; }
[data-concept="mobile"] .rowx { padding: 18px 20px; }
[data-concept="mobile"] .chip { height: 40px; padding: 0 18px; }
@media (min-width: 901px) {
  [data-concept="mobile"] .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; width: min(560px, calc(100% - 32px));
    height: 68px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lg); z-index: 40; }
  [data-concept="mobile"] .tabbar a, [data-concept="mobile"] .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: 600 12px/1 var(--font); color: var(--text-3); background: none; border: 0; cursor: pointer; text-decoration: none; }
  [data-concept="mobile"] .tabbar a.active { color: var(--accent-text); }
  [data-concept="mobile"] .tabbar .tab-plus span.plus { width: 50px; height: 50px; border-radius: 16px; background: var(--accent); color: #fff; display: grid; place-items: center; margin-top: -14px; box-shadow: var(--shadow); }
  [data-concept="mobile"] .content { padding-bottom: 120px; }
}

/* =====================================================================
   Collapsible sidebar (Hassan #7): desktop only. Toggle next to the logo; collapsed = icon rail with floating tooltips (.rail-tip),
   active item + overdue badge stay visible, company switcher and "+ Neu" become icons. Mobile (≤ 960 px) keeps drawer + tab bar.
   ===================================================================== */
.side-top { display: flex; align-items: center; gap: 4px; padding-right: 12px; }
.side-top .brand { flex: 1; min-width: 0; }
.side-toggle { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; color: var(--sidebar-fg-muted); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.side-toggle:hover { background: var(--sidebar-hover); color: var(--text); }
.side-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.side-toggle .ico { width: 19px; height: 19px; }
.side-toggle .tg-chev { transform-box: fill-box; transform-origin: center; transition: transform var(--dur) var(--ease); }
[data-concept="enterprise"] .sidebar .side-top { background: #0F172A; }
[data-concept="enterprise"] .side-toggle { color: #CBD5E1; } [data-concept="enterprise"] .side-toggle:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.rail-tip { position: fixed; z-index: 120; transform: translateY(-50%); padding: 6px 10px; border-radius: 8px; background: var(--text-primary); color: var(--bg-page); font: 600 13px/1.2 var(--font);
  white-space: nowrap; pointer-events: none; box-shadow: 0 4px 12px rgba(13, 25, 48, .18); animation: fade var(--dur-fast) var(--ease); }
.rail-tip::before { content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; background: inherit; transform: translateY(-50%) rotate(45deg); border-radius: 1px; }
@media (max-width: 960px) { .side-toggle { display: none; } .rail-tip { display: none; } }
@media (min-width: 961px) {
  .shell { transition: grid-template-columns var(--dur) var(--ease); }
  .shell.is-rail { grid-template-columns: 76px minmax(0, 1fr); }
  .shell.is-rail .sidebar { overflow-x: hidden; }
  /* labels stay in the DOM for screen readers (visually hidden), tooltips show them on hover/focus */
  .shell.is-rail .nav a > span:not(.nav-badge), .shell.is-rail .side-foot a > span, .shell.is-rail .admin-zone a > span, .shell.is-rail .side-new .btn > span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .shell.is-rail .side-top { flex-direction: column; align-items: center; gap: 6px; padding: 16px 0 10px; }
  .shell.is-rail .side-top .brand { padding: 0; flex: none; }
  .shell.is-rail .brand .logo-text { display: none; }
  .shell.is-rail .side-toggle .tg-chev { transform: rotate(180deg); }
  .shell.is-rail .workspace { margin: 0 12px 10px; padding: 9px; justify-content: center; gap: 0; }
  .shell.is-rail .workspace > div, .shell.is-rail .workspace .ws-chev { display: none; }
  .shell.is-rail .sidebar .side-new { margin: 0 16px 12px; }
  .shell.is-rail .sidebar .side-new .btn { width: 44px; padding: 0; justify-content: center; gap: 0; }
  .shell.is-rail .nav a { padding: 0 16px; gap: 0; }
  .shell.is-rail .nav .nav-badge { position: absolute; top: 3px; left: 29px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; margin: 0; background: var(--danger-fill); color: #fff; box-shadow: 0 0 0 2px var(--sidebar-bg); }
  .shell.is-rail .nav-sec { height: 1px; padding: 0; margin: 12px 14px; background: var(--sidebar-border); font-size: 0; overflow: hidden; }
  .shell.is-rail .nav-sec:first-child { margin-top: 2px; }
  .shell.is-rail .nav-item.open .nav-sub { display: none; }
  .shell.is-rail .sidebar .side-foot { padding: 10px 12px 14px; }
  .shell.is-rail .sidebar .side-foot a { padding: 0 16px; gap: 0; }
  .shell.is-rail .admin-zone a { justify-content: center; }
  .ws-pop.ws-pop-rail { position: fixed; right: auto; width: 290px; z-index: 70; }
}

/* =====================================================================
   "Ungespeicherte Änderungen" bar (ui.js dirtyBar, Hassan #6): lies over the sticky top bar, calm accent tint, Verwerfen + Speichern
   ===================================================================== */
.dirty-bar { position: absolute; inset: 8px 16px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 0 8px 0 12px; border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border)); box-shadow: var(--shadow);
  animation: db-in var(--dur) var(--ease); }
.dirty-bar.is-floating { position: fixed; inset: auto 16px auto 16px; top: 12px; height: 52px; z-index: 90; }
.dirty-bar .db-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); }
.dirty-bar .db-ico .ico { width: 17px; height: 17px; }
.dirty-bar .db-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.dirty-bar .db-txt b { font-weight: 650; font-size: 14.5px; color: var(--text); }
.dirty-bar .db-sub { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dirty-bar .db-act { display: flex; gap: 8px; flex: none; }
.dirty-bar .btn[hidden] { display: none; }
.dirty-bar.is-saved { background: color-mix(in srgb, var(--ok) 8%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 28%, var(--border)); }
.dirty-bar.is-saved .db-ico { background: var(--ok-bg); color: var(--ok); }
.dirty-bar.out { opacity: 0; transform: translateY(-4px); transition: opacity .2s ease, transform .2s ease; }
@keyframes db-in { from { opacity: 0; transform: translateY(-6px); } }
[data-concept="enterprise"] .dirty-bar { inset: 6px 12px; }
@media (max-width: 700px) {
  .dirty-bar { inset: 6px 8px; gap: 8px; padding: 0 6px 0 8px; }
  .dirty-bar .db-sub { display: none; }
  .dirty-bar .db-ico { display: none; }
  .dirty-bar .db-txt b { font-size: 13.5px; }
  .dirty-bar .btn-sm { padding: 0 10px; }
  .dirty-bar [data-db-discard] .ico { display: none; }
  .topbar .dirty-bar .btn-primary span { display: inline; } .topbar .dirty-bar .btn-primary.btn-sm { width: auto; padding: 0 12px; }   /* pages.css hides top-bar button texts on phones */
}
@media (max-width: 380px) { .dirty-bar [data-db-save] .ico { display: none; } }

/* =====================================================================
   Form errors (ui.js formError, Hassan #10): summary at the top of the form with links to each field; red field state + message
   ===================================================================== */
.form-error { margin-bottom: 4px; scroll-margin-top: 96px; grid-column: 1 / -1; }
.form-error:focus { outline: none; }
.form-error .fe-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.form-error .fe-title { font-weight: 600; }
.form-error .fe-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.form-error .fe-list button { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; width: 100%; padding: 6px 8px; margin: 0 -8px; border: 0; border-radius: 8px; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer; }
.form-error .fe-list button:hover, .form-error .fe-list button:focus-visible { background: color-mix(in srgb, var(--err) 9%, transparent); outline: none; }
.form-error .fe-lbl { font-weight: 600; color: var(--text); }
.form-error .fe-msg { color: inherit; }
.form-error .fe-go { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--err); white-space: nowrap; }
.form-error .fe-go .ico { width: 14px; height: 14px; }
.form-error .fe-done { opacity: .55; } .form-error .fe-done .fe-lbl { text-decoration: line-through; }
label.field.has-error > span:first-child, .field.has-error > span:first-child { color: var(--err); }
.field-error { display: flex; align-items: flex-start; gap: 5px; margin-top: 1px; font-size: 12.5px; line-height: 1.35; }
.field-error::before { content: "!"; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--err); color: var(--surface); font: 800 10px/14px var(--font); text-align: center; margin-top: 1px; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { background: color-mix(in srgb, var(--err) 4%, var(--surface)); }
input[aria-invalid="true"]:focus, select[aria-invalid="true"]:focus, textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 22%, transparent); border-color: var(--err); }
.field-flash { animation: field-flash 1.6s var(--ease); border-radius: 10px; }
@keyframes field-flash { 0%, 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); } 100% { box-shadow: 0 0 0 4px transparent; } }

/* =====================================================================
   Creatable LOV (ui.js lov/bindLov, Hassan #8): select-like button, search, own values with soft colour chips
   ===================================================================== */
.lov { position: relative; min-width: 0; }
.lov-btn { width: 100%; height: var(--ctrl-h); display: flex; align-items: center; gap: 8px; padding: 0 10px 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: 400 var(--fs)/1.4 var(--font); text-align: left; cursor: pointer; transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.lov-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--border-strong) 60%, var(--text-3)); }
.lov-btn:focus-visible, .lov-btn[aria-expanded="true"] { border-color: var(--focus); box-shadow: var(--focus-ring); outline: none; }
.lov-btn:disabled { background: var(--disabled-bg); color: var(--disabled-fg); border-color: var(--disabled-border); cursor: not-allowed; }
.lov-btn .lov-val { flex: 1; min-width: 0; display: flex; overflow: hidden; }
.lov-btn .lov-ph { color: var(--text-3); padding-left: 4px; }
.lov-btn .lov-chev { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.lov-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop var(--dur-fast) var(--ease); }
.lov-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--border); }
.lov-search .ico { width: 16px; height: 16px; color: var(--text-3); }
.lov-search input { border: 0; box-shadow: none !important; padding: 0; height: 42px; background: transparent; }
.lov-list { max-height: 260px; overflow-y: auto; padding: 6px; }
.lov-opt { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.lov-opt.sel, .lov-opt:hover { background: var(--surface-3); }
.lov-opt .lov-on { width: 16px; height: 16px; color: var(--accent); margin-left: auto; }
.lov-opt.lov-add { color: var(--accent-text); font-weight: 600; border-top: 1px dashed var(--border); border-radius: 0 0 8px 8px; margin-top: 4px; padding-top: 8px; }
.lov-opt.lov-add .ico { width: 16px; height: 16px; }
.lov-none { padding: 12px 10px; color: var(--text-3); font-size: 14px; }
.lov-new { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.lov-new[hidden], .lov-search[hidden] { display: none; }
.lov-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.lov-sw { width: 28px; height: 28px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--lc) 16%, var(--surface)); cursor: pointer;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lc) 35%, transparent); }
.lov-sw i { width: 12px; height: 12px; border-radius: 50%; background: var(--lc); }
.lov-sw[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--lc); }
.lov-sw:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.lov-new-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lov-new-act { margin-left: auto; display: flex; gap: 6px; }
/* soft colour chip: dot + text on a light tint (also usable in lists: ui.js lovChip) */
.lov-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 26px; padding: 0 10px 0 9px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; background: color-mix(in srgb, var(--lc) 13%, var(--surface)); color: color-mix(in srgb, var(--lc) 62%, var(--text));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lc) 22%, transparent); }
.lov-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--lc); flex: none; }
.lc-slate { --lc: #64748B; } .lc-blue { --lc: #2F7DE1; } .lc-teal { --lc: #0E9488; } .lc-green { --lc: #2F9E5B; }
.lc-amber { --lc: #C99A06; } .lc-orange { --lc: #E07B39; } .lc-rose { --lc: #D9467A; } .lc-violet { --lc: #7C5CDB; }
[data-mode="dark"] .lc-slate { --lc: #94A3B8; } [data-mode="dark"] .lc-blue { --lc: #6AA8F7; } [data-mode="dark"] .lc-teal { --lc: #3CC7B6; } [data-mode="dark"] .lc-green { --lc: #5BC584; }
[data-mode="dark"] .lc-amber { --lc: #E8C14A; } [data-mode="dark"] .lc-orange { --lc: #F39A5E; } [data-mode="dark"] .lc-rose { --lc: #F07AA2; } [data-mode="dark"] .lc-violet { --lc: #A78BFA; }
.dirty-bar.is-saved [data-db-save]:disabled { background: var(--ok-bg); border-color: transparent; color: var(--ok); opacity: 1; }
