:root {
  --green: #3d8010;
  --green-dark: #0d3530;
  --bg: #eaf5ee;
  --card: #ffffff;
  --text: #0d3530;
  --muted: #5a6f6a;
  --danger: #c0392b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: 'DM Sans', system-ui, sans-serif; }
body { padding-bottom: 80px; }

.app-header { display:flex; justify-content:space-between; align-items:center; padding:14px 16px 4px; }
.app-header h1 { margin:0; font-size: 22px; font-weight:700; }
.app-header .brand { font-size:11px; font-weight:700; letter-spacing:1.5px; text-transform:uppercase; color:var(--green); line-height:1; margin-bottom:2px; }
.app-header-titles { display:flex; flex-direction:column; gap:2px; }
.user-chip { background: var(--card); padding:6px 10px; border-radius:16px; font-size:14px; margin:0; }

/* Auth-Page Brand */
.auth-page .brand { font-size:13px; font-weight:700; letter-spacing:2px; text-transform:uppercase; color:var(--green); text-align:center; margin-bottom:2px; }
.auth-page .brand-sub { font-size:12px; color:var(--muted); text-align:center; margin:0 0 24px 0; letter-spacing:0.5px; }
.auth-page h1 { font-size:24px; margin:0 0 18px 0; text-align:center; }

.day-tabs { display:flex; gap:8px; padding:0 16px; }
.day-tab { flex:1; text-align:center; padding:10px; background:var(--card); border-radius:8px; text-decoration:none; color:var(--text); font-weight:500; }
.day-tab.active { background: var(--green); color:#fff; }

.band-list { list-style:none; padding:0; margin:0; }

/* --- Time-Grid Lineup ---
   Vertikale Y-Achse = Zeit, X-Achse = Stages.
   --px-per-min steuert wie eng/weit der Tag wird. */
.timegrid {
  --px-per-min: 1.4px;
  --axis-w: 44px;
  display:grid;
  grid-template-columns: var(--axis-w) 1fr;
  gap:0;
  padding:4px 8px 16px;
  position:relative;
}
.timegrid-axis {
  position:relative;
  height: calc(var(--day-length-min) * var(--px-per-min) + 26px);
}
.hour-mark {
  position:absolute;
  top: calc(var(--at) * var(--px-per-min) + 26px);
  left:0;
  right:4px;
  font-size:10px;
  font-weight:600;
  color:var(--muted);
  transform: translateY(-50%);
  text-align:right;
  padding-right:6px;
  line-height:1;
}
.timegrid-cols {
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:4px;
}
.stage-col {
  position:relative;
}
.stage-col-head {
  margin:0 0 4px 0;
  font-size:12px;
  font-weight:700;
  text-align:center;
  color:var(--green-dark);
  text-transform:uppercase;
  letter-spacing:0.4px;
  height:22px;
  line-height:22px;
}
.stage-track {
  position:relative;
  height: calc(var(--day-length-min) * var(--px-per-min));
  background: rgba(255,255,255,0.4);
  border-radius:6px;
}
.hour-line {
  position:absolute;
  top: calc(var(--at) * var(--px-per-min));
  left:0;
  right:0;
  height:1px;
  background: rgba(13,53,48,0.08);
  pointer-events:none;
}
.band-card-btn {
  position:absolute;
  top: calc(var(--start) * var(--px-per-min));
  left:2px;
  right:2px;
  height: calc(var(--dur) * var(--px-per-min) - 2px);
  min-height: 28px;
  text-align:left;
  background:var(--card);
  border:1px solid rgba(13,53,48,0.1);
  border-radius:6px;
  padding:3px 6px;
  cursor:pointer;
  font-family:inherit;
  color:var(--text);
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  gap:1px;
  overflow:hidden;
  transition: background-color .12s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.band-card-btn.active {
  background: var(--green);
  color:#fff;
  border-color: var(--green-dark);
}
.band-card-btn .band-name {
  font-size:11px;
  font-weight:700;
  line-height:1.15;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.band-card-btn .band-time {
  font-size:10px;
  font-weight:500;
  color:var(--muted);
  line-height:1.1;
}
.band-card-btn.active .band-time { color:#d4e8c8; }
.band-check {
  position:absolute;
  top:3px;
  right:5px;
  font-size:11px;
  font-weight:700;
}

@media (min-width: 480px) {
  .timegrid { --px-per-min: 1.6px; --axis-w: 52px; padding:4px 16px 20px; }
  .band-card-btn { padding:4px 8px; }
  .band-card-btn .band-name { font-size:12px; }
  .band-card-btn .band-time { font-size:11px; }
}
@media (min-width: 720px) {
  .timegrid { --px-per-min: 1.8px; }
}

/* Stage-Badge bleibt für andere Views (Mein Tag, Crew) erhalten */
.stage-badge { background: var(--bg); padding:2px 8px; border-radius:6px; font-weight:500; }
.band-name { font-weight:600; }
.band-info { display:flex; gap:8px; font-size:13px; color: var(--muted); margin-top:2px; }

.bottom-nav { position:fixed; bottom:0; left:0; right:0; background:var(--card); display:flex; padding:8px 0; border-top:1px solid #ddd; }
.bottom-nav a { flex:1; text-align:center; padding:8px; color:var(--text); text-decoration:none; font-size:14px; }

.auth-page { max-width:420px; margin:40px auto; padding:0 16px; }
.auth-page form { display:flex; flex-direction:column; gap:14px; }
.auth-page label { display:flex; flex-direction:column; gap:4px; }
.auth-page .label-text { font-size:13px; font-weight:500; color:var(--muted); }
.auth-page input { width:100%; height:44px; padding:0 12px; border:1px solid #ccc; border-radius:8px; font-size:16px; font-family:inherit; box-sizing:border-box; background:var(--card); color:var(--text); }
.auth-page input:focus { outline:none; border-color:var(--green); box-shadow:0 0 0 3px rgba(61,128,16,0.15); }
.auth-page button { width:100%; height:48px; margin-top:6px; background:var(--green); color:#fff; border:none; border-radius:8px; font-size:16px; font-weight:600; font-family:inherit; cursor:pointer; }
.auth-page .hint { font-size:13px; color:var(--muted); margin-top:16px; }
.flash { background:#fef3c7; padding:8px 12px; border-radius:8px; }

.conflict-marker { color: var(--danger); font-weight:600; }

.crew-page { padding: 0 16px; }
.time-control { display:flex; justify-content:space-between; align-items:center; background:var(--card); padding:12px; border-radius:12px; margin-bottom:12px; }
.time-control button { background:var(--green); color:#fff; border:none; padding:6px 12px; border-radius:8px; cursor:pointer; }
.crew-list { list-style:none; padding:0; margin:0; }
.crew-row { display:flex; gap:12px; background:var(--card); padding:12px; border-radius:12px; margin-bottom:8px; align-items:center; }
.crew-row .avatar { font-size:32px; }
.status { font-size:13px; color:var(--muted); }
.status.conflict { color: var(--danger); font-weight:600; }
.overlap-list { list-style:none; padding:0; margin:8px 0 0 0; }
.overlap-row { background:var(--card); padding:12px; border-radius:12px; margin-bottom:8px; border-left:4px solid var(--green); }
h2 { margin: 16px 0 8px; font-size: 18px; }

.timeline { list-style:none; padding:8px 16px; margin:0; }
.timeline-row { display:flex; gap:12px; background:var(--card); padding:12px; border-radius:12px; margin-bottom:8px; align-items:center; }
.timeline-row.past { opacity:0.4; }
.timeline-row.conflict { border-left:4px solid var(--danger); }
.time-block { text-align:center; min-width:60px; }
.time-day { font-size:11px; color:var(--muted); text-transform:uppercase; }
.time-start { font-size:18px; font-weight:600; }
.status { font-size:13px; color: var(--muted); }
.empty { text-align:center; padding:40px 16px; color: var(--muted); }

.admin-page { padding: 0 16px; }
.admin-band, .admin-user { background: var(--card); padding:8px 12px; border-radius:8px; margin-bottom:8px; }
.admin-page form { display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.admin-page button.danger { background: var(--danger); color:#fff; border:none; padding:8px; border-radius:6px; }

.bottom-nav a { display:flex; flex-direction:column; align-items:center; font-size:11px; gap:2px; padding:6px 4px; }
.bottom-nav a.active { color: var(--green); font-weight:600; }
.bottom-nav .icon { font-size:18px; }

@media (min-width: 720px) {
  body { max-width: 720px; margin: 0 auto; }
}
