/* Family: shared visual system for the desktop workspace and mobile app. */
:root {
  color-scheme: light;
  --canvas: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --ink: #172b4d;
  --ink-strong: #102442;
  --muted: #586b85;
  --border: #e1e8f1;
  --border-strong: #cbd6e5;
  --blue: #255de1;
  --blue-dark: #1949bc;
  --blue-soft: #edf3ff;
  --green: #14724f;
  --green-soft: #eaf7f0;
  --amber: #8a590b;
  --amber-soft: #fff5df;
  --red: #b63637;
  --red-soft: #fff0ef;
  --radius: 18px;
  --shadow: 0 3px 18px rgb(24 48 87 / 4%);
  --sidebar-width: 236px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .link-button { border: 1px solid transparent; border-radius: 10px; padding: 11px 16px; font-weight: 650; cursor: pointer; transition: background .16s, border-color .16s, box-shadow .16s; }
button { color: inherit; background: var(--surface-soft); }
button:disabled { cursor: not-allowed; opacity: .48; }
button:not(:disabled):active, .link-button:active { transform: translateY(1px); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #84a9ff; outline-offset: 3px; }
.primary { background: var(--blue); color: #fff; box-shadow: 0 3px 8px rgb(37 93 225 / 13%); }
.primary:hover:not(:disabled) { background: var(--blue-dark); }
.secondary { background: var(--surface); color: #34537b; border: 1px solid var(--border); }
.secondary:hover:not(:disabled) { background: var(--blue-soft); border-color: #c4d5f7; color: var(--blue-dark); }
.danger { color: #aa2c32; background: #fff4f3; border-color: #f6dbd8; }
.danger:hover:not(:disabled) { background: #ffe7e5; }
.tiny { padding: 8px 11px; font-size: 12px; min-height: 36px; }
.link-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; text-align: center; }
.link-button.tiny { padding: 8px 11px; }
.icon-button { background: transparent; border: 0; color: var(--muted); font-size: 26px; width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; border-radius: 10px; }
.icon-button:hover { background: var(--surface-soft); color: var(--ink-strong); }

/* Navigation and workspace shell. */
aside, .app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 30; display: flex; flex-direction: column; padding: 28px 16px 20px; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 28px; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.5px; color: var(--ink-strong); }
.brand small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.brand-accent { color: var(--blue); }
.logo, .brand-logo { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; color: #fff; background: var(--blue); border-radius: 13px; font-size: 26px; box-shadow: 0 4px 12px rgb(37 93 225 / 18%); }
.logo.youtube-logo { background: #fff2f2; box-shadow: none; border: 1px solid #ffe4e2; }
.brand-logo svg, .logo svg { flex-shrink: 0; }
.nav-label { padding: 9px 13px 10px; margin: 0; color: #74849a; font-size: 10px; font-weight: 750; letter-spacing: 1.5px; }
nav, .primary-nav { display: grid; gap: 7px; }
nav a, .nav-more > summary { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 12px 14px; color: #536680; border-radius: 11px; font-size: 13px; font-weight: 550; }
nav a > svg, nav a > span[aria-hidden], .nav-more > summary > svg { width: 20px; height: 20px; flex: 0 0 auto; font-size: 19px; text-align: center; }
nav a:hover, .nav-more > summary:hover { color: var(--blue-dark); background: #f4f7fd; }
nav a.active { background: var(--blue-soft); color: var(--blue-dark); font-weight: 750; }
.nav-more > summary { list-style: none; cursor: pointer; }
.nav-more > summary::-webkit-details-marker, .more-actions > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after { content: '⌄'; margin-left: auto; font-size: 16px; }
.nav-more[open] > summary::after { transform: rotate(180deg); }
.nav-more:has(a.active) > summary { color: var(--blue-dark); background: var(--blue-soft); }
.nav-more-links { display: grid; gap: 3px; margin: 6px 0 0 23px; padding-left: 8px; border-left: 1px solid var(--border); }
.nav-more-links a { font-size: 12px; padding: 10px 11px; min-height: 42px; }
.aside-footer { margin-top: auto; padding: 17px 12px 0; color: #63748c; font-size: 11px; }
.aside-footer p { margin: 0; font-size: inherit; }
.aside-footer .runtime { background: var(--surface-soft); padding: 12px; border-radius: 10px; }
.workspace { margin-left: var(--sidebar-width); min-height: 100dvh; }
header, .app-header { min-height: 78px; padding: 15px 32px; background: rgb(255 255 255 / 94%); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
#breadcrumb { color: #526782; font-size: 12px; }
.header-title { font-weight: 700; font-size: 14px; color: var(--ink-strong); }
.header-date { font-size: 11px; color: var(--muted); margin-top: 3px; }
#header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
#header-actions .tiny { font-size: 11px; min-height: 36px; padding: 8px 11px; }
.header-more, .header-tools { position: relative; }
.header-more > summary, .header-tools > summary { list-style: none; cursor: pointer; padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; background: white; color: #34537b; font-size: 12px; font-weight: 650; }
.header-more > summary::-webkit-details-marker, .header-tools > summary::-webkit-details-marker { display: none; }
.header-more-list, .header-tools-list { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; display: grid; gap: 6px; min-width: 215px; padding: 10px; border: 1px solid var(--border); border-radius: 13px; background: white; box-shadow: 0 12px 35px rgb(24 48 87 / 13%); }
.header-more-list button, .header-tools-list button { text-align: left; }
.runtime { display: flex; align-items: center; gap: 8px; }
.runtime i { width: 7px; height: 7px; border-radius: 50%; background: #1d9f72; box-shadow: 0 0 0 3px #e7f7ef; }
.session { display: flex; align-items: center; gap: 12px; }
.session span { font-size: 11px; }
main { max-width: 1650px; margin: auto; padding: 30px 32px 44px; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; padding: 24px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: linear-gradient(110deg, #fff 55%, #f6f9ff); padding: 28px; }
.hero > div:first-child, .hero-copy { min-width: 0; }
.hero-copy { max-width: 800px; }
.hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.eyebrow { color: var(--blue-dark); font-size: 10px; font-weight: 800; letter-spacing: 1.7px; }
h1 { color: var(--ink-strong); font-size: clamp(26px, 2.4vw, 34px); line-height: 1.3; letter-spacing: -1px; margin: 8px 0 10px; overflow-wrap: anywhere; }
h2 { color: var(--ink-strong); font-size: 17px; line-height: 1.4; letter-spacing: -.3px; margin: 0 0 8px; }
h3 { line-height: 1.5; }
p { color: var(--muted); line-height: 1.7; margin: 5px 0; }
.hero p { max-width: 730px; font-size: 13px; }
.muted, .subtext { color: var(--muted); }
.subtext { display: block; font-size: 12px; line-height: 1.65; margin-top: 5px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.section-heading h2 { margin-bottom: 4px; }
.section-heading p { font-size: 12px; }
.section-heading > div { min-width: 0; }
.section-heading > a { font-size: 12px; white-space: nowrap; }
.section-heading .row-actions { flex-shrink: 0; }
.back { display: inline-flex; align-items: center; color: #365fa1; font-size: 12px; font-weight: 600; margin-bottom: 18px; padding: 4px 0; }
.back:hover { color: var(--blue); }

/* Clear counters and today's workflow. */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stats-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { margin: 0; padding: 20px 22px; min-height: 112px; }
.stat h2, .stat h3 { color: var(--muted); font-size: 12px; font-weight: 600; margin: 0 0 12px; letter-spacing: 0; }
.stat strong { display: block; font-size: 29px; line-height: 1.2; letter-spacing: -.7px; font-variant-numeric: tabular-nums; color: var(--ink-strong); overflow-wrap: anywhere; }
.task-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.task-card { text-align: left; margin: 0; padding: 22px; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; position: relative; }
.task-card:hover { border-color: #adc5f5; box-shadow: 0 5px 20px rgb(24 48 87 / 7%); background: #fcfdff; }
.task-card > span:first-child:not(.task-icon), .task-label { color: #425772; font-size: 12px; font-weight: 650; grid-column: 1; }
.task-card strong, .task-count { color: var(--ink-strong); font-size: 34px; line-height: 1.2; letter-spacing: -1px; grid-column: 1; font-variant-numeric: tabular-nums; }
.task-icon { display: grid; place-items: center; grid-column: 2; grid-row: 1 / span 2; width: 43px; height: 43px; border-radius: 13px; color: #3b63b4; background: var(--blue-soft); align-self: start; }
.task-icon svg { width: 21px; height: 21px; }
.task-card[data-filter="expired"] .task-icon { color: #b34241; background: #fff0ee; }
.task-card[data-filter="today"] .task-icon { color: #996916; background: #fff4dc; }
.task-card[data-filter="confirmed"] .task-icon { color: #3b7f6d; background: #eaf7f2; }
.task-link { display: block; grid-column: 1 / -1; font-size: 11px; color: #48638b; font-weight: 550; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.dashboard-today > .section-heading { margin-bottom: 15px; }
.dashboard-summary { margin-top: 4px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 22px; }
.dashboard-grid > .card { margin-bottom: 0; }
.attention-panel { padding: 23px; }
.attention-panel > p { font-size: 13px; }
.attention-panel .actions { margin-top: 18px; }
.attention-list { display: grid; gap: 12px; margin-top: 18px; }
.attention-item { display: flex; align-items: center; gap: 12px; padding: 13px; background: var(--surface-soft); border-radius: 12px; }
.attention-item > div { min-width: 0; }
.attention-item strong { display: block; font-size: 13px; }
.attention-item .subtext { font-size: 11px; margin-top: 3px; }
.attention-count { margin-left: auto; font-size: 22px; font-weight: 750; color: var(--ink-strong); }
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* Search, filters and tables. */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface-soft); border: 1px solid #e8edf5; border-radius: 13px; margin: 20px 0 14px; }
.toolbar input { flex: 1; min-width: 120px; background-color: var(--surface); }
.toolbar select { width: auto; min-width: 160px; max-width: 100%; background-color: var(--surface); }
.toolbar small { color: var(--muted); white-space: nowrap; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #6c7e98; pointer-events: none; }
.search-field input { padding-left: 40px; }
.table-wrap { overflow: auto; scrollbar-width: thin; scrollbar-color: #c9d4e4 transparent; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; white-space: nowrap; }
th { background: #f8fafd; color: #5a6f89; padding: 15px 13px; border-bottom: 1px solid var(--border); font-size: 10px; font-weight: 750; letter-spacing: .65px; }
th:first-child { border-top-left-radius: 10px; }
th:last-child { border-top-right-radius: 10px; }
td { padding: 20px 13px; border-bottom: 1px solid #e9eef5; font-size: 13px; line-height: 1.55; vertical-align: top; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background-color: #fbfcff; }
.email-link { color: #285db9; font-size: inherit; font-weight: 650; padding: 0; background: none; border: 0; text-align: left; border-radius: 3px; overflow-wrap: anywhere; }
.email-link:hover { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 3px; }
.customer-info { min-width: 210px; max-width: 310px; white-space: normal; }
.customer-name { font-size: 14px; line-height: 1.5; color: var(--ink-strong); }
.customer-info .info-line.subtext { color: #3c5a7d; }
.customer-note, .contact-content { white-space: pre-wrap; overflow-wrap: anywhere; }
.customer-info .lookup-code-line { color: var(--muted); }
.lookup-code { color: var(--ink-strong); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .08em; margin-left: 2px; }
.info-line { display: flex; align-items: center; gap: 6px; }
.info-text { min-width: 0; overflow-wrap: anywhere; }
.copy-info { display: inline-grid; place-items: center; flex: 0 0 auto; color: #617b9f; background: transparent; padding: 4px; width: 28px; height: 28px; min-height: 28px; border-radius: 7px; }
.copy-info:hover { color: var(--blue); background: var(--blue-soft); }
.copy-group { display: inline-flex; align-items: center; gap: 7px; }
.contact-link { color: #2a5897; text-decoration: underline; text-decoration-color: #b7c9e4; text-underline-offset: 3px; line-height: 1.9; }
.contact-link:hover { color: var(--blue-dark); }
.copy-buffer { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 9px; font-size: 10px; font-weight: 650; border-radius: 7px; line-height: 1.5; color: #526580; background: #eef2f7; }
.badge.green { color: #136442; background: var(--green-soft); }
.badge.red { color: #a22d31; background: var(--red-soft); }
.badge.amber { color: #80530a; background: var(--amber-soft); }
.badge.blue { color: #2451ad; background: var(--blue-soft); }
.expiry-date { color: var(--ink-strong); font-size: 14px; font-weight: 700; }
.occupancy { color: #284e8b; font-weight: 750; font-size: 15px; }
.slot-count { display: inline-block; background: #edf3ff; padding: 5px 9px; border-radius: 8px; font-weight: 750; color: #2a569c; }
.row-actions { display: flex; align-items: flex-start; gap: 7px; flex-wrap: wrap; }
.row-actions > .primary { white-space: nowrap; }
.more-actions { min-width: 36px; }
.more-actions > summary { list-style: none; display: grid; place-items: center; color: #486280; background: #f3f6fb; border: 1px solid var(--border); border-radius: 9px; min-height: 36px; min-width: 36px; cursor: pointer; font-size: 19px; line-height: 1; padding: 5px 9px; }
.more-actions > summary:hover { color: var(--blue-dark); background: var(--blue-soft); }
.more-actions[open] { flex-basis: 100%; }
.more-actions[open] > summary { margin-bottom: 7px; }
.more-actions-list { display: grid; gap: 5px; min-width: 155px; padding: 7px; border: 1px solid var(--border); background: #fbfcff; border-radius: 10px; }
.more-actions-list button { text-align: left; white-space: normal; }
.list-pagination, .journal-pages { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 18px; margin-top: 8px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.list-pagination span { margin-right: auto; }

/* Forms and dialogs. */
input, select, textarea { width: 100%; min-height: 44px; padding: 11px 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; outline: none; transition: border-color .16s, box-shadow .16s; }
input::placeholder, textarea::placeholder { color: #78879c; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: #7399ed; box-shadow: 0 0 0 3px #eaf0ff; }
input:disabled, select:disabled, textarea:disabled { color: #6b7c92; background: #f1f4f8; cursor: not-allowed; }
label { display: block; color: #3c526d; font-size: 12px; font-weight: 650; margin: 18px 0 8px; }
textarea { resize: vertical; min-height: 96px; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 18px; padding: 0; accent-color: var(--blue); }
.check-label { display: flex; align-items: flex-start; gap: 10px; line-height: 1.6; font-weight: 500; }
.check-label input { flex: 0 0 auto; margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.form-grid > label { grid-row: 1; }
.form-grid > input, .form-grid > select { grid-row: 2; }
.mapping-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.actions button { font-size: 12px; }
dialog { border: 1px solid var(--border); border-radius: 20px; width: 510px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px); padding: 26px; color: var(--ink); background: white; box-shadow: 0 24px 90px rgb(13 36 73 / 24%); overflow-y: auto; overscroll-behavior: contain; }
dialog::backdrop { background: rgb(18 35 62 / 42%); backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.dialog-heading h2 { font-size: 20px; margin: 4px 0; }
.dialog-heading .icon-button { flex: 0 0 auto; margin: -3px -6px 0 0; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--border); }
#form-error, #import-error, #access-error, .vault-error, #statistics-error { color: #af2f38; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
#form-error:empty, .vault-error:empty, #statistics-error:empty { display: none; }
#form-error:not(:empty) { background: var(--red-soft); padding: 10px 12px; border-radius: 9px; margin-top: 15px; }
#renewal-date-preview, #transfer-family-preview { padding: 12px; border: 1px solid #dce7fc; border-radius: 10px; color: #35547d; background: #f4f8ff; font-size: 12px; margin-top: 14px; }
#renewal-receipt-note { font-size: 11px; margin-top: 7px; }
#toast { display: none; position: fixed; bottom: 26px; right: 28px; z-index: 100; max-width: 440px; color: white; background: #163552; border: 1px solid #34546c; border-radius: 13px; box-shadow: 0 10px 35px rgb(18 40 71 / 20%); padding: 15px 20px; font-size: 13px; line-height: 1.6; }
.notice { padding: 14px 16px; margin-bottom: 20px; border: 1px solid #eedfb8; border-radius: 12px; background: #fffaee; color: #7d5d1f; font-size: 12px; line-height: 1.7; }
.error-box { border: 1px solid #f3c6c5; background: #fff3f2; padding: 22px; border-radius: 14px; color: #a32f36; }
.empty { text-align: center; padding: 46px 22px; }
.empty-icon { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 17px; background: #edf3ff; color: #5178bf; font-size: 28px; margin-bottom: 18px; }
.empty h2 { font-size: 17px; }
.empty h3 { margin: 0 0 8px; }
.empty p { font-size: 13px; margin-bottom: 18px; }
.list-item { padding: 15px 0; border-bottom: 1px solid var(--border); font-size: 13px; overflow-wrap: anywhere; }
.list-item:last-child { border-bottom: 0; }
code { background: #f0f4fa; color: #3c5679; padding: 3px 6px; border-radius: 5px; font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; }
.tabs { display: flex; gap: 10px; }
.tabs span { color: var(--blue-dark); background: var(--blue-soft); padding: 10px; border-radius: 9px; font-size: 12px; font-weight: 650; }
.sr-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Family support board and audit log. */
.issue-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.issue-column { min-width: 0; min-height: 250px; padding: 15px; background: #f2f5fa; border: 1px solid var(--border); border-radius: 15px; }
.issue-column.drag-over { outline: 2px solid var(--blue); background: #edf3ff; }
.issue-stack { display: grid; gap: 12px; }
.issue-card { min-width: 0; padding: 17px; background: white; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 2px 8px rgb(24 48 87 / 3%); cursor: grab; overflow-wrap: anywhere; }
.issue-card.dragging { opacity: .45; }
.issue-card.focused { outline: 2px solid var(--blue); outline-offset: 2px; }
.issue-card h3 { font-size: 14px; margin: 14px 0 7px; }
.issue-card > strong { font-size: 14px; }
.issue-card select { margin: 12px 0; font-size: 12px; }
.issue-empty { padding: 22px 5px; }
.issue-email { font-size: 13px; }
.issue-family-link { color: var(--ink-strong); }
.issue-family-link:hover { color: var(--blue); text-decoration: underline; }
.issue-dates { display: grid; gap: 5px; background: #f4f7fb; border-radius: 9px; padding: 11px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.issue-dates b { color: var(--ink); }
.resolution-note { color: #196547; background: var(--green-soft); padding: 10px; border-radius: 9px; }
#issue-completion { margin-top: 14px; padding: 13px; background: #f3f7ff; border-radius: 10px; }
.family-issue-notice { display: grid; justify-items: start; gap: 3px; margin-top: 9px; white-space: normal; max-width: 320px; }
.family-issue-notice .badge { white-space: normal; }
.family-issue-notice .subtext { font-size: 11px; overflow-wrap: anywhere; }
.journal-message { white-space: normal; min-width: 180px; max-width: 600px; overflow-wrap: anywhere; }
.journal-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.audit-change { border-top: 1px solid var(--border); margin-top: 18px; }
.audit-change h3 { font-size: 14px; }
.audit-change h3 .badge { vertical-align: middle; margin-left: 6px; }
.audit-value { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid #edf1f6; font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.audit-value b { color: var(--muted); }

/* Account vault. */
.vault-access { max-width: 560px; }
.vault-access form > button { margin-top: 18px; min-width: 130px; }
.vault-access > p:last-child { font-size: 12px; margin-top: 20px; }
.vault-table td { white-space: normal; max-width: 340px; overflow-wrap: anywhere; }
.vault-code { font-size: 22px; font-weight: 750; letter-spacing: 2px; font-variant-numeric: tabular-nums; color: #684fb9; background: #f2effb; padding: 6px 8px; border-radius: 8px; }
.vault-key { font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.vault-password-value, .vault-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.vault-table .row-actions { margin-top: 7px; }
#vault-dialog { width: min(560px, calc(100vw - 32px)); }
#vault-dialog-fields > button { margin-top: 7px; }
#vault-dialog.vault-import-dialog { width: min(880px, calc(100vw - 32px)); }
#vault-dialog input[readonly] { color: #52657d; background: #f3f6fb; }
#vault-sheet-source { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; min-height: 165px; }
#vault-sheet-mapping { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(140px, 2fr); align-items: center; gap: 10px 16px; margin-top: 18px; }
#vault-sheet-mapping label { margin: 0; }
#vault-sheet-preview { margin-top: 20px; }
#vault-count { margin: 14px 0; }
#vault-unlinked { border-top: 1px solid var(--border); padding-top: 17px; margin-top: 24px; }
#vault-unlinked summary { cursor: pointer; font-weight: 650; }
#vault-table tr.vault-last-copied td[data-label="MAIL FAMILY"] .info-text { color: #a64e09; }

/* Statistics, integrations and update tools. */
.statistics-field { flex: 1; min-width: 0; }
.statistics-field label { margin: 0 0 8px; }
.statistics-field select { width: 100%; }
.statistics-selection { margin: 25px 0 14px; }
.statistics-selection p { font-size: 12px; }
.statistics-note { white-space: pre-wrap; max-width: 300px; overflow-wrap: anywhere; }
.statistics-pagination { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--border); }
#statistics-totals .stat strong, #statistics-new-totals .stat strong { font-size: clamp(22px, 2.8vw, 32px); }
#statistics-new-totals .stats { margin: 14px 0 26px; }
.statistics-months-menu > summary { cursor: pointer; color: var(--ink-strong); font-size: 16px; font-weight: 700; padding: 4px 0; }
.statistics-months-menu[open] > summary { margin-bottom: 20px; }
#sheets-dialog { width: min(640px, calc(100vw - 32px)); }
#sheets-message { color: #a32f36; white-space: pre-wrap; font-size: 12px; }
#sheets-conflicts .notice { margin-top: 18px; }
#sheets-conflicts li { overflow-wrap: anywhere; }
#sheets-dialog p { line-height: 1.7; font-size: 13px; }
#sheets-dialog details > summary { cursor: pointer; padding: 9px 0; font-size: 12px; }
.sheet-script-url { display: block; overflow-wrap: anywhere; font-size: 12px; line-height: 1.7; margin: 10px 0; }
.update-message { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font-size: 13px; }
.update-release-notes { white-space: pre-wrap; max-height: 240px; overflow: auto; overflow-wrap: anywhere; }
#updater-dialog { width: 550px; }
#updater-dialog .actions { margin-top: 20px; }
#import-results td { white-space: normal; min-width: 80px; }
.access-page { background: radial-gradient(ellipse at top, #e6efff, #f3f6fb 65%); min-height: 100dvh; }
.access-page main { max-width: 490px; padding: 24px; margin: 9vh auto 0; }
.access-page .card { box-shadow: 0 12px 45px rgb(24 48 87 / 8%); padding: 30px; }
.access-page button { width: 100%; margin-top: 20px; }

@media (min-width: 1500px) {
  main { padding-top: 34px; }
  td { padding-top: 22px; padding-bottom: 22px; }
}
@media (max-width: 1180px) {
  :root { --sidebar-width: 206px; }
  aside, .app-sidebar { padding-left: 12px; padding-right: 12px; }
  .brand { gap: 8px; padding-left: 5px; padding-right: 5px; }
  .brand strong { font-size: 15px; }
  .brand small { font-size: 9px; }
  header, .app-header { padding-left: 24px; padding-right: 24px; }
  main { padding: 24px; }
  .hero { padding: 24px; }
  .task-grid { gap: 12px; }
  .task-card { padding: 18px; }
  .task-icon { width: 36px; height: 36px; border-radius: 11px; }
  .task-label, .task-card > span:first-child:not(.task-icon) { font-size: 11px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: 1fr; }
  .issue-board { gap: 12px; }
  .issue-column { padding: 11px; }
  .mapping-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 761px) and (max-width: 980px) {
  .hero { align-items: flex-start; }
  .hero-actions { max-width: 210px; }
  .hero-actions > * { width: 100%; }
  .task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { padding: 18px 16px; }
  .stat strong { font-size: 26px; }
  .issue-board { grid-template-columns: 1fr; }
  #header-actions { gap: 6px; }
  #header-actions .tiny { font-size: 10px; padding: 7px 9px; }
}

/* Five persistent destinations keep the mobile workspace within thumb reach. */
@media (max-width: 760px) {
  :root { --radius: 16px; }
  html { scroll-padding-top: 24px; scroll-padding-bottom: 100px; }
  body { font-size: 14px; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  aside, .app-sidebar { position: relative; inset: auto; width: 100%; height: auto; overflow: visible; display: block; padding: 17px 18px; border-right: 0; border-bottom: 1px solid var(--border); z-index: 40; }
  .brand { padding: 0; gap: 10px; width: max-content; max-width: 100%; }
  .brand strong { font-size: 17px; }
  .brand small { font-size: 10px; margin-top: 2px; }
  .logo, .brand-logo { width: 38px; height: 38px; border-radius: 11px; }
  .brand-logo svg, .logo svg { max-width: 29px; }
  .nav-label, .aside-footer { display: none; }
  nav, .primary-nav { position: fixed; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; gap: 2px; z-index: 60; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); background: rgb(255 255 255 / 98%); border-top: 1px solid var(--border); box-shadow: 0 -5px 25px rgb(24 48 87 / 5%); }
  nav > a, nav > .nav-more > summary { position: relative; flex-direction: column; justify-content: center; gap: 5px; border-radius: 11px; min-height: 57px; padding: 6px 2px; font-size: 10px; line-height: 1.25; font-weight: 600; text-align: center; }
  nav a > svg, nav a > span[aria-hidden], .nav-more > summary > svg { width: 21px; height: 21px; font-size: 20px; }
  nav > a.active { background: #edf3ff; }
  .nav-more > summary::after { display: none; }
  nav > .nav-more { min-width: 0; }
  .nav-more-links { position: absolute; bottom: calc(100% + 10px); left: 12px; right: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 12px; margin: 0; border: 1px solid var(--border); border-radius: 17px; background: white; box-shadow: 0 -8px 40px rgb(24 48 87 / 15%); max-height: calc(100dvh - 155px); overflow-y: auto; }
  .nav-more-links a { min-height: 49px; font-size: 12px; padding: 12px 10px; gap: 9px; }
  .workspace { margin-left: 0; min-height: auto; }
  header, .app-header { min-height: 61px; height: auto; padding: 12px 18px; flex-wrap: nowrap; align-items: center; gap: 12px; }
  #breadcrumb { font-size: 11px; overflow-wrap: anywhere; }
  .header-title { font-size: 13px; }
  .header-date { font-size: 10px; }
  #header-actions { flex-shrink: 0; max-width: 58%; gap: 6px; }
  #header-actions .tiny { min-height: 38px; font-size: 10px; padding: 8px 10px; }
  .header-more > summary, .header-tools > summary { min-height: 38px; padding: 9px 10px; font-size: 11px; }
  .header-more-list, .header-tools-list { max-width: calc(100vw - 32px); }
  main { padding: 20px 14px 24px; }
  .card { padding: 19px 16px; margin-bottom: 17px; }
  .hero { flex-direction: column; align-items: stretch; gap: 19px; padding: 22px 19px; background: linear-gradient(135deg, #fff 50%, #f1f6ff); }
  .hero h1 { font-size: 27px; line-height: 1.28; letter-spacing: -.8px; margin-bottom: 10px; }
  .hero p { font-size: 12px; line-height: 1.7; }
  .eyebrow { font-size: 9px; letter-spacing: 1.5px; }
  .hero-actions { width: 100%; justify-content: flex-start; gap: 9px; }
  .hero-actions > .primary { flex: 1; }
  .hero-actions > * { font-size: 12px; }
  .hero > .primary { width: 100%; }
  h2 { font-size: 16px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 13px; }
  .section-heading > a { font-size: 11px; }
  .section-heading p { font-size: 11px; }
  .section-heading .row-actions { flex-wrap: wrap; flex-shrink: 1; }
  .subtext { font-size: 12px; }
  .task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-bottom: 20px; }
  .task-card { padding: 16px 14px; gap: 9px 6px; border-radius: 14px; }
  .task-label, .task-card > span:first-child:not(.task-icon) { font-size: 11px; line-height: 1.5; }
  .task-card strong, .task-count { font-size: 30px; }
  .task-icon { width: 31px; height: 31px; border-radius: 9px; }
  .task-icon svg { width: 17px; height: 17px; }
  .task-link { font-size: 10px; margin-top: 4px; padding-top: 10px; }
  .stats, .stats-three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-bottom: 20px; }
  .stats-three > .stat:last-child { grid-column: 1 / -1; }
  .stat { padding: 17px 15px; min-height: 104px; margin: 0; }
  .stat h2, .stat h3 { font-size: 11px; margin-bottom: 12px; }
  .stat strong { font-size: 26px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 17px; }
  .attention-panel { padding: 19px 16px; }
  .toolbar { flex-wrap: wrap; gap: 9px; padding: 10px; margin: 17px 0 12px; border-radius: 12px; }
  .toolbar input, .search-field { width: 100%; flex-basis: 100%; min-width: 0; }
  .toolbar select { flex: 1; min-width: 0; width: 100%; }
  .toolbar small { font-size: 11px; }
  .table-wrap { overflow: visible; }
  .record-table, .record-table tbody { display: block; width: 100%; white-space: normal; }
  .record-table thead { display: none; }
  .record-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 9px; margin-top: 13px; padding: 11px; border: 1px solid var(--border); background: white; border-radius: 13px; box-shadow: 0 2px 7px rgb(24 48 87 / 2%); }
  .record-table td { display: block; min-width: 0; padding: 10px 3px; border: 0; font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
  .record-table td::before { content: attr(data-label); display: block; font-size: 9px; font-weight: 700; letter-spacing: .5px; line-height: 1.5; color: #61748f; margin-bottom: 6px; }
  .record-table td:first-child { grid-column: 1 / -1; padding: 11px 10px; margin-bottom: 3px; background: #f5f8fd; border-radius: 9px; }
  .record-table td:first-child::before { display: none; }
  .record-table td:last-child { grid-column: 1 / -1; padding-top: 12px; margin-top: 4px; border-top: 1px solid #edf1f7; }
  .record-table td:last-child::before { display: none; }
  .record-table tr:hover td { background-color: transparent; }
  .record-table tr:hover td:first-child { background: #f5f8fd; }
  .record-table .customer-info { min-width: 0; max-width: none; }
  .record-table .customer-name { font-size: 15px; }
  .record-table .subtext { font-size: 11px; }
  .record-table .badge { font-size: 10px; padding: 5px 8px; white-space: normal; }
  .record-table:has(th:nth-child(7)):not(.vault-table) td:nth-child(4) { border-radius: 8px; background: #fff9ec; padding-left: 9px; padding-right: 7px; font-weight: 650; }
  .customer-info { min-width: 0; max-width: none; }
  .customer-name { font-size: 15px; }
  .customer-info .info-line.subtext { font-size: 12px; }
  .copy-info { width: 38px; height: 38px; min-height: 38px; padding: 8px; }
  .copy-info svg { width: 17px; height: 17px; }
  .contact-link { line-height: 2; }
  .row-actions { gap: 8px; }
  .row-actions > .primary, .row-actions > .link-button { flex-grow: 1; }
  .row-actions > .primary, .row-actions > .link-button, .row-actions > button { min-height: 42px; }
  .more-actions > summary { min-height: 42px; min-width: 43px; }
  .more-actions-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; width: 100%; min-width: 0; }
  .more-actions-list button { min-height: 44px; font-size: 12px; padding: 9px; }
  .list-pagination, .journal-pages { font-size: 11px; gap: 8px; margin-top: 14px; padding-top: 15px; }
  .list-pagination span { width: 100%; }
  .list-pagination button { flex: 1; min-height: 42px; }
  input, select, textarea { font-size: 16px; min-height: 46px; }
  label { font-size: 12px; }
  .form-grid { display: block; }
  .mapping-grid { grid-template-columns: 1fr; }
  .tiny, .actions button, .link-button { font-size: 12px; }
  .badge { font-size: 11px; }
  dialog { width: min(510px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: calc(100dvh - 28px); border-radius: 18px; padding: 21px 18px; }
  .dialog-heading { padding-bottom: 13px; }
  .dialog-heading h2 { font-size: 19px; }
  .dialog-footer { position: sticky; bottom: -21px; z-index: 1; background: white; margin-left: -18px; margin-right: -18px; margin-bottom: -21px; padding: 16px 18px 20px; box-shadow: 0 -6px 16px rgb(255 255 255 / 90%); }
  .dialog-footer button { min-height: 46px; font-size: 14px; }
  .dialog-footer .primary { flex: 1; }
  #toast { left: 14px; right: 14px; bottom: calc(88px + env(safe-area-inset-bottom)); max-width: none; font-size: 13px; padding: 13px 16px; }
  .empty { padding: 33px 10px; }
  .empty p { font-size: 12px; }
  .notice { font-size: 12px; padding: 12px 14px; }
  .issue-board { grid-template-columns: 1fr; gap: 15px; }
  .issue-column { min-height: 130px; padding: 13px; }
  .issue-card { padding: 16px; }
  .issue-card select { font-size: 16px; }
  .issue-card h3, .issue-card > strong { font-size: 15px; }
  .issue-email { font-size: 14px; }
  .issue-dates, .audit-value { font-size: 12px; }
  .journal-message { min-width: 0; }
  .family-issue-notice .subtext { font-size: 11px; }
  .vault-table td { max-width: none; }
  .vault-table td:nth-child(5), .vault-table td:nth-child(6), .vault-table td:nth-child(7) { grid-column: 1 / -1; }
  .vault-code { font-size: 26px; }
  .vault-key { font-size: 13px; }
  #vault-dialog, #vault-dialog.vault-import-dialog { max-width: calc(100vw - 24px); width: calc(100vw - 24px); }
  #vault-sheet-mapping { grid-template-columns: 1fr; gap: 8px; }
  #vault-sheet-mapping label { margin-top: 8px; }
  .statistics-field { width: 100%; flex-basis: 100%; }
  .statistics-field select { min-width: 0; }
  .statistics-note { max-width: none; }
  .statistics-pagination { flex-wrap: wrap; gap: 8px; }
  #statistics-totals .stat strong, #statistics-new-totals .stat strong { font-size: 25px; }
  #statistics-months td:nth-child(-n+2) { grid-column: 1 / -1; }
  #statistics-months td:nth-child(-n+2)::before { display: none; }
  #statistics-months td:nth-child(2) { color: var(--muted); font-size: 12px; padding-top: 0; }
  #statistics-months td:last-child { grid-column: auto; border: 0; margin-top: 0; padding-top: 10px; }
  #statistics-months td:last-child::before { display: block; }
  #statistics-months td::before { font-size: 9px; }
  #sheets-dialog, #updater-dialog { width: calc(100vw - 24px); }
  #sheets-dialog p { font-size: 12px; }
  .sheet-script-url { font-size: 11px; }
  .access-page { padding-bottom: env(safe-area-inset-bottom); }
  .access-page main { padding: 22px 18px; margin: 7vh auto 0; }
  .access-page .card { padding: 26px 22px; }
}
@media (max-width: 360px) {
  main { padding-left: 10px; padding-right: 10px; }
  .hero { padding: 20px 16px; }
  .hero h1 { font-size: 25px; }
  .task-card { padding: 14px 11px; }
  .task-icon { width: 27px; height: 27px; }
  .task-card strong { font-size: 27px; }
  .task-label, .task-card > span:first-child:not(.task-icon) { font-size: 10px; }
  nav > a, nav > .nav-more > summary { font-size: 9px; }
  .record-table tr { padding: 9px; gap: 2px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  aside, header, .app-sidebar, .app-header, .row-actions, .list-pagination, #toast { display: none !important; }
  .workspace { margin: 0; }
  body { background: white; padding: 0; }
  main { max-width: none; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .table-wrap { overflow: visible; }
}

/* Shared icon and composed-page refinements. */
.skip-link { position: fixed; left: 18px; top: -70px; z-index: 200; background: white; color: var(--blue-dark); padding: 11px 16px; border-radius: 9px; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }
.primary-nav svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.header-title { display: grid; gap: 1px; }
.header-title #breadcrumb { font-weight: 700; color: var(--ink-strong); font-size: 14px; }
.header-date { display: block; }
.header-more > summary, .header-sync { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.header-more > summary > svg, .header-sync > svg { width: 15px; height: 15px; flex: 0 0 auto; }
.header-more-list { width: 235px; }
.header-more-list button { width: 100%; }
.task-top, .task-card > span.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; grid-column: 1 / -1; }
.task-top .task-label { padding-top: 3px; }
.task-top .task-icon { flex: 0 0 auto; }
.task-card { display: flex; flex-direction: column; align-items: stretch; gap: 7px; }
.task-count { margin-top: -8px; }
.task-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-link > svg { width: 15px; height: 15px; flex: 0 0 auto; }
.task-violet .task-icon, .task-card.task-violet .task-icon { color: #7050bd; background: #f1edfc; }
.section-count { display: inline-grid; place-items: center; font-size: 11px; min-width: 26px; height: 24px; padding: 2px 7px; border-radius: 7px; color: #3a5f9d; background: #edf3ff; vertical-align: middle; margin-left: 6px; font-weight: 750; letter-spacing: 0; }
.section-link { display: inline-flex; align-items: center; gap: 7px; }
.section-link svg { width: 15px; height: 15px; }
.empty-icon svg { width: 28px; height: 28px; }
.panel-icon { width: 36px; height: 36px; display: grid; place-items: center; color: #5474ac; background: #f0f5ff; border-radius: 10px; }
.panel-icon svg { width: 20px; height: 20px; }
.family-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0 24px; }
.family-summary > div + div { padding-left: 20px; border-left: 1px solid var(--border); }
.family-summary strong { display: block; color: var(--ink-strong); font-size: 30px; letter-spacing: -.7px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.family-summary span { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.support-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border: 1px solid #dceee4; border-radius: 11px; color: #24684b; background: #eff9f3; font-size: 12px; font-weight: 600; }
.support-status > span { display: flex; align-items: center; gap: 9px; }
.support-status svg { width: 17px; height: 17px; flex-shrink: 0; }
.support-status.has-issues { border-color: #f1dfbb; color: #835b16; background: #fff8e9; }
.quick-panel > p { font-size: 12px; }
.quick-links { display: grid; gap: 10px; margin-top: 17px; }
.quick-links > a { display: flex; align-items: center; gap: 13px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px; }
.quick-links > a:hover { border-color: #bfceed; background: #f8faff; }
.quick-icon { width: 37px; height: 37px; border-radius: 10px; display: grid; place-items: center; color: #4d70ae; background: #eef4ff; flex: 0 0 auto; }
.quick-icon svg { width: 19px; height: 19px; }
.quick-links strong { display: block; font-size: 12px; color: var(--ink-strong); }
.quick-links small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.quick-links > a > svg { width: 17px; height: 17px; margin-left: auto; color: #6f86a5; flex: 0 0 auto; }
.dashboard-grid { margin-bottom: 22px; }
.date-cell, .date-value, .numeric, .money-cell, .money { font-variant-numeric: tabular-nums; }
.date-value { font-size: 13px; color: var(--ink-strong); }
.money-cell, .money { color: #294f7c; }
.money { font-weight: 700; }
.form-field { min-width: 0; }
.form-grid > .form-field { grid-row: auto; }
.form-field label { margin-top: 18px; }
.help-disclosure { margin-top: 15px; padding: 10px 12px; background: #f7f9fc; border: 1px solid #e7edf5; border-radius: 9px; }
.help-disclosure > summary { color: #526986; font-size: 12px; font-weight: 600; cursor: pointer; }
.help-disclosure p { font-size: 12px; margin-top: 9px; }
.filter-field { display: grid; gap: 5px; min-width: 160px; }
.filter-field label { margin: 0; font-size: 10px; }
.filter-field select { width: 100%; }
.occupancy { min-width: 115px; font-size: 13px; }
.occupancy > strong { display: block; color: #345a97; font-size: 13px; }
.occupancy-track { display: block; height: 5px; width: 105px; max-width: 100%; background: #e9eff8; border-radius: 9px; overflow: hidden; margin-top: 9px; }
.occupancy-track > span { display: block; height: 100%; background: #5382e6; border-radius: 9px; }
.over-capacity > strong { color: #8b5e15; }
.over-capacity .occupancy-track > span { background: #dbad52; }
.customer-table--compact .customer-info { min-width: 200px; max-width: 260px; }
.customer-table--compact td[data-column="renewal"] .badge { white-space: normal; max-width: 150px; }
.customer-table--compact th, .customer-table--compact td { padding-left: 11px; padding-right: 11px; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 280px; font-size: 13px; color: var(--muted); }
.loading-spinner { width: 20px; height: 20px; border: 2px solid #dfe8f7; border-top-color: var(--blue); border-radius: 50%; animation: family-spin .8s linear infinite; }
@keyframes family-spin { to { transform: rotate(360deg); } }
@media (min-width: 761px) {
  .app-sidebar { background: linear-gradient(165deg, #162f55, #112541 70%); border-right-color: #132c4d; }
  .app-sidebar .brand strong { color: #fff; }
  .app-sidebar .brand-accent { color: #5aa9ff; }
  .app-sidebar .brand small { color: #b0c0d8; }
  .app-sidebar .nav-label { color: #92a7c5; font-size: 9px; }
  .app-sidebar nav a, .app-sidebar .nav-more > summary { color: #c2cfe1; }
  .app-sidebar nav a:hover, .app-sidebar .nav-more > summary:hover { background: #233d61; color: white; }
  .app-sidebar nav a.active, .app-sidebar .nav-more:has(a.active) > summary { color: white; background: #2c5fc6; box-shadow: 0 4px 12px rgb(0 0 0 / 8%); }
  .app-sidebar .nav-more-links { border-left-color: #3a5071; }
  .app-sidebar .aside-footer { display: flex; gap: 9px; align-items: flex-start; border: 1px solid #304968; background: #1b3454; border-radius: 12px; padding: 13px; }
  .aside-footer strong { color: #dce6f5; display: block; font-size: 11px; font-weight: 600; }
  .aside-footer small { color: #aebfd5; display: block; font-size: 9px; margin-top: 4px; }
  .status-dot { display: inline-block; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: #5dd8b3; margin-top: 5px; box-shadow: 0 0 0 3px #24465b; }
}
@media (max-width: 760px) {
  .header-title #breadcrumb { font-size: 12px; }
  .header-date { font-size: 9px; }
  .header-more > summary { padding: 9px; }
  .header-sync > svg, .header-more > summary > svg { width: 14px; height: 14px; }
  .task-top .task-label { font-size: 11px; padding-top: 0; min-height: 32px; }
  .task-top .task-icon { width: 30px; height: 30px; }
  .task-count { margin-top: -3px; }
  .record-table.customer-table td[data-column="expiry"] { border-radius: 8px; background: #fff9ec; padding-left: 9px; padding-right: 7px; font-weight: 650; }
  .record-table.customer-table td[data-column="renewal"] { grid-column: 1 / -1; padding: 10px 4px; border-top: 1px solid #edf1f7; }
  .record-table.customer-table td[data-column="payment"] { grid-column: 1 / -1; }
  .record-table.customer-table td[data-column="purchased"] { grid-column: auto; }
  .record-table.customer-table:not(.customer-table--compact) td[data-column="family"] { grid-column: 1 / -1; }
  .record-table.customer-table--compact td[data-column="expiry"] { grid-column: auto; }
  .customer-table--compact .customer-info { min-width: 0; max-width: none; }
  .customer-table--compact td[data-column="renewal"] .badge { max-width: none; }
  .record-table.customer-table td[data-column="payment"] > .money { display: inline-block; margin-left: 8px; }
  .family-summary { margin: 17px 0 21px; gap: 16px; }
  .family-summary > div + div { padding-left: 16px; }
  .family-summary strong { font-size: 28px; }
  .family-summary span, .support-status { font-size: 11px; }
  .support-status { padding: 12px 10px; }
  .quick-links > a { min-height: 65px; }
  .quick-links strong { font-size: 13px; }
  .quick-links small { font-size: 11px; }
  .dashboard-grid { margin-bottom: 17px; }
  .filter-field { flex: 1; min-width: 0; }
  .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
  .form-grid:not(:has(> .form-field)) { display: block; }
  .occupancy { min-width: 0; }
  .occupancy > strong { font-size: 12px; }
  .date-value { font-size: 13px; }
  .help-disclosure > summary, .help-disclosure p { font-size: 11px; }
}
@media (max-width: 380px) {
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .more-actions > summary { min-height: 44px; min-width: 44px; }
  .row-actions > .primary, .row-actions > .link-button, .row-actions > button, .list-pagination button { min-height: 44px; }
  #header-actions .tiny, .header-more > summary, .header-tools > summary { min-height: 44px; }
  .icon-button { width: 44px; height: 44px; }
  .help-disclosure > summary { min-height: 32px; display: flex; align-items: center; }
}
/* Mobile text remains legible at the device's default scale. */
@media (max-width: 760px) {
  .record-table td { font-size: 14px; }
  .record-table td::before { font-size: 10px; }
  .record-table .customer-name, .customer-name { font-size: 16px; }
  .record-table .subtext { font-size: 12px; }
  .record-table .customer-info .info-line.subtext { font-size: 14px; }
  .record-table .customer-info .contact-content { font-size: 13px; }
  .record-table .badge { font-size: 11px; }
  .copy-info { width: 44px; height: 44px; min-height: 44px; padding: 11px; }
  .date-value { font-size: 14px; }
  .task-top .task-label { font-size: 12px; }
  .family-summary span, .support-status, .help-disclosure > summary, .help-disclosure p { font-size: 12px; }
  .section-heading p, .quick-links small { font-size: 12px; }
}
/* CSV previews retain their column layout and scroll inside the card. */
@media (max-width: 760px) {
  .table-wrap:has(> table:not(.record-table)) { overflow-x: auto; }
}
/* Case priorities work with drag-and-drop, keyboard and touch controls. */
.issue-column-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:14px; }
.issue-column-heading h2 { margin:0; }
.issue-column-heading .tiny { padding:7px 9px; }
.issue-card-tools { display:flex; align-items:center; gap:7px; margin-bottom:11px; }
.issue-drag-handle { font-size:24px; line-height:1; color:#687f9f; cursor:grab; }
.issue-reported { margin:0; font-size:10px; flex:1; }
.issue-order-buttons { display:flex; gap:4px; }
.issue-order-buttons .tiny { padding:4px 8px; min-width:32px; min-height:32px; font-size:17px; }
.issue-card.drop-before { box-shadow:0 -4px 0 #255de1; }
.issue-card.drop-after { box-shadow:0 4px 0 #255de1; }
#issue-board[aria-busy="true"] { opacity:.7; pointer-events:none; }
#product-import-dialog { width:min(900px,calc(100vw - 24px)); }
#product-sheet-source { min-height:150px; font-family:ui-monospace,SFMono-Regular,Consolas,monospace; }
.product-import-mapping { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 16px; margin-top:16px; }
.occupancy-fill-0 { width:0; }.occupancy-fill-1 { width:20%; }.occupancy-fill-2 { width:40%; }.occupancy-fill-3 { width:60%; }.occupancy-fill-4 { width:80%; }.occupancy-fill-5 { width:100%; }
@media (max-width:760px) {
  .issue-order-buttons .tiny { min-width:44px; min-height:44px; }
  .issue-reported { font-size:11px; }
  .product-import-mapping { grid-template-columns:1fr; }
}
.product-source-cell { min-width:130px; max-width:210px; white-space:normal; overflow-wrap:anywhere; }
@media (max-width:760px) { .product-source-cell { min-width:0; max-width:none; } }

/* Tra cứu & chuyển nhóm */
.lookup-status { display: grid; justify-items: start; gap: 6px; }
.lookup-status p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.lookup-callout { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 16px 0 0; flex-wrap: wrap; font-size: 13px; }
.lookup-callout > div { flex: 1 1 260px; }
.lookup-table td[data-column="invite"] { min-width: 220px; max-width: 360px; white-space: normal; }
.lookup-url { max-width: 340px; white-space: normal; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }
.lookup-table td[data-column="state"] .subtext { white-space: normal; max-width: 260px; }
.lookup-family-badge { display: inline-flex; margin-left: 8px; vertical-align: middle; }
.lookup-warning { color: var(--red); }
.lookup-steps { margin: 10px 0 0; padding-left: 20px; line-height: 1.85; font-size: 13px; }
.lookup-mail-list { display: grid; gap: 2px; margin: 8px 0 10px; }
.lookup-mail-list .info-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.lookup-pending-mails { align-items: flex-start; margin: 0 0 16px; }
.lookup-pending-mails .subtext { margin-top: 2px; }
.lookup-callout > .lookup-pending-actions { flex: 0 0 auto; flex-direction: column; align-items: stretch; }
.lookup-mail-delete { color: #b42318; font-size: 18px; line-height: 1; }
.lookup-mail-delete:hover { color: #912018; background: #fdecea; }
.gen-menu { position: relative; }
.gen-menu > summary { list-style: none; display: inline-flex; align-items: center; cursor: pointer; border-radius: 10px; padding: 11px 16px; font-weight: 650; }
.gen-menu > summary::-webkit-details-marker { display: none; }
.gen-menu > summary::after { content: '▾'; margin-left: 6px; font-size: 11px; }
.gen-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; gap: 6px; padding: 8px; min-width: 120px; background: #fff; border: 1px solid #d9e2ef; border-radius: 10px; box-shadow: 0 10px 24px rgb(16 36 66 / 14%); }
#move-mapping select { min-width: 220px; }
#move-summary { font-weight: 650; margin: 12px 0 6px; }
#move-mapping .error-box { margin-top: 12px; padding: 14px; font-size: 13px; }
#modal.lookup-wide { width: min(880px, calc(100vw - 32px)); }
/* Khách báo mất Premium */
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.nav-count[hidden] { display: none; }
.report-alert { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; border: 1px solid #fecaca; background: #fff5f5; color: #7f1d1d; text-decoration: none; }
.report-alert strong { display: block; font-size: 15px; color: #991b1b; }
.report-alert:hover { border-color: #fca5a5; }
.report-alert-dot { flex: none; width: 12px; height: 12px; border-radius: 999px; background: #e5484d; box-shadow: 0 0 0 0 rgba(229,72,77,.55); animation: report-ping 1.8s ease-out infinite; }
@keyframes report-ping { 70% { box-shadow: 0 0 0 10px rgba(229,72,77,0); } 100% { box-shadow: 0 0 0 0 rgba(229,72,77,0); } }
@media (prefers-reduced-motion: reduce) { .report-alert-dot { animation: none; } }
.report-card { border-color: #fecaca; }
.report-card-empty { border-color: var(--line, #e2e8f0); }
.report-group { border: 1px solid #f1d5d5; border-radius: 12px; overflow: hidden; }
.report-group + .report-group { margin-top: 12px; }
.report-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; background: #fff7f7; border-bottom: 1px solid #f1d5d5; }
.report-group-head .subtext { display: block; }
.report-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto; gap: 12px; align-items: center; padding: 12px 14px; }
.report-row + .report-row { border-top: 1px solid #f3e4e4; }
.report-what { display: grid; gap: 4px; justify-items: start; }
.telegram-steps code { font-size: 12px; }
@media (max-width: 720px) { .report-row { grid-template-columns: 1fr; } }
