/* Table-Order – gemeinsame Basis: Variablen, Formulare, Buttons, Dialoge */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1c1917;
  --muted: #6b655c;
  --line: #e4dfd5;
  --accent: #0f766e;
  --accent-dark: #0b5a54;
  --accent-soft: #d8efec;
  --danger: #b91c1c;
  --danger-soft: #fde8e8;
  --ok: #15803d;
  --ok-soft: #dcf5e4;
  --warn-soft: #fff3cd;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(28, 25, 23, .06), 0 4px 14px rgba(28, 25, 23, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
a { color: var(--accent-dark); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* Buttons */
.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 44px; padding: .55em 1.1em;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 10px;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { border-color: #cfc8ba; background: #faf8f3; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(15, 118, 110, .45); outline-offset: 2px;
}
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-danger { color: var(--danger); border-color: #f0c4c4; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { min-height: 36px; padding: .3em .8em; font-size: .9rem; border-radius: 8px; }
.btn-block { display: flex; width: 100%; }

/* Formulare */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3em; }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=search],
input[type=date], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: .55em .75em;
  font: inherit; color: inherit; background: #fff;
  border: 1.5px solid var(--line); border-radius: 10px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.field { margin-bottom: 1rem; }
.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; margin-top: .25em; }
.check { display: flex; align-items: center; gap: .55em; font-weight: 500; }
.check input { width: 1.2em; height: 1.2em; accent-color: var(--accent); }

/* Meldungen */
.flash { padding: .75em 1em; border-radius: 10px; margin-bottom: 1rem; font-weight: 500; }
.flash-ok { background: var(--ok-soft); color: #0f5a2a; }
.flash-error { background: var(--danger-soft); color: #8f1515; }
.flash-info { background: var(--accent-soft); color: var(--accent-dark); }

/* Dialog (native <dialog>) */
dialog {
  width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 24px);
  padding: 0; border: 0; border-radius: 16px; color: var(--ink);
  background: var(--surface); box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
dialog::backdrop { background: rgba(20, 16, 12, .55); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; }
.dlg-body { padding: 1rem 1.25rem; overflow: auto; max-height: calc(100vh - 220px); }
.dlg-foot { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; padding: 1rem 1.25rem; border-top: 1px solid var(--line); }

.badge { display: inline-block; padding: .15em .65em; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--line); color: var(--ink); }
.badge-new { background: #111; color: #fff; }
.badge-progress { background: #1d4ed8; color: #fff; }
.badge-ready { background: #dc2626; color: #fff; }
.badge-paid { background: #16a34a; color: #fff; }
.badge-off { background: #e7e2d8; color: var(--muted); }

.itemlist { list-style: none; margin: 0; padding: 0; }
.itemlist li { display: flex; gap: .75rem; justify-content: space-between; padding: .55em 0; border-bottom: 1px dashed var(--line); }
.itemlist li:last-child { border-bottom: 0; }
.itemlist .qty { font-weight: 800; min-width: 2.4em; }
.itemlist .nm { flex: 1; }

/* Einfache Zentrierseiten (Login, Installer, Fehler) */
body.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 1.5rem; }
.card-narrow { width: min(420px, 100%); }
.card-wide { width: min(720px, 100%); }
.brandline { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.15rem; margin-bottom: 1.2rem; }
.brand-mark { color: var(--accent); }
.reqs { list-style: none; padding: 0; margin: 0 0 1rem; }
.reqs li { padding: .3em 0; }
.reqs .ok::before { content: "✔ "; color: var(--ok); }
.reqs .bad::before { content: "✖ "; color: var(--danger); }
.reqs .opt::before { content: "• "; color: var(--muted); }
.grid2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
