:root {
  --navy: #094D82; --navy-deep: #134570; --ink: #0A2E4D; --blue: #13A5DF; --magenta: #DF4F8A;
  --orange: #ED6825; --gold: #F7B718; --page: #F5F8FB; --n100: #EAF0F6; --n200: #D6E0EA;
  --n500: #657586; --n700: #33414F; --ok: #2FA36B; --danger: #D9463C;
  --shadow: 0 2px 8px rgba(9, 77, 130, .08); --shadow-hover: 0 8px 24px rgba(9, 77, 130, .14);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Montserrat, system-ui, sans-serif; color: var(--n700); background: var(--page); font-size: 15px; line-height: 1.5; }
a { color: var(--blue); }
h1, h2, h3 { color: var(--navy); margin: 0 0 12px; font-weight: 700; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
.topbar { background: linear-gradient(135deg, var(--navy-deep), var(--blue)); color: #fff; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.brand img { height: 36px; display: block; }
.brand-tag { font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; opacity: .9; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.account-switch { font: inherit; padding: 6px 10px; border-radius: 12px; border: 0; max-width: 260px; }
.link-btn { background: none; border: 0; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.menu-btn { display: none; background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 12px; padding: 6px 12px; font: inherit; font-weight: 600; }
.layout { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 230px 1fr; gap: 24px; padding: 24px 16px 48px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { padding: 10px 14px; border-radius: 12px; text-decoration: none; color: var(--n700); font-weight: 500; }
.nav a:hover { background: var(--n100); }
.nav a.active { background: #fff; color: var(--navy); font-weight: 700; box-shadow: var(--shadow); border-left: 4px solid var(--orange); }
.main { min-width: 0; outline: none; }
.card { background: #fff; border: 1px solid var(--n200); border-radius: 18px; box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.tile { background: #fff; border: 1px solid var(--n200); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); transition: box-shadow .18s, transform .18s; text-decoration: none; color: inherit; display: block; }
a.tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.tile .label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--n500); font-weight: 600; }
.tile .value { font-size: 28px; font-weight: 800; color: var(--navy); margin-top: 4px; }
.tile .value.alert { color: var(--orange); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--n500); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--n200); }
td { padding: 10px 8px; border-bottom: 1px solid var(--n100); vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--n100); color: var(--n700); text-transform: capitalize; }
.pill.paid, .pill.closed { background: #E3F4EB; color: #1E7A4D; }
.pill.overdue { background: #FDEBE9; color: #A8322A; }
.pill.open, .pill.sent, .pill.new { background: #E2F4FC; color: #0B6C93; }
.btn { display: inline-block; border: 0; border-radius: 12px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .14s; }
.btn-primary { background: var(--orange); color: #fff; } .btn-primary:hover { background: #D65A1C; }
.btn-ghost { background: var(--n100); color: var(--navy); } .btn-ghost:hover { background: var(--n200); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--n500); font-size: 13px; }
label { display: block; font-weight: 600; font-size: 13px; color: var(--navy); margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=tel], textarea, select.field { width: 100%; font: inherit; padding: 9px 12px; border: 1px solid var(--n200); border-radius: 12px; background: #fff; }
textarea { min-height: 110px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.conv { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.msg { padding: 12px 14px; border-radius: 14px; background: var(--n100); }
.msg.you { background: #FFF3EA; }
.msg .meta { font-size: 12px; color: var(--n500); margin-bottom: 4px; font-weight: 600; }
.checks { display: grid; grid-template-columns: 1fr 70px 70px; gap: 6px 12px; align-items: center; }
.checks .h { font-size: 12px; font-weight: 700; color: var(--n500); text-transform: uppercase; text-align: center; }
.checks input { width: 18px; height: 18px; justify-self: center; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; box-shadow: var(--shadow-hover); z-index: 10; }
.loading, .empty { padding: 32px; text-align: center; color: var(--n500); }
.error { color: var(--danger); }
.footer { text-align: center; color: var(--n500); font-size: 13px; padding: 24px 16px 40px; }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; padding-top: 12px; }
  .menu-btn { display: inline-block; }
  .nav { display: none; } .nav.open { display: flex; }
  .grid2 { grid-template-columns: 1fr; }
  .brand-tag { display: none; }
  .account-switch { max-width: 150px; }
  .hide-sm { display: none; }
}

/* Quotes & projects */
.deal { padding: 12px 0; border-bottom: 1px solid var(--n100); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 10px 0 4px; }
.steps span { font-size: 12px; text-align: center; padding: 6px 4px; border-radius: 8px; background: var(--n100); color: #5b6670; }
.steps span.on { background: #094D82; color: #fff; }
@media (max-width: 560px) { .steps span { font-size: 10px; } }

/* Photos */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.gallery a { text-decoration: none; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; display: block; background: var(--n100); }
.gallery .muted { font-size: 12px; }

/* ---------- v0.4 interface ---------- */
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn .ic { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
.nav a { display: flex; align-items: center; gap: 10px; }
.nav a .ic { color: var(--n500); }
.nav a.active .ic, .nav a:hover .ic { color: var(--navy); }
.nav-group { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--n500); padding: 16px 14px 4px; }
.nav-account { background: #fff; border: 1px solid var(--n200); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; }
.nav-account-name { font-weight: 700; color: var(--navy); line-height: 1.3; }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.hero h1 { font-size: 30px; margin: 2px 0 2px; }
.link-sm { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 13px; color: var(--n500); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.link-sm:hover { color: var(--navy); }
.link-sm .ic { width: 15px; height: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }

.attention { padding: 16px 20px; }
.attention h2 { font-size: 16px; }
.attn { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: var(--n700); margin-top: 8px; border: 1px solid transparent; }
.attn .ic { width: 20px; height: 20px; }
.attn .chev { margin-left: auto; font-size: 22px; color: var(--n500); }
.attn-critical { background: #FDEBE9; border-color: #F6C9C4; } .attn-critical .ic { color: #B3261E; }
.attn-warning { background: #FFF4E5; border-color: #FBD9A8; } .attn-warning .ic { color: #B25E00; }
.attn-info { background: #E8F5FC; border-color: #BFE3F5; } .attn-info .ic { color: #0B6C93; }
.attn:hover { filter: brightness(.98); }

.tile .muted { margin-top: 2px; }
.tile.tile-text .value { font-size: 20px; line-height: 1.3; margin-top: 8px; }
.tile.tile-alert { border-color: #F6C9C4; background: linear-gradient(180deg, #fff, #FFF7F6); }
.tile.tile-alert .value { color: #B3261E; }
.tile.tile-warn { border-color: #FBD9A8; }
.tile.tile-warn .value { color: #B25E00; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 20px; }
.grid-cards > .card { margin-bottom: 0; }
.grid-cards:empty { display: none; }

.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--n100); }
.agenda li:last-child { border-bottom: 0; }
.agenda-date { width: 48px; text-align: center; border-radius: 12px; background: var(--n100); padding: 4px 0; flex: none; }
.agenda-date span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--orange); letter-spacing: .06em; }
.agenda-date strong { display: block; font-size: 20px; color: var(--navy); line-height: 1.1; }
.agenda-body { flex: 1; min-width: 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--n100); }
.list li:last-child { border-bottom: 0; }
.list li a, .list li > span:first-child { display: flex; flex-direction: column; text-decoration: none; color: var(--n700); min-width: 0; }
.list li a strong { color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty.small { padding: 16px; }

.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; background: var(--n100); }

.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 18px; }

/* Charts */
.chart { position: relative; }
.chart-plot { position: relative; width: 100%; }
.chart-plot svg { display: block; width: 100%; height: auto; font-family: Montserrat, system-ui, sans-serif; }
.chart-plot rect[tabindex]:focus { outline: none; }
.chart-plot rect[tabindex]:focus-visible { stroke: var(--blue); stroke-width: 2; }
.chart-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--n200); box-shadow: var(--shadow-hover); border-radius: 10px; padding: 8px 10px; font-size: 12px; color: var(--n700); white-space: nowrap; z-index: 2; }
.chart-tip strong { color: var(--navy); }
.chart-foot { display: flex; justify-content: flex-end; margin-top: 4px; }

/* Loading skeleton */
.skel-line { height: 14px; border-radius: 8px; background: var(--n100); margin-bottom: 10px; }
.skel-line.w40 { width: 40%; height: 26px; } .skel-line.w25 { width: 25%; margin-bottom: 20px; }
.skel-tile { height: 110px; } .skel-card { height: 240px; }
.skel .skel-line, .skel .skel-tile, .skel .skel-card { animation: pulse 1.4s ease-in-out infinite; }
.skel .skel-tile, .skel .skel-card { background: #fff; }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .skel * { animation: none !important; } a.tile:hover { transform: none; } }

@media (max-width: 760px) {
  .hero h1 { font-size: 24px; }
  .grid-cards { grid-template-columns: 1fr; }
  .nav { background: var(--page); padding-bottom: 8px; }
  .actions .btn { flex: 1 1 auto; text-align: center; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile { padding: 14px; border-radius: 18px; }
  .tile .value { font-size: 22px; }
  .tile.tile-text .value { font-size: 16px; }
  .topbar-inner { flex-wrap: wrap; row-gap: 8px; }
  .topbar-right { gap: 8px; }
  .account-switch { order: 3; flex: 1 0 100%; max-width: none; }
  .topbar-right { display: contents; }
  .menu-btn { margin-left: auto; }
  #signOut { display: none; }
  .nav-signout { display: flex !important; }
}
.nav-signout { display: none !important; }

/* ---------- Admin ---------- */
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.admin-head h1 { margin: 0; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--n200); margin-bottom: 20px; overflow-x: auto; scrollbar-width: thin; }
.admin-tabs a { padding: 10px 14px; text-decoration: none; color: var(--n500); font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; white-space: nowrap; }
.admin-tabs a:hover { color: var(--navy); }
.admin-tabs a.on { color: var(--navy); border-bottom-color: var(--orange); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input[type=search] { flex: 2 1 220px; }
.filters select { flex: 1 1 160px; width: auto; }
input[type=search], input[type=number] { font: inherit; padding: 9px 12px; border: 1px solid var(--n200); border-radius: 12px; background: #fff; }
input.sm, select.sm { padding: 6px 8px; font-size: 13px; }
.nowrap { white-space: nowrap; }
.sys { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; margin-right: 4px; background: var(--n100); color: #8A97A5; text-decoration: line-through; }
.sys.on { background: #E3F4EB; color: #1E7A4D; text-decoration: none; }
.chip { display: inline-block; background: var(--n100); border-radius: 999px; padding: 3px 10px; font-size: 13px; margin: 2px 4px 2px 0; }
.btn.danger { color: #B3261E; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--n700); }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.detail { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; font-weight: 600; color: var(--n700); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 40px; height: 22px; border-radius: 999px; background: var(--n200); position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { left: 21px; }
.switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }

/* account modules */
.mod-list { border: 1px solid var(--n100); border-radius: 12px; max-height: 460px; overflow-y: auto; }
.mod-row { display: grid; grid-template-columns: 1fr auto 150px; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--n100); }
.mod-row:last-child { border-bottom: 0; }
.mod-row.disabled { opacity: .55; }
.eff { font-size: 12px; font-weight: 600; color: var(--n500); }
.eff.on { color: #1E7A4D; }

/* lookups */
.lookup { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.lookup-item { text-align: left; background: #fff; border: 1px solid var(--n200); border-radius: 10px; padding: 8px 12px; font: inherit; cursor: pointer; display: flex; flex-direction: column; }
.lookup-item:hover:not([disabled]) { border-color: var(--blue); background: #F4FAFD; }
.lookup-item[disabled] { opacity: .5; cursor: default; }

/* user assignment rows */
.link-row { display: grid; grid-template-columns: 2fr 1fr 2fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.link-row .link-sm { font-size: 20px; }

/* permissions matrix */
.matrix-wrap { margin-top: 12px; }
.matrix { border-collapse: separate; border-spacing: 0; }
.matrix th, .matrix td { border-bottom: 1px solid var(--n100); }
.matrix thead th { vertical-align: bottom; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--n700); }
.matrix tbody th { text-align: left; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--n700); position: sticky; left: 0; background: #fff; min-width: 180px; }
.matrix thead th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; }
.pcol { min-width: 120px; text-align: center !important; }
.pname { font-weight: 700; color: var(--navy); }
.pact { display: flex; gap: 10px; justify-content: center; }
.pact .link-sm { color: var(--blue); font-size: 12px; }
.cell { text-align: center; padding: 6px; }
.perm { font: inherit; font-size: 12px; font-weight: 600; border-radius: 8px; padding: 5px 0; width: 92px; cursor: pointer; border: 1px solid transparent; }
.perm-on { background: #E3F4EB; color: #1E7A4D; border-color: #BFE3CF; }
.perm-view { background: #E8F5FC; color: #0B6C93; border-color: #BFE3F5; }
.perm-off { background: #fff; color: #8A97A5; border-color: var(--n200); }
.perm[disabled] { cursor: default; opacity: .7; }
.perm:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.mod-off th, .mod-off td { opacity: .5; }

/* requests */
.seg { display: inline-flex; background: var(--n100); border-radius: 12px; padding: 3px; }
.seg a { padding: 6px 14px; border-radius: 10px; text-decoration: none; color: var(--n500); font-weight: 600; font-size: 13px; }
.seg a.on { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.req-detail { background: var(--page); border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }

/* settings */
.set-row { margin-bottom: 14px; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--page) 30%); padding: 16px 0; display: flex; gap: 12px; align-items: center; }

/* dialog */
.dlg-wrap { position: fixed; inset: 0; background: rgba(10, 46, 77, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.dlg { background: #fff; border-radius: 20px; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; box-shadow: var(--shadow-hover); }
.dlg h2 { margin: 0; }
.dlg [data-x].link-sm { font-size: 26px; line-height: 1; }

/* staff preview bar + announcement */
.preview-bar { background: #FFF4E5; border-bottom: 1px solid #FBD9A8; color: #6B3A00; display: flex; justify-content: center; align-items: center; gap: 16px; padding: 8px 16px; font-size: 14px; flex-wrap: wrap; }
.preview-bar .ic { vertical-align: -4px; margin-right: 6px; color: #B25E00; }
.preview-bar .btn { background: #fff; color: #6B3A00; border: 1px solid #FBD9A8; }
.announce { margin: 0 0 16px; }

@media (max-width: 760px) {
  .link-row { grid-template-columns: 1fr 1fr; }
  .link-row [data-f=contact] { grid-column: 1 / 2; }
  .mod-row { grid-template-columns: 1fr auto; }
  .mod-row select { grid-column: 1 / -1; }
}

/* ---------- Visits ---------- */
.label-sm { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); }
.today-card { border-left: 4px solid var(--orange); }
.tracker { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0 4px; padding: 0; position: relative; }
.tracker li { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--n500); position: relative; text-align: center; }
.tracker li::before { content: ''; position: absolute; top: 7px; left: -50%; width: 100%; height: 3px; background: var(--n200); z-index: 0; }
.tracker li:first-child::before { display: none; }
.tracker li.done::before, .tracker li.now::before { background: var(--navy); }
.tracker .dot { width: 17px; height: 17px; border-radius: 50%; background: #fff; border: 3px solid var(--n200); position: relative; z-index: 1; }
.tracker li.done .dot { background: var(--navy); border-color: var(--navy); }
.tracker li.now .dot { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 5px rgba(237, 104, 37, .18); }
.tracker li.now { color: var(--navy); font-weight: 700; }
.tracker li.done { color: var(--n700); }
.tracker-note { margin-top: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.facts { margin-top: 12px; }
.facts label { margin-top: 10px; }

.rate-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, #fff, #F4FAFD); }
.stars-quick { display: flex; gap: 4px; }
.stars-quick a { color: #C9D4DF; padding: 2px; border-radius: 8px; }
.stars-quick a .ic { width: 34px; height: 34px; fill: currentColor; stroke: none; }
.stars-quick:hover a { color: var(--gold); }
.stars-quick a:hover ~ a { color: #C9D4DF; }
.stars-quick a:focus-visible { outline: 2px solid var(--blue); }
.stars { display: inline-flex; gap: 1px; vertical-align: middle; }
.stars span { color: #D6E0EA; display: inline-flex; }
.stars span.on { color: var(--gold); }
.stars .ic { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.stars-input { display: flex; gap: 6px; }
.stars-input label { margin: 0; cursor: pointer; color: #C9D4DF; position: relative; }
.stars-input label.on { color: var(--gold); }
.stars-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars-input .ic { width: 42px; height: 42px; fill: currentColor; stroke: none; }
.stars-input input:focus-visible + span { outline: 2px solid var(--blue); border-radius: 8px; }
.stars-label { margin: 4px 0 8px; font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 560px) { .tracker li { font-size: 11px; } .stars-quick a .ic { width: 30px; height: 30px; } }
.bar-row { display: grid; grid-template-columns: 64px 1fr 36px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.bar { height: 10px; background: var(--n100); border-radius: 6px; overflow: hidden; display: block; }
.bar span { display: block; height: 100%; background: var(--navy); border-radius: 0 6px 6px 0; }
.rating-row { padding: 14px 0; border-bottom: 1px solid var(--n100); }
.rating-row:last-child { border-bottom: 0; }
.quote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--n200); }

/* ---------- Dark sidebar (v0.7) ---------- */
.layout { align-items: start; }
.nav { background: linear-gradient(180deg, #0A2E4D 0%, #0B3A63 100%); border-radius: 20px; padding: 14px 10px 16px; box-shadow: var(--shadow); position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.nav a { color: #C9D8E6; font-weight: 500; }
.nav a .ic { color: #7FA3C2; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a:hover .ic { color: #fff; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 700; box-shadow: none; border-left: 4px solid var(--orange); padding-left: 10px; }
.nav a.active .ic { color: var(--orange); }
.nav a:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.nav-group { color: #7FA3C2; }
.nav-account { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.nav-account-name { color: #fff; }
.nav-account .muted { color: #9DB6CC; }
.nav-signout { color: #C9D8E6 !important; }
@media (max-width: 760px) {
  .nav { position: static; max-height: none; background: linear-gradient(180deg, #0A2E4D 0%, #0B3A63 100%); padding: 10px; margin-bottom: 4px; }
}

/* ---------- Launch polish (v0.9): menu locked to the left edge ---------- */
@media (min-width: 761px) {
  .topbar-inner { max-width: none; padding: 12px 24px; }
  .layout { max-width: none; margin: 0; grid-template-columns: 260px minmax(0, 1fr); gap: 0; padding: 0; min-height: calc(100vh - 64px); }
  .nav { position: sticky; top: 0; height: 100vh; max-height: 100vh; border-radius: 0; box-shadow: none; margin: 0; padding: 20px 12px 24px; }
  .main { padding: 28px 40px 56px; max-width: 1160px; width: 100%; }
}
/* Menu highlight without the orange bar */
.nav a.active { border-left: 4px solid var(--blue); background: rgba(255,255,255,.14); }
.nav a.active .ic { color: #fff; }

/* Page loading: keep the current page (dimmed) and show a thin blue line at the top */
.main { transition: opacity .15s ease; }
.main.is-loading { opacity: .45; pointer-events: none; }
body.route-loading::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000;
  background: linear-gradient(90deg, transparent 0%, var(--blue) 40%, var(--blue) 60%, transparent 100%); background-size: 200% 100%;
  animation: sv-loadline 1s linear infinite; }
@keyframes sv-loadline { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.skel .skel-line, .skel .skel-tile, .skel .skel-card { animation-duration: 2s; }
@media (prefers-reduced-motion: reduce) { body.route-loading::before { animation: none; background: var(--blue); } .main { transition: none; } }

/* Disabled controls in staff previews */
.btn.is-disabled { opacity: .5; cursor: not-allowed; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain[disabled] { opacity: .6; }

/* Inspections: original-language note */
details.orig { margin-top: 4px; font-size: 13px; }
details.orig summary { cursor: pointer; color: var(--blue); }

/* Cleaning team */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.person { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--n200); border-radius: 18px; background: #fff; }
.person-sup { border-color: var(--n100); background: var(--page); margin-top: 8px; }
.avatar { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 20px; color: #fff;
  background: linear-gradient(135deg, var(--navy-deep), var(--blue)); }
.person-name { font-weight: 700; color: var(--navy); font-size: 17px; }
.person-fact { font-size: 13px; color: var(--n700); margin-top: 4px; }

/* Maintenance calendar */
table.cal { min-width: 640px; }
table.cal th, table.cal td { text-align: center; padding: 10px 4px; }
table.cal tbody th { text-align: left; font-weight: 600; color: var(--navy); white-space: nowrap; padding-right: 12px; }
table.cal .cal-now { background: rgba(19,165,223,.08); }
table.cal thead th.cal-now { color: var(--blue); }
.cal-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--n200); vertical-align: middle; }
.cal-planned { background: #fff; border: 2px solid var(--navy); width: 10px; height: 10px; }
.cal-scheduling { background: var(--gold); }
.cal-scheduled { background: var(--blue); }
.cal-completed, .cal-done { background: var(--navy); }
.cal-key { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--n700); }
.cal-key > span { display: inline-flex; align-items: center; gap: 6px; }
details.plan { border-bottom: 1px solid var(--n100); padding: 10px 0; }
details.plan summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
details.plan summary::-webkit-details-marker { display: none; }
details.plan summary > span { display: flex; flex-direction: column; }
details.plan[open] summary strong { color: var(--blue); }
.plan-body { padding: 12px 0 4px; }
table.cal tbody th { text-transform: none; letter-spacing: 0; font-size: 14px; }

/* Open (unfilled) position on the team page */
.person-open { border-style: dashed; background: var(--page); }
.avatar-open { background: var(--n200); color: var(--n700); }
.badge-open { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; background: #fff4e5; color: #9a5b00; vertical-align: middle; }

/* ---------- Residential (house cleaning) theme: pink gradient ----------
   Turned on by body.theme-home for accounts on the Residential profile. Re-points the
   brand tokens, so headings, buttons, links, tiles and charts all follow. */
body.theme-home {
  --navy: #9C2A63; --navy-deep: #C2306F; --ink: #5E1739; --blue: #EC6FA5; --orange: #DF4F8A;
  --page: #FDF5F9; --n100: #FBE7F0; --n200: #F3D2E2;
  --shadow: 0 2px 8px rgba(156, 42, 99, .08); --shadow-hover: 0 8px 24px rgba(156, 42, 99, .16);
}
body.theme-home .topbar { background: linear-gradient(135deg, #B8336A 0%, #DF4F8A 55%, #F59CC0 100%); }
body.theme-home .nav { background: linear-gradient(180deg, #6E1A45 0%, #A62A64 100%); }
body.theme-home .btn-primary:hover { background: #C93D77; }
body.theme-home .tile.tile-alert { border-color: #F3C2D7; background: linear-gradient(180deg, #fff, #FFF4F8); }
body.theme-home .rate-card { background: linear-gradient(135deg, #fff, #FDEFF5); }
@media (max-width: 900px) { body.theme-home .nav { background: linear-gradient(180deg, #6E1A45 0%, #A62A64 100%); } }

/* ---------- Supplies & Products ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--n100); padding: 4px; border-radius: 14px; margin-bottom: 14px; }
.seg button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--n700); padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.seg-n { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--n200); font-size: 12px; text-align: center; }
.seg button.on .seg-n { background: var(--navy); color: #fff; }
.thumb, .thumb-sm, .prod-img, .room-img { object-fit: contain; background: #fff; border: 1px solid var(--n200); border-radius: 12px; flex: none; }
.thumb { width: 64px; height: 64px; }
.thumb-sm { width: 36px; height: 36px; border-radius: 8px; }
.thumb-empty { display: inline-flex; align-items: center; justify-content: center; background: var(--n100); color: var(--n500); }
.thumb-empty .ic { width: 45%; height: 45%; }
.sup-list { display: flex; flex-direction: column; }
.sup-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--n100); }
.sup-item:first-child { border-top: 0; }
.sup-item.is-low .thumb { border-color: #F6C9C4; }
.sup-name { font-weight: 700; color: var(--ink); }
.sup-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.stat { display: flex; flex-direction: column; min-width: 64px; }
.stat span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--n500); }
.stat strong { color: var(--navy); font-size: 16px; }
.stat.warn strong { color: #B25E00; }
.sup-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; font-size: 13px; }
.spark rect { fill: var(--n200); } .spark rect.low { fill: #F2A65A; }
.spark rect:last-of-type { fill: var(--navy); } .spark rect.low:last-of-type { fill: var(--orange); }
.spark .par { stroke: var(--n500); stroke-dasharray: 3 2; stroke-width: 1; }
.room-photo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 8px; }
.room-img { width: 96px; height: 72px; object-fit: cover; }
details.ship { border-top: 1px solid var(--n100); padding: 10px 0; }
details.ship:first-of-type { border-top: 0; }
details.ship summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
details.ship summary::-webkit-details-marker { display: none; }
.ship-thumbs { display: flex; } .ship-thumbs .thumb-sm { margin-right: -10px; box-shadow: 0 0 0 2px #fff; }
.ship-text { flex: 1; margin-left: 10px; min-width: 0; }
.ship-items { list-style: none; padding: 8px 0 0; margin: 0; display: grid; gap: 6px; }
.ship-items li { display: flex; align-items: center; gap: 10px; }
.ship-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.ship-photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; }
.shop { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.shop-cart { position: sticky; top: 16px; }
.shop-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; }
.shop-filters input { flex: 1 1 220px; margin: 0; } .shop-filters select { flex: 0 1 220px; margin: 0; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.prod { background: #fff; border: 1px solid var(--n200); border-radius: 18px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.prod-img { width: 100%; height: 140px; border: 0; }
.prod-body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.prod-name { font-weight: 700; color: var(--ink); line-height: 1.3; }
.prod-usual { font-size: 12px; font-weight: 600; color: var(--navy); background: var(--n100); border-radius: 8px; padding: 2px 8px; align-self: flex-start; }
.prod-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.prod-price { font-size: 18px; font-weight: 800; color: var(--navy); }
.qty { display: inline-flex; align-items: center; gap: 8px; } .qty span { min-width: 18px; text-align: center; font-weight: 700; }
.cart-lines { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; font-size: 14px; }
.cart-lines li { display: flex; justify-content: space-between; gap: 10px; }
.cart-total { border-top: 1px solid var(--n200); padding-top: 8px; font-size: 16px; }
button.link { background: none; border: 0; color: var(--blue); font: inherit; font-size: 13px; cursor: pointer; padding: 0; }
.cart-fab { display: none; }
@media (max-width: 900px) {
  .shop { grid-template-columns: 1fr; }
  .shop-cart { position: static; }
  .cart-fab { display: flex; position: fixed; right: 16px; bottom: 16px; width: 54px; height: 54px; border-radius: 50%; background: var(--orange); color: #fff; align-items: center; justify-content: center; box-shadow: var(--shadow-hover); z-index: 20; }
  .cart-fab .ic { width: 24px; height: 24px; }
  .cart-fab span:not(:empty) { position: absolute; top: -2px; right: -2px; background: var(--navy); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 6px; }
}
@media (max-width: 640px) {
  .sup-item { grid-template-columns: 52px 1fr; }
  .sup-item .thumb { width: 52px; height: 52px; }
  .sup-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; text-align: left; }
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .prod { padding: 10px; } .prod-img { height: 110px; }
}

/* ---------- Quick polish (Nov 2026) ---------- */
.pill.tone-good { background: #E3F4EB; color: #1E7A4D; }
.pill.tone-info { background: #E2F4FC; color: #0B6C93; }
.pill.tone-bad { background: #FDEBE9; color: #A8322A; }
.nowrap { white-space: nowrap; }
/* Tiles fill each row instead of leaving a half-empty last row. */
.tiles { display: flex; flex-wrap: wrap; }
.tiles > .tile { flex: 1 1 190px; min-width: 0; }
@media (max-width: 640px) { .tiles > .tile { flex-basis: 140px; } }
.sds-item { grid-template-columns: 64px 1fr auto; align-items: center; }
.sds-files { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .sds-files { grid-column: 1 / -1; justify-content: flex-start; } }
