/* Barkleys Roofing CRM — mobile-first styles */
:root {
  --navy: #1c3a5e;      /* AccuLynx-like dark navy header */
  --navy-2: #24476f;
  --nav: #3b7ac6;       /* blue icon navigation bar */
  --nav-dark: #2f67ad;
  --primary: #3b7ac6;   /* links, secondary buttons, active states */
  --primary-dark: #2f67ad;
  --accent: #f68b1f;    /* orange primary actions */
  --accent-dark: #e07a10;
  --green: #78b833;
  --bg: #e9eaed;        /* light-gray page background */
  --card: #ffffff;
  --card-head: #f4f5f7;
  --text: #333a44;
  --muted: #6b7280;
  --line: #e1e4e8;
  --danger: #dc2626;
  --ok: #16a34a;
  --radius: 3px;
  --shadow: 0 1px 2px rgba(20, 30, 45, .08);
  --tap: 48px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
a { color: var(--primary); }
h1 { font-size: 1.5rem; margin: 0; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.inline { display: inline; }

/* ---------- Layout ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 16px; }
.container-wide { max-width: 1600px; margin: 0 auto; padding: 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; flex-wrap: wrap; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
/* AccuLynx-style panel: gray title band, optional blue top rule */
.card.ax-card { padding: 0; overflow: hidden; }
.ax-card > .card-head, .ax-card > h2 { background: var(--card-head); border-bottom: 1px solid var(--line); padding: 10px 14px; margin: 0; min-height: 48px; }
.ax-card > .card-head h2, .ax-card > h2 { font-size: 1.2rem; font-weight: 400; color: #3b4452; }
.ax-card > .card-body { padding: 14px; }
.ax-card.blue-top { border-top: 2px solid var(--primary); }
.card > h2 { font-weight: 500; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.narrow-left { max-width: 720px; }
.back { display: inline-block; margin: 0 0 10px; text-decoration: none; font-weight: 600; padding: 6px 0; }

/* ---------- App shell (AccuLynx-style): navy top header + blue icon nav bar ---------- */
.ax-top { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 12px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 35; }
.hamburger { background: none; border: 0; width: 44px; height: 44px; display: grid; place-items: center; color: inherit; cursor: pointer; margin-left: -6px; }
.hamburger .ico { width: 26px; height: 26px; fill: currentColor; }
.ax-brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: 1.5px; font-size: 1rem; white-space: nowrap; }
.ax-brand b { color: var(--accent); font-weight: 800; }
.ax-brand img { border-radius: 5px; }
.ax-company { display: none; color: #d6e0ec; font-size: .85rem; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.25); }
.ax-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ax-user { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: .88rem; font-weight: 600; }
.ax-user span { display: none; }
.ax-user .ico { width: 22px; height: 22px; fill: #fff; }
.ax-quick-add { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff; }
.ax-quick-add .ico { width: 22px; height: 22px; fill: currentColor; }

/* Phones: the blue nav becomes a slide-in drawer */
.ax-nav { position: fixed; top: 0; bottom: 0; left: 0; width: 286px; max-width: 86vw; background: var(--nav); z-index: 50; transform: translateX(-100%); transition: transform .2s ease; overflow-y: auto; display: flex; flex-direction: column; padding-bottom: 20px; }
body.nav-open .ax-nav { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
.nav-scrim { display: none; }
body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 45; }
.ax-nav-mobilehead { background: var(--navy); color: #fff; padding: 16px; display: flex; flex-direction: column; }
.ax-nav-mobilehead span { color: #b8c7da; font-size: .85rem; }
.ax-item { position: relative; }
.ax-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: none; border: 0; color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: left; min-height: 48px; }
.ax-btn .ico { width: 22px; height: 22px; fill: currentColor; flex: none; }
.ax-item.active > .ax-btn { background: rgba(255,255,255,.18); }
.ax-orange > .ax-btn { background: var(--accent); }
.ax-orange + .ax-orange > .ax-btn { border-top: 1px solid rgba(255,255,255,.25); }
.ax-menu { display: none; background: #fff; padding: 6px 0; }
.ax-item.open > .ax-menu { display: block; }
.ax-menu a { display: block; padding: 10px 18px 10px 50px; color: var(--primary); text-decoration: none; font-size: .95rem; white-space: nowrap; }
.ax-menu a:hover { background: #eef4fb; }
.ax-menu a.soon { color: #9aa3ae; cursor: default; }
.ax-menu a.soon:hover { background: none; }
.ax-menu em { font-style: normal; font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; background: #eef0f3; color: #7b8491; border-radius: 3px; padding: 1px 5px; margin-left: 4px; }
.ax-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.ax-search { display: flex; margin: 10px 12px; background: #f1f2f4; }
.ax-search input[type=search] { border: 0; border-radius: 0; background: transparent; min-height: 44px; }
.ax-search button { border: 0; background: none; width: 46px; display: grid; place-items: center; cursor: pointer; }
.ax-search .ico { width: 20px; height: 20px; fill: var(--primary); }
.ax-help { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: #fff; text-decoration: none; font-weight: 600; background: var(--accent); margin: 0 12px; border-radius: 3px; }
.ax-help .ico { width: 22px; height: 22px; fill: currentColor; }
.ax-logout button { margin: 14px 16px 0; background: none; border: 1px solid rgba(255,255,255,.5); color: #fff; font: inherit; padding: 8px 14px; border-radius: 3px; cursor: pointer; }

.page-sub { margin: 4px 0 0; }
.page-title { font-size: 1.75rem; font-weight: 300; color: #333; margin: 0; letter-spacing: -.2px; }
.page-band { background: #fff; margin: -16px -16px 16px; padding: 16px 16px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.filter-band { background: #d9dadd; margin: -16px -16px 16px; padding: 10px 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-band label { font-size: .72rem; color: var(--muted); display: flex; flex-direction: column; background: #fff; padding: 4px 8px 0; min-width: 150px; }
.filter-band label select, .filter-band label input { border: 0; min-height: 34px; padding: 2px 0 6px; font-size: 15px; }
.filter-band label select:focus { outline: none; }

.sample-banner { background: #fef3c7; color: #78350f; border-bottom: 1px solid #fcd34d; padding: 8px 16px; font-size: .9rem; text-align: center; }
.sample-banner a { color: #78350f; font-weight: 700; margin-left: 6px; }
.tag-sample { display: inline-block; background: #fde68a; color: #78350f; border: 1px solid #f59e0b; font-size: .66rem; font-weight: 800; letter-spacing: .5px; padding: 1px 6px; border-radius: 4px; vertical-align: middle; }
.flash { max-width: 980px; margin: 12px auto 0; background: #dcfce7; color: #14532d; border: 1px solid #86efac; padding: 12px 16px; border-radius: 3px; font-weight: 600; }
@media (max-width: 1312px) { .flash { margin: 12px 16px 0; } }
@media (max-width: 480px) { .sample-banner { font-size: .8rem; padding: 6px 12px; } .brand-name { font-size: 1.05rem; } }
.alert { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; padding: 12px 14px; border-radius: 3px; margin-bottom: 14px; font-weight: 600; }

/* ---------- Bottom nav (phones) ---------- */
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(0,0,0,.06); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 62px; color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 600; }
.bottomnav .ico { width: 24px; height: 24px; fill: currentColor; }
.bottomnav a.active { color: var(--primary); }
.bottomnav a.bn-new .ico { background: var(--accent); color: var(--navy); border-radius: 50%; padding: 4px; width: 32px; height: 32px; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 18px; border-radius: 3px; border: 1px solid #cfd6df; background: #fff; color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f8fafc; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-blue { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-blue:hover { background: var(--primary-dark); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: #69a52b; }
.btn-outline-blue { border-color: var(--primary); color: var(--primary); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-ghost { color: var(--danger); border-color: #fecaca; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: .9rem; }
.btn-lg { min-height: 54px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .8rem; padding: 0 4px; }

input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid #cfd6df; border-radius: 3px; background: #fff; font: inherit; font-size: 16px; color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(59, 122, 198, .25); border-color: var(--primary); }
.form label, .job-form label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 14px; }
.form label input, .form label select, .form label textarea { margin-top: 6px; font-weight: 400; }
.req { color: var(--danger); }
.row2, .row3 { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
.row3 { grid-template-columns: 2fr 1fr 1.3fr; }
@media (min-width: 640px) { .row2 { grid-template-columns: 1fr 1fr; } }
.pills { border: 0; padding: 0; margin: 0 0 14px; }
.pills legend { font-weight: 600; font-size: .92rem; margin-bottom: 8px; padding: 0; }
.pill { display: inline-block !important; margin: 0 6px 8px 0 !important; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid #cfd6df; border-radius: 3px; background: #fff; font-weight: 600; cursor: pointer; }
.pill input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill span { border-radius: 3px; }
.pill input:focus-visible + span { outline: 3px solid rgba(245,158,11,.5); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.sticky-actions { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); background: rgba(243,245,248,.95); padding: 10px 0; backdrop-filter: blur(4px); }
.sticky-actions .btn-primary { flex: 1; max-width: 320px; }

/* ---------- Login ---------- */
.login-body { background: linear-gradient(160deg, #0f2a44 0%, #1d3f63 55%, #274f7a 100%); padding-bottom: 0; min-height: 100vh; }
.login-main { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 28px 24px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login-brand img { border-radius: 12px; }
.login-title { font-size: 1.45rem; font-weight: 800; color: var(--navy); }
.login-sub { color: var(--muted); font-size: .9rem; }

/* ---------- Pipeline filters ---------- */
.filters { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 14px; }
.filters .btn, .board-hint { display: none; }
@media (min-width: 640px) {
  .filters { grid-template-columns: minmax(200px, 420px) 240px auto auto; justify-content: start; }
  .filters .btn { display: inline-flex; }
  .filters { grid-template-columns: minmax(200px, 420px) 240px auto auto 1fr; }
}
.view-toggle { display: inline-flex; background: #e5e9ef; border-radius: 3px; padding: 3px; }
.view-toggle button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 40px; }
.view-toggle button.active { background: #fff; color: var(--navy); box-shadow: var(--shadow); }

/* Which view shows: phones = list, desktop = board. The toggle overrides. */
.board { display: none; }
.plist { display: block; }
@media (min-width: 900px) { .board { display: flex; } .plist { display: none; } .board-hint { display: block; align-self: center; text-align: right; } }
body.view-list .board-hint { display: none; }
.plist.plist-always { display: block !important; }
body.view-board .board { display: flex; } body.view-board .plist { display: none; }
body.view-list .board { display: none; } body.view-list .plist { display: block; }

/* ---------- Kanban board ---------- */
.board { gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; scroll-snap-type: x proximity; }
.col { flex: 0 0 236px; background: #e9edf2; border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 220px); scroll-snap-align: start; border-top: 4px solid var(--stage); }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 2px; }
.col-title { font-weight: 700; font-size: .92rem; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--stage, var(--navy)); color: #fff; font-size: .78rem; font-weight: 700; }
.col-sum { padding: 0 12px 6px; font-size: .78rem; color: var(--muted); min-height: 18px; }
.col-body { padding: 4px 8px 10px; overflow-y: auto; min-height: 90px; flex: 1; border-radius: 0 0 var(--radius) var(--radius); transition: background .15s; }
.col-body.drag-over { background: rgba(245, 158, 11, .18); outline: 2px dashed var(--accent); outline-offset: -4px; }
.jcard { display: block; background: #fff; border-radius: 3px; padding: 10px 12px; margin-bottom: 8px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); border-left: 3px solid var(--stage, transparent); cursor: grab; }
.jcard:hover { box-shadow: 0 2px 4px rgba(15,42,68,.1), 0 6px 16px rgba(15,42,68,.1); }
.jcard.dragging { opacity: .45; }
.jcard-top { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.jcard-name { font-weight: 700; font-size: .95rem; }
.jcard-addr { font-size: .82rem; color: var(--muted); margin: 2px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jcard-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .78rem; }
.jcard-value { font-weight: 700; color: var(--navy); }
.jcard-when { margin-left: auto; color: var(--muted); }
.pm-chip { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-size: .7rem; font-weight: 700; flex: none; vertical-align: middle; }
.pm-none { background: #cbd5e1; color: #334155; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #e5e7eb; color: #374151; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-insurance { background: #ede9fe; color: #5b21b6; }
.badge-retail { background: #e0f2fe; color: #075985; }

/* ---------- Phone list ---------- */
.stage-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.stage-chips::-webkit-scrollbar { display: none; }
.stage-chips a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; background: #fff; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: .85rem; font-weight: 600; }
.stage-chips a::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--stage); }
.stage-chips a b { background: var(--stage); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .75rem; }
.stage-chips a.is-zero { opacity: .55; }
.lgroup { margin-bottom: 14px; scroll-margin-top: 76px; }
.lgroup.is-empty { display: none; }
.lgroup-head { display: flex; align-items: center; gap: 8px; font-size: .95rem; margin: 0 0 8px; padding-left: 10px; border-left: 4px solid var(--stage); }
.litem { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 8px; display: grid; grid-template-columns: 1fr; overflow: hidden; }
.litem-main { display: flex; flex-direction: column; padding: 12px 14px 6px; text-decoration: none; color: var(--text); }
.litem-name { font-weight: 700; font-size: 1.02rem; }
.litem-addr { color: var(--muted); font-size: .9rem; }
.litem-meta { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.litem-stage { padding: 4px 14px 12px; }
.litem-stage select { min-height: 44px; background-color: #f8fafc; font-weight: 600; }
@media (min-width: 640px) { .litem { grid-template-columns: 1fr 240px; align-items: center; } .litem-main { padding-bottom: 12px; } .litem-stage { padding: 12px 14px; } }
.empty { background: #fff; border-radius: var(--radius); padding: 24px; text-align: center; color: var(--muted); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 3px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .2s; z-index: 60; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* ---------- Job page ---------- */
.job-head { border-top: 5px solid var(--stage); display: grid; gap: 14px; }
.job-head h1 { font-size: 1.45rem; }
.job-addr { display: inline-block; margin-top: 6px; text-decoration: none; font-weight: 600; }
.job-sub { margin-top: 4px; }
.stage-form label { font-weight: 700; font-size: .85rem; color: var(--muted); display: block; }
.stage-select-lg { margin-top: 4px; font-weight: 700; font-size: 1.05rem; border: 2px solid var(--stage); }
.quick-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.qa { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; border-radius: 3px; background: #f1f5f9; text-decoration: none; color: var(--navy); font-size: 1.2rem; }
.qa span { font-size: .78rem; font-weight: 700; }
.qa:hover { background: #e2e8f0; }
.dl { display: grid; grid-template-columns: 1fr; gap: 10px 20px; margin: 0; }
@media (min-width: 560px) { .dl { grid-template-columns: 1fr 1fr; } }
.dl div { border-bottom: 1px solid #f1f5f9; padding-bottom: 8px; }
.dl dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.dl dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }
.subhead { margin: 18px 0 10px; font-size: .95rem; color: var(--navy); }
.dates { margin: 14px 0 0; }

/* Notes timeline */
.note-form { display: grid; gap: 8px; margin-bottom: 14px; }
.note-form .btn { justify-self: end; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.tl-note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 3px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }
.tl-event { font-size: .88rem; color: #374151; display: flex; align-items: flex-start; gap: 8px; }
.tl-type-stage .tl-event { font-weight: 700; color: var(--navy); }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; margin-top: 7px; flex: none; }
.tl-type-stage .tl-dot { background: var(--accent); }
.tl-meta { font-size: .76rem; color: var(--muted); margin-top: 4px; padding-left: 2px; }
.tl-event + .tl-meta { padding-left: 16px; }

/* Uploads */
.upload-form { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 3px; padding: 12px; margin-bottom: 14px; display: grid; gap: 10px; }
.upload-row { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .upload-row { grid-template-columns: 200px 1fr auto; } #documents .upload-row { grid-template-columns: 1fr auto auto; } }
.file-btn { position: relative; display: flex; align-items: center; justify-content: center; min-height: 56px; border-radius: 3px; background: #fff; border: 2px solid var(--navy); color: var(--navy); font-weight: 700; cursor: pointer; text-align: center; padding: 0 12px; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-btn.has-files { background: #ecfdf5; border-color: var(--ok); color: #065f46; }
.file-btn-inline { min-height: var(--tap); border-width: 1px; }
.photo-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.photo-filters button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; min-height: 38px; }
.photo-filters button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
@media (max-width: 420px) { .gallery { grid-template-columns: 1fr 1fr; } }
.thumb { margin: 0; }
.thumb a { display: block; aspect-ratio: 1; border-radius: 3px; overflow: hidden; background: #e2e8f0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.thumb a:hover img { transform: scale(1.04); }
.thumb figcaption { font-size: .78rem; margin-top: 4px; color: #374151; line-height: 1.3; }
.pcat { font-weight: 700; font-size: .68rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); display: block; }
.pcat-inspection { color: #b91c1c; } .pcat-before { color: #475569; } .pcat-during { color: #b45309; } .pcat-after { color: #15803d; }
.empty-small { margin: 4px 0; }
.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.doc-icon { width: 44px; height: 52px; border-radius: 6px; background: #e2e8f0; color: #475569; display: grid; place-items: center; font-size: .7rem; font-weight: 800; }
.doc-icon.pdf { background: #fee2e2; color: #b91c1c; }
.doc-icon.has-thumb { padding: 0; overflow: hidden; }
.doc-icon.has-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-info { display: flex; flex-direction: column; min-width: 0; }
.doc-info .small { overflow: hidden; text-overflow: ellipsis; }
.doc-label { font-weight: 700; text-decoration: none; }
.doc-actions { grid-column: 2; display: flex; gap: 8px; }
@media (min-width: 640px) { .doclist li { grid-template-columns: 44px 1fr auto; } .doc-actions { grid-column: auto; } }
.danger-zone { text-align: right; margin: 8px 0 24px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 15, 25, .95); display: flex; flex-direction: column; color: #fff; }
.lightbox[hidden] { display: none; }
.lb-bar, .lb-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; flex-wrap: wrap; }
.lb-title { font-weight: 700; }
.lb-close { background: none; border: 0; color: #fff; font-size: 1.6rem; width: 48px; height: 48px; cursor: pointer; }
.lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; position: relative; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.15); color: #fff; border: 0; width: 48px; height: 64px; font-size: 2rem; cursor: pointer; border-radius: 8px; }
.lb-prev { left: 8px; } .lb-next { right: 8px; }
.lb-meta { font-size: .85rem; color: #cbd5e1; }
.lb-actions { display: flex; gap: 8px; }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (min-width: 800px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; border-top: 2px solid var(--primary); }
.stat-num { font-size: 1.6rem; font-weight: 500; color: var(--accent); }
.stat-label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.dash-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 1500px) { .dash-grid { grid-template-columns: 1fr 1fr; } }
.bars { list-style: none; margin: 0; padding: 0; }
.bars a { display: grid; grid-template-columns: 150px 1fr 32px; align-items: center; gap: 10px; padding: 6px 0; text-decoration: none; color: var(--text); font-size: .88rem; }
.bar-track { background: #eef2f6; height: 16px; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; }
.bar-num { text-align: right; font-weight: 700; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px 4px; border-bottom: 1px solid #f1f5f9; }
.table td a { text-decoration: none; color: var(--text); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.num { text-align: right !important; }
@media (max-width: 480px) { .hide-sm { display: none; } .bars a { grid-template-columns: 120px 1fr 28px; } }
.recent { list-style: none; margin: 0; padding: 0; }
.recent a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; text-decoration: none; color: var(--text); align-items: center; }
.recent-main { display: flex; flex-direction: column; align-items: flex-start; }
.recent-when { grid-column: 1 / -1; }
@media (min-width: 700px) { .recent a { grid-template-columns: 1fr 190px 200px; } .recent-when { grid-column: auto; text-align: right; } }
.stage-badge { justify-self: start; display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--stage) 15%, white); color: color-mix(in srgb, var(--stage) 75%, black); border: 1px solid color-mix(in srgb, var(--stage) 35%, white); }

/* ---------- Users ---------- */
.userlist { list-style: none; margin: 0; padding: 0; }
.userlist li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; flex-wrap: wrap; }
.userlist li.inactive { opacity: .6; }
.user-info { display: flex; gap: 10px; align-items: center; }
.user-actions summary { list-style: none; }
.user-actions summary::-webkit-details-marker { display: none; }
.user-actions-body { display: grid; gap: 8px; margin-top: 8px; }
.invite-box { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.invite-box input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; min-width: 0; }
.audit-list { list-style: none; margin: 0; padding: 0; }
.audit-list li { padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.pay-received .pay-amt.is-neg, .pay-table tr.pay-received .pay-amt.is-neg { color: #b91c1c; }
.pay-paid_out .pay-amt.is-pos, .pay-table tr.pay-paid_out .pay-amt.is-pos { color: #15803d; }
.inline-form { display: flex; gap: 6px; }
.inline-form input, .inline-form select { min-height: 38px; padding: 6px 10px; }

/* ---------- Cards: job number / status / priority ---------- */
.jcard-num { font-size: .72rem; color: var(--muted); font-weight: 600; margin-top: 1px; }
.jcard-addr { margin: 2px 0 6px; }
.jcard-status { display: inline-block; font-size: .72rem; font-weight: 700; color: color-mix(in srgb, var(--stage) 80%, black); background: color-mix(in srgb, var(--stage) 12%, white); border-radius: 4px; padding: 2px 7px; margin-bottom: 8px; }
.prio { font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .3px; }
.prio-high { color: #c2410c; } .prio-urgent { color: #dc2626; }
.tiny { font-size: .74rem; }
.pos { color: #15803d; } .neg { color: #b91c1c; }
.is-hidden { display: none !important; }
.alert-soft { background: #fef2f2; font-weight: 400; margin: 0; }

/* ---------- Job File ---------- */
.job-kicker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.job-num { font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.ms-track { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); position: relative; }
.ms-track li { display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; font-size: .7rem; font-weight: 600; color: var(--muted); text-align: center; }
.ms-track li::before { content: ''; position: absolute; top: 13px; left: -50%; right: 50%; height: 3px; background: #e2e8f0; z-index: 0; }
.ms-track li:first-child::before { display: none; }
.ms-track li.done::before, .ms-track li.current::before { background: var(--primary); }
.ms-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid #cbd5e1; font-size: .75rem; font-weight: 800; color: var(--muted); position: relative; z-index: 1; }
.ms-track li.done .ms-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.ms-track li.current .ms-dot { background: #fff; border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px rgba(29,111,184,.15); }
.ms-track li.current { color: var(--primary); font-weight: 800; }
.ms-track.is-cancelled { opacity: .45; }
@media (min-width: 560px) { .ms-track li { font-size: .8rem; } }

.jobfile { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
.job-menu { position: sticky; top: 58px; z-index: 20; display: flex; gap: 6px; overflow-x: auto; background: var(--bg); padding: 8px 0; margin-bottom: 8px; scrollbar-width: none; }
.job-menu::-webkit-scrollbar { display: none; }
.job-menu-title { display: none; }
.job-menu a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 600; font-size: .88rem; min-height: 42px; }
.job-menu a b { background: #e2e8f0; color: #334155; border-radius: 999px; padding: 0 7px; font-size: .72rem; }
.job-menu a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.job-menu a.active b { background: rgba(255,255,255,.25); color: #fff; }
.js .tab-panel:not(.active) { display: none; }
.tab-panel { scroll-margin-top: 120px; }
@media (min-width: 1000px) {
  .job-head { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .quick-actions { grid-column: 1 / -1; grid-auto-columns: 110px; justify-content: start; }
}
@media (min-width: 1000px) {
  .jobfile { grid-template-columns: 210px minmax(0, 1fr); align-items: start; }
  .job-menu { flex-direction: column; top: 74px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; gap: 2px; }
  .job-menu-title { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 4px 10px 8px; }
  .job-menu a { border-radius: 8px; border: 0; justify-content: space-between; background: transparent; }
  .job-menu a:hover { background: #f1f5f9; }
}
.next-steps { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-left: 5px solid var(--stage); }
.ns-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.ns-status { font-size: 1.1rem; }
.ov-grid { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 1200px) { .ov-grid { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; } }
.fin-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fin-mini div { background: #f8fafc; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; }
.fin-mini span { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.fin-mini b { font-size: 1.05rem; }
.gallery-strip { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.gallery-activity { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.gallery-activity figcaption a { color: var(--text); text-decoration: none; }
.chip-link { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 600; font-size: .85rem; }
.chip-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Financials */
.fin-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .fin-tiles { grid-template-columns: repeat(5, 1fr); } }
.fin-tile { background: #f8fafc; border: 1px solid #eef2f6; border-radius: 3px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.fin-tile span { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.fin-tile b { font-size: 1.2rem; font-weight: 800; }
.fin-tile em { font-style: normal; font-size: .75rem; color: var(--muted); }
.fin-tiles .fin-tile:last-child { grid-column: 1 / -1; }
@media (min-width: 700px) { .fin-tiles .fin-tile:last-child { grid-column: auto; } }
.contract-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.contract-form label { font-weight: 600; font-size: .9rem; flex: 1; min-width: 220px; max-width: 360px; }
.contract-form .hint { flex-basis: 100%; margin: 0; }
.input-money { display: flex; align-items: center; margin-top: 6px; }
.input-money span { display: grid; place-items: center; min-height: var(--tap); padding: 0 12px; background: #f1f5f9; border: 1px solid #cfd6df; border-right: 0; border-radius: 3px 0 0 10px; font-weight: 700; color: var(--muted); }
.input-money input { border-radius: 0 10px 10px 0 !important; margin-top: 0 !important; }
.form label .input-money input { margin-top: 0; }
input[type=date], input[type=datetime-local] { width: 100%; min-height: var(--tap); padding: 8px 12px; border: 1px solid #cfd6df; border-radius: 3px; background: #fff; font: inherit; font-size: 16px; }
.pay-form .btn { margin-top: 4px; }
@media (max-width: 639px) { .btn-block-sm { width: 100%; } }
/* Job Financials payment log — AccuLynx Payments screen (Received, then Paid). */
.pay-log-card { padding: 0; overflow: hidden; }
.pay-log-card > .card-head { padding: 12px 16px; margin: 0; }
.pay-section-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #e6e8eb; color: var(--navy); padding: 13px 16px;
  font-size: 1.05rem; font-weight: 700; border-top: 1px solid #d5d8de;
}
.pay-section-total { font-weight: 600; font-variant-numeric: tabular-nums; }
.pay-cards { display: grid; grid-template-columns: minmax(0, 1fr); background: #fff; }
.pay-card { background: #fff; border-bottom: 1px solid #e6e8eb; padding: 14px 10px 8px; min-width: 0; }
.pay-fields { display: flex; flex-direction: column; }
.pay-field { display: grid; grid-template-columns: 7.75rem minmax(0, 1fr); align-items: stretch; }
.pay-field-label {
  text-align: right; text-transform: uppercase; color: #9aa1aa;
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; line-height: 1.35;
  padding: 6px 12px 6px 4px; border-right: 1px solid #d5d8de;
}
.pay-field-value {
  color: var(--navy); font-weight: 600; font-size: .98rem; line-height: 1.35;
  padding: 5px 10px 5px 12px; min-height: 1.35em; overflow-wrap: anywhere;
}
.pay-card-actions { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 4px; }
.pay-card-actions form { margin: 0; }
.pay-delete {
  background: none; border: 0; color: var(--primary); cursor: pointer;
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 8px;
}
.pay-delete .ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pay-edit {
  color: var(--primary); font-weight: 600; text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center; padding: 8px 12px;
}
.pay-edit:hover { text-decoration: underline; }
.pay-empty { padding: 4px 16px 16px; }
/* One column. Received cards stay in the Received section; Paid cards stay below it. */
.pay-log, .pay-section { display: block; }
.pay-log-page { max-width: 640px; margin-left: auto; margin-right: auto; }
.pay-received .pay-dir, .pay-received .pay-amt { color: #15803d; }
.pay-paid_out .pay-dir, .pay-paid_out .pay-amt { color: #b91c1c; }
.pay-blank { color: var(--muted); font-weight: 600; white-space: nowrap; font-size: 1.05rem; }
.pay-table .pay-blank { font-size: .98rem; }
.pay-amt { font-weight: 800; font-size: 1.05rem; white-space: nowrap; }

/* Payments page */
.pay-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; align-items: end; }
.pay-filters label { font-weight: 600; font-size: .85rem; display: block; }
.pay-filters input, .pay-filters select { margin-top: 4px; }
.pay-filter-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 800px) { .pay-filters { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1440px) { .pay-filters { grid-template-columns: 160px 160px 1fr 1fr 1fr 1fr; } }
.stats-money .stat-in { border-top-color: #16a34a; } .stats-money .stat-out, .stat-out { border-top-color: #dc2626; } .stat-due { border-top-color: #7c3aed; }
.stat-in { border-top-color: #16a34a; }
.stats-money { grid-template-columns: 1fr 1fr; }
.stats-money .stat-due { grid-column: 1 / -1; }
@media (min-width: 800px) { .stats-money { grid-template-columns: repeat(3, 1fr); } .stats-money .stat-due { grid-column: auto; } }
.table-card { padding: 6px 16px; overflow-x: auto; }
.pay-table td { vertical-align: top; }
.pay-table td[data-label="Date"] { white-space: nowrap; }
.pay-table .pay-amt { font-size: .98rem; }
.pay-table tr.pay-received .pay-amt { color: #15803d; } .pay-table tr.pay-paid_out .pay-amt { color: #b91c1c; }
.memo-cell { max-width: 260px; color: #374151; }
.dir-badge { display: inline-block; font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .3px; }
.dir-received { background: #dcfce7; color: #166534; } .dir-paid_out { background: #fee2e2; color: #991b1b; }
@media (max-width: 760px) {
  .pay-table thead { display: none; }
  .pay-table, .pay-table tbody, .pay-table tr, .pay-table td { display: block; width: 100%; }
  .pay-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
  .pay-table td { border: 0; padding: 0; }
  .pay-table td[data-label="Date"] { grid-column: 1; grid-row: 1 / span 2; align-self: start; font-weight: 700; }
  .pay-table td[data-label="Received"], .pay-table td[data-label="Paid out"] { grid-column: 2; text-align: right; }
  .pay-table td[data-label="Received"] { grid-row: 1; }
  .pay-table td[data-label="Paid out"] { grid-row: 2; }
  .pay-table td[data-label="Received"]::before, .pay-table td[data-label="Paid out"]::before { color: var(--muted); font-weight: 600; font-size: .75rem; }
  .pay-table td[data-label="Received"]::before { content: 'Received '; }
  .pay-table td[data-label="Paid out"]::before { content: 'Paid out '; }
  .pay-table td[data-label="Recorded"], .pay-table td[data-label="Memo"], .pay-table td[data-label="Method"], .pay-table td[data-label="From / To"], .pay-table td[data-label="Type"], .pay-table td[data-label="Job"] { grid-column: 1 / -1; }
  .pay-table td[data-label="From / To"]::before { content: 'From / to: '; color: var(--muted); }
  .pay-table td[data-label="Method"]::before { content: 'Method: '; color: var(--muted); }
  .pay-table td[data-label="Type"] br { display: none; }
  .pay-table td[data-label="Recorded"] br { display: none; }
  .memo-cell { max-width: none; }
}
.bar-sub { font-size: .75rem; color: var(--muted); padding: 0 0 6px 160px; margin-top: -4px; }
@media (max-width: 480px) { .bar-sub { padding-left: 0; } }

/* ---------- Desktop ---------- */
@media (min-width: 1000px) {
  body { padding-bottom: 0; }
  .hamburger, .ax-nav-mobilehead, .ax-logout, .ax-quick-add { display: none; }
  .ax-top { position: static; min-height: 36px; padding: 0 14px; }
  .ax-brand { font-size: .95rem; }
  .ax-company { display: inline; }
  .ax-user span { display: inline; }
  .ax-nav { position: sticky; top: 0; transform: none; width: auto; max-width: none; flex-direction: row; align-items: stretch; overflow: visible; padding: 0; z-index: 36; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
  .ax-btn { flex-direction: column; gap: 1px; padding: 5px 10px 4px; min-height: 42px; font-size: .68rem; font-weight: 400; width: auto; min-width: 58px; align-items: center; text-align: center; }
  .ax-btn .ico { width: 20px; height: 20px; }
  .ax-orange + .ax-orange > .ax-btn { border-top: 0; border-left: 1px solid rgba(255,255,255,.3); }
  .ax-item.has-menu:hover > .ax-menu, .ax-item.open > .ax-menu { display: block; }
  .ax-item:hover > .ax-btn { background: rgba(255,255,255,.14); }
  .ax-orange:hover > .ax-btn { background: var(--accent-dark); }
  .ax-item.active > .ax-btn { background: #fff; color: var(--primary); }
  .ax-menu { position: absolute; top: 100%; left: 0; min-width: 190px; box-shadow: 0 6px 18px rgba(0,0,0,.2); border-radius: 0 0 3px 3px; z-index: 60; }
  .ax-menu a { padding: 8px 16px; font-size: .92rem; }
  .ax-search { margin: 0 0 0 auto; width: min(360px, 32vw); background: #f1f2f4; }
  .ax-search input[type=search] { min-height: 42px; font-size: .9rem; }
  .ax-help { margin: 0; border-radius: 0; flex-direction: column; gap: 1px; padding: 5px 10px 4px; font-size: .68rem; font-weight: 400; justify-content: center; }
  .ax-help .ico { width: 20px; height: 20px; }
  .bottomnav { display: none; }
  .sticky-actions { bottom: 0; }
  .toast { bottom: 24px; }
  .page-band, .filter-band { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }
  .container, .container-wide { padding: 16px 24px; }
}
@media (min-width: 1000px) and (max-width: 1180px) { .ax-company { display: none; } .ax-btn { min-width: 50px; padding: 5px 7px 4px; } }

/* ---------- Milestone badges (colored circles) ---------- */
.ms-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ms, #9ca3af); color: #fff; font-weight: 700; font-size: .8rem; flex: none; line-height: 1; letter-spacing: -.5px; }
.ms-badge-xs { width: 20px; height: 20px; font-size: .62rem; vertical-align: middle; }
.ms-badge-lg { width: 34px; height: 34px; font-size: 1rem; }
.ms-badge-xl { width: 56px; height: 56px; font-size: 1.7rem; font-weight: 700; }
.ms-badge.off { background: #cfd2d6; }

/* ---------- Dashboard (AccuLynx layout) ---------- */
.dash-layout { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 1100px) { .dash-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.pipe-circles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 18px 8px 16px; }
.pipe-c { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--text); }
.pipe-c b { color: var(--accent); font-size: 1.5rem; font-weight: 500; line-height: 1.2; margin-top: 6px; }
.pipe-c > span:last-child { font-size: .8rem; color: #444; }
@media (max-width: 520px) { .pipe-c .ms-badge-xl { width: 42px; height: 42px; font-size: 1.25rem; } .pipe-c b { font-size: 1.15rem; } .pipe-c > span:last-child { font-size: .68rem; } }
.stats-money { margin-bottom: 12px; }
.ar-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-decoration: none; color: var(--text); border: 1px solid var(--line); padding: 8px 10px 10px; }
.ar-title { grid-column: 1 / -1; font-size: .72rem; font-weight: 700; color: #555; }
.ar-b { display: flex; flex-direction: column; align-items: center; border-top: 3px solid #cfd2d6; padding-top: 4px; }
.ar-b em { font-style: normal; font-size: .72rem; color: var(--muted); }
.ar-b b { font-size: .88rem; font-weight: 600; }
.action-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
@media (min-width: 700px) { .action-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
.action-tile { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; background: #f3f4f6; padding: 10px 12px; text-decoration: none; color: #777; }
.action-tile b { font-size: 1.3rem; font-weight: 400; color: #666; }
.action-tile span { font-size: .78rem; text-align: center; line-height: 1.2; }
.action-tile i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; background: #bfc3c8; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .78rem; }
.bar-label { display: flex; align-items: center; gap: 6px; }
.dash-feed .feed { list-style: none; margin: 0; padding: 0 14px; max-height: 1100px; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed-av { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.feed-kind { font-size: .82rem; color: #c0392b; font-weight: 600; }
.feed-kind b { color: #555; }
.feed-stage, .feed-payment { color: #2f7d32; }
.feed-body a { font-weight: 600; font-size: .9rem; text-decoration: none; }
.feed-body p { margin: 2px 0 0; font-size: .85rem; color: #555; word-break: break-word; }

/* ---------- Job File (AccuLynx layout) ---------- */
.jobfile-page { padding: 0; }
.jf-wrap { padding-top: 14px; }
.jf-head { background: #fff; margin: 0; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.jf-back { display: grid; place-items: center; width: 36px; height: 44px; color: var(--primary); }
.jf-back .ico { width: 30px; height: 30px; fill: currentColor; }
.jf-title { min-width: 0; }
.jf-title h1 { font-size: 1.3rem; font-weight: 400; color: #333; line-height: 1.2; }
.jf-title a { font-size: .85rem; text-decoration: none; }
.jf-cell { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.jf-prio, .jf-owner { display: none; }
.jf-bal { justify-content: space-between; text-decoration: none; color: var(--text); background: #f7f8fa; padding: 6px 10px; }
.jf-bal > span:first-child { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline; }
.jf-bal b { font-size: 1.05rem; }
.jf-bal-lbl { color: var(--green); font-size: .8rem; }
.jf-bal-sub { color: var(--green); font-size: .75rem; font-weight: 700; }
.jf-ar { color: var(--primary); font-size: .72rem; }
.pct-ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--green) calc(var(--p) * 1%), #e8413c 0); flex: none; }
.pct-ring span { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: #222; }
.prio-dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--green); display: inline-block; }
.prio-dot.prio-low { border-color: #9ca3af; } .prio-dot.prio-high { border-color: #f59e0b; } .prio-dot.prio-urgent { border-color: #dc2626; }
.jf-tabs { background: #fff; margin: 0; display: flex; align-items: stretch; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); position: sticky; top: 52px; z-index: 25; box-shadow: 0 2px 4px rgba(0,0,0,.06); }
.jf-tabs::-webkit-scrollbar { display: none; }
.jf-tabs > a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; min-height: 48px; color: var(--primary); text-decoration: none; font-size: .95rem; border-bottom: 3px solid transparent; border-right: 1px solid #eef0f2; }
.jf-tabs > a .ico { width: 16px; height: 16px; fill: currentColor; }
.jf-tabs > a b { font-weight: 600; font-size: .72rem; color: var(--muted); }
.jf-tabs > a.active { color: #333; border-bottom-color: var(--primary); }
.jf-menu { margin-left: auto; position: relative; flex: none; }
.jf-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 48px; color: var(--primary); font-size: .75rem; font-weight: 600; cursor: pointer; }
.jf-menu summary::-webkit-details-marker { display: none; }
.jf-menu summary .ico { width: 24px; height: 24px; fill: currentColor; }
.jf-menu-list { position: fixed; right: 12px; margin-top: 0; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.2); min-width: 220px; padding: 6px 0; z-index: 70; }
.jf-menu-list a, .jf-menu-list .linkbtn { display: block; padding: 10px 16px; color: var(--primary); text-decoration: none; font-size: .95rem; text-align: left; width: 100%; }
.jf-menu-list a:hover { background: #eef4fb; }
.danger-link { color: var(--danger) !important; text-decoration: none !important; font-size: .95rem !important; }
.jf-quick { margin-bottom: 14px; }
.tab-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.tab-title .page-title { font-size: 1.6rem; }
.ms-body { display: grid; gap: 16px; }
.ms-next { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ns-next { color: var(--accent); font-weight: 500; }
.ms-next .stage-form { width: 100%; max-width: 360px; }
.ms-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); }
.ms-track li { display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative; font-size: .72rem; color: #444; text-align: center; }
.ms-track li::before { content: ''; position: absolute; top: 16px; left: -50%; right: 50%; height: 3px; background: #cfd2d6; z-index: 0; }
.ms-track li:first-child::before { display: none; }
.ms-track li.done::before { background: #9ca3af; }
.ms-track .ms-badge { position: relative; z-index: 1; }
.ms-track li.current .ms-badge { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ms) 25%, white); }
.ms-date { color: var(--muted); font-size: .68rem; }
.ms-track.is-cancelled { opacity: .45; }
.ja-row { display: grid; grid-template-columns: repeat(2, 1fr); }
.ja-row > * { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; color: var(--primary); font-size: .9rem; }
.ja-row b { color: var(--accent); font-size: 1.25rem; font-weight: 500; }
.ja-soon { color: #9aa3ae !important; }
.ja-soon b { color: #c3c8ce; }
.ov-2col { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
.ax-card > .card-head h2 .ico { width: 20px; height: 20px; fill: var(--primary); vertical-align: -3px; }
.icon-link { text-decoration: none; font-size: 1.2rem; color: var(--primary); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 12px; margin: 0; font-size: .92rem; }
.kv dt { font-weight: 700; color: #333; }
.kv dd { margin: 0; word-break: break-word; min-height: 1.2em; }
.subtabs { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card-head); border-bottom: 1px solid var(--line); }
.subtabs button { border: 0; background: none; font: inherit; padding: 12px 6px; color: var(--primary); cursor: pointer; font-size: .9rem; border-left: 1px solid var(--line); }
.subtabs button:first-child { border-left: 0; }
.subtabs button.active { background: #fff; color: #333; font-size: 1.1rem; }
.ov-zero { margin: 0; display: flex; gap: 12px; align-items: baseline; color: #444; font-size: .9rem; }
.ov-zero b { color: var(--accent); font-size: 1.1rem; font-weight: 500; }
.note-inline { grid-template-columns: 1fr auto; align-items: start; }
.note-inline textarea { min-height: 48px; }
.comm-layout { display: grid; grid-template-columns: 1fr; gap: 12px; }
.comm-rail { display: flex; gap: 6px; overflow-x: auto; }
.comm-rail button { flex: none; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; padding: 8px 12px; font: inherit; font-size: .85rem; color: var(--primary); cursor: pointer; min-height: 42px; }
.comm-rail button .ico { width: 18px; height: 18px; fill: currentColor; }
.comm-rail button b { color: var(--muted); font-size: .75rem; }
.comm-rail button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.comm-rail button.active b { color: #dbe8f7; }
.doc-folder { border: 1px solid var(--line); margin-bottom: 12px; }
.doc-folder-head { background: var(--card-head); padding: 10px 12px; color: var(--primary); font-size: 1.05rem; border-bottom: 1px solid var(--line); }
button.doc-folder-head { width: 100%; border: 0; border-bottom: 1px solid var(--line); font: inherit; font-size: 1.05rem; text-align: left; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
button.doc-folder-head::after { content: '›'; font-size: 1.3rem; line-height: 1; }
button.doc-folder-head:hover { background: #e7eef6; }
.doc-folder.is-open button.doc-folder-head { cursor: default; }
.doc-folder.is-open button.doc-folder-head::after { content: none; }
.doc-folder-crumb { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.doc-folder .doclist li { padding: 10px 12px; }
.fin-layout { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
.fin-layout .fin-tiles { margin: 0; }
.fin-tile { background: #fff; border: 0; box-shadow: var(--shadow); border-radius: var(--radius); }
.fin-tile b { font-weight: 500; }
.fin-dark { outline: 3px solid var(--navy); outline-offset: -3px; }
.ar-box { background: #fff; box-shadow: var(--shadow); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ar-box .ar-title { font-size: .75rem; font-weight: 700; color: #444; }
.ar-buckets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; height: 70px; align-items: end; }
.ar-buckets span { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.ar-buckets i { width: 70%; background: #d1d5db; display: block; min-height: 3px; max-height: 44px; }
.ar-buckets span.on i { background: #e8413c; }
.ar-buckets em { font-style: normal; font-size: .7rem; color: #555; border-top: 1px solid #ccc; width: 100%; text-align: center; padding-top: 2px; }
@media (min-width: 700px) {
  .ja-row { grid-template-columns: repeat(7, 1fr); }
  .ja-row > * { border-bottom: 0; flex-direction: column; align-items: flex-start; gap: 2px; }
}
@media (min-width: 800px) {
  .ms-body { grid-template-columns: 260px 1fr; align-items: center; }
  .ms-track li { font-size: .82rem; }
  .comm-layout { grid-template-columns: 170px 1fr; align-items: start; }
  .comm-rail { flex-direction: column; background: #dfe1e5; padding: 6px; }
  .comm-rail button { border: 0; justify-content: flex-start; }
}
@media (min-width: 1000px) {
  .jf-head { grid-template-columns: auto auto minmax(0, 1fr) auto auto auto; padding: 0 0 0 12px; gap: 0 12px; min-height: 66px; }
  .jf-cell { grid-column: auto; align-self: stretch; border-left: 1px solid var(--line); padding: 8px 16px; }
  .jf-prio, .jf-owner { display: flex; }
  .jf-prio { flex-wrap: wrap; max-width: 150px; column-gap: 6px; }
  .jf-prio .muted { width: 100%; }
  .jf-bal { background: none; min-width: 230px; }
  .jf-bal > span:first-child { display: flex; flex-direction: column; }
  .jf-owner { min-width: 190px; color: var(--primary); font-size: .9rem; }
  .jf-tabs { top: 42px; }
  .jf-quick { display: none; }
  .ov-2col { grid-template-columns: 1fr 1fr; align-items: start; }
  .fin-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .jf-body { max-width: 1140px; margin: 0 auto; }
}

/* ---------- Pipeline / results lists ---------- */
.band-actions { display: flex; gap: 10px; align-items: center; }
.band-actions .btn .ico { width: 18px; height: 18px; fill: currentColor; }
.filter-band.filters { display: grid; grid-template-columns: 1fr; gap: 8px; }
.filter-band input[type=search], .filter-band select { border-radius: 0; border-color: #fff; min-height: 46px; }
@media (min-width: 640px) { .filter-band.filters { grid-template-columns: minmax(200px, 420px) 240px auto auto 1fr; } }
.seg { display: flex; gap: 0; margin: 0 0 14px; overflow-x: auto; background: #fff; box-shadow: var(--shadow); scrollbar-width: none; }
.seg a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; min-height: 44px; text-decoration: none; color: var(--primary); border-bottom: 3px solid transparent; font-size: .92rem; }
.seg a.active { color: #333; border-bottom-color: var(--primary); font-weight: 600; }
.col { background: #dfe1e5; border-radius: var(--radius); border-top: 3px solid var(--stage); flex-basis: 224px; }
.col-title { display: flex; align-items: center; gap: 6px; }
.jcard { border-radius: var(--radius); border-left: 0; border-top: 0; }
.jcard-name { color: var(--primary); }
.litem { border-radius: var(--radius); }
.litem-main { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 12px 14px 8px; }
.litem-main > span:not(.litem-side) { grid-column: 1; }
.litem-name { color: var(--primary); font-weight: 400; font-size: 1.12rem; }
.litem-line, .litem-addr { font-size: .85rem; color: #555; }
.litem-owner { font-weight: 700; font-size: .88rem; margin-top: 6px; }
.litem-kv { font-size: .8rem; color: #444; display: flex; align-items: center; gap: 6px; }
.litem-kv b { min-width: 58px; }
.litem-side { grid-column: 2; grid-row: 1 / span 5; display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 0; }
.litem-side .ms-badge { margin-bottom: 4px; }
@media (min-width: 900px) {
  .plist.plist-always { display: grid !important; grid-template-columns: 1fr; }
  .plist-always .lgroup-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 10px; }
  .plist-always .litem { margin: 0; grid-template-columns: 1fr; }
  .plist-always .litem-stage { padding: 0 14px 12px; }
}
.more-fields { margin: 0 0 8px; }
.more-fields summary { cursor: pointer; color: var(--primary); font-weight: 600; padding: 8px 0 12px; }

/* ---------- Reports ---------- */
.rep-tag { display: inline-block; background: #9ca3af; color: #fff; font-size: .72rem; font-weight: 600; padding: 2px 6px; letter-spacing: .5px; vertical-align: middle; margin-left: 8px; }
.rep-filter { font-size: .85rem; color: #666; margin: 0 0 8px; }
.chart-wrap { background: #fff; padding: 12px; margin-bottom: 16px; overflow-x: auto; box-shadow: var(--shadow); }
.chart { width: 100%; min-width: 560px; height: auto; display: block; }
.rep-table { width: 100%; border-collapse: collapse; background: #eaf2fc; font-size: .9rem; }
.rep-table th { background: #d3e2f4; text-align: left; font-weight: 700; padding: 9px 12px; border: 1px solid #c3d3e8; white-space: nowrap; }
.rep-table td { padding: 7px 12px; border: 1px solid #cfdcee; }
.rep-table tbody tr:nth-child(even) td { background: #f2f7fd; }
.rep-table tfoot td { font-weight: 700; background: #d3e2f4; }
.rep-table a { text-decoration: none; }
.rep-scroll { overflow-x: auto; box-shadow: var(--shadow); margin-bottom: 16px; }
.lib-list { list-style: none; margin: 0; padding: 0; }
.lib-head, .lib-list li { display: grid; grid-template-columns: 56px 1fr 120px; gap: 10px; align-items: center; }
.lib-head { background: #dfe1e5; font-size: .7rem; color: var(--muted); padding: 6px 10px; letter-spacing: .5px; }
.lib-list li { background: #fff; margin-top: 8px; padding: 12px 10px; box-shadow: var(--shadow); }
.lib-icon { font-size: 1.6rem; text-align: center; }
.lib-title a { font-size: 1.15rem; text-decoration: none; }
.lib-title p { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.lib-entity span { background: #9ca3af; color: #fff; font-size: .68rem; padding: 3px 8px; display: inline-block; }
@media (max-width: 560px) { .lib-head, .lib-list li { grid-template-columns: 40px 1fr; } .lib-entity { display: none; } }
.ls-list { list-style: none; margin: 0; padding: 0; }
.ls-list li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ls-list li.inactive .ls-name { color: #9aa3ae; text-decoration: line-through; }
.ls-main { display: flex; align-items: center; gap: 12px; }
.ls-check { width: 22px; height: 22px; border: 2px solid var(--accent); display: grid; place-items: center; color: #fff; font-size: .8rem; background: #fff; cursor: pointer; padding: 0; }
.ls-check.on { background: var(--accent); }
.ls-actions { display: flex; gap: 6px; align-items: center; }
.ls-actions details summary { list-style: none; cursor: pointer; color: var(--primary); }
.settings-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
.settings-nav { list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.settings-nav li { padding: 5px 0; color: var(--primary); }
.settings-nav li.sub { padding-left: 18px; font-size: .88rem; }
.settings-nav li b { color: #333; }
.settings-nav a { text-decoration: none; }
@media (min-width: 900px) { .settings-layout { grid-template-columns: 240px minmax(0, 760px); } }
.ar-strip-lg { background: #fff; margin-bottom: 16px; box-shadow: var(--shadow); }

/* Full-bleed white/gray bands regardless of container width */
.page-band { box-shadow: 0 0 0 100vmax #fff; clip-path: inset(0 -100vmax); }
.filter-band { box-shadow: 0 0 0 100vmax #d9dadd; clip-path: inset(0 -100vmax); }
.flash { max-width: 1280px; }
[hidden] { display: none !important; }

/* Milestone requests */
.nav-count { display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; padding: 0 4px; border-radius: 999px; background: #e8413c; color: #fff; font-size: .68rem; font-weight: 800; line-height: 1; vertical-align: middle; }
.ax-btn { position: relative; }
.ax-btn > .nav-count { position: absolute; top: 3px; right: 4px; }
.page-title .nav-count { margin-left: 8px; position: static; }
.ms-banner { background: #fffbeb; border: 1px solid #f6d98a; padding: 12px 14px; border-radius: 3px; }
.ms-banner p { margin: 6px 0 0; }
.ms-banner.is-approved { background: #f0fdf4; border-color: #bbf7d0; }
.ms-banner.is-denied { background: #fef2f2; border-color: #fecaca; }
.ms-banner-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 10px; }
.ms-ask { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 420px; padding-top: 8px; border-top: 1px solid var(--line); }
.ms-ask label, .ms-deny label, .req-deny { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 700; color: var(--muted); }
.ms-deny { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.req-table { width: 100%; border-collapse: collapse; }
.req-table th, .req-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.req-deny { flex-direction: row; align-items: center; font-weight: 400; }
.req-deny input[type=text] { min-width: 160px; }
@media (max-width: 639px) {
  .page-band .page-sub, .page-band .band-actions { display: none; }
  .page-band { padding-top: 12px; padding-bottom: 10px; margin-bottom: 12px; }
  .page-title { font-size: 1.5rem; }
  .filter-band { margin-bottom: 12px; }
}
