:root {
  --ink: #173b4a;
  --muted: #5f7782;
  --line: #b8e2ea;
  --soft: #eaf7fa;
  --surface: #ffffff;
  --green: #087e9a;
  --green-2: #0797b3;
  --green-soft: #e3f5f8;
  --coral: #d95f5b;
  --coral-soft: #fff0ef;
  --amber: #7a6200;
  --amber-soft: #fff9d8;
  --blue: #2d9fc0;
  --blue-soft: #e7f7fb;
  --sun: #f4d64e;
  --shadow: 0 10px 26px rgba(8, 126, 154, .10);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { background: var(--soft); color: var(--ink); font-family: "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif; letter-spacing: 0; }
body { margin: 0; min-height: 100vh; background: var(--soft); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; flex: 0 0 auto; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 26px; line-height: 1.25; font-weight: 760; color: #173b4a; }
h2 { margin-bottom: 0; font-size: 18px; line-height: 1.35; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 650; }

.site-header { position: sticky; z-index: 40; top: 0; height: 68px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; gap: 28px; background: rgba(248,253,254,.97); border-top: 4px solid #1bb6d1; border-bottom: 1px solid var(--line); box-shadow: 0 4px 18px rgba(8,126,154,.07); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.brand > span:last-child { min-width: 0; display: grid; }
.brand strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.brand small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; background: #087e9a; color: white; border-bottom: 4px solid var(--sun); font-weight: 800; }
.brand-mark { overflow: hidden; border: 1px solid #8ccfdb; border-bottom: 3px solid var(--sun); border-radius: 50%; }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-mark.large { width: 48px; height: 48px; font-size: 20px; }
.desktop-nav { display: flex; align-items: stretch; gap: 4px; height: 100%; }
.desktop-nav a, .desktop-nav button { display: flex; align-items: center; gap: 7px; padding: 0 16px; color: #4b6671; font-size: 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; cursor: pointer; }
.desktop-nav a:hover, .desktop-nav a:focus-visible, .desktop-nav button:hover, .desktop-nav button:focus-visible { color: var(--green); background: var(--green-soft); border-bottom-color: var(--green); outline: 0; }
.desktop-nav a.current { color: var(--green); background: #e3f5f8; border-bottom-color: var(--sun); }
.logout-form { margin-left: auto; }

.page-shell { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 32px 0 80px; }
.page-heading, .today-header, .customer-identity { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading.compact { justify-content: flex-start; max-width: 720px; margin-inline: auto; }
.heading-actions { display: flex; gap: 8px; }
.page-back-link, .back-link {
  width: fit-content;
  min-height: 44px;
  margin: -5px 0 8px;
  padding: 0 10px 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 6px;
  color: #536f79;
  font-size: 13px;
  font-weight: 700;
  touch-action: manipulation;
}
.page-back-link:hover, .back-link:hover { background: #e7f4f6; color: var(--green); }
.page-back-link svg, .back-link svg { width: 21px; height: 21px; }

.button { min-height: 42px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 7px; background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; }
.button.primary { background: #087e9a; color: white; box-shadow: 0 5px 12px rgba(8,126,154,.18); }
.button.primary:hover { background: #066b83; }
.button.secondary { border-color: #69c9dc; color: #087e9a; background: #f6fcfd; }
.button.subtle { background: #f0f8fa; border-color: var(--line); color: #466571; }
.button.small { min-height: 34px; padding: 0 11px; font-size: 12px; }
.button.wide { width: 100%; }
.button:focus-visible, .icon-button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(244,214,78,.58); outline-offset: 2px; }
.icon-button { width: 42px; height: 42px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--green); cursor: pointer; }
.icon-button.small { width: 30px; height: 30px; }
.icon-button.small svg { width: 17px; }

.search-bar { height: 54px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; margin-bottom: 28px; padding-left: 16px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 16px rgba(8,126,154,.07); }
.search-bar svg { color: #718991; }
.search-bar input { width: 100%; height: 48px; border: 0; outline: 0; background: transparent; font-size: 15px; }
.search-bar button { align-self: stretch; padding: 0 20px; border: 0; border-left: 1px solid var(--line); background: #e8f7fa; color: var(--green); font-weight: 750; cursor: pointer; }
.customer-filter-form { margin-bottom: 22px; }
.customer-filter-form .search-bar { margin-bottom: 10px; }
.filter-panel { overflow: hidden; background: #f8fcfd; border: 1px solid var(--line); border-radius: var(--radius); }
.filter-panel summary { min-height: 46px; padding: 0 14px; display: flex; align-items: center; gap: 8px; color: #365f70; cursor: pointer; list-style: none; font-size: 13px; font-weight: 700; }
.filter-panel summary::-webkit-details-marker { display: none; }
.filter-panel summary span { display: flex; align-items: center; gap: 7px; }
.filter-panel summary > b { margin-left: auto; padding: 3px 7px; border-radius: 5px; background: #fff7c2; color: #6d5700; font-size: 10px; }
.filter-panel summary > svg { margin-left: auto; transition: transform .18s ease; }
.filter-panel summary > b + svg { margin-left: 0; }
.filter-panel[open] summary { border-bottom: 1px solid var(--line); }
.filter-panel[open] summary > svg { transform: rotate(180deg); }
.filter-fields { padding: 14px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.filter-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.filter-actions { padding: 0 14px 14px; display: flex; justify-content: flex-end; gap: 8px; }
.filter-actions .button { min-height: 38px; }
.filter-body { padding: 12px 14px 4px; display: grid; gap: 10px; }
.filter-group { min-width: 0; padding: 0; border: 0; }
.filter-group > header { min-height: 28px; display: flex; align-items: center; gap: 7px; color: #315966; font-size: 12px; }
.filter-group > header svg { width: 16px; height: 16px; }
.filter-basic-grid { display: grid; grid-template-columns: 180px 180px minmax(320px, 1fr); gap: 10px; }
.filter-basic-grid > label, .filter-staff-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.filter-date-range { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.filter-date-range > div { display: grid; grid-template-columns: minmax(0,1fr) 18px minmax(0,1fr); align-items: center; gap: 5px; }
.filter-date-range label { min-width: 0; display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; gap: 4px; }
.filter-date-range label small { color: #6a858f; font-size: 10px; }
.filter-date-range svg { width: 15px; color: #83a0aa; }
.staff-filter-group { overflow: hidden; border: 1px solid #d9e9ec; border-radius: 6px; background: #fbfefe; }
.staff-filter-group > summary { min-height: 40px; padding: 0 10px; display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; }
.staff-filter-group > summary::-webkit-details-marker { display: none; }
.staff-filter-group > summary span { display: flex; align-items: center; gap: 7px; color: #315966; font-size: 12px; }
.staff-filter-group > summary span svg { width: 16px; }
.staff-filter-group > summary small { margin-left: auto; color: var(--muted); font-size: 10px; }
.staff-filter-group > summary > svg { width: 16px; transition: transform .18s ease; }
.staff-filter-group[open] > summary > svg { transform: rotate(180deg); }
.filter-staff-grid { padding: 10px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; border-top: 1px solid #dfecef; }
.active-filter-chips { margin-top: 7px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.active-filter-chips::-webkit-scrollbar { display: none; }
.active-filter-chips span { flex: 0 0 auto; padding: 4px 8px; border: 1px solid #abd8e2; border-radius: 999px; background: #eff9fb; color: #276779; font-size: 10px; }

.action-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.action-section { overflow: hidden; background: white; border: 1px solid var(--line); border-left: 4px solid #86b8c2; border-radius: var(--radius); box-shadow: 0 5px 18px rgba(8,126,154,.055); }
.action-section > header { min-height: 52px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.action-section > header > div { display: flex; align-items: center; gap: 9px; }
.action-section > header strong { min-width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #8da5ab; }
.tone-danger { border-left-color: var(--coral); }.tone-danger > header { background: #fff8f7; }.tone-danger .status-dot { background: var(--coral); }
.tone-care { border-left-color: #2d9fc0; }.tone-care > header { background: #edf9fc; }.tone-care .status-dot { background: var(--blue); }
.tone-primary { border-left-color: #0797b3; }.tone-primary > header { background: #eaf8fb; }.tone-primary .status-dot { background: var(--green-2); }
.tone-warning { border-left-color: var(--sun); }.tone-warning > header { background: #fffbef; }.tone-warning .status-dot { background: var(--amber); }
.tone-muted > header { background: #f3fafc; }
.action-row { min-height: 70px; padding: 9px 10px 9px 14px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #ddeef2; }
.action-row:last-child { border-bottom: 0; }
.action-main { min-width: 0; flex: 1; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.action-copy, .customer-copy, .customer-value { min-width: 0; display: grid; gap: 3px; }
.action-copy strong, .customer-copy strong { font-size: 14px; }
.action-copy small, .customer-copy small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.customer-name-line { min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.customer-name-line > strong { flex: 0 0 auto; }
.customer-name-line > small { min-width: 0; color: #357d91; font-size: 10px; }
.customer-spark { width: 20px; height: 20px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; }
.customer-spark svg { width: 15px; height: 15px; stroke-width: 2.4; }
.customer-spark.spark-on { background: #fff5b8; color: #bd8d00; }
.customer-spark.spark-off { background: #edf2f3; color: #9aabb0; }
.customer-spark.spark-off svg { opacity: .58; }
.customer-spark.spark-error { color: #9aabb0; font-size: 13px; font-weight: 800; }
.inventory-name-line, .deleted-name-line, .member-name-line { min-width: 0; display: inline-flex; align-items: center; gap: 7px; }
.inventory-name-line strong, .deleted-name-line strong, .member-name-line strong { min-width: 0; }
.member-badge { padding: 3px 7px; border-radius: 5px; background: #fff7c2; color: #6d5700; font-size: 11px; font-weight: 750; }
.action-follow { border-color: transparent; background: var(--soft); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #dff4f8; color: #087e9a; border: 1px solid #b8e2ea; font-weight: 800; }
.avatar.large { width: 56px; height: 56px; font-size: 21px; }
.empty-state { margin: 0; padding: 28px 16px; color: var(--muted); text-align: center; font-size: 13px; }

.customer-list { background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 6px 20px rgba(8,126,154,.06); }
.customer-row { min-height: 76px; padding: 11px 14px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto 20px; align-items: center; gap: 12px; border-bottom: 1px solid #ddeef2; }
.customer-row:last-child { border-bottom: 0; }
.customer-row:hover { background: #f1fafc; }
.customer-value { justify-items: end; }
.customer-value strong { font-family: Consolas, "SFMono-Regular", monospace; font-size: 14px; }
.customer-value small { color: var(--green-2); font-size: 11px; font-weight: 700; }
.customer-row > svg { color: #829aa3; }
.empty-page { min-height: 280px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.empty-page svg { width: 34px; height: 34px; margin-bottom: 12px; }
.empty-page h2 { color: var(--ink); margin-bottom: 6px; }
.empty-page p { margin: 0; font-size: 13px; }
.empty-page.compact { min-height: 190px; }

.record-form { max-width: 720px; margin: 0 auto; padding: 22px; background: white; border: 1px solid var(--line); border-top: 5px solid #1bb6d1; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(8,126,154,.07); }
.field-group { display: grid; gap: 7px; margin-bottom: 19px; }
.field-group > label, .stack-form > label { display: grid; gap: 7px; color: #2b4550; font-size: 13px; font-weight: 700; }
.required { margin-left: 6px; color: var(--coral); font-size: 10px; font-weight: 650; }
.form-control { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #bed9df; border-radius: 6px; background: white; color: var(--ink); }
textarea.form-control { resize: vertical; }
.form-control:focus { border-color: #087e9a; outline: 3px solid #fff7c2; }
.date-picker-input { cursor: pointer; }
.date-picker-input::-webkit-calendar-picker-indicator { width: 24px; height: 24px; padding: 8px; cursor: pointer; }
.field-disabled { opacity: .5; }
.field-disabled .form-control { background: var(--soft); }
.help-text { color: var(--muted); font-size: 11px; }
.field-error, .form-error { color: #9b382f; font-size: 12px; }
.form-error { margin-bottom: 16px; padding: 11px 12px; background: var(--coral-soft); border-left: 3px solid var(--coral); }
.has-error .form-control { border-color: var(--coral); }
.form-actions { position: sticky; bottom: 12px; padding-top: 8px; background: white; }
.roster-picker { display: grid; }
.roster-trigger { width: 100%; min-height: 50px; padding: 8px 12px; display: none; grid-template-columns: 20px minmax(0,1fr) 18px; align-items: center; gap: 9px; border: 1px solid #bed9df; border-radius: 6px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.roster-trigger:hover { border-color: #8cbec7; }
.roster-trigger:focus-visible { border-color: #087e9a; outline: 3px solid #fff7c2; }
.roster-trigger > svg { width: 18px; height: 18px; color: #68838d; }
.roster-trigger > svg:last-child { width: 16px; }
.roster-trigger-content { min-width: 0; display: grid; gap: 5px; }
.roster-placeholder { color: #758991; font-size: 14px; }
.roster-tags { min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.roster-tags:empty { display: none; }
.roster-tags > span { max-width: 100%; padding: 4px 7px; overflow: hidden; border: 1px solid #b9dce2; border-radius: 4px; background: #eaf7f9; color: #076f82; font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.roster-dialog { width: min(520px, calc(100% - 28px)); max-height: min(680px, calc(100dvh - 32px)); margin: auto; padding: 0; overflow: hidden; border: 1px solid #bad5da; border-radius: 8px; background: #f8fbfc; color: var(--ink); box-shadow: 0 24px 70px rgba(18,52,62,.28); }
.roster-dialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.roster-dialog::backdrop { background: rgba(20,48,56,.46); }
.roster-dialog > header { min-height: 70px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #d7e5e8; background: #fff; }
.roster-dialog > header small { color: #087e9a; font-size: 10px; font-weight: 750; }
.roster-dialog > header h2 { margin: 2px 0 0; font-size: 19px; }
.roster-dialog-body { min-height: 0; padding: 12px; display: grid; grid-template-rows: auto minmax(120px,1fr) auto; gap: 10px; overflow: hidden; }
.roster-search { min-height: 46px; padding: 0 11px; display: flex; align-items: center; gap: 8px; border: 1px solid #bed9df; border-radius: 6px; background: #fff; }
.roster-search:focus-within { border-color: #087e9a; outline: 3px solid #fff7c2; }
.roster-search svg { width: 18px; height: 18px; color: #68838d; }
.roster-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.roster-options { min-height: 0; display: grid; align-content: start; border: 1px solid #c9dde1; border-radius: 6px; overflow-y: auto; overscroll-behavior: contain; background: #fff; }
.roster-option { min-height: 50px; padding: 9px 12px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #e3edef; color: #294651; cursor: pointer; }
.roster-option:last-child { border-bottom: 0; }
.roster-option:hover { background: #f2fafb; }
.roster-option.selected { background: #e8f7fa; color: #076f82; font-weight: 700; }
.roster-option input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: #087e9a; }
.roster-option span { min-width: 0; overflow-wrap: anywhere; }
.roster-option[hidden] { display: none; }
.roster-empty { margin: 0; padding: 13px; border: 1px dashed #c7dce0; border-radius: 6px; background: #fff; color: var(--muted); font-size: 12px; text-align: center; }
.roster-dialog > footer { padding: 11px 12px calc(11px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; border-top: 1px solid #d7e5e8; background: #fff; }
.roster-dialog > footer .button { width: 100%; }
.roster-picker.is-enhanced > select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.roster-picker.is-enhanced .roster-trigger { display: grid; }
.export-notice { margin: 8px 0 18px; padding: 13px; display: flex; gap: 10px; background: var(--green-soft); border: 1px solid var(--line); border-radius: 6px; color: var(--green); }
.export-notice div { display: grid; gap: 4px; }
.export-notice p { margin: 0; color: #4b6671; font-size: 12px; line-height: 1.5; }

.customer-identity { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.identity-main { display: flex; align-items: center; gap: 14px; }
.phone-line { margin-top: 5px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-family: Consolas, monospace; font-size: 13px; }
.creator-line { margin-top: 7px; display: flex; align-items: center; gap: 5px; color: #5f7782; font-size: 11px; }
.creator-line svg { width: 14px; height: 14px; }
.alert { min-height: 48px; margin: -8px 0 18px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; border-radius: 6px; font-size: 13px; }
.alert.danger { background: var(--coral-soft); color: #7f312b; border: 1px solid #ecc8c3; }
.alert span { color: #8d4d47; }
.member-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); background: white; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 6px 20px rgba(8,126,154,.06); }
.member-strip > div { min-height: 88px; padding: 17px 18px; display: grid; align-content: center; gap: 7px; border-right: 1px solid var(--line); background: #e7f7fa; }
.member-strip > div:nth-child(2) { background: #f0fbfd; }
.member-strip > div:nth-child(3) { background: #fffadf; }
.member-strip > div:last-child { border-right: 0; }
.member-strip small { color: var(--muted); font-size: 11px; }
.member-strip strong { font-size: 18px; }
.member-strip .level-progress { background: #dff4f8; }
.customer-stats { margin-top: 12px; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.customer-stats > div { min-height: 92px; padding: 15px 14px; display: grid; align-content: center; gap: 8px; border-right: 1px solid #d9ecf0; }
.customer-stats > div:last-child { border-right: 0; }
.customer-stats small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.customer-stats strong { color: #173b4a; font-family: "DIN Alternate", Consolas, monospace; font-size: 21px; line-height: 1.15; }
.customer-stats .is-date strong { font-size: 17px; }
.customer-stats em { margin-left: 3px; color: var(--muted); font-family: inherit; font-size: 12px; font-style: normal; font-weight: 600; }
.detail-actions { margin: 18px 0; display: flex; flex-wrap: wrap; gap: 10px; }
.inventory-band { min-height: 68px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 15px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.profile-facts { min-width: 0; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.profile-facts > span:not(.inventory-trace) { display: grid; gap: 4px; }
.profile-facts small, .inventory-trace { color: var(--muted); font-size: 11px; }
.profile-facts strong { font-size: 15px; }
.profile-actions { display: flex; align-items: center; gap: 8px; }
.profile-actions form { margin: 0; }
.plain-section { margin-top: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.plain-section h2 { margin-bottom: 10px; }
.plain-section p { margin-bottom: 0; color: #4b6671; font-size: 14px; line-height: 1.75; }
.appointment-section { margin-top: 24px; }
.appointment-section > header { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.appointment-section > header h2 { margin: 0; }
.appointment-section > header span { color: var(--muted); font-size: 12px; }
.appointment-list { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.appointment-list-head, .appointment-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(120px, .8fr) minmax(120px, .8fr) auto; align-items: center; gap: 12px; }
.appointment-list-head { min-height: 40px; padding: 8px 16px; background: #f4f8f9; color: #63777e; font-size: 12px; font-weight: 700; }
.appointment-row { min-height: 58px; padding: 10px 16px; border-top: 1px solid #e0eaec; }
.appointment-row > span { min-width: 0; display: grid; gap: 3px; }
.appointment-row small { display: none; color: var(--muted); font-size: 10px; }
.appointment-row strong { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.appointment-status { width: fit-content; padding: 4px 8px; border-radius: 5px; background: #edf6f7; color: #41616b !important; font-size: 12px !important; }
.appointment-status.status-scheduled { background: #e8f7fa; color: #087e9a !important; }
.appointment-status.status-arrived { background: #eef8ef; color: #247c45 !important; }
.appointment-status.status-deal { background: #fff7cf; color: #816600 !important; }
.appointment-status.status-canceled { background: #f1f3f4; color: #73838a !important; }
.appointment-actions { display: flex !important; align-items: center; justify-content: flex-end; }
.appointment-actions form { margin: 0; }
.appointment-cancel-button { min-width: 52px; min-height: 34px; padding: 6px 10px; border: 1px solid #e0b8b3; border-radius: 5px; background: #fff6f4; color: #a94438; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.appointment-cancel-button:hover { background: #fbe6e2; }
.appointment-cancel-button:disabled { border-color: #d9e1e3; background: #f1f3f4; color: #8a989d; cursor: not-allowed; }
.appointment-empty { min-height: 76px; padding: 14px 16px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); font-size: 13px; }
.appointment-empty svg { width: 20px; height: 20px; flex: 0 0 auto; }
.appointment-load-error { min-height: 76px; padding: 14px 16px; display: flex; align-items: center; gap: 10px; border: 1px solid #f0c9c4; border-radius: 6px; background: #fff6f4; color: #a94438; font-size: 13px; }
.appointment-load-error svg { width: 20px; height: 20px; flex: 0 0 auto; }
.appointment-load-error a { margin-left: auto; color: inherit; font-weight: 700; white-space: nowrap; }
.preserve-lines { white-space: pre-line; }

.timeline-section { margin-top: 28px; }
.timeline-section > header { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.timeline-section > header span { color: var(--muted); font-size: 12px; }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; top: 20px; bottom: 20px; left: 20px; width: 1px; background: #b8dbe2; }
.timeline-item { position: relative; display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 12px; margin-bottom: 14px; }
.timeline-icon { z-index: 1; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: white; border: 1px solid var(--line); color: var(--green); }
.kind-risk .timeline-icon { color: var(--coral); border-color: #e4bcb7; background: var(--coral-soft); }
.kind-followup .timeline-icon { color: var(--blue); background: var(--blue-soft); border-color: #b8e2ea; }
.timeline-content { padding: 17px 18px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(8,126,154,.05); }
.timeline-content > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.timeline-content > header > div { display: grid; gap: 4px; }
.timeline-content > header span { color: var(--muted); font-size: 11px; }
.timeline-content p { margin: 12px 0 0; color: #4b6671; font-size: 13px; line-height: 1.65; }
.timeline-content p b { color: var(--ink); }
.timeline-content .visit-staff { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.visit-staff span { padding: 3px 6px; border: 1px solid #c9e2e7; border-radius: 4px; background: #eff9fb; color: #315966; font-size: 11px; }
.visit-note-list { margin-top: 13px; display: grid; gap: 8px; }
.visit-note-list section { padding: 10px 11px; border-left: 3px solid #31a7be; background: #f3fafc; }
.visit-note-list section:nth-child(2) { border-left-color: #f0cf35; background: #fffdf2; }
.visit-note-list section:nth-child(3) { border-left-color: #54a17e; background: #f3faf6; }
.visit-note-list section.legacy-note { border-left-color: #9caeb4; background: #f6f8f8; }
.visit-note-list section > strong { color: #294f5c; font-size: 12px; }
.timeline-content .visit-note-list p { margin-top: 5px; }
.existing-attachments-readonly { padding: 10px; border: 1px solid #c8e1e6; border-radius: 6px; background: #f5fbfc; }
.existing-attachments-readonly header { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.existing-attachments-readonly header span { display: flex; align-items: center; gap: 6px; color: #286779; font-size: 12px; font-weight: 750; }
.existing-attachments-readonly header svg { width: 16px; }
.existing-attachments-readonly header small { color: var(--muted); font-size: 10px; }
.existing-attachments-readonly > div { display: grid; grid-template-columns: repeat(auto-fill,minmax(72px,1fr)); gap: 7px; }
.existing-attachments-readonly img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; border-radius: 5px; }
.timeline-content .amount { margin-top: 11px; font-family: Consolas, monospace; color: var(--green); font-size: 22px; font-weight: 750; }
.status-pill { padding: 4px 7px; border-radius: 5px; background: var(--soft); color: var(--muted); font-size: 10px; font-weight: 750; }
.status-pill.success { background: var(--green-soft); color: var(--green); }
.status-pill.danger { background: var(--coral-soft); color: var(--coral); }
.visit-statuses { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.status-pill.surgery { border: 1px solid #ead875; background: #fff9d8; color: #6f5900; }
.next-contact { display: flex; align-items: center; gap: 6px; color: var(--blue) !important; }
.next-contact svg { width: 16px; }
.timeline-content footer { margin-top: 15px; padding-top: 11px; display: flex; align-items: center; gap: 12px; border-top: 1px solid #ddeef2; color: var(--muted); font-size: 11px; }
.timeline-content footer span { margin-right: auto; }
.timeline-content footer a, .timeline-content footer button { padding: 0; border: 0; background: transparent; color: var(--green-2); cursor: pointer; }
.attachment-grid { margin-top: 13px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.attachment-grid a { width: 100%; aspect-ratio: 1; display: block; overflow: hidden; border-radius: 5px; background: var(--soft); }
.attachment-grid img { width: 100%; height: 100%; display: block; object-fit: cover; }
.attachment-item { position: relative; min-width: 0; }
.attachment-action-trigger { display: none; }
.attachment-delete-button { position: absolute; z-index: 2; top: 5px; right: 5px; width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.86); border-radius: 50%; background: rgba(151,49,43,.92); color: white; box-shadow: 0 3px 9px rgba(48,31,29,.25); cursor: pointer; touch-action: manipulation; }
.attachment-delete-button:hover { background: #8d2824; }
.attachment-delete-button:focus-visible { outline: 3px solid rgba(240,207,53,.72); outline-offset: 2px; }
.attachment-delete-button:disabled { opacity: .55; cursor: wait; }
.attachment-delete-button svg { width: 16px; height: 16px; stroke-width: 2.5; }
.attachment-empty { grid-column: 1 / -1; margin: 0; padding: 18px 10px; border: 1px dashed #bed9df; border-radius: 5px; background: #f7fbfc; color: var(--muted); text-align: center; font-size: 12px; }
.attachment-control-error,
.attachment-delete-error { margin: 8px 0 0; color: #9b382f; font-size: 12px; }
.attachment-preview-dialog { inset: 0; width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: #101719; color: white; }
.attachment-preview-dialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr); }
.attachment-preview-dialog::backdrop { background: #101719; }
.attachment-preview-dialog > header { min-height: 56px; padding: max(10px,env(safe-area-inset-top)) 12px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(61,184,202,.52); background: rgba(16,23,25,.96); }
.attachment-preview-dialog > header strong { font-size: 14px; letter-spacing: 0; }
.attachment-preview-dialog > header button { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.34); border-radius: 50%; background: rgba(255,255,255,.08); color: white; cursor: pointer; }
.attachment-preview-dialog > header button:focus-visible { outline: 3px solid rgba(240,207,53,.82); outline-offset: 2px; }
.attachment-preview-dialog > header svg { width: 19px; height: 19px; }
.attachment-preview-stage { min-width: 0; min-height: 0; padding: 12px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); display: grid; place-items: center; overflow: hidden; }
.attachment-preview-stage img { max-width: 100%; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); width: auto; height: auto; display: block; object-fit: contain; }
.attachment-preview-stage p { margin: 0; color: rgba(255,255,255,.82); font-size: 14px; text-align: center; }
.attachment-preview-stage img[hidden],
.attachment-preview-stage p[hidden] { display: none; }
.attachment-preview-stage [data-attachment-preview-error] { color: #ffd2cc; }
.more-actions { width: fit-content; margin: 30px 0 0 auto; color: #6c8791; font-size: 11px; }
.more-actions summary { display: flex; align-items: center; justify-content: flex-end; gap: 5px; cursor: pointer; list-style: none; }
.more-actions summary::-webkit-details-marker { display: none; }
.more-actions summary svg { width: 15px; height: 15px; }
.more-actions > div { margin-top: 9px; padding: 12px; background: white; border: 1px solid #ead3d0; border-radius: 6px; text-align: right; }
.more-actions p { margin: 0 0 8px; color: var(--muted); font-size: 10px; }
.text-danger { border: 0; background: transparent; color: var(--coral); cursor: pointer; }

.north-star { min-height: 150px; padding: 24px 26px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; background: #087e9a; color: white; border-top: 5px solid var(--sun); border-radius: var(--radius); box-shadow: 0 10px 24px rgba(8,126,154,.18); }
.north-star > div { grid-row: span 2; }
.north-star span, .north-star p, .north-star small { color: #d6f0f5; }
.north-star span { font-size: 11px; font-weight: 700; }
.north-star h2 { margin: 7px 0 6px; font-size: 22px; }
.north-star p { margin: 0; font-size: 12px; }
.north-star > strong { font-family: Consolas, monospace; font-size: 38px; text-align: right; }
.north-star > small { text-align: right; }
.metric-row { margin: 18px 0 28px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: white; overflow: hidden; box-shadow: 0 5px 18px rgba(8,126,154,.055); }
.metric { min-height: 105px; padding: 17px; display: grid; align-content: center; gap: 5px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric small, .metric span { color: var(--muted); font-size: 11px; }
.metric strong { font-family: "DIN Alternate", Consolas, monospace; font-size: 24px; color: #087e9a; }
.level-overview { margin: 0 0 28px; background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 5px 18px rgba(8,126,154,.055); }
.level-overview > header { min-height: 66px; padding: 13px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.level-overview > header > span { color: var(--muted); font-size: 11px; }
.level-grid { display: grid; grid-template-columns: repeat(9,minmax(0,1fr)); }
.level-card { min-width: 0; min-height: 94px; padding: 14px 8px; display: grid; align-content: center; justify-items: center; gap: 6px; border-right: 1px solid var(--line); border-top: 4px solid #3cb8d2; background: #f7fcfd; }
.level-card:last-child { border-right: 0; }
.level-card:nth-child(2), .level-card:nth-child(5), .level-card:nth-child(8) { border-top-color: #087e9a; background: #ebf8fb; }
.level-card:nth-child(3), .level-card:nth-child(6), .level-card:nth-child(9) { border-top-color: var(--sun); background: #fffddf; }
.level-card > small { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.level-card > button { padding: 0; display: inline-flex; align-items: baseline; gap: 3px; border: 0; background: transparent; color: #087e9a; cursor: pointer; }
.level-card > button strong { font-family: "DIN Alternate", Consolas, monospace; font-size: 25px; text-decoration: underline; text-decoration-color: var(--sun); text-underline-offset: 4px; }
.level-card > button span { color: var(--muted); font-size: 10px; }
.member-dialog { width: min(620px, calc(100% - 28px)); max-height: min(720px, calc(100vh - 36px)); max-height: min(720px, calc(100dvh - 36px)); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: white; color: var(--ink); box-shadow: 0 24px 70px rgba(8,63,79,.26); }
.member-dialog[open] { display: flex; flex-direction: column; }
.member-dialog::backdrop { background: rgba(18,55,69,.44); }
.member-dialog > header { position: sticky; z-index: 2; top: 0; min-height: 72px; padding: 14px 17px; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; background: #f0fafd; border-bottom: 1px solid var(--line); }
.member-dialog-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.member-dialog-list > a { min-height: 72px; padding: 10px 14px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto 18px; align-items: center; gap: 10px; border-bottom: 1px solid #ddeef2; }
.member-dialog-list > a:hover { background: #f0fafd; }
.member-dialog-list > a > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.member-dialog-list > a small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.member-dialog-list > a b { color: #087e9a; font-family: Consolas, monospace; font-size: 12px; }
.member-dialog-list > a > svg { width: 17px; color: #829aa3; }
.data-section { margin-top: 22px; background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.data-section > header { min-height: 70px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.data-section > header > span { color: var(--muted); font-size: 12px; }
.rfm-match-count strong { margin: 0 2px; color: var(--green); font-size: 16px; }
.rfm-pagination-error { margin: 0; padding: 10px 18px; border-bottom: 1px solid #ecc8c3; background: var(--coral-soft); color: #7f312b; font-size: 12px; }
.rfm-pagination button, .cohort-pagination button { padding: 0; border: 0; background: transparent; color: #9aaeb5; font: inherit; font-weight: 750; cursor: not-allowed; opacity: 1; }
.cohort-pagination-error { min-height: 46px; padding: 9px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #ecc8c3; background: var(--coral-soft); color: #7f312b; font-size: 12px; }
.cohort-pagination-error a { flex: 0 0 auto; color: #7f312b; font-weight: 750; text-decoration: underline; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { min-width: 94px; padding: 12px 14px; text-align: left; border-bottom: 1px solid #ddeef2; white-space: nowrap; }
th { color: var(--muted); background: #f1fafc; font-size: 11px; }
td small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
td a { color: var(--green-2); font-weight: 700; }

.login-shell { width: 100%; min-height: 100vh; padding: 24px; display: grid; place-items: center; background: #e8f7fa; }
.login-panel { width: min(400px, 100%); padding: 30px; background: white; border: 1px solid var(--line); border-top: 5px solid #1bb6d1; border-radius: var(--radius); box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 30px; }
.login-brand h1 { font-size: 22px; }
.login-brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.stack-form { display: grid; gap: 18px; }
.toast-stack { position: fixed; z-index: 100; top: 78px; right: 20px; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 12px 15px; border-radius: 6px; background: var(--green); color: white; box-shadow: var(--shadow); font-size: 13px; transition: opacity .2s, transform .2s; }
.toast.error { background: var(--coral); }
.toast-hide { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.mobile-nav { display: none; }

@media (max-width: 760px) {
  body { background: #edf9fb; }
  .site-header { position: sticky; height: 58px; padding: 0 14px; border-top-width: 3px; }
  .brand { min-width: 0; }
  .brand strong { font-size: 14px; }
  .brand small { display: none; }
  .brand-mark { width: 31px; height: 31px; }
  .desktop-nav { display: none; }
  .logout-form { margin-left: auto; }
  .site-header .icon-button { width: 36px; height: 36px; border: 0; background: var(--soft); }
  .page-shell { width: 100%; padding: 16px 14px calc(86px + env(safe-area-inset-bottom)); }
  h1 { font-size: 23px; }
  .page-heading, .today-header { align-items: flex-start; margin-bottom: 17px; }
  .today-header .button, .page-heading .button { min-height: 42px; padding: 0 11px; }
  .heading-actions .button { font-size: 12px; }
  .heading-actions { flex-wrap: wrap; justify-content: flex-end; }
  .search-bar { margin-bottom: 18px; height: 56px; }
  .customer-filter-form { margin-bottom: 14px; }
  .customer-filter-form .search-bar { margin-bottom: 9px; }
  .filter-panel { margin-inline: -1px; }
  .filter-fields { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .filter-fields label:first-child { grid-column: 1 / -1; }
  .filter-actions .button { flex: 1; min-height: 42px; }
  .action-board { grid-template-columns: 1fr; gap: 14px; }
  .action-section > header { min-height: 48px; }
  .action-row { min-height: 72px; }
  .member-badge { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav {
    position: fixed;
    z-index: 70;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: calc(66px + env(safe-area-inset-bottom));
    padding: 5px max(6px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    overflow: visible;
    background: rgba(248,253,254,.97);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(8,126,154,.10);
  }
  .mobile-nav > a, .mobile-nav > button {
    min-width: 0;
    min-height: 54px;
    padding: 3px 1px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: #536d78;
    font-size: 11px;
    line-height: 1.15;
    cursor: pointer;
    touch-action: manipulation;
  }
  .mobile-nav > a > span, .mobile-nav > button > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav svg { width: 21px; height: 21px; }
  .mobile-nav .mobile-add { justify-self: center; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--sun); color: var(--ink); box-shadow: 0 7px 16px rgba(164,132,0,.24); }
  .mobile-nav .mobile-add svg { width: 25px; height: 25px; }
  .mobile-nav a.current:not(.mobile-add) { color: #087e9a; font-weight: 750; }
  .mobile-nav a.current:not(.mobile-add) svg { stroke-width: 2.4; }
  .customer-list { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .customer-row { padding-inline: 14px; grid-template-columns: 40px minmax(0,1fr) auto 16px; gap: 9px; }
  .customer-value strong { font-size: 12px; }
  .customer-name-line { gap: 7px; }
  .customer-name-line > small { font-size: 9px; }
  .record-form { margin-inline: -14px; padding: 18px 14px 24px; border-left: 0; border-right: 0; border-radius: 0; box-shadow: none; }
  .form-control { min-height: 48px; font-size: 16px; }
  .customer-identity { margin-bottom: 15px; }
  .identity-main { gap: 11px; }
  .avatar.large { width: 49px; height: 49px; }
  .member-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .member-strip > div { min-height: 78px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
  .member-strip > div:nth-child(2) { border-right: 0; }
  .member-strip > div:nth-last-child(-n+2) { border-bottom: 0; }
  .member-strip strong { font-size: 16px; }
  .customer-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .customer-stats > div { min-height: 94px; padding: 14px 10px; border-bottom: 1px solid #e3efed; }
  .customer-stats > div:nth-child(3n) { border-right: 0; }
  .customer-stats > div:nth-last-child(-n+3) { border-bottom: 0; }
  .customer-stats small { font-size: 12px; }
  .customer-stats strong { font-size: 21px; }
  .customer-stats .is-date strong { font-size: 15px; }
  .detail-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-actions .subtle { grid-column: auto; }
  .detail-actions .button { width: 100%; }
  .inventory-band { align-items: stretch; flex-direction: column; }
  .profile-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .inventory-trace { grid-column: 1 / -1; }
  .profile-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-actions .button, .profile-actions button { width: 100%; }
  .timeline-section { margin-inline: -4px; }
  .appointment-section { margin-inline: -4px; }
  .appointment-list-head { display: none; }
  .appointment-row { min-height: 72px; padding: 11px 12px; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, .8fr) auto; gap: 8px; border-top: 1px solid #e0eaec; }
  .appointment-row:first-child { border-top: 0; }
  .appointment-row small { display: block; }
  .appointment-row strong { font-size: 12px; }
  .appointment-cancel-button { min-width: 44px; min-height: 32px; padding-inline: 6px; }
  .timeline-item { grid-template-columns: 34px minmax(0,1fr); gap: 8px; }
  .timeline::before { left: 17px; }
  .timeline-icon { width: 34px; height: 34px; }
  .timeline-icon svg { width: 17px; height: 17px; }
  .timeline-content { padding: 14px; }
  .attachment-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .north-star { padding: 20px; grid-template-columns: 1fr auto; }
  .north-star h2 { font-size: 17px; }
  .north-star > strong { font-size: 29px; }
  .metric-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric { min-height: 92px; border-bottom: 1px solid var(--line); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-last-child(-n+2) { border-bottom: 0; }
  .level-overview { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .level-overview > header { min-height: 62px; padding-inline: 14px; }
  .level-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .level-card { min-height: 82px; border-bottom: 1px solid var(--line); }
  .level-card:nth-child(3n) { border-right: 0; }
  .level-card:nth-last-child(-n+3) { border-bottom: 0; }
  .level-card > button strong { font-size: 23px; }
  .member-dialog { width: calc(100% - 28px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); margin: auto; border-radius: 8px; }
  .data-section { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .data-section > header { align-items: flex-start; gap: 12px; }
  .north-star { min-height: 138px; padding: 19px 17px; }
  .login-shell { padding: 18px; }
  .login-panel { padding: 24px 20px; }
  .toast-stack { top: 64px; left: 14px; right: 14px; }
  .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* SaaS clarity layer: a stable operations shell with restrained pool-tile accents. */
:root {
  --ink: #17343e;
  --muted: #60757d;
  --line: #d3e3e7;
  --soft: #f3f8f9;
  --green: #087e92;
  --green-2: #0794a9;
  --green-soft: #e8f6f8;
  --sun: #f4d64e;
  --shadow: 0 8px 24px rgba(22, 64, 76, .08);
}

html { scroll-behavior: smooth; }
body { overflow-x: hidden; background: #f4f8f9; }
button, a, summary { touch-action: manipulation; }
button:disabled { cursor: wait; opacity: .72; }
h1, h2 { text-wrap: balance; }
h1, h2, h3 { scroll-margin-top: 84px; }
table, .metric strong, .north-star > strong, .customer-value strong, .customer-stats strong { font-variant-numeric: tabular-nums; }
select.form-control { background-color: #fff; color: var(--ink); }

.skip-link {
  position: fixed;
  z-index: 200;
  top: 8px;
  left: 8px;
  padding: 9px 12px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.app-sidebar { display: none; }

.button { min-height: 44px; border-radius: 6px; box-shadow: none; transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
.button.primary { background: var(--green); box-shadow: 0 4px 10px rgba(8, 126, 146, .16); }
.button.primary:hover { background: #066b7d; box-shadow: 0 6px 14px rgba(8, 126, 146, .2); }
.button.secondary:hover, .button.subtle:hover { border-color: #7fc8d4; background: #eaf6f8; color: #066b7d; }
.button.is-loading svg { animation: button-spin .8s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }
.icon-button { border-color: #c9dde2; transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
.icon-button:hover { border-color: #8ccbd5; background: var(--green-soft); }

.mobile-account-button {
  width: 38px;
  height: 38px;
  margin-left: auto;
  display: grid;
  place-items: center;
  border: 1px solid #c5dfe4;
  border-radius: 50%;
  background: #fff;
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}

.page-shell { width: min(1180px, calc(100% - 48px)); padding-top: 34px; }
.page-heading, .today-header { min-height: 64px; margin-bottom: 20px; }
.page-heading h1, .today-header h1 { position: relative; padding-bottom: 8px; }
.page-heading h1::after, .today-header h1::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--sun);
  content: "";
}
.page-heading.compact h1::after { width: 24px; }
.eyebrow { color: #6c8087; font-weight: 700; }

.search-bar { border-color: #cadfe4; box-shadow: 0 3px 10px rgba(25, 70, 82, .045); }
.search-bar:focus-within { border-color: #63b9c7; box-shadow: 0 0 0 3px rgba(244, 214, 78, .35); }
.search-bar input::placeholder { color: #8b9ba1; }
.search-bar button { background: #edf7f8; transition: background-color .16s ease, color .16s ease; }
.search-bar button:hover { background: #dff1f4; color: #056779; }
.filter-panel { border-color: #cedfe3; background: #fff; }
.filter-panel summary:hover { background: #f3f8f9; }

.action-board { gap: 18px; }
.action-section { border-color: #d2e1e5; border-left-width: 3px; box-shadow: 0 4px 14px rgba(24, 65, 76, .055); }
.action-section > header { min-height: 56px; background: #fbfdfd; }
.action-section > header > div { gap: 10px; }
.section-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; background: #edf5f6; color: #62818a; }
.section-icon svg { width: 17px; height: 17px; }
.tone-danger > header { background: #fffafa; }
.tone-danger .section-icon { background: #fff0ef; color: var(--coral); }
.tone-surgery { border-left-color: #4b9b78; }
.tone-surgery > header { background: #f7fcf9; }
.tone-surgery .section-icon { background: #e6f5ed; color: #267654; }
.tone-care > header, .tone-primary > header { background: #f8fcfd; }
.tone-care .section-icon, .tone-primary .section-icon { background: #e6f5f8; color: var(--green); }
.tone-warning > header { background: #fffdf5; }
.tone-warning .section-icon { background: #fff8d7; color: #806700; }
.action-section > header strong { border-radius: 6px; background: #edf4f5; font-variant-numeric: tabular-nums; }
.action-row { min-height: 72px; border-bottom-color: #e4ecee; transition: background-color .14s ease; }
.action-row:hover { background: #f7fbfc; }
.action-follow { background: #f0f7f8; }
.member-badge { border: 1px solid #f0df7b; background: #fff9d8; }
.avatar { border-color: #c8e3e8; background: #e9f7f9; }

.customer-list-meta { margin: 0 0 9px; display: flex; align-items: baseline; gap: 4px; color: var(--muted); font-size: 12px; }
.customer-list-meta strong { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.customer-list-meta small { margin-left: auto; color: #7a8d93; }
.customer-list-limit-hint { margin: 6px 0 0; color: #7a8d93; font-size: 11px; text-align: center; }
.deleted-customer-list { border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.deleted-customer-row { min-height: 84px; padding: 11px 14px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid #e2ebed; }
.deleted-customer-row:last-child { border-bottom: 0; }
.deleted-customer-copy { min-width: 0; display: grid; gap: 3px; }
.deleted-customer-copy strong { font-size: 15px; }
.deleted-customer-copy small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.deleted-customer-row form { margin: 0; }
.customer-list { border-color: #cedfe3; box-shadow: 0 4px 16px rgba(24, 65, 76, .055); }
.customer-list-head {
  min-height: 42px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 42px minmax(220px, 1fr) 160px 150px 20px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #d7e4e7;
  background: #f4f8f9;
  color: #71858c;
  font-size: 11px;
  font-weight: 700;
}
.customer-row { grid-template-columns: 42px minmax(220px, 1fr) 160px 150px 20px; border-bottom-color: #e1eaec; transition: background-color .14s ease; }
.customer-row:hover { background: #f5fafb; }
.customer-last-visit { color: #4f6871; font-size: 12px; font-variant-numeric: tabular-nums; }
.customer-name-line > small { display: none; }
.risk-flag { width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--coral-soft); color: #bd4d48; }
.risk-flag { flex: 0 0 auto; }
.risk-flag svg { width: 13px; height: 13px; }
.mobile-visit-dates { display: none; }
.customer-last-visit { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: baseline; gap: 2px 7px; }
.customer-last-visit small { color: #7b8d93; font-size: 10px; }
.customer-last-visit b { color: #405a63; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.customer-value strong { color: #23434d; font-family: "Bahnschrift", "Microsoft YaHei UI", sans-serif; }

.record-form { max-width: 820px; padding: 28px 30px; border: 1px solid #cedfe3; border-top: 4px solid #21afc1; box-shadow: 0 8px 26px rgba(24, 65, 76, .07); }
.field-group { margin-bottom: 22px; }
.field-group > label, .stack-form > label { color: #294650; font-size: 13px; }
.field-group > label { display: block; }
.form-control { min-height: 48px; border-color: #c8dadd; background: #fff; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.form-control:hover { border-color: #95bec6; }
.form-control:focus { border-color: var(--green); outline: 0; box-shadow: 0 0 0 3px rgba(244, 214, 78, .4); }
.checkbox-field { margin: 4px 0 22px; }
.checkbox-label { min-height: 68px; padding: 12px 14px; display: flex !important; align-items: center; gap: 12px; border: 1px solid #c8dadd; border-radius: 6px; background: #f8fbfc; cursor: pointer; }
.checkbox-label:hover { border-color: #8cbec7; background: #f2f9fa; }
.checkbox-label:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(244, 214, 78, .4); }
.checkbox-input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--green); cursor: pointer; }
.checkbox-label > span { min-width: 0; display: grid; gap: 4px; }
.checkbox-label strong { color: var(--ink); font-size: 14px; }
.checkbox-label small { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.45; }
.form-actions { position: static; bottom: auto; margin: 8px -4px -4px; padding: 16px 4px 4px; border-top: 1px solid #e3ebed; }
.required { padding: 2px 5px; display: inline-flex; border-radius: 4px; background: #fff0ef; vertical-align: 1px; }
.inline-radio-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.inline-radio-field legend { margin-bottom: 9px; color: #294650; font-size: 13px; font-weight: 700; }
.inline-radio-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.inline-radio-option { min-height: 48px; padding: 10px 14px; display: flex; align-items: center; gap: 9px; border: 1px solid #c8dadd; border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; }
.inline-radio-option:hover { border-color: #95bec6; }
.inline-radio-option:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(244, 214, 78, .4); }
.inline-radio-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.inline-radio-option:has(input:checked) { border-color: var(--green); background: #f2faf9; }

.customer-identity { min-height: 92px; }
.member-strip, .customer-stats, .inventory-band { border-color: #cedfe3; box-shadow: 0 3px 12px rgba(24, 65, 76, .04); }
.member-strip > div { background: #fff; }
.member-strip > div:nth-child(2) { background: #f8fbfc; }
.member-strip > div:nth-child(3) { background: #fffbe6; }
.member-strip .level-progress { background: #edf8fa; }
.customer-stats > div { border-right-color: #e0e9eb; }
.detail-actions .button { min-width: 138px; }
.timeline-content { border-color: #d2e1e5; box-shadow: 0 3px 12px rgba(24, 65, 76, .045); }
.timeline-content footer { border-top-color: #e3ebed; }

.north-star { background: #087b8e; box-shadow: 0 10px 24px rgba(8, 95, 111, .16); }
.metric-row, .level-overview, .data-section { border-color: #cedfe3; box-shadow: 0 4px 16px rgba(24, 65, 76, .045); }
.metric { border-right-color: #dce7e9; }
.level-card { background: #fbfdfd; }
.level-card:nth-child(2), .level-card:nth-child(5), .level-card:nth-child(8) { background: #f1f9fa; }
.level-card:nth-child(3), .level-card:nth-child(6), .level-card:nth-child(9) { background: #fffbea; }
th { background: #f4f8f9; color: #63777e; }
tbody tr:hover { background: #f7fbfc; }

.account-sheet {
  width: min(420px, calc(100% - 28px));
  max-height: min(680px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(18, 52, 62, .24);
}
.account-sheet::backdrop { background: rgba(20, 48, 56, .42); }
.account-sheet > header { min-height: 72px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.account-sheet > header p, .account-sheet > header h2 { margin-bottom: 0; }
.account-facts { padding: 18px 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.account-facts span { min-height: 72px; padding: 12px; display: grid; align-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; background: #f7fafb; }
.account-facts small { color: var(--muted); font-size: 11px; }
.account-facts strong { font-size: 14px; }
.account-sheet > form { padding: 0 16px 18px; }

@media (min-width: 761px) {
  body.has-app-shell { padding-left: 244px; }
  .site-header { display: none; }
  .app-sidebar {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    width: 244px;
    padding: 22px 16px 16px;
    display: flex;
    flex-direction: column;
    background: #0b5263;
    color: #fff;
    border-right: 1px solid #0a4553;
    box-shadow: 5px 0 18px rgba(17, 55, 65, .09);
  }
  .sidebar-brand { min-height: 54px; padding: 0 8px; }
  .sidebar-brand strong { color: #fff; font-size: 17px; }
  .sidebar-brand small { color: #b8dce3; }
  .sidebar-brand .brand-mark { background: #fff; color: #0b5263; border-bottom-color: var(--sun); }
  .nav-label { margin: 32px 10px 10px; color: #9dcbd4; font-size: 11px; font-weight: 700; }
  .desktop-nav { height: auto; display: grid; align-content: start; gap: 6px; }
  .desktop-nav a, .desktop-nav button {
    position: relative;
    min-height: 48px;
    padding: 0 12px;
    gap: 11px;
    border: 0;
    border-radius: 6px;
    color: #d8ebef;
    font-size: 14px;
    font-weight: 650;
  }
  .desktop-nav a:hover, .desktop-nav a:focus-visible, .desktop-nav button:hover, .desktop-nav button:focus-visible { border: 0; background: rgba(255, 255, 255, .1); color: #fff; }
  .desktop-nav a.current { border: 0; background: #fff; color: #0b5263; }
  .desktop-nav a.current::after { position: absolute; right: 9px; width: 4px; height: 20px; border-radius: 3px; background: var(--sun); content: ""; }
  .nav-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 5px; background: rgba(255, 255, 255, .08); }
  .nav-icon svg { width: 17px; height: 17px; }
  .desktop-nav a.current .nav-icon { background: #e5f4f6; }
  .sidebar-user { margin-top: auto; padding: 14px 8px 2px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 34px; align-items: center; gap: 10px; border-top: 1px solid rgba(255, 255, 255, .15); }
  .user-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #e8f6f8; color: #0b5263; font-weight: 800; }
  .user-copy { min-width: 0; display: grid; gap: 3px; }
  .user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-copy strong { font-size: 13px; }
  .user-copy small { color: #a9d2da; font-size: 10px; }
  .sidebar-user form { margin: 0; }
  .sidebar-logout { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .08); color: #d7ebef; cursor: pointer; }
  .sidebar-logout:hover { background: rgba(255, 255, 255, .16); color: #fff; }
  .sidebar-logout svg { width: 17px; height: 17px; }
  .page-shell { width: min(1180px, calc(100% - 56px)); }
  .toast-stack { left: 268px; right: auto; }
}

@media (max-width: 760px) {
  body { background: #f4f9fa; }
  .site-header { background: rgba(255, 255, 255, .98); border-top-color: #20afc1; box-shadow: 0 2px 12px rgba(24, 65, 76, .08); }
  .site-header .brand small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-shell { padding-top: 18px; }
  .page-heading, .today-header { min-height: 58px; }
  .page-heading { flex-wrap: wrap; }
  .page-heading .heading-actions { width: 100%; justify-content: flex-start; }
  .page-heading h1, .today-header h1 { padding-bottom: 7px; }
  .search-bar { height: 54px; margin-bottom: 16px; box-shadow: none; }
  .action-board { gap: 12px; }
  .action-section { border-left-width: 3px; box-shadow: none; }
  .action-section > header { min-height: 52px; }
  .section-icon { width: 28px; height: 28px; }
  .action-row { padding-left: 12px; }
  .customer-list-meta { padding: 0 2px; }
  .customer-list-head, .customer-last-visit { display: none; }
  .customer-row { grid-template-columns: 40px minmax(0, 1fr) auto 16px; gap: 9px; }
  .customer-row { min-height: 88px; }
  .mobile-visit-dates { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .mobile-visit-dates small { color: #357d91; font-size: 9px; }
  .customer-name-line > small { display: block; }
  .customer-list { box-shadow: none; }
  .deleted-customer-list { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .deleted-customer-row { min-height: 92px; padding-inline: 14px; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 9px; }
  .deleted-customer-row .button { width: 44px; min-width: 44px; padding: 0; font-size: 0; }
  .deleted-customer-row .button svg { width: 19px; }
  .record-form { padding-top: 20px; }
  .form-actions { margin-inline: -2px; }
  .member-strip, .customer-stats, .inventory-band { box-shadow: none; }
  .detail-actions .button { min-width: 0; }
  .north-star, .metric-row, .level-overview, .data-section { box-shadow: none; }
  .mobile-nav { grid-template-columns: repeat(5, 1fr); background: rgba(255, 255, 255, .98); box-shadow: 0 -4px 18px rgba(24, 65, 76, .09); }
  .mobile-nav > button svg { width: 21px; height: 21px; }
  .account-sheet {
    width: calc(100% - 24px);
    max-height: calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin: auto;
    border-radius: 8px;
  }
  .page-back-link { margin: -4px 0 6px; }
  .member-dialog { overscroll-behavior: contain; }
}

@media (prefers-reduced-motion: reduce) {
  .button.is-loading svg { animation: none; }
}

/* Member operations workflow */
.nav-icon-badge, .mobile-nav-badge { position: relative; }
[data-task-count][hidden] { display: none !important; }
.nav-icon-badge b, .mobile-nav-badge b {
  position: absolute;
  z-index: 2;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 10px;
  background: #e5544f;
  color: #fff;
  font-size: 9px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.nav-icon-badge b { top: -8px; right: -10px; }
.mobile-nav-badge b { top: 0; left: calc(50% + 5px); }

.task-stats { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.task-stat { min-height: 90px; padding: 14px 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-top: 3px solid #63b9c7; border-radius: 6px; background: #fff; }
.task-stat:hover { border-color: #8ccbd5; background: #f8fcfd; }
.task-stat span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.task-stat span svg { width: 18px; }
.task-stat strong { color: var(--ink); font-family: "Bahnschrift", "Microsoft YaHei UI", sans-serif; font-size: 30px; }
.task-stat.danger { border-top-color: #e66a63; }
.task-stat.success { border-top-color: #4b9b78; }
.task-stat.warning { border-top-color: var(--sun); }
.upcoming-followups { min-height: 58px; margin: -7px 0 18px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; border: 1px solid #b9dfe7; border-left: 4px solid #2d9fc0; border-radius: 6px; background: #f4fbfd; }
.upcoming-followups:hover, .upcoming-followups.current { background: #e9f7fa; border-color: #8fcfdb; }
.upcoming-followups > span { min-width: 0; display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; column-gap: 8px; }
.upcoming-followups > span svg { grid-row: 1 / span 2; width: 19px; color: #248aa6; }
.upcoming-followups > span strong { font-size: 13px; }
.upcoming-followups > span small { color: var(--muted); font-size: 10px; }
.upcoming-followups > b { margin-left: auto; color: #176f88; font-size: 22px; }
.upcoming-followups > svg { width: 18px; color: #6d929d; }
.upcoming-hint { color: #287c92; font-size: 10px; }

.team-board { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.team-board > header { min-height: 66px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.team-board > header h2, .team-board > header p { margin: 0; }
.team-board > header h2 { font-size: 17px; }
.team-board > header > span { color: var(--muted); font-size: 12px; }
.team-row { min-height: 68px; padding: 9px 14px; display: grid; grid-template-columns: 40px minmax(150px, 1fr) repeat(3, 90px) 18px; align-items: center; gap: 12px; border-bottom: 1px solid #e4ecee; }
.team-row:last-child { border-bottom: 0; }
.team-row:hover, .team-row.selected { background: #f0f8fa; }
.team-name, .team-row > span:not(.avatar) { min-width: 0; display: grid; gap: 3px; }
.team-row small { color: var(--muted); font-size: 11px; }
.team-row b { font-size: 15px; font-variant-numeric: tabular-nums; }
.danger-text { color: #c94944; }

.task-filter { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.task-filter .form-control { width: auto; min-width: 150px; min-height: 42px; }
.task-type-tabs { margin-bottom: 10px; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.task-type-tabs a { min-width: fit-content; min-height: 38px; padding: 0 11px; display: flex; align-items: center; gap: 7px; border: 1px solid #cbdde1; border-radius: 6px; background: #fff; color: #536d78; font-size: 12px; font-weight: 700; }
.task-type-tabs a.current { border-color: #75bdc9; background: #eaf6f8; color: #076e80; }
.task-type-tabs b { min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 4px; background: #edf3f4; font-size: 10px; font-variant-numeric: tabular-nums; }
.task-type-tabs a.current b { background: #fff; }
.segmented-control { min-height: 42px; padding: 3px; display: inline-flex; align-items: stretch; gap: 2px; border: 1px solid #cbdde1; border-radius: 6px; background: #edf4f5; }
.segmented-control a { min-width: 86px; padding: 0 13px; display: grid; place-items: center; border-radius: 4px; color: #536d78; font-size: 13px; font-weight: 700; }
.segmented-control a.current { background: #fff; color: #087e92; box-shadow: 0 1px 4px rgba(24, 65, 76, .12); }

.task-list { border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.task-item { min-height: 98px; padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid #e2ebed; }
.task-item:last-child { border-bottom: 0; }
.task-item:has(.task-select) { grid-template-columns: 24px minmax(0, 1fr) auto; }
.task-item.is-overdue { border-left: 4px solid #e15b55; background: #fffafa; }
.task-item.is-completed { background: #f9fcfb; }
.task-select { width: 22px; height: 44px; display: grid; place-items: center; }
.task-select input { width: 20px; height: 20px; accent-color: var(--green); }
.task-main { min-width: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 11px; }
.task-copy { min-width: 0; display: grid; gap: 5px; }
.task-title { display: flex; align-items: center; gap: 8px; }
.task-title strong { font-size: 15px; }
.task-type { padding: 3px 6px; border-radius: 4px; background: #e8f5f7; color: #08758a; font-size: 10px; font-style: normal; font-weight: 750; }
.task-type.type-post_surgery { background: #e8f5ee; color: #257353; }
.task-type.type-planned_followup { background: #fff7d2; color: #765f00; }
.task-copy > small { color: #506a73; font-size: 12px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 10px; color: #71858c; font-size: 11px; }
.task-meta span { display: inline-flex; align-items: center; gap: 4px; }
.task-meta svg { width: 13px; height: 13px; }
.task-action { min-width: 112px; padding-inline: 12px; background: #edf7f8; color: #076f81; }
.completion-line { color: #39785e; font-size: 11px; }
.quality-flag { width: fit-content; padding: 3px 6px; display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; background: #fff0ef; color: #b94743; font-size: 10px; }
.quality-flag svg { width: 12px; height: 12px; }
.bulk-task-bar { position: sticky; z-index: 4; bottom: 82px; margin-top: 10px; padding: 10px 12px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; border: 1px solid #bdd9df; border-radius: 6px; background: rgba(255, 255, 255, .98); box-shadow: 0 8px 24px rgba(22, 64, 76, .12); }
.bulk-task-bar > span { margin-right: auto; color: var(--muted); font-size: 12px; }
.bulk-task-bar .form-control { width: 180px; min-height: 42px; }
.pagination { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 18px; }
.pagination a { color: var(--green); font-weight: 750; }
.pagination span { color: var(--muted); font-size: 12px; }

.page-intro { margin: -8px 0 18px; color: var(--muted); font-size: 13px; }
.inventory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.inventory-card { min-height: 126px; padding: 18px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto 18px; align-items: center; gap: 14px; border: 1px solid var(--line); border-top: 4px solid #26a9bc; border-radius: 6px; background: #fff; }
.inventory-card:hover { border-color: #83c3ce; background: #f9fcfd; }
.inventory-card.tone-yellow { border-top-color: var(--sun); }
.inventory-card.tone-coral { border-top-color: #e66a63; }
.inventory-card.tone-green { border-top-color: #4b9b78; }
.inventory-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 6px; background: #e7f5f7; color: #087e92; }
.tone-yellow .inventory-icon { background: #fff8d5; color: #786100; }
.tone-coral .inventory-icon { background: #fff0ef; color: #c64e49; }
.tone-green .inventory-icon { background: #e8f5ee; color: #287356; }
.inventory-copy { min-width: 0; display: grid; gap: 6px; }
.inventory-copy strong { font-size: 17px; }
.inventory-copy small { color: var(--muted); font-size: 12px; }
.inventory-count { min-width: 82px; display: grid; justify-items: end; gap: 2px; }
.inventory-count b { color: var(--green); font-size: 31px; font-variant-numeric: tabular-nums; }
.inventory-count small { color: var(--muted); font-size: 11px; }
.inventory-placeholder { min-height: 70px; padding: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px dashed #bcd3d8; border-radius: 6px; color: #789097; font-size: 12px; }
.inventory-placeholder svg { width: 17px; }
.heading-count { color: var(--green); font-size: 16px; font-weight: 800; }
.page-heading h1 > svg { width: 23px; vertical-align: -4px; }
.inventory-customer-list, .risk-list { border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.inventory-customer-row { min-height: 80px; padding: 10px 14px; display: grid; grid-template-columns: 42px minmax(180px, 1fr) 64px 170px 18px; align-items: center; gap: 12px; border-bottom: 1px solid #e2ebed; }
.inventory-customer-row:last-child { border-bottom: 0; }
.inventory-customer-row > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.inventory-customer-row > span:nth-child(2) small, .last-date { color: var(--muted); font-size: 11px; }

.risk-toolbar { margin-bottom: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.risk-toolbar .search-bar { margin: 0; }
.risk-list-meta { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.risk-list-meta strong { margin-right: 4px; color: var(--ink); font-size: 16px; }
.risk-row { min-height: 82px; padding: 10px 14px; display: grid; grid-template-columns: 36px minmax(110px, .8fr) 112px minmax(120px, 1fr) minmax(150px, 1.2fr) 68px 18px; align-items: center; gap: 12px; border-bottom: 1px solid #e2ebed; }
.risk-row:last-child { border-bottom: 0; }
.risk-level { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: #fff1ef; color: #d1544e; }
.risk-level.level-attention { background: #fff8d5; color: #806700; }
.risk-level svg { width: 18px; }
.risk-customer, .risk-date, .risk-category, .risk-summary { min-width: 0; display: grid; gap: 4px; }
.risk-row small { color: var(--muted); font-size: 10px; }
.risk-row b { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { padding: 4px 7px; border-radius: 4px; background: #fff3d0; color: #765f00; font-size: 10px; font-weight: 750; text-align: center; }
.status-badge.status-resolved { background: #e8f5ee; color: #267354; }

.account-links { padding: 0 16px 14px; display: grid; }
.account-links a { min-height: 50px; display: grid; grid-template-columns: 24px minmax(0, 1fr) 18px; align-items: center; gap: 9px; border-top: 1px solid var(--line); color: var(--ink); font-size: 13px; }
.account-links a > svg { width: 18px; color: var(--green); }
.account-links a > svg:last-child { color: var(--muted); }
.account-links a[aria-disabled="true"] { pointer-events: none; }
.account-navigation-feedback { position: fixed; z-index: 120; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); min-height: 46px; max-width: min(360px, calc(100vw - 32px)); padding: 10px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid #9bcbd3; border-radius: 6px; background: #f5fbfc; color: var(--ink); box-shadow: 0 12px 34px rgba(18, 52, 62, .2); font-size: 13px; font-weight: 700; }
.account-navigation-feedback[hidden] { display: none; }
.account-navigation-spinner { width: 17px; height: 17px; flex: 0 0 auto; border: 2px solid #b8d9de; border-top-color: var(--green); border-radius: 50%; animation: button-spin .75s linear infinite; }
.account-navigation-feedback.is-error { border-color: #dfaaa5; background: #fff7f6; color: #873d36; }
.account-navigation-feedback.is-error .account-navigation-spinner { display: none; }
.account-navigation-feedback button { min-height: 32px; margin-left: auto; padding: 5px 10px; border: 1px solid currentColor; border-radius: 5px; background: #fff; color: inherit; font: inherit; cursor: pointer; }

/* Homepage demo */
.home-shell { width: min(1180px, calc(100% - 56px)); }
.home-layout { min-height: calc(100vh - 112px); display: grid; align-content: start; gap: 24px; }
.home-zone { min-width: 0; padding-top: 18px; border-top: 1px solid #b7dce4; }
.home-zone:first-child { padding-top: 0; border-top: 0; }
.home-zone-heading { min-height: 54px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.home-zone-heading.compact { min-height: 44px; }
.home-zone-heading h1, .home-zone-heading h2 { margin: 0; }
.home-demo-tag { padding: 5px 8px; border: 1px solid #b8dce3; border-radius: 4px; background: #f4fafb; color: #5f7782; font-size: 11px; font-weight: 700; }
.home-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.home-metric-placeholder { min-width: 0; min-height: 82px; padding: 12px 14px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid #c5e1e7; border-radius: 6px; background: #fff; }
.home-metric-placeholder svg { width: 20px; color: #087e9a; }
.home-metric-placeholder span { overflow: hidden; color: #5f7782; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.home-metric-placeholder strong { color: #173b4a; font-size: 21px; font-variant-numeric: tabular-nums; }
.home-workbench-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(72px, 1fr)); gap: 10px; }
.home-workbench-item, .home-workbench-slot { min-width: 0; min-height: 72px; border-radius: 6px; }
.home-workbench-item { padding: 10px 6px; display: grid; place-items: center; align-content: center; gap: 7px; border: 1px solid #acd7df; background: #fff; color: #235665; font-size: 12px; font-weight: 750; text-align: center; }
.home-workbench-item:hover, .home-workbench-item:focus-visible { border-color: #087e9a; background: #eaf7fa; color: #087e9a; }
.home-workbench-item svg { width: 23px; height: 23px; color: #087e9a; }
.home-workbench-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-workbench-slot { border: 1px dashed #d0e2e6; background: rgba(255, 255, 255, .38); }
.home-schedule-tabs { width: fit-content; min-height: 40px; padding: 3px; display: grid; grid-template-columns: repeat(2, minmax(96px, 1fr)); border: 1px solid #b7dce4; border-radius: 6px; background: #e8f5f7; }
.home-schedule-tabs button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 4px; background: transparent; color: #58727c; font-size: 13px; font-weight: 750; cursor: pointer; }
.home-schedule-tabs button[aria-selected="true"] { background: #fff; color: #087e9a; box-shadow: 0 2px 7px rgba(8, 126, 154, .12); }
.home-schedule-panel { min-width: 0; min-height: 150px; color: #738a92; }
.home-schedule-panel[hidden] { display: none; }
.home-schedule-panel-heading { min-height: 36px; padding: 8px 2px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #315964; }
.home-schedule-panel-heading > strong { font-size: 12px; font-weight: 750; }
.home-schedule-panel-heading > span { color: #087e9a; font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.home-schedule-list { display: grid; gap: 7px; }
.home-schedule-row { min-width: 0; min-height: 54px; padding: 8px 10px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.1fr) minmax(68px, .8fr) minmax(76px, .9fr) 17px; align-items: center; gap: 9px; border: 1px solid #c5e1e7; border-radius: 6px; background: #fff; color: var(--ink); text-decoration: none; }
.home-schedule-row:hover, .home-schedule-row:focus-visible { border-color: #087e9a; background: #f4fbfc; }
.home-schedule-row > span { min-width: 0; display: grid; align-content: center; gap: 3px; }
.home-schedule-row strong, .home-schedule-row small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-schedule-customer strong, .home-schedule-value strong { color: var(--ink); font-size: 13px; }
.home-schedule-row small { color: #69818a; font-size: 10px; font-variant-numeric: tabular-nums; }
.home-schedule-location strong { color: #466b75; font-size: 11px; font-weight: 650; }
.home-schedule-state { display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px; }
.home-schedule-status { width: fit-content; padding: 3px 6px; border-radius: 4px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.home-schedule-status.status-scheduled { background: #e8f7fa; color: #087e9a; }
.home-schedule-status.status-arrived { background: #eef8ef; color: #247c45; }
.home-schedule-status.status-deal { background: #fff7cf; color: #816600; }
.home-schedule-status.status-canceled { background: #f1f3f4; color: #73838a; }
.home-schedule-state em { color: #6e5d12; font-size: 11px; font-style: normal; font-weight: 750; }
.home-schedule-value { justify-items: end; text-align: right; }
.home-schedule-value strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.home-schedule-row > svg { width: 16px; height: 16px; color: #85aab3; }
.home-schedule-empty { min-height: 112px; display: grid; place-items: center; align-content: center; gap: 8px; color: #738a92; }
.home-schedule-empty svg { width: 27px; height: 27px; color: #8fb7c0; }
.home-schedule-empty strong { font-size: 13px; font-weight: 650; }
.home-schedule-error { min-height: 112px; padding: 18px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #f0c9c4; border-radius: 6px; background: #fff6f4; color: #a94438; }
.home-schedule-error > svg { width: 22px; height: 22px; }
.home-schedule-error .button { margin-left: 5px; }

@media (max-width: 760px) {
  .account-navigation-feedback { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); left: 12px; max-width: none; }
  .home-shell { width: 100%; padding-top: 10px; }
  .home-layout { height: calc(100dvh - 58px - 96px); min-height: 0; grid-template-rows: 25dvh 25dvh minmax(128px, 1fr); gap: 9px; }
  .home-zone { min-height: 0; padding-top: 8px; overflow: hidden; }
  .home-zone-heading { min-height: 39px; align-items: center; }
  .home-zone-heading.compact { min-height: 32px; }
  .home-zone-heading h1 { font-size: 21px; }
  .home-zone-heading h2 { font-size: 15px; }
  .home-zone-heading .eyebrow { margin-bottom: 1px; font-size: 10px; }
  .home-demo-tag { padding: 4px 6px; font-size: 9px; }
  .home-metric-grid { height: calc(100% - 39px); gap: 6px; }
  .home-metric-placeholder { min-height: 0; height: 100%; padding: 7px 3px; grid-template-columns: 1fr; grid-template-rows: 20px auto 18px; justify-items: center; gap: 1px; text-align: center; }
  .home-metric-placeholder svg { width: 18px; height: 18px; }
  .home-metric-placeholder span { width: 100%; font-size: 9px; }
  .home-metric-placeholder strong { font-size: 15px; }
  .home-workbench-grid { height: calc(100% - 32px); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .home-workbench-item, .home-workbench-slot { min-height: 0; height: 100%; border-radius: 5px; }
  .home-workbench-item { padding: 3px 2px; gap: 3px; font-size: 10px; }
  .home-workbench-item svg { width: 20px; height: 20px; }
  .home-schedule { display: flex; flex-direction: column; }
  .home-schedule > .home-zone-heading, .home-schedule-tabs { flex: 0 0 auto; }
  .home-schedule-tabs { width: 100%; min-height: 36px; grid-template-columns: repeat(2, 1fr); }
  .home-schedule-tabs button { min-height: 30px; padding: 0 8px; font-size: 12px; }
  .home-schedule-panel { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
  .home-schedule-error { flex: 1 1 auto; }
  .home-schedule-panel-heading { min-height: 30px; padding: 5px 1px; }
  .home-schedule-row { min-height: 58px; padding: 7px 8px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(48px, .65fr) minmax(58px, .75fr) 15px; gap: 5px; }
  .home-schedule-customer strong, .home-schedule-value strong { font-size: 11px; }
  .home-schedule-location strong { font-size: 10px; }
  .home-schedule-row small { font-size: 9px; }
  .home-schedule-status { padding: 2px 4px; font-size: 9px; }
  .home-schedule-state em { font-size: 10px; }
  .home-schedule-row > svg { width: 14px; height: 14px; }
  .home-schedule-empty, .home-schedule-error { min-height: 90px; }
  .home-schedule-empty svg, .home-schedule-error > svg { width: 23px; height: 23px; }
  .home-schedule-empty strong, .home-schedule-error strong { font-size: 12px; }
  .home-schedule-error { padding: 12px 8px; gap: 7px; }
  .home-schedule-error .button { min-height: 30px; padding: 4px 8px; font-size: 11px; }
}

.task-checkboxes ul { margin: 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.task-checkboxes label { min-height: 52px; padding: 8px 10px; display: flex; align-items: center; gap: 9px; border: 1px solid #cbdde1; border-radius: 6px; background: #f7fbfc; font-size: 13px; }
.task-checkboxes input { width: 20px; height: 20px; accent-color: var(--green); }
.suture-hint { width: fit-content; margin-top: 2px; padding: 5px 7px; display: inline-flex; align-items: center; gap: 5px; border-radius: 4px; background: #fff8d5; color: #725d00; font-size: 11px; font-weight: 700; }
.suture-hint svg { width: 14px; height: 14px; }
.owner-editor { margin: -8px 0 22px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.owner-editor summary { min-height: 46px; padding: 0 14px; display: flex; align-items: center; gap: 8px; color: var(--green); font-size: 13px; font-weight: 750; cursor: pointer; }
.owner-editor summary svg { width: 17px; }
.owner-editor form { padding: 12px 14px; display: flex; gap: 10px; border-top: 1px solid var(--line); }
.owner-editor .form-control { flex: 1; }

.rule-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(260px, 340px); align-items: start; gap: 18px; }
.rule-form { max-width: none; }
.rule-preview { margin: 0 0 20px; padding: 14px; border: 1px solid #cfe2e6; border-radius: 6px; background: #f5fafb; }
.rule-preview > small { color: var(--muted); font-size: 11px; }
.rule-preview > div { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 7px; }
.rule-preview span { padding: 6px 9px; border-radius: 4px; background: #e4f3f5; color: #076f82; font-size: 12px; font-weight: 750; }
.rule-note { padding: 12px; display: flex; gap: 9px; border-left: 3px solid var(--sun); background: #fffbe8; }
.rule-note svg { width: 18px; flex: 0 0 auto; }
.rule-note p { margin: 0; color: #5f5b40; font-size: 12px; line-height: 1.6; }
.rule-forecast { border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.rule-forecast > header { min-height: 68px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.rule-forecast > header > svg { color: var(--green); }
.rule-forecast h2, .rule-forecast small { margin: 0; }
.rule-forecast h2 { font-size: 16px; }
.rule-forecast small, .rule-forecast > p { color: var(--muted); font-size: 10px; }
.rule-forecast dl { margin: 0; padding: 8px 14px; }
.rule-forecast dl > div { min-height: 44px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e5edef; }
.rule-forecast dt { color: var(--muted); font-size: 12px; }
.rule-forecast dd { margin: 0; font-weight: 800; }
.rule-forecast .forecast-total dd { color: var(--green); font-size: 20px; }
.rule-forecast > p { margin: 0; padding: 10px 14px 14px; }

.routing-summary { margin-bottom: 14px; padding: 11px 14px; display: flex; gap: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.routing-summary span { display: grid; gap: 2px; }
.routing-summary small { color: var(--muted); font-size: 11px; }
.routing-summary strong { color: var(--green); font-size: 20px; }
.routing-layout { display: grid; grid-template-columns: minmax(300px, 420px) minmax(360px, 1fr); align-items: start; gap: 18px; }
.city-route-list { border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.city-route-list a { min-height: 64px; padding: 9px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); color: var(--ink); }
.city-route-list a:last-child { border-bottom: 0; }
.city-route-list a:hover, .city-route-list a.current { background: #eef9fb; }
.city-route-list a.current { box-shadow: inset 3px 0 var(--green); }
.city-route-list a > span { min-width: 0; display: grid; gap: 4px; }
.city-route-list strong { font-size: 13px; }
.city-route-list small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.city-route-list b { color: var(--green); font-size: 12px; }
.city-route-list svg { width: 16px; color: var(--muted); }
.routing-form { max-width: none; }
.routing-form > header { margin-bottom: 14px; }
.routing-form > header h2 { margin: 2px 0 0; font-size: 21px; }
.routing-form .rule-note { margin-bottom: 18px; }
.routing-employees ul { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; }
.routing-employees label { min-height: 48px; padding: 8px 10px; display: flex; align-items: center; gap: 9px; border: 1px solid #cbdde1; border-radius: 6px; background: #f7fbfc; font-size: 13px; font-weight: 700; cursor: pointer; }
.routing-employees label:has(input:checked) { border-color: #75bdc9; background: #eaf6f8; color: #076e80; }
.routing-employees input { width: 20px; height: 20px; accent-color: var(--green); }
.routing-empty { min-height: 112px; padding: 18px; display: grid; place-items: center; gap: 5px; border: 1px dashed #b9d3d9; border-radius: 6px; background: #f7fbfc; text-align: center; }
.routing-empty svg { width: 25px; color: var(--green); }
.routing-empty strong { font-size: 14px; }
.routing-empty span { color: var(--muted); font-size: 11px; }
.branding-settings-layout { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: 260px minmax(0,1fr); align-items: start; gap: 16px; }
.branding-preview { padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: #f7fcfd; }
.brand-preview-line { margin: 12px 0 16px; display: flex; align-items: center; gap: 10px; }
.brand-preview-line > span:last-child { min-width: 0; display: grid; gap: 2px; }
.brand-preview-line strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.brand-preview-line small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.branding-preview > p:last-child { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.branding-form { margin: 0; }

@media (max-width: 760px) {
  .filter-body { padding: 10px 10px 3px; }
  .filter-basic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .filter-date-range { grid-column: 1 / -1; }
  .filter-staff-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .filter-basic-grid .form-control, .filter-staff-grid .form-control { min-width: 0; min-height: 42px; padding-inline: 9px; font-size: 12px; }
  .filter-date-range label { grid-template-columns: 16px minmax(0,1fr); }
  .active-filter-chips { margin-inline: -1px; padding-bottom: 2px; }
  .upcoming-followups { margin-top: -4px; padding-inline: 11px; }
  .upcoming-followups > span small { white-space: normal; }
  .existing-attachments-readonly > div { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .existing-attachments-readonly .attachment-action-trigger { position: absolute; z-index: 2; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.9); border-radius: 50%; background: rgba(255,255,255,.9); color: #286779; box-shadow: 0 2px 6px rgba(20,64,73,.2); cursor: pointer; touch-action: manipulation; }
  .existing-attachments-readonly .attachment-action-trigger:focus-visible { outline: 2px solid rgba(240,207,53,.85); outline-offset: 2px; }
  .existing-attachments-readonly .attachment-action-trigger svg { width: 14px; height: 14px; stroke-width: 2.4; }
  .existing-attachments-readonly .attachment-delete-button { display: none; width: 24px; height: 24px; top: 4px; right: 4px; }
  .existing-attachments-readonly .attachment-delete-button svg { width: 13px; height: 13px; stroke-width: 2.4; }
  .existing-attachments-readonly .attachment-item.attachment-actions-open .attachment-action-trigger { display: none; }
  .existing-attachments-readonly .attachment-item.attachment-actions-open .attachment-delete-button { display: grid; }
  .branding-settings-layout { grid-template-columns: 1fr; }
  .branding-preview { padding: 14px; }
  .branding-form { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .roster-dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: none; max-height: min(82dvh, 700px); margin: 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 8px 8px 0 0; }
  .roster-dialog > header { min-height: 66px; }
  .roster-dialog-body { padding: 10px 12px; }
  .task-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .task-stat { min-height: 78px; padding: 10px; display: grid; align-content: center; gap: 5px; }
  .task-stat span { font-size: 11px; }
  .task-stat strong { font-size: 25px; }
  .task-stat.warning { grid-column: 1 / -1; min-height: 58px; display: flex; }
  .team-board { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .team-board > header { padding-inline: 14px; }
  .team-board > header > span { display: none; }
  .team-scroll { overflow-x: auto; }
  .team-row { min-width: 560px; }
  .task-filter { align-items: stretch; flex-wrap: wrap; }
  .segmented-control { flex: 1 1 100%; }
  .segmented-control a { flex: 1; }
  .task-filter .form-control { flex: 1; min-width: 0; font-size: 14px; }
  .task-type-tabs { margin-inline: -14px; padding: 0 14px 2px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .task-type-tabs a { min-width: 0; justify-content: space-between; }
  .task-list .empty-page { min-height: 170px; padding-top: 8px; place-content: start center; }
  .task-list .empty-page svg { width: 28px; height: 28px; margin-bottom: 6px; }
  .task-list .empty-page h2 { margin-bottom: 4px; font-size: 17px; }
  .task-list .empty-page p { font-size: 11px; }
  .task-list { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .task-item, .task-item:has(.task-select) { padding: 13px 14px; grid-template-columns: minmax(0, 1fr) auto; }
  .task-item:has(.task-select) .task-select { display: none; }
  .task-main { grid-template-columns: 38px minmax(0, 1fr); }
  .task-action { width: 44px; min-width: 44px; padding: 0; font-size: 0; }
  .task-action svg { width: 19px; }
  .bulk-task-bar { display: none; }
  .inventory-grid { grid-template-columns: 1fr; gap: 10px; }
  .inventory-card { min-height: 105px; padding: 14px; grid-template-columns: 42px minmax(0, 1fr) auto 16px; gap: 10px; }
  .inventory-icon { width: 42px; height: 42px; }
  .inventory-copy strong { font-size: 15px; }
  .inventory-count { min-width: 64px; }
  .inventory-count b { font-size: 27px; }
  .inventory-placeholder { min-height: 58px; }
  .inventory-customer-list, .risk-list { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .inventory-customer-row { min-height: 88px; padding-inline: 14px; grid-template-columns: 40px minmax(0, 1fr) auto 16px; gap: 9px; }
  .inventory-customer-row .last-date { grid-column: 2 / 4; }
  .risk-toolbar { grid-template-columns: 1fr; }
  .risk-toolbar .segmented-control { min-height: 44px; }
  .risk-row { min-height: 136px; padding-inline: 14px; grid-template-columns: 34px minmax(0, 1fr) auto 16px; gap: 7px 8px; }
  .risk-date { display: grid; grid-column: 2 / 4; grid-row: 2; }
  .risk-category { grid-column: 2 / 4; grid-row: 3; }
  .risk-summary { grid-column: 2 / 4; grid-row: 4; }
  .risk-date small, .risk-category small, .risk-summary small { white-space: normal; }
  .risk-row > .status-badge { grid-column: 3; grid-row: 1; }
  .risk-row > svg { grid-column: 4; grid-row: 1 / 5; }
  .owner-editor { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .owner-editor form { flex-direction: column; }
  .rule-layout { grid-template-columns: 1fr; }
  .rule-layout .record-form { margin-bottom: 0; }
  .rule-forecast { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .routing-summary { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .routing-layout { grid-template-columns: 1fr; }
  .city-route-list { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .city-route-list a { padding-inline: 14px; }
  .routing-form { order: -1; margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .routing-employees ul { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .filter-date-range > div { grid-template-columns: 1fr; gap: 6px; }
  .filter-date-range > div > svg { display: none; }
  .filter-date-range label { grid-template-columns: 18px minmax(0,1fr); }
  .staff-filter-group > summary small { display: none; }
  .staff-filter-group > summary span { min-width: 0; }
  .filter-actions .button { white-space: nowrap; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
