/* GigMinion — stage-friendly UI. Dark by default, light as a toggle.
   Phone-first: every control ≥ 44px, one-column layouts, bottom tabs. */

:root {
  --bg: #0f1115;
  --bg-2: #171a21;
  --bg-3: #1f232c;
  --line: #2a2f3a;
  --fg: #f2f4f8;
  --fg-2: #aab2c0;
  --fg-3: #6f7886;
  --accent: #f5b942;        /* stage amber — readable in the dark, not blinding */
  --accent-fg: #1a1200;
  --ok: #4cd68a;
  --warn: #f5b942;
  --bad: #ff6b6b;
  --info: #6cb8ff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --tap: 48px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-2: #ffffff;
  --bg-3: #eef0f4;
  --line: #d9dde5;
  --fg: #14171d;
  --fg-2: #4b5363;
  --fg-3: #8a93a3;
  --accent: #b97400;
  --accent-fg: #ffffff;
  --shadow: 0 10px 30px rgba(20,23,29,.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; color: var(--fg-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 .75rem; }
.muted { color: var(--fg-2); }
.small { font-size: .875rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: calc(.5rem + env(safe-area-inset-top)) .75rem .5rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.band-switch {
  display: flex; align-items: center; gap: .4rem; min-height: var(--tap);
  background: transparent; border: 0; color: var(--fg); padding: 0 .25rem; cursor: pointer;
  font-weight: 700; font-size: 1.05rem; max-width: 70vw;
}
.band-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--fg-3); }
.top-actions { display: flex; gap: .25rem; }
.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: 12px; border: 0;
  background: transparent; color: var(--fg-2); font-size: 1.25rem; cursor: pointer;
}
.icon-btn:hover { background: var(--bg-3); color: var(--fg); }

/* ---------- main ---------- */
.view { max-width: 720px; margin: 0 auto; padding: 1rem; }
.view.center { min-height: 70vh; display: grid; place-items: center; text-align: center; }

.card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; margin-bottom: .75rem;
}
.card.tap { cursor: pointer; transition: transform .06s ease; }
.card.tap:active { transform: scale(.99); }

.row { display: flex; align-items: center; gap: .75rem; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: .75rem; }

.list { display: flex; flex-direction: column; gap: .6rem; }
.date-chip {
  flex: 0 0 auto; width: 56px; text-align: center; border-radius: 12px; padding: .35rem 0;
  background: var(--bg-3); border: 1px solid var(--line);
}
.date-chip .d { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.date-chip .m { font-size: .7rem; text-transform: uppercase; color: var(--fg-2); letter-spacing: .06em; }
.title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { color: var(--fg-2); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .2rem .5rem; border-radius: 999px; background: var(--bg-3); color: var(--fg-2); border: 1px solid var(--line);
}
.pill.confirmed { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill.potential { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pill.cancelled { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.pill.completed { color: var(--fg-3); }
.pill.private { color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); }

.seg { display: flex; background: var(--bg-3); border-radius: 12px; padding: 3px; margin-bottom: .75rem; }
.seg button {
  flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--fg-2); cursor: pointer; font-weight: 600;
}
.seg button[aria-pressed="true"] { background: var(--bg-2); color: var(--fg); box-shadow: 0 1px 4px rgba(0,0,0,.25); }

/* ---------- forms ---------- */
label.f { display: block; margin-bottom: .8rem; }
label.f > span { display: block; font-size: .85rem; color: var(--fg-2); margin-bottom: .3rem; }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: .6rem .75rem; font: inherit; color: var(--fg);
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
textarea { min-height: 96px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.check { display: flex; align-items: center; gap: .6rem; min-height: var(--tap); cursor: pointer; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: var(--tap); padding: 0 1.1rem; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-3); color: var(--fg); font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: transparent; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.actions .btn { flex: 1; }

.fab {
  position: fixed; right: 1rem; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 15;
  width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-fg);
  font-size: 2rem; line-height: 1; box-shadow: var(--shadow); cursor: pointer;
}

.err { color: var(--bad); font-size: .9rem; margin: .5rem 0; }
.hint { color: var(--fg-3); font-size: .85rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--fg-2); }
.empty .big { font-size: 2.5rem; margin-bottom: .5rem; }

/* ---------- tabs ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 60px; color: var(--fg-3); font-size: .75rem; font-weight: 600;
}
.tabs a .t-ico { font-size: 1.25rem; }
.tabs a[aria-current="page"] { color: var(--accent); }

/* ---------- sheet / toast / banner ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet .panel {
  width: 100%; max-width: 720px; max-height: 92vh; overflow: auto;
  background: var(--bg-2); border-radius: 20px 20px 0 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto .75rem; }
.menu-item { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: var(--tap); padding: 0 .5rem; border: 0; background: transparent; color: var(--fg); text-align: left; border-radius: 10px; cursor: pointer; }
.menu-item:hover { background: var(--bg-3); }
.menu-item.active { color: var(--accent); font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  background: var(--fg); color: var(--bg); padding: .7rem 1rem; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow);
  max-width: 90vw;
}
.banner { position: sticky; top: 0; z-index: 25; padding: .5rem 1rem; text-align: center; font-size: .9rem; font-weight: 600; }
.banner.offline { background: #3a2f12; color: #ffd98a; }
.banner.sync { background: #12303a; color: #a7e0ff; }

.logo { font-size: 2.2rem; font-weight: 900; letter-spacing: -.02em; }
.logo b { color: var(--accent); }

@media (min-width: 720px) {
  body { padding-bottom: 2rem; }
  .tabs { position: sticky; bottom: auto; top: 0; }
}
