:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, .22);
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --danger: #ef4444;
  --warning: #f97316;
  --watch: #eab308;
  --ok: #22c55e;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(14,165,233,.18), transparent 30%), var(--bg);
  color: var(--text);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px 22px;
  background: rgba(15, 23, 42, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.logo {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  border-radius: 14px; color: #020617; font-weight: 900;
}
.brand small { display: block; color: var(--muted); margin-top: 2px; }
.topnav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.navbtn, .langbtn, .secondary, .primary, .logout {
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px;
  color: var(--text); background: rgba(255,255,255,.04); text-decoration: none;
}
.navbtn.active, .primary { background: var(--accent); color: #04111d; border-color: var(--accent); font-weight: 800; }
.secondary:hover, .navbtn:hover, .langbtn:hover { border-color: var(--accent); }
.userbar { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.langbtn.active { background: var(--panel-2); color: var(--accent); }
.app-shell { padding: 22px; max-width: 1680px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.span-2, .dashboard-grid > .weather-card, .dashboard-grid > .chat-card { grid-column: 1 / -1; }
.card {
  background: linear-gradient(180deg, rgba(31,41,55,.94), rgba(17,24,39,.96));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); min-width: 0;
}
.card h1, .card h2, .view-head h1 { margin: 0 0 4px; }
.card-head, .view-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.view-head { margin-bottom: 18px; }
.muted { color: var(--muted); }
.timeline-list { display: grid; gap: 10px; }
.dashboard-grid > .card:first-child { min-height: 520px; }
.timeline-item {
  display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; align-items: center;
  padding: 12px; border: 1px solid var(--line); background: rgba(15,23,42,.48); border-radius: 14px;
}
.time-pill { color: #bae6fd; font-weight: 800; }
.stage-pill, .status-pill, .priority-pill, .risk-pill {
  display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 8px; font-size: 12px; color: var(--muted); margin: 2px;
}
.status-missing, .status-problem, .risk-danger { color: #fecaca; border-color: rgba(239,68,68,.45); background: rgba(239,68,68,.12); }
.status-received, .risk-watch { color: #fef3c7; border-color: rgba(234,179,8,.45); background: rgba(234,179,8,.12); }
.status-approved, .risk-ok { color: #bbf7d0; border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.12); }
.risk-warning { color: #fed7aa; border-color: rgba(249,115,22,.48); background: rgba(249,115,22,.14); }
.weather-box table, .table-wrap table { width: 100%; border-collapse: collapse; }
.weather-card { min-height: 360px; }
.weather-card .weather-box {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.weather-card .weather-summary { grid-column: 1; }
.weather-card .weather-box table { grid-column: 2; grid-row: 1 / span 3; }
.weather-card .weather-box > button { grid-column: 1; justify-self: start; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 13px; }
.weather-summary { padding: 12px; border-radius: 14px; border: 1px solid var(--line); margin-bottom: 12px; }
.weather-summary.ok { border-color: rgba(34,197,94,.4); }
.weather-summary.watch { border-color: rgba(234,179,8,.5); }
.weather-summary.warning { border-color: rgba(249,115,22,.5); }
.weather-summary.danger { border-color: rgba(239,68,68,.55); }
.weather-watch td { background: rgba(234,179,8,.06); }
.weather-warning td { background: rgba(249,115,22,.08); }
.weather-danger td { background: rgba(239,68,68,.08); }
.status-list, .compact-list, .files-list { display: grid; gap: 10px; }
.status-row, .compact-item, .file-item, .contact-card {
  padding: 12px; border: 1px solid var(--line); background: rgba(15,23,42,.42); border-radius: 14px;
}
.bands-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.band-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(160px, .8fr) minmax(180px, .8fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
}
.compact-card { box-shadow: none; }
.band-problems-filter { align-self: center; margin-top: 22px; }
.band-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.band-problem-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(249,115,22,.45);
  color: #fed7aa;
  background: rgba(249,115,22,.14);
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 900;
}
.status-day-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(56,189,248,.28);
  border-radius: 12px;
  background: rgba(14,165,233,.08);
  color: #dff6ff;
}
.status-day-head span { color: var(--muted); font-size: 13px; }
.band-card { display: grid; gap: 10px; }
.band-card h3 { margin: 0; }
.band-meta { color: var(--muted); font-size: 14px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 4px; }
.chat-card { min-height: 420px; display: flex; flex-direction: column; }
.chat-messages {
  flex: 1; overflow: auto; max-height: 360px; padding: 10px; background: rgba(15,23,42,.35); border-radius: 14px; border: 1px solid var(--line);
}
.chat-message { margin-bottom: 10px; display: flex; gap: 10px; align-items: flex-start; }
.chat-bubble { background: rgba(255,255,255,.06); padding: 10px 12px; border-radius: 14px; max-width: 85%; }
.chat-bubble.important { border: 1px solid rgba(249,115,22,.6); background: rgba(249,115,22,.1); }
.chat-meta { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.chat-form { margin-top: 10px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
input, select, textarea {
  width: 100%; margin-top: 6px; padding: 10px 11px; color: var(--text);
  background: rgba(15,23,42,.78); border: 1px solid var(--line); border-radius: 12px;
}
textarea { resize: vertical; }
label { display: block; color: var(--muted); font-size: 13px; font-weight: 650; }
.inline-check { display: inline-flex; align-items: center; gap: 8px; }
.inline-check input { width: auto; margin: 0; }
.form-grid, .settings-form, .upload-form, .band-upload-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.settings-form .inline-check, .upload-form button, .band-upload-form button, .settings-form button { align-self: end; }
.modal {
  display: none; position: fixed; inset: 0; z-index: 50; background: rgba(2,6,23,.78);
  padding: 20px; overflow: auto;
}
.modal.open { display: grid; place-items: start center; }
.modal-content {
  width: min(720px, 100%); margin-top: 30px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 22px; padding: 22px; box-shadow: var(--shadow); position: relative;
}
.modal-content.wide { width: min(980px, 100%); }
.modal-close { position: absolute; right: 16px; top: 12px; border: 0; background: transparent; color: var(--muted); font-size: 30px; }
.modal-form { display: grid; gap: 12px; }

.band-files-panel {
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 12px;
}
.compact-head { margin-bottom: 0; }
.band-files-panel h3 { margin: 0 0 4px; }

.document-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.doc-card {
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.42);
  border-radius: 14px;
  display: grid;
  gap: 10px;
}
.doc-card.is-missing {
  border-color: rgba(239,68,68,.28);
}
.doc-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.doc-card-head h4 {
  margin: 0;
}
.doc-card-body {
  display: grid;
  gap: 8px;
}
.doc-file {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
}
.missing-doc {
  margin: 0;
}

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); }
.login-card form { display: grid; gap: 14px; }
.alert { padding: 10px; border-radius: 12px; margin: 10px 0; }
.alert.danger { background: rgba(239,68,68,.14); border: 1px solid rgba(239,68,68,.45); }
.language-row { display: flex; gap: 12px; margin-top: 16px; }

.location-search { grid-column: 1 / -1; }
.location-search-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.location-results { display: grid; gap: 8px; margin-top: 10px; }
.location-result {
  text-align: left; width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px;
  color: var(--text); background: rgba(15,23,42,.52);
}
.location-result:hover { border-color: var(--accent); }
.location-result span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.alert.ok { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.4); }
@media (max-width: 1050px) {
  .topbar { grid-template-columns: 1fr; }
  .topnav { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
@media (max-width: 640px) {
  .app-shell, .topbar { padding: 14px; }
  .timeline-item { grid-template-columns: 1fr; }
  .card-head, .view-head { flex-direction: column; }
  th:nth-child(n+4), td:nth-child(n+4) { display: none; }
  .chat-form, .location-search-row { grid-template-columns: 1fr; }
}


/* Phase 2 */
.chat-card label select { min-width: 220px; }
.pinned-messages { display: grid; gap: 8px; margin-bottom: 10px; }
.pinned-title { color: #fef3c7; font-weight: 800; font-size: 13px; }
.pinned-item {
  padding: 9px 11px; border: 1px solid rgba(234,179,8,.35); background: rgba(234,179,8,.08);
  border-radius: 12px; font-size: 13px;
}
.chat-bubble.pinned { border: 1px solid rgba(234,179,8,.45); }
.chat-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chat-form { grid-template-columns: 1fr auto; align-items: end; }
.message-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
button.tiny, .tiny { padding: 5px 8px; font-size: 12px; border-radius: 9px; }
.file-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.active-file { border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.06); }
.doc-preview { margin-top: -2px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(15,23,42,.55); }
.doc-preview img { width: 100%; max-height: 320px; object-fit: contain; display: block; background: rgba(2,6,23,.35); }
.doc-preview-details { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: rgba(15,23,42,.35); }
.doc-preview-details iframe { width: 100%; height: 360px; border: 0; margin-top: 8px; border-radius: 8px; background: #fff; }
.old-files { border-top: 1px solid var(--line); padding-top: 8px; }
.old-files summary { color: var(--muted); cursor: pointer; font-weight: 700; }
@media (max-width: 640px) {
  .chat-form { grid-template-columns: 1fr; }
  .chat-actions { justify-content: flex-start; }
  .doc-preview-details iframe { height: 260px; }
}

/* Phase 3 */
.navlink {
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px;
  color: var(--text); background: rgba(255,255,255,.04); text-decoration: none;
}
.navlink:hover { border-color: var(--accent); }
.band-portal-panel {
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 12px;
}
.portal-link-row {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: end;
}
.portal-link-row input { margin-top: 0; font-size: 12px; }
.portal-body { min-height: 100vh; }
.portal-shell { max-width: 1100px; margin: 0 auto; padding: 22px; display: grid; gap: 16px; }
.portal-card h1 { margin: 8px 0 4px; }
.portal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.compact-language { margin-top: 0; }
.portal-doc-grid { margin-top: 16px; }
@media (max-width: 760px) {
  .portal-link-row { grid-template-columns: 1fr; }
  .portal-head { display: block; }
}

/* Phase 4 timeline and chat pin controls */
.timeline-day-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 8px;
}
.day-tab {
  min-width: 112px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(15,23,42,.42);
  text-align: left;
}
.day-tab span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.day-tab strong {
  display: block;
  margin-top: 2px;
}
.day-tab.active {
  border-color: var(--accent);
  background: rgba(14,165,233,.16);
}
.pinned-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}
@media (max-width: 640px) {
  .day-tab { min-width: 98px; }
  .pinned-item { grid-template-columns: 1fr; }
}

/* Phase 4 full timeline upgrade */
.timeline-controls {
  display: grid;
  gap: 10px;
  margin: 8px 0 14px;
}
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.38);
  border-radius: 999px;
  width: fit-content;
}
.segbtn {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
}
.segbtn.active {
  color: #04111d;
  background: var(--accent);
  font-weight: 800;
}
.timeline-filters {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(150px, 220px) auto;
  gap: 10px;
  align-items: end;
}
.timeline-filters select { margin-top: 5px; }
.timeline-problems { align-self: center; margin-top: 20px; }
.timeline-content { min-width: 0; }
.timeline-grid-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15,23,42,.25);
}
.timeline-grid-head,
.timeline-grid-body {
  display: grid;
  grid-template-columns: 72px repeat(var(--stage-count), minmax(220px, 1fr));
  min-width: calc(72px + (var(--stage-count) * 220px));
}
.timeline-grid-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(15,23,42,.96);
  border-bottom: 1px solid var(--line);
}
.timeline-time-head,
.timeline-stage-head {
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.timeline-stage-head {
  color: var(--text);
  border-left: 1px solid var(--line);
}
.timeline-grid-body {
  position: relative;
}
.timeline-time-axis,
.timeline-stage-lane {
  position: relative;
  min-height: 360px;
}
.timeline-time-axis {
  border-right: 1px solid var(--line);
}
.time-tick {
  position: absolute;
  left: 8px;
  right: 8px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.timeline-stage-lane {
  border-left: 1px solid rgba(148,163,184,.12);
}
.lane-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(148,163,184,.12);
}
.timeline-block {
  position: absolute;
  left: 8px;
  right: 8px;
  display: grid;
  align-content: start;
  gap: 2px;
  overflow: hidden;
  text-align: left;
  border: 1px solid rgba(56,189,248,.38);
  border-radius: 12px;
  padding: 7px 8px;
  color: var(--text);
  background: rgba(14,165,233,.13);
  box-shadow: none;
}
.timeline-block strong {
  font-size: 14px;
  line-height: 1.18;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-block span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-block:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.timeline-block.type-performance {
  background: rgba(14,165,233,.18);
  border-color: rgba(56,189,248,.55);
}
.timeline-block.type-soundcheck {
  background: rgba(167,139,250,.14);
  border-color: rgba(167,139,250,.42);
}
.timeline-block.type-arrival,
.timeline-block.type-loadout {
  background: rgba(148,163,184,.10);
  border-color: rgba(148,163,184,.32);
}
.timeline-block.type-changeover {
  background: repeating-linear-gradient(135deg, rgba(234,179,8,.16), rgba(234,179,8,.16) 8px, rgba(234,179,8,.08) 8px, rgba(234,179,8,.08) 16px);
  border-color: rgba(234,179,8,.42);
}
.timeline-block.has-problems {
  border-color: rgba(249,115,22,.65);
}
.timeline-warning {
  display: inline-flex;
  width: fit-content;
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #fed7aa;
  background: rgba(249,115,22,.18);
  border: 1px solid rgba(249,115,22,.42);
  font-size: 11px !important;
  font-weight: 800;
}
.now-line {
  position: absolute;
  left: 72px;
  right: 0;
  z-index: 2;
  height: 0;
  border-top: 2px solid #ef4444;
  pointer-events: none;
}
.now-line span {
  position: absolute;
  left: 8px;
  top: -14px;
  background: #ef4444;
  color: white;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
}
.timeline-list-view {
  display: grid;
  gap: 8px;
}
.timeline-list-row {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  background: rgba(15,23,42,.45);
}
.timeline-list-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}
.timeline-list-row:hover {
  border-color: var(--accent);
}
.timeline-stage-view-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15,23,42,.35);
}
@media (max-width: 760px) {
  .timeline-controls { gap: 12px; }
  .timeline-filters { grid-template-columns: 1fr; }
  .segmented { width: 100%; justify-content: stretch; }
  .segbtn { flex: 1; }
  .timeline-list-row { grid-template-columns: 1fr; }
  .timeline-problems { margin-top: 0; }
}

/* v0.7.1 horizontal timeline */
.timeline-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.timeline-horizontal-shell {
  overflow: auto;
  max-width: 100%;
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15,23,42,.25);
  overscroll-behavior-x: contain;
}
.timeline-horizontal-grid {
  display: grid;
  grid-template-columns: 170px var(--timeline-width);
  grid-template-rows: 44px auto;
  min-width: calc(170px + var(--timeline-width));
  position: relative;
}
.timeline-horizontal-corner {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(15,23,42,.98);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}
.timeline-horizontal-head {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 44px;
  border-bottom: 1px solid var(--line);
  background: rgba(15,23,42,.96);
}
.h-time-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(148,163,184,.20);
}
.h-time-tick span {
  position: absolute;
  top: 11px;
  left: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.timeline-stage-labels {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  left: 0;
  z-index: 4;
  background: rgba(15,23,42,.94);
  border-right: 1px solid var(--line);
}
.timeline-stage-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148,163,184,.16);
}
.timeline-stage-label strong {
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-stage-label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.timeline-horizontal-lanes {
  grid-column: 2;
  grid-row: 2;
  position: relative;
}
.timeline-h-lane {
  position: relative;
  border-bottom: 1px solid rgba(148,163,184,.16);
  background: linear-gradient(180deg, rgba(255,255,255,.015), transparent);
}
.timeline-h-lane:nth-child(even) {
  background: rgba(255,255,255,.018);
}
.h-hour-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(148,163,184,.12);
}
.timeline-subrow-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(148,163,184,.10);
  pointer-events: none;
}
.timeline-h-block {
  position: absolute;
  z-index: 2;
  display: grid;
  align-content: start;
  gap: 2px;
  overflow: hidden;
  text-align: left;
  border: 1px solid rgba(56,189,248,.38);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--text);
  background: rgba(14,165,233,.13);
  box-shadow: none;
}
.timeline-h-block:hover {
  border-color: var(--accent);
  background: rgba(14,165,233,.22);
}
.timeline-h-block strong {
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-h-block span,
.timeline-h-block small {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-h-block small {
  color: #fed7aa;
}
.timeline-h-block.type-performance {
  background: rgba(14,165,233,.18);
  border-color: rgba(56,189,248,.55);
}
.timeline-h-block.type-soundcheck {
  background: rgba(167,139,250,.14);
  border-color: rgba(167,139,250,.42);
}
.timeline-h-block.type-arrival,
.timeline-h-block.type-loadout {
  background: rgba(148,163,184,.10);
  border-color: rgba(148,163,184,.32);
}
.timeline-h-block.type-changeover {
  background: repeating-linear-gradient(135deg, rgba(234,179,8,.16), rgba(234,179,8,.16) 8px, rgba(234,179,8,.08) 8px, rgba(234,179,8,.08) 16px);
  border-color: rgba(234,179,8,.42);
}
.timeline-h-block.has-problems {
  border-color: rgba(249,115,22,.65);
}
.timeline-mini-warning {
  position: absolute;
  right: 6px;
  top: 6px;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #fed7aa;
  background: rgba(249,115,22,.22);
  border: 1px solid rgba(249,115,22,.45);
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}
.active-hour-band {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  background: rgba(239,68,68,.08);
  border-left: 1px solid rgba(239,68,68,.28);
  border-right: 1px solid rgba(239,68,68,.18);
  pointer-events: none;
}
.now-line-horizontal {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 9;
  width: 0;
  border-left: 3px solid #ef4444;
  pointer-events: none;
}
.now-line-horizontal span {
  position: sticky;
  top: 6px;
  left: 6px;
  display: inline-block;
  transform: translateX(6px);
  background: #ef4444;
  color: white;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.timeline-horizontal-shell.zoom-compact .timeline-h-block {
  padding: 7px 8px;
  border-radius: 11px;
}
.timeline-horizontal-shell.zoom-compact .timeline-h-block strong {
  font-size: 12px;
}
.timeline-horizontal-shell.zoom-compact .timeline-h-block span {
  font-size: 10px;
}
.timeline-horizontal-shell.zoom-detailed .timeline-h-block strong {
  font-size: 14px;
}
.timeline-horizontal-shell.zoom-detailed .timeline-warning {
  margin-top: 4px;
}
@media (max-width: 760px) {
  .timeline-control-row { display: grid; grid-template-columns: 1fr; }
  .timeline-zoom-switch { display: none; }
  .timeline-horizontal-shell { display: none; min-height: 0; }
}

.timeline-warning {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 7px;
  border: 1px solid rgba(249,115,22,.45);
  background: rgba(249,115,22,.14);
  color: #fed7aa;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  font-weight: 900;
}
.timeline-h-block .timeline-warning { margin-top: 2px; }

@media (max-width: 900px) {
  .band-filters { grid-template-columns: 1fr; }
  .band-problems-filter { margin-top: 0; }
}

/* v0.7.4 clearer timeline colors */
.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px;
  background: rgba(15,23,42,.30);
}
.timeline-legend-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-right: 4px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 999px;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255,255,255,.035);
}
.legend-item i {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255,255,255,.06);
}
.legend-item.type-performance i { background: #38bdf8; }
.legend-item.type-soundcheck i { background: #a78bfa; }
.legend-item.type-arrival i { background: #22c55e; }
.legend-item.type-changeover i { background: #f59e0b; }
.legend-item.type-loadout i { background: #94a3b8; }
.legend-item.type-problem i { background: #f97316; }

.timeline-h-block,
.timeline-block,
.timeline-list-row {
  border-left-width: 5px;
}
.timeline-h-block.type-performance,
.timeline-block.type-performance,
.timeline-list-row.type-performance {
  background: linear-gradient(135deg, rgba(14,165,233,.30), rgba(8,47,73,.82));
  border-color: rgba(56,189,248,.72);
  border-left-color: #38bdf8;
}
.timeline-h-block.type-performance:hover,
.timeline-block.type-performance:hover {
  background: linear-gradient(135deg, rgba(14,165,233,.40), rgba(8,47,73,.92));
}
.timeline-h-block.type-soundcheck,
.timeline-block.type-soundcheck,
.timeline-list-row.type-soundcheck {
  background: linear-gradient(135deg, rgba(124,58,237,.30), rgba(49,46,129,.76));
  border-color: rgba(167,139,250,.72);
  border-left-color: #a78bfa;
}
.timeline-h-block.type-soundcheck:hover,
.timeline-block.type-soundcheck:hover {
  background: linear-gradient(135deg, rgba(124,58,237,.40), rgba(49,46,129,.90));
}
.timeline-h-block.type-arrival,
.timeline-block.type-arrival,
.timeline-list-row.type-arrival {
  background: linear-gradient(135deg, rgba(34,197,94,.24), rgba(20,83,45,.74));
  border-color: rgba(34,197,94,.65);
  border-left-color: #22c55e;
}
.timeline-h-block.type-arrival:hover,
.timeline-block.type-arrival:hover {
  background: linear-gradient(135deg, rgba(34,197,94,.32), rgba(20,83,45,.88));
}
.timeline-h-block.type-loadout,
.timeline-block.type-loadout,
.timeline-list-row.type-loadout {
  background: linear-gradient(135deg, rgba(148,163,184,.22), rgba(30,41,59,.86));
  border-color: rgba(148,163,184,.58);
  border-left-color: #94a3b8;
}
.timeline-h-block.type-loadout:hover,
.timeline-block.type-loadout:hover {
  background: linear-gradient(135deg, rgba(148,163,184,.30), rgba(30,41,59,.96));
}
.timeline-h-block.type-changeover,
.timeline-block.type-changeover,
.timeline-list-row.type-changeover {
  background:
    repeating-linear-gradient(135deg, rgba(245,158,11,.24), rgba(245,158,11,.24) 9px, rgba(120,53,15,.42) 9px, rgba(120,53,15,.42) 18px),
    linear-gradient(135deg, rgba(245,158,11,.28), rgba(69,26,3,.80));
  border-color: rgba(245,158,11,.75);
  border-left-color: #f59e0b;
}
.timeline-h-block.type-changeover:hover,
.timeline-block.type-changeover:hover {
  background:
    repeating-linear-gradient(135deg, rgba(245,158,11,.32), rgba(245,158,11,.32) 9px, rgba(120,53,15,.52) 9px, rgba(120,53,15,.52) 18px),
    linear-gradient(135deg, rgba(245,158,11,.36), rgba(69,26,3,.92));
}
.timeline-h-block.has-problems,
.timeline-block.has-problems,
.timeline-list-row.has-problems {
  border-color: rgba(249,115,22,.95);
  border-left-color: #ef4444;
  box-shadow: inset 0 0 0 1px rgba(249,115,22,.25), 0 0 0 1px rgba(239,68,68,.10);
}
.timeline-warning,
.timeline-h-block .timeline-warning {
  border-color: rgba(251,146,60,.80);
  background: rgba(249,115,22,.32);
  color: #fff7ed;
}
.timeline-mini-warning {
  background: rgba(249,115,22,.40);
  border-color: rgba(251,146,60,.82);
  color: #fff7ed;
}
.timeline-h-block strong,
.timeline-block strong {
  color: #f8fafc;
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
}
.timeline-h-block span,
.timeline-h-block small,
.timeline-block span {
  color: rgba(226,232,240,.86);
}
@media (max-width: 760px) {
  .timeline-legend { display: none; }
}


/* v0.7.5 stacked timeline rows for overlapping items */
.timeline-h-lane {
  min-height: 96px;
}
.timeline-h-block {
  min-height: 52px;
}
.timeline-horizontal-shell.zoom-compact .timeline-h-block {
  min-height: 46px;
}
.timeline-horizontal-shell.zoom-detailed .timeline-h-block {
  min-height: 68px;
}
.timeline-subrow-line {
  opacity: .85;
}


/* v0.7.5.2 mobile weather fix */
@media (max-width: 760px) {
  body { overflow-x: hidden; }
  .app-shell { padding: 12px; max-width: 100%; overflow-x: hidden; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 14px; }
  .card { padding: 14px; border-radius: 16px; max-width: 100%; overflow: hidden; }
  .weather-card { min-height: 0; }
  .weather-card .card-head { align-items: center; }
  .weather-card .weather-box {
    display: block;
    max-width: 100%;
    overflow: hidden;
  }
  .weather-card .weather-summary {
    max-width: 100%;
    margin-bottom: 12px;
  }
  .weather-card .weather-box > button {
    margin-bottom: 12px;
  }
  .weather-card .weather-box table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .weather-card .weather-box thead,
  .weather-card .weather-box tbody,
  .weather-card .weather-box tr {
    width: 100%;
  }
  .weather-card .weather-box th,
  .weather-card .weather-box td {
    padding: 8px 7px;
    font-size: 13px;
    white-space: nowrap;
  }
  .weather-card .risk-pill {
    padding: 3px 7px;
    font-size: 11px;
  }
}


/* v0.7.5.3 hide completed tasks by default */
.task-filter-row {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 14px;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.inline-check input {
  width: auto;
  margin: 0;
}
.task-item.task-done {
  opacity: .58;
}
.task-item.task-done strong {
  text-decoration: line-through;
}
@media (max-width: 760px) {
  .task-filter-row { justify-content: flex-start; }
}


/* v0.8 workers/users permissions */
.users-card { margin-top: 18px; }
.user-form .permissions-box {
  grid-column: 1 / -1;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px;
  padding: 12px;
  background: rgba(15,23,42,.28);
}
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 12px;
  margin-top: 10px;
}
.permission-check {
  padding: 8px 10px;
  border: 1px solid rgba(148,163,184,.15);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}
.form-actions { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .permissions-grid { grid-template-columns: 1fr; }
}


/* v0.8.2 draggable timeline */
.timeline-drag-toggle {
  align-self: center;
  margin-top: 0;
  border: 1px solid rgba(148,163,184,.20);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(15,23,42,.35);
}
.timeline-horizontal-shell.drag-enabled .timeline-draggable {
  cursor: grab;
  touch-action: none;
}
.timeline-horizontal-shell.drag-enabled .timeline-draggable:active,
.timeline-h-block.is-dragging {
  cursor: grabbing;
}
.timeline-h-block.is-dragging {
  z-index: 30;
  opacity: .92;
  transform: scale(1.015);
  box-shadow: 0 22px 55px rgba(0,0,0,.45), 0 0 0 2px rgba(56,189,248,.55);
}
.timeline-h-block.is-saving {
  opacity: .65;
}
@media (max-width: 760px) {
  .timeline-drag-toggle { display: none; }
}


/* v0.8.2.3 drag checkbox binding fix */
.timeline-horizontal-shell.drag-enabled {
  user-select: none;
}
.timeline-horizontal-shell.drag-enabled .timeline-draggable {
  cursor: grab;
}
.timeline-horizontal-shell.drag-enabled .timeline-draggable:hover {
  box-shadow: inset 0 0 0 1px rgba(56,189,248,.40), 0 0 0 2px rgba(56,189,248,.16);
}


/* v0.8.2.4 robust drag cards */
.timeline-h-block[role="button"] {
  appearance: none;
  font-family: inherit;
}
.timeline-drag-chip {
  position: absolute;
  right: 7px;
  bottom: 6px;
  display: none;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 950;
  color: #e0f2fe;
  background: rgba(14,165,233,.35);
  border: 1px solid rgba(56,189,248,.55);
  pointer-events: none;
}
.timeline-horizontal-shell.drag-enabled .timeline-drag-chip {
  display: inline-flex;
}
.timeline-horizontal-shell.drag-enabled .timeline-draggable {
  cursor: grab;
  touch-action: none;
}
.timeline-horizontal-shell.drag-enabled .timeline-draggable:hover {
  box-shadow: inset 0 0 0 1px rgba(56,189,248,.48), 0 0 0 2px rgba(56,189,248,.18);
}
.timeline-horizontal-shell.drag-active {
  cursor: grabbing;
}
.timeline-h-block.is-dragging {
  z-index: 80;
  cursor: grabbing;
  opacity: .94;
  transform: scale(1.02);
  box-shadow: 0 24px 60px rgba(0,0,0,.50), 0 0 0 2px rgba(56,189,248,.70);
}
.timeline-h-block.is-saving {
  opacity: .58;
}
body.timeline-drag-mode-on .timeline-drag-toggle {
  border-color: rgba(34,197,94,.75);
  background: rgba(34,197,94,.18);
}


/* v0.8.2.5 drag all timeline items */
.timeline-horizontal-shell.drag-enabled .timeline-draggable.type-arrival .timeline-drag-chip,
.timeline-horizontal-shell.drag-enabled .timeline-draggable.type-soundcheck .timeline-drag-chip,
.timeline-horizontal-shell.drag-enabled .timeline-draggable.type-changeover .timeline-drag-chip,
.timeline-horizontal-shell.drag-enabled .timeline-draggable.type-performance .timeline-drag-chip {
  display: inline-flex;
}
.timeline-horizontal-shell.drag-enabled .timeline-draggable.type-arrival,
.timeline-horizontal-shell.drag-enabled .timeline-draggable.type-soundcheck,
.timeline-horizontal-shell.drag-enabled .timeline-draggable.type-changeover,
.timeline-horizontal-shell.drag-enabled .timeline-draggable.type-performance {
  outline: 1px dashed rgba(226,232,240,.18);
  outline-offset: -4px;
}


/* v0.8.2.6 delete band button */
.band-form-actions {
  margin-top: 4px;
  align-items: center;
}
button.danger,
button.secondary.danger {
  color: #fee2e2;
  border-color: rgba(248,113,113,.55);
  background: rgba(127,29,29,.30);
}
button.danger:hover,
button.secondary.danger:hover {
  border-color: rgba(248,113,113,.85);
  background: rgba(185,28,28,.40);
}


/* v0.8.2.7 delete button in Bands tab */
.band-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}
.band-card-actions .danger {
  margin-left: auto;
}
@media (max-width: 760px) {
  .band-card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .band-card-actions .danger {
    margin-left: 0;
  }
}
