/* Wochenabgabe dashboard – dark neon-purple street theme */

@font-face { font-family: "Fraktur"; src: url("fonts/unifrakturcook-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("fonts/rajdhani-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("fonts/rajdhani-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("fonts/rajdhani-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #08050d;
  --card: rgba(22, 12, 34, 0.84);
  --card-solid: #160c22;
  --card-hover: rgba(52, 20, 78, 0.55);
  --input: rgba(10, 5, 16, 0.75);
  --line: rgba(196, 92, 255, 0.16);
  --line-strong: rgba(214, 60, 255, 0.45);
  --text: #f1e8fa;
  --muted: #a896bd;
  --accent: #d63cff;
  --accent-2: #8f2bff;
  --accent-soft: rgba(214, 60, 255, 0.14);
  --glow: 0 0 22px rgba(214, 60, 255, 0.35);
  --up: #43e397;
  --down: #ff5577;
  --warn: #ffb547;
  --gold: #ffd36b;
  --silver: #d9d4e6;
  --bronze: #e39a5f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 500 15px/1.45 "Rajdhani", "Segoe UI", system-ui, sans-serif;
  position: relative;
}
/* blurred alley artwork behind everything */
body::before {
  content: ""; position: fixed; inset: -40px; z-index: -2;
  background: url("img/background.jpg") center / cover no-repeat;
  filter: blur(18px) brightness(0.55) saturate(1.35);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(214, 60, 255, 0.20), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(143, 43, 255, 0.18), transparent 50%),
    linear-gradient(180deg, rgba(8, 5, 13, 0.25), rgba(8, 5, 13, 0.72));
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #ef8cff; text-shadow: 0 0 10px rgba(214, 60, 255, 0.6); }
h1 {
  margin: 0; font-size: 28px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: linear-gradient(90deg, #fff 0%, #f0b8ff 45%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h2 { font-family: "Fraktur", "Old English Text MT", serif; font-weight: 700; font-size: 24px; margin: 0 0 10px; color: #f6d8ff; text-shadow: 0 0 14px rgba(214, 60, 255, 0.45); }
h3 { font-size: 15px; margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .06em; color: #e7c8ff; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: #e9c9ff; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 10px 22px;
  background: rgba(10, 5, 16, 0.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-strong); box-shadow: 0 4px 30px rgba(214, 60, 255, 0.15);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-shadow: none; color: var(--text); }
.brand img { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); box-shadow: var(--glow); object-fit: cover; }
.brand span { font-family: "Fraktur", serif; font-size: 26px; line-height: 1; color: #f8dcff; text-shadow: 0 0 16px rgba(214, 60, 255, 0.7); }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.topbar nav a {
  color: var(--muted); padding: 6px 11px; border-radius: 8px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; font-size: 13.5px; transition: all .15s;
}
.topbar nav a:hover { color: var(--text); background: var(--accent-soft); text-shadow: none; }
.topbar nav a.active { color: #fff; background: linear-gradient(135deg, rgba(214, 60, 255, .35), rgba(143, 43, 255, .25)); box-shadow: inset 0 0 0 1px var(--line-strong), var(--glow); }
.logout { display: flex; gap: 10px; align-items: center; }

main { max-width: 1320px; margin: 0 auto; padding: 26px 18px 70px; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.weeknav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ cards & tiles */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  margin-bottom: 18px; overflow-x: auto; backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.card.narrow { max-width: 400px; margin: 0 auto; }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cardhead h2 { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile {
  position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 18px; backdrop-filter: blur(10px);
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); box-shadow: var(--glow); }
.tile .label { color: var(--muted); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.tile .value { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; color: #fff; text-shadow: 0 0 18px rgba(214, 60, 255, 0.45); }
.tile .sub { color: var(--muted); font-size: 13.5px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }

/* ------------------------------------------------------------------ podium (top 3) */
.podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.podium .place {
  position: relative; overflow: hidden; border-radius: 16px; padding: 18px 20px 16px;
  background: linear-gradient(145deg, rgba(64, 18, 96, 0.75), rgba(18, 9, 28, 0.9));
  border: 1px solid var(--line-strong); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
.podium .place.r1 { border-color: rgba(255, 211, 107, 0.55); box-shadow: 0 0 34px rgba(214, 60, 255, 0.35), 0 10px 40px rgba(0, 0, 0, .5); }
.podium .place::after {
  content: attr(data-rank); position: absolute; right: 14px; top: -14px;
  font-family: "Fraktur", serif; font-size: 110px; line-height: 1; color: rgba(214, 60, 255, 0.16);
}
.podium .medal { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.podium .r1 .medal { color: var(--gold); }
.podium .r2 .medal { color: var(--silver); }
.podium .r3 .medal { color: var(--bronze); }
.podium .name { display: block; font-size: 21px; font-weight: 700; color: #fff; margin: 4px 0 6px; position: relative; z-index: 1; }
.podium .units { font-size: 30px; font-weight: 700; color: #fff; text-shadow: 0 0 16px rgba(214, 60, 255, 0.6); }
.podium .units small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.podium .meta { color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------------------ tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
th.center { text-align: center; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--card-hover); }
tfoot td { font-weight: 700; border-top: 1px solid var(--line-strong); border-bottom: none; color: #fff; background: rgba(214, 60, 255, 0.07); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.strong { font-weight: 700; color: #fff; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.up { color: var(--up); }
.down { color: var(--down); }
tr.voided td { opacity: .5; }
tr.voided td .pill { opacity: 1; }

.rank {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font-weight: 700; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
}
.rank.r1 { background: linear-gradient(135deg, #ffe39a, #d79b2b); color: #2a1600; border: none; box-shadow: 0 0 14px rgba(255, 211, 107, .5); }
.rank.r2 { background: linear-gradient(135deg, #f2eefa, #a59db8); color: #1c1724; border: none; }
.rank.r3 { background: linear-gradient(135deg, #f3b27c, #a75e2c); color: #2a1300; border: none; }

.bar { height: 5px; margin-top: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; min-width: 90px; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); box-shadow: 0 0 10px rgba(214, 60, 255, 0.7); }

/* ------------------------------------------------------------------ pills, badges, flash */
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--accent-soft); color: #eaa8ff; border: 1px solid rgba(214, 60, 255, .25); }
.pill.accepted { background: rgba(67, 227, 151, 0.12); color: var(--up); border-color: rgba(67, 227, 151, .3); }
.pill.voided, .pill.deleted { background: rgba(255, 85, 119, 0.12); color: var(--down); border-color: rgba(255, 85, 119, .3); }
.pill.unparsed, .pill.edited { background: rgba(255, 181, 71, 0.12); color: var(--warn); border-color: rgba(255, 181, 71, .3); }
.badge { background: linear-gradient(135deg, #ff4f8b, var(--accent)); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11.5px; font-weight: 700; box-shadow: 0 0 10px rgba(255, 79, 139, .6); }
.flash { padding: 11px 15px; border-radius: 10px; margin-bottom: 16px; background: var(--accent-soft); border: 1px solid var(--line-strong); }
.flash.error { background: rgba(255, 85, 119, 0.12); color: #ff9db1; border-color: rgba(255, 85, 119, .35); }
.flash.ok { background: rgba(67, 227, 151, 0.1); color: var(--up); border-color: rgba(67, 227, 151, .3); }

/* ------------------------------------------------------------------ forms & buttons */
input, select, textarea, button, .btn { font: inherit; color: var(--text); }
input, select, textarea {
  background: var(--input); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; max-width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(214, 60, 255, 0.2); }
select option { background: var(--card-solid); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(.7); }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; }
input.tiny { width: 95px; padding: 3px 7px; font-size: 12.5px; }
button, .btn {
  display: inline-block; cursor: pointer; border-radius: 9px; padding: 7px 15px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; font-size: 13.5px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 1px solid transparent;
  box-shadow: 0 0 16px rgba(214, 60, 255, 0.35); transition: transform .1s, box-shadow .15s, filter .15s;
}
button:hover, .btn:hover { filter: brightness(1.12); box-shadow: 0 0 24px rgba(214, 60, 255, 0.6); text-decoration: none; color: #fff; text-shadow: none; }
button:active { transform: translateY(1px); }
.btn, button.secondary { background: rgba(255, 255, 255, 0.04); border-color: var(--line-strong); box-shadow: none; color: var(--text); }
.btn:hover, button.secondary:hover { background: var(--accent-soft); box-shadow: var(--glow); }
.btn.active { background: linear-gradient(135deg, rgba(214, 60, 255, .35), rgba(143, 43, 255, .25)); border-color: var(--accent); }
button.small, .btn.small { padding: 3px 10px; font-size: 12px; }
button.danger { background: linear-gradient(135deg, #ff5577, #c3245a); box-shadow: 0 0 12px rgba(255, 85, 119, .35); }
button.link { background: none; border: none; color: var(--accent); padding: 0; box-shadow: none; text-transform: none; letter-spacing: 0; font-weight: 600; }
button.link:hover { filter: none; box-shadow: none; color: #ef8cff; }
form.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
form.stack, .stack { display: flex; flex-direction: column; gap: 11px; }
.stack label, .filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.stack label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.stack button { align-self: flex-start; }
.stack h2 { margin: 14px 0 0; }
.stack h2:first-of-type { margin-top: 0; }
ul.plain { list-style: none; padding: 0; margin: 0 0 8px; }
pre.message { background: var(--input); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 11px; white-space: pre-wrap; margin: 0 0 8px; font-family: ui-monospace, Consolas, monospace; }
.reason { color: var(--warn); margin: 0 0 10px; }
code.wrap { white-space: pre-wrap; word-break: break-word; }

/* ------------------------------------------------------------------ login */
.login-wrap { min-height: calc(100vh - 100px); display: grid; place-items: center; }
.login-card { width: 100%; max-width: 400px; text-align: left; }
.login-logo { display: block; width: 120px; height: 120px; margin: 4px auto 10px; border-radius: 22px; object-fit: cover; border: 1px solid var(--line-strong); box-shadow: 0 0 40px rgba(214, 60, 255, 0.55); }
.login-title { font-family: "Fraktur", serif; font-size: 40px; text-align: center; margin: 0 0 14px; color: #f8dcff; text-shadow: 0 0 20px rgba(214, 60, 255, 0.8); }
.login-card button { width: 100%; align-self: stretch; padding: 10px; }

@media (max-width: 900px) {
  .topbar { position: static; padding: 10px 14px; gap: 8px 12px; }
  .logout { margin-left: auto; }
  .topbar nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .topbar nav a { white-space: nowrap; }
}
@media (max-width: 640px) {
  .brand span { font-size: 22px; }
  .logout .muted { display: none; }
  main { padding: 18px 12px 60px; }
  h1 { font-size: 22px; }
  .tile .value { font-size: 28px; }
}
