/* Fanszene Verwaltung – Design  ·  © ff144
   Akzentfarben kommen aus den Einstellungen: --a1 (Hauptfarbe), --a2 (Zweitfarbe) */
:root {
  --a1: #800020; --a2: #FFFFFF; --a1-text: #fff; --a2-text: #141414;
  --bg: #0f0f10; --bg2: #161618; --card: #1b1b1e; --card2: #232327; --line: #2e2e33;
  --text: #ececee; --muted: #9a9aa2; --ok: #3fa66b; --warn: #d9a23b; --err: #d0503f;
  --radius: 10px;
  --head: "Oswald", "Bebas Neue", "Impact", "Haettenschweiler", "Arial Narrow Bold", "Roboto Condensed", "sans-serif-condensed", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
h1, h2, h3, .head { font-family: var(--head); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: 30px; } h2 { font-size: 21px; } h3 { font-size: 16px; color: var(--muted); }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.ico { width: 20px; height: 20px; flex: none; }

/* Schal-Streifen */
.scarf { height: 8px; flex: none; background: repeating-linear-gradient(-45deg, var(--a1) 0 14px, var(--a2) 14px 28px); }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: rgba(15,15,16,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--head); text-transform: uppercase; font-size: 20px; letter-spacing: .06em; font-weight: 700; min-width: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand img { height: 36px; width: 36px; object-fit: contain; }
.userbox { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.userbox a { display: flex; gap: 6px; align-items: center; text-decoration: none; padding: 7px 10px; border-radius: 8px; color: var(--muted); }
.userbox a:hover { background: var(--card); color: var(--text); }
.menu-btn { display: none; background: none; border: 0; color: var(--text); padding: 6px; cursor: pointer; }

/* Layout */
.layout { display: flex; flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; }
.sidenav { width: 230px; flex: none; padding: 18px 10px; position: sticky; top: 60px; align-self: flex-start; max-height: calc(100vh - 60px); overflow: auto; }
.sidenav a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; border-left: 3px solid transparent; }
.sidenav a:hover { background: var(--card); color: var(--text); }
.sidenav a.active { background: var(--card); color: var(--text); border-left-color: var(--a1); }
.sidenav a.active .ico { color: var(--a2); }
.nav-backdrop { display: none; }
.main { flex: 1; min-width: 0; padding: 24px 24px 40px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .userbox span { display: none; }
  .sidenav { position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; background: var(--bg2); max-height: none; width: 260px; transform: translateX(-100%); transition: transform .2s; padding-top: 24px; border-right: 1px solid var(--line); }
  .nav-open .sidenav { transform: none; }
  .nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.6); }
  .main { padding: 18px 16px 32px; }
  h1 { font-size: 25px; }
}

/* Seitenkopf */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--line); position: relative; }
.page-head::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 70px; height: 2px; background: var(--a1); }
.page-head h1 { margin: 0; }
.page-head .sub { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Karten */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.empty { text-align: center; padding: 40px 18px; color: var(--muted); }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-title h2 { margin: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 18px; }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; border-top: 3px solid var(--line); }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.stat .value { font-family: var(--head); font-size: 26px; font-weight: 700; margin-top: 2px; }
.stat.pos { border-top-color: var(--ok); } .stat.neg { border-top-color: var(--err); } .stat.acc { border-top-color: var(--a1); } .stat.warn { border-top-color: var(--warn); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 14px var(--body); padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card2); color: var(--text); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #4a4a52; background: #2b2b30; }
.btn-primary { background: var(--a1); color: var(--a1-text); border-color: var(--a1); }
.btn-primary:hover { background: var(--a1); filter: brightness(1.15); border-color: var(--a1); }
.btn-light { background: var(--a2); color: var(--a2-text); border-color: var(--a2); }
.btn-danger { background: transparent; color: #ff8c7d; border-color: #5a2a24; }
.btn-danger:hover { background: #3a1a16; border-color: var(--err); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 20px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.inline { display: inline; margin: 0; }

/* Formulare */
label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; font: 15px var(--body); color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--a1); outline-offset: 0; border-color: var(--a1); }
textarea { min-height: 120px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; display: inline-block; margin: 0 8px 0 0; accent-color: var(--a1); transform: scale(1.15); }
input[type=color] { padding: 2px; height: 42px; width: 60px; cursor: pointer; }
input[type=file] { padding: 7px; }
.form.narrow { max-width: 560px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.check { display: flex; align-items: center; color: var(--text); font-weight: 500; font-size: 14px; cursor: pointer; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters label { margin: 0; }
.filters input, .filters select { min-width: 150px; }

/* Segment-Auswahl (Bar/PayPal etc.) */
.seg { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; margin-bottom: 12px; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 11px 6px; cursor: pointer; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 13px; background: var(--bg2); }
.seg label + label span { border-left: 1px solid var(--line); }
.seg input:checked + span { background: var(--a1); color: var(--a1-text); }
.seg input:focus-visible + span { outline: 2px solid var(--a2); outline-offset: -3px; }

/* Tabellen */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.02); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.inactive td { opacity: .5; }
.td-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

@media (max-width: 640px) {
  table.m-cards thead { display: none; }
  table.m-cards, table.m-cards tbody, table.m-cards tr, table.m-cards td { display: block; width: 100%; }
  table.m-cards tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.m-cards td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.m-cards td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; text-align: left; }
  table.m-cards td .td-actions { width: 100%; justify-content: flex-end; padding-top: 6px; }
}

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--card2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { color: #7fdca2; border-color: #24533a; background: #15291e; }
.badge.warn { color: #f1c66d; border-color: #5b4519; background: #2a2112; }
.badge.err { color: #ff9384; border-color: #5a2a24; background: #2a1512; }
.badge.acc { background: var(--a1); color: var(--a1-text); border-color: var(--a1); }
.pos-text { color: #7fdca2; } .neg-text { color: #ff9384; }

/* Meldungen */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; font-weight: 500; }
.flash-ok { background: #15291e; border-color: #24533a; color: #a9e9c0; }
.flash-err { background: #2a1512; border-color: #5a2a24; color: #ffb0a5; }
.flash-info { background: var(--card2); border-color: var(--line); }

/* Login */
.auth { justify-content: flex-start; }
.auth-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 16px; gap: 22px; }
.auth-hero { text-align: center; }
.auth-hero h1 { font-size: 34px; margin: 10px 0 2px; }
.kicker { color: var(--muted); text-transform: uppercase; letter-spacing: .2em; font-size: 12px; margin: 0; }
.auth-logo { width: 200px; height: 200px; object-fit: contain; filter: drop-shadow(0 8px 30px rgba(0,0,0,.6)); }
.auth-logo.placeholder, .hero-logo.placeholder { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--a1); color: var(--a1-text); font-family: var(--head); font-size: 70px; font-weight: 700; border: 6px solid var(--a2); width: 170px; height: 170px; }
.auth-card { width: 100%; max-width: 380px; }

/* Startseite */
.hero { position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); background: radial-gradient(ellipse at top left, color-mix(in srgb, var(--a1) 45%, transparent), transparent 60%), var(--card); padding: 26px; display: flex; gap: 26px; align-items: center; margin-bottom: 18px; }
.hero::after { content: ""; position: absolute; right: -40px; top: 0; bottom: 0; width: 140px; background: repeating-linear-gradient(-45deg, var(--a1) 0 16px, var(--a2) 16px 32px); opacity: .14; transform: skewX(-12deg); }
.hero-logo { width: 150px; height: 150px; object-fit: contain; flex: none; filter: drop-shadow(0 6px 24px rgba(0,0,0,.6)); position: relative; z-index: 1; }
.hero-logo.placeholder { width: 130px; height: 130px; font-size: 52px; }
.hero-body { position: relative; z-index: 1; min-width: 0; }
.hero-body .kicker { margin-bottom: 6px; }
.match { font-family: var(--head); text-transform: uppercase; font-weight: 700; font-size: 34px; line-height: 1.05; letter-spacing: .03em; }
.match .vs { color: var(--a2); opacity: .7; font-size: .6em; padding: 0 .3em; vertical-align: middle; }
.match-meta { display: flex; gap: 8px 18px; flex-wrap: wrap; color: var(--muted); margin-top: 10px; font-size: 14px; }
.match-meta b { color: var(--text); }
.countdown { display: inline-block; margin-top: 14px; background: var(--a2); color: var(--a2-text); font-family: var(--head); text-transform: uppercase; font-weight: 700; padding: 6px 14px; border-radius: 6px; letter-spacing: .06em; font-size: 15px; }
@media (max-width: 640px) {
  .hero { flex-direction: column; text-align: center; padding: 22px 16px; }
  .hero-logo { width: 120px; height: 120px; }
  .match { font-size: 26px; }
  .match-meta { justify-content: center; }
}

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.quick a { display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-family: var(--head); text-transform: uppercase; font-weight: 700; letter-spacing: .05em; font-size: 15px; transition: border-color .15s, transform .15s; position: relative; }
.quick a:hover { border-color: var(--a1); transform: translateY(-2px); }
.quick a .ico { width: 28px; height: 28px; color: var(--a2); }
.quick a.primary { background: var(--a1); color: var(--a1-text); border-color: var(--a1); }
.quick a.primary .ico { color: var(--a1-text); }
.quick .count { position: absolute; top: 12px; right: 12px; background: var(--a2); color: var(--a2-text); border-radius: 999px; font-family: var(--body); font-size: 12px; padding: 1px 8px; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }

/* Kasse */
.pos-grid { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .pos-grid { grid-template-columns: 1fr; } }
.cat-head { font-family: var(--head); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-size: 13px; margin: 6px 0 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; color: var(--text); font: inherit; border-bottom: 3px solid var(--a1); min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.tile:hover { background: var(--card2); }
.tile:active { transform: scale(.98); }
.tile .t-name { font-weight: 700; line-height: 1.25; }
.tile .t-price { font-family: var(--head); font-size: 20px; font-weight: 700; }
.tile .t-stock { font-size: 12px; color: var(--muted); }
.tile:disabled { opacity: .35; cursor: not-allowed; border-bottom-color: var(--line); }
.cart { position: sticky; top: 76px; }
.cart-items { list-style: none; margin: 0 0 12px; padding: 0; max-height: 40vh; overflow: auto; }
.cart-items li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font-size: 16px; cursor: pointer; }
.qty b { min-width: 22px; text-align: center; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--head); text-transform: uppercase; font-size: 28px; font-weight: 700; padding: 10px 0 14px; border-top: 2px solid var(--a1); }
.cart-empty { color: var(--muted); text-align: center; padding: 22px 0; }

.cart-bar { display: none; }
@media (max-width: 1000px) {
  .has-cart .cart-bar { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 25; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--a1); color: var(--a1-text); text-decoration: none; box-shadow: 0 10px 30px rgba(0,0,0,.6); font-size: 15px; }
  .has-cart .cart-bar > b { font-family: var(--head); font-size: 20px; }
  .has-cart .main { padding-bottom: 90px; }
  .cart { position: static; }
}

/* Protokoll */
.prose { white-space: pre-wrap; line-height: 1.65; }
.task-row { display: grid; grid-template-columns: 1fr 180px 150px auto; gap: 8px; align-items: end; margin-bottom: 8px; }
.task-row label { margin: 0; }
@media (max-width: 760px) { .task-row { grid-template-columns: 1fr 1fr; } .task-row label:first-child { grid-column: 1 / -1; } }
.done-text { text-decoration: line-through; color: var(--muted); }

/* Changelog */
.version { border-left: 3px solid var(--a1); padding-left: 16px; margin-bottom: 26px; }
.version h2 { margin-bottom: 2px; }
.version ul { margin: 10px 0 0; padding: 0; list-style: none; }
.version li { padding: 5px 0; display: flex; gap: 10px; align-items: baseline; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--text); border-bottom-color: var(--a1); }

.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); vertical-align: middle; }
.logo-preview { width: 160px; height: 160px; object-fit: contain; background: var(--bg2); border: 1px dashed var(--line); border-radius: 10px; padding: 10px; display: block; margin-bottom: 12px; }
.perm-group { margin-bottom: 14px; }
.perm-group h3 { margin-bottom: 6px; }

@media print {
  body { background: #fff; color: #000; }
  .topbar, .sidenav, .foot, .scarf, .no-print, .page-head .actions { display: none !important; }
  .card { border: 0; background: none; padding: 0; }
  .main { padding: 0; }
  .badge { border: 1px solid #999; background: none; color: #000; }
  td, th { border-color: #ccc; color: #000; }
}
