/* PGBR Portal. Brand colors from permaglazebathrenew.com: navy, white and sparkle yellow (red only for warnings).
   Look: a deep navy frame with pill tabs, a soft light panel, and white cards with big rounded corners. */
:root {
  --navy: #12367b;
  --navy-deep: #0c2557;
  --frame: #0a1d45;
  --navy-soft: #e6ecf7;
  --yellow: #f3ea1d;
  --yellow-soft: #fbf8c4;
  --red: #d6260f;
  --red-bright: #ff2a13;
  --ink: #18213a;
  --muted: #5d667a;
  --line: #e3e8f1;
  --panel: #edf1f7;
  --bg: var(--panel);
  --card: #ffffff;
  --green: #1f7a4a;
  --radius: 22px;
  --radius-sm: 14px;
  --side: 202px;
  --shadow: 0 1px 2px rgba(12, 37, 87, .05), 0 10px 28px rgba(12, 37, 87, .07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--frame);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--frame); line-height: 1.45; font-size: 15px; }
a { color: var(--navy); }
h1 { font-size: 1.85rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 .35rem; color: var(--navy-deep); }
h2 { font-size: 1.08rem; font-weight: 650; margin: 0 0 .8rem; color: var(--navy-deep); }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { flex: none; }

/* Header: logo, search, view switch and you, then the pill tabs. */
.top { background: var(--frame); color: #fff; padding: .8rem 1.25rem .9rem; }
.top-row { display: flex; align-items: center; gap: 1rem; }
.logo img { display: block; height: 55px; width: auto; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.top-right a { color: #fff; }
.top-search { display: flex; align-items: center; gap: .4rem; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; padding: 0 .4rem 0 .85rem; color: #b9c6e2; }
.top-search input { background: transparent; border: 0; color: #fff; padding: .5rem .4rem; width: 12rem; }
.top-search input::placeholder { color: #9fb0d4; }
.top-search input:focus { outline: none; }
.top-search:focus-within { border-color: var(--yellow); }
.who { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; text-decoration: none; padding: .2rem .8rem .2rem .2rem; border-radius: 999px; background: rgba(255, 255, 255, .09); }
.who:hover { background: rgba(255, 255, 255, .16); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); color: var(--navy-deep); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.role-tag { background: var(--yellow); color: var(--navy-deep); border-radius: 999px; padding: .3rem .8rem; font-size: .8rem; font-weight: 700; }
.view-switch { display: flex; align-items: center; gap: .4rem; }
.view-switch label { font-size: .82rem; color: #b9c6e2; }
.view-switch select { background: var(--yellow); color: var(--navy-deep); border: 0; border-radius: 999px; font-weight: 700; padding: .45rem .8rem; }
.round-btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14); color: #fff; }
.round-btn:hover { background: rgba(255, 255, 255, .18); }
.menu-toggle { display: none; }

.main-tabs { display: flex; gap: .5rem; margin-top: .9rem; overflow-x: auto; scrollbar-width: none; }
.main-tabs::-webkit-scrollbar { display: none; }
.main-tabs a {
  display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; text-decoration: none;
  padding: .55rem 1.05rem; border-radius: 999px; font-weight: 600; font-size: .9rem;
  color: #dbe3f3; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
}
.main-tabs a:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.main-tabs a[aria-current="page"] { background: #fff; color: var(--navy-deep); border-color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.main-tabs a[aria-current="page"] .ico { color: var(--navy); }
.view-note { margin: .9rem 0 0; color: #b9c6e2; font-size: .88rem; }
.count { background: var(--red-bright); color: #fff; border-radius: 999px; font-size: .72rem; padding: .05rem .45rem; font-weight: 700; margin-left: auto; }
.main-tabs .count { margin-left: .1rem; }

/* The frame below the header: side menu on the navy, page on a light rounded panel. */
.shell { display: flex; align-items: flex-start; }
.side { position: sticky; top: 0; width: var(--side); flex: none; max-height: 100vh; overflow-y: auto; padding: .3rem .75rem 1.5rem 1.1rem; }
.side a { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; margin: 1px 0; border-radius: 12px; text-decoration: none; color: #c9d4ea; font-weight: 500; font-size: .93rem; }
.side a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side a[aria-current="page"] { background: #fff; color: var(--navy-deep); font-weight: 650; }
.side a[aria-current="page"] .ico { color: var(--navy); }
.side a.sub { padding-left: 2.45rem; font-size: .9rem; }
.side-group { display: flex; align-items: center; gap: .6rem; margin: .9rem 0 .2rem; padding: 0 .75rem; color: #8fa1c7; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.side-group.on { color: var(--yellow); }

.page { flex: 1; min-width: 0; padding: 0 1.25rem 1.25rem 0; }
.bare .page, .page:only-child { padding-left: 1.25rem; }
.panel { background: var(--panel); border-radius: 30px; padding: 1.75rem 1.9rem 2rem; min-height: calc(100vh - 9rem); }
main { max-width: 1040px; }
main.wide { max-width: 1340px; }
main.narrow { max-width: 580px; margin: 0 auto; }
.bare .top-row { justify-content: center; }
.bare .logo img { height: 70px; }
.bare .top-right { position: absolute; right: 1.25rem; }
.bare .panel { padding-top: 3rem; }

/* Cards and layout */
.card { background: var(--card); border: 0; border-radius: var(--radius); padding: 1.35rem 1.5rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.card.highlight { box-shadow: 0 0 0 3px var(--yellow), var(--shadow); }
.card.warn { box-shadow: inset 5px 0 0 var(--red-bright), var(--shadow); }
.sub-card { background: var(--panel); border-radius: var(--radius-sm); padding: 1rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: start; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: .85rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .85rem; }
.inline { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: 0; }
.narrow-form { max-width: 720px; }

/* Forms */
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .88rem; color: var(--navy-deep); }
label small { font-weight: 400; color: var(--muted); }
label.check, label.inline-label { flex-direction: row; align-items: center; gap: .45rem; font-weight: 500; }
.inline label { flex-direction: row; align-items: center; gap: .4rem; }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #d3dae7; border-radius: 12px; padding: .6rem .75rem; width: 100%;
}
.panel > main select, .card select { background-color: #fff; }
.inline input, .inline select, .actions select { width: auto; }
input[type="checkbox"] { width: auto; accent-color: var(--navy); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; border-color: var(--navy); }
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; text-decoration: none; text-align: center;
  background: var(--navy); color: #fff; border: 1px solid var(--navy); border-radius: 999px; padding: .6rem 1.2rem;
}
button:hover, .btn:hover { background: var(--navy-deep); }
button.ghost, .btn.ghost { background: #fff; color: var(--navy); border-color: #d3dae7; }
button.ghost:hover, .btn.ghost:hover { background: var(--navy-soft); border-color: var(--navy-soft); }
button.small, .btn.small { padding: .38rem .85rem; font-size: .85rem; }
button.danger { color: var(--red); border-color: #f1c2b9; background: #fff; }
button.danger:hover { background: #fff1ee; }
.stack > button { align-self: flex-start; }
.link-btn { background: none; border: 0; padding: 0; color: var(--navy); text-decoration: underline; font-weight: 500; border-radius: 0; display: inline; }
.link-btn:hover { background: none; }
.link-btn.danger { color: var(--red); }

/* Notices */
.notice { background: #fff4f2; border: 0; box-shadow: inset 4px 0 0 var(--red-bright); color: #8a1c0c; border-radius: var(--radius-sm); padding: .8rem 1.1rem; }
.notice.ok { background: #eef8f2; box-shadow: inset 4px 0 0 var(--green); color: var(--green); }

/* Stats: a small label and a big number, like a reading on a dashboard. */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; margin: 1.1rem 0; }
.stat { background: var(--card); border-radius: var(--radius); padding: 1.15rem 1.3rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); display: flex; flex-direction: column-reverse; gap: .2rem; position: relative; }
.stat strong { display: block; font-size: 2rem; font-weight: 500; letter-spacing: -.02em; color: var(--navy-deep); }
.stat span { color: var(--muted); font-size: .82rem; font-weight: 600; }
.stat::after { content: ""; position: absolute; top: 1.1rem; right: 1.1rem; width: 12px; height: 12px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 5px var(--yellow-soft); }
a.stat:hover { box-shadow: 0 0 0 2px var(--yellow), var(--shadow); }

/* Lists and tables */
.list { list-style: none; margin: 0 0 .5rem; padding: 0; }
.list li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list a { text-decoration: none; }
.list a:hover { text-decoration: underline; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: .5rem; border-bottom: 2px solid var(--line); }
.table td { padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table a { text-decoration: none; }
tr.canceled td, .canceled { opacity: .55; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: .75rem; }
.tabs a { padding: .35rem .75rem; border-radius: 99px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .88rem; }
.tabs a[aria-current="page"] { background: var(--navy); color: #fff; }

/* Badges */
.badge { display: inline-block; font-size: .75rem; font-weight: 700; border-radius: 99px; padding: .1rem .55rem; background: #eceff5; color: var(--muted); vertical-align: middle; }
.b-new, .b-estimate, .b-scheduled, .b-quoted { background: var(--navy-soft); color: var(--navy); }
.b-contacted, .b-talked, .b-on_way, .b-follow_up { background: #e6f2ff; color: #0b5cad; }
.b-estimate_set, .b-in_progress, .b-booked, .b-job { background: #fff7c2; color: #6b5d00; }
.b-won, .b-done, .b-complete { background: #e3f5ea; color: var(--green); }
.b-lost, .b-canceled, .b-not_interested { background: #fde8e4; color: var(--red); }
.b-callback, .b-voicemail, .b-no_answer, .b-on_hold { background: #fff0e0; color: #9a4a00; }

/* Calendar */
.legend { display: flex; gap: .4rem 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: .6rem; align-items: center; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .25rem; }
.month { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.month-head, .month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.month-head span { padding: .5rem; font-size: .8rem; font-weight: 700; color: #fff; background: var(--navy); text-align: center; }
.day { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .3rem; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.day:nth-child(7n) { border-right: 0; }
.day.other { background: #f8f9fc; }
.day.other .day-num { opacity: .5; }
.day.today { background: #fffde6; }
.day.today .day-num a, .day.today .day-num { color: var(--red); font-weight: 800; }
.day-num { font-size: .85rem; font-weight: 600; }
.day-num a { text-decoration: none; color: var(--ink); }
.ev { display: block; font-size: .75rem; padding: 2px 5px; border-radius: 5px; text-decoration: none; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid; }
.k-estimate { background: var(--navy-soft); border-color: var(--navy); }
.k-job { background: #fff8c4; border-color: #c9bb00; }
.k-follow_up { background: #e6f2ff; border-color: #3a86d1; }
.k-other { background: #eef0f4; border-color: #8b93a5; }
.dot.k-estimate { background: var(--navy); } .dot.k-job { background: #d8c900; } .dot.k-follow_up { background: #3a86d1; } .dot.k-other { background: #8b93a5; }
.ev.done { opacity: .6; text-decoration: line-through; }
.ev.canceled { opacity: .4; text-decoration: line-through; }

/* Funnel board */
.board { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.col { background: #e9edf5; border-radius: var(--radius); padding: .7rem; min-height: 200px; border-top: 4px solid var(--navy); }
.col.s-won { border-top-color: var(--green); }
.col.s-lost { border-top-color: var(--red); }
.col.s-estimate_set, .col.s-quoted { border-top-color: #c9bb00; }
.col h2 { font-size: .95rem; display: flex; justify-content: space-between; }
.col-sum { font-size: .85rem; font-weight: 700; color: var(--navy); margin-top: -.5rem; }
.lead-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; margin-bottom: .5rem; display: flex; flex-direction: column; gap: .2rem; }
.lead-card a { text-decoration: none; }
.lead-card .move { margin-top: .35rem; }
.lead-card select { font-size: .8rem; padding: .25rem .4rem; }

/* Sales bars */
.bars { display: flex; flex-direction: column; gap: .5rem; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 110px; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); }
.bar { background: #eef1f6; border-radius: 6px; height: 22px; overflow: hidden; }
.fill { display: block; height: 100%; background: var(--navy); border-radius: 6px; width: 2%; }
.fill.s-won { background: var(--green); } .fill.s-lost { background: var(--red); } .fill.s-estimate_set, .fill.s-quoted { background: #d8c900; }
.bar-num { font-weight: 700; }

/* Messages */
.msg-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; align-items: start; }
.msg-people { padding: .5rem; }
.msg-people a { display: block; padding: .55rem .7rem; border-radius: 8px; text-decoration: none; color: var(--ink); }
.msg-people a small { display: block; color: var(--muted); }
.msg-people a[aria-current="page"] { background: var(--navy-soft); box-shadow: inset 4px 0 0 var(--navy); }
.msgs { max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; padding: .25rem; margin-bottom: .75rem; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 75%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.bubble { background: #eef1f6; border-radius: 14px; padding: .55rem .8rem; }
.msg.me .bubble { background: var(--navy); color: #fff; }
.msg-send { display: flex; gap: .5rem; align-items: flex-end; }

/* Technicians */
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.job { display: flex; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.job:last-child { border-bottom: 0; }
.job-time { min-width: 70px; display: flex; flex-direction: column; }
.job-time small { color: var(--muted); }
.job-body { flex: 1; min-width: 0; }
.job-actions { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .45rem; }
.job.done { opacity: .65; }

/* Notes, steps, misc */
.note p { white-space: normal; }
.note-meta { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .7rem; }
.setup-key { font-family: ui-monospace, Menlo, monospace; font-size: 1.15rem; letter-spacing: .05em; background: var(--navy-soft); border: 1px dashed var(--navy); border-radius: 8px; padding: .6rem .8rem; margin: .5rem 0; user-select: all; word-break: break-all; }
.copy-row { display: flex; gap: .5rem; }
.preview { border: 2px dashed var(--navy); border-radius: var(--radius); padding: 1.2rem; margin-top: 1rem; background: #fff; }

/* Phones and small tablets */
@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .logo img { height: 43px; }
  .top { padding: .7rem .75rem .75rem; }
  .top-row { flex-wrap: wrap; gap: .6rem; }
  .top-right { width: 100%; justify-content: space-between; margin: 0; gap: .45rem; }
  .top-search { flex: 1; min-width: 0; }
  .top-search input { width: 100%; }
  .who { padding-right: .2rem; }
  .who-name { display: none; }
  .view-switch label { display: none; }
  .main-tabs { margin: .75rem -.75rem 0; padding: 0 .75rem; }
  .side { position: fixed; top: 0; left: 0; bottom: 0; max-height: none; z-index: 30; width: 234px; background: var(--frame); padding-top: 1.2rem;
    transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .menu-open .side { transform: none; }
  .page, .bare .page, .page:only-child { padding: 0 .5rem .5rem; }
  .panel { border-radius: 24px; padding: 1.15rem 1rem 1.5rem; min-height: calc(100vh - 8rem); }
  .card { padding: 1.1rem 1.05rem; border-radius: 18px; }
  h1 { font-size: 1.5rem; }
  .cols, .row2, .row3, .msg-layout { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat strong { font-size: 1.6rem; }
  .bar-row { grid-template-columns: 110px 1fr 70px; }
  .day { min-height: 70px; }
  .ev small, .ev b { display: none; }
  .table { display: block; overflow-x: auto; }
  .msg { max-width: 90%; }
}

/* Several small buttons in one table cell: let them wrap, one per line if needed. */
.row-actions { min-width: 120px; }
.row-actions > form { display: inline-block; margin: 0 .7rem .25rem 0; }

/* ===== Added Nov 22, 2026 ===== */
.top-gap { margin-top: .75rem; }
details > summary { cursor: pointer; font-weight: 600; color: var(--navy); margin: .25rem 0; }
.num { text-align: right; white-space: nowrap; }

/* Search */
.search-big { display: flex; gap: .5rem; margin-bottom: 1rem; }

/* Jobs hub */
.careers-link { flex: 1; max-width: 520px; }
.posting-row { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.col.s-applied { border-top-color: var(--navy); }
.col.s-screen { border-top-color: #3a86d1; }
.col.s-interview, .col.s-offer { border-top-color: #c9bb00; }
.col.s-hired { border-top-color: var(--green); }
.col.s-declined { border-top-color: var(--red); }
.b-applied { background: var(--navy-soft); color: var(--navy); }
.b-screen { background: #e6f2ff; color: #0b5cad; }
.b-interview, .b-offer { background: #fff7c2; color: #6b5d00; }
.b-hired, .b-r-yes { background: #e3f5ea; color: var(--green); }
.b-declined, .b-r-no { background: #fde8e4; color: var(--red); }
.b-r-maybe { background: #fff0e0; color: #9a4a00; }
.stars { color: #b39b00; letter-spacing: .05em; }
.scorecard { border-bottom: 1px solid var(--line); padding-bottom: .6rem; margin-bottom: .6rem; }
.score-row { flex-direction: row; justify-content: space-between; align-items: center; gap: .75rem; font-weight: 500; }
.score-row select { width: 9rem; flex: none; }
.k-interview { background: #f1e8fb; border-color: #7b4bb3; }
.dot.k-interview { background: #7b4bb3; }
.b-interview { background: #f1e8fb; color: #5b2f91; }

/* Public careers page */
.careers h1 { margin-bottom: .75rem; }
.job-text { line-height: 1.6; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; margin-bottom: .5rem; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; background: #eef1f6; }
.photo-grid figcaption { font-size: .82rem; margin-top: .2rem; }

/* Estimates and warranty */
.estimate-add { display: grid; grid-template-columns: 1fr 5rem 7rem auto; gap: .5rem; align-items: end; margin-top: .75rem; }
.warranty { border-radius: var(--radius); padding: .5rem .9rem; font-weight: 600; display: inline-block; }
.warranty.ok, .warranty-inline.ok { color: var(--green); }
.warranty.ok { background: #eef8f2; border: 1px solid #a9d8bc; }
.warranty.over { background: #f4f5f8; border: 1px solid var(--line); color: var(--muted); }
.warranty-inline.over { color: var(--muted); }
.estimate-page { max-width: 820px; }
.estimate-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; border-bottom: 3px solid var(--yellow); padding-bottom: .8rem; margin-bottom: 1rem; }
.estimate-logo { height: 54px; width: auto; background: var(--navy); padding: 6px 10px; border-radius: 6px; }
.estimate-co { text-align: right; font-size: .9rem; }
.estimate-table { margin: 1.2rem 0; }
.estimate-table tfoot th { font-size: 1.05rem; color: var(--ink); border-top: 2px solid var(--line); }
.sign-row { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; margin-top: 2.5rem; font-size: .9rem; }
.sign-line { display: block; border-bottom: 1px solid var(--ink); height: 2.2rem; }

/* Tasks */
.tasks-cols { grid-template-columns: 3fr 2fr; }
.task { display: flex; gap: .6rem; align-items: flex-start; }
.task-body { flex: 1; min-width: 0; }
.task.done .task-body strong { text-decoration: line-through; color: var(--muted); }
.tick { width: 1.6rem; height: 1.6rem; padding: 0; border-radius: 6px; background: #fff; border: 2px solid var(--navy); color: var(--green); font-weight: 800; line-height: 1; flex: none; }
.tick:hover { background: var(--navy-soft); }
.task.done .tick { border-color: var(--green); }

@media (max-width: 900px) {
  .tasks-cols { grid-template-columns: 1fr; }
  .estimate-add { grid-template-columns: 1fr 1fr; }
  .estimate-add label:first-child { grid-column: 1 / -1; }
  .score-row { flex-direction: column; align-items: stretch; }
  .score-row select { width: 100%; }
  .copy-row { flex-wrap: wrap; }
}

/* Printing (estimates): just the page, no menus. */
@media print {
  .top, .side, .no-print, .notice { display: none !important; }
  .page { padding: 0; }
  .panel { background: #fff; padding: 0; border-radius: 0; min-height: 0; }
  body, .card { background: #fff; box-shadow: none; }
  .estimate-sheet { border: 0; padding: 0; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .estimate-logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Show-password eye button (added by app.js) */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 2.9rem; }
.pw-eye { position: absolute; top: 50%; right: .3rem; transform: translateY(-50%); background: transparent; border: 0; color: var(--muted); padding: .35rem; border-radius: 6px; line-height: 0; }
.pw-eye:hover { background: var(--navy-soft); color: var(--navy); }
.pw-eye[aria-pressed="true"] { color: var(--navy); }

/* ===== Design refresh v1.3: rounded cards and pills everywhere ===== */
.list li { border-bottom-color: var(--line); padding: .65rem 0; }
.table th { border-bottom: 1px solid var(--line); font-size: .74rem; }
.table td { border-bottom-color: var(--line); }
.table tr:last-child td { border-bottom: 0; }
.tabs { gap: .35rem; }
.tabs a { padding: .45rem .95rem; color: var(--muted); background: transparent; border: 1px solid #d6dde9; }
.tabs a:hover { background: #fff; color: var(--navy); }
.tabs a[aria-current="page"] { background: #fff; color: var(--navy-deep); border-color: #fff; box-shadow: var(--shadow); }
.badge { padding: .18rem .65rem; font-weight: 650; }
.board { gap: .9rem; }
.col { background: rgba(255, 255, 255, .55); border-radius: var(--radius); border-top: 0; box-shadow: inset 0 4px 0 var(--navy); padding: .9rem .75rem; }
.col.s-won, .col.s-hired { box-shadow: inset 0 4px 0 var(--green); }
.col.s-lost, .col.s-declined { box-shadow: inset 0 4px 0 var(--red); }
.col.s-estimate_set, .col.s-quoted, .col.s-interview, .col.s-offer { box-shadow: inset 0 4px 0 #d8c900; }
.col.s-screen { box-shadow: inset 0 4px 0 #3a86d1; }
.lead-card { border: 0; border-radius: 16px; padding: .75rem .8rem; box-shadow: 0 1px 2px rgba(12, 37, 87, .06), 0 4px 12px rgba(12, 37, 87, .05); }
.month { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.month-head span { background: var(--navy-deep); }
.ev { border-radius: 8px; }
.bubble { border-radius: 18px; }
.msg.me .bubble { background: var(--navy); }
.msg-people a { border-radius: 12px; }
.setup-key, .preview { border-radius: var(--radius-sm); }
.photo-grid img { border-radius: 14px; border: 0; }
.warranty { border-radius: 999px; padding: .45rem 1rem; }
.tick { border-radius: 8px; }
.bar { border-radius: 999px; }
.fill { border-radius: 999px; }
.copy-row input { border-radius: 999px; }
.pw-wrap input { padding-right: 2.9rem; }
.estimate-sheet { border-radius: var(--radius); }
.stat span { padding-right: 1.5rem; }
.bare .notice { max-width: 580px; margin: 0 auto 1rem; }

/* ===== Folder look v1.4: a folder tab on the upper left holds the badge circle and the section name;
   the pill tabs sit beside it on the navy, and the folder's S-curve slopes down into the panel. ===== */
.shell { display: block; }
.page, .bare .page, .page:only-child { padding: .35rem 1.4rem 1.4rem; }
.folder-row { display: flex; align-items: stretch; height: 86px; }
.folder-tab { display: flex; align-items: center; gap: .95rem; background: var(--panel); border-radius: 30px 0 0 0; padding: 0 .35rem 0 1.1rem; flex: none; }
.folder-badge { width: 54px; height: 54px; border-radius: 50%; background: #fff; color: var(--navy-deep); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.25rem; text-decoration: none; box-shadow: 0 2px 10px rgba(12, 37, 87, .12); flex: none; }
.folder-badge:hover { box-shadow: 0 0 0 3px var(--yellow), 0 2px 10px rgba(12, 37, 87, .12); }
.folder-title { font-size: 2rem; font-weight: 500; letter-spacing: -.02em; color: var(--navy-deep); white-space: nowrap; }
.folder-curve { display: block; width: 96px; height: 100%; flex: none; fill: var(--panel); margin-left: -1px; }
.folder-row .main-tabs { margin: 0 0 0 .4rem; align-self: center; flex: 1; min-width: 0; padding: .35rem .2rem .35rem 0; }
.panel { border-radius: 0 30px 30px 30px; min-height: calc(100vh - 12rem); padding-top: 1.4rem; }
.bare .folder-row { height: 70px; }
.view-note { color: var(--muted); margin: 0 0 1rem; font-size: .88rem; }

/* The pages inside a section, as small pills at the top of the folder. */
.sub-tabs { display: flex; gap: .45rem; flex-wrap: wrap; margin: 0 0 1.4rem; }
.sub-tabs a { padding: .5rem 1.05rem; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .88rem; color: var(--muted); background: rgba(18, 54, 123, .06); }
.sub-tabs a:hover { background: #fff; color: var(--navy); }
.sub-tabs a[aria-current="page"] { background: #fff; color: var(--navy-deep); box-shadow: var(--shadow); }

@media (max-width: 900px) {
  .page, .bare .page, .page:only-child { padding: .25rem .5rem .5rem; }
  .folder-row { flex-wrap: wrap; height: auto; }
  .folder-row .main-tabs { order: -1; flex: 0 0 calc(100% + 1rem); margin: 0 -.5rem .7rem; padding: 0 .5rem; }
  .folder-tab { height: 66px; padding-left: .8rem; gap: .7rem; border-radius: 24px 0 0 0; }
  .folder-curve { height: 66px; width: 70px; }
  .folder-badge { width: 44px; height: 44px; font-size: 1.05rem; }
  .folder-title { font-size: 1.45rem; }
  .panel { border-radius: 0 24px 24px 24px; }
  .bare .folder-row { height: auto; }
}

/* ===== v1.4: side menu (sections) beside the folder; no pill tabs ===== */
.shell { display: flex; align-items: flex-start; }
.has-menu .page { padding-left: 0; }
.bare .page { padding-left: 1.4rem; }
.side { padding-top: 1.9rem; }
.side a { padding: .62rem .85rem; font-size: .95rem; gap: .7rem; }
.side .count { margin-left: auto; }
@media (max-width: 900px) {
  .has-menu .page { padding-left: .5rem; }
  .side { padding-top: 1.2rem; }
}

/* ===== v1.5: folder tab size in one place. --tab-h is the tab's height; the circle, title and curve follow it. ===== */
:root { --tab-h: 22px; }
.folder-row, .bare .folder-row { height: var(--tab-h); }
.folder-tab { height: var(--tab-h); border-radius: 12px 0 0 0; gap: .4rem; padding: 0 .2rem 0 .6rem; }
.folder-badge { width: calc(var(--tab-h) - 4px); height: calc(var(--tab-h) - 4px); font-size: calc(var(--tab-h) * .45); box-shadow: 0 1px 3px rgba(12, 37, 87, .15); }
.folder-title { font-size: calc(var(--tab-h) * .62); font-weight: 600; letter-spacing: 0; }
.folder-curve { height: var(--tab-h); width: calc(var(--tab-h) * 1.6); }
@media (max-width: 900px) {
  .folder-row, .bare .folder-row { height: var(--tab-h); }
  .folder-tab { height: var(--tab-h); border-radius: 12px 0 0 0; padding-left: .6rem; gap: .4rem; }
  .folder-curve { height: var(--tab-h); width: calc(var(--tab-h) * 1.6); }
  .folder-badge { width: calc(var(--tab-h) - 4px); height: calc(var(--tab-h) - 4px); font-size: calc(var(--tab-h) * .45); }
  .folder-title { font-size: calc(var(--tab-h) * .62); }
}

/* ===== v1.5: View menu, a flat yellow pill that opens a card below (no browser-drawn menu) ===== */
.view-menu { position: relative; }
.view-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; user-select: none;
  background: var(--yellow); color: var(--navy-deep); border-radius: 999px; padding: .5rem .8rem .5rem 1rem; font-weight: 700; font-size: .92rem; line-height: 1; }
.view-menu > summary::-webkit-details-marker { display: none; }
.view-menu > summary:hover { background: #f7f06a; }
.view-menu > summary:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.view-label { font-weight: 600; opacity: .62; }
.view-menu .chev { transition: transform .15s; }
.view-menu[open] > summary .chev { transform: rotate(180deg); }

.view-pop { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: 300px; background: #f2f4f8; border-radius: 24px; padding: 6px;
  box-shadow: 0 2px 6px rgba(12, 37, 87, .08), 0 18px 44px rgba(12, 37, 87, .28); color: var(--ink); }
.view-pop-head { display: flex; align-items: center; gap: .6rem; margin: 0; padding: .75rem .9rem .8rem; font-weight: 650; font-size: .95rem; color: var(--ink); }
.view-pop-head .chev { color: var(--muted); }
.view-count { margin-left: auto; font-weight: 600; font-size: .85rem; color: var(--muted); }
.view-list { background: #fff; border-radius: 19px; padding: .45rem; box-shadow: 0 1px 2px rgba(12, 37, 87, .06); display: flex; flex-direction: column; }
.view-opt { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 14px;
  color: var(--ink); padding: .55rem .6rem; font-weight: 500; justify-content: flex-start; }
.view-opt:hover { background: var(--panel); color: var(--ink); }
.view-text { display: flex; flex-direction: column; flex: 1; font-size: .95rem; line-height: 1.2; }
.view-text small { color: var(--muted); font-size: .78rem; font-weight: 400; margin-top: 2px; }
.view-dot { width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: var(--muted); background: #f2f4f8; box-shadow: inset 0 0 0 1px #e2e6ee; }
.view-opt.on .view-dot { background: var(--yellow); color: var(--navy-deep); box-shadow: 0 0 0 3px var(--yellow-soft); }
.view-opt.on .view-text { color: var(--muted); }
.view-opt .go { color: #b3bac8; flex: none; }
.view-opt.on .go { visibility: hidden; }
@media (max-width: 900px) {
  .view-pop { right: auto; left: 0; width: min(300px, calc(100vw - 1.5rem)); }
}

/* ===== v1.5: section pills sit on the navy, right of the folder notch, the same height as the tab ===== */
.folder-row .sub-tabs { display: flex; align-items: flex-end; gap: .35rem; margin: 0 0 0 .3rem; flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.folder-row .sub-tabs::-webkit-scrollbar { display: none; }
.folder-row .sub-tabs a { height: var(--tab-h); line-height: var(--tab-h); padding: 0 .8rem; font-size: calc(var(--tab-h) * .55); white-space: nowrap;
  color: #c9d4ea; background: rgba(255, 255, 255, .09); box-shadow: none; }
.folder-row .sub-tabs a:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.folder-row .sub-tabs a[aria-current="page"] { background: #fff; color: var(--navy-deep); box-shadow: none; }

/* ===== v1.6: roomier folder tab. --tab-h is the tab height; --pill-h the section pills beside it. ===== */
:root { --tab-h: 36px; --pill-h: 26px; }
.folder-tab, .folder-tab { gap: .6rem; padding: 0 .9rem 0 .7rem; border-radius: 16px 0 0 0; }
.folder-badge { width: 28px; height: 28px; font-size: 13px; }
.folder-title { font-size: 17px; font-weight: 600; letter-spacing: -.005em; }
.folder-curve { width: 56px; }
.folder-row .sub-tabs { align-items: center; padding-bottom: 8px; padding-top: 2px; margin-left: .5rem; gap: .4rem; }
.folder-row .sub-tabs a { height: var(--pill-h); line-height: var(--pill-h); font-size: 13px; padding: 0 .95rem; }
@media (max-width: 900px) {
  .folder-tab { gap: .55rem; padding: 0 .8rem 0 .6rem; border-radius: 16px 0 0 0; }
  .folder-badge { width: 28px; height: 28px; font-size: 13px; }
  .folder-title { font-size: 16px; }
  .folder-curve { width: 52px; }
}

/* v1.6 tuning: 30px tab */
:root { --tab-h: 30px; --pill-h: 22px; }
.folder-badge { width: 24px; height: 24px; font-size: 12px; }
.folder-title { font-size: 16px; }
.folder-curve { width: 48px; }
.folder-row .sub-tabs { padding-bottom: 6px; padding-top: 2px; }
.folder-row .sub-tabs a { font-size: 12.5px; padding: 0 .85rem; }
@media (max-width: 900px) {
  .folder-badge { width: 24px; height: 24px; font-size: 12px; }
  .folder-title { font-size: 15px; }
  .folder-curve { width: 46px; }
}

/* v1.7: badge and title sit visually centered (the tab's bottom blends into the panel), and the tab is a little longer */
.folder-tab { padding: 0 1.5rem 0 .95rem; }
.folder-badge, .folder-title { transform: translateY(3px); }
@media (max-width: 900px) { .folder-tab { padding: 0 1.2rem 0 .8rem; } }

/* ===== v1.7: dropdowns, a flat field that opens a rounded card (same look as the View menu) ===== */
.dd { position: relative; display: block; }
.dd.dd-inline { display: inline-block; }
.dd-native { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; left: 1rem; bottom: 0; }
.dd-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .6rem; text-align: left;
  background: #fff; color: var(--ink); border: 1px solid #d3dae7; border-radius: 12px; padding: .6rem .75rem; font-weight: 500; }
.dd-btn:hover { background: #fff; border-color: #b9c3d6; }
.dd-btn[aria-expanded="true"] { border-color: var(--navy); }
.dd-btn svg { color: var(--muted); flex: none; transition: transform .15s; }
.dd-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.dd-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dd-btn.dd-empty .dd-text { color: var(--muted); }
.dd-btn.dd-invalid { border-color: var(--red); }
.dd-inline .dd-btn { width: auto; }
.lead-card .dd-btn { padding: .32rem .55rem; font-size: .8rem; border-radius: 10px; }

.dd-pop { position: fixed; z-index: 80; background: #f2f4f8; border-radius: 22px; padding: 5px;
  box-shadow: 0 2px 6px rgba(12, 37, 87, .08), 0 18px 44px rgba(12, 37, 87, .26); }
.dd-head { margin: 0; padding: .6rem .85rem .55rem; font-weight: 650; font-size: .85rem; color: var(--ink); }
.dd-list { background: #fff; border-radius: 18px; padding: .35rem; max-height: 320px; overflow-y: auto; box-shadow: 0 1px 2px rgba(12, 37, 87, .06); }
.dd-opt { display: flex; align-items: center; gap: .7rem; padding: .5rem .55rem; border-radius: 12px; cursor: pointer; font-size: .92rem; color: var(--ink); }
.dd-opt:hover, .dd-opt:focus { background: var(--panel); outline: none; }
.dd-opt:focus-visible { box-shadow: inset 0 0 0 2px var(--yellow); }
.dd-dot { width: 22px; height: 22px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: #f2f4f8; box-shadow: inset 0 0 0 1px #e2e6ee; }
.dd-opt.on .dd-dot { background: var(--yellow); color: var(--navy-deep); box-shadow: 0 0 0 3px var(--yellow-soft); }
.dd-opt.on { font-weight: 600; }
.dd-opt.dd-blank { color: var(--muted); }
.dd-opt.dd-off { opacity: .45; cursor: default; }

/* v1.7: logo another 25% larger (55 → 69px; login page 70 → 88px). On phones it shrinks to fit beside the menu button. */
.logo { min-width: 0; flex: 0 1 auto; }
.logo img { height: 69px; max-width: 100%; }
.bare .logo img { height: 88px; }
@media (max-width: 900px) {
  .logo img, .bare .logo img { height: auto; width: min(367px, calc(100vw - 4.5rem)); }
}
@media (max-width: 900px) {
  .logo img { height: 43px; width: auto; max-width: calc(100vw - 6rem); }
  .bare .logo img { height: auto; width: min(367px, calc(100vw - 2rem)); }
}

/* ===== v1.8: customer portal, job tools, money, inventory, hiring extras ===== */
.my-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .88rem; color: var(--muted); margin-bottom: 1rem; }
.care { margin: 0; padding-left: 1.2rem; }
.care li { margin-bottom: .45rem; }
.signed { background: #eef8f2; color: var(--green); border-radius: var(--radius-sm); padding: .7rem 1rem; }
.send-estimate { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.estimate-add.with-book { grid-template-columns: 1.4fr 1.4fr 4.5rem 6.5rem auto; }
.progress { height: 8px; background: var(--panel); border-radius: 999px; overflow: hidden; margin: .2rem 0 .6rem; }
.progress span { display: block; height: 100%; width: 2%; background: var(--green); border-radius: 999px; }
.check-list li { display: flex; gap: .6rem; align-items: flex-start; }
.check-list li.done > span { color: var(--muted); text-decoration: line-through; }
.material-add { display: grid; grid-template-columns: 1fr 6rem auto; gap: .5rem; align-items: end; margin-top: .6rem; }
.costing td { padding: .45rem 0; }
.costing tr.total td { border-top: 2px solid var(--line); }
.neg { color: var(--red); }
.price-row { display: grid; grid-template-columns: 1fr 7rem 7rem auto auto; gap: .5rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.price-row:last-child { border-bottom: 0; }
.inventory td { vertical-align: middle; }
.inv-row { display: grid; grid-template-columns: 1.6fr .7fr .6fr .6fr .7fr .6fr auto; gap: .5rem; align-items: center; }
.inventory tr.low .inv-row input[name="on_hand"] { border-color: var(--red); color: var(--red); font-weight: 700; }
.inventory input.num { text-align: right; }
.qty { width: 5rem !important; }
.slot-pick h2 { margin-top: 1rem; }
.slot-pick h2:first-of-type { margin-top: 0; }
.slot { margin: 0 .4rem .5rem 0; }
.slot small { font-weight: 400; color: var(--muted); }
.stars { border: 0; padding: 0; margin: 0; display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: .2rem; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 2rem; color: #cfd5e1; cursor: pointer; line-height: 1; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #e0c400; }
.stars input:focus-visible + label { outline: 3px solid var(--yellow); border-radius: 4px; }
.cert-eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--muted); margin: .5rem 0 .2rem; }
.cert-facts { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 2rem; margin: 1.4rem 0; }
.cert-facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cert-facts dd { margin: .15rem 0 0; font-size: 1.02rem; }
@media (max-width: 900px) {
  .estimate-add.with-book { grid-template-columns: 1fr 1fr; }
  .estimate-add.with-book label:first-of-type, .estimate-add.with-book label:nth-of-type(2) { grid-column: 1 / -1; }
  .price-row { grid-template-columns: 1fr 1fr; }
  .price-row input:first-of-type { grid-column: 1 / -1; }
  .inv-row { grid-template-columns: 1fr 1fr; }
  .cert-facts { grid-template-columns: 1fr; }
}

/* ===== v1.9: dark mode. The <html> element gets data-theme="dark" when the person chose Dark,
   or chose Auto (the default) and their device is set to dark (public/assets/theme.js). ===== */
[data-theme="dark"] {
  color-scheme: dark;
  --frame: #060d20;
  --panel: #0e1730;
  --card: #172240;
  --ink: #e6ebf6;
  --muted: #9eabc6;
  --line: #29365a;
  --navy-soft: #1f2d52;
  --yellow-soft: #3b380f;
  --field: #0e1730;
  --field-line: #34436c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .3);
  background: var(--frame);
}
[data-theme="dark"] body { background: var(--frame); color: var(--ink); }
[data-theme="dark"] a { color: #9cb8ff; }
[data-theme="dark"] :is(h1, h2, h3, label, .folder-title, .stat strong, .view-pop-head, .dd-head, .cert-facts dd) { color: #eef2ff; }
[data-theme="dark"] label small, [data-theme="dark"] .muted { color: var(--muted); }
[data-theme="dark"] :is(input, select, textarea) { background: var(--field); border-color: var(--field-line); color: var(--ink); }
[data-theme="dark"] .top-search input, [data-theme="dark"] .top-search input:focus { background: transparent; }
[data-theme="dark"] :is(button.ghost, .btn.ghost) { background: transparent; color: #c9d6f5; border-color: var(--field-line); }
[data-theme="dark"] :is(button.ghost, .btn.ghost):hover { background: var(--navy-soft); }
[data-theme="dark"] button.danger { background: transparent; color: #ff8b7a; border-color: #6b2b24; }
[data-theme="dark"] .link-btn { color: #9cb8ff; }
[data-theme="dark"] .link-btn.danger { color: #ff8b7a; }
[data-theme="dark"] button:not(.ghost):not(.danger):not(.link-btn):not(.dd-btn):not(.view-opt):not(.tick):not(.round-btn):not(.pw-eye):not(.menu-toggle):not(.slot):not(.ts) { background: #2c57c4; border-color: #2c57c4; }
[data-theme="dark"] .btn:not(.ghost) { background: #2c57c4; border-color: #2c57c4; color: #fff; }

/* Menus, pills and tabs */
[data-theme="dark"] .side a { color: #b7c4e0; }
[data-theme="dark"] .side a[aria-current="page"] { background: var(--card); color: #fff; }
[data-theme="dark"] .side a[aria-current="page"] .ico { color: var(--yellow); }
[data-theme="dark"] .folder-badge { background: var(--card); color: #fff; box-shadow: 0 0 0 1px var(--line); }
[data-theme="dark"] .folder-row .sub-tabs a[aria-current="page"] { background: var(--card); color: #fff; }
[data-theme="dark"] .tabs a { border-color: var(--line); }
[data-theme="dark"] .tabs a:hover, [data-theme="dark"] .tabs a[aria-current="page"] { background: var(--card); color: #fff; border-color: var(--card); }
[data-theme="dark"] .sub-tabs a { background: rgba(255, 255, 255, .06); }
[data-theme="dark"] .sub-tabs a:hover, [data-theme="dark"] .sub-tabs a[aria-current="page"] { background: var(--card); color: #fff; }
[data-theme="dark"] :is(.dd-pop, .view-pop) { background: #0a1228; box-shadow: 0 0 0 1px var(--line), 0 18px 44px rgba(0, 0, 0, .55); }
[data-theme="dark"] :is(.dd-list, .view-list) { background: var(--card); }
[data-theme="dark"] :is(.dd-opt, .view-opt) { color: var(--ink); }
[data-theme="dark"] :is(.dd-opt:hover, .dd-opt:focus, .view-opt:hover) { background: var(--navy-soft); }
[data-theme="dark"] :is(.dd-dot, .view-dot) { background: var(--field); box-shadow: inset 0 0 0 1px var(--field-line); }
[data-theme="dark"] .dd-btn { background: var(--field); border-color: var(--field-line); color: var(--ink); }

/* Badges and notices: tinted, not pastel */
[data-theme="dark"] .badge { background: #26324f; color: #b8c3da; }
[data-theme="dark"] :is(.b-new, .b-estimate, .b-scheduled, .b-quoted, .b-applied) { background: rgba(111, 155, 255, .16); color: #a9c2ff; }
[data-theme="dark"] :is(.b-contacted, .b-talked, .b-on_way, .b-follow_up, .b-screen) { background: rgba(58, 134, 209, .22); color: #8cc8ff; }
[data-theme="dark"] :is(.b-estimate_set, .b-in_progress, .b-booked, .b-job, .b-offer) { background: rgba(243, 234, 29, .14); color: #f3ea1d; }
[data-theme="dark"] :is(.b-won, .b-done, .b-complete, .b-hired, .b-r-yes) { background: rgba(46, 160, 100, .2); color: #74d9a2; }
[data-theme="dark"] :is(.b-lost, .b-canceled, .b-not_interested, .b-declined, .b-r-no) { background: rgba(255, 42, 19, .18); color: #ff8b7a; }
[data-theme="dark"] :is(.b-callback, .b-voicemail, .b-no_answer, .b-on_hold, .b-r-maybe) { background: rgba(255, 153, 51, .18); color: #ffb873; }
[data-theme="dark"] .b-interview { background: rgba(123, 75, 179, .28); color: #d3b2ff; }
[data-theme="dark"] .notice { background: rgba(255, 42, 19, .12); color: #ffb3a7; }
[data-theme="dark"] .notice.ok, [data-theme="dark"] .signed { background: rgba(46, 160, 100, .15); color: #8fe0b2; }
[data-theme="dark"] .warranty.ok { background: rgba(46, 160, 100, .15); border-color: transparent; color: #8fe0b2; }
[data-theme="dark"] .warranty.over { background: var(--navy-soft); border-color: transparent; }
[data-theme="dark"] .warranty-inline.ok { color: #74d9a2; }

/* Boards, calendar, messages, bits */
[data-theme="dark"] .col { background: rgba(255, 255, 255, .035); }
[data-theme="dark"] .lead-card { background: var(--card); box-shadow: 0 0 0 1px var(--line); }
[data-theme="dark"] .month-head span { background: #0a1d45; }
[data-theme="dark"] .day { border-color: var(--line); }
[data-theme="dark"] .day.other { background: #0b1329; }
[data-theme="dark"] .day.today { background: rgba(243, 234, 29, .07); }
[data-theme="dark"] .day-num a { color: var(--ink); }
[data-theme="dark"] .ev { color: var(--ink); }
[data-theme="dark"] .k-estimate { background: rgba(111, 155, 255, .16); }
[data-theme="dark"] .k-job { background: rgba(243, 234, 29, .12); }
[data-theme="dark"] .k-follow_up { background: rgba(58, 134, 209, .2); }
[data-theme="dark"] .k-other { background: rgba(139, 147, 165, .18); }
[data-theme="dark"] .k-interview { background: rgba(123, 75, 179, .25); }
[data-theme="dark"] .bubble { background: #22304f; color: var(--ink); }
[data-theme="dark"] .msg.me .bubble { background: #2c57c4; color: #fff; }
[data-theme="dark"] :is(.progress, .bar) { background: var(--field); }
[data-theme="dark"] .fill { background: #6f9bff; }
[data-theme="dark"] .tick { background: transparent; border-color: #6f9bff; }
[data-theme="dark"] .photo-grid img { background: var(--field); }
[data-theme="dark"] .setup-key { background: var(--navy-soft); border-color: #6f9bff; color: var(--ink); }
[data-theme="dark"] .stars label { color: #3a466a; }
[data-theme="dark"] .stat::after { box-shadow: 0 0 0 5px rgba(243, 234, 29, .15); }
[data-theme="dark"] .neg { color: #ff8b7a; }
[data-theme="dark"] .inventory tr.low .inv-row input[name="on_hand"] { border-color: #ff8b7a; color: #ff8b7a; }
[data-theme="dark"] .pw-eye { color: var(--muted); }
[data-theme="dark"] .pw-eye:hover { background: var(--navy-soft); color: #fff; }

/* Estimates and warranty certificates stay white like paper, so they print and save as PDF the same. */
[data-theme="dark"] .estimate-sheet {
  --card: #fff; --ink: #1b2233; --muted: #5d667a; --line: #dde3ee; --panel: #f3f5f9;
  background: #fff; color: #1b2233; box-shadow: none;
}
[data-theme="dark"] .estimate-sheet :is(h1, h2, h3, .cert-facts dd) { color: var(--navy-deep); }
[data-theme="dark"] .estimate-sheet a { color: var(--navy); }
[data-theme="dark"] .estimate-sheet .signed { background: #eef8f2; color: var(--green); }

/* ===== v1.9: side menu foot: Settings, the Light / Dark / Auto switch and the portal version ===== */
.side { display: flex; flex-direction: column; min-height: calc(100vh - 7.5rem); }
.side-foot { margin-top: auto; padding-top: 1.25rem; }
.theme-switch { display: flex; gap: 2px; margin: .5rem .3rem 0; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .07); }
.theme-switch button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; padding: .32rem .2rem; border: 0; border-radius: 999px;
  background: transparent; color: #b7c4e0; font-size: .78rem; font-weight: 600; }
.theme-switch button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.theme-switch button[aria-pressed="true"] { background: #fff; color: var(--navy-deep); }
[data-theme="dark"] .theme-switch button[aria-pressed="true"] { background: var(--card); color: #fff; }
.side-version { margin: .7rem .8rem 0; font-size: .74rem; color: #7f90b5; }
@media (max-width: 900px) { .side { min-height: 0; } }
[data-theme="dark"] .theme-switch button { background: transparent; border-color: transparent; color: #b7c4e0; }
[data-theme="dark"] .theme-switch button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
[data-theme="dark"] .theme-switch button[aria-pressed="true"] { background: var(--card); color: #fff; }

/* v1.9: the side menu is only as wide as its longest item (it was a fixed 224px). Phones keep the slide-out width. */
@media (min-width: 901px) {
  .side { width: max-content; padding-right: .7rem; }
  .side a { padding-right: 1.1rem; }
  .theme-switch button { padding-left: .55rem; padding-right: .55rem; }
}

/* ===== v1.10: Permissions page switches ===== */
.switch { position: relative; display: inline-block; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #cdd5e3; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }
[data-theme="dark"] .switch span { background: #34436c; }
.perm-grid td { vertical-align: middle; }
.perm-grid td.num, .perm-grid th.num { text-align: center; width: 7.5rem; }
.switch-row { flex-direction: row; justify-content: space-between; align-items: center; gap: 1rem; font-weight: 500; }
.perm-list li { padding: .55rem 0; }

/* ===== v1.11: My details form, orders ===== */
.req { color: var(--red); font-weight: 700; }
[data-theme="dark"] .req { color: #ff8b7a; }
.details-form h2 { margin: .6rem 0 0; font-size: 1rem; }
.details-form h2:first-of-type { margin-top: 0; }
.addr-row { grid-template-columns: 2fr 1fr 1fr; }
.choice { border: 0; padding: 0; margin: 0; }
.choice legend { font-weight: 600; font-size: .88rem; margin-bottom: .4rem; color: var(--navy-deep); }
[data-theme="dark"] .choice legend { color: #eef2ff; }
.choice-pill { display: inline-flex; flex-direction: row; margin-right: .5rem; }
.choice-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-pill span { padding: .5rem 1.2rem; border-radius: 999px; border: 1px solid #d3dae7; cursor: pointer; font-weight: 600; }
.choice-pill input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.choice-pill input:focus-visible + span { outline: 3px solid var(--yellow); }
[data-theme="dark"] .choice-pill span { border-color: var(--field-line); }
[data-theme="dark"] .choice-pill input:checked + span { background: #2c57c4; border-color: #2c57c4; }
.order-add { grid-template-columns: 1fr 5rem 6rem auto; }
.details-nudge a { font-weight: 700; }
@media (max-width: 900px) { .addr-row { grid-template-columns: 1fr 1fr; } .addr-row label:first-child { grid-column: 1 / -1; } .order-add { grid-template-columns: 1fr 1fr; } }
.hub-search { margin: .25rem 0 0; max-width: 720px; }

/* v1.12: My details at login: a welcome, and kind messages under the fields that need attention */
.gate-welcome { background: var(--card); border-radius: var(--radius); padding: 1.3rem 1.5rem; margin-bottom: 1rem; box-shadow: inset 5px 0 0 var(--yellow), var(--shadow); }
.gate-welcome h1 { font-size: 1.5rem; }
.gate-welcome p { margin: 0; color: var(--muted); }
.notice.kind { background: #fff8e1; color: #6b4e00; box-shadow: inset 4px 0 0 #e0b400; }
[data-theme="dark"] .notice.kind { background: rgba(243, 234, 29, .1); color: #f3e98a; }
.field-error { display: block; font-weight: 500; font-size: .84rem; color: #a3430b; margin-top: .1rem; }
.field-error::before { content: "→ "; }
[data-theme="dark"] .field-error { color: #ffb873; }
[aria-invalid="true"] { border-color: #e0a040 !important; background: #fffaf0; }
[data-theme="dark"] [aria-invalid="true"] { background: rgba(255, 153, 51, .08); }
.choice .field-error { margin-top: .5rem; }

/* v1.12: sales tools */
.score { letter-spacing: -.05em; font-size: .7rem; color: #c3cada; white-space: nowrap; vertical-align: middle; }
.score.s4, .score.s5 { color: #d6260f; } .score.s3 { color: #d8a300; } .score.s1, .score.s2 { color: #8b93a5; }
.lead-glance { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; background: var(--card); border-radius: var(--radius-sm); padding: .65rem 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.next-step.urgent { color: #9a4a00; }
[data-theme="dark"] .next-step.urgent { color: #ffb873; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: .7rem; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.timeline li:last-child { border-bottom: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: #8b93a5; margin-top: .4rem; flex: none; }
.tl-call .tl-dot { background: #3a86d1; } .tl-email .tl-dot { background: #7b4bb3; } .tl-visit .tl-dot { background: #d8c900; }
.tl-money .tl-dot, .tl-done .tl-dot { background: var(--green); } .tl-estimate .tl-dot { background: var(--navy); } .tl-feedback .tl-dot { background: #e0a040; }
.team-row { display: grid; grid-template-columns: 9rem 8rem 1fr auto; gap: .6rem; align-items: end; }
.progress.goal span { background: var(--navy); }
.section-title { margin: 1.6rem 0 .3rem; }
.lost-bars .bar-row { grid-template-columns: 200px 1fr 60px; }
@media (max-width: 900px) { .team-row { grid-template-columns: 1fr 1fr; } .team-row label:nth-child(3) { grid-column: 1 / -1; } }

/* Admin invites, per-person access and the quick add on Customers */
.access-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .35rem 1.25rem; border: 0; padding: 0; margin: 0; }
.access-pick legend { margin-bottom: .5rem; font-weight: 600; }
.small-row { font-size: .9rem; font-weight: 400; padding: .3rem 0; border-bottom: 1px solid var(--line, #e3e8f0); }
.access-edit.follows .access-pick { opacity: .55; }
.quick-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: .75rem; align-items: end; }
.check-line { display: flex; flex-direction: row; justify-content: flex-start; gap: .5rem; align-items: center; margin-top: .75rem; font-weight: 400; }
.check-line input { width: auto; margin: 0; }
@media (max-width: 800px) { .quick-row { grid-template-columns: 1fr 1fr; } .quick-row button { grid-column: 1 / -1; } }

/* v1.13: side menu blocks and grouped access switches */
.side-sep { border: 0; border-top: 1px solid rgba(255, 255, 255, .14); margin: .55rem .75rem; }
.side-foot > a + a, .side-foot > a { margin-bottom: 1px; }
.perm-grid .perm-group th { text-align: left; padding-top: 1rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #6b7a99); }
.access-group { grid-column: 1 / -1; margin: .75rem 0 .1rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #6b7a99); }

/* ===== v1.13: Home welcome card, the navy clock/calendar/timer card, and the calendar's new look ===== */
.welcome-row { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 1.25rem; margin-bottom: 1.5rem; align-items: stretch; }
.welcome-card { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); padding: 2.4rem 2.6rem; display: flex; flex-direction: column; }
.welcome-date { color: var(--muted); font-size: 1.05rem; margin-bottom: .9rem; }
.welcome-hi { font-size: clamp(2.6rem, 5.2vw, 4.6rem); font-weight: 700; line-height: 1.02; letter-spacing: -.035em; color: var(--navy-deep); margin: 0 0 1.5rem; }
.welcome-quote { margin: 0 0 2rem; max-width: 30rem; }
.welcome-quote p { font-size: 1.25rem; line-height: 1.4; color: var(--ink); margin: 0 0 .5rem; }
.welcome-quote footer { color: var(--muted); }
.welcome-pills { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: auto; }
.pill-btn { display: inline-flex; align-items: center; gap: .5rem; border-radius: 999px; padding: .8rem 1.6rem; font-size: 1.02rem; font-weight: 600; text-decoration: none; cursor: pointer; border: 1.5px solid transparent; line-height: 1.1; }
.pill-btn.solid { background: var(--navy); color: #fff; }
.pill-btn.solid:hover { background: var(--navy-deep); }
.pill-btn.outline { background: transparent; color: var(--navy-deep); border-color: #c9d3e6; }
.pill-btn.outline:hover { border-color: var(--navy); }
.pill-btn[aria-disabled="true"] { cursor: default; }
.pill-btn.light { background: #fff; color: var(--navy-deep); }
.pill-btn.light:hover { background: var(--yellow); }
.pill-btn.light-outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.pill-btn.light-outline:hover { border-color: #fff; }
.small-pill { padding: .5rem 1.05rem; font-size: .9rem; }

.time-card { border-radius: 28px; padding: 1.9rem 1.9rem 1.6rem; color: #fff; box-shadow: 0 18px 40px rgba(12, 37, 87, .28);
  background: radial-gradient(120% 70% at 100% 0%, rgba(86, 170, 255, .38), transparent 60%), radial-gradient(90% 60% at 0% 100%, rgba(64, 214, 214, .22), transparent 60%), linear-gradient(160deg, #163f8f, var(--navy-deep)); }
.time-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.mini-cal-title { display: flex; align-items: center; gap: .45rem; color: #fff; text-decoration: none; }
.stack-year { display: inline-block; font-weight: 800; line-height: .92; letter-spacing: -.02em; }
.mini-cal-title .stack-year { font-size: 1.05rem; }
.mini-month { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; }
.aclock { width: 88px; height: 88px; flex: none; }
.aclock-ticks line { stroke: #fff; stroke-width: 2.4; }
.aclock-h { stroke: #fff; stroke-width: 5; stroke-linecap: round; }
.aclock-m { stroke: #fff; stroke-width: 3.6; stroke-linecap: round; }
.aclock-s line { stroke: var(--yellow); stroke-width: 1.4; stroke-linecap: round; }
.aclock-s circle { fill: var(--yellow); }
.holiday { margin: .6rem 0 1rem; color: #d7e2f7; }
.holiday strong { color: #fff; font-size: 1.05rem; }
.mini-cal { display: grid; gap: 5px; }
.mini-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.mini-head span { text-align: center; font-size: .72rem; font-weight: 700; color: #b9c8e6; }
.mini-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 1.5px solid rgba(255, 255, 255, .42); border-radius: 9px; font-size: .78rem; color: #fff; text-decoration: none; font-variant-numeric: tabular-nums; }
.mini-day:hover { border-color: #fff; }
.mini-day.empty { border: 0; }
.mini-day.busy { background: rgba(120, 205, 255, .28); }
.mini-day.today { background: var(--yellow); border-color: var(--yellow); color: var(--navy-deep); font-weight: 700; }
.week-count { margin: 1rem 0 0; color: #d7e2f7; }
.week-count strong { color: #fff; font-size: 1.3rem; margin-right: .2rem; }
.timer-box { border-top: 1px solid rgba(255, 255, 255, .18); margin-top: 1.1rem; padding-top: 1.1rem; display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.timer-start { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; width: 100%; }
.timer-start select { flex: 1 1 160px; min-width: 0; background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; padding: .6rem .9rem; }
.timer-start select option { color: var(--ink); }
.timer-now { display: flex; align-items: baseline; gap: .55rem; flex-wrap: wrap; }
.timer-clock { font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.timer-clock.paused { color: #b9c8e6; }
.timer-job { color: #d7e2f7; font-size: .9rem; }
.timer-dot { width: 10px; height: 10px; border-radius: 50%; background: #48e08a; align-self: center; animation: pulse 1.6s ease-in-out infinite; }
.timer-dot.paused { background: var(--yellow); animation: none; }
.timer-btns { display: flex; gap: .5rem; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .timer-dot { animation: none; } }
@media (max-width: 980px) { .welcome-row { grid-template-columns: minmax(0, 1fr); } .welcome-card { padding: 1.8rem; } }
.welcome-card, .time-card { min-width: 0; }
@media (max-width: 420px) { .welcome-card, .time-card { padding: 1.4rem; } .time-card .mini-month { font-size: 1.7rem; } .aclock { width: 72px; height: 72px; } }

/* Calendar: a soft gradient sheet, rounded-square days, and day / week / month / year views. */
.cal-sheet { border-radius: 28px; padding: 1.8rem; box-shadow: var(--shadow);
  background: radial-gradient(60% 50% at 100% 0%, rgba(140, 220, 245, .75), transparent 70%), radial-gradient(55% 45% at 0% 70%, rgba(150, 225, 240, .6), transparent 70%), radial-gradient(40% 35% at 95% 55%, rgba(245, 238, 160, .55), transparent 70%), #f6f7f2; }
.cal-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.cal-title { display: flex; align-items: center; gap: .55rem; font-size: clamp(2.3rem, 5vw, 3.8rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; margin: 0; color: #0b1734; }
.cal-title .stack-year { font-size: .42em; }
.cal-title small { font-size: .45em; font-weight: 600; letter-spacing: -.01em; color: var(--muted); margin-left: .3rem; }
.cal-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.cal-tools select { border-radius: 999px; }
.seg { display: inline-flex; background: rgba(255, 255, 255, .7); border: 1.5px solid #0b1734; border-radius: 999px; padding: 3px; }
.seg a { padding: .42rem .95rem; border-radius: 999px; text-decoration: none; color: #0b1734; font-weight: 600; font-size: .9rem; }
.seg a[aria-current="page"] { background: var(--navy); color: #fff; }
.cal-nav { display: flex; gap: .35rem; align-items: center; }
.round-nav { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1.5px solid #0b1734; text-decoration: none; color: #0b1734; font-weight: 700; background: rgba(255, 255, 255, .55); }
.round-nav:hover { background: #fff; }
.cal-sheet .legend { margin-bottom: 1rem; }
.cal-grid { display: grid; gap: .6rem; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; }
.cal-head span { display: flex; align-items: center; justify-content: center; height: 46px; border: 1.5px solid #0b1734; border-radius: 14px; font-weight: 800; color: #0b1734; background: rgba(255, 255, 255, .35); }
.cal-day { border: 1.5px solid #0b1734; border-radius: 16px; min-height: 104px; padding: .45rem .5rem; background: rgba(255, 255, 255, .38); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.empty { border: 0; background: none; }
.cal-day.busy { background: rgba(255, 255, 255, .6); }
.cal-day.today { background: rgba(120, 218, 232, .55); }
.cal-num { font-weight: 600; color: #0b1734; text-decoration: none; align-self: center; font-size: 1.02rem; margin-bottom: 2px; }
.cal-num:hover { text-decoration: underline; }
.cal-day .ev { font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day .more { font-size: .74rem; color: var(--navy); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; }
.week-day { min-height: 340px; }
.week-head { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #0b1734; margin-bottom: .35rem; }
.week-head span { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.week-head strong { font-size: 1.5rem; line-height: 1.1; }
.week-day .ev { white-space: normal; }
.quiet { color: var(--muted); font-size: .8rem; text-align: center; margin-top: .5rem; }
.cal-dayview { background: rgba(255, 255, 255, .5); border: 1.5px solid #0b1734; border-radius: 18px; padding: .6rem 1rem; }
.quiet-day { margin: .5rem 0 .75rem; color: var(--muted); }
.hour-row { display: grid; grid-template-columns: 64px 1fr; gap: .75rem; padding: .4rem 0; border-top: 1px solid rgba(11, 23, 52, .12); min-height: 44px; }
.hour-row:first-of-type { border-top: 0; }
.hour { color: var(--muted); font-size: .82rem; font-weight: 600; padding-top: .2rem; }
.hour-evs { display: flex; flex-direction: column; gap: .35rem; }
.ev.big { font-size: .92rem; padding: .45rem .7rem; white-space: normal; }
.ev.big small { display: block; opacity: .8; }
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.4rem 1.6rem; }
.year-month-name { display: block; font-size: 1.15rem; font-weight: 800; color: #0b1734; text-decoration: none; margin-bottom: .45rem; }
.mini-cal.light .mini-head span { color: #0b1734; }
.mini-cal.light .mini-day { border-color: rgba(11, 23, 52, .55); color: #0b1734; border-radius: 7px; font-size: .72rem; }
.mini-cal.light .mini-day.busy { background: rgba(120, 218, 232, .6); }
.mini-cal.light .mini-day.today { background: var(--navy); border-color: var(--navy); color: #fff; }
@media (max-width: 800px) {
  .cal-sheet { padding: 1rem; border-radius: 20px; }
  .cal-row, .cal-week { gap: .3rem; }
  .cal-head span { height: 34px; border-radius: 10px; }
  .cal-day { min-height: 64px; border-radius: 10px; padding: .25rem; }
  .cal-day .ev { display: none; }
  .cal-day.busy .cal-num::after { content: ""; display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--navy); margin: 3px auto 0; }
  .cal-week { grid-template-columns: 1fr; }
  .week-day { min-height: 0; }
  .week-head { flex-direction: row; gap: .5rem; align-items: baseline; }
}
[data-theme="dark"] .welcome-hi { color: #eef2ff; }
[data-theme="dark"] .pill-btn.outline { color: #eef2ff; border-color: #3a4a70; }
[data-theme="dark"] .cal-sheet { background: radial-gradient(60% 50% at 100% 0%, rgba(60, 140, 200, .45), transparent 70%), radial-gradient(55% 45% at 0% 70%, rgba(40, 150, 170, .35), transparent 70%), radial-gradient(40% 35% at 95% 55%, rgba(180, 170, 60, .2), transparent 70%), #121a2e; }
[data-theme="dark"] :is(.cal-title, .cal-num, .week-head, .year-month-name, .seg a, .round-nav, .cal-head span, .mini-cal.light .mini-head span, .mini-cal.light .mini-day) { color: #eef2ff; }
[data-theme="dark"] :is(.cal-day, .cal-head span, .seg, .round-nav, .cal-dayview) { border-color: rgba(220, 230, 255, .55); background: rgba(255, 255, 255, .05); }
[data-theme="dark"] .cal-day.empty { border: 0; background: none; }
[data-theme="dark"] .cal-day.today { background: rgba(80, 180, 210, .35); }
[data-theme="dark"] .mini-cal.light .mini-day { border-color: rgba(220, 230, 255, .45); }

/* v1.13: CEO hub */
.see-as-pills { display: flex; flex-wrap: wrap; gap: .6rem; }
.see-pill { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: .65rem 1.1rem; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); color: var(--navy-deep); cursor: pointer; text-align: left; }
.see-pill small { color: var(--muted); font-weight: 400; }
.see-pill:hover { border-color: var(--navy); }
.see-pill.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.see-pill.on small { color: #c9d4ea; }
.goal-line { display: flex; justify-content: space-between; gap: .5rem; margin: .4rem 0 0; }
[data-theme="dark"] .see-pill { color: #eef2ff; }

/* v1.13: Team hub */
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.announce-list li { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: baseline; }
.announce-list li.pinned { background: var(--yellow-soft); border-radius: 12px; padding: .6rem .75rem; }
.announce-body { flex: 1 1 100%; }
.chat-list { list-style: none; margin: 0 0 .75rem; padding: 0; max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; }
.chat-list li { background: var(--panel); border-radius: 14px; padding: .5rem .75rem; max-width: 90%; }
.chat-list li.mine { align-self: flex-end; background: var(--navy-soft); }
.chat-list p { margin: .15rem 0 0; }
.chat-form { display: flex; gap: .5rem; }
.chat-form input { flex: 1; min-width: 0; }
.crew-name { margin: .6rem 0 .1rem; }
.list.compact li { padding: .2rem 0; font-size: .9rem; }
.directory li { display: flex; flex-direction: column; gap: 2px; }
[data-theme="dark"] .announce-list li.pinned { background: rgba(243, 234, 29, .12); }
[data-theme="dark"] .chat-list li { background: rgba(255, 255, 255, .06); }
[data-theme="dark"] .chat-list li.mine { background: rgba(120, 160, 255, .18); }

/* v1.14: side-by-side fields line up along their boxes (a note like "(their login)" no longer pushes one box down);
   the My details form keeps tops aligned so a message under one field doesn't shift its neighbor. */
.row2, .row3 { align-items: end; }
.details-form :is(.row2, .row3) { align-items: start; }
/* Menu hover: the same light blue as the folder. */
.side a:hover, .side-foot a:hover { background: var(--panel); color: var(--navy-deep); }
.side a:hover .ico { color: var(--navy); }
.folder-row .sub-tabs a:hover { background: var(--panel); color: var(--navy-deep); }
[data-theme="dark"] .side a:hover, [data-theme="dark"] .side-foot a:hover, [data-theme="dark"] .folder-row .sub-tabs a:hover { background: var(--panel); color: #eef2ff; }
[data-theme="dark"] .side a:hover .ico { color: #9cb8ff; }

.today-row td { background: var(--navy-soft); }
.welcome-hi { margin-bottom: 2rem; }

/* v1.14: pick who's on a calendar entry */
.pill-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }
.toggle-pill { flex-direction: row; cursor: pointer; font-weight: 500; }
.toggle-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-pill span { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--navy-deep); }
.toggle-pill span::before { content: "+"; font-weight: 700; color: var(--muted); }
.toggle-pill input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.toggle-pill input:checked + span::before { content: "✓"; color: var(--yellow); }
.toggle-pill input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }
.lead-pick { margin-top: .75rem; }
[data-theme="dark"] .toggle-pill span { color: #eef2ff; }

/* v1.14: maps and mileage */
.map-box { height: 260px; border-radius: 16px; overflow: hidden; background: var(--panel); margin-bottom: .6rem; }
.map-box.tall { height: 380px; margin: 0; }
.stop-pin { display: flex !important; align-items: center; justify-content: center; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; font-size: .8rem; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.route-card { background: rgba(255, 255, 255, .7); border: 1.5px solid #0b1734; border-radius: 18px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.route-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.route-head h2 { margin: 0; }
.route-form { display: flex; gap: .5rem; align-items: center; }
.route-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; margin-bottom: .6rem; }
.route-stops { margin: .5rem 0 0; padding-left: 1.3rem; display: grid; gap: .45rem; }
@media (max-width: 800px) { .route-body { grid-template-columns: 1fr; } .map-box.tall { height: 300px; } }
[data-theme="dark"] .route-card { background: rgba(255, 255, 255, .05); border-color: rgba(220, 230, 255, .55); }

/* v1.14: Fleet */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.vehicle-card { display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: var(--ink); margin: 0; }
.vehicle-card:hover { box-shadow: 0 0 0 2px var(--navy); }
.vehicle-top { display: flex; flex-direction: column; }
.vehicle-top strong { font-size: 1.15rem; color: var(--navy-deep); }
.vehicle-odo { font-size: 1.6rem; font-weight: 700; margin: .2rem 0 0; color: var(--navy-deep); font-variant-numeric: tabular-nums; }
.vehicle-odo small { font-size: .8rem; color: var(--muted); font-weight: 500; }
.due-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.due-list.big { margin-bottom: 1rem; }
.toggle-pill.radio span::before { content: none; }
.log-kinds { margin-top: 0; }
[data-theme="dark"] :is(.vehicle-top strong, .vehicle-odo) { color: #eef2ff; }

[hidden] { display: none !important; }

/* v1.15: Good, Better, Best; Selections; Change orders; signatures */
.gbb-grid, .gbb-sheet, .gbb-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.gbb-card { border: 1.5px solid var(--line); border-radius: 16px; padding: .75rem; display: flex; flex-direction: column; gap: .4rem; }
.gbb-card.chosen, .gbb-col.chosen { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset; }
.gbb-card input[type="text"] { font-weight: 700; }
.gbb-total { font-size: 1.3rem; color: var(--navy-deep); font-weight: 700; margin: 0; }
.gbb-tools { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-top: .6rem; }
.inline-label { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
.gbb-col { border: 1.5px solid var(--line); border-radius: 14px; padding: .75rem; }
.gbb-col h2 { margin-bottom: .3rem; }
.gbb-col ul { padding-left: 1.1rem; margin: .4rem 0; }
.sheet-sub { font-size: 1rem; margin-top: 1rem; }
.gbb-choice { cursor: pointer; }
.gbb-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gbb-choice span { display: flex; flex-direction: column; gap: .25rem; height: 100%; padding: .9rem 1rem; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); font-weight: 400; }
.gbb-choice em { font-style: normal; font-size: 1.25rem; font-weight: 700; color: var(--navy-deep); }
.gbb-choice input:checked + span { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset; background: var(--navy-soft); }
.gbb-choice input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.option-card { display: flex; flex-direction: column; gap: .3rem; border: 1.5px solid var(--line); border-radius: 16px; padding: .6rem; background: var(--card); margin: 0; }
.option-card.chosen { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset; }
.option-card img, .option-noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--panel); }
.option-noimg { display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; color: var(--muted); }
.option-card .over { color: var(--red); font-weight: 600; }
.option-card .under { color: var(--green); font-weight: 600; }
.option-card button { margin-top: auto; }
.option-actions { display: flex; gap: .75rem; margin-top: auto; }
.pick-label { margin-top: auto; font-weight: 700; color: var(--navy); }
.co-list li { display: flex; flex-direction: column; gap: .3rem; }
.co-meta, .co-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.credit { color: var(--green); font-weight: 600; }
.co-amount { font-size: 1.2rem; font-weight: 700; color: var(--navy-deep); }
.pre-line { white-space: pre-line; }
.sig-pad { position: relative; border: 1.5px dashed var(--navy); border-radius: 14px; background: #fff; }
.sig-pad canvas { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; border-radius: 14px; }
.sig-hint { position: absolute; left: 1rem; bottom: .8rem; color: #9aa6bd; pointer-events: none; font-size: .9rem; }
.sig-pad.signed .sig-hint { display: none; }
.sig-clear { position: absolute; right: .75rem; top: .5rem; }
.sig-label { margin: 0; font-weight: 600; color: var(--navy-deep); }
.sig-img { display: block; max-width: 260px; max-height: 90px; margin: .4rem 0; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
[data-theme="dark"] :is(.gbb-total, .gbb-choice em, .co-amount, .sig-label) { color: #eef2ff; }

/* v1.15: login activity */
.logins-table td { vertical-align: middle; }
.spark rect.on { fill: var(--navy); }
.spark rect.off { fill: var(--line); }
[data-theme="dark"] .spark rect.on { fill: #9cb8ff; }

/* v1.15: training */
.train-cat { margin: 1.25rem 0 .6rem; }
.train-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.train-card { display: flex; flex-direction: column; gap: .5rem; margin: 0; }
.train-card.done { border: 1.5px solid var(--green); }
.train-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.option-actions { flex-wrap: wrap; }
.option-actions button { white-space: nowrap; }

/* v1.16: contracts, payment schedules, discounts, estimate views */
.schedule-table td { vertical-align: top; }
.schedule-table .badge { margin-top: .2rem; }
.terms-box { max-height: 14rem; overflow: auto; border: 1px solid #d3dae7; border-radius: 10px; padding: .8rem 1rem; font-size: .86rem; line-height: 1.5; background: #f7f9fc; }
[data-theme="dark"] .terms-box { background: var(--field-bg, #1b2438); border-color: var(--field-line); }
.line-off td:first-child { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.35); }
.line-off td:first-child .badge, .line-off td:first-child form { text-decoration: none; display: inline-block; }
.line-off td.num { opacity: .5; text-decoration: line-through; }
.discount-check { align-self: end; white-space: nowrap; }
.est-views { margin: .4rem 0; }
.input-suffix { display: inline-flex; align-items: center; gap: .4rem; }
.input-suffix input { width: 6rem; }
.contract-sigs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.contract-sigs > div { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.contract-sigs .sig-img { max-width: 100%; }
.contract-sigs .sign-line { display: block; border-bottom: 1px solid #333; }
.contract-sigs .sign-line.tall { height: 3.5rem; }
.contract-sheet h2.sheet-sub { margin-top: 1.4rem; }
@media (max-width: 640px) { .contract-sigs { grid-template-columns: 1fr; } }
/* The add-a-line row wraps as fields are added (price book, option, discount). */
.estimate-add, .estimate-add.with-book { display: flex; flex-wrap: wrap; align-items: flex-end; }
.estimate-add > label { flex: 0 1 7rem; min-width: 0; }
.estimate-add > label:has(input[name="description"]), .estimate-add > label:has(select[name="price_item_id"]) { flex: 2 1 13rem; }
.estimate-add > label:has(input[name="quantity"]) { flex: 0 1 4.5rem; }
.estimate-add > label:has(select[name="option_id"]) { flex: 1 1 8rem; }
.estimate-add > label.discount-check { flex: 0 0 auto; padding-bottom: .55rem; }
.estimate-add > button { flex: 0 0 auto; }
.schedule-table td:first-child { width: 60%; }
.ms-actions { display: flex; gap: .4rem; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: .35rem; }
.ms-actions form { margin: 0; }
@media (max-width: 640px) { .estimate-head { flex-wrap: wrap; } .estimate-head .estimate-co { text-align: left; min-width: 0; } }
.plain-set { border: 0; padding: 0; margin: 0; min-width: 0; }
.plain-set legend { font-weight: 600; font-size: .88rem; padding: 0; margin-bottom: .4rem; }
