/* WebPOS Verwaltung (zusaetzlich zu app.css) */
.page.page-wide { max-width: 1500px; }

.admin { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.admin-nav {
  position: sticky; top: calc(var(--header-h) + 1rem); max-height: calc(100vh - var(--header-h) - 2rem); overflow-y: auto;
  scrollbar-width: none; -ms-overflow-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .75rem;
}
.admin-nav::-webkit-scrollbar { display: none; }
.nav-group + .nav-group { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--border); }
.nav-title { font-size: .7rem; font-weight: 700; letter-spacing: .08em; color: var(--muted); padding: .4rem .6rem; }
.nav-link { display: block; padding: .6rem .75rem; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; min-height: 44px; }
.nav-link:hover { background: #eef2fb; }
.nav-link.is-active { background: var(--brand); color: #fff; }
.nav-link.is-disabled { color: #9aa4b8; cursor: default; }
.nav-link.is-disabled:hover { background: transparent; }

.admin-main { min-width: 0; }
.admin-main .form-card > .card + .card, .admin-main > .card + .card { margin-top: 1rem; }
.admin-main .form-card + .card { margin-top: 1rem; }

/* Arbeits- und Informationsleiste (AUI): bleibt beim Scrollen direkt unter der Kopfleiste stehen. Suche je Seite, dazu die
   Funktionsschaltflaechen (Neu, Speichern, Bearbeiten usw.). Jede Schaltflaeche hat ein Symbol, eine kurze Beschriftung und
   einen Tooltip (title, ohne JavaScript). */
.aui {
  position: sticky; top: var(--header-h); z-index: 40;
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .5rem .65rem; margin-bottom: 1.25rem;
}
.aui-icon { display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.aui-search { flex: 1 1 200px; min-width: 150px; max-width: 420px; margin: 0; position: relative; display: flex; align-items: center; }
.aui-search .aui-icon { position: absolute; left: .65rem; color: var(--muted); }
.aui-search input[type="search"] { width: 100%; min-height: 44px; padding: .5rem .75rem .5rem 2.3rem; border: 1px solid #c3ccdd; border-radius: 8px; font: inherit; background: #fff; color: var(--text); }
.aui-search input[type="search"]:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.aui-extra { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.aui-extra select, .aui-extra input { min-height: 44px; padding: .4rem .6rem; font: inherit; border: 1px solid #c3ccdd; border-radius: 8px; background: #fff; color: var(--text); }
.aui-actions { display: flex; align-items: stretch; gap: .3rem; margin-left: auto; max-width: 100%; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.aui-actions::-webkit-scrollbar { display: none; }
.aui-btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; flex: 0 0 auto;
  min-width: 58px; min-height: 48px; padding: .3rem .45rem; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--text); text-decoration: none; font: inherit; cursor: pointer; text-align: center;
}
.aui-btn-label { font-size: .64rem; font-weight: 700; line-height: 1; white-space: nowrap; letter-spacing: .01em; }
.aui-btn:hover { background: #eef2fb; }
.aui-btn-primary { background: var(--brand); color: #fff; }
.aui-btn-primary:hover { background: var(--brand-dark); }
.aui-btn-danger { color: var(--danger-text); }
.aui-btn-danger:hover { background: var(--danger-bg); }
.aui-btn.is-disabled, .aui-btn[disabled] { opacity: .4; cursor: not-allowed; pointer-events: none; }
button.aui-btn { font-family: inherit; }

.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; }

@media (max-width: 720px) {
  .aui { gap: .5rem; padding: .5rem; }
  .aui-search { flex: 1 1 100%; max-width: none; order: 1; }
  .aui-extra { flex: 1 1 100%; order: 2; }
  .aui-actions { flex: 1 1 100%; order: 3; margin-left: 0; justify-content: flex-start; }
}

.pagehead { margin-bottom: 1.25rem; }
.pagehead h1 { margin-bottom: .15rem; }
.pagehead p { margin: 0; }
.pagehead-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.pagehead-row > div { min-width: 0; max-width: 60ch; }
.crumbs a { text-decoration: none; }
.pagehead .crumbs { margin-bottom: .35rem; font-size: .9rem; }

.flash { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid transparent; }
.flash-success { background: #e8f6ee; color: #14633a; border-color: #bfe5cf; }
.flash-error { background: var(--danger-bg); color: var(--danger-text); border-color: #f5c6c2; }
.flash-info { background: #eaf1fe; color: #1a3f9c; border-color: #c7d8fa; }
.notice { background: #f0f4fb; border: 1px solid #d5def0; color: #34435f; border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; font-size: .95rem; }

/* Formulare */
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; margin-top: .75rem; }
.field { min-width: 0; }
.field.full, .grid-form > .full { grid-column: 1 / -1; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .95rem; }
.req { color: var(--danger-text); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="url"], .field input[type="date"],
.field input[type="password"], .field input[type="number"], .field select, .field textarea {
  width: 100%; min-height: 46px; padding: .6rem .75rem; font: inherit; color: var(--text);
  background: #fff; border: 1px solid #c3ccdd; border-radius: 8px;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.field input[readonly] { background: #f1f4f9; color: #4a5670; }
.field select:disabled { background: #f1f4f9; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger-text); }
.hint { font-size: .85rem; color: var(--muted); margin-top: .3rem; }
.error { font-size: .875rem; color: var(--danger-text); margin-top: .3rem; font-weight: 600; }
.static { min-height: 46px; display: flex; align-items: center; padding: .6rem .75rem; background: #f1f4f9; border-radius: 8px; }
.check { display: flex; gap: .6rem; align-items: center; font-weight: 600; min-height: 44px; }
.check input { width: 22px; height: 22px; }
.actions { margin-top: 1.25rem; display: flex; gap: .75rem; flex-wrap: wrap; }
.form-inline { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.form-inline .field { flex: 1 1 260px; }

/* Buttons */
.btn-secondary { background: #fff; color: var(--text); border-color: #c3ccdd; }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: .4rem .75rem; font-size: .9rem; min-height: 40px; }
.btn-icon { min-width: 40px; padding-left: .5rem; padding-right: .5rem; }
.btn-link { background: transparent; color: var(--brand); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
button.btn { font-family: inherit; }
.btn-lg { min-height: 48px; }

/* Listen */
.card.table-card { padding: 0; overflow: hidden; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .75rem 1rem; background: #f7f9fc; border-bottom: 1px solid var(--border); }
table.list td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.is-inactive td { color: #7b859a; }
table.list .num { text-align: right; white-space: nowrap; }
table.list .col-actions { text-align: right; white-space: nowrap; }
table.list .col-actions > * { margin-left: .3rem; }
.tax-card table.list th { background: transparent; padding-left: 0; }
.tax-card table.list td { padding-left: 0; }
.indent { display: inline-block; padding-left: 1.5rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; background: #eef1f7; padding: .1rem .35rem; border-radius: 5px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.empty-card { text-align: center; padding: 2rem 1.5rem; }
.empty-card p { margin-top: 0; color: var(--muted); }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; border-radius: 999px; padding: .12rem .65rem; background: #eef1f7; color: #4a5670; }
.badge-ok { background: #e2f5ea; color: #14633a; }
.badge-off { background: #eceff4; color: #6b7588; }
.badge-info { background: #e6eefc; color: #1a3f9c; }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.filters input[type="search"], .filters select { min-height: 44px; padding: .5rem .75rem; font: inherit; border: 1px solid #c3ccdd; border-radius: 8px; background: #fff; }
.filters input[type="search"] { flex: 1 1 240px; }

.tax-card .tax-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.tax-card h2 { margin-bottom: .1rem; }
.tax-card .muted { margin: 0 0 .5rem; }
.tax-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.tax-card.is-inactive { opacity: .75; }
.admin-main .tax-card + .tax-card { margin-top: 1rem; }

dl.kv { display: grid; grid-template-columns: 180px 1fr; gap: .4rem 1rem; margin: .5rem 0 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; }

/* Uebersicht */
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.step { display: flex; gap: .9rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow); min-height: 72px; }
.step:hover { border-color: var(--brand); }
.step-mark { flex: 0 0 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #eef1f7; color: var(--muted); font-weight: 700; }
.step.is-done .step-mark { background: #e2f5ea; color: #14633a; }
.step-body { display: flex; flex-direction: column; min-width: 0; }
.step-name { font-weight: 700; }
.step-text { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }

/* Farbauswahl (kein Inline-Style wegen CSP) */
.palette { display: flex; gap: .5rem; flex-wrap: wrap; }
.swatch-choice { position: relative; cursor: pointer; }
.swatch-choice input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.swatch { display: inline-block; width: 44px; height: 44px; border-radius: 10px; border: 3px solid transparent; box-shadow: 0 0 0 1px var(--border); vertical-align: middle; }
.swatch-choice input:checked + .swatch { border-color: var(--text); }
.swatch-choice input:focus-visible + .swatch { outline: 2px solid var(--brand); outline-offset: 2px; }
.swatch-sm { width: 16px; height: 16px; border-radius: 4px; border-width: 0; margin-right: .25rem; }
.sw-none { background: repeating-linear-gradient(45deg, #fff, #fff 4px, #e5e9f2 4px, #e5e9f2 8px); }
.sw-0 { background: #2563EB; } .sw-1 { background: #0F766E; } .sw-2 { background: #B45309; } .sw-3 { background: #B91C1C; }
.sw-4 { background: #7C3AED; } .sw-5 { background: #BE185D; } .sw-6 { background: #4D7C0F; } .sw-7 { background: #475569; }

/* Autocomplete-Eingabefeld (Typeahead), siehe assets/combo.js. Die Trefferliste ist per Voreinstellung verborgen (erst combo_open zeigt sie). */
.combo_wrap { position: relative; display: flex; align-items: center; }
.combo_input { width: 100%; min-height: 46px; padding: .6rem 2.4rem .6rem .75rem; font: inherit; color: var(--text); background: #fff; border: 1px solid #c3ccdd; border-radius: 8px; }
.combo_input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.combo_clear { position: absolute; right: .35rem; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.combo_clear:hover { background: #eef1f7; color: var(--text); }
.combo_clear .aui-icon { width: 16px; height: 16px; }
.combo_list {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + .3rem); z-index: 20; max-height: 15rem; overflow-y: auto;
  margin: 0; padding: .3rem; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 28px rgba(16, 26, 51, .18);
  scrollbar-width: none; -ms-overflow-style: none;
}
.combo_list::-webkit-scrollbar { display: none; }
.combo_list.combo_open { display: block; }
.combo_item { padding: .55rem .6rem; border-radius: 6px; cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.combo_item:hover, .combo_item.combo_active { background: #eef2fb; }

/* Live-Suche (assets/livesearch.js): Zeilen werden sofort beim Tippen ein-/ausgeblendet, kein Neuladen der Seite. */
.live-hidden { display: none; }
.live-empty-row td { padding: 1.5rem 1rem; text-align: center; }

@media (max-width: 980px) {
  .admin { grid-template-columns: 1fr; }
  .admin-nav { position: static; max-height: none; overflow: visible; display: flex; flex-wrap: wrap; gap: .25rem .75rem; padding: .5rem; }
  .nav-group { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
  .nav-group + .nav-group { margin-top: 0; padding-top: 0; border-top: 0; }
  .nav-title { display: none; }
  .nav-link { padding: .5rem .8rem; }
}
@media (max-width: 720px) {
  .grid-form { grid-template-columns: 1fr; }
  dl.kv { grid-template-columns: 1fr; }
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list tr { padding: .5rem 0; border-bottom: 1px solid var(--border); }
  table.list td { border: 0; padding: .3rem 1rem; text-align: left !important; }
  table.list td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .8rem; }
  table.list .col-actions { padding-top: .5rem; }
  table.list .col-actions > * { margin: 0 .3rem .3rem 0; }
}

/* Kalender-Integration */
.card.table-card .card-pad { padding: 1rem 1rem 0; }
.cal-ops { align-items: center; margin-top: .25rem; }
.card + .card.table-card, .card.table-card + .card { margin-top: 1rem; }
