/* Canada Auto Glass - Booking System */
:root {
  --navy: #17202f;
  --navy2: #1f2b40;
  --red: #d62828;
  --blue: #2563eb;
  --bg: #f1f4f8;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: var(--navy); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.logo { font-size: 30px; background: var(--red); width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.brand-text strong { display: block; font-size: 14px; letter-spacing: .5px; }
.brand-text span { font-size: 12px; color: #94a3b8; }
.sidebar nav { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav a { color: #cbd5e1; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-size: 15px; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.on { background: var(--red); color: #fff; font-weight: 600; }
.side-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.who { color: #94a3b8; margin-bottom: 8px; word-break: break-all; }
.signout { color: #f87171; text-decoration: none; font-weight: 600; }

main { flex: 1; min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 12px; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5; }
.search { display: flex; gap: 8px; flex: 1; max-width: 480px; }
.search input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.search button { padding: 9px 16px; background: var(--navy); color: #fff; border: 0; border-radius: 8px; cursor: pointer; }
.today-pill { font-size: 13px; color: var(--muted); white-space: nowrap; }
.content { padding: 24px; max-width: 1200px; }
.content h1 { margin: 0 0 16px; font-size: 24px; }

/* ---------- cards / tables ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.card h2 { margin: 0 0 16px; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.card h3 { margin: 0 0 12px; font-size: 16px; }
.step { background: var(--navy); color: #fff; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.empty { color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 12px; padding: 30px; text-align: center; }
.muted { color: var(--muted); font-size: 13px; }
.nowrap { white-space: nowrap; }

.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl th { background: var(--navy); color: #fff; font-weight: 600; }
.tbl tr:hover td { background: #f8fafc; }
.tbl a { color: var(--blue); }

/* ---------- jobs ---------- */
.date-nav { display: flex; gap: 10px; margin-bottom: 16px; }
.date-nav a { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; text-decoration: none; color: var(--text); font-size: 14px; }
.jobs { display: flex; flex-direction: column; gap: 12px; }
.job-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.job-card.done { opacity: .85; }
.job-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.job-time { font-weight: 700; font-size: 16px; }
.job-date { color: var(--muted); font-size: 13px; }
.badge { background: #eef2ff; color: #3730a3; font-size: 12px; padding: 3px 10px; border-radius: 20px; }
.badge.dim { background: #f1f5f9; color: var(--muted); }
.job-body { font-size: 14px; line-height: 1.6; }
.job-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- forms ---------- */
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; margin-top: 6px; font-weight: 400; background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: auto; margin: 0; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pill input { display: none; }
.pill span { display: inline-block; padding: 9px 16px; border: 1px solid var(--line); border-radius: 20px; font-size: 14px; font-weight: 400; cursor: pointer; background: #fff; }
.pill input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 600; }

.btn-primary { background: var(--blue); color: #fff; border: 0; border-radius: 8px; padding: 12px 22px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-primary.big { width: 100%; padding: 14px; font-size: 16px; }
.btn { display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 13px; cursor: pointer; text-decoration: none; }
.btn.small { padding: 6px 12px; }
.btn.secondary { background: #f1f5f9; }
.btn.danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 12px 0; }
.inline-form label { margin: 0; min-width: 200px; }
.error { color: #b91c1c; }
.error.box { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 12px; margin-bottom: 16px; }
.notice { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 12px; }
.notice.ok { background: #f0fdf4; border-color: #bbf7d0; }

/* ---------- appointment form layout ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.appt-form .card { margin-bottom: 16px; }
.summary dl { margin: 0; }
.summary dt { font-size: 12px; color: var(--muted); text-transform: uppercase; margin-top: 10px; }
.summary dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; }
.tips ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.7; color: var(--muted); }

/* ---------- calendar ---------- */
.cal { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.cal th { background: var(--navy); color: #fff; padding: 10px; font-size: 13px; }
.cal td { border: 1px solid var(--line); height: 90px; vertical-align: top; padding: 6px; width: 14.28%; }
.cal td.blank { background: #f8fafc; }
.cal td.today { background: #eff6ff; }
.cal td a { text-decoration: none; color: var(--text); display: block; height: 100%; }
.dnum { font-weight: 700; }
.dcount { display: block; margin-top: 6px; background: var(--red); color: #fff; font-size: 12px; border-radius: 12px; padding: 2px 8px; text-align: center; }

/* ---------- login ---------- */
.login-page { background: var(--navy); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 36px; width: 100%; max-width: 400px; text-align: center; }
.login-logo { font-size: 44px; background: var(--red); width: 72px; height: 72px; border-radius: 18px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.login-card h1 { font-size: 20px; margin: 0; letter-spacing: 1px; }
.login-card .sub { color: var(--muted); margin: 6px 0 20px; font-size: 14px; }
.login-card form { text-align: left; }
.login-card .btn-primary { width: 100%; margin-top: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .side-panel { order: -1; }
}
@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .row, .row3 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .cal td { height: 56px; font-size: 13px; }
}
