/* Deansound crew app: phone first, same colors as the CRM. */
:root {
  --bg: #0b0d10;
  --panel: #11151a;
  --field: #0e1216;
  --raised: #151b21;
  --line: #202731;
  --line-strong: #29323d;
  --text: #eef2f7;
  --text-soft: #cbd5df;
  --muted: #8b97a3;
  --accent: #37b7ff;
  --accent-strong: #168fd2;
  --good: #6ee7a0;
  --good-bg: #103724;
  --yellow: #ffd36d;
  --warn-bg: #3a2d0c;
  --bad: #ff6969;
  --bad-bg: #401b1b;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
a {
  color: var(--accent);
}
button,
input {
  font: inherit;
}
[hidden] {
  display: none !important;
}

/* top bar */
.app-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  background: rgba(11, 13, 16, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand {
  font-weight: 900;
  letter-spacing: 0.04em;
  font-size: 18px;
}
.brand span {
  color: var(--accent);
}
.brand small {
  margin-left: 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.who {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-soft);
  min-width: 0;
}
.who span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-bar {
  padding: 8px 16px;
  background: var(--warn-bg);
  color: var(--yellow);
  font-size: 13px;
  font-weight: 600;
}

/* layout */
.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(32px + var(--safe-bottom));
}
.loading,
.empty {
  padding: 40px 8px;
  text-align: center;
  color: var(--muted);
}
h1 {
  margin: 4px 0 2px;
  font-size: 24px;
  line-height: 1.2;
}
h2 {
  margin: 26px 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.sub {
  color: var(--muted);
  font-size: 14px;
}
.muted {
  color: var(--muted);
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--raised);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}
.btn.small {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 14px;
}
.btn.link {
  border: 0;
  background: none;
  color: var(--accent);
  padding: 6px 0;
  min-height: 36px;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.btn-row .btn {
  flex: 1 1 140px;
}

/* sign in */
.signin {
  max-width: 380px;
  margin: 8vh auto 0;
}
.signin label {
  display: block;
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-soft);
}
.signin input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--field);
  color: var(--text);
  font-size: 16px; /* 16px stops iPhone zooming in on the field */
}
.signin .btn {
  width: 100%;
  margin-top: 18px;
}
.msg {
  margin-top: 14px;
  min-height: 20px;
  font-size: 14px;
  color: var(--text-soft);
}
.msg.err {
  color: var(--bad);
}

/* show list */
.section-title {
  margin: 22px 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.show-card {
  display: flex;
  gap: 14px;
  width: 100%;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.show-card:active {
  background: var(--raised);
}
.date-box {
  flex: none;
  width: 56px;
  padding: 6px 0;
  border-radius: 10px;
  background: var(--raised);
  text-align: center;
  line-height: 1.1;
}
.date-box .m {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}
.date-box .d {
  font-size: 24px;
  font-weight: 800;
}
.date-box .w {
  font-size: 11px;
  color: var(--muted);
}
.show-main {
  min-width: 0;
  flex: 1;
}
.show-name {
  font-weight: 700;
  font-size: 17px;
}
.show-meta {
  margin-top: 2px;
  font-size: 14px;
  color: var(--text-soft);
}
.show-pay {
  margin-top: 6px;
  font-size: 14px;
  color: var(--good);
  font-weight: 600;
}
.pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  background: var(--raised);
  color: var(--text-soft);
}
.pill.warn {
  background: var(--warn-bg);
  color: var(--yellow);
}
.pill.good {
  background: var(--good-bg);
  color: var(--good);
}
.past .show-card {
  opacity: 0.7;
}

/* show details */
.back {
  margin: -4px 0 6px -2px;
}
.block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.block + .block {
  margin-top: 10px;
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.kv:last-child {
  border-bottom: 0;
}
.kv b {
  font-weight: 600;
  text-align: right;
}
.pre {
  white-space: pre-wrap;
  font-size: 15px;
}
.sched-day {
  margin: 8px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.sched-row {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.sched-row:last-child {
  border-bottom: 0;
}
.sched-time {
  flex: none;
  width: 92px;
  color: var(--accent);
  font-weight: 600;
}
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.list-row:last-child {
  border-bottom: 0;
}
.list-row .qty {
  flex: none;
  color: var(--muted);
}
.list-row.me {
  color: var(--accent);
  font-weight: 600;
}
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--text);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.file-row:last-child {
  border-bottom: 0;
}
.file-row span:last-child {
  color: var(--accent);
  font-size: 14px;
  flex: none;
}
.updated {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.offline {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--yellow);
  font-size: 13px;
}

/* submissions (phase 2) */
.mt {
  margin-top: 12px;
}
.mb {
  margin-bottom: 10px;
}
.submit-row .btn {
  flex: 1 1 100px;
}
.sub-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.sub-row:last-child {
  border-bottom: 0;
}
.sub-main {
  min-width: 0;
}
.sub-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.pill.bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.sub-form {
  margin-top: 8px;
}
.f {
  display: block;
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-soft);
}
.f input:not([type='radio']):not([type='checkbox']):not([type='file']),
.f select,
.f textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.f input[type='file'] {
  display: block;
  margin-top: 8px;
  color: var(--text-soft);
}
.choice {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.choice label,
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--raised);
  color: var(--text);
  font-size: 15px;
}
.check {
  margin-top: 14px;
}
.sub-form .btn.primary {
  width: 100%;
  margin-top: 20px;
}
.btn:disabled {
  opacity: 0.5;
}

/* tabs */
.tabs {
  position: sticky;
  top: calc(57px + var(--safe-top));
  z-index: 9;
  display: flex;
  background: rgba(11, 13, 16, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.tabs a {
  flex: 1;
  padding: 12px 6px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.tabs a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* availability calendar */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
  font-size: 17px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-grid .dow {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.cal-grid .day {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.cal-grid .day.today {
  border-color: var(--accent);
}
.cal-grid .day.past {
  opacity: 0.35;
  cursor: default;
}
.cal-grid .day.blocked {
  background: var(--bad-bg);
  border-color: var(--bad);
  color: var(--bad);
  text-decoration: line-through;
}
.cal-grid .day.show::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--accent);
}
.cal-key {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.cal-key .key {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  margin-left: 8px;
}
.cal-key .key.blocked {
  background: var(--bad-bg);
  border: 1px solid var(--bad);
}
.cal-key .key.show {
  background: var(--accent);
  border-radius: 50%;
}

/* narrow phones: keep the header on one line */
.brand {
  white-space: nowrap;
}
.who .btn.small {
  white-space: nowrap;
  min-height: 34px;
  padding: 6px 10px;
}
@media (max-width: 420px) {
  .brand {
    font-size: 16px;
  }
  .brand small {
    font-size: 10px;
  }
  .who span {
    max-width: 90px;
  }
}

/* =====================================================================================================
   Design refresh: the same look as the CRM (Crew Submissions style). Cards with a soft lift, small-capital
   section titles with a blue marker, tinted status tags, colored type tags and edges on things you sent.
   ===================================================================================================== */
:root {
  --hover: #18232c;
  --line-bright: #33414b;
  --muted-light: #9aa7b4;
  --good-strong: #43d17d;
  --orange: #ffb547;
  --bad-soft: #ff9292;
}

/* section titles (h2 and the list headings): gray small capitals with a short blue marker */
h2,
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 26px 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-light);
}
h2::before,
.section-title::before {
  content: '';
  flex: none;
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--accent);
}

/* cards: a little lift off the page */
.block,
.show-card {
  background: linear-gradient(180deg, #131920 0%, var(--panel) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    0 8px 22px rgba(0, 0, 0, 0.22);
}

/* show list: a blue edge on shows coming up, a quiet gray one on past shows */
.show-card {
  position: relative;
  overflow: hidden;
  align-items: center;
}
.show-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}
.past .show-card::before {
  background: var(--line-bright);
}
.date-box {
  border: 1px solid var(--line-strong);
  background: var(--field);
}

/* status tags: tinted with a matching edge */
.pill {
  --tone: var(--muted-light);
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 32%, transparent);
}
.pill.good {
  --tone: var(--good);
}
.pill.warn {
  --tone: var(--yellow);
}
.pill.bad {
  --tone: var(--bad-soft);
}

/* things you sent (mileage, receipts, gear issues, shop hours): one card each with a colored type tag */
.sub-card {
  --kind: var(--accent);
  position: relative;
  margin-bottom: 10px;
  padding: 12px 14px 12px 16px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.sub-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--kind);
}
.sub-card.sc-receipt {
  --kind: var(--good-strong);
}
.sub-card.sc-shop {
  --kind: var(--yellow);
}
.sub-card.sc-gear {
  --kind: var(--orange);
}
.sc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.sc-kind {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--kind);
  background: color-mix(in srgb, var(--kind) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--kind) 35%, transparent);
}
.sc-withdraw {
  margin-top: 4px;
}
/* labeled rows: label on the left, value on the right */
.facts {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 5px 12px;
  font-size: 15px;
}
.facts > span:nth-child(odd) {
  padding-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.facts > span:nth-child(even) {
  overflow-wrap: anywhere;
}

/* After the show buttons: three even buttons on one line */
.submit-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.submit-row .btn {
  padding: 10px 6px;
  font-size: 14px;
  white-space: nowrap;
}

/* buttons: gentle press and hover */
.btn {
  transition:
    background-color 0.12s,
    border-color 0.12s,
    filter 0.12s;
}
.btn:not(.link):not(.primary):active,
.btn:not(.link):not(.primary):hover {
  border-color: var(--line-bright);
  background: var(--hover);
}
.btn.primary:active,
.btn.primary:hover {
  filter: brightness(1.1);
}

/* pay lines: what it was, with the day and amount of work under it */
.pay-line {
  align-items: flex-start;
}
.pay-line .pl-what {
  display: block;
}
.pay-line .pl-meta {
  display: block;
  margin-top: 1px;
  font-size: 13px;
}
.pay-line .pl-meta:empty {
  display: none;
}
.list-row .qty {
  color: var(--text-soft);
  font-weight: 600;
}

/* top tabs: the open tab gets a soft blue wash under its line */
.tabs a.active {
  background: linear-gradient(0deg, rgba(55, 183, 255, 0.1), transparent 70%);
}
