/*
 * Comdat Ansagen – styles following Comdat-EDV-Systeme/comdat-erp docs/design.md.
 * Section 2 (design tokens) is copied 1:1. Components use only these variables.
 */

/* ------------------------------------------------------------------ tokens: light */
:root {
  /* Marke (aus dem Comdat-Logo) */
  --brand: #0f6baf;
  --brand-600: #0c5a94;   /* Hover */
  --brand-700: #0a4a7a;   /* Text auf hellem Blau, aktive Navigation */
  --brand-50: #eef5fc;    /* zarter Hintergrund: aktiv, ausgewählt */
  --brand-100: #d7e8f7;   /* Rahmen/Hover auf hellem Blau */

  /* Flächen */
  --bg: #f4f6f9;          /* Seitenhintergrund */
  --surface: #ffffff;     /* Karten, Seitenleiste */
  --surface-2: #f9fafb;   /* Tabellenkopf, Hover, Fußzeilen */
  --surface-3: #eef1f5;   /* Reiter-Hintergrund, neutrale Abzeichen */
  --input-bg: #ffffff;
  --topbar-bg: rgba(255, 255, 255, .92);
  --row-hover: #fafbfd;
  --unread-bg: #f5f9fe;

  /* Rahmen und Text */
  --border: #e4e8ee;
  --border-strong: #cdd5df;   /* Eingabefelder, sekundäre Buttons */
  --text: #101828;
  --text-2: #344054;          /* Labels, Navigation */
  --muted: #667085;           /* Hinweise, Spaltenköpfe */

  /* Zustände: Farbe, Hintergrund, Rahmen, Text */
  --ok: #067647;    --ok-bg: #ecfdf3;    --ok-border: #abefc6;    --ok-text: #085d3a;
  --warn: #b54708;  --warn-bg: #fffaeb;  --warn-border: #fedf89;  --warn-text: #93370d;
  --error: #c0362c; --error-bg: #fef3f2; --error-border: #fecdca; --error-text: #912018;
  --info-bg: #eff8ff; --info-border: #b2ddff; --info-text: #194185; --info-strong: #175cd3;
  --purple: #6941c6; --purple-bg: #f4f3ff;   /* z. B. Status „Wartet“ */

  /* Diagramme */
  --series-1: #2a78d6; --series-2: #eb6834; --chart-grid: #e4e8ee;

  /* Form */
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .22), 0 4px 8px -4px rgba(16, 24, 40, .08);
  --focus: 0 0 0 3px rgba(15, 107, 175, .22);
  --sidebar-w: 264px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

/* ------------------------------------------------------------------ tokens: dark */
html[data-theme="dark"] {
  --brand: #3b8fd6; --brand-600: #2f7fc4; --brand-700: #9ccaf2;
  --brand-50: rgba(59, 143, 214, .14); --brand-100: rgba(59, 143, 214, .3);
  --bg: #0e1318; --surface: #161c23; --surface-2: #1c232b; --surface-3: #242c36;
  --input-bg: #11171d; --topbar-bg: rgba(22, 28, 35, .9); --row-hover: #1a2129;
  --unread-bg: rgba(59, 143, 214, .08);
  --border: #29323d; --border-strong: #3a4553;
  --text: #e6edf3; --text-2: #c2ccd6; --muted: #8d99a7;
  --ok: #47cd89;    --ok-bg: rgba(23, 178, 106, .14);  --ok-border: rgba(23, 178, 106, .35);  --ok-text: #a6f4c5;
  --warn: #fdb022;  --warn-bg: rgba(247, 144, 9, .14); --warn-border: rgba(247, 144, 9, .35); --warn-text: #fedf89;
  --error: #f97066; --error-bg: rgba(240, 68, 56, .14); --error-border: rgba(240, 68, 56, .4); --error-text: #fecdca;
  --info-bg: rgba(46, 144, 250, .14); --info-border: rgba(46, 144, 250, .35); --info-text: #b2ddff; --info-strong: #84caff;
  --purple: #bda6f9; --purple-bg: rgba(122, 90, 248, .16);
  --series-1: #3987e5; --series-2: #d95926; --chart-grid: #29323d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 1px 3px rgba(0, 0, 0, .45);
  --shadow-lg: 0 16px 36px -8px rgba(0, 0, 0, .65);
  --focus: 0 0 0 3px rgba(59, 143, 214, .35);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --brand: #3b8fd6; --brand-600: #2f7fc4; --brand-700: #9ccaf2;
    --brand-50: rgba(59, 143, 214, .14); --brand-100: rgba(59, 143, 214, .3);
    --bg: #0e1318; --surface: #161c23; --surface-2: #1c232b; --surface-3: #242c36;
    --input-bg: #11171d; --topbar-bg: rgba(22, 28, 35, .9); --row-hover: #1a2129;
    --unread-bg: rgba(59, 143, 214, .08);
    --border: #29323d; --border-strong: #3a4553;
    --text: #e6edf3; --text-2: #c2ccd6; --muted: #8d99a7;
    --ok: #47cd89;    --ok-bg: rgba(23, 178, 106, .14);  --ok-border: rgba(23, 178, 106, .35);  --ok-text: #a6f4c5;
    --warn: #fdb022;  --warn-bg: rgba(247, 144, 9, .14); --warn-border: rgba(247, 144, 9, .35); --warn-text: #fedf89;
    --error: #f97066; --error-bg: rgba(240, 68, 56, .14); --error-border: rgba(240, 68, 56, .4); --error-text: #fecdca;
    --info-bg: rgba(46, 144, 250, .14); --info-border: rgba(46, 144, 250, .35); --info-text: #b2ddff; --info-strong: #84caff;
    --purple: #bda6f9; --purple-bg: rgba(122, 90, 248, .16);
    --series-1: #3987e5; --series-2: #d95926; --chart-grid: #29323d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow: 0 1px 3px rgba(0, 0, 0, .45);
    --shadow-lg: 0 16px 36px -8px rgba(0, 0, 0, .65);
    --focus: 0 0 0 3px rgba(59, 143, 214, .35);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg);
}
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; margin: 0; line-height: 1.25; }
h2 { font-size: 1.05rem; font-weight: 650; margin: 0; }
h3 { font-size: .95rem; font-weight: 650; margin: 0; }
p { margin: 0 0 .75rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.muted { color: var(--muted); }
.hint { font-size: .85rem; color: var(--muted); }
.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;
}
kbd {
  font-family: var(--mono); font-size: .78rem; padding: .05rem .35rem; border-radius: 5px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface-2);
}
code, .mono { font-family: var(--mono); font-size: .88em; }

.icon {
  width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em;
}

/* Logo switch: light logo in light mode, dark logo in dark mode. */
img.logo-dark { display: none; }
html[data-theme="dark"] img.logo-light { display: none; }
html[data-theme="dark"] img.logo-dark { display: inline-block; }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] img.logo-light { display: none; }
  html[data-theme="system"] img.logo-dark { display: inline-block; }
}

/* ------------------------------------------------------------------ layout */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem 1rem 1rem;
  background: var(--surface); border-right: 1px solid var(--border);
}
.sidebar-brand { display: block; }
.sidebar-brand img { height: 30px; width: auto; }
.sidebar-brand .app-name {
  display: block; margin-top: .45rem; font-size: .72rem; font-weight: 650; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.sidebar .button.primary-action { width: 100%; }
.nav { display: flex; flex-direction: column; gap: .15rem; }
.nav-group-title {
  margin: .75rem .75rem .25rem; font-size: .72rem; font-weight: 650; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.nav a, .nav .nav-disabled {
  display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; border-radius: 8px;
  color: var(--text-2); font-weight: 550; text-decoration: none;
}
.nav a .icon, .nav .nav-disabled .icon { width: 1.2rem; height: 1.2rem; color: var(--muted); }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--brand-50); color: var(--brand-700); }
.nav a[aria-current="page"] .icon { color: var(--brand); }
.nav .nav-disabled { color: var(--muted); cursor: default; }
.nav .pill { margin-left: auto; }

.sidebar-user { margin-top: auto; border-top: 1px solid var(--border); padding-top: .9rem; }
.user-row { display: flex; align-items: center; gap: .65rem; }
.user-row .name { font-weight: 600; line-height: 1.2; }
.user-row .role { font-size: .8rem; color: var(--muted); }
.sidebar-user form { margin-top: .5rem; }

.main { margin-left: var(--sidebar-w); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: .75rem;
  padding: 0 1.25rem; background: var(--topbar-bg); border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px);
}
.topbar .spacer { flex: 1; }
.topbar .tenant-badge { font-weight: 600; color: var(--text-2); }
.search {
  position: relative; flex: 1; max-width: 34rem;
}
.search .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; height: 38px; border-radius: 999px; padding: 0 1rem 0 2.4rem;
  border: 1px solid var(--border-strong); background: var(--input-bg); color: var(--text);
  font: inherit;
}
.search input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }

.page { max-width: 1600px; padding: 1.75rem 2rem 3rem; }
.page.narrow { max-width: 760px; }
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-head .subtitle { margin: .3rem 0 0; color: var(--muted); font-size: .95rem; }
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 1.25rem; }

.nav-backdrop { display: none; }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem; box-shadow: var(--shadow-sm);
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.card-head h2 { display: flex; align-items: center; gap: .5rem; }
.card-head h2 .icon { color: var(--muted); }

.empty { text-align: center; padding: 1.5rem 1rem; }
.empty .icon { width: 2.4rem; height: 2.4rem; color: var(--border-strong); margin-bottom: .5rem; }
.empty .title { font-weight: 650; color: var(--text-2); margin-bottom: .25rem; }
.empty .text { color: var(--muted); font-size: .92rem; margin: 0 auto; max-width: 32rem; }

/* ------------------------------------------------------------------ buttons */
.button, button.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  height: 38px; padding: 0 1rem; border-radius: 8px; border: 1px solid var(--brand);
  background: var(--brand); color: #fff; font: inherit; font-size: .92rem; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.button:hover { background: var(--brand-600); border-color: var(--brand-600); text-decoration: none; }
.button.secondary { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.button.secondary:hover { background: var(--surface-2); }
.button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.button.ghost:hover { background: var(--surface-2); }
.button.danger { background: var(--surface); color: var(--error); border-color: var(--error-border); }
.button.danger:hover { background: var(--error-bg); }
.button.small { height: 32px; padding: 0 .75rem; font-size: .85rem; }
.button.link { background: none; border: 0; height: auto; padding: 0; color: var(--brand); font-weight: 600; }
.button[disabled], .button.disabled { opacity: .55; pointer-events: none; }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 50%; border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-button:hover { background: var(--surface-2); }
.icon-button .icon { width: 1.25rem; height: 1.25rem; }
.icon-button.menu-button { display: none; }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field label { font-size: .88rem; font-weight: 600; color: var(--text-2); }
.req { color: var(--error); margin-left: .15rem; }
.input, .field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="search"], .field input[type="url"], .field input[type="number"], .field input[type="date"],
.field input[type="time"], .field select, .field textarea {
  min-height: 40px; padding: .5rem .75rem; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--input-bg); color: var(--text); font: inherit; box-shadow: var(--shadow-sm); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: none; border-color: var(--brand); box-shadow: var(--focus);
}
.field.has-error input { border-color: var(--error); }
.field .error, .errorlist { color: var(--error); font-size: .88rem; margin: 0; padding: 0; list-style: none; }
.field .help { font-size: .85rem; color: var(--muted); }
.form-errors {
  background: var(--error-bg); border: 1px solid var(--error-border); color: var(--error-text);
  border-radius: var(--radius); padding: .65rem .9rem; margin-bottom: 1rem; font-size: .92rem;
}
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .5rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
.token-input { font-family: var(--mono); font-size: 1.35rem !important; letter-spacing: .3em; text-align: center; }

/* ------------------------------------------------------------------ tables */
.table-wrap {
  overflow-x: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th {
  position: sticky; top: 0; text-align: left; padding: .65rem 1rem; background: var(--surface-2);
  border-bottom: 1px solid var(--border); font-size: .74rem; font-weight: 650;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
table.list td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: var(--row-hover); }
table.list .title { font-weight: 600; color: var(--text); }
table.list .sub { font-size: .82rem; color: var(--muted); }
.results-meta { font-size: .85rem; color: var(--muted); margin: 0 0 .6rem; }

/* ------------------------------------------------------------------ badges, status */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem; border-radius: 999px;
  font-size: .74rem; font-weight: 600; background: var(--surface-3); color: var(--text-2);
}
.badge.brand { background: var(--brand-50); color: var(--brand-700); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.pill {
  display: inline-flex; padding: .05rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600;
  background: var(--surface-3); color: var(--muted);
}
.status {
  display: inline-flex; align-items: center; gap: .4rem; padding: .18rem .6rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600; background: var(--info-bg); color: var(--info-strong); white-space: nowrap;
}
.status::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.status-ok { background: var(--ok-bg); color: var(--ok); }
.status-warn { background: var(--warn-bg); color: var(--warn); }
.status-error { background: var(--error-bg); color: var(--error); }
.number {
  font-family: var(--mono); font-size: .84rem; font-weight: 600; color: var(--brand-700);
  background: var(--brand-50); border-radius: 6px; padding: .05rem .4rem;
}

/* ------------------------------------------------------------------ avatar */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: .78rem; font-weight: 650;
}
.avatar.lg { width: 38px; height: 38px; font-size: .9rem; }
.avatar-0 { background: #0f6baf; } .avatar-1 { background: #7a5af8; } .avatar-2 { background: #0e9384; }
.avatar-3 { background: #dd6b20; } .avatar-4 { background: #d92d7a; } .avatar-5 { background: #4e5ba6; }

/* ------------------------------------------------------------------ messages */
.messages { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.25rem; }
.message {
  display: flex; align-items: flex-start; gap: .6rem; padding: .7rem .9rem; border-radius: var(--radius);
  border: 1px solid var(--info-border); background: var(--info-bg); color: var(--info-text); font-size: .92rem;
}
.message .text { flex: 1; }
.message.success { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok-text); }
.message.warning { border-color: var(--warn-border); background: var(--warn-bg); color: var(--warn-text); }
.message.error { border-color: var(--error-border); background: var(--error-bg); color: var(--error-text); }
.message .close {
  border: 0; background: none; color: inherit; cursor: pointer; font-size: 1.15rem; line-height: 1; padding: 0 .2rem;
}
.notice {
  border: 1px solid var(--warn-border); background: var(--warn-bg); color: var(--warn-text);
  border-radius: var(--radius); padding: .7rem .9rem; font-size: .92rem;
}

/* ------------------------------------------------------------------ auth pages */
.auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem;
  background:
    radial-gradient(60rem 30rem at 10% -10%, rgba(15, 107, 175, .08), transparent 60%),
    radial-gradient(50rem 30rem at 110% 110%, rgba(15, 107, 175, .06), transparent 60%),
    var(--bg);
}
html[data-theme="dark"] .auth { background: var(--bg); }
@media (prefers-color-scheme: dark) { html[data-theme="system"] .auth { background: var(--bg); } }
.auth-inner { width: 100%; max-width: 440px; }
.auth-logo { text-align: center; margin-bottom: 1.25rem; }
.auth-logo img { height: 42px; width: auto; }
.auth-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 1.75rem 1.75rem 1.5rem;
}
.auth-card h1 { font-size: 1.35rem; margin-bottom: .35rem; }
.auth-card .lead { color: var(--muted); font-size: .92rem; margin-bottom: 1.25rem; }
.auth-card .button { width: 100%; }
.auth-footer { text-align: center; margin-top: 1rem; font-size: .82rem; color: var(--muted); }
.qr-box {
  display: flex; justify-content: center; padding: .75rem; margin: .5rem 0 1rem;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
}
.qr-box img { width: 200px; height: 200px; }
.secret { word-break: break-all; font-family: var(--mono); font-size: .9rem; color: var(--text-2); }
.steps { margin: 0 0 1rem; padding-left: 1.2rem; color: var(--text-2); font-size: .92rem; }
.steps li { margin-bottom: .3rem; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .icon-button.menu-button { display: inline-flex; }
  .nav-toggle:checked ~ .sidebar { transform: translateX(0); }
  .nav-toggle:checked ~ .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 35; background: rgba(16, 24, 40, .45);
  }
  .page { padding: 1.25rem 1rem 2.5rem; }
  .topbar { padding: 0 1rem; }
}
@media (max-width: 700px) {
  h1 { font-size: 1.35rem; }
  .grid { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { border-bottom: 1px solid var(--border); padding: .5rem 0; }
  table.cards td { border: 0; padding: .3rem 1rem; }
  table.cards td::before {
    content: attr(data-label); display: block; font-size: .72rem; font-weight: 650; letter-spacing: .05em;
    text-transform: uppercase; color: var(--muted);
  }
}
@media (pointer: coarse) {
  .button, .field input, .field select, .icon-button { min-height: 44px; }
  .icon-button { width: 44px; height: 44px; }
}

/* ------------------------------------------------------------------ announcements */
.section { margin-bottom: 1.5rem; }
.quote {
  margin: 0 0 .75rem; padding: .6rem .8rem; border-left: 3px solid var(--brand-100);
  background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--text-2); white-space: pre-line;
}
.player { width: 100%; max-width: 32rem; height: 40px; margin-bottom: .5rem; }
.player.small { width: 15rem; max-width: 100%; height: 32px; margin: 0; }
.card-highlight { border-color: var(--brand-100); box-shadow: var(--shadow); }
.field textarea { resize: vertical; min-height: 7rem; line-height: 1.45; }
.file-input {
  padding: .9rem; border: 1px dashed var(--border-strong); border-radius: 8px; background: var(--surface-2);
  color: var(--text-2); font: inherit; width: 100%;
}
button.button[disabled] { opacity: .55; cursor: not-allowed; }

/* ------------------------------------------------------------------ schedules */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-grid .span-2 { grid-column: span 2; }
.hours-table td { white-space: nowrap; }
.hours-table input[type="time"] {
  min-height: 38px; padding: .35rem .5rem; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--input-bg); color: var(--text); font: inherit;
}
.check { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.outlook { display: grid; gap: 1rem; }
.outlook .when { font-size: .78rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.outlook .what { font-size: 1.15rem; font-weight: 650; margin: .1rem 0 .4rem; }
.outlook .next { border-top: 1px solid var(--border); padding-top: 1rem; }
.term-list { list-style: none; margin: 0; padding: 0; }
.term-list li { display: flex; justify-content: space-between; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.term-list li:last-child { border-bottom: 0; }
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .hours-table td { white-space: normal; }
  /* Times side by side in pairs: from/to, break from/to. */
  table.cards.hours-table tr { display: flex; flex-wrap: wrap; }
  .hours-table td { width: 100%; }
  .hours-table td[data-label="Tag"]::before, .hours-table td[data-label="Geöffnet"]::before { display: none; }
  .hours-table td[data-label="Tag"], .hours-table td[data-label="Geöffnet"] { width: 50%; }
  .hours-table td[data-label="Von"], .hours-table td[data-label="Bis"],
  .hours-table td[data-label="Pause von"], .hours-table td[data-label="Pause bis"] { width: 50%; }
  .hours-table input[type="time"] { width: 100%; }
}

/* ------------------------------------------------------------------ help */
.help .card h2 { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.help .card h2 .icon { color: var(--brand); }
.help .card p:last-child { margin-bottom: 0; }
ul.steps { padding-left: 1.2rem; }

/* Row actions with inline forms (rename, delete) – no JavaScript needed. */
.row-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; align-items: flex-start; }
.row-actions.start { justify-content: flex-start; margin-top: .5rem; }
.inline-edit > summary { list-style: none; }
.inline-edit > summary::-webkit-details-marker { display: none; }
.inline-edit[open] > summary { background: var(--surface-2); }
.inline-edit > form { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .4rem; }
.inline-edit .input { width: 12rem; max-width: 100%; height: 32px; }

/* Disclosure: optional part of a form that opens on demand. */
.disclosure > summary { list-style: none; width: fit-content; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure[open] > summary { background: var(--surface-2); }
.disclosure-body { margin-top: .75rem; }

/* "Jetzt schließen" on the dashboard */
.close-now { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1rem; }
.close-now p { margin: 0 0 .5rem; }
