/* ============================================================
   Thömus Weihnachtsgewinnspiel — Shop-Backend
   Design wie das Backend des Sommergewinnspiels (Thömus Design System).
   ============================================================ */
@font-face { font-family: 'Galano Grotesque'; src: url('../assets/fonts/GalanoGrotesque-Regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Galano Grotesque'; src: url('../assets/fonts/GalanoGrotesque-SemiBold.otf') format('opentype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Galano Grotesque'; src: url('../assets/fonts/GalanoGrotesque-Bold.otf') format('opentype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Galano Grotesque'; src: url('../assets/fonts/GalanoGrotesque-Heavy.otf') format('opentype'); font-weight: 800 900; font-display: swap; }

:root {
  --tho-red: #E30613;
  --tho-red-dark: #B5040F;
  --tho-black: #0D0D0D;
  --tho-gray-900: #1A1A1A;
  --tho-gray-700: #444444;
  --tho-gray-600: #666666;
  --tho-gray-400: #999999;
  --tho-gray-300: #CCCCCC;
  --tho-gray-200: #E5E5E5;
  --tho-gray-100: #F5F5F5;
  --tho-white: #FFFFFF;
  --font: 'Galano Grotesque', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); color: var(--tho-gray-900); background: var(--tho-gray-100); -webkit-font-smoothing: antialiased; }
a { color: var(--tho-red); text-decoration: none; }
button, input, select { font-family: var(--font); }
h1, h2, h3, h4 { font-weight: 800; line-height: 1.1; text-transform: uppercase; letter-spacing: -0.01em; color: var(--tho-gray-900); }
.hidden { display: none !important; }

.btn { display: inline-block; font-size: 15px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  border: none; cursor: pointer; transition: background 150ms, color 150ms, border-color 150ms; text-align: center; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-red { background: var(--tho-red); color: var(--tho-white); padding: 18px 40px; }
.btn-red:hover { background: var(--tho-red-dark); }
.btn-outline-dark { background: transparent; color: var(--tho-gray-900); border: 2px solid var(--tho-gray-900); padding: 12px 24px; font-size: 13px; }
.btn-outline-dark:hover { background: var(--tho-gray-900); color: var(--tho-white); }

.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; padding: 5px 12px; align-self: flex-start; }
.badge-red { background: var(--tho-red); color: var(--tho-white); }
.badge-dark { background: var(--tho-gray-700); color: var(--tho-white); }
.badge-subtle { background: var(--tho-gray-200); color: var(--tho-gray-600); }
.badge-outline { background: transparent; color: var(--tho-gray-900); border: 1px solid var(--tho-gray-900); }

.lang-switch { display: flex; align-items: center; gap: 4px; }
.lang-switch button { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; padding: 8px 12px; border: none; cursor: pointer; background: transparent; color: var(--tho-gray-600); }
.lang-switch button.active { background: var(--tho-black); color: var(--tho-white); }
.admin-header .lang-switch button { color: var(--tho-gray-400); }
.admin-header .lang-switch button.active { background: var(--tho-white); color: var(--tho-black); }

.login-screen { background: var(--tho-black); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--tho-white); padding: 56px 56px 48px; max-width: 420px; width: 100%; display: flex; flex-direction: column; gap: 24px; }
.login-card img { height: 40px; display: block; align-self: center; }
.login-card .head { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.login-card h3 { font-size: 26px; }
.login-card .head p { font-size: 14px; color: var(--tho-gray-600); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--tho-gray-700); }
.field input {
  font-family: var(--font); font-size: 15px; padding: 14px;
  border: 1px solid var(--tho-gray-300); background: var(--tho-white); color: var(--tho-gray-900); outline: none; width: 100%;
}
.login-error { margin-top: -12px; font-size: 13px; font-weight: 600; color: var(--tho-red); }
.login-card .btn-red { padding: 16px; font-size: 14px; }

/* ── Admin: Prüfmaske ────────────────────────────────────── */
.admin-screen { background: var(--tho-gray-100); min-height: 100vh; }
.admin-header { background: var(--tho-black); padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-header .left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.admin-header img { height: 32px; display: block; background: var(--tho-white); padding: 3px 8px; }
.admin-header .title { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tho-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-header .logout {
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  background: none; border: 1px solid var(--tho-gray-700); color: var(--tho-gray-300); padding: 8px 16px; cursor: pointer; flex-shrink: 0;
}
.admin-header .logout:hover { border-color: var(--tho-white); color: var(--tho-white); }
.admin-main { max-width: 820px; margin: 0 auto; padding: 48px 24px 64px; display: flex; flex-direction: column; gap: 32px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button {
  font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 12px 28px; border: none; cursor: pointer; background: transparent; color: var(--tho-gray-600);
}
.tabs button.active { background: var(--tho-black); color: var(--tho-white); }

.panel { background: var(--tho-white); padding: 40px; display: flex; flex-direction: column; gap: 24px; }
.panel .label { font-size: 12px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--tho-gray-600); }
.panel select {
  font-family: var(--font); font-size: 16px; font-weight: 600; padding: 12px 14px;
  border: 2px solid var(--tho-gray-900); background: var(--tho-white); color: var(--tho-gray-900);
  outline: none; width: 100%; cursor: pointer;
}
.check-row { display: flex; gap: 12px; }
.check-row input {
  font-family: var(--font); font-size: 32px; font-weight: 800; letter-spacing: 0.2em; padding: 12px 18px;
  border: 2px solid var(--tho-gray-900); background: var(--tho-white); color: var(--tho-gray-900);
  outline: none; width: 100%; text-align: center;
}
.check-row .btn-red { padding: 0 40px; font-size: 14px; flex-shrink: 0; }

.warn-banner { background: var(--tho-black); padding: 20px 28px; display: flex; align-items: center; gap: 14px; }
.warn-banner p { font-size: 15px; font-weight: 600; color: var(--tho-white); }

.result-card { background: var(--tho-white); padding: 40px; display: flex; flex-direction: column; gap: 16px; }
.result-card.winner { border-top: 4px solid var(--tho-red); }
.result-card.redeemed { border-top: 4px solid var(--tho-gray-600); }
.result-card.loser { border-top: 4px solid var(--tho-gray-300); }
.result-card.invalid { border-top: 4px solid var(--tho-black); }
.result-card h3 { font-size: 30px; }
.result-card h4 { font-size: 22px; }
.result-card .cust-label { font-size: 13px; color: var(--tho-gray-400); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.result-card .cust-name { font-size: 18px; font-weight: 600; color: var(--tho-gray-900); }
.result-card .note { font-size: 13px; color: var(--tho-gray-400); }
.result-card .text { font-size: 15px; color: var(--tho-gray-600); }
.result-card .btn-red { align-self: flex-start; padding: 16px 32px; font-size: 14px; }

.table-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.table-head h4 { font-size: 22px; }
.table-head .count { font-size: 13px; color: var(--tho-gray-400); }
.panel .sub { font-size: 14px; color: var(--tho-gray-600); }
.filter-row { display: flex; gap: 12px; flex-wrap: wrap; }
.filter-row input {
  font-family: var(--font); font-size: 15px; padding: 12px 14px; border: 1px solid var(--tho-gray-300);
  background: var(--tho-white); color: var(--tho-gray-900); outline: none; flex: 1; min-width: 220px;
}
.filter-row select { flex: 0 1 auto; width: auto; border: 1px solid var(--tho-gray-300); font-size: 14px; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-family: var(--font); }
table.data th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--tho-gray-600); padding: 10px 16px 10px 0; border-bottom: 2px solid var(--tho-gray-900); white-space: nowrap;
}
table.data td { font-size: 15px; color: var(--tho-gray-900); padding: 12px 16px 12px 0; border-bottom: 1px solid var(--tho-gray-200); }
table.data td.code { font-weight: 800; letter-spacing: 0.08em; }
table.data td.muted { color: var(--tho-gray-600); }
.empty-note { font-size: 14px; color: var(--tho-gray-400); padding: 16px 0; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
}
@media (max-width: 640px) {
  .login-card { padding: 40px 28px 36px; }
  .panel { padding: 24px 20px; }
  .check-row { flex-direction: column; }
  .check-row .btn-red { padding: 16px; }
  .admin-header .title { font-size: 11px; }
}

/* ── Weihnachten: Ergänzungen ────────────────────────────── */
.admin-main { max-width: 980px; }
.admin-header .right { display: flex; align-items: center; gap: 12px; }
.check-row input { font-size: 24px; letter-spacing: 0.08em; text-transform: uppercase; }
.check-row input::placeholder { font-size: 15px; font-weight: 600; letter-spacing: .02em; text-transform: none; color: var(--tho-gray-400); }
.result-card.notissued { border-top: 4px solid var(--tho-red); background: #FFF1F2; }
.result-card.notissued h4 { color: var(--tho-red); }
.result-card.goodie { border-top: 4px solid var(--tho-gray-900); }
.result-card .meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.result-card .ok { font-size: 15px; font-weight: 700; color: #137333; }
.result-card .err { font-size: 15px; font-weight: 700; color: var(--tho-red); }
.status-line { font-size: 14px; color: var(--tho-gray-600); }
.status-line strong { color: var(--tho-gray-900); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile { background: var(--tho-gray-100); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.tile .v { font-size: 30px; font-weight: 800; line-height: 1; color: var(--tho-gray-900); font-variant-numeric: tabular-nums; }
.tile .k { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tho-gray-600); }
.tile.warn .v { color: var(--tho-red); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.total td { font-weight: 800; border-bottom: 2px solid var(--tho-gray-900); }
.row-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; }
.pill.redeemed { background: var(--tho-gray-700); color: #fff; }
.pill.issued { background: var(--tho-gray-200); color: var(--tho-gray-700); }
.pill.bad { background: var(--tho-red); color: #fff; }
@media (max-width: 640px) { .admin-header .title { display: none; } }
