@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500&display=swap');

:root {
  --bg-void: #17141D;
  --bg-surface: #211C29;
  --bg-surface-2: #2A2333;
  --line: #3A3244;
  --text-hi: #F6F0EC;
  --text-mid: #B6A8C2;
  --text-low: #776985;
  --topbar-bg: #17141Dee;
  --page-bg: #0E0C12;
  --gradient-a: #3A2A4A55;
  --gradient-b: #4A344A44;
  --shadow-ambient: #00000088;
  --accent: #8C3FA6;
  --accent-soft: #8C3FA622;
}

.app.theme-light {
  --bg-void: #F3EEF7;
  --bg-surface: #FFFFFF;
  --bg-surface-2: #F1E9F6;
  --line: #E0D3EA;
  --text-hi: #2A2233;
  --text-mid: #6B5C7A;
  --text-low: #9A8CA8;
  --topbar-bg: #F3EEF7ee;
  --page-bg: #E9E2F0;
  --gradient-a: #8C3FA61a;
  --gradient-b: #4A344A11;
  --shadow-ambient: #00000022;
  --accent: #8C3FA6;
  --accent-soft: #8C3FA61a;
}

* { box-sizing: border-box; }
html, body { background: var(--page-bg); margin: 0; padding: 0; }

.app {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background:
    radial-gradient(ellipse 700px 400px at 85% 0%, var(--gradient-a), transparent),
    radial-gradient(ellipse 600px 400px at 10% 5%, var(--gradient-b), transparent),
    var(--bg-void);
  color: var(--text-hi);
  font-family: 'Inter', sans-serif;
  padding-bottom: 90px;
  position: relative;
  box-shadow: 0 0 60px var(--shadow-ambient);
  min-height: 100dvh;
}

/* ---------- Bottom-Nav ---------- */
.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 480px; display: flex;
  border-top: 1px solid var(--line); background: var(--topbar-bg); backdrop-filter: blur(8px);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 25;
}
.bottom-nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; color: var(--text-low); font-size: 11px; font-weight: 500;
  cursor: pointer; padding: 6px 0; font-family: 'Inter', sans-serif;
}
.bottom-nav-btn.is-active { color: var(--accent); }
.bottom-nav-btn:active { transform: scale(0.96); }

.editor-badge {
  font-size: 10.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent); border-radius: 20px; padding: 4px 9px; white-space: nowrap;
}

/* ---------- Regieplan ---------- */
.regie-half-label {
  padding: 16px 4px 8px; font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 16px; letter-spacing: .03em; color: var(--accent);
}
.regie-list { display: flex; flex-direction: column; }
.regie-row { display: flex; align-items: center; gap: 11px; padding: 10px 15px; border-top: 1px solid var(--line); }
.regie-row:first-child { border-top: none; }
.regie-num {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0; background: var(--bg-surface-2);
  color: var(--text-low); font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.regie-body { flex: 1; min-width: 0; }
.regie-title { font-weight: 600; font-size: 14px; }
.regie-artist { font-size: 12px; color: var(--accent); font-weight: 600; margin-top: 1px; }
.regie-divider { padding: 4px 15px; text-align: center; color: var(--text-low); font-size: 11px; letter-spacing: .1em; border-top: 1px dashed var(--line); }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--topbar-bg); backdrop-filter: blur(8px);
  z-index: 20;
  gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: var(--accent); color: var(--bg-void);
  display: flex; align-items: center; justify-content: center;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 17px; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 11px; color: var(--text-low); }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--bg-surface); border: 1px solid var(--line); color: var(--text-hi);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn.is-active { background: var(--accent); border-color: var(--accent); color: var(--bg-void); }
.icon-btn:active { transform: scale(0.94); }

/* ---------- Login / PIN ---------- */
.pin-screen {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  text-align: center;
}
.pin-mark {
  width: 64px; height: 64px; border-radius: 16px; background: var(--accent); color: var(--bg-void);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.pin-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 28px; letter-spacing: 0.03em; margin: 0 0 4px; }
.pin-sub { color: var(--text-mid); font-size: 14px; margin: 0 0 24px; }
.pin-input {
  width: 100%; max-width: 260px; text-align: center; letter-spacing: 0.4em;
  font-family: 'JetBrains Mono', monospace; font-size: 22px; padding: 14px 10px;
  background: var(--bg-surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text-hi);
  margin-bottom: 14px;
}
.pin-input:focus { outline: none; border-color: var(--accent); }
.pin-error { color: #E86A6A; font-size: 13px; margin: -4px 0 14px; }
.pin-submit {
  width: 100%; max-width: 260px; padding: 13px; border-radius: 12px; border: none;
  background: var(--accent); color: var(--bg-void); font-weight: 600; font-size: 15px; cursor: pointer;
}
.pin-submit:active { transform: scale(0.98); }
.pin-cancel {
  margin-top: 10px; background: transparent; border: none; color: var(--text-low); font-size: 13px; cursor: pointer;
}

/* ---------- Stop-Liste ---------- */
.stop-list { padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.stop-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--bg-surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px;
  cursor: pointer; color: var(--text-hi);
}
.stop-card:active { background: var(--bg-surface-2); }
.stop-date-badge {
  flex-shrink: 0; width: 50px; text-align: center; padding: 6px 0; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
}
.stop-date-badge .d { font-size: 17px; font-weight: 700; color: var(--accent); line-height: 1; }
.stop-date-badge .m { font-size: 10px; color: var(--text-low); text-transform: uppercase; margin-top: 2px; }
.stop-card-body { flex: 1; min-width: 0; }
.stop-card-city { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 17px; letter-spacing: .02em; }
.stop-card-arena { font-size: 12.5px; color: var(--text-mid); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stop-card svg.chev { color: var(--text-low); flex-shrink: 0; }
.empty-hint { text-align: center; color: var(--text-low); font-size: 13.5px; padding: 40px 20px; }

/* ---------- Stop-Detail Header ---------- */
.stop-header { padding: 18px 16px 14px; text-align: center; border-bottom: 1px solid var(--line); }
.stop-header-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 24px; letter-spacing: .02em; margin: 0 0 4px; }
.stop-header-sub { color: var(--text-low); font-size: 13px; }

/* ---------- Cards / Sections ---------- */
.section { padding: 14px 16px 0; }
.section-card { background: var(--bg-surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; padding: 13px 15px;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: .02em;
}
.section-head-actions { display: flex; gap: 6px; }

/* Day notes */
.day-notes-body { padding: 0 15px 14px; color: var(--text-mid); font-size: 13.5px; line-height: 1.5; white-space: pre-line; }
.day-notes-textarea {
  width: 100%; min-height: 80px; margin: 0 15px 14px; width: calc(100% - 30px);
  background: var(--bg-surface-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text-hi);
  padding: 10px; font-family: 'Inter', sans-serif; font-size: 13.5px; resize: vertical;
}

/* ---------- Schedule Liste ---------- */
.sched-list { display: flex; flex-direction: column; }
.sched-row {
  display: flex; align-items: flex-start; gap: 11px; padding: 12px 15px;
  border-top: 1px solid var(--line);
}
.sched-row:first-child { border-top: none; }
.sched-icon {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface-2); color: var(--accent);
}
.sched-icon.is-bus { background: var(--accent); color: var(--bg-void); }
.sched-body { flex: 1; min-width: 0; }
.sched-time {
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--text-low); margin-bottom: 2px;
}
.sched-title { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.sched-note { font-size: 12.5px; color: var(--text-mid); margin-top: 3px; line-height: 1.4; }
.sched-tags {
  display: inline-block; margin-top: 6px; padding: 3px 9px; border-radius: 20px;
  background: var(--bg-surface-2); border: 1px solid var(--line); color: var(--text-mid); font-size: 11.5px;
}
.sched-edit-controls { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.sched-edit-controls .icon-btn { width: 28px; height: 28px; border-radius: 7px; }
.sched-edit-row2 { display: flex; gap: 6px; margin-top: 8px; }

/* ---------- Info-Karten (Venue / Hotel) ---------- */
.info-row { display: flex; align-items: flex-start; gap: 9px; padding: 10px 15px; border-top: 1px solid var(--line); }
.info-row:first-child { border-top: none; }
.info-row svg { color: var(--text-low); flex-shrink: 0; margin-top: 2px; }
.info-row-title { font-weight: 600; font-size: 14px; }
.info-row-sub { font-size: 12.5px; color: var(--text-mid); margin-top: 1px; }
.info-row a { color: var(--accent); text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px; border-radius: 11px; border: none; cursor: pointer; font-size: 14px; font-weight: 600;
}
.btn.primary { background: var(--accent); color: var(--bg-void); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text-hi); }
.btn.danger { background: transparent; border: 1px solid #6B2C2C; color: #E86A6A; }
.btn:active { transform: scale(0.98); }
.btn-add {
  margin: 12px 15px 15px; width: calc(100% - 30px);
}

/* ---------- Editor Formular (Sheet) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: #000000aa; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 480px; background: var(--bg-surface); border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  max-height: 88vh; overflow-y: auto; border-top: 1px solid var(--line);
}
.sheet-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 20px; margin: 0 0 14px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11.5px; color: var(--text-low); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 5px; }
.field input[type="text"], .field input[type="time"], .field textarea {
  width: 100%; background: var(--bg-surface-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text-hi); padding: 10px 11px; font-family: 'Inter', sans-serif; font-size: 14px;
}
.field textarea { resize: vertical; min-height: 60px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.icon-toggle { display: flex; gap: 8px; }
.icon-toggle-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-surface-2);
  color: var(--text-mid); cursor: pointer; font-size: 13px;
}
.icon-toggle-btn.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.sheet-actions { display: flex; gap: 10px; margin-top: 6px; }
.sheet-actions .btn { flex: 1; }

/* ---------- Loading / misc ---------- */
.loading-hint { text-align: center; color: var(--text-low); font-size: 13px; padding: 30px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bg-surface); border: 1px solid var(--line); color: var(--text-hi);
  padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 60; box-shadow: 0 4px 20px #00000055;
}
