:root {
  --navy: #0f1f3d;
  --navy-2: #16294f;
  --blue: #2a7de1;
  --blue-soft: rgba(42, 125, 225, 0.18);
  --amber: #f5a623;
  --green: #10b981;
  --red: #ef4444;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --ink: #e8eefc;
  --ink-2: #a9b6d3;
  --ink-3: #6f7fa3;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-2: rgba(255, 255, 255, 0.1);
  --edge: rgba(255, 255, 255, 0.16);
  --edge-bright: rgba(255, 255, 255, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-w: 232px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(1200px 700px at 10% -10%, #1d3a73 0%, transparent 60%),
              radial-gradient(900px 600px at 110% 10%, #1b2f5e 0%, transparent 55%),
              var(--navy);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at 30% 0%, #000 30%, transparent 75%);
}
a { color: #7fb4ff; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--ink-2); }
.small { font-size: 0.85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- boot / auth ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; gap: 8px; text-align: center; align-content: center; }
.boot-logo { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.auth .card { width: 100%; max-width: 420px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }

/* ---------- layout ---------- */
.app { position: relative; z-index: 1; }
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  border-right: 1px solid var(--edge); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.sidebar .brand { padding: 6px 10px 16px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500; text-decoration: none; transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--glass); color: var(--ink); }
.nav a.active { background: var(--blue-soft); color: #fff; box-shadow: inset 0 0 0 1px rgba(42,125,225,0.5); }
.nav a .ico { width: 20px; text-align: center; opacity: 0.9; }
.sidebar .spacer { flex: 1; }
.sidebar .user { padding: 10px 12px; font-size: 0.85rem; color: var(--ink-2); border-top: 1px solid var(--edge); }
.sidebar .user b { display: block; color: var(--ink); }
.main { padding: 22px 26px 80px; min-width: 0; }
.bottom-nav { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 14px 14px 92px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 2px;
    background: rgba(15,31,61,0.82); border-top: 1px solid var(--edge); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
  .bottom-nav a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; color: var(--ink-2); font-size: 0.68rem; text-decoration: none; }
  .bottom-nav a .ico { font-size: 1.2rem; }
  .bottom-nav a.active { color: #fff; background: var(--blue-soft); }
}

/* ---------- glass cards ---------- */
.card {
  position: relative; background: var(--glass); border: 1px solid var(--edge); border-radius: var(--radius);
  padding: 18px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.25), inset 0 1px 0 var(--edge-bright);
}
.card.glow::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; box-shadow: 0 0 60px rgba(42,125,225,0.25); }
.card + .card { margin-top: 14px; }
.card h2, .card h3 { margin: 0 0 12px; font-size: 1.05rem; letter-spacing: -0.01em; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } .grid.cols-4.stats, .grid.cols-2.stats { grid-template-columns: 1fr 1fr; } }

.stat { display: block; text-decoration: none; color: inherit; }
.stat .n { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; }
.stat .l { color: var(--ink-2); font-size: 0.85rem; }
.stat.amber .n { color: var(--amber); } .stat.green .n { color: var(--green); } .stat.red .n { color: var(--red); } .stat.blue .n { color: #7fb4ff; }

/* ---------- page header ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-header h1 { margin: 0; font-size: 1.5rem; letter-spacing: -0.02em; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; min-width: 160px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--edge); background: var(--glass-2); color: var(--ink); cursor: pointer; font-weight: 500; line-height: 1.1;
  transition: background 0.15s, transform 0.05s; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,0.16); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #3b8cf0, #2a7de1); border-color: rgba(255,255,255,0.3); color: #fff; box-shadow: 0 6px 20px rgba(42,125,225,0.35); }
.btn.primary:hover { background: linear-gradient(180deg, #4a98f5, #2f84ea); }
.btn.danger { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.45); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 0.85rem; }
.btn.icon { padding: 8px; width: 36px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row.end { justify-content: flex-end; }

/* ---------- forms ---------- */
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field-head { display: flex; align-items: center; gap: 2px; }
.field > label, .field-head > label { font-size: 0.82rem; color: var(--ink-2); font-weight: 500; }
.field .hint { font-size: 0.78rem; color: var(--ink-3); }
.input, input.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--edge);
  background: rgba(0,0,0,0.22); color: var(--ink); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42,125,225,0.25); }
select.input option { background: var(--navy-2); color: var(--ink); }
textarea.input { min-height: 90px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
.check { display: flex; align-items: center; gap: 8px; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.inline-form .field { margin: 0; }
.money { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ---------- form engine (certificates) ---------- */
.fgrid { display: grid; gap: 10px 12px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.fcell { grid-column: span 4; display: grid; gap: 4px; align-content: start; }
.fcell.w-full { grid-column: span 12; } .fcell.w-half { grid-column: span 6; } .fcell.w-third { grid-column: span 4; } .fcell.w-quarter { grid-column: span 3; }
.fcell > label { font-size: 0.82rem; color: var(--ink-2); font-weight: 500; }
.fcell .req { color: var(--red); }
.fcell .hint { font-size: 0.78rem; color: var(--ink-3); }
.fcell .fnote { margin: 0; font-style: italic; }
.fcell .fheading { margin: 8px 0 0; font-size: 0.95rem; }
@media (max-width: 900px) { .fcell, .fcell.w-third, .fcell.w-quarter { grid-column: span 6; } .fcell.w-full, .fcell.w-half { grid-column: span 12; } }
@media (max-width: 560px) { .fcell, .fcell.w-third, .fcell.w-quarter, .fcell.w-half { grid-column: span 12; } }
.seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: rgba(0,0,0,0.22); border: 1px solid var(--edge); flex-wrap: wrap; }
.seg button { padding: 7px 12px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font-weight: 500; white-space: nowrap; }
.seg button.on { color: #fff; background: var(--glass-2); box-shadow: inset 0 1px 0 var(--edge-bright); }
.seg button.on.good { background: rgba(16,185,129,0.35); } .seg button.on.bad { background: rgba(239,68,68,0.4); } .seg button.on.mid { background: rgba(245,158,11,0.35); }
.ftable td { padding: 6px 6px; } .ftable th { white-space: nowrap; } .ftable td .input { min-width: 110px; padding: 7px 9px; } .ftable td.short .input { min-width: 70px; width: 80px; } .ftable td .seg button { padding: 5px 8px; font-size: 0.85rem; }
.frows { display: grid; gap: 10px; } .frow.card { padding: 12px 14px; } .frow-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sig-pad { width: 100%; max-width: 600px; aspect-ratio: 600 / 180; display: block; background: #fff; border-radius: 10px; border: 1px dashed #8aa; touch-action: none; cursor: crosshair; }
.sig-img { height: 90px; max-width: 100%; background: #fff; border-radius: 10px; padding: 6px; display: block; }
.photo-tile { position: relative; } .photo-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--edge); cursor: pointer; }
.photo-tile .x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,0.6); color: #fff; cursor: pointer; font-size: 1rem; line-height: 1; }
.cert-preview { background: #fff; color: #15213b; border-radius: var(--radius); padding: 22px; }
.photo-tile.pick { display: block; cursor: pointer; opacity: 0.6; }
.photo-tile.pick.on { opacity: 1; } .photo-tile.pick.on img { outline: 3px solid var(--accent); }
.photo-tile.pick input { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; z-index: 1; }
.photo-tile.pick .cap { font-size: 0.75rem; color: var(--ink-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-state { font-size: 0.8rem; color: var(--ink-3); align-self: center; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--edge); background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
table.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.07); vertical-align: middle; }
.table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); font-weight: 600; background: rgba(255,255,255,0.03); position: sticky; top: 0; }
.table tbody tr { cursor: pointer; transition: background 0.1s; }
.table tbody tr:hover { background: rgba(255,255,255,0.05); }
.table tr.static { cursor: default; }
.table td.money, .table th.money { text-align: right; }
.table .sub { display: block; font-size: 0.8rem; color: var(--ink-3); }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--edge); }
@media (max-width: 700px) { .table .hide-sm { display: none; } }

/* ---------- list cards (phone) ---------- */
.list { display: grid; gap: 8px; }
.list-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--edge); cursor: pointer; }
.list-item:hover { background: rgba(255,255,255,0.09); }
.list-item .t { font-weight: 600; }
.list-item .s { color: var(--ink-2); font-size: 0.85rem; }

/* ---------- badges / tabs ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.08); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, #9ca3af); box-shadow: 0 0 10px var(--c, #9ca3af); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,0.2); border: 1px solid var(--edge); width: fit-content; max-width: 100%; }
.tabs button { padding: 7px 12px; border-radius: 9px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font-weight: 500; white-space: nowrap; }
.tabs button.active { background: var(--glass-2); color: #fff; box-shadow: inset 0 1px 0 var(--edge-bright); }
.tabs button .count { margin-left: 6px; font-size: 0.75rem; color: var(--ink-3); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--edge); background: transparent; color: var(--ink-2); cursor: pointer; font-size: 0.82rem; }
.chip.active { background: var(--blue-soft); color: #fff; border-color: rgba(42,125,225,0.6); }

/* ---------- modal / toast ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(5,12,28,0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade 0.15s; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; background: linear-gradient(180deg, rgba(30,50,95,0.95), rgba(15,31,61,0.97)); border: 1px solid var(--edge-bright); border-radius: var(--radius); padding: 20px; box-shadow: 0 30px 80px rgba(0,0,0,0.5); animation: pop 0.18s; }
.modal.wide { max-width: 860px; }
.modal h2 { margin: 0 0 14px; font-size: 1.15rem; }
.modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
@media (max-width: 600px) { .modal-back { place-items: end center; padding: 0; } .modal { border-radius: 20px 20px 0 0; max-height: 92vh; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(12px); opacity: 0; } }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: rgba(20,40,80,0.95); border: 1px solid var(--edge-bright); box-shadow: 0 10px 30px rgba(0,0,0,0.4); animation: pop 0.2s; }
.toast.error { border-color: rgba(239,68,68,0.6); } .toast.success { border-color: rgba(16,185,129,0.6); }
@media (max-width: 900px) { .toasts { bottom: 86px; } }

/* Notification bell: new enquiries, in the sidebar on desktop and floating top right on phones. */
.bell-wrap { position: relative; margin-left: auto; }
/* The bell list is wider than the sidebar, so the sidebar must sit above the page beside it. */
.sidebar { z-index: 5; }
.bell { position: relative; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; font-size: 1.05rem;
  background: var(--glass-2); border: 1px solid var(--edge); color: var(--ink); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.bell:hover { border-color: var(--edge-bright); }
.bell.ring { border-color: var(--amber); box-shadow: 0 0 14px rgba(245,158,11,0.45); }
.bell.ring .bell-ico { animation: bell-ring 1.6s ease-in-out 2; transform-origin: 50% 10%; }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; font-size: 0.7rem; font-weight: 700;
  display: grid; place-items: center; background: var(--red); color: #fff; box-shadow: 0 0 0 2px var(--navy); }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-4deg); } }
.bell-panel { position: absolute; top: 46px; left: 0; z-index: 150; width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; padding: 12px;
  font-size: 0.9rem; font-weight: 400; letter-spacing: normal; background: rgba(14,30,62,0.97); }
.bell-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 8px; }
.bell-item { display: grid; gap: 3px; padding: 10px; border-radius: var(--radius-sm); color: var(--ink); border: 1px solid transparent; cursor: pointer; }
.bell-name { color: var(--ink); font-weight: 700; text-decoration: none; }
.bell-item:hover { background: var(--glass-2); border-color: var(--edge); }
.bell-item.fresh { border-left: 3px solid var(--amber); }
.bell-line { display: flex; justify-content: space-between; gap: 8px; }
.bell-contact { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.bell-contact a { color: var(--blue); }
.bell-all { display: block; text-align: center; padding: 10px 0 4px; color: var(--blue); }
.bell-float { display: none; }
@media (max-width: 900px) {
  .bell-float { display: block; position: fixed; top: 10px; right: 12px; z-index: 120; }
  .bell-float .bell-panel { left: auto; right: 0; }
  .main { padding-top: 58px; }
}

/* ---------- misc ---------- */
.empty { padding: 36px 16px; text-align: center; color: var(--ink-2); }
.empty .big { font-size: 2rem; margin-bottom: 6px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 0.93rem; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 10px; }
.section-title h3 { margin: 0; font-size: 1rem; }
.timeline { display: grid; gap: 10px; }
.timeline .item { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.timeline .dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 10px var(--blue); }
.timeline .when { color: var(--ink-3); font-size: 0.8rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--edge); cursor: pointer; }
.sched { display: grid; grid-template-columns: 60px 1fr; border: 1px solid var(--edge); border-radius: var(--radius); overflow: hidden; background: var(--glass); }
.sched .hour { height: 56px; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 0.75rem; color: var(--ink-3); padding: 4px 6px; }
.sched .col { position: relative; border-left: 1px solid rgba(255,255,255,0.06); }
.sched .appt { position: absolute; left: 4px; right: 4px; padding: 6px 8px; border-radius: 8px; background: var(--blue-soft); border: 1px solid rgba(42,125,225,0.6); font-size: 0.8rem; overflow: hidden; cursor: pointer; }
.sched .appt b { display: block; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week .day { min-height: 120px; padding: 8px; border-radius: 12px; background: var(--glass); border: 1px solid var(--edge); }
.week .day.today { border-color: var(--blue); box-shadow: 0 0 20px rgba(42,125,225,0.25); }
.week .day h4 { margin: 0 0 6px; font-size: 0.8rem; color: var(--ink-2); }
.week .appt { display: block; padding: 5px 7px; margin-bottom: 4px; border-radius: 8px; background: var(--blue-soft); border: 1px solid rgba(42,125,225,0.5); font-size: 0.78rem; cursor: pointer; }
@media (max-width: 900px) { .week { grid-template-columns: 1fr; } }
/* Scheduler board (1.3.0, spec 24): the diary beside the "Jobs to book" panel; drag and drop by pointer. */
.sched-board { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.sched-main { min-width: 0; }
.board-panel { position: sticky; top: 10px; max-height: calc(100vh - 20px); overflow: auto; }
.board-panel h3 { margin: 0 0 6px; }
.board-list { margin-top: 8px; }
.board-job .t { display: flex; align-items: center; gap: 4px; }
.board-booked { color: #7fb4ff; }
.btn.drag-handle { min-width: 44px; min-height: 44px; cursor: grab; font-size: 1.1rem; }
.sched .appt { touch-action: none; }
.drag-ghost { opacity: 0.88; box-shadow: 0 12px 30px rgba(0,0,0,0.45); cursor: grabbing; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }
.sched .col.drop-over { background-color: rgba(42,125,225,0.10); }
.drop-slot { position: absolute; left: 2px; right: 2px; border: 2px dashed #7fb4ff; border-radius: 8px; font-size: 0.75rem; font-weight: 700; padding: 2px 6px; color: #cfe2ff; pointer-events: none; }
.toast-actions { display: grid; gap: 8px; }
/* Jobs list: Booked for (spec 24). */
.th-sort { background: none; border: 0; color: inherit; font: inherit; font-weight: inherit; cursor: pointer; padding: 0; min-height: 32px; text-align: left; }
.th-sort:focus-visible { outline: 2px solid #7fb4ff; outline-offset: 2px; }
.input.booked-date { width: 160px; min-height: 36px; }
@media (max-width: 1100px) { .sched-board { grid-template-columns: 1fr; } .board-panel { position: static; max-height: none; } }
@media (prefers-reduced-motion: reduce) { .drag-ghost { box-shadow: none; } }
.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .bottom-nav, .page-header .actions, .toolbar, .no-print { display: none !important; }
  .main { padding: 0; }
  .card, .table-wrap { background: #fff; border-color: #ddd; box-shadow: none; backdrop-filter: none; }
  .print-only { display: block; }
}

/* ---------- to-do ---------- */
.todo .t { display: flex; align-items: center; gap: 10px; }
.todo .t input { width: 18px; height: 18px; margin: 0; flex: none; }
.todo.done .text { text-decoration: line-through; color: var(--ink-3); }
.tag-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); flex: none; }
.list-item .s.overdue { color: var(--red); font-weight: 600; }

/* ---------- map ---------- */
.map { height: 60vh; min-height: 340px; border-radius: var(--radius); border: 1px solid var(--edge); overflow: hidden; background: var(--glass); position: relative; z-index: 0; }
.leaflet-container { font: inherit; color: #15213b; }
.leaflet-popup-content { margin: 12px 14px; line-height: 1.35; min-width: 200px; }
.leaflet-popup-content a { color: #1f6fd0; }
.map-pop .btn { background: #eef2f9; border-color: #d9dfeb; color: #15213b; }
.map-pop .btn.primary { color: #fff; }
.map-pop .badge { border-color: #d9dfeb; background: #f1f4fa; }
@media (max-width: 900px) { .map { height: 50vh; } }

/* ---------- email (Group E) ---------- */
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.email-status { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }
.email-line a { color: var(--ink); }
.email-body { white-space: pre-wrap; margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--edge); max-height: 50vh; overflow: auto; line-height: 1.45; }
.msg-list { display: grid; gap: 8px; }
.msg-item { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--edge); background: var(--glass); cursor: pointer; }
.msg-item:hover, .msg-item:focus-visible { border-color: var(--edge-bright); outline: none; }
.msg-item.in { border-left: 3px solid var(--green); }
.msg-item.unread .msg-subject, .unread { font-weight: 700; color: var(--ink); }
.msg-head { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-2); font-size: 0.85rem; }
.msg-head .when { color: var(--ink-3); white-space: nowrap; }
.msg-subject { margin-top: 2px; }
.msg-preview { color: var(--ink-3); font-size: 0.85rem; margin-top: 2px; }
.day-picks { display: flex; gap: 10px; flex-wrap: wrap; }
.reminder-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 4px 16px; align-items: center; margin: 10px 0; }
@media (max-width: 700px) { .reminder-grid { grid-template-columns: 1fr; } }
/* Price list (1.5.0, spec 27) */
.price-pick { position: relative; }
.price-pick-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto; background: var(--navy-2); border: 1px solid var(--edge); border-radius: var(--radius-sm); padding: 4px; }
.pp-group { color: var(--ink-3); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 8px 2px; }
.pp-item { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 10px 8px; border-radius: 8px; cursor: pointer; min-height: 44px; }
.pp-item.active, .pp-item:not(.off):hover { background: var(--blue-soft); }
.pp-item.off { opacity: 0.5; cursor: not-allowed; }
.pp-name { flex: 1 1 auto; color: var(--ink); }
.pp-code { color: var(--ink-3); font-size: 0.8rem; }
.pp-price { color: var(--ink-2); white-space: nowrap; }
.pp-note { flex-basis: 100%; color: var(--ink-3); font-size: 0.8rem; }
.pp-empty { padding: 10px 8px; color: var(--ink-3); }
@media (max-width: 600px) { .price-pick-list { position: static; max-height: 60vh; margin-top: 6px; } }
.list-note { color: var(--ink-2); font-size: 0.85rem; margin-top: 4px; }
.not-set { color: var(--red); font-weight: 600; }
.price-cat { margin-top: 14px; }
.price-cat h3 { margin: 0 0 6px; font-size: 0.95rem; color: var(--ink-2); }
.price-row-moves { display: inline-flex; gap: 4px; }
/* On my way lock, office side (1.6.0, spec 28) */
.field-lock-banner { border-left: 4px solid var(--amber); background: rgba(245, 158, 11, 0.12); }
.job-locked button:disabled, .job-locked input:disabled, .job-locked select:disabled, .job-locked textarea:disabled { cursor: not-allowed; opacity: 0.55; }
.office-note { border-left: 4px solid var(--amber); }
.office-note-item { border-left: 3px solid var(--amber); padding-left: 8px; }
.job-locked-line { color: var(--amber); }
.appt-locked { outline: 2px dashed var(--amber); outline-offset: -2px; cursor: default; }
.appt-lock { font-size: 0.75rem; color: var(--amber); }
/* "?" help hints (1.8.0, spec 30) */
.help-q {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px; padding: 0; margin: 0 0 0 6px;
  border: 0; border-radius: 50%; background: var(--blue); color: #fff; font: 700 12px/1 var(--font, inherit); cursor: pointer;
  vertical-align: middle; box-shadow: 0 0 0 1px rgba(255,255,255,0.18); opacity: 0.85;
}
.help-q:hover, .help-q[aria-expanded="true"] { opacity: 1; }
.help-q:focus-visible { outline: 2px solid #7fb4ff; outline-offset: 2px; opacity: 1; }
.hints-off .help-q { display: none !important; }
/* On phones the tap target is 32 px while the dot still looks 18 px. */
@media (max-width: 900px), (pointer: coarse) {
  .help-q { width: 32px; height: 32px; margin: -7px -7px -7px -1px; background: radial-gradient(circle, var(--blue) 0 8.5px, transparent 9px); box-shadow: none; }
}
.title-wrap { display: flex; align-items: center; gap: 2px; min-width: 0; }
.with-hint { display: flex; align-items: center; gap: 2px; }
.nav-row { display: flex; align-items: center; gap: 2px; }
.nav-row > a { flex: 1; min-width: 0; }
.nav-row > .help-q { margin-right: 4px; }
/* Engineer bottom tabs: the "?" sits in the tab's top-right corner, outside the link. */
.tab-cell { position: relative; display: grid; min-width: 0; }
.tab-cell > .help-q { position: absolute; top: -6px; right: -4px; margin: 0; }
/* A tab row's "?" sits after the row, outside .tabs, and drops below it on a narrow screen rather than overflow. */
.tabs-row { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; margin-bottom: 14px; max-width: 100%; min-width: 0; }
.tabs-row > .tabs { margin-bottom: 0; min-width: 0; }
.help-pop {
  position: fixed; z-index: 1000; width: 300px; max-width: calc(100vw - 16px); padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--navy-2, #13254a); color: var(--ink); border: 1px solid var(--blue); box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  font-size: 0.9rem; line-height: 1.4; text-align: left; font-weight: 400; letter-spacing: normal; text-transform: none; white-space: normal;
}
.help-pop:focus { outline: none; }
.help-pop:focus-visible { outline: 2px solid #7fb4ff; outline-offset: 2px; }
.help-pop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.help-pop-title { font-size: 0.95rem; }
.help-pop-close { background: none; border: 0; color: var(--ink-2); cursor: pointer; font-size: 1rem; line-height: 1; min-width: 32px; min-height: 32px; margin: -8px -10px -6px 0; }
.help-pop-close:hover { color: var(--ink); }
.help-pop p { margin: 6px 0 0; }
.help-pop-tip { color: var(--ink-2); }
@media print { .help-q, .help-pop { display: none !important; } }
