/* South Town Painting Field App — official brand palette
   Deep Navy #2D3282 (text/brush) · Teal #00AEEF (stripe) · Purple #7B2D8B (stripe) */
:root {
  --navy: #2d3282;
  --navy-dark: #232866;
  --teal: #00aeef;
  --purple: #7b2d8b;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1e2340;
  --muted: #5f6689;
  --line: #dde1ec;
  --danger: #b3261e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Brand stripe accent along the very top, echoing the logo pinstripes */
.topbar { border-top: 4px solid var(--purple); position: relative; }
.topbar::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0;
  border-top: 4px solid var(--teal);
  transform: translateY(4px);
  pointer-events: none;
}

.topbar {
  background: #fff;
  border-bottom: 2px solid var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { height: 34px; width: auto; display: block; }
.topbar nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar nav a { color: var(--navy); text-decoration: none; font-weight: 600; }
.topbar nav a:hover { color: var(--teal); }
.topbar .who { color: var(--muted); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; font-size: 20px; color: var(--navy); padding: 4px 12px; cursor: pointer; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .topbar nav { display: none; }
  .topbar.nav-open nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-basis: 100%;
    gap: 0;
    border-top: 1px solid var(--line);
    margin-top: 8px;
    padding-top: 4px;
  }
  .topbar.nav-open nav a, .topbar.nav-open nav .who { padding: 12px 4px; border-bottom: 1px solid #f0f2f8; }
  .topbar.nav-open nav .inline { padding: 12px 4px; }
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 20px 16px 60px; }

h1 { font-size: 24px; margin-bottom: 16px; color: var(--navy); }
h2 { font-size: 17px; color: var(--navy); }

.auth-card {
  max-width: 420px;
  margin: 7vh auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  border-radius: 12px;
  padding: 28px 24px;
}
.auth-logo { display: block; width: 100%; max-width: 320px; margin: 0 auto 6px; }
.auth-sub { text-align: center; color: var(--muted); margin-bottom: 18px; }
.auth-help { margin-top: 16px; text-align: center; color: var(--muted); font-size: 14px; }

label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
input, select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; }

.btn {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: #eef1f8; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-block { width: 100%; margin-top: 6px; }
.btn-small { padding: 6px 10px; font-size: 13px; }
.notif-badge { display: inline-block; min-width: 18px; padding: 1px 5px; border-radius: 10px; background: #d32f2f; color: #fff; font-size: 12px; font-weight: 700; text-align: center; line-height: 16px; }
.btn-danger { color: var(--danger); border-color: #e3b8b5; }
.linklike { background: none; border: none; color: var(--navy); cursor: pointer; font-size: 15px; font-weight: 600; }
.linklike:hover { color: var(--teal); }
.inline { display: inline; }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c3; }
.alert-ok { background: #e6f7fd; color: #045f82; border: 1px solid #b3e7fa; }
.alert-temp { background: #f5ecf7; color: #4d1d57; border: 1px solid #dfc0e5; }
.alert-temp code { font-size: 16px; background: #fff; padding: 2px 6px; border-radius: 4px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
}
.tile p { color: var(--muted); margin-top: 6px; font-size: 14px; }
.tile-soon { opacity: 0.65; }
.tile-live { border-left: 4px solid var(--teal); }
.tile-live:hover { border-color: var(--teal); box-shadow: 0 2px 8px rgba(45, 50, 130, 0.12); }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.page-head h1 { margin-bottom: 0; }

.table-scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #eef0f9; color: var(--navy); font-weight: 600; }
tr:last-child td { border-bottom: none; }
.row-inactive { opacity: 0.5; }
.actions { display: flex; gap: 6px; }

.form-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; max-width: 720px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; margin-bottom: 12px; }

code { background: #eef0f9; padding: 1px 5px; border-radius: 4px; font-size: 13px; }

/* ---- Schedule ---- */
.week-nav { display: flex; gap: 6px; }
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(170px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}
@media (max-width: 900px) { .week-grid { display: flex; flex-direction: column; } }
.day-col { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 120px; }
.day-today { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.day-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.day-name { font-weight: 700; color: var(--navy); font-size: 14px; }
.pill { border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600; }
.pill-pub { background: #e2f6e6; color: #1b5e20; }
.pill-draft { background: #fff3e0; color: #8a5300; }
.job-card { border: 1px solid var(--line); border-left: 3px solid var(--navy); border-radius: 8px; padding: 8px; margin-bottom: 8px; }
.job-changed { border-left-color: var(--purple); background: #faf5fb; }
.job-flag { color: var(--purple); font-size: 11px; font-weight: 600; }
.job-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.job-note { color: var(--muted); font-size: 12px; margin-top: 4px; }
.job-fallback { color: var(--muted); font-size: 11px; margin-top: 4px; font-style: italic; }
.crew { list-style: none; }
.crew li { font-size: 13px; padding: 2px 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pf { color: #c8a400; font-weight: 700; }
.seg { background: #eef0f9; color: var(--navy); border-radius: 4px; font-size: 11px; padding: 1px 5px; }
.crew-actions { margin-left: auto; display: flex; gap: 2px; }
.chip-btn { background: none; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-size: 11px; padding: 0 5px; color: var(--muted); }
.chip-btn:hover { border-color: var(--navy); color: var(--navy); }
.chip-x:hover { border-color: var(--danger); color: var(--danger); }
.day-actions { display: flex; gap: 6px; margin-top: 6px; }
.people-picker { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 14px; }
.people-picker legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
.picker-role { font-weight: 700; color: var(--navy); font-size: 13px; margin: 10px 0 4px; }
.picker-item { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-bottom: 4px; }
.picker-item input { width: auto; margin: 0; }
.inline-filter select { display: inline-block; width: auto; margin-left: 6px; }

/* ---- My assignment cards ---- */
.assign-block { margin-bottom: 24px; }
.assign-day { margin: 14px 0 8px; }
.assign-card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.assign-empty { border-left-color: var(--line); color: var(--muted); }
.assign-job { font-size: 17px; font-weight: 700; color: var(--navy); }
.assign-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 14px; }
.assign-addr { margin-top: 6px; font-size: 14px; }
.assign-addr a { color: var(--navy); }
.assign-note { margin-top: 6px; font-size: 14px; color: var(--muted); }
.assign-crew { margin-top: 8px; font-size: 14px; background: #eef0f9; border-radius: 8px; padding: 8px 10px; }

/* ---- Manpower requests panel ---- */
.req-panel { background: #f4faf6; border: 1px dashed #bcd9c5; border-radius: 8px; padding: 8px; margin: 8px 0; }
.req-title { font-size: 11px; font-weight: 700; color: #1b5e20; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.req-item { font-size: 12px; padding: 3px 0; }
.req-use { color: var(--navy); font-weight: 600; text-decoration: none; margin-left: 4px; }
.req-use:hover { color: var(--teal); }
.req-missing { font-size: 12px; color: var(--danger); margin-top: 4px; font-weight: 600; }

/* ---- Time clock ---- */
.clock-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; max-width: 480px; }
.clock-in-state { border-left: 5px solid #1b5e20; }
.clock-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-bottom: 6px; }
.btn-clock { width: 100%; padding: 18px; font-size: 20px; font-weight: 700; border-radius: 12px; margin-top: 14px; border: none; cursor: pointer; color: #fff; }
.btn-in { background: #1b5e20; }
.btn-in:hover { background: #144a18; }
.btn-out { background: var(--danger); }
.btn-out:hover { background: #911e17; }
.row-flagged { background: #fff7f6; }

/* ---- Schedule board (names left, days across, colored job blocks) ---- */
.board-scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.board { width: 100%; border-collapse: collapse; font-size: 13px; }
.board th, .board td { border-bottom: 1px solid var(--line); border-right: 1px solid #eef0f6; padding: 6px; vertical-align: top; }
.board thead th { background: #eef0f9; position: sticky; top: 0; }
.board-name-col {
  position: sticky; left: 0; background: #fff; font-weight: 600; white-space: nowrap;
  min-width: 140px; max-width: 190px; z-index: 1; box-shadow: 2px 0 0 var(--line);
}
.board thead .board-name-col { background: #eef0f9; z-index: 2; }
.board-sub { color: var(--purple); }
.board-day { font-weight: 700; color: var(--navy); white-space: nowrap; }
.board-day-actions { display: flex; gap: 4px; margin-top: 4px; }
.board-cell { min-width: 120px; }
.board-today { background: #f2fbff; }
.board-block {
  border-radius: 6px; padding: 4px 6px; margin-bottom: 4px; font-size: 12px;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.board-block .crew-actions { margin-left: auto; }
.board-note { flex-basis: 100%; font-size: 11px; opacity: 0.8; }
