/* ProCare Employee Portal — shared styles */

:root {
  --pc-navy: #0a2540;
  --pc-red: #dc2626;
  --pc-orange: #f59e0b;
  --pc-bg: #f1f5f9;
  --pc-text: #0f172a;
  --pc-muted: #64748b;
  --pc-border: #e2e8f0;
  --pc-card: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--pc-bg);
  color: var(--pc-text);
  font-size: 14px;
}

a { color: var(--pc-red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Brand logo — transparent PNG */
.brand-logo {
  background-image: url('../../../assets/img/procare-logo.png');
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

/* ===== App layout ===== */
.app { display: flex; min-height: 100vh; background: linear-gradient(180deg,#f2f4f7 0%,#edf1f5 100%); }
.sidebar {
  width: 220px;
  background: linear-gradient(180deg, #0e3a74 0%, #0a2e5d 100%);
  color: #eaf2ff;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.06);
}
.sidebar .logo {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar .logo .brand-logo { width: 140px; height: 113px; background-color: rgba(255,255,255,0.95); border-radius: 8px; padding: 6px; }
.sidebar nav { padding: .75rem .85rem; flex: 1; display:flex; flex-direction:column; gap: 6px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 14px;
  color: #e9f1fb;
  font-weight: 500;
  font-size: 15px;
  border-radius: 12px;
  transition: all .15s ease;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.sidebar nav a.active {
  background: rgba(255,255,255,0.14);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.sidebar nav a i { width: 22px; text-align: center; color: rgba(255,255,255,0.85); font-size: 1rem; }
.sidebar nav .section-label {
  padding: 1rem 1.25rem .35rem;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #64748b;
  font-weight: 700;
}
.sidebar .user-card {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: .65rem;
}
.sidebar .user-card .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--pc-red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.sidebar .user-card .meta { flex: 1; min-width: 0; }
.sidebar .user-card .name { color: #fff; font-weight: 600; font-size: .85rem; line-height: 1.2; }
.sidebar .user-card .role { color: #94a3b8; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.sidebar .user-card .logout { color: #94a3b8; padding: .35rem; }
.sidebar .user-card .logout:hover { color: #fff; }

.main { flex: 1; min-width: 0; }

/* Top bar — for non-dashboard pages */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--pc-border);
  padding: 0 1.5rem;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
}
.topbar h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f1d2f;
  margin: 0;
  letter-spacing: -0.02em;
}
.topbar .actions { display: flex; gap: .5rem; align-items: center; }

.content { padding: 24px 22px 26px; max-width: 1500px; }

/* ===== Components ===== */
.card {
  background: var(--pc-card);
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
.card-header {
  font-weight: 700;
  color: var(--pc-navy);
  margin-bottom: 1rem;
  display: flex; justify-content: space-between; align-items: center;
}
.card-header h2 { margin: 0; font-size: 1.05rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .88rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .12s ease;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(180deg, #1467d0 0%, #0f59bd 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(13,85,180,.18), inset 0 0 0 1px rgba(255,255,255,.12);
}
.btn-primary:hover { background: linear-gradient(180deg, #1a73da 0%, #1361c5 100%); text-decoration: none; }
.btn-navy { background: var(--pc-navy); color: #fff; }
.btn-navy:hover { background: #061629; text-decoration: none; }
.btn-ghost { background: #fff; color: var(--pc-navy); border-color: var(--pc-border); }
.btn-ghost:hover { background: #f8fafc; text-decoration: none; border-color:#cbd5e1; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; text-decoration: none; }
.btn-warn { background: var(--pc-orange); color: #fff; }
.btn-warn:hover { background: #d97706; text-decoration: none; }
.btn-sm { padding: .35rem .7rem; font-size: .78rem; }
.btn-lg { padding: .85rem 1.5rem; font-size: 1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input, .select, .textarea {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--pc-border);
  border-radius: 7px;
  background: #fff;
  font-size: .88rem;
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--pc-red); box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }
.label { display: block; font-size: .75rem; font-weight: 600; color: #475569; margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .04em; }

/* ===== Status pills (Dispatch.me model) ===== */
.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .6rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border: 1px solid transparent;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-offered     { background: #fef3c7; color: #92400e; }
.pill-unscheduled { background: #e2e8f0; color: #334155; }
.pill-scheduled   { background: #dbeafe; color: #1e40af; }
.pill-inprogress  { background: #fed7aa; color: #9a3412; }
.pill-paused      { background: #fee2e2; color: #991b1b; }
.pill-completed   { background: #dcfce7; color: #166534; }
.pill-canceled    { background: #f1f5f9; color: #64748b; }
.pill-canceled::before { background: #94a3b8; }

/* ===== Table ===== */
.tbl {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.tbl th, .tbl td {
  text-align: left;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: .88rem;
}
.tbl th {
  font-size: .72rem;
  font-weight: 700;
  color: var(--pc-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  background: #fafbfc;
  position: sticky; top: 60px;
  border-bottom: 1px solid var(--pc-border);
}
.tbl td { color: var(--pc-navy); }
.tbl tr.clickable { cursor: pointer; transition: background .12s ease; }
.tbl tr.clickable:hover { background: #fafbfc; }
.tbl tr:last-child td { border-bottom: none; }

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .7rem;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
}
.chip .x {
  cursor: pointer;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(0,0,0,0.1);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .7rem; line-height: 1;
}
.chip .x:hover { background: rgba(0,0,0,0.2); }

/* KPI cards */
.kpi {
  background: #fff;
  border: 1px solid var(--pc-border);
  border-radius: 10px;
  padding: 1.25rem;
}
.kpi .num { font-size: 1.8rem; font-weight: 800; color: var(--pc-navy); line-height: 1.1; }
.kpi .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--pc-muted); font-weight: 600; }
.kpi .delta { font-size: .75rem; font-weight: 600; margin-top: .35rem; }
.kpi .delta.up { color: #16a34a; }
.kpi .delta.down { color: #dc2626; }

/* Tabs */
.tabs { border-bottom: 1px solid var(--pc-border); display: flex; gap: 0; margin-bottom: 1rem; }
.tab {
  padding: .75rem 1.1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--pc-muted);
  border-bottom: 2px solid transparent;
  font-size: .85rem;
}
.tab:hover { color: var(--pc-navy); }
.tab.active { color: var(--pc-red); border-bottom-color: var(--pc-red); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== Dispatch board (schedule.html) ===== */
.board-wrap { background: #fff; border: 1px solid var(--pc-border); border-radius: 10px; overflow: auto; }
.board {
  display: grid;
  grid-template-columns: 160px repeat(11, minmax(110px, 1fr));
  font-size: .8rem;
  min-width: 1400px;
}
.board .cell { border-right: 1px solid var(--pc-border); border-bottom: 1px solid var(--pc-border); padding: .35rem; min-height: 88px; position: relative; }
.board .cell.head {
  background: #f8fafc; font-weight: 700; color: #475569;
  text-align: center; min-height: 38px; padding: .55rem .35rem;
  position: sticky; top: 0; z-index: 1;
}
.board .cell.tech-row {
  background: #fff;
  font-weight: 700;
  color: var(--pc-navy);
  display: flex; align-items: center; gap: .55rem;
  padding: .55rem;
  position: sticky; left: 0; z-index: 1;
  border-right: 2px solid var(--pc-border);
}
.board .cell.tech-row .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--pc-red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
}
.board .cell.drop-target.drag-over { background: #fef3c7; }
.board .cell.unassigned-col { background: #fafbfc; }

.job-card {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-left: 3px solid var(--pc-red);
  border-radius: 5px;
  padding: .35rem .5rem;
  font-size: .73rem;
  cursor: grab;
  margin-bottom: .25rem;
  user-select: none;
}
.job-card:active { cursor: grabbing; }
.job-card.dragging { opacity: .5; }
.job-card .jc-customer { font-weight: 700; color: var(--pc-navy); }
.job-card .jc-time { color: #475569; font-size: .68rem; }
.job-card .jc-svc { color: var(--pc-muted); font-size: .68rem; }

.unassigned-list {
  background: #fff;
  border: 1px solid var(--pc-border);
  border-radius: 10px;
  padding: 1rem;
  min-height: 80px;
}
.unassigned-list h3 { margin: 0 0 .5rem; font-size: .85rem; color: var(--pc-navy); }
.unassigned-list .job-card { background: #fef3c7; border-color: #fcd34d; border-left-color: var(--pc-orange); }

/* ===== Tech mobile view ===== */
.tech-shell { max-width: 480px; margin: 0 auto; background: #fff; min-height: 100vh; }
.tech-header {
  background: var(--pc-navy);
  color: #fff;
  padding: 1rem;
  display: flex; align-items: center; justify-content: space-between;
}
.tech-job-card {
  border: 1px solid var(--pc-border);
  border-left: 4px solid var(--pc-red);
  border-radius: 8px;
  padding: 1rem;
  margin: .75rem;
  background: #fff;
}
.tech-job-card .ttime { font-size: .75rem; color: var(--pc-muted); font-weight: 600; }
.tech-job-card .tcust { font-weight: 700; color: var(--pc-navy); font-size: 1.05rem; margin-top: .15rem; }
.tech-job-card .taddr { color: var(--pc-muted); font-size: .85rem; margin: .25rem 0; }
.tech-job-card .tbtns { display: flex; gap: .5rem; margin-top: .65rem; flex-wrap: wrap; }

.signature-pad {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  width: 100%;
  height: 180px;
  display: block;
  touch-action: none;
}

/* Photo thumbs */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .5rem; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--pc-border); }

/* Activity feed */
.activity-item { padding: .6rem 0; border-bottom: 1px dashed var(--pc-border); display: flex; gap: .65rem; align-items: flex-start; }
.activity-item:last-child { border-bottom: none; }
.activity-item .ai-icon { width: 30px; height: 30px; border-radius: 50%; background: #fee2e2; color: var(--pc-red); display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.activity-item .ai-time { color: var(--pc-muted); font-size: .72rem; }

/* Equipment cards */
.equipment-card {
  border: 1px solid var(--pc-border);
  border-radius: 8px;
  padding: .85rem;
  background: #f8fafc;
  display: flex; gap: .75rem; align-items: flex-start;
}
.equipment-card .eq-icon { font-size: 1.6rem; color: var(--pc-red); flex-shrink: 0; padding-top: .15rem; }
.equipment-card .eq-meta { flex: 1; }
.equipment-card .eq-title { font-weight: 700; color: var(--pc-navy); }
.equipment-card .eq-detail { color: var(--pc-muted); font-size: .8rem; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.modal-backdrop.show { display: flex; }
.modal { background: #fff; border-radius: 12px; max-width: 540px; width: 100%; max-height: 90vh; overflow: auto; }
.modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--pc-border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; font-size: 1.05rem; color: var(--pc-navy); }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--pc-border); display: flex; justify-content: flex-end; gap: .5rem; }
.modal .close { cursor: pointer; color: var(--pc-muted); font-size: 1.3rem; }

/* Helpers */
.row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.muted { color: var(--pc-muted); }
.tiny { font-size: .75rem; }
.bold { font-weight: 700; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.between { justify-content: space-between; }
.center { align-items: center; }
.right { text-align: right; }
.grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
}

/* ===== Dashboard ===== */
.welcome-h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--pc-navy);
  margin: 0;
  letter-spacing: -0.02em;
}

.kpi-clean {
  background: #fff;
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
.kpi-clean .kpi-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.kpi-clean .kpi-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pc-navy);
}
.kpi-clean .kpi-link {
  font-size: .85rem;
  color: var(--pc-red);
  font-weight: 600;
  text-decoration: none;
}
.kpi-clean .kpi-link:hover { text-decoration: underline; }
.kpi-clean .kpi-row {
  display: flex; align-items: center; gap: 1rem;
}
.kpi-clean .kpi-circle {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--pc-navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.kpi-clean .kpi-num {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--pc-navy);
  line-height: 1;
}
.kpi-clean .kpi-sub {
  font-size: .85rem;
  color: var(--pc-muted);
  margin-top: .2rem;
}

/* Cleaner card variant for dashboard */
.dash-card {
  background: #fff;
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  padding: 1.4rem;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
.dash-card-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 1rem;
}
.dash-card-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pc-navy);
}
.dash-card-header .more {
  font-size: .85rem; color: var(--pc-red); font-weight: 600; text-decoration: none;
}
.dash-card-header .more:hover { text-decoration: underline; }

/* Schedule list (Today's Schedule) — 3-column layout matching reference */
.sched-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: .85rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.sched-row:last-child { border-bottom: none; }
.sched-row .sched-main {
  font-weight: 700;
  color: var(--pc-navy);
  font-size: .95rem;
}
.sched-row .sched-main a { color: var(--pc-navy); }
.sched-row .sched-main a:hover { color: var(--pc-red); text-decoration: none; }

/* Avatar stack */
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .av-mini {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #94a3b8; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700;
  border: 2px solid #fff;
  margin-left: -8px;
}
.avatar-stack .av-mini:first-child { margin-left: 0; }
.avatar-stack .av-mini.unassigned { background: #cbd5e1; color: #475569; }

/* Status badges (matches reference: Active=green, Pending=amber, Critical=red) */
.tag {
  display: inline-block;
  padding: .35rem .9rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 700;
}
.tag-active   { background: #dcfce7; color: #166534; }
.tag-pending  { background: #fef3c7; color: #92400e; }
.tag-critical { background: #fee2e2; color: #991b1b; }
.tag-neutral  { background: #f1f5f9; color: #475569; }
.tag-info     { background: #dbeafe; color: #1e40af; }

/* Recent activity rows for dashboard */
.act-row {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .75rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.act-row:last-child { border-bottom: none; }
.act-row .act-icn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--pc-navy);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: .9rem;
}
.act-row .act-text { color: var(--pc-navy); font-weight: 600; font-size: .92rem; }
.act-row .act-time { color: var(--pc-muted); font-size: .78rem; margin-top: .15rem; }

/* Visits chart container */
.visits-chart-wrap {
  position: relative;
  margin-top: .25rem;
}
.visits-chart {
  width: 100%;
  height: 220px;
  display: block;
}
.visits-chart .grid-line { stroke: #e2e8f0; stroke-width: 1; }
.visits-chart .axis-text { font-size: 11px; fill: var(--pc-muted); font-family: 'Inter', sans-serif; }
.visits-chart .data-line { fill: none; stroke: #2563eb; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.visits-chart .data-area { fill: url(#chartGradient); stroke: none; }
.visits-chart .data-point { fill: #2563eb; }
.visits-chart .data-label { font-size: 11px; fill: var(--pc-navy); font-weight: 600; font-family: 'Inter', sans-serif; }
.visits-chart-foot {
  margin-top: .5rem;
  font-size: .82rem;
  color: var(--pc-muted);
}
.visits-chart-foot strong { color: var(--pc-navy); }

/* Customer table for dashboard */
.cust-tbl { width: 100%; border-collapse: collapse; }
.cust-tbl th {
  text-align: left;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--pc-muted);
  font-weight: 700;
  padding: .55rem 0;
  border-bottom: 1px solid var(--pc-border);
}
.cust-tbl th:last-child, .cust-tbl td:last-child { text-align: right; }
.cust-tbl td {
  padding: .8rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: .92rem;
  color: var(--pc-navy);
  font-weight: 600;
}
.cust-tbl tr:last-child td { border-bottom: none; }
.cust-tbl tr.clickable { cursor: pointer; }
.cust-tbl tr.clickable:hover td { background: #fafbfc; }

/* Legacy section title (kept for other pages that still use it) */
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pc-navy);
  margin: 2rem 0 1rem;
  display: flex;
  align-items: center;
  gap: .55rem;
}
.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 22px;
  background: var(--pc-red);
  border-radius: 2px;
}
.section-title .sub {
  font-size: .8rem;
  font-weight: 500;
  color: var(--pc-muted);
  margin-left: auto;
}

/* Welcome banner at top of dashboard */
.welcome-card {
  background: linear-gradient(135deg, var(--pc-navy) 0%, #061629 60%, #1a2e4a 100%);
  color: #fff;
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.welcome-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 90% 20%, rgba(220,38,38,0.18) 0%, transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(245,158,11,0.12) 0%, transparent 50%);
  pointer-events: none;
}
.welcome-card > * { position: relative; z-index: 1; }
.welcome-card .greeting { font-size: 1.5rem; font-weight: 800; margin: 0 0 .25rem; }
.welcome-card .date { color: #cbd5e1; font-size: .9rem; }

/* KPI variations */
.kpi-icon {
  display: flex; gap: 1rem; align-items: flex-start;
  background: #fff; border: 1px solid var(--pc-border);
  border-radius: 10px; padding: 1.1rem 1.15rem;
  position: relative; overflow: hidden;
}
.kpi-icon::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 3px;
  background: var(--accent, var(--pc-red));
}
.kpi-icon .icon-box {
  width: 42px; height: 42px;
  border-radius: 9px;
  background: var(--accent-bg, #fee2e2);
  color: var(--accent, var(--pc-red));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.kpi-icon .body { flex: 1; min-width: 0; }
.kpi-icon .num { font-size: 1.6rem; font-weight: 800; color: var(--pc-navy); line-height: 1.05; }
.kpi-icon .label { font-size: .7rem; color: var(--pc-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.kpi-icon .delta { font-size: .72rem; margin-top: .3rem; font-weight: 600; }
.kpi-icon .delta.up { color: #16a34a; }
.kpi-icon .delta.down { color: #dc2626; }
.kpi-icon .delta.neutral { color: var(--pc-muted); }

/* Bar chart */
.bar-chart .bar-row { display: flex; align-items: center; gap: .75rem; padding: .4rem 0; }
.bar-chart .bar-row .label { width: 130px; font-size: .8rem; color: var(--pc-navy); font-weight: 600; flex-shrink: 0; }
.bar-chart .bar-row .bar-container { flex: 1; height: 16px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
.bar-chart .bar-row .bar-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--pc-navy) 0%, var(--pc-red) 100%);
  transition: width .4s ease;
  min-width: 4px;
}
.bar-chart .bar-row .value { width: 70px; text-align: right; font-size: .8rem; color: var(--pc-muted); font-variant-numeric: tabular-nums; font-weight: 600; }

/* Sparkline (SVG-based) */
.sparkline {
  display: block;
  width: 100%;
  height: 70px;
  overflow: visible;
}
.sparkline polyline { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sparkline .area { fill-opacity: .15; stroke: none; }
.sparkline .axis-label { font-size: 9px; fill: var(--pc-muted); font-family: 'Inter', sans-serif; }

/* Donut/legend rows */
.legend-row {
  display: flex; align-items: center; gap: .55rem;
  padding: .4rem 0;
  font-size: .82rem;
  border-bottom: 1px dashed var(--pc-border);
}
.legend-row:last-child { border-bottom: none; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-row .lbl { flex: 1; color: var(--pc-navy); font-weight: 600; }
.legend-row .val { color: var(--pc-muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.legend-bar { width: 100%; height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden; margin-top: .3rem; }
.legend-bar > div { height: 100%; border-radius: 3px; }

/* Inquiry row (recent leads) */
.inquiry-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .35rem;
  padding: .65rem 0;
  border-bottom: 1px dashed var(--pc-border);
  font-size: .85rem;
}
.inquiry-row:last-child { border-bottom: none; }
.inquiry-row .name { font-weight: 700; color: var(--pc-navy); }
.inquiry-row .meta { color: var(--pc-muted); font-size: .75rem; margin-top: 2px; }
.inquiry-row .badge {
  background: #dbeafe; color: #1e40af;
  font-size: .68rem; padding: .15rem .5rem;
  border-radius: 99px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  align-self: start;
}
.inquiry-row .badge.lead-job_application { background: #fef3c7; color: #92400e; }
.inquiry-row .badge.lead-hvac_waitlist { background: #fed7aa; color: #9a3412; }

/* Geographic / city pill */
.geo-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  background: #f1f5f9; color: var(--pc-navy);
  padding: .3rem .65rem; border-radius: 6px;
  font-size: .78rem; font-weight: 600;
  margin: .2rem .3rem .2rem 0;
}
.geo-pill .geo-count { color: var(--pc-red); font-variant-numeric: tabular-nums; }

/* ===== Notifications ===== */
.notif-bell { position: relative; }
.notif-badge {
  position: absolute;
  top: -3px; right: -3px;
  background: var(--pc-red); color: #fff;
  font-size: .65rem; font-weight: 800;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  line-height: 1;
}
.notif-item {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .8rem .9rem;
  border-bottom: 1px solid var(--pc-border);
  background: #fff;
}
.notif-item.unread { background: #fef3c7; border-left: 3px solid var(--pc-orange); }
.notif-item:last-child { border-bottom: none; }
.notif-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fee2e2; color: var(--pc-red);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notif-body { flex: 1; min-width: 0; }
.notif-subj { font-weight: 700; color: var(--pc-navy); font-size: .9rem; }
.notif-meta { font-size: .72rem; color: var(--pc-muted); margin-top: .15rem; }

/* ===== Map containers ===== */
.map-container {
  width: 100%;
  height: 600px;
  border-radius: 10px;
  border: 1px solid var(--pc-border);
  overflow: hidden;
  background: #e2e8f0;
}
.map-mini {
  width: 100%;
  height: 200px;
  border-radius: 8px;
  border: 1px solid var(--pc-border);
  overflow: hidden;
  background: #e2e8f0;
}
.leaflet-popup-content {
  font-family: 'Inter', sans-serif !important;
  margin: 12px !important;
}
.leaflet-popup-content .pop-name { font-weight: 700; color: var(--pc-navy); margin-bottom: .25rem; }
.leaflet-popup-content .pop-detail { font-size: .8rem; color: var(--pc-muted); }
.leaflet-popup-content .pop-link { color: var(--pc-red); font-weight: 600; font-size: .82rem; text-decoration: none; }

/* Map marker dot (custom DivIcon) */
.map-marker-dot {
  width: 28px; height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
}
.map-marker-dot i {
  transform: rotate(45deg);
  color: #fff; font-size: .75rem;
}

/* Status filter chips on map */
.map-filter-bar {
  display: flex; flex-wrap: wrap; gap: .4rem;
  align-items: center;
}
.map-filter-bar .map-filter-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .7rem;
  border-radius: 99px;
  border: 1px solid var(--pc-border);
  background: #fff;
  font-size: .78rem; font-weight: 600;
  color: var(--pc-navy);
  cursor: pointer;
  transition: all .12s ease;
}
.map-filter-bar .map-filter-chip:hover { border-color: var(--pc-red); }
.map-filter-bar .map-filter-chip.active {
  background: var(--pc-navy); color: #fff; border-color: var(--pc-navy);
}
.map-filter-bar .map-filter-chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
}

/* ===== Routes view ===== */
.route-card {
  background: #fff;
  border: 1px solid var(--pc-border);
  border-radius: 10px;
  padding: 1.1rem;
  margin-bottom: 1.5rem;
}
.route-header {
  display: flex; gap: .75rem; align-items: center;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--pc-border);
}
.route-header .avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--pc-red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
}
.route-header .name { font-weight: 700; color: var(--pc-navy); font-size: 1.05rem; }
.route-header .meta { color: var(--pc-muted); font-size: .8rem; }
.route-header .stats {
  margin-left: auto;
  display: flex; gap: 1rem;
  text-align: right;
}
.route-header .stats .stat-num { font-weight: 800; color: var(--pc-navy); font-size: 1.15rem; line-height: 1; }
.route-header .stats .stat-lbl { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--pc-muted); font-weight: 700; }

.route-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1rem;
}
@media (max-width: 900px) {
  .route-body { grid-template-columns: 1fr; }
}

.timeline {
  position: relative;
  padding-left: 38px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 17px; top: 14px; bottom: 14px;
  width: 2px;
  background: var(--pc-border);
}
.timeline-stop {
  position: relative;
  padding: .55rem 0 1.25rem;
}
.timeline-stop::before {
  content: '';
  position: absolute;
  left: -27px; top: 12px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--pc-red);
  z-index: 1;
}
.timeline-stop.completed::before { background: #16a34a; border-color: #16a34a; }
.timeline-stop.inprogress::before { background: var(--pc-orange); border-color: var(--pc-orange); }
.timeline-stop.scheduled::before { background: #fff; border-color: var(--pc-red); }
.timeline-stop.paused::before { background: #fff; border-color: #dc2626; }

.timeline-stop .ts-time {
  display: inline-block;
  font-weight: 700;
  color: var(--pc-navy);
  background: #f1f5f9;
  padding: .2rem .55rem;
  border-radius: 5px;
  font-size: .82rem;
  margin-bottom: .3rem;
}
.timeline-stop .ts-name {
  font-weight: 700;
  color: var(--pc-navy);
  font-size: .95rem;
}
.timeline-stop .ts-addr {
  color: var(--pc-muted);
  font-size: .8rem;
  margin-top: .1rem;
}
.timeline-stop .ts-svc {
  color: var(--pc-navy);
  font-size: .82rem;
  margin-top: .35rem;
}
.timeline-stop .ts-actions {
  margin-top: .5rem;
  display: flex; gap: .4rem;
  flex-wrap: wrap;
}

.timeline-leg {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .25rem 0 .5rem 0;
  padding: .35rem .6rem;
  background: #f8fafc;
  border-radius: 5px;
  font-size: .72rem;
  color: var(--pc-muted);
  font-weight: 600;
}

/* Login page */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0a2540 0%, #061629 60%, #1e3a5f 100%); padding: 1rem; }
.login-card { background: #fff; border-radius: 14px; padding: 2.5rem; max-width: 420px; width: 100%; box-shadow: 0 30px 70px -20px rgba(0,0,0,0.6); }
.login-card .brand-logo { width: 240px; height: 194px; margin: 0 auto 1rem; display: block; }
.demo-creds { background: #fef3c7; border: 1px solid #fcd34d; border-radius: 8px; padding: .75rem; margin-top: 1rem; font-size: .78rem; color: #92400e; }
.demo-creds b { display: block; margin-bottom: .25rem; }
.demo-creds code { background: rgba(0,0,0,0.08); padding: 1px 6px; border-radius: 4px; font-family: ui-monospace, monospace; }
