*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active-bg: #1e3a5f;
  --sidebar-active-text: #60a5fa;
  --sidebar-hover-bg: #1e293b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  /* success/warning/text-light darkened from their original shades — the
     originals read at 3.1-3.3:1 contrast on white (fails WCAG AA's 4.5:1
     for normal text) and 2.56:1 for text-light; these pass at 5-7:1 while
     staying the same hue. Backgrounds/buttons using these vars (e.g.
     .btn-success, .dot-yellow) are unaffected in any way that hurts
     legibility — a slightly darker fill behind white button text only
     helps that contrast, never hurts it. */
  --success: #166534;
  --warning: #92400e;
  --danger: #dc2626;
  --info: #0891b2;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #6b7280;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── LAYOUT ── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

#sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: 24px;
}

#main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  /* Reserve the scrollbar's track width always, not just when a page is
     tall enough to need it. Without this, a dense/busy month (needs a
     scrollbar) and a light month (doesn't) get a slightly different
     available content width, so the 7-column calendar grid computed
     for one month doesn't line up with the header row computed at a
     different width — visible as day cells drifting past the app edge
     on smaller screens or at higher zoom, where the scrollbar's ~15px
     is a bigger fraction of the available width. */
  scrollbar-gutter: stable;
  padding: 24px;
}

/* ── SIDEBAR ── */
.sidebar-header {
  padding: 20px 6px 16px;
  border-bottom: 1px solid #1e293b;
  margin-bottom: 8px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon { font-size: 24px; }
.logo-title { color: #f1f5f9; font-weight: 700; font-size: 14px; line-height: 1.2; }
.logo-sub { color: var(--sidebar-text); font-size: 11px; }

/* ── App switcher (jump to the other Liberty apps) ── */
.app-switcher { padding: 10px 10px 12px; border-bottom: 1px solid #1e293b; margin-bottom: 6px; position: relative; }
.switcher-btn {
  width: 100%; display: flex; align-items: center; gap: 9px; background: var(--sidebar-hover-bg);
  border: 1px solid #29344a; color: #e2e8f0; border-radius: 8px; padding: 8px 9px;
  cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; text-align: left;
  transition: background .15s, border-color .15s;
}
.switcher-btn:hover { background: #243044; border-color: #334361; }
.switcher-btn[aria-expanded="true"] { background: #243044; border-color: var(--primary); }
.switcher-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-chevron { color: var(--sidebar-text); flex-shrink: 0; transition: transform .15s; display: flex; }
.switcher-btn[aria-expanded="true"] .switcher-chevron { transform: rotate(180deg); }

.switcher-pop {
  position: absolute; top: calc(100% + 6px); left: 10px; right: 10px; z-index: 20;
  background: #152238; border: 1px solid #2a3752; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); padding: 6px;
  opacity: 0; transform: translateY(-4px) scale(.98); pointer-events: none;
  transition: opacity .13s ease, transform .13s ease;
}
.switcher-pop.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.switcher-pop-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5b6b85; padding: 7px 9px 5px; }
.app-tile { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 7px; color: #e2e8f0; text-decoration: none; cursor: pointer; position: relative; }
.app-tile:hover { background: #1e2c47; }
.app-tile .icon { width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; font-weight: 700; overflow: hidden; background: #1e293b; }
.app-tile .icon img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.switcher-btn .switcher-icon { width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0; overflow: hidden; display: flex; }
.switcher-btn .switcher-icon img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.app-tile .body { flex: 1; min-width: 0; }
.app-tile .name { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.app-tile .role { font-size: 10.5px; color: #8291a8; line-height: 1.3; margin-top: 1px; }
.app-tile .go { color: #5b6b85; flex-shrink: 0; display: flex; }
.app-tile.current { background: #1c2b45; cursor: default; }
.app-tile.current:hover { background: #1c2b45; }
.app-tile.current .check { color: var(--sidebar-active-text); flex-shrink: 0; display: flex; }
.switcher-pop-divider { height: 1px; background: #243149; margin: 5px 4px; }
.switcher-pop-foot { font-size: 10.5px; color: #5b6b85; padding: 7px 9px 5px; display: flex; align-items: center; gap: 5px; }

.nav-section-label {
  padding: 18px 16px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: #8698b8;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  position: relative;
}

.nav-item:hover { background: var(--sidebar-hover-bg); color: #e2e8f0; }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.nav-icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { width: 17px; height: 17px; }

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.nav-badge.danger { background: var(--danger); }

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-title { font-size: 22px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── CARDS ── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 32px; font-weight: 700; margin: 6px 0 2px; line-height: 1; }
.stat-sub { font-size: 12px; color: var(--text-muted); }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.primary .stat-value { color: var(--primary); }

/* ── DASHBOARD SECTIONS ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: 1fr; } }

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.attention-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.attention-item:last-child { border-bottom: none; }

.attention-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.dot-red { background: var(--danger); }
.dot-yellow { background: var(--warning); }
.dot-green { background: #16a34a; }
.dot-blue { background: var(--primary); }

.attention-name { font-weight: 600; font-size: 13px; }
.attention-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }
.activity-name { font-weight: 500; flex: 1; }
.activity-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ── PIPELINE BAR ── */
.pipeline-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.pipeline-bar-label { width: 110px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pipeline-bar-track { flex: 1; background: var(--border); border-radius: 4px; height: 20px; overflow: hidden; }
.pipeline-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s; display: flex; align-items: center; padding-left: 8px; }
.pipeline-bar-count { font-size: 11px; font-weight: 700; color: white; white-space: nowrap; }
.pipeline-bar-value { width: 90px; font-size: 12px; color: var(--text-muted); text-align: right; }

/* ── FILTERS ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar input[type="text"],
.filter-bar select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
}

.filter-bar input[type="text"] { min-width: 200px; }
.filter-bar select { min-width: 140px; }

.filter-bar input:focus, .filter-bar select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ── TABLE ── */
.table-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

thead th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
thead th:hover { color: var(--text); }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
tbody tr.row-overdue { background: #fef2f2 !important; }
tbody tr.row-overdue:hover { background: #fee2e2 !important; }
tbody tr.row-due-soon { background: #fffbeb !important; }
tbody tr.row-due-soon:hover { background: #fef3c7 !important; }

tbody td {
  padding: 10px 14px;
  font-size: 13px;
  vertical-align: middle;
}

.td-project { font-weight: 600; max-width: 220px; }
.td-project small { display: block; font-weight: 400; color: var(--text-muted); font-size: 11px; }
.td-customer { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.td-amount { font-weight: 600; white-space: nowrap; }
.td-date { white-space: nowrap; color: var(--text-muted); }
.td-date.overdue { color: var(--danger); font-weight: 600; }
.td-date.due-soon { color: var(--warning); font-weight: 600; }

.actions { display: flex; gap: 6px; white-space: nowrap; }

/* ── BADGES / PILLS ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-open { background: #dbeafe; color: #1e40af; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-awarded { background: #dcfce7; color: #166534; }
.badge-not-awarded { background: #fee2e2; color: #991b1b; }
.badge-budget { background: #f3e8ff; color: #6b21a8; }
.badge-stage { background: #e2e8f0; color: #475569; font-size: 11px; }
.badge-bid   { background: rgba(59,130,246,.15); color: #3b82f6; border: 1px solid rgba(59,130,246,.3); font-size: 11px; font-weight: 700; }
.badge-co    { background: rgba(251,191,36,.15);  color: #92400e; border: 1px solid rgba(251,191,36,.3); font-size: 11px; font-weight: 700; }

/* ── Award celebration ── */
@keyframes bell-ring {
  0%        { transform: rotate(0deg);    transform-origin: 50% 0%; }
  8%        { transform: rotate(-22deg);  transform-origin: 50% 0%; }
  18%       { transform: rotate(22deg);   transform-origin: 50% 0%; }
  28%       { transform: rotate(-16deg);  transform-origin: 50% 0%; }
  38%       { transform: rotate(16deg);   transform-origin: 50% 0%; }
  48%       { transform: rotate(-10deg);  transform-origin: 50% 0%; }
  58%       { transform: rotate(10deg);   transform-origin: 50% 0%; }
  68%       { transform: rotate(-5deg);   transform-origin: 50% 0%; }
  78%       { transform: rotate(5deg);    transform-origin: 50% 0%; }
  100%      { transform: rotate(0deg);    transform-origin: 50% 0%; }
}
.bell-ringing {
  animation: bell-ring 1.2s ease-in-out;
}

/* ── Jurisdiction badge ── */
.jurisdiction-badge {
  display: inline-block;
  background: #f3e8ff; color: #7c3aed;
  border: 1px solid #ddd6fe;
  border-radius: 4px; font-weight: 700;
  letter-spacing: .03em; white-space: nowrap;
  vertical-align: middle;
}

/* ── Company autocomplete ── */
.company-ac-wrap { position: relative; }
.company-ac-results {
  position: absolute; z-index: 1500; top: calc(100% + 2px); left: 0; right: 0;
  background: var(--card-bg); border: 1px solid var(--primary);
  border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.12);
  max-height: 220px; overflow-y: auto;
}
.company-ac-item {
  padding: 9px 12px; cursor: pointer; font-size: 13px; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.company-ac-item:last-child { border-bottom: none; }
.company-ac-item:hover { background: #f1f5f9; }
.company-ac-item strong { color: var(--primary); }

/* ── Customer contact picker in bid form ── */
.contact-picker-wrap { margin-top: 5px; }
.cp-row { display: flex; gap: 5px; align-items: center; }
.cp-row .cp-select { flex: 1; }
.cp-clear { flex-shrink: 0; }
.cp-selected {
  margin-top: 4px; font-size: 12px; color: #166534; font-weight: 600;
  padding: 3px 8px; background: #dcfce7; border-radius: 4px; display: inline-block;
}

/* ── Projects page ── */
.proj-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .1s;
}
.proj-row:last-child { border-bottom: none; }
.proj-row:hover { background: #f8fafc; }
.proj-row.proj-row-selected { background: #eff6ff !important; }
.proj-row.proj-row-selected:hover { background: #dbeafe !important; }
.proj-name { font-size: 14px; font-weight: 600; color: var(--text); }
.proj-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  margin-top: 5px; font-size: 12px; color: var(--text-muted);
}
.proj-meta-sep { color: var(--border); margin: 0 2px; }
.proj-meta-customers { color: var(--text-muted); }
.proj-tag {
  display: inline-block; border-radius: 4px; padding: 1px 5px; font-size: 11px; font-weight: 600;
}
/* Bid # tags — blue */
.proj-tag-bid { background: #eff6ff; color: #3b82f6; }
/* Job # tags — red */
.proj-tag-job { background: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; }
/* No job # indicator — dashed muted */
.proj-tag-nojob {
  background: transparent; color: #cbd5e1; border: 1px dashed #e2e8f0;
  font-weight: 400; font-style: italic;
}
.proj-tag-muted { background: #f1f5f9; color: var(--text-muted); }

/* Projects filter buttons */
.proj-filter-btns { display: flex; gap: 2px; flex-wrap: nowrap; }
.proj-filter-btn {
  padding: 5px 11px; border-radius: 4px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); font-size: 12px;
  cursor: pointer; font-family: inherit; white-space: nowrap; transition: all .15s;
  line-height: 1.4;
}
.proj-filter-btn:hover { background: #f1f5f9; color: var(--text); border-color: #cbd5e1; }
.proj-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
/* Job # Audit */
.audit-bid-row:hover { background: #f0f9ff !important; }
.audit-proj-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe;
  border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background .12s;
}
.audit-proj-chip:hover { background: #dbeafe; }
.audit-badge {
  display: inline-block; border-radius: 10px;
  padding: 2px 8px; font-size: 11px; font-weight: 600;
}
.audit-badge-ok   { background: #dcfce7; color: #166534; }
.audit-badge-warn { background: #fffbeb; color: #92400e; }
.audit-badge-err  { background: #fef2f2; color: #dc2626; }

/* Sort select */
.proj-sort-select {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; color: var(--text); background: #fff; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.proj-sort-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.proj-active-badge {
  display: inline-block; background: #dcfce7; color: #166534;
  border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 600;
}
.proj-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 5px;
  flex-shrink: 0; padding-top: 1px;
}
.proj-stats {
  display: flex; gap: 8px; font-size: 12px; color: var(--text-muted);
  white-space: nowrap;
}
.proj-bid-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px; margin-bottom: 6px;
  background: #f8fafc; border-radius: 6px; border: 1px solid var(--border);
}
.proj-bid-card:hover { border-color: var(--primary); }

/* ── Bid lifecycle timeline ── */
.lifecycle-phase {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.lifecycle-phase:last-of-type { border-bottom: none; }
.lifecycle-phase-marker {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; margin-top: 1px;
}
.lifecycle-phase-body { flex: 1; min-width: 0; }
.lifecycle-phase-title { font-size: 13px; font-weight: 700; color: var(--text); }
.lifecycle-meta { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.lifecycle-current-marker {
  font-size: 11px; font-weight: 700; color: var(--primary);
  padding: 4px 0; letter-spacing: .05em;
}
.lifecycle-co-row {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 5px; margin-bottom: 3px;
  font-size: 12px; cursor: pointer;
}
.lifecycle-co-row:hover { background: rgba(0,0,0,.04); }

/* ── Job panel: reminder cards ── */
.jp-reminder-card {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; margin-bottom: 6px;
  background: #fffbeb; border: 1px solid #fcd34d; border-radius: 6px;
}

/* ── Job panel: customer contact blocks ── */
.jp-customer-block {
  margin-bottom: 12px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.jp-customer-block:last-child { border-bottom: none; margin-bottom: 0; }
.jp-customer-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.jp-customer-name { font-size: 13px; font-weight: 700; color: var(--text); }
.jp-no-contact { font-size: 12px; color: var(--text-muted); padding: 2px 0; }
.jp-contact-card {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 7px 10px; margin-bottom: 4px;
  background: #f8fafc; border-radius: 6px; border: 1px solid var(--border);
}
.jp-contact-info { flex: 1; min-width: 0; }
.jp-contact-name { font-size: 13px; font-weight: 600; color: #0f172a; }
.jp-contact-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.jp-contact-link { color: var(--text-muted); text-decoration: none; }
.jp-contact-link:hover { text-decoration: underline; }
.jp-ct-results-box {
  max-height: 200px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg);
}
.jp-ct-result {
  padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.jp-ct-result:hover { background: #f1f5f9; }
.jp-ct-create {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; cursor: pointer; color: var(--primary);
  font-size: 13px; font-weight: 600; border-top: 1px solid var(--border);
}
.jp-ct-create:hover { background: rgba(37,99,235,.06); }

/* ── Bid Checklist ── */
.cl-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  cursor: pointer; user-select: none; padding: 2px 0;
}
.cl-header:hover .jp-section-title { color: var(--primary); }
.cl-summary {
  font-size: 12px; font-weight: 600; color: var(--primary);
  margin-left: 8px; font-variant-numeric: tabular-nums;
}
.cl-progress-bar-wrap {
  height: 4px; background: var(--border); border-radius: 2px;
  margin-top: 6px; overflow: hidden; width: 100%;
}
.cl-progress-bar-fill {
  height: 100%; background: var(--primary); border-radius: 2px;
  transition: width .3s ease;
}
.cl-toggle-icon {
  font-size: 11px; color: var(--text-muted); flex-shrink: 0;
  margin-top: 3px; margin-left: 8px;
}
.cl-body { margin-top: 12px; }
.cl-section { margin-bottom: 14px; }
.cl-section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.cl-section-name {
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
}
.cl-section-count {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.cl-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 4px 6px; border-radius: 4px;
  margin-bottom: 1px; position: relative;
}
.cl-item:hover { background: rgba(0,0,0,0.04); }
.cl-checkbox { flex-shrink: 0; margin-top: 2px; cursor: pointer; accent-color: var(--primary); }
.cl-item-label { font-size: 13px; color: var(--text); line-height: 1.4; flex: 1; }
.cl-item-done .cl-item-label { color: var(--text-muted); text-decoration: line-through; }
.cl-item-na .cl-item-label  { color: var(--text-muted); font-style: italic; }

/* N/A button — hidden until hover */
.cl-na-btn {
  display: none; flex-shrink: 0; margin-left: auto;
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border: 1px solid var(--border); border-radius: 3px;
  background: none; color: var(--text-muted); cursor: pointer;
  font-family: inherit; line-height: 1.4;
}
.cl-na-btn:hover { background: #fef3c7; color: #92400e; border-color: #d97706; }
.cl-item:hover .cl-na-btn { display: inline-flex; align-items: center; }

/* N/A tag shown when marked */
.cl-na-tag {
  flex-shrink: 0; margin-left: auto;
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border: 1px solid #d97706; border-radius: 3px;
  background: #fef3c7; color: #92400e;
  cursor: pointer;
}
.cl-na-tag:hover { background: #fde68a; }

/* ── Profile modal ── */
.profile-stats {
  display: flex; gap: 0; flex-wrap: wrap;
  background: #f8fafc;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden;
}
.profile-stat {
  flex: 1; min-width: 110px;
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 10px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.profile-stat:last-child { border-right: none; }
.profile-stat-val {
  font-size: 20px; font-weight: 900; line-height: 1; color: #1e293b;
  word-break: break-word; max-width: 100%;
}
.profile-stat-lbl { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #64748b; margin-top: 4px; }

/* Clickable name/company links */
.profile-link {
  cursor: pointer; color: var(--primary);
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}
.profile-link:hover { border-bottom-color: var(--primary); }
.company-link {
  cursor: pointer; color: var(--primary); font-size: 13px;
  border-bottom: 1px dashed rgba(59,130,246,.4);
}
.company-link:hover { border-bottom-style: solid; }

/* ── Contacts page ── */
.ct-company-name {
  cursor: pointer; color: var(--text);
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.ct-company-name:hover { color: var(--primary); border-bottom-color: var(--primary); }
.ct-assign-btn {
  font-size: 12px; color: var(--text-muted); background: none; border: 1px dashed var(--border);
  border-radius: 4px; padding: 2px 8px; cursor: pointer; font-family: inherit;
}
.ct-assign-btn:hover { color: var(--primary); border-color: var(--primary); }
.btn-inline-link {
  background: none; border: none; color: var(--primary); cursor: pointer;
  font-size: inherit; font-family: inherit; padding: 0; text-decoration: underline;
}

.initials-pill {
  display: inline-block;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1e40af;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 26px;
}
/* Estimators and salespeople can share initials (e.g. two people both "DD") —
   role color is what actually tells them apart, not the letters. */
.initials-pill-sales {
  background: #dcfce7;
  color: #166534;
}
/* Clickable estimator pill */
.est-pill-clickable { cursor: pointer; }
.est-pill-clickable:hover { opacity: 0.75; outline: 2px solid var(--primary); outline-offset: 1px; }

/* Sub-estimator pill — same shape, lighter fill to distinguish from main */
.initials-pill-sub {
  background: #e0e7ff; color: #3730a3;
  opacity: 0.8;
  border: 1px dashed #a5b4fc;
}

/* Sub-estimator row in bid form */
.sub-est-row {
  display: flex; gap: 6px; align-items: center;
}
.sub-est-row select { flex: 0 0 180px; }
.sub-est-row .sub-est-scope { flex: 1; }

/* ── PROGRESS BAR ── */
.progress-bar {
  background: var(--border);
  border-radius: 4px;
  height: 6px;
  width: 80px;
  display: inline-block;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
}
.progress-fill.complete { background: var(--success); }

/* ── BUTTONS ── */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 5px 8px; }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 5px 8px; font-size: 14px; }

/* ── MODALS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: var(--card-bg);
  color: var(--text);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  border: 1px solid var(--border);
}

/* ── Shared form controls (used in modals) ── */
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-label {
  display: block;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
}
.form-input {
  display: block; width: 100%;
  padding: 8px 10px;
  background: var(--card-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-input::placeholder { color: var(--text-muted); opacity: .7; }
textarea.form-input { resize: vertical; min-height: 60px; }
.modal-large { max-width: 760px; }
.modal-small { max-width: 420px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 18px; font-weight: 700; }

.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--text-muted); padding: 4px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── FORMS ── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.03em; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: white;
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-group textarea { resize: vertical; }
.form-group .optional { font-weight: 400; color: var(--text-light); font-size: 11px; }
.field-hint { color: var(--text-muted); font-size: 11px; margin-top: 4px; display: block; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }

.form-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 16px 0 8px;
  border-top: 2px solid var(--border);
  margin-top: 8px;
}
.form-section-title:first-child { border-top: none; padding-top: 0; }

.extra-customers summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
  padding: 4px 0;
}

/* ── FOLLOW-UPS PAGE ── */
.followup-group { margin-bottom: 24px; }
.followup-group-title {
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.followup-group-title.overdue { background: #fee2e2; color: #991b1b; }
.followup-group-title.today { background: #fef3c7; color: #92400e; }
.followup-group-title.this-week { background: #dbeafe; color: #1e40af; }
.followup-group-title.upcoming { background: #f1f5f9; color: var(--text-muted); }

.followup-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.followup-card.overdue { border-left: 4px solid var(--danger); }
.followup-card.today { border-left: 4px solid var(--warning); }
.followup-card.this-week { border-left: 4px solid var(--primary); }

.fc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fc-project { font-size: 14px; font-weight: 700; }
.fc-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.fc-actions { display: flex; gap: 6px; flex-shrink: 0; margin-top: 2px; }
.fc-last-contact {
  margin-top: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.fc-last-contact strong { color: var(--text); }

/* ── FOLLOW-UP HISTORY IN MODAL ── */
.followup-history-section { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.followup-history-title { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.history-entry {
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
}
.history-entry-date { font-weight: 600; color: var(--text-muted); font-size: 11px; margin-bottom: 4px; }
.history-entry-notes { color: var(--text); }
.history-entry-response { color: var(--text-muted); margin-top: 4px; font-style: italic; }

.followup-project-name {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── DIGEST ── */
.digest-header { text-align: center; padding: 20px 0; }
.digest-date { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.digest-section { margin-bottom: 28px; }
.digest-section-title {
  font-size: 16px; font-weight: 700;
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.digest-empty { color: var(--text-muted); font-size: 13px; font-style: italic; padding: 8px 0; }

.digest-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.digest-table th { text-align: left; padding: 6px 10px; background: #f8fafc; border: 1px solid var(--border); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.digest-table td { padding: 8px 10px; border: 1px solid var(--border); }
.digest-table tr:nth-child(even) td { background: #fafafa; }

.person-card { display: inline-block; background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin: 0 8px 8px 0; min-width: 140px; }
.person-name { font-weight: 700; font-size: 14px; }
.person-stats { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.person-alert { color: var(--danger); font-weight: 600; }

/* ── HISTORY ── */
.history-filters { margin-bottom: 16px; }

/* ── SETTINGS ── */
.team-table { width: 100%; }
.team-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.team-row:last-child { border-bottom: none; }
.team-initials-circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: white;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.team-name { font-weight: 600; font-size: 14px; }
.team-role { font-size: 12px; color: var(--text-muted); }
.team-inactive { opacity: 0.5; }

/* ── UTILITIES ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.empty-state-desc { font-size: 13px; }

.loading-screen {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; min-height: 300px; gap: 12px;
  color: var(--text-muted);
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.fw-bold { font-weight: 700; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

.no-data { text-align: center; padding: 32px; color: var(--text-muted); font-style: italic; }

@media print {
  #sidebar { display: none; }
  #main { padding: 0; }
  .btn, .filter-bar { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ── LOGIN OVERLAY ── */
#login-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}

.login-card {
  background: none; border-radius: 0;
  padding: 0; width: 100%; max-width: 400px;
  box-shadow: none;
  text-align: center;
}

.login-logo { font-size: 48px; margin-bottom: 10px; }
.login-title { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.login-subtitle { font-size: 14px; color: #94a3b8; margin-bottom: 24px; }

.login-section-label {
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em;
  color: var(--text-muted); text-transform: uppercase;
  text-align: left; margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}

.login-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px; margin-bottom: 4px;
}

.login-member-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 7px; padding: 14px 8px; border-radius: 10px;
  border: 2px solid var(--border); background: #f8fafc;
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.login-member-btn:hover { border-color: var(--primary); background: #eff6ff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.login-member-btn.selected { border-color: var(--primary); background: #dbeafe; }

.login-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: white;
}
.login-member-name { font-size: 11px; font-weight: 600; color: var(--text); line-height: 1.2; }

.login-selected-name {
  font-size: 16px; font-weight: 700; color: var(--text);
  margin: 20px 0 16px; padding-top: 20px;
  border-top: 1px solid var(--border);
}

.pin-entry label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.pin-inputs { display: flex; gap: 10px; justify-content: center; margin-bottom: 4px; }
.pin-digit {
  width: 52px; height: 56px; text-align: center; font-size: 24px; font-weight: 700;
  border: 2px solid var(--border); border-radius: 8px; background: #f8fafc;
  font-family: inherit; transition: border-color 0.15s; color: var(--text);
}
.pin-digit:focus { outline: none; border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.login-error { color: var(--danger); font-size: 13px; font-weight: 600; margin-top: 8px; }

/* ── SIDEBAR USER PROFILE ── */
.sidebar-user {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 10px 12px; background: #1e293b;
  border-radius: 8px; cursor: default;
}
.sidebar-user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary);
  color: white; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-user-name { font-size: 12px; font-weight: 700; color: #f1f5f9; }
.sidebar-user-role { font-size: 10px; color: #64748b; text-transform: capitalize; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-logout {
  background: none; border: none; cursor: pointer; color: #475569;
  font-size: 16px; padding: 2px 4px; border-radius: 4px; flex-shrink: 0;
}
.sidebar-logout:hover { color: #94a3b8; background: #334155; }

/* ── SIDEBAR FOOTER (online + ideas) ── */
.sidebar-footer {
  margin-top: auto; padding: 10px 10px 4px;
  border-top: 1px solid #1e293b; display: flex; gap: 6px;
}
.sb-footer-btn {
  flex: 1; background: #1e293b; border: none; border-radius: 6px;
  color: #94a3b8; font-size: 11px; font-weight: 600;
  padding: 7px 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: background .15s, color .15s;
}
.sb-footer-btn:hover { background: #334155; color: #f1f5f9; }
.online-pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(34,197,94,.4);
  animation: online-pulse 2s infinite;
}
@keyframes online-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
  70%  { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
/* Ideas status badges */
.idea-status-new      { background:#eff6ff; color:#1d4ed8; }
.idea-status-reviewed { background:#fef3c7; color:#92400e; }
.idea-status-done     { background:#dcfce7; color:#166534; }
.idea-status-wontfix  { background:#f1f5f9; color:#64748b; }

/* ── MY WORK SECTION (personal dashboard) ── */
.my-work-banner {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 20px;
  color: white;
}
.my-work-greeting { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.my-work-sub { font-size: 13px; opacity: 0.8; margin-bottom: 14px; }
.my-work-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.my-work-stat { text-align: center; }
.my-work-stat-value { font-size: 26px; font-weight: 800; line-height: 1; }
.my-work-stat-label { font-size: 11px; opacity: 0.75; margin-top: 2px; }
.my-work-stat.alert .my-work-stat-value { color: #fca5a5; }

/* ── MINE TOGGLE ── */
.mine-toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card-bg);
  cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--text-muted); font-family: inherit; transition: all 0.15s;
  white-space: nowrap;
}
.mine-toggle:hover { border-color: var(--primary); color: var(--primary); }
.mine-toggle.active { background: #dbeafe; border-color: var(--primary); color: var(--primary); }
.mine-toggle .toggle-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}

/* ── DASHBOARD VIEW TOGGLE ── */
.stat-card-link {
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.stat-card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* ── DASHBOARD VIEW TOGGLE ── */
.dash-view-toggle {
  display: flex; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.dash-view-btn {
  padding: 7px 14px; font-size: 13px; font-weight: 600;
  border: none; background: var(--card-bg); color: var(--text-muted);
  cursor: pointer; font-family: inherit; transition: all 0.15s;
  white-space: nowrap;
}
.dash-view-btn:hover { background: #f1f5f9; color: var(--text); }
.dash-view-btn.active { background: var(--primary); color: white; }

/* ── DASHBOARD GREETING BAR ── */
.dash-greeting-bar {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
  border-radius: var(--radius); padding: 14px 20px; margin-bottom: 20px; color: white;
}
.dash-greeting-text { font-size: 16px; font-weight: 700; margin-right: 12px; }
.dash-greeting-sub { font-size: 13px; opacity: 0.85; }

/* ── QUICK LOG FAB ── */
.quick-log-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 800;
  display: flex; align-items: center; gap: 8px;
  background: var(--primary); color: white;
  border: none; border-radius: 28px;
  padding: 13px 22px; font-size: 15px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 4px 16px rgba(37,99,235,0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}
.quick-log-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,99,235,0.5);
}
.quick-log-fab:active { transform: translateY(0); }

/* ── QUICK LOG MODAL ── */
.modal-medium { width: 540px; }

.ql-results {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-top: 4px;
  max-height: 280px; overflow-y: auto;
}
.ql-result-item {
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.ql-result-item:last-child { border-bottom: none; }
.ql-result-item:hover { background: #f0f7ff; }
.ql-result-name { font-weight: 600; font-size: 13px; color: var(--text); }
.ql-result-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ql-no-results { padding: 14px; text-align: center; color: var(--text-muted); font-size: 13px; }
.ql-searching  { padding: 14px; text-align: center; color: var(--text-muted); font-size: 13px; font-style: italic; }

.ql-selected-bid {
  background: #f0f7ff; border: 1px solid #bfdbfe;
  border-radius: var(--radius); padding: 10px 14px;
}
.ql-selected-name { font-weight: 700; font-size: 14px; color: var(--text); }
.ql-selected-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ── JOB DETAIL PANEL ── */
.job-panel-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 900;
}
.job-panel {
  position: fixed; top: 0; right: 0;
  width: 500px; max-width: 100vw; height: 100vh;
  background: white; z-index: 950;
  display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.job-panel.open { transform: translateX(0); }
.job-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 12px;
  flex-shrink: 0;
}
.job-panel-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.job-panel-body {
  flex: 1; overflow-y: auto; padding: 16px 20px;
}
.job-panel-footer {
  display: flex; gap: 8px; padding: 12px 20px;
  border-top: 1px solid var(--border); background: #f8fafc;
  flex-shrink: 0;
}
.jp-section {
  margin-bottom: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.jp-section:last-child { border-bottom: none; }
.jp-section-title {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text); margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 2px solid var(--primary);
  display: inline-block;
}
.jp-field {
  display: flex; gap: 8px; margin-bottom: 6px; font-size: 13px; align-items: flex-start;
}
.jp-label { color: var(--text-muted); min-width: 120px; flex-shrink: 0; }
.jp-value { color: var(--text); font-weight: 500; }
.jp-notes-box {
  background: #f8fafc; border-radius: 6px; padding: 10px 12px;
  font-size: 13px; color: var(--text); line-height: 1.6; white-space: pre-wrap;
}
.jp-history-entry {
  background: #f8fafc; border-radius: 6px; padding: 10px 12px;
  margin-bottom: 8px; font-size: 13px;
}
.jp-history-date {
  color: var(--text-muted); font-size: 12px; margin-bottom: 4px;
}
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #f0f7ff !important; }

/* ── FOLLOW-UP DATE CELLS ── */
.fu-date-overdue { font-weight: 600; font-size: 13px; color: var(--danger); }
.fu-date-today   { font-weight: 600; font-size: 13px; color: var(--warning); }
.fu-date-week    { font-weight: 500; font-size: 13px; }
.fu-date-sub     { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.fu-sub-overdue  { color: var(--danger); }
.fu-sub-today    { color: var(--warning); }
.fu-sub-week     { color: var(--primary); }
.fu-no-date      { font-size: 12px; color: var(--text-light); font-style: italic; }

/* ── EMAIL/PASSWORD AUTH ── */
.login-form-group { margin-bottom: 12px; }
.login-input { width: 100%; padding: 11px 14px; background: #0f1117; border: 1px solid #2d3148; border-radius: 8px; color: #f1f5f9; font-size: 0.95rem; outline: none; font-family: inherit; transition: border-color 0.2s; }
.login-input:focus { border-color: #6366f1; }
.login-submit-btn { width: 100%; padding: 12px; background: #6366f1; color: #fff; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; margin-top: 4px; font-family: inherit; transition: background 0.2s; }
.login-submit-btn:hover { background: #4f46e5; }
.login-error { color: #f87171; font-size: 0.85rem; margin-bottom: 12px; padding: 8px 12px; background: rgba(248,113,113,0.1); border-radius: 6px; }
#pw-requirements div { padding: 2px 0; transition: color 0.2s; }

/* ── "Sign in with Microsoft" (brand button per Microsoft's guidelines) ── */
.ms-signin-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 11px 14px; background: #fff; color: #5e5e5e;
  border: 1px solid #8c8c8c; border-radius: 4px; font-family: 'Segoe UI', inherit;
  font-size: 0.95rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background 0.15s;
}
.ms-signin-btn:hover { background: #f3f3f3; }
.ms-signin-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: #64748b; font-size: 0.8rem; }
.ms-signin-divider::before, .ms-signin-divider::after { content: ''; flex: 1; height: 1px; background: #2d3148; }

/* ── GLOBAL SIDEBAR SEARCH ── */
.sidebar-search-wrap {
  padding: 0 12px 10px;
}
.sidebar-search-inner {
  position: relative;
  display: flex;
  align-items: center;
}
.sidebar-search-icon {
  position: absolute;
  left: 8px;
  display: flex;
  pointer-events: none;
  opacity: 0.45;
}
.sidebar-search-icon svg {
  width: 13px;
  height: 13px;
  z-index: 1;
}
.sidebar-search-input {
  width: 100%;
  padding: 7px 26px 7px 30px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 12px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.sidebar-search-input::placeholder { color: #475569; }
.sidebar-search-input:focus {
  border-color: #3b82f6;
  color: #f1f5f9;
  background: rgba(37,99,235,0.12);
}
.sidebar-search-clear {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  font-size: 12px;
  padding: 3px 5px;
  line-height: 1;
  border-radius: 3px;
  z-index: 1;
}
.sidebar-search-clear:hover { color: #94a3b8; background: #334155; }

/* ── DATA CLEANUP ── */
.cleanup-chip {
  padding: 5px 11px;
  border-radius: 16px;
  border: 1px solid;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}
.cleanup-chip:hover { opacity: 0.8; }
.cleanup-chip .chip-count {
  background: rgba(0,0,0,0.12);
  border-radius: 8px;
  padding: 0 6px;
  margin-left: 5px;
  font-size: 11px;
  font-weight: 700;
}
.cleanup-chip.active .chip-count { background: rgba(255,255,255,0.25); }
.issue-tag {
  display: inline-block;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  margin: 1px 2px 1px 0;
  border: 1px solid;
}
/* ── Calendar ────────────────────────────────────────────────────────────── */
.cal-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-month-label { font-size: 16px; font-weight: 700; color: var(--text); flex: 1; text-align: center; }
.cal-filter-select {
  padding: 5px 8px; font-size: 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--card-bg);
  color: var(--text); font-family: inherit; cursor: pointer; margin-left: auto;
}
.cal-hdr { display: grid; grid-template-columns: repeat(5,1fr); margin-bottom: 3px; }
.cal-hdr-cell { text-align:center; font-size:12px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; padding:8px 0; min-width: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 3px; }
.cal-day-empty { min-height: 80px; min-width: 0; border-radius: 6px; background: var(--sidebar-hover-bg); opacity: 0.25; }
.cal-day {
  min-height: 80px; min-width: 0; padding: 5px; border-radius: 6px;
  background: var(--card-bg); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px; transition: border-color 0.15s;
}
.cal-day:hover { border-color: var(--primary); }
.cal-day-today { border-color: var(--primary); background: rgba(37,99,235,0.04); }
.cal-day-holiday { background: var(--sidebar-hover-bg); opacity: 0.6; }
.cal-day-holiday .cal-day-num { color: var(--text-muted); }
.cal-day-holiday-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-day-num { font-size: 12px; font-weight: 600; color: var(--text-muted); line-height: 1.2; }
.cal-day-num-today {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 700;
}
.cal-day-chips { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cal-day-clickable { cursor: pointer; }
.cal-chip {
  display: flex; align-items: center; gap: 3px; padding: 2px 5px;
  background: rgba(30,58,95,0.6); border-radius: 3px;
  border-left: 3px solid #64748b; min-width: 0;
}
.cal-chip-fu { border-left-color: #475569; background: #1e293b; opacity: 0.85; }
.cal-chip-done { opacity: 0.6; }
.cal-chip-done .cal-chip-txt { text-decoration: line-through; }
.cal-chip-txt { font-size: 10px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.cal-chip-ini { font-size: 9px; font-weight: 800; white-space: nowrap; flex-shrink: 0; }
.cal-modal-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s;
}
.cal-modal-row:last-child { border-bottom: none; }
.cal-modal-row:hover { background: var(--sidebar-hover-bg); }
.cal-modal-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cal-modal-info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.cal-modal-name { font-size: 14px; font-weight: 600; color: var(--text); }
.cal-modal-meta { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.cal-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); }
.cal-legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* ── Fix-mode field highlighting ─────────────────────────────────────────── */
.field-needs-fix {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.30) !important;
  background-color: rgba(245, 158, 11, 0.07) !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-needs-fix:focus {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.50) !important;
}

#pw-requirements div.met { color: #4ade80; }
