/* Vera: Gerüst a Komponenten no dem LuxRP-Admin-Design-System (Tokens, Klassen, Moossen),
   mat Türkis als Interaktiounsfaarf an Orange als zweet Markefaarf aus dem Logo.
   Am Géigesaz zum Admin och fir den Handy. */

@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-latin.woff2') format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/ibm-plex-mono-latin-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }

/* ═══ Tokens ═══ */
:root {
  color-scheme: dark;
  --bg: #05060a; --s1: #0d1017; --s2: #131722; --s3: #191e2c; --s4: #1f2536; --field: #0a0c12;
  --line: #1c2231; --line-2: #262c40; --field-line: #6c759b;
  --t1: #f1f3fa; --t2: #aab2c8; --t3: #8a93b6; --t4: #4f5775;

  /* Türkis = Interaktioun (Primärknäppchen, aktiven Uert, Fokus, Auswiel) */
  --accent: #1fe0e0; --accent-hi: #67f0f0; --accent-ink: #021819;
  --accent-wash: rgba(31, 224, 224, .10); --accent-line: rgba(31, 224, 224, .42);
  --link: var(--accent-hi);
  /* Orange = Mark a Zoufall (Wierfelen, fixéiert, Logo) */
  --orange: #ff8c00; --orange-hi: #ffa53a; --orange-ink: #1f1000;
  --orange-wash: rgba(255, 140, 0, .12); --orange-line: rgba(255, 140, 0, .50);

  --success: #27c481; --success-fill: #27c481; --success-fill-hi: #3fd896; --on-success: #04140c;
  --warning: #f2c94c; --danger: #ff5c6a; --danger-fill: #c4303d; --danger-fill-hi: #d43846; --on-danger: #fff;
  --info: #6cb6ff; --neutral: #aab2c8; --violet: #b197fc;
  --overlay: rgba(5, 6, 10, .70);

  --tint: 12%; --tint-line: 45%;
  --success-wash: color-mix(in srgb, var(--success) var(--tint), transparent);
  --success-line: color-mix(in srgb, var(--success) var(--tint-line), transparent);
  --warning-wash: color-mix(in srgb, var(--warning) var(--tint), transparent);
  --danger-wash: color-mix(in srgb, var(--danger) var(--tint), transparent);
  --danger-line: color-mix(in srgb, var(--danger) var(--tint-line), transparent);
  --info-wash: color-mix(in srgb, var(--info) var(--tint), transparent);
  --neutral-wash: color-mix(in srgb, var(--neutral) 10%, transparent);
  --violet-wash: color-mix(in srgb, var(--violet) 14%, transparent);

  --font-ui: 'Manrope', ui-sans-serif, system-ui, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 24px;
  --lh: 1.45; --lh-tight: 1.25;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;
  --r-1: 3px; --r-2: 5px; --r-3: 8px;
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4);
  --sidebar-w: 232px; --topbar-h: 48px; --row-h: 40px; --control-h: 36px; --btn-h: 32px;
  --page-max: 1600px; --form-max: 720px;
  --dur-1: 100ms; --dur-2: 140ms; --dur-3: 200ms; --dur-4: 240ms;
  --ease: cubic-bezier(.23, 1, .32, 1); --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ═══ Basis ═══ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--t1); font: 400 var(--fs-base)/var(--lh) var(--font-ui); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
table { border-collapse: collapse; width: 100%; }
h1, h2, h3 { line-height: var(--lh-tight); font-weight: 600; }
h1 { font-size: var(--fs-xl); font-weight: 700; line-height: 28px; letter-spacing: -.01em; }
h2 { font-size: var(--fs-lg); line-height: 24px; }
h3 { font-size: var(--fs-base); }
p { max-width: 75ch; }
a { color: var(--link); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-wash); color: var(--t1); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-1); }
html [hidden], html [hidden][class] { display: none; }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--lg { width: 20px; height: 20px; }
.icon--xl { width: 24px; height: 24px; }
.muted { color: var(--t3); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
.skip { position: absolute; left: var(--sp-3); top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-2); font-weight: 600; }
.skip:focus { top: var(--sp-3); }

/* ═══ Gerüst ═══ */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; background: var(--bg); border-right: 1px solid var(--line); z-index: 40; }
.sidebar__brand { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; height: var(--topbar-h); padding: 0 var(--sp-4); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--t1); font-weight: 800; font-size: 17px; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 22px; height: 22px; }
.brand__sub { color: var(--t3); font-weight: 500; font-size: var(--fs-xs); letter-spacing: 0; }
.sidebar__nav { flex: 1; padding: var(--sp-3) var(--sp-2); }
.navgroup + .navgroup { margin-top: var(--sp-4); }
.navgroup__label { padding: 0 var(--sp-3) var(--sp-1); color: var(--t3); font-size: var(--fs-xs); font-weight: 600; }
.navgroup__list { list-style: none; padding: 0; }
.navitem { position: relative; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 var(--sp-3); border-radius: var(--r-2); color: var(--t2); font-size: var(--fs-sm); font-weight: 500; transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.navitem:hover { background: var(--s2); color: var(--t1); text-decoration: none; }
.navitem.is-active { background: var(--s3); color: var(--t1); }
.navitem.is-active::before { content: ''; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 2px; border-radius: 0 2px 2px 0; background: var(--accent); }
.navitem .icon { color: var(--t3); }
.navgroup[data-group="iessen"] .navitem:not(.is-active) .icon { color: var(--orange); }
.navitem:hover .icon, .navitem.is-active .icon { color: var(--t1); }
.navitem__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navitem__badge { min-width: 20px; height: 18px; padding: 0 5px; border-radius: var(--r-1); background: var(--accent); color: var(--accent-ink); font: 500 var(--fs-xs)/18px var(--font-mono); text-align: center; }
.sidebar__foot { display: flex; flex-shrink: 0; align-items: center; gap: var(--sp-1); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); }
.sidebar__me { display: flex; flex: 1; align-items: center; gap: var(--sp-2); min-width: 0; }
.sidebar__user { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sidebar__username { font-weight: 600; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__role { color: var(--t3); font-size: var(--fs-xs); }
.avatar { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--orange-wash); color: var(--orange); font-size: var(--fs-xs); font-weight: 700; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--sp-3); height: var(--topbar-h); padding: 0 var(--sp-6); background: var(--bg); border-bottom: 1px solid var(--line); }
.btn.topbar__menu, .btn.sidebar__close { display: none; }
.topbar__brand { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--t3); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
.crumbs a { color: var(--t3); }
.crumbs a:hover { color: var(--t1); text-decoration: none; }
.crumbs__sep { color: var(--t4); }
.crumbs [aria-current="page"] { overflow: hidden; color: var(--t1); text-overflow: ellipsis; }
.page { width: 100%; max-width: calc(var(--page-max) + 2 * var(--sp-6)); padding: var(--sp-6) var(--sp-6) var(--sp-12); margin: 0 auto; }
.page:focus { outline: none; }
.scrim { display: none; }

/* ═══ Säitekapp, Sektiounen, Panel ═══ */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-6); }
.pagehead__title { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xl); }
.pagehead__tile { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; margin-right: var(--sp-1); border-radius: var(--r-2); background: var(--orange-wash); color: var(--orange); }
.pagehead__tile .icon { width: 18px; height: 18px; }
.pagehead__tile--neutral { background: var(--neutral-wash); color: var(--t2); }
.pagehead__sub { margin-top: var(--sp-1); color: var(--t2); font-size: var(--fs-sm); }
.pagehead__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.section + .section, .section + .panel, .panel + .section, .kpis + .section { margin-top: var(--sp-8); }
.section__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
.section__title { font-size: var(--fs-lg); }
.section__meta { color: var(--t3); font-size: var(--fs-xs); }
.panel { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-3); }
.panel + .panel { margin-top: var(--sp-4); }
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3); min-height: 44px; padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); }
.panel__title { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-base); font-weight: 600; }
.panel__body { padding: var(--sp-4); }
.panel__body--flush { padding: 0; }
.grid { display: grid; gap: var(--sp-4); }
.grid--main-side { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.toolbar__spacer { flex: 1; }

/* ═══ Knäpp ═══ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--btn-h); padding: 0 var(--sp-3); border: 1px solid transparent; border-radius: var(--r-2); font-size: var(--fs-sm); font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none; transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), transform var(--dur-2) var(--ease); }
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hi); }
.btn--orange { background: var(--orange); color: var(--orange-ink); }
.btn--orange:hover { background: var(--orange-hi); }
.btn--secondary { background: var(--s1); border-color: var(--line-2); color: var(--t1); }
.btn--secondary:hover { background: var(--s2); border-color: var(--field-line); }
.btn--ghost { color: var(--t2); }
.btn--ghost:hover { background: var(--s2); color: var(--t1); }
.btn--danger { background: var(--danger-fill); color: var(--on-danger); }
.btn--danger:hover { background: var(--danger-fill-hi); }
.btn--danger-quiet { border-color: var(--line-2); color: var(--danger); }
.btn--danger-quiet:hover { background: var(--danger-wash); }
.btn--success { background: var(--success-wash); color: var(--success); }
.btn--success:hover { background: var(--success-line); }
.btn--sm { height: 28px; padding: 0 var(--sp-2); font-size: var(--fs-xs); }
.btn--lg { height: 40px; padding: 0 var(--sp-4); font-size: var(--fs-base); }
.btn--icon { width: var(--btn-h); padding: 0; }
.btn--sm.btn--icon { width: 28px; }
.btn--block { width: 100%; }
.btn[aria-pressed="true"].btn--toggle-orange { background: var(--orange-wash); color: var(--orange); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn[aria-busy="true"] { position: relative; color: transparent; pointer-events: none; }
.btn[aria-busy="true"] > * { visibility: hidden; }
.btn[aria-busy="true"]::after { content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid var(--t2); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ Badges, Chips ═══ */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: var(--r-1); font-size: var(--fs-xs); font-weight: 500; line-height: 1; white-space: nowrap; background: var(--neutral-wash); color: var(--t2); }
.badge .icon { width: 12px; height: 12px; }
.badge--success { background: var(--success-wash); color: var(--success); }
.badge--warning { background: var(--warning-wash); color: var(--warning); }
.badge--danger { background: var(--danger-wash); color: var(--danger); }
.badge--info { background: var(--info-wash); color: var(--info); }
.badge--accent { background: var(--accent-wash); color: var(--accent); }
.badge--orange { background: var(--orange-wash); color: var(--orange); }
.badge--violet { background: var(--violet-wash); color: var(--violet); }
/* Dauer: Form + Wuert, net nëmme Faarf */
.dur { display: inline-flex; align-items: center; gap: 4px; }
.dur__bars { display: inline-flex; gap: 2px; }
.dur__bars i { width: 3px; height: 9px; border-radius: 1px; background: currentColor; opacity: .25; }
.dur--schnell .dur__bars i:nth-child(-n+1), .dur--mettel .dur__bars i:nth-child(-n+2), .dur--laang .dur__bars i { opacity: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 var(--sp-3); border: 1px solid var(--line-2); border-radius: var(--r-1); background: var(--s1); color: var(--t2); font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; }
.chip:hover { border-color: var(--field-line); color: var(--t1); }
.chip[aria-pressed="true"] { background: var(--s4); border-color: var(--field-line); color: var(--t1); }

/* ═══ Kennzuelen ═══ */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: var(--sp-6); background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 2px; margin: -1px 0 0 -1px; padding: var(--sp-3) 60px var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); border-left: 1px solid var(--line); color: var(--t1); }
a.kpi:hover { background: var(--s2); text-decoration: none; }
.kpi__icon { position: absolute; top: 50%; right: var(--sp-4); display: grid; place-items: center; width: 34px; height: 34px; margin-top: -17px; border-radius: var(--r-2); background: var(--neutral-wash); color: var(--t2); }
.kpi__icon .icon { width: 18px; height: 18px; }
.kpi__icon--success { background: var(--success-wash); color: var(--success); }
.kpi__icon--warning { background: var(--warning-wash); color: var(--warning); }
.kpi__icon--accent { background: var(--accent-wash); color: var(--accent); }
.kpi__icon--orange { background: var(--orange-wash); color: var(--orange); }
.kpi__label { order: -1; color: var(--t2); font-size: var(--fs-xs); font-weight: 500; }
.kpi__value { font: 500 var(--fs-2xl)/32px var(--font-mono); font-variant-numeric: tabular-nums; }
.kpi__value--text { font-family: var(--font-ui); font-size: var(--fs-lg); line-height: 32px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi__hint { color: var(--t3); font-size: var(--fs-xs); }
.kpi--warning .kpi__value { color: var(--warning); }
.kpi--success .kpi__value { color: var(--success); }

/* ═══ Tabellen ═══ */
.table-wrap { overflow-x: auto; }
.table { font-size: var(--fs-sm); }
.table th { height: 36px; padding: 0 var(--sp-3); background: var(--s1); border-bottom: 1px solid var(--line-2); color: var(--t2); font-size: var(--fs-xs); font-weight: 600; text-align: left; white-space: nowrap; }
.table td { height: var(--row-h); padding: var(--sp-1) var(--sp-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: var(--sp-4); }
.table th:last-child, .table td:last-child { padding-right: var(--sp-4); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-id] { cursor: pointer; }
.table tbody tr:hover td { background: var(--s2); }
.table tr.is-muted td { color: var(--t3); }
.table .col-num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.col-num { font-family: inherit; }
.table .col-actions { width: 1%; text-align: right; white-space: nowrap; }
.cell-main { font-weight: 600; color: var(--t1); }
.cell-sub { display: block; color: var(--t3); font-size: var(--fs-xs); }
.cell-clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t2); }

/* ═══ Formulairen ═══ */
.form { display: flex; flex-direction: column; gap: var(--sp-5); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; }
.field__label { color: var(--t1); font-size: var(--fs-sm); font-weight: 500; padding: 0; }
.field__hint { color: var(--t2); font-size: var(--fs-xs); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.input, .select { width: 100%; min-height: var(--control-h); padding: 6px var(--sp-3); background: var(--field); border: 1px solid var(--field-line); border-radius: var(--r-2); color: var(--t1); transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
.input::placeholder { color: var(--t3); }
.input:hover, .select:hover { border-color: var(--t3); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.select { appearance: none; padding-right: 32px; background-image: var(--chevron); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px 16px; }
.input-unit { position: relative; display: flex; align-items: center; }
.input-unit .input { padding-right: 52px; font-family: var(--font-mono); }
.input-unit__unit { position: absolute; right: var(--sp-3); color: var(--t3); font-size: var(--fs-sm); pointer-events: none; }
.input--search { padding-left: 34px; }
.search { position: relative; flex: 1 1 220px; max-width: 320px; }
.search .icon { position: absolute; left: 11px; top: 50%; margin-top: -8px; color: var(--t3); pointer-events: none; }
.check { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 28px; cursor: pointer; font-size: var(--fs-sm); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); }
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 24px; cursor: pointer; font-size: var(--fs-sm); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 32px; height: 18px; border-radius: 9px; background: var(--line-2); box-shadow: inset 0 0 0 1px var(--field-line); transition: background var(--dur-1) var(--ease); flex: none; }
.switch__track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--t2); transition: transform var(--dur-2) var(--ease), background var(--dur-1) var(--ease); }
.switch input:checked + .switch__track { background: var(--accent); box-shadow: none; }
.switch input:checked + .switch__track::after { transform: translateX(14px); background: var(--accent-ink); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus); }
.segmented { display: inline-flex; flex-wrap: wrap; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--s1); }
.segmented > label, .segmented > button { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 var(--sp-3); border-radius: var(--r-1); color: var(--t2); font-size: var(--fs-sm); font-weight: 500; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented > label:has(input:checked), .segmented > [aria-pressed="true"] { background: var(--s4); color: var(--t1); }
.segmented > label:has(input:focus-visible) { box-shadow: var(--focus); }
.segmented > *:hover { color: var(--t1); }
.ing-rows { display: flex; flex-direction: column; gap: var(--sp-2); }
.ing-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 32px; gap: var(--sp-2); align-items: center; }

/* ═══ Notizen, Leerzoustand ═══ */
.notice { display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-2); background: var(--neutral-wash); color: var(--t2); font-size: var(--fs-sm); align-items: flex-start; }
.notice > .icon { margin-top: 2px; }
.notice__body { flex: 1; }
.notice--info { background: var(--info-wash); color: var(--info); }
.notice--success { background: var(--success-wash); color: var(--success); }
.notice--warning { background: var(--warning-wash); color: var(--warning); }
.notice--danger { background: var(--danger-wash); color: var(--danger); }
.notice + * { margin-top: var(--sp-4); }
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding: var(--sp-10) var(--sp-4); text-align: center; color: var(--t2); }
.empty__icon { width: 24px; height: 24px; color: var(--t3); }
.empty__title { color: var(--t1); font-weight: 600; }
.empty__text { font-size: var(--fs-sm); max-width: 44ch; }
.empty .btn { margin-top: var(--sp-2); }
.skeleton { background: var(--s2); border-radius: var(--r-2); min-height: 120px; }

/* ═══ Toasts ═══ */
.toasts { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 200; display: flex; flex-direction: column; gap: var(--sp-2); width: min(400px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); background: var(--s3); border: 1px solid var(--line-2); border-radius: var(--r-2); box-shadow: var(--shadow-pop); color: var(--t1); font-size: var(--fs-sm); cursor: pointer; transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease); }
@starting-style { .toast { opacity: 0; transform: translateY(8px); } }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition-duration: var(--dur-2); }
.toast > .icon { margin-top: 2px; color: var(--t3); }
.toast--success > .icon { color: var(--success); }
.toast--error > .icon { color: var(--danger); }
.toast--info > .icon { color: var(--info); }

/* ═══ Modal ═══ */
.modal { width: min(560px, calc(100vw - 32px)); max-height: min(88vh, 900px); padding: 0; margin: auto; background: var(--s1); color: var(--t1); border: 1px solid var(--line-2); border-radius: var(--r-3); box-shadow: var(--shadow-pop); overflow: hidden; }
.modal--sm { width: min(440px, calc(100vw - 32px)); }
.modal[open] { display: flex; flex-direction: column; animation: modal-in var(--dur-3) var(--ease); }
.modal::backdrop { background: var(--overlay); }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.modal__inner { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--line); }
.modal__title { font-size: var(--fs-lg); }
.modal__body { padding: var(--sp-5); overflow-y: auto; flex: 1; min-height: 0; }
.modal__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); justify-content: flex-end; padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--line); }
.modal__foot .spacer { flex: 1; }
.modal__error { margin-bottom: var(--sp-4); }

/* Rezept-Auswiel (Plang) */
.picklist { display: flex; flex-direction: column; gap: 2px; margin-top: var(--sp-3); }
.pick { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 44px; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-2); text-align: left; }
.pick:hover { background: var(--s2); }
.pick.is-current { background: var(--s4); box-shadow: inset 2px 0 0 var(--accent); }
.pick__name { flex: 1; min-width: 0; font-weight: 600; font-size: var(--fs-sm); }
.pick__meta { display: flex; gap: var(--sp-1); flex-wrap: wrap; justify-content: flex-end; }

/* Akafslëscht */
.shop { list-style: none; padding: 0; }
.shop__item { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); }
.shop__item:last-child { border-bottom: 0; }
.shop__check { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border: 1.5px solid var(--field-line); border-radius: var(--r-2); color: transparent; }
.shop__check:hover { border-color: var(--accent); }
.shop__item.is-bought .shop__check { background: var(--success); border-color: var(--success); color: var(--on-success); }
.shop__item.is-bought .shop__name { color: var(--t3); text-decoration: line-through; }
.shop__text { flex: 1; min-width: 0; }
.shop__name { font-weight: 600; font-size: var(--fs-sm); }
.shop__qty { color: var(--t3); font-size: var(--fs-xs); }
.log { list-style: none; padding: 0; font-size: var(--fs-sm); }
.log li { display: flex; gap: var(--sp-3); align-items: baseline; padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); }
.log li:last-child { border-bottom: 0; }
.log__delta { width: 84px; flex: none; text-align: right; font-family: var(--font-mono); font-size: var(--fs-xs); }
.log__delta.is-plus { color: var(--success); }
.log__delta.is-minus { color: var(--t2); }
.log__text { flex: 1; min-width: 0; }
.log__time { color: var(--t3); font-size: var(--fs-xs); white-space: nowrap; }

/* ═══ Woch (Iessensplang) ═══ */
.weeknav { display: flex; align-items: center; gap: var(--sp-1); }
.weeknav__label { min-width: 150px; text-align: center; font-weight: 600; font-size: var(--fs-sm); }
.planbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-4); }
.planbar__spacer { flex: 1; }
.week-wrap { container-type: inline-size; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--sp-2); }
.day { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.day__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 44px; padding: var(--sp-2) var(--sp-3); background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-3); }
.day__title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.day__name { font-weight: 700; font-size: var(--fs-sm); }
.day__date { color: var(--t3); font-size: var(--fs-xs); font-family: var(--font-mono); }
.day.is-today .day__head { border-color: var(--accent-line); }
.day.is-today .day__name { color: var(--accent); }
.day.is-off .day__head { background: transparent; border-style: dashed; }
.day.is-off .day__name { color: var(--t3); }
.slot { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 140px; padding: var(--sp-2) var(--sp-3) var(--sp-2); background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-3); transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), opacity var(--dur-2) var(--ease); }
.slot__top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-1); min-height: 24px; }
.slot__label { display: flex; align-items: center; gap: 4px; color: var(--t3); font-size: var(--fs-xs); font-weight: 600; }
.slot__label .icon { width: 12px; height: 12px; color: var(--orange); }
.slot__grip { display: grid; place-items: center; width: 28px; height: 28px; margin-right: -6px; border-radius: var(--r-2); color: var(--t3); cursor: grab; touch-action: none; }
.slot__grip:hover { background: var(--s2); color: var(--t1); }
.slot__name { font-weight: 600; font-size: var(--fs-sm); line-height: 1.3; overflow-wrap: anywhere; }
.slot__name--empty { color: var(--t3); font-weight: 500; }
.slot__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--t3); font-size: var(--fs-xs); }
.slot__actions { display: flex; align-items: center; justify-content: space-between; gap: 2px; margin-top: auto; padding-top: var(--sp-1); }
.slot.is-locked { border-color: var(--orange-line); }
.slot.is-off { background: transparent; border-style: dashed; color: var(--t3); }
.slot.is-off .slot__name { color: var(--t3); font-weight: 500; text-decoration: line-through; text-decoration-color: var(--t4); }
.slot.is-cooked { border-color: var(--success-line); }
.slot.is-dragging { opacity: .3; }
.slot.is-over { border-color: var(--accent); background: var(--s2); box-shadow: inset 0 0 0 1px var(--accent); }
.slot.is-flash { animation: flash .5s var(--ease); }
@keyframes flash { from { background: var(--orange-wash); } }
.slot--ghost { position: fixed; left: 0; top: 0; z-index: 300; margin: 0; pointer-events: none; box-shadow: var(--shadow-pop); border-color: var(--accent); opacity: .96; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.slot[data-draggable="1"] { cursor: grab; }
.legend { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); margin-top: var(--sp-3); color: var(--t3); font-size: var(--fs-xs); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }

@container (max-width: 1000px) {
  .week { grid-template-columns: 1fr; gap: var(--sp-3); }
  .day { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
  .day__head { grid-column: 1 / -1; }
  .day__title { flex-direction: row; align-items: baseline; gap: var(--sp-2); }
  .slot { min-height: 120px; }
}

/* ═══ Höhenlinnen-Textur (aus dem LuxRP Admin, a Vera-Faarwen) ═══
   Nëmmen op der Iwwersiicht. Fest am Viewport, 55 % Deckkraft, an der Mëtt méi roueg,
   dozou feint Korn. Inhalt steet a Panelen driwwer. */
body[data-route="home"]::before,
body[data-route="home"]::after { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; }
body[data-route="home"]::before {
  background: url('../img/contours.svg') center / cover no-repeat;
  opacity: .55;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 55% 45%, rgba(0, 0, 0, .45), #000 80%);
  mask-image: radial-gradient(ellipse 70% 60% at 55% 45%, rgba(0, 0, 0, .45), #000 80%);
}
body[data-route="home"]::after { background: url('../img/grain.svg') repeat; background-size: 200px 200px; opacity: .03; }
body[data-route="home"] .shell { position: relative; z-index: 1; }
body[data-route="home"] .topbar { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); }

/* Haut */
.today { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.today .slot { min-height: 96px; }

/* ═══ Umeldung (Bühn) ═══ */
.stage { position: relative; display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: var(--sp-6) var(--sp-4); overflow: hidden; }
.stage::before, .stage::after { content: ''; position: absolute; width: 140vmax; height: 9vmax; transform: rotate(18deg); opacity: .07; pointer-events: none; }
.stage::before { background: var(--orange); top: 18%; left: -20vmax; }
.stage::after { background: #00ffff; top: 34%; left: -24vmax; }
.login { position: relative; z-index: 1; width: min(380px, 100%); }
.login__brand { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-6); text-align: center; }
.login__mark { width: 64px; height: 64px; }
.login__name { font-size: 28px; font-weight: 800; letter-spacing: .14em; }
.login__sub { color: var(--t3); font-size: var(--fs-xs); }
.login .panel__body { padding: var(--sp-6); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ═══ Handy a Tablet ═══ */
@media (max-width: 1100px) {
  .grid--main-side { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform var(--dur-4) var(--ease-drawer); box-shadow: none; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .scrim { position: fixed; inset: 0; z-index: 30; background: var(--overlay); opacity: 0; pointer-events: none; transition: opacity var(--dur-3) var(--ease); display: block; }
  .shell.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 var(--sp-2) 0 var(--sp-2); }
  .btn.topbar__menu, .btn.sidebar__close { display: inline-flex; }
  .topbar__brand { display: flex; margin-left: auto; padding-right: var(--sp-2); }
  .topbar__brand .brand__mark { width: 20px; height: 20px; }
  .page { padding: var(--sp-4) var(--sp-4) var(--sp-12); }
  .pagehead { margin-bottom: var(--sp-4); }
  .pagehead__actions { width: 100%; }
  .pagehead__actions .btn { flex: 1; }
  .btn { height: 36px; }
  .btn--sm { height: 32px; }
  .btn--sm.btn--icon { width: 32px; }
  .input, .select { font-size: 16px; } /* keen Zoom op iOS */
  .grid--2, .field-row { grid-template-columns: 1fr; }
  .modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: var(--r-3) var(--r-3) 0 0; border-bottom: 0; }
  .modal--sm { width: 100vw; }
  /* Tabelle gëtt Kaarteliste */
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
  .table--stack tbody tr:last-child { border-bottom: 0; }
  .table--stack td { height: auto; padding: 2px 0 !important; border: 0; text-align: left !important; }
  .table--stack td[data-label]:not([data-label=""])::before { content: attr(data-label) ': '; color: var(--t3); font-family: var(--font-ui); font-size: var(--fs-xs); }
  .table--stack td.col-actions { width: auto; padding-top: var(--sp-2) !important; }
  .table--stack td.col-actions:empty { display: none; }
  .table--stack .cell-clip { max-width: none; white-space: normal; }
  .table--stack tbody tr:hover td { background: none; }
  .ing-row { grid-template-columns: minmax(0, 1fr) 110px 36px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding-right: var(--sp-3); }
  .kpi__icon { display: none; }
  .weeknav { width: 100%; justify-content: space-between; }
  .planbar .btn-row { width: 100%; }
  .planbar .btn-row .btn { flex: 1; }
  .toasts { left: var(--sp-3); right: var(--sp-3); bottom: var(--sp-3); width: auto; }
  .search { max-width: none; }
}
@media (max-width: 420px) {
  .today { grid-template-columns: 1fr; }
}
