/* ==========================================================================
   Admin-Bereich – handyfreundlich und hell, gleiche Markenwelt
   ========================================================================== */
body.admin { font-size: 16px; background: var(--cream); }
.a-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: var(--walnut); color: var(--on-dark); }
.a-top .brand { font-family: var(--font-display); }
.a-nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.a-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--on-dark); text-decoration: none; font-weight: 700; white-space: nowrap; opacity: .82; }
.a-nav a:hover { opacity: 1; background: rgba(255, 246, 230, .08); color: var(--on-dark); }
.a-nav a.active { opacity: 1; background: rgba(233, 182, 95, .18); color: var(--gold); }
.a-top-right { display: flex; align-items: center; gap: 14px; }
.a-top-right form { margin: 0; }
.a-link { background: none; border: 0; color: var(--on-dark-muted); font: 600 .9rem var(--font); cursor: pointer; text-decoration: none; padding: 0; white-space: nowrap; }
.a-link:hover { color: var(--gold); }
@media (max-width: 900px) {
  .a-top { padding: 10px 14px; justify-content: space-between; }
  .a-top-right .a-link:first-child { display: none; }
  .a-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--walnut); border-top: 1px solid rgba(255, 246, 230, .16); gap: 0; }
  .a-nav a { flex-direction: column; gap: 2px; font-size: .68rem; padding: 6px 4px; min-width: 56px; }
  .a-nav a span:first-child { font-size: 1.3rem; }
  body.admin { padding-bottom: 80px; }
}

.a-main { width: min(100% - 28px, 1240px); margin: 24px auto 60px; }
.a-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.a-head h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 0; }
.a-head p { margin: 4px 0 0; max-width: 680px; }
.a-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.a-back { color: var(--muted); text-decoration: none; font-size: .9rem; }
.a-h2 { font-size: 1.2rem; font-weight: 800; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.a-flash { margin-bottom: 16px; }
.ok { color: var(--ok); }
.warn { color: var(--ginger-deep); }
.card { padding: clamp(18px, 3vw, 28px); box-shadow: none; }
.card + .card, .card + section, section + .card, .orga-grid + .card { margin-top: 18px; }

.tiles { display: grid; grid-template-columns: 1.5fr repeat(5, 1fr); gap: 12px; margin-bottom: 24px; }
.tiles-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, 1fr); } .tiles:not(.tiles-4) .tile-hero { grid-column: 1 / -1; } .tiles-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { padding: 16px 18px; border-radius: var(--radius-sm); background: var(--icing); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile b { font-size: 2rem; line-height: 1.1; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.tile b small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.tile-label { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--ginger-deep); }
.tile-sub { font-size: .85rem; color: var(--muted); line-height: 1.3; }
.tile-hero { background: var(--walnut-2); border-color: var(--walnut-2); color: var(--on-dark); }
.tile-hero b { font-size: 2.6rem; color: var(--on-dark); }
.tile-hero b small { color: var(--on-dark-muted); }
.tile-hero .tile-label { color: var(--gold); }
.tile-hero .tile-sub { color: var(--on-dark-muted); }
.tile-hero.is-negative { background: var(--berry-deep); border-color: var(--berry-deep); }
.tile-warn { border-color: var(--gold); background: #FBF0D6; }
.tile-link { text-decoration: none; color: inherit; }
.tile-link:hover { color: inherit; border-color: var(--ginger); }
.tile-btn { margin-top: 8px; }
.spots-bar { height: 10px; margin: 6px 0; border-radius: 999px; background: rgba(255, 246, 230, .2); overflow: hidden; }
.spots-fill { height: 100%; border-radius: 999px; background: var(--gold); }
.mini-list { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 2px; font-size: .9rem; }
.mini-list li { display: flex; justify-content: space-between; gap: 8px; }
.mini-list b { font-size: .95rem; }

.a-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--parchment); overflow-x: auto; max-width: 100%; }
.seg a { padding: 7px 14px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 700; white-space: nowrap; }
.seg a.active { background: var(--walnut-2); color: var(--on-dark); }
.input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 2px solid rgba(44, 24, 16, .18); background: #fff; color: var(--ink); font: 600 1rem var(--font); }
.input:focus { outline: none; border-color: var(--berry); }
.a-search { max-width: 340px; }

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--icing); }
.a-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.a-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.a-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.a-table tr:last-child td { border-bottom: 0; }
.a-table .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.sub { font-size: .84rem; color: var(--muted); }
.sub a { color: var(--muted); }
.sub.warn { color: var(--ginger-deep); font-weight: 700; }
.note { margin-top: 6px; font-size: .86rem; padding: 6px 10px; border-radius: 8px; background: var(--parchment); }
.note-admin { background: #FBF0D6; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn { margin-left: 4px; }
.inline { display: inline; margin: 0; }
.chip { display: inline-flex; padding: 2px 10px; border-radius: 999px; font: 800 .8rem var(--font); }
.chip-warn { background: #F6E2B8; color: #6E4413; }
.promoted { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.promoted .sub { flex: 1 1 100%; }
@media (max-width: 760px) {
  #reg-table thead { display: none; }
  #reg-table, #reg-table tbody, #reg-table tr, #reg-table td { display: block; }
  #reg-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  #reg-table td { border: 0; padding: 3px 0; }
  #reg-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .8rem; }
  .row-actions { text-align: left; padding-top: 8px !important; }
  .row-actions .btn { margin: 0 6px 0 0; }
}
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty div { font-size: 3rem; }

.a-form .form-grid { gap: 14px 18px; }
.a-form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.a-checks { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
label.a-checks { font-weight: 700; cursor: pointer; }
label.a-checks span { display: inline-flex; gap: 8px; align-items: center; }
.a-checks input { width: 20px; height: 20px; accent-color: var(--berry); }
.danger-zone { margin-top: 18px; text-align: right; }
.danger-card { border-color: rgba(168, 30, 45, .35); margin-top: 18px; }
.confirm-word { max-width: 200px; }

/* Login */
.login-wrap { min-height: 80vh; display: grid; place-items: center; }
.login-card { width: min(100%, 420px); }
.login-icon { font-size: 3.4rem; line-height: 1; }
.login-title { font-size: 2.6rem; margin: 6px 0 4px; }
.login-card .btn-block { margin-top: 16px; }
.login-back { margin: 16px 0 0; }

/* Ofenplan */
.oven-settings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; margin-bottom: 14px; }
@media (max-width: 620px) { .oven-settings { grid-template-columns: minmax(0, 1fr); } }
.oven-table td { vertical-align: middle; }
.oven-time b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.input-num { width: 82px; padding: 8px 8px; text-align: center; }
.oven-move { white-space: nowrap; text-align: right; }
.oven-move .btn { padding: .55em .8em; }
.oven-move .btn:disabled { opacity: .3; cursor: default; transform: none; }
.oven-change td { padding: 7px 14px; background: #FBF0D6; font-size: .88rem; font-weight: 800; color: #6E4413; }
.oven-print { display: none; }
@media (max-width: 760px) {
  .oven-table thead { display: none; }
  .oven-table, .oven-table tbody, .oven-table tr { display: block; }
  .oven-table tr:not(.oven-change) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .oven-table td { display: block; border: 0; padding: 0; }
  .oven-table .oven-time { grid-column: 1; }
  .oven-table .oven-time + td { grid-column: 2 / -1; }
  .oven-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .72rem; font-weight: 700; margin-bottom: 2px; }
  .input-num { width: 100%; }
  .oven-move { grid-column: 1 / -1; text-align: left; }
  .oven-change { display: block; }
  .oven-change td { padding: 7px 14px; }
}

/* Budget */
.budget-total { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.budget-total .input { width: 90px; font-size: 1.3rem; font-weight: 800; padding: 4px 8px; }
.budget-total span { font-weight: 800; }
.budget-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--parchment); margin-bottom: 8px; }
.budget-bar span { display: block; height: 100%; transition: width .3s ease; }
.budget-spent { background: var(--berry); }
.budget-open { background: var(--gold); }
.budget-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 0; margin: 0 0 22px; font-size: .85rem; color: var(--muted); }
.budget-legend li { display: inline-flex; align-items: center; gap: 6px; }
.budget-legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--parchment); box-shadow: inset 0 0 0 1px var(--line); }
.budget-legend i.budget-spent { background: var(--berry); box-shadow: none; }
.budget-legend i.budget-open { background: var(--gold); box-shadow: none; }
.shop-group + .shop-group { margin-top: 14px; }
.shop-group .a-h2 { margin-bottom: 6px; }
.shop-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); margin: 0; }
.shop-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; min-width: 0; }
.shop-check input { flex: none; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--ok); }
.shop-check b { display: block; font-weight: 700; line-height: 1.3; }
.shop-check small { display: block; color: var(--muted); font-size: .84rem; }
.is-bought .shop-check b { text-decoration: line-through; color: var(--muted); }
.shop-price { display: block; }
.shop-price span { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.shop-price .input { padding: 6px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.is-auto .shop-save { display: none; }
.shop-del { background: none; border: 0; color: var(--muted); font-size: 1.3rem; cursor: pointer; opacity: .5; padding: 4px 8px; }
.shop-del:hover { opacity: 1; color: var(--berry); }
@media (max-width: 640px) {
  .shop-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .shop-check { grid-column: 1 / -1; }
}

/* Orga */
.orga-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.orga-grid > .card { margin: 0; }
.settings + .orga-grid { margin-top: 18px; }
@media (max-width: 900px) { .orga-grid { grid-template-columns: minmax(0, 1fr); } }
.check-h { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--ginger-deep); margin: 16px 0 6px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.check-list li { display: flex; align-items: flex-start; gap: 6px; }
.check-toggle { flex: 1; margin: 0; min-width: 0; }
.check-toggle button { width: 100%; display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 10px; border: 0; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.check-toggle button:hover { background: var(--parchment); }
.check-toggle .box { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid rgba(44, 24, 16, .3); display: grid; place-items: center; font-size: .8rem; font-weight: 800; color: #fff; margin-top: 1px; }
.check-list li.done .box { background: var(--ok); border-color: var(--ok); }
.check-list li.done .check-toggle span:last-child { text-decoration: line-through; color: var(--muted); }
.check-del { margin: 0; }
.check-del button { background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; opacity: .4; padding: 4px 8px; }
.check-del button:hover { opacity: 1; color: var(--berry); }
.check-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.check-add input { flex: 2 1 180px; width: auto; }
.check-add select { flex: 1 1 130px; width: auto; }
.sorten-admin { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.sorten-admin li { display: flex; flex-direction: column; gap: 1px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.sorten-admin li > .chip { align-self: flex-start; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row form { margin: 0; }
.text-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.text-card { padding: 16px; border-radius: 14px; background: var(--parchment); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.text-card h3 { margin: 0; font-size: 1.05rem; }
.text-card pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 500 .9rem/1.5 var(--font); color: var(--ink); margin: 0; flex: 1; max-height: 280px; overflow-y: auto; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 12px; }
.asset { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--muted); font-size: .8rem; word-break: break-all; }
.asset img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.asset-pdf { display: grid; place-items: center; aspect-ratio: 4/5; border-radius: 10px; border: 1px solid var(--line); background: var(--parchment); font-weight: 800; color: var(--berry-deep); font-size: 1.4rem; }

/* Einstellungen */
.settings .card { margin-bottom: 18px; margin-top: 0; }
.sticky-save { position: sticky; bottom: 16px; z-index: 5; display: flex; justify-content: flex-end; margin: 10px 0 24px; }
@media (max-width: 900px) { .sticky-save { bottom: 86px; } }

/* Toast */
.a-toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 100; margin: 0; box-shadow: var(--shadow); background: var(--icing); transition: opacity .4s, transform .4s; max-width: calc(100% - 32px); font-weight: 700; }
.a-toast.out { opacity: 0; transform: translateX(-50%) translateY(10px); }
@media (max-width: 900px) { .a-toast { bottom: 96px; } }

/* Druckansicht des Ofenplans */
@media print {
  body.admin { background: #fff; padding: 0; font-size: 12pt; }
  .a-top, .no-print, .a-flash, .a-toast { display: none !important; }
  .a-main { width: 100%; margin: 0; }
  .oven-print { display: block; }
  .oven-print h1 { font-size: 28pt; margin: 0 0 4pt; }
  .oven-print p { margin: 0 0 14pt; }
  .oven-print table { width: 100%; border-collapse: collapse; }
  .oven-print th, .oven-print td { padding: 8pt 8pt; border: 1px solid #888; text-align: left; }
  .oven-print th { font-size: 10pt; }
  .oven-print td b { font-size: 14pt; }
  .oven-box { width: 44pt; }
}
