:root {
  --navy: #1c2f4a;
  --red: #b3221e;
  --gray: #f4f5f7;
  --border: #d8dce2;
}
* { box-sizing: border-box; }
body { font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif; margin: 0; color: #1a1a1a; background: #fff; }
.topbar { display: flex; justify-content: space-between; align-items: center; background: var(--navy); color: #fff; padding: 12px 20px; flex-wrap: wrap; }
.topbar .brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.topbar nav a { color: #fff; margin-left: 16px; text-decoration: none; font-size: 1rem; padding: 6px 2px; display: inline-block; }
.topbar nav a:hover { text-decoration: underline; }
.topbar .who { color: #c9d3e0; margin-left: 16px; font-size: 0.9rem; }
.container { max-width: 900px; margin: 0 auto; padding: 24px 16px 60px; }
h1, h2, h3 { color: var(--navy); }
table { width: 100%; border-collapse: collapse; margin: 12px 0; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
th { background: var(--gray); }
.card { border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 20px; background: #fff; }
form.inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
/* Bigger touch targets everywhere — a lot of students are filling these in
   with work gloves on, so small, tightly-packed form controls are a real
   problem, not just a style preference. */
input, select, textarea {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1.05rem;
  min-height: 46px;
}
textarea { min-height: 80px; }
input[type="file"] { padding: 10px 8px; }
label { font-size: 0.9rem; color: #444; display: block; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
button, .btn {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.05rem;
  min-height: 46px;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { opacity: 0.9; }
button.danger { background: var(--red); }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; font-size: 0.9rem; }
.flash-success { background: #e3f4e8; color: #1e6b34; }
.flash-error { background: #fbe4e2; color: var(--red); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.badge-submitted { background: #fde8cc; color: #8a5300; }
.badge-in_progress { background: #dbe6fb; color: #1c3f8a; }
.badge-ready_for_pickup { background: #e5dbfb; color: #4a1c8a; }
.badge-paid { background: #d9f2df; color: #1e6b34; }
.badge-closed { background: #e5e5e5; color: #555; }
.badge-pending_verification { background: #f6d6d6; color: #8a1c1c; }
.total-row td { font-weight: 700; }
.photo-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-grid figure { margin: 0; width: 160px; }
.photo-grid img { width: 100%; border-radius: 6px; border: 1px solid var(--border); }
.photo-grid figcaption { font-size: 0.8rem; color: #555; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

.link-btn {
  background: none;
  color: var(--navy);
  border: none;
  padding: 6px 4px;
  text-decoration: underline;
  font-size: 0.95rem;
  min-height: auto;
  cursor: pointer;
  display: inline;
}
.link-btn:hover { opacity: 0.7; }

.message-thread { margin-bottom: 14px; }
.message { border-bottom: 1px solid var(--border); padding: 8px 0; }
.message:last-child { border-bottom: none; }
.message strong { color: var(--navy); }
.message-time { color: #888; font-size: 0.8rem; margin-left: 8px; }
.message p { margin: 4px 0 0; }

.badge-waiting_on_parts { background: #fff1b8; color: #7a5b00; }
.badge-overdue { background: var(--red); color: #fff; }
.badge-review { background: #fde0a8; color: #7a4a00; }
.badge-good { background: #d9f2df; color: #1e6b34; }
.badge-bad { background: #f6d6d6; color: #8a1c1c; }
small { color: #666; }
.muted { color: #666; }

/* Announcement banner */
.announce { background: #fff4c2; color: #5b4500; border-bottom: 2px solid #e5c64a; padding: 12px 20px; font-size: 1.05rem; text-align: center; }

/* Dashboard */
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.stat { flex: 1 1 150px; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: var(--gray); }
.stat b { display: block; font-size: 1.4rem; color: var(--navy); }
.stat.warn b { color: var(--red); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input[type=text], .filters input[type=search] { flex: 1 1 200px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { padding: 12px 18px; border-radius: 6px; border: 1px solid var(--border); text-decoration: none; color: var(--navy); font-size: 1.05rem; background: #fff; min-height: 46px; display: inline-flex; align-items: center; }
.tab.active { background: var(--navy); color: #fff; }
tr.overdue td { background: #fdecea; }
.wo-cards { display: none; }
.wo-card { display: block; border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 12px; text-decoration: none; color: inherit; background: #fff; }
.wo-card.overdue { border-color: var(--red); background: #fdecea; }
.wo-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.wo-card .veh { font-size: 1.1rem; font-weight: 600; color: var(--navy); margin: 6px 0 2px; }
@media (max-width: 700px) {
  table.wo-table { display: none; }
  .wo-cards { display: block; }
  .topbar nav a { margin-left: 10px; }
}

/* Progress bar */
.progress { display: flex; gap: 6px; margin: 14px 0 6px; }
.progress .step { flex: 1; text-align: center; padding: 10px 4px; border-radius: 6px; background: var(--gray); color: #777; font-size: 0.9rem; border: 1px solid var(--border); }
.progress .step.done { background: #d9f2df; color: #1e6b34; border-color: #b6e2c0; font-weight: 600; }
.progress .step.current { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 600; }

/* Inspections */
.flagged td, .flagged { background: #fdecea; }
.flagged input, .flagged select { border-color: var(--red); background: #fff; }
.flag-note { color: var(--red); font-weight: 600; }
.pf { display: flex; gap: 10px; }
.pf label { display: flex; align-items: center; gap: 8px; border: 2px solid var(--border); border-radius: 8px; padding: 12px 22px; font-size: 1.1rem; margin: 0; cursor: pointer; }
.pf input { min-height: 0; width: 22px; height: 22px; }
.insp-field { padding: 12px; border-bottom: 1px solid var(--border); }
input[type=checkbox] { min-height: 0; width: 22px; height: 22px; vertical-align: middle; }
label.check { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; color: #1a1a1a; margin: 10px 0; }

/* Signature pad */
.sig-wrap { border: 2px dashed #999; border-radius: 8px; background: #fff; touch-action: none; }
canvas.sig { width: 100%; height: 180px; display: block; touch-action: none; }
.sig-img { max-width: 260px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }

/* Activity / notes */
.log { font-size: 0.9rem; max-height: 320px; overflow: auto; }
.log div { padding: 6px 0; border-bottom: 1px solid var(--border); }
.internal { background: #fffbe6; border-color: #e5c64a; }
.stars label { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--border); border-radius: 8px; padding: 12px 16px; margin: 0 6px 6px 0; font-size: 1.1rem; cursor: pointer; }
.stars input { min-height: 0; width: 20px; height: 20px; }
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.preset-row button { background: #e7ecf3; color: var(--navy); }
button.secondary, .btn.secondary { background: #e7ecf3; color: var(--navy); }
.big-clock { font-size: 1.2rem; padding: 18px 28px; }
.tag-box { border: 3px solid #000; padding: 20px; max-width: 520px; margin: 20px auto; text-align: center; }
.tag-box .big { font-size: 2rem; font-weight: 800; }
.tag-box .qr { display: flex; justify-content: center; margin: 14px 0; }
.pw-box { font-family: monospace; font-size: 1.15rem; background: var(--gray); padding: 4px 10px; border-radius: 4px; }
details > summary { cursor: pointer; padding: 12px 4px; font-size: 1.05rem; color: var(--navy); font-weight: 600; min-height: 46px; }
.settings-section { scroll-margin-top: 12px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions form.inline { margin: 0; }

/* Printable work-order / invoice view: hide nav and buttons, keep just the content */
@media print {
  .no-print, .topbar, header.topbar, .announce { display: none !important; }
  body { background: #fff; }
  .card { border: none; padding: 0; }
  .container { max-width: 100%; padding: 0; }
  .flagged td, .flagged { background: #fff !important; }
  a { color: inherit; text-decoration: none; }
}

/* logo */
.topbar { padding-top: 6px; padding-bottom: 6px; }
.topbar .brand { display: flex; align-items: center; gap: 12px; }
.topbar .brandlogo { height: 58px; width: auto; display: block; }
.hero { text-align: center; margin: 6px 0 18px; }
.hero img { width: 100%; max-width: 230px; height: auto; }
.hero h1 { margin: 6px 0 0; }
.printlogo { height: 84px; width: auto; vertical-align: middle; margin-right: 12px; }
@media (max-width: 600px) { .topbar .brandlogo { height: 46px; } .topbar .brand span { font-size: .95rem; } .hero img { max-width: 170px; } }
@media print { .topbar { display: none; } }
