/* Verwaltung – ruhig, gut lesbar, große Ziele für die Bedienung am Handy */
body:has(.admin-main), .auth-body { background: #f4efe6; }

.admin-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px var(--gutter); background: var(--paper); border-bottom: 1px solid var(--line); }
.admin-top .brand { margin-right: 0; display: inline-flex; flex-direction: column; text-decoration: none; line-height: 1; }
.admin-top .brand-logo { height: 32px; width: auto; }
.admin-top .brand-sub { font-size: .5rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 5px; padding-left: 18.6%; white-space: nowrap; }
.admin-top-title { margin: 0 auto 0 0; font-weight: 650; color: var(--ink); padding-left: 16px; border-left: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-user { display: flex; align-items: center; gap: 14px; }
.admin-user form { display: inline; }
@media (max-width: 640px) {
  .admin-top-title { order: 3; flex-basis: 100%; border-left: 0; padding-left: 0; }
  .admin-top { gap: 8px 12px; }
  .admin-user { margin-left: auto; }
}

.admin-crumbs { padding: 10px var(--gutter) 0; font-size: .9rem; }
.admin-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 10px var(--gutter); background: #f4efe6; position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.admin-tabs a { flex: 0 0 auto; padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.admin-tabs a:hover { background: rgba(18, 52, 59, .07); }
.admin-tabs a[aria-current] { background: var(--ink); color: #fff; }

.admin-main { max-width: 1040px; margin: 0 auto; padding: 24px var(--gutter) 80px; }
.admin-main h1 { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 650; }
.admin-main h2 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 650; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: clamp(18px, 3vw, 28px); margin-bottom: 20px; }
.panel-highlight { border: 2px solid var(--ok); background: #f3f8f1; }
.narrow-panel { max-width: 640px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h1, .panel-head h2 { margin: 0; }
.empty { color: var(--muted); padding: 18px; background: #fbf7ef; border-radius: 10px; border: 1px dashed var(--line); margin: 0; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; gap: 12px 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row-main { flex: 1 1 320px; min-width: 0; }
.row-main p { margin: 2px 0 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.is-hidden .row-main { opacity: .6; }
.msg { background: #fff; border-left: 3px solid var(--line); padding: 6px 12px; margin: 6px 0 !important; white-space: pre-line; }
form.inline { display: inline; }
.form.compact { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form.compact input, .form.compact select { min-height: 40px; padding: 8px 10px; width: auto; flex: 1 1 140px; }
.compact-form { margin: 12px 0; }

.badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #ebe4d6; color: #4b4a45; vertical-align: middle; margin-left: 4px; }
.badge-neu, .badge-offen { background: #ffe1a8; color: #5c3b00; }
.badge-bestaetigt, .badge-erledigt { background: var(--ok-bg); color: var(--ok); }
.badge-abgelehnt { background: var(--error-bg); color: var(--error); }
.badge-in_bearbeitung, .badge-uebernommen { background: #dfeaf0; color: #1d4a5e; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #efe9de; border-radius: 999px; padding: 2px 4px 2px 10px; margin: 2px 4px 2px 0; font-size: .82rem; }
.chip-x { border: 0; background: transparent; cursor: pointer; font-size: 1rem; width: 28px; height: 28px; border-radius: 50%; color: var(--muted); }
.chip-x:hover { background: #e0d6c4; color: var(--error); }

details.mini > summary { list-style: none; cursor: pointer; }
details.mini > summary::-webkit-details-marker { display: none; }
details.mini[open] { flex-basis: 100%; display: grid; gap: 8px; padding: 12px; background: #fbf7ef; border-radius: 10px; }
details.mini[open] > summary { justify-self: start; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 16px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 14px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.stat:hover { border-color: var(--ink); color: var(--text); }
.stat-n { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: var(--ink); line-height: 1; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; }
.filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.filter a { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); text-decoration: none; font-weight: 600; min-height: 40px; display: inline-flex; align-items: center; }
.filter a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }

.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, #f4efe6 30%); padding: 20px 0 calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 10px; flex-wrap: wrap; z-index: 5; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.preview-img { max-height: 200px; width: auto; border-radius: 10px; border: 1px solid var(--line); background: #fff; margin-bottom: 8px; }
.preview-sm { max-height: 140px; }
.gallery-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix > span { display: flex; align-items: center; padding: 0 10px; background: #efe9de; border: 1.5px solid #cbbfa9; border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--muted); }
.input-prefix input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }
.secret { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.secret code { font-size: 1.15rem; background: #fff; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); user-select: all; }
.hours-edit { display: grid; gap: 8px; margin-bottom: 16px; }
.hours-edit .form-row { grid-template-columns: 160px 1fr; gap: 8px; }
@media (max-width: 520px) { .hours-edit .form-row { grid-template-columns: 1fr 1.6fr; } }
.inline-price { display: inline-flex; gap: 6px; align-items: center; }
.inline-price input { width: 90px !important; min-height: 40px !important; padding: 6px 10px !important; }

/* ---------- Personalruf-Tafel ---------- */
.live-dot { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; color: var(--ok); }
.live-dot::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
.live-dot.is-offline { color: var(--error); }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live-dot::before { animation: none; } }
.board { display: grid; gap: 12px; margin-top: 12px; }
.call { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; padding: 16px 18px; border-radius: 14px; background: #fff; border: 2px solid var(--line); }
.call-offen { border-color: #e7a23a; background: #fffaf0; }
.call-offen.is-new { animation: flash 1.2s ease 2; }
@keyframes flash { 50% { background: #ffe9bf; } }
.call-uebernommen { border-color: #8fb3c4; }
.call-erledigt { opacity: .6; }
.call-title { font-size: 1.15rem; font-weight: 700; margin: 0; color: var(--ink); }
.call-title .kind { font-weight: 600; color: var(--text); }
.call-meta { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }
.call-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.call-actions .btn { min-height: 52px; min-width: 128px; }
@media (max-width: 560px) { .call { grid-template-columns: 1fr; } .call-actions .btn { flex: 1; } }
.board-group { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 14px 0 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow); z-index: 100; max-width: calc(100% - 32px); }
.toast-error { background: var(--error); }
.who { border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
.who legend { font-weight: 600; padding: 0 4px; }
.who p { flex-basis: 100%; margin: 0; }
.demo-host .demo-banner { margin: 0; }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 440px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: clamp(24px, 5vw, 40px); box-shadow: var(--shadow); }
.auth-card .brand { margin: 0 auto 24px; display: flex; flex-direction: column; align-items: center; text-decoration: none; line-height: 1; }
.auth-card .brand-logo { width: min(240px, 70%); height: auto; }
.auth-card .brand-sub { font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.auth-card h1 { margin-bottom: .2em; }
.linkish.small { font-size: .875rem; }
/* Vorlagen-Auswahl */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin: 14px 0 8px; }
.tpl-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; }
.tpl-card:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(18, 52, 59, .15); }
.tpl-card input { position: absolute; top: 18px; left: 18px; width: 24px; height: 24px; accent-color: var(--ink); }
.tpl-card img { width: 100%; aspect-ratio: 32 / 21; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); }
.tpl-name { font-weight: 700; color: var(--ink); }
.tpl-desc { font-size: .85rem; color: var(--muted); flex: 1; }
