:root {
  --navy: #0a1628;
  --navy-2: #102038;
  --gold: #c9a227;
  --page: #eef3f8;
  --ink: #122033;
  --muted: #5a6b80;
  --card: #ffffff;
  --line: #cdd6e1;
  --danger: #c45c5c;
  /* MarineServiceTech iPhone accent (AccentColor ~ rgb 0.05, 0.38, 0.45) */
  --mst: #0c6173;
  --mst-fill: rgba(12, 97, 115, .14);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
  min-height: 100vh;
}
a { color: var(--mst); text-decoration: none; }
a:hover { text-decoration: underline; }
.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  background: var(--navy-2);
  border-bottom: 1px solid rgba(201,162,39,.35);
}
.top img.logo { height: 36px; border-radius: 6px; }
.brand { font-weight: 700; letter-spacing: .04em; color: var(--gold); }
.nav { display: flex; gap: 12px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.nav a { color: #e8eef6; font-size: 14px; }
.nav-logout { display: inline; margin: 0; }
.nav-logout button {
  background: transparent !important;
  color: #e8eef6 !important;
  border: 0 !important;
  padding: 4px 8px !important;
  margin: 0 !important;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.nav-drop { position: relative; }
.nav-drop-btn {
  background: transparent !important;
  color: #e8eef6 !important;
  border: 0 !important;
  padding: 4px 8px !important;
  margin: 0 !important;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  border-radius: 6px;
}
.nav-drop-btn::after { content: " ▾"; font-size: 11px; }
.nav-drop-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(10, 22, 40, .16);
  padding: 6px;
  z-index: 40;
}
.nav-drop-panel a {
  display: block;
  color: var(--ink) !important;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none !important;
}
.nav-drop-panel a:hover { background: var(--mst-fill); }
.dropzone {
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  background: #f7f9fc;
  margin-bottom: 12px;
}
.dropzone.over { border-color: var(--mst); background: var(--mst-fill); color: var(--ink); }
.file-notes { display: grid; gap: 10px; margin: 12px 0; }
.file-note {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.file-note .name { font-size: 13px; font-weight: 650; color: var(--ink); }
.file-note textarea { min-height: 56px; }
.ticket-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.ticket-nav a {
  padding: 6px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 650;
}
.ticket-nav a.on {
  background: var(--mst);
  color: #fff;
  border-color: var(--mst);
}
.nav-drop-panel .nav-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px 2px;
}
.warn-box {
  background: #fff6e5;
  border: 1px solid #c9a227;
  color: #5c3d00;
  padding: 12px 14px;
  border-radius: 8px;
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
}
.trade-cat {
  margin-bottom: 1.2rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.trade-cat h2 { font-size: 1.05rem; margin-bottom: 4px; }
.trade-cat label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.trade-cat label input { width: auto; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 18px 64px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(10, 22, 40, .06);
}
h1, h2 { margin: 0 0 12px; font-weight: 650; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 80px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); margin: 8px 0 0; }
.check input { width: auto; margin: 0; }
.badge-cell {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--mst);
  color: #fff;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}
a.sort-on { color: var(--navy); font-weight: 700; text-decoration: underline; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
button, .btn {
  display: inline-block;
  background: var(--gold);
  color: var(--navy) !important;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none !important;
  margin-top: 12px;
}
button.secondary, .btn.secondary { background: transparent; color: var(--gold) !important; border: 1px solid var(--gold); }
.flash { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.flash.ok { background: rgba(201,162,39,.18); }
.flash.err { background: rgba(196,92,92,.15); color: #8a2a2a; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.muted { color: var(--muted); font-size: 13px; }
.hero { padding: 48px 0; }
.photos { display: flex; gap: 10px; flex-wrap: wrap; }
.photos img { height: 110px; border-radius: 8px; border: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid rgba(201,162,39,.2); border-radius: 10px; padding: 12px; }
.stat b { display: block; font-size: 22px; color: var(--gold); }
.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.lane {
  min-height: 260px;
  background: #f7f9fc;
  border-radius: 10px;
  padding: 8px;
  border: 1px dashed var(--line);
}
.lane h3 { font-size: 13px; margin: 0 0 8px; color: var(--gold); }
.lane.over { outline: 2px dashed var(--gold); }
.chip {
  background: var(--card);
  padding: 8px;
  border-radius: 8px;
  cursor: grab;
  margin-bottom: 8px;
  font-size: 13px;
}
.chip small { display: block; color: var(--muted); }

/* Schedule calendar — iPhone MarineServiceTech week/month */
.wrap:has(.schedule-page) { max-width: 1180px; }
.schedule-page h1 { margin-bottom: 8px; }
.cal-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 8px;
}
.cal-top h1 { margin: 0; flex: 1 1 120px; }
.seg {
  display: inline-flex;
  background: #fff;
  border: 1px solid rgba(12, 97, 115, .45);
  border-radius: 10px;
  overflow: hidden;
}
.seg a {
  color: var(--ink);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none !important;
}
.seg a.on {
  background: var(--mst);
  color: #fff;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 220px;
  justify-content: center;
}
.cal-title { font-weight: 650; font-size: 17px; letter-spacing: .01em; }
.cal-chevron {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(12, 97, 115, .25);
  color: var(--mst) !important;
  font-size: 22px;
  line-height: 1;
  text-decoration: none !important;
}
.cal-today { margin-top: 0 !important; }
.cal-hint { margin: 0 0 14px; }
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0 4px 6px;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: center;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 18px;
}
.cal-cell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-grid.month .cal-cell { min-height: 118px; }
.cal-grid.month .cal-events { overflow-y: auto; max-height: 88px; }
.cal-cell.weekend { background: #f4f7fa; }
.cal-cell.out { opacity: .42; }
.cal-cell.is-today {
  background: var(--mst-fill);
  border-color: var(--mst);
}
.cal-cell.over {
  outline: 2px solid var(--mst);
  background: rgba(12, 97, 115, .28);
}
.cal-date { display: flex; justify-content: center; }
.cal-num {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 650;
}
.cal-cell.is-today .cal-num {
  background: var(--mst);
  color: #fff;
}
.cal-events { flex: 1; min-height: 0; }
.cal-more { font-size: 10px; color: var(--muted); text-align: center; }
.schedule-page .chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 7px;
  margin-bottom: 4px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--chip, var(--gold)) 40%, transparent);
  background: color-mix(in srgb, var(--chip, var(--gold)) 16%, #fff);
  border-left: 3px solid var(--chip, var(--gold));
  cursor: grab;
}
.schedule-page .chip:active { cursor: grabbing; }
.chip-wo {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.chip-who {
  font-size: 11px;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-meta {
  font-size: 10px;
  color: var(--muted);
}
.tone-emergency { --chip: #e5484d; }
.tone-insurance { --chip: #3b82f6; }
.tone-survey { --chip: #6366f1; }
.tone-warranty { --chip: #14b8a6; }
.tone-winterize { --chip: #22d3ee; }
.tone-splash { --chip: #0d7390; }
.tone-estimate { --chip: #a855f7; }
.tone-service { --chip: #0c6173; }
.tone-handoff { --chip: #c9a227; }
.tone-deposit { --chip: #eab308; }
.tone-cancel { --chip: #94a3b8; }
.tone-referral { --chip: #38bdf8; }
.tone-abandon { --chip: #c45c5c; }
.tone-other { --chip: #93a4bb; }
.unscheduled-tray h2 { margin-bottom: 4px; }
.unscheduled-lane {
  min-height: 72px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}
.unscheduled-lane .chip { width: 180px; margin-bottom: 0; }
.pkg-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.pkg-row button { margin-top: 0; }
@media (max-width: 900px) {
  .cal-grid.week { grid-template-columns: repeat(7, minmax(110px, 1fr)); overflow-x: auto; }
  .cal-weekdays { min-width: 770px; }
  .cal-grid.week { min-width: 770px; }
}
@media (max-width: 720px) { .row { grid-template-columns: 1fr; } .nav { flex-wrap: wrap; } }
