/* Spark & Start Mechanic — staff website */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1c2330;
  --muted: #6b7280;
  --line: #e2e6ec;
  --accent: #b3541e;
  --accent-dark: #8f4215;
  --ok: #1a7f4b;
  --warn: #b3541e;
  --danger: #b3261e;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- header / nav ---------- */
header.topbar {
  background: #20293a;
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 50;
}
header.topbar .brand { font-weight: 700; font-size: 16px; }
header.topbar .brand small { display: block; font-weight: 400; font-size: 11px; color: #b9c2d0; }
header.topbar .spacer { flex: 1; }
.bell {
  position: relative;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
}
.bell .badge {
  position: absolute;
  top: 0;
  right: 2px;
  background: #d43d2a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
}
.userchip { font-size: 13px; color: #d6dbe3; }
.linkbtn {
  background: none; border: none; color: #9fc1ff;
  cursor: pointer; font-size: 13px; padding: 4px;
}
nav.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  background: #2b3547;
  padding: 6px 10px;
  position: sticky;
  top: 53px;
  z-index: 49;
}
nav.tabs button {
  background: none;
  border: none;
  color: #cfd6e2;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
nav.tabs button.active { background: #3d4a61; color: #fff; font-weight: 600; }

main { padding: 14px; max-width: 1100px; margin: 0 auto; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 { margin: 0 0 10px; font-size: 18px; }
.card h3 { margin: 14px 0 8px; font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; }
.err {
  background: #fdeceb; color: var(--danger);
  border: 1px solid #f5c6c2; border-radius: 8px;
  padding: 10px; margin: 10px 0; font-size: 14px;
}
.okmsg {
  background: #e9f7ef; color: var(--ok);
  border: 1px solid #bfe6cf; border-radius: 8px;
  padding: 10px; margin: 10px 0; font-size: 14px;
}

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
input, select, textarea {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 70px; resize: vertical; }
.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: #eef1f5; color: var(--ink); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btnrow { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.loginwrap { max-width: 420px; margin: 40px auto; }

/* ---------- tables ---------- */
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.grid th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.rowbtns { white-space: nowrap; }
.rowbtns button { margin-right: 4px; }

/* ---------- schedule ---------- */
.daystrip { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.daystrip button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  min-width: 74px;
}
.daystrip button.active { background: #20293a; color: #fff; border-color: #20293a; }
.daystrip button .dow { display: block; font-size: 11px; color: var(--muted); }
.daystrip button.active .dow { color: #cfd6e2; }
.weeknav { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.timeline { position: relative; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.trow { display: flex; border-bottom: 1px solid #f0f2f5; min-height: 40px; }
.trow .tlabel { width: 64px; flex: none; font-size: 11px; color: var(--muted); padding: 4px 6px; text-align: right; }
.trow .tcell { flex: 1; }
.tblock {
  position: absolute;
  left: 70px; right: 6px;
  background: #e8f0fe;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  overflow: hidden;
  cursor: pointer;
}
.tblock .tt { font-weight: 700; }
.tblock.st-pending { background: #fff4e0; border-left-color: var(--warn); }
.tblock.st-confirmed { background: #e9f7ef; border-left-color: var(--ok); }
.tblock.st-completed { background: #eef1f5; border-left-color: #9aa3b2; color: var(--muted); }
.tblock.st-cancelled, .tblock.st-declined { background: #fdeceb; border-left-color: var(--danger); color: var(--muted); text-decoration: line-through; }

/* ---------- modal ---------- */
#modalhost:empty { display: none; }
#modalhost {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 26, 38, 0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 20px 12px;
  overflow-y: auto;
}
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  width: 100%;
  max-width: 560px;
}
.modal h2 { margin-top: 0; }

/* ---------- notifications ---------- */
.notifpanel {
  position: absolute;
  right: 10px;
  top: 56px;
  width: min(360px, calc(100vw - 20px));
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  z-index: 60;
  max-height: 70vh;
  overflow-y: auto;
}
.notifpanel h3 { margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 15px; }
.notifitem { padding: 10px 14px; border-bottom: 1px solid #f0f2f5; font-size: 14px; }
.notifitem .nk { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.notifitem .nt { font-weight: 600; }

/* ---------- phone tab ---------- */
.bigphone {
  display: block;
  font-size: 34px;
  font-weight: 800;
  color: var(--accent-dark);
  text-decoration: none;
  margin: 8px 0 4px;
}
.note {
  background: #fff8ec;
  border: 1px solid #f0dcae;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #7a5b1e;
  margin-top: 10px;
}

@media (max-width: 640px) {
  main { padding: 10px; }
  .bigphone { font-size: 28px; }
}
