/* Admin composition; shared controls, motion and semantic colors are defined once in app.css. */
.admin-body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
.container { width: min(1360px, calc(100% - 48px)); margin: var(--space-6) auto; }

/* Header: four primary sections plus «Ещё» for settings, audit and updates. */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 8px 32px; height: 64px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand-logo { display: block; width: 36px; height: 34px; object-fit: contain; flex-shrink: 0; }
.brand:hover, .brand:visited { color: var(--text); }
.topbar nav { display: flex; align-items: stretch; justify-content: space-between; flex: 1 1 auto; height: 100%; gap: 8px 24px; }
.nav-primary { display: flex; align-items: stretch; gap: 24px; }
#admin-navigation a.nav-link, #admin-navigation a.nav-link:visited { position: relative; display: inline-flex; align-items: center; padding: 8px 0; color: var(--muted); font-weight: 500; text-decoration: none !important; transition: color var(--duration) var(--ease); }
#admin-navigation a.nav-link:hover { color: var(--text); }
#admin-navigation a.nav-link.active { color: var(--text); }
.topbar nav a.active::after { position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--accent); content: ""; }
.nav-more { position: relative; display: flex; align-items: center; }
button.nav-more-toggle { min-height: 34px; padding: 6px 12px; border-color: var(--line); background: var(--surface); color: var(--muted); }
button.nav-more-toggle::after { content: ""; width: 6px; height: 6px; margin: 0 2px 3px 4px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform var(--duration) var(--ease); }
button.nav-more-toggle[aria-expanded=true]::after { transform: translateY(3px) rotate(-135deg); }
button.nav-more-toggle:enabled:hover, button.nav-more-toggle[aria-expanded=true] { background: var(--hover); border-color: var(--control-line); color: var(--text); }
button.nav-more-toggle.active { color: var(--text); border-color: var(--control-line); }
.nav-more-menu { display: grid; gap: 2px; }
.js .nav-more-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; display: none; width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--panel-radius); box-shadow: 0 10px 28px rgb(16 24 40 / 12%); }
.js .nav-more-menu.nav-more-open { display: grid; animation: reveal var(--duration) var(--ease); }
.nav-more-menu a.nav-link, .nav-more-menu .link-button, .nav-more-menu .pwa-install { width: 100%; min-height: 36px; padding: 8px 10px !important; justify-content: flex-start; border-radius: var(--radius); }
.nav-more-menu a.nav-link.active { background: var(--accent-soft); color: var(--accent) !important; }
.nav-more-menu a.nav-link.active::after { display: none; }
.nav-more-menu a.nav-link:hover, .nav-more-menu .link-button:enabled:hover { background: var(--hover); }
.nav-more-menu form { display: block; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.nav-toggle { display: none; }
.nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after { width: 16px; height: 2px; border-radius: 2px; background: currentColor; }
.nav-toggle-icon { position: relative; display: inline-block; }
.nav-toggle-icon::before, .nav-toggle-icon::after { position: absolute; left: 0; content: ""; }
.nav-toggle-icon::before { top: -5px; }
.nav-toggle-icon::after { top: 5px; }

/* Page heading: one title, an optional short fact, page actions on the right. */
.page-head, .section-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4); }
.page-head { margin-bottom: var(--space-5); }
.page-head > div:first-child { flex: 1 1 320px; min-width: 0; max-width: 72ch; }
.page-head p { margin: var(--space-1) 0 0; font-size: 13px; }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); max-width: 100%; }
.page-actions > form { display: flex; }
.section-title { display: flex; align-items: baseline; gap: var(--space-3); margin: 0 0 var(--space-3); font-size: 16px; }
.section-title .count-badge { font-size: 12px; }
.count-badge { flex: 0 0 auto; min-width: 24px; padding: 1px 8px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--neutral-bg); color: var(--neutral); font-size: 12px; font-weight: 600; }

/* Dashboard. */
.overview-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.overview-stats > :is(a, article) { display: grid; gap: 2px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--panel-radius); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color var(--duration) var(--ease), background-color var(--duration) var(--ease); }
.overview-stats > a:hover { border-color: var(--accent-line); background: var(--hover); color: var(--text); }
.overview-stats strong { font-size: 30px; font-weight: 600; line-height: 1.2; }
.overview-stats span { color: var(--muted); }
.overview-stats .needs-attention strong { color: var(--danger); }
/* Same four columns and gap as the stats above, so card edges line up with the tiles. */
.dashboard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); align-items: stretch; margin-bottom: var(--space-5); }
.dashboard-grid > .card { grid-column: span 2; margin: 0; }
.dashboard-list { margin: 0; padding: 0; list-style: none; }
.dashboard-list > li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.dashboard-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.dashboard-list > li:first-child { padding-top: 0; }
.dashboard-list .item-main { display: grid; min-width: 0; }
.dashboard-list .item-main span { color: var(--muted); font-size: 13px; }
.dashboard-list .item-side { flex: 0 0 auto; text-align: right; }
.card > .section-title:first-child { margin-top: 0; }
.card-empty { margin: 0; color: var(--muted); }

/* Filters sit directly above the list they filter. */
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: var(--space-3); margin: 0 0 var(--space-4); }
.filters label { flex: 0 1 220px; }
.filters label.grow { flex: 1 1 260px; max-width: 420px; }
.filters > input { flex: 1 1 260px; max-width: 420px; }
.filters .filters-reset { align-self: center; font-size: 13px; }

/* Forms share one grid in dialogs and fallback disclosures. */
.form-grid, .meeting-registry-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid > button { grid-column: 1 / -1; justify-self: start; }
.field-hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.settings-form { display: grid; gap: var(--space-5); max-width: 880px; }
.settings-form fieldset { min-width: 0; border: 0; border-bottom: 1px solid var(--line); margin: 0; padding: 0 0 var(--space-5); }
.settings-form legend { padding: 0; margin-bottom: var(--space-4); font-size: 16px; }
.settings-form .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Each setting takes three rows shared with its neighbours — caption, field, hint — so fields stay on
   one line when a caption or a hint wraps. Captions sit right above their field, hints right below. */
@supports (grid-template-rows: subgrid) {
  .settings-form .form-grid > label { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 6px; align-items: end; }
  .settings-form .form-grid > label > .field-hint { align-self: start; }
}
.settings-form > button { justify-self: start; }
.settings-note { margin: var(--space-5) 0 0; color: var(--muted); font-size: 13px; }
.disclosure-panel { scroll-margin-top: 80px; }
.disclosure-panel > summary { color: var(--text); font-size: 16px; }
.disclosure-panel > h2, .enhanced-panel { display: none; }

/* Dialogs: one modal layer for every form, card and confirmation. */
.registry-dialog { width: min(760px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgb(16 24 40 / 22%); }
.registry-dialog[open] { animation: dialog-in var(--duration) var(--ease); }
.registry-dialog::backdrop { background: rgb(16 24 40 / 40%); animation: fade-in var(--duration) var(--ease); }
.registry-dialog.dialog-compact { width: min(480px, calc(100% - 32px)); }
.registry-dialog.dialog-wide { width: min(880px, calc(100% - 32px)); }
.dialog-header { display: flex; align-items: start; justify-content: space-between; gap: var(--space-4); position: sticky; top: 0; z-index: 1; padding: 18px 20px 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dialog-header > div { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.dialog-header h2 { margin: 0; font-size: 18px; }
.dialog-header p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
button.dialog-close { flex: 0 0 auto; width: 32px; min-height: 32px; padding: 0; border-color: transparent; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
button.dialog-close:enabled:hover { background: var(--hover); border-color: transparent; color: var(--text); }
.dialog-content { min-width: 0; padding: var(--space-5) 24px 24px; }
.dialog-content > h2 { display: none; }
.dialog-content :is(.employee-import-body, .employee-manual-add-body) { padding: 0; }
.dialog-content .compact-form { margin: 0; }
.dialog-content .compact-form > button { justify-self: start; }
.dialog-content > form + form { margin-top: var(--space-4); }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-2); padding: 0 24px 20px; }
.confirm-dialog .dialog-content { padding-bottom: var(--space-4); }
.confirm-dialog .dialog-content p { margin: 0; }
.dialog-section { padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.dialog-section:first-child { padding-top: 0; border-top: 0; }
.dialog-section:last-child { padding-bottom: 0; }
.dialog-section > h3 { margin: 0 0 var(--space-3); font-size: 14px; color: var(--muted); font-weight: 600; }
.dialog-section .compact-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.dialog-section .compact-form.stacked { grid-template-columns: 1fr; }
.dialog-section .compact-form.stacked > button { justify-self: start; }
.dialog-buttons { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dialog-buttons form { margin: 0; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px var(--space-4); margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* Tables: quiet header, comfortable rows, cards on narrow screens. */
.table-wrap, .meeting-registry-table-shell { position: relative; max-width: 100%; min-width: 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--panel-radius); background: var(--surface); }
.table-wrap { margin-bottom: var(--space-4); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
th { background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; overflow-wrap: normal; white-space: nowrap; }
tbody tr { transition: background-color var(--duration) var(--ease); }
tbody tr:hover > td { background: var(--hover); }
tbody:last-child tr:last-child > td { border-bottom: 0; }
/* A second line under a value. Not tied to tables: a card moved into a dialog keeps its lines. */
.secondary-line { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
td.numeric, th.numeric { text-align: right; }
td.row-actions { width: 1%; white-space: nowrap; text-align: right; }
td.row-actions > * + * { margin-left: var(--space-2); }
td.row-actions form { display: inline; }
td.row-actions > details.admin-password { display: inline-block; vertical-align: middle; }
.empty-row { padding: var(--space-6) var(--space-4); color: var(--muted); text-align: center; }
tbody tr:hover > td.empty-row { background: transparent; }
table:has(.empty-row) thead { display: none; }
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-4) 0 var(--space-5); color: var(--muted); }
.technical-details { max-width: 560px; min-width: 200px; }
.release-notes { white-space: pre-line; }
.inline-details > summary { padding: 0; font-size: 13px; }
.inline-details[open] > :not(summary) { margin: var(--space-1) 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 800px) { .inline-details > summary { min-height: 32px; } }

/* Section blocks below a list (secondary information). */
.card.disclosure-card { padding: var(--space-3) var(--space-5); }
.card.disclosure-card > summary { color: var(--text); font-weight: 600; }
.card.disclosure-card[open] { padding-bottom: var(--space-5); }

/* Employee directory. */
.registry-tabs { display: flex; gap: var(--space-5); margin-bottom: var(--space-5); border-bottom: 1px solid var(--line); overflow-x: auto; }
.registry-tabs a { padding: 10px 0; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; transition: color var(--duration) var(--ease); }
.registry-tabs a:hover { color: var(--text); }
.registry-tabs a[aria-selected=true], .registry-tabs a[aria-current=page] { color: var(--text); box-shadow: inset 0 -2px var(--accent); }
.registry-tabs .count-badge { margin-left: 4px; }
[data-tab-panel]:not([hidden]) { animation: fade-in var(--duration) var(--ease); }
[data-tab-panel]:focus { outline: none; }
.attention-card { border-color: var(--accent-line); }
.attention-card .section-title { margin-bottom: var(--space-4); }
.employee-registry-table td:first-child strong { display: block; }
/* Departments above the employee list: counts are text, the chosen one is marked by more than color.
   Phones and long rows use the list in the search form instead; it is always submitted with the search. */
.department-filter { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-4); }
.department-filter a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 5px 3px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13px; text-decoration: none; transition: border-color var(--duration) var(--ease), background-color var(--duration) var(--ease); }
.department-filter a:hover { border-color: var(--control-line); background: var(--hover); color: var(--text); }
.department-filter a[aria-current=page] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
.department-filter a[aria-current=page] .count-badge { background: var(--surface); color: var(--accent-hover); }
.department-filter-note { color: var(--muted); font-size: 12px; font-weight: 400; }
.employee-filters .department-select { display: none; }
.employee-filters .department-select.is-primary { display: flex; }
@media (max-width: 520px) {
  .department-filter { display: none; }
  .employee-filters .department-select { display: flex; }
}
.contact-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.contact-row:last-of-type { border-bottom: 0; }
.contact-row form { margin: 0; }
.contact-row .dialog-buttons { gap: var(--space-1); }
.pending-department-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); margin-top: var(--space-2); min-width: 0; }
.pending-department-hint { display: block; margin-top: var(--space-2); color: var(--muted); }
.pending-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); }
.pending-actions form { margin: 0; }
.face-similarity-warning { margin: 0 0 var(--space-3); text-align: left; }
/* Action cells do not wrap; a warning inside one must, or it squeezes the other columns. */
td.row-actions .face-similarity-warning { min-width: 16rem; max-width: 28rem; white-space: normal; }
.directory-create-form, .employee-import-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-3); margin: 0 0 var(--space-4); }
.directory-table td:first-child strong { display: block; }
.directory-settings-form { display: grid; gap: var(--space-4); }
.directory-form-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-3); }
.directory-members-list, .member-list { display: grid; gap: var(--space-2); padding: var(--space-1) 0; }
.member-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 260px; overflow-y: auto; }
.directory-delete-form { padding-top: var(--space-4); margin-top: var(--space-4); border-top: 1px solid var(--line); }
.employee-import-body, .employee-manual-add-body { padding-top: var(--space-4); }

/* Meetings: rows grouped by day; details expand in place with the shared reveal. */
.meetings-registry { min-width: 0; }
.meeting-registry-create { min-width: 0; border: 0; padding: 0; margin: 0; }
.meeting-registry-create > legend { display: none; }
.meeting-registry-create > .form-error { margin: 0 0 var(--space-3); }
.meeting-registry-table-shell { margin-bottom: var(--space-5); }
.meeting-registry-table { min-width: 0; table-layout: auto; }
.meeting-registry-table th:nth-child(2) { width: 32%; }
.meeting-registry-table th:nth-child(3) { width: 26%; }
.meeting-day > tr > th { padding: 18px 16px 8px; background: var(--canvas); border-bottom: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; text-align: left; }
.meeting-registry-entry:first-of-type .meeting-day > tr > th, .meeting-day:first-of-type > tr > th { padding-top: 12px; }
.meeting-registry-summary td:first-child { white-space: nowrap; }
.meeting-registry-summary td > span.meeting-time { display: inline; margin: 0; color: var(--text); font-weight: 600; font-size: 15px; }
.meeting-registry-summary .meeting-title { font-weight: 600; }
.meeting-registry-summary td > span:not(.status) { display: block; color: var(--muted); margin-top: 2px; font-size: 12px; }
.meeting-registry-summary td > span.arrived-count { display: inline; margin: 0; color: var(--success); font-size: 14px; font-weight: 600; }
.meeting-registry-status .status { white-space: nowrap; }
.meeting-registry-summary.is-expanded > td { background: var(--hover); border-bottom-color: transparent; }
.meeting-registry-open { width: 1%; white-space: nowrap; text-align: right; }
button.row-toggle { white-space: nowrap; min-height: 30px; padding: 4px 8px; border-color: transparent; background: transparent; color: var(--accent); font-size: 13px; }
button.row-toggle::after { content: ""; width: 7px; height: 7px; margin: 0 2px 3px 4px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform var(--duration) var(--ease); }
button.row-toggle[aria-expanded=true]::after { transform: translateY(3px) rotate(-135deg); }
button.row-toggle:enabled:hover { background: var(--accent-soft); border-color: transparent; color: var(--accent-hover); }
.meeting-registry-detail-row > td { padding: 0; background: var(--hover); }
.meeting-registry-detail-row:not([hidden]) .meeting-registry-detail { animation: reveal var(--duration) var(--ease); }
.meeting-registry-detail { padding: var(--space-4) var(--space-5) var(--space-5); }
.meeting-registry-detail > header { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4); }
.meeting-registry-detail > header p { margin: 0; color: var(--muted); }
.meeting-registry-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.meeting-registry-actions form { margin: 0; }
.meeting-registry-participants { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 52rem; margin: var(--space-4) 0 0; }
.meeting-registry-participants > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); min-width: 0; padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
.meeting-registry-participants > div > span:first-child { flex: 1 1 160px; overflow-wrap: anywhere; }
.meeting-registry-empty { display: grid; gap: var(--space-1); padding: var(--space-6) var(--space-5); border: 1px dashed var(--line); border-radius: var(--panel-radius); background: var(--surface); color: var(--muted); text-align: center; }
.meeting-registry-empty strong { color: var(--text); }
.employee-picker { min-width: 0; margin: var(--space-5) 0 0; padding: var(--space-4) 0 0; border: 0; border-top: 1px solid var(--line); }
.employee-picker legend { padding: 0 var(--space-2) 0 0; font-size: 15px; }
/* «Согласие получено ранее» beside an administrator's first photo: same divider as the picker. */
.external-consent { display: grid; gap: var(--space-3); min-width: 0; margin: 0; padding: var(--space-4) 0 0; border: 0; border-top: 1px solid var(--line); }
.external-consent legend { padding: 0 var(--space-2) 0 0; font-size: 15px; }
/* Weekdays of a repeated meeting: seven short boxes that wrap on a phone. */
.weekday-picker { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.weekday-picker legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 500; }
.weekday-options { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.weekday-options .check-row { align-items: center; }
/* Bulk actions above the employee list: the choice lives in the name cell of each row. */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-3); margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--panel-radius); background: var(--surface); }
.bulk-bar > label:not(.check-row) { flex: 0 1 240px; }
.bulk-bar > .bulk-all { align-self: center; }
.bulk-count { flex: 1 1 160px; align-self: center; color: var(--muted); font-size: 13px; }
.js .bulk-bar > [data-bulk-for] { display: none; }
.js .bulk-bar > [data-bulk-for].is-shown { display: flex; }
.bulk-pick { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.bulk-pick > input { margin-top: 2px; }
.bulk-result > h2 { margin: 0 0 var(--space-3); font-size: 16px; }
.bulk-result .table-wrap { margin: var(--space-3) 0 0; }
/* Linked chats for administrator alerts. */
.alert-links { display: grid; gap: 0; margin: 0 0 var(--space-4); padding: 0; list-style: none; }
.alert-links li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.alert-links li:last-child { border-bottom: 0; }
.alert-links form { margin: 0; }
.alert-code { margin: 0 0 var(--space-4); }
/* Settings: a checkbox setting spans the grid; the digest status sits under its fields. */
.settings-form .form-grid > .check-row { grid-row: auto; display: flex; }
.settings-form .form-grid > .check-row .field-hint { display: block; margin-top: 2px; }
.settings-status { grid-column: 1 / -1; display: grid; gap: var(--space-2); }
.settings-status > p { margin: 0; }
/* Calibration: the current threshold row is marked by a word and a tint, not by color alone. */
.calibration-subtitle { margin: var(--space-5) 0 var(--space-3); font-size: 15px; }
.calibration-table tr.is-current > td { background: var(--accent-soft); }
.calibration-start { margin-top: var(--space-4); }
/* Plain-language help: one purpose line per page, specialist pages marked. */
.page-hint { margin: var(--space-1) 0 var(--space-2); color: var(--text); font-size: 15px; line-height: 1.5; max-width: 72ch; }
.specialist-note { margin: var(--space-2) 0; padding: var(--space-2) var(--space-3); border: 1px solid var(--warning-line); border-left: 4px solid var(--warning); border-radius: 6px; background: var(--warning-bg); font-size: 14px; max-width: 72ch; }
.nav-more-label { margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3) 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
/* Updates: long operator commands wrap instead of widening the page. */
.update-install { margin-bottom: var(--space-5); }
.update-steps { display: grid; gap: var(--space-3); margin: var(--space-3) 0 0; padding-left: 1.25em; }
.update-steps code { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 520px) {
  .bulk-bar > label:not(.check-row), .bulk-bar > button { flex: 1 1 100%; }
}
.registration-code-actions { display: grid; gap: var(--space-2); justify-items: start; margin-top: var(--space-3); }
.registration-code-actions > p { margin: 0; }
/* Employee card: statuses and facts on top, labelled panels, editing behind disclosures, and the
   destructive actions in one framed area. Long values wrap inside their own column. */
.employee-overview { display: grid; gap: var(--space-4); }
.status-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--space-3) var(--space-5); margin: 0; }
.facts-grid > div { min-width: 0; }
.facts-grid > .wide { grid-column: 1 / -1; }
.facts-grid dt { color: var(--muted); font-size: 12px; font-weight: 500; }
.facts-grid dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.fact-item { display: inline-block; max-width: 100%; margin-right: var(--space-4); }
.info-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--space-4); align-items: start; }
.info-panel { container-type: inline-size; display: grid; gap: var(--space-3); min-width: 0; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--panel-radius); }
.info-panel > h4 { margin: 0; font-size: 14px; }
.info-panel .facts { grid-template-columns: minmax(8.5rem, max-content) minmax(0, 1fr); align-items: baseline; }
.info-panel .face-candidate { margin: 0; }
.panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.panel-actions form { margin: 0; }
.panel-note { margin: 0; font-size: 13px; }
@container (max-width: 340px) {
  .info-panel .facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .info-panel .facts dd { margin-bottom: var(--space-2); }
  .panel-actions > :is(.button, form), .panel-actions > form > button { width: 100%; }
}
/* Secondary forms open on request; a thin rule separates them, the section rule closes the list. */
.card-disclosure { border-top: 1px solid var(--line); }
.dialog-section > h3 + .card-disclosure { border-top: 0; }
.card-disclosure > summary { min-height: 40px; }
.card-disclosure[open] > summary { margin-bottom: 0; }
.card-disclosure > :not(summary) { margin-bottom: var(--space-4); }
.card-disclosure > .employee-profile-form { margin-bottom: var(--space-4); }
.dialog-section > :is(.facts, .registration-code-actions) + .card-disclosure { margin-top: var(--space-3); }
.info-panel .card-disclosure > :not(summary) { margin-bottom: 0; }
.dialog-section .compact-form.messenger-link-form { grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); }
.dialog-section .compact-form.messenger-link-form .wide, .dialog-section .compact-form.messenger-link-form > button { grid-column: 1 / -1; }
.dialog-section .compact-form.contact-add-form { grid-template-columns: minmax(0, 1fr) minmax(7rem, 9rem) auto; }
@media (max-width: 560px) {
  .dialog-section .compact-form:is(.messenger-link-form, .contact-add-form) { grid-template-columns: minmax(0, 1fr); }
  .danger-action > form, .danger-action > form > button { width: 100%; }
}
.danger-zone { margin-top: var(--space-4); padding: var(--space-4); border: 1px solid var(--danger-line); border-radius: var(--panel-radius); }
.dialog-section.danger-zone:last-child { padding-bottom: var(--space-4); }
.danger-zone > h3 { color: var(--danger); }
.danger-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.danger-zone > h3 + .danger-action { padding-top: 0; border-top: 0; }
.danger-action:last-child { padding-bottom: 0; }
.danger-action > p { flex: 1 1 280px; min-width: 0; margin: 0; font-size: 13px; color: var(--muted); }
.danger-action > form { flex: 0 0 auto; margin: 0; }
/* The search stays above the list; only the list scrolls. */
.participant-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-2) var(--space-4); padding: 0 0 var(--space-2); }
.participant-list, .member-picker { max-height: 320px; overflow-y: auto; }
.participant-search { flex: 1 1 260px; }
.participant-count { margin: 0 0 8px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.participant-empty { margin: var(--space-2) 0; color: var(--muted); font-size: 14px; }
.select-all-row { padding: var(--space-2) 0; }
.participant-scope { margin-top: var(--space-1); border-bottom: 1px solid var(--line); }
.participant-scope > summary { padding: var(--space-2) 0; color: var(--text); }
.participant-scope > summary::before, .participant-scope[open] > summary::before { color: var(--muted); }
.participant-scope > summary .check-row { flex: 1; }
[data-scope-members] { display: grid; gap: var(--space-2); padding: 0 0 var(--space-3) 26px; }
.meeting-registry-form-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4); padding-top: var(--space-4); margin-top: var(--space-4); border-top: 1px solid var(--line); }
.meeting-registry-form-footer > span { flex: 1 1 240px; color: var(--muted); font-size: 13px; }

/* Login is part of the same system, without the navigation shell. */
body.admin-login { display: grid; place-items: center; padding: 48px 24px; }
.admin-login .standalone-shell { width: min(400px, 100%); }
.admin-login .login-card { display: grid; gap: var(--space-4); margin: 0; padding: var(--space-6); }
.admin-login .login-card h1 { font-size: 22px; }
.admin-login .login-card p { margin: 0; }
.admin-login .login-card .alert { margin: 0; }
.admin-login .login-card button { width: 100%; }

@media (max-width: 1100px) {
  .topbar { gap: var(--space-4); }
  .nav-primary { gap: 18px; }
}
@media (max-width: 1024px) {
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .topbar nav { display: grid; grid-template-columns: 1fr; gap: var(--space-1); position: absolute; top: calc(100% + 4px); right: 24px; z-index: 30; width: 260px; height: auto; max-width: calc(100vw - 24px); max-height: calc(100dvh - 88px); overflow-y: auto; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--panel-radius); box-shadow: 0 10px 28px rgb(16 24 40 / 12%); }
  .js .topbar nav { display: none; }
  .js .topbar nav.nav-open { display: grid; animation: reveal var(--duration) var(--ease); }
  .nav-primary { display: grid; gap: 2px; }
  .nav-more { display: block; padding-top: var(--space-1); margin-top: var(--space-1); border-top: 1px solid var(--line); }
  button.nav-more-toggle { display: none; }
  .js .nav-more-menu, .nav-more-menu { position: static; display: grid; width: auto; padding: 0; border: 0; box-shadow: none; animation: none; }
  #admin-navigation a.nav-link, .topbar nav .link-button { width: 100%; min-height: 44px; padding: 10px 12px !important; justify-content: flex-start; border-radius: var(--radius); }
  #admin-navigation a.nav-link.active { background: var(--accent-soft); color: var(--accent); }
  .topbar nav a.active::after { display: none; }
}
@media (max-width: 800px) {
  .container { width: calc(100% - 32px); margin: var(--space-5) auto; }
  .topbar { padding: 0 16px; }
  .js .topbar nav { right: 16px; }
  .brand { font-size: 16px; }
  .page-head { align-items: start; }
  .page-head > div:first-child { flex-basis: 100%; }
  .overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid > .card { grid-column: auto; }
  .settings-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Every registry table turns into labelled cards instead of scrolling sideways. */
  .table-wrap, .meeting-registry-table-shell { overflow: visible; border: 0; background: transparent; }
  table.responsive-table, table.responsive-table tbody { display: block; }
  table.responsive-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  table.responsive-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); margin-bottom: var(--space-3); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--panel-radius); background: var(--surface); }
  table.responsive-table td { display: block; min-width: 0; padding: 0; border: 0; white-space: normal; text-align: left; }
  table.responsive-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; font-weight: 500; }
  table.responsive-table td:first-child, table.responsive-table td.row-actions, table.responsive-table td.wide-cell, table.responsive-table td.empty-row { grid-column: 1 / -1; }
  table.responsive-table td.row-actions { width: auto; padding-top: var(--space-3); border-top: 1px solid var(--line); }
  table.responsive-table td.row-actions::before { display: none; }
  /* A row without actions (for example, your own administrator account) gets no empty divider. */
  table.responsive-table td.row-actions:not(:has(*)) { display: none; }
  table.responsive-table tbody tr:hover > td { background: transparent; }
  .meeting-registry-table { display: block; }
  .meeting-registry-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .meeting-day, .meeting-day > tr, .meeting-day > tr > th { display: block; }
  .meeting-day > tr > th { padding: var(--space-4) 0 var(--space-2); border: 0; background: transparent; }
  .meeting-registry-entry { display: block; margin-bottom: var(--space-3); border: 1px solid var(--line); border-radius: var(--panel-radius); background: var(--surface); overflow: hidden; }
  .meeting-registry-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); padding: var(--space-4); }
  .meeting-registry-summary > td { display: block; min-width: 0; padding: 0; border: 0; background: transparent !important; text-align: left; }
  .meeting-registry-summary > td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; font-weight: 500; }
  .meeting-registry-summary > td:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
  .meeting-registry-summary > .meeting-registry-open { grid-column: 1 / -1; width: auto; padding-top: var(--space-2); border-top: 1px solid var(--line); text-align: left; }
  .meeting-registry-open > button { width: 100%; min-height: 40px; }
  .meeting-registry-detail-row:not([hidden]), .meeting-registry-detail-row > td { display: block; width: 100%; }
  .meeting-registry-detail { padding: var(--space-4); border-top: 1px solid var(--line); }
  .registry-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .registry-dialog :is(.form-grid, .meeting-registry-fields) { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .container { width: calc(100% - 24px); margin: 20px auto; }
  .topbar { padding-inline: 12px; }
  h1 { font-size: 23px; }
  .card { padding: var(--space-4); }
  .page-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .page-actions > .button, .page-actions > button { width: 100%; }
  .form-grid, .meeting-registry-fields, .settings-form .form-grid, .member-list, .meeting-registry-participants { grid-template-columns: 1fr; }
  .form-grid > button, .meeting-registry-form-footer > button { width: 100%; }
  .filters label, .filters label.grow { flex: 1 1 100%; max-width: none; }
  .filters > button { flex: 1 1 auto; }
  .directory-create-form, .employee-import-form, .pending-department-form, .dialog-section .compact-form { grid-template-columns: 1fr; }
  .directory-form-footer { align-items: stretch; flex-direction: column; }
  .registry-tabs { gap: var(--space-4); }
  .registry-dialog, .registry-dialog.dialog-compact { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .dialog-header, .dialog-content { padding-inline: var(--space-4); }
  /* The sticky header keeps the close button in reach; a long name takes fewer lines of the phone. */
  .dialog-header { padding-block: 12px 10px; }
  .dialog-header h2 { font-size: 16px; }
  .dialog-header p { font-size: 12px; }
  .dialog-actions { padding-inline: var(--space-4); }
  .dialog-actions > button { flex: 1 1 auto; }
  .participant-list, .member-picker { max-height: none; }
  .overview-stats > :is(a, article) { padding: var(--space-4); }
  .pagination span { flex-basis: 100%; }
  body.admin-login { padding: 32px 16px; }
  .admin-login .login-card { padding: var(--space-5); }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: var(--space-2); }
}
td .secondary-line + .status, td strong + .status { margin-top: 4px; }
.dialog-section .compact-form .dialog-buttons { flex-wrap: nowrap; align-items: center; }
.dialog-section .compact-form .dialog-buttons select { width: auto; min-width: 120px; }
.dialog-section .compact-form > input:not([type=hidden]) { grid-column: 1 / -1; }
@media (max-width: 520px) { .dialog-section .compact-form .dialog-buttons { flex-wrap: wrap; } .dialog-section .compact-form .dialog-buttons select { flex: 1 1 auto; } }

/* One-time confirmation after an action; it fades out by itself and can be closed. */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; align-items: center; gap: var(--space-3); max-width: min(420px, calc(100vw - 32px)); padding: 12px 12px 12px 16px; border: 1px solid var(--success-line); border-radius: var(--panel-radius); background: var(--surface); color: var(--text); box-shadow: 0 10px 28px rgb(16 24 40 / 14%); animation: dialog-in var(--duration) var(--ease); transition: opacity 240ms var(--ease), transform 240ms var(--ease); }
.toast::before { content: ""; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.toast.is-hiding { opacity: 0; transform: translateY(8px); }
button.toast-close { flex: 0 0 auto; width: 28px; min-height: 28px; padding: 0; border-color: transparent; background: transparent; color: var(--muted); font-size: 18px; }
button.toast-close:enabled:hover { background: var(--hover); border-color: transparent; color: var(--text); }
.participant-issue { display: block; margin-top: 2px; color: var(--warning); font-size: 12px; font-weight: 400; }
.meeting-registry-status .status + .status { margin-top: 4px; }
.meeting-registry-status { white-space: normal; }
.meeting-registry-status .status { display: block; }
.filters .filters-export { margin-left: auto; }
.attendance-summary { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-3); }
.attendance-recent { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.attendance-recent li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.attendance-recent li > span:first-child { min-width: 0; }
/* The status keeps its own width; the meeting text wraps beside it instead of squeezing the label. */
.attendance-recent li > .status { flex: none; white-space: nowrap; }
.attendance-recent li:last-child { border-bottom: 0; }
@media (max-width: 520px) {
  .toast { right: 16px; left: 16px; bottom: 16px; max-width: none; }
  .filters .filters-export { margin-left: 0; width: 100%; }
}
.participant-side { display: inline-flex; flex: none; align-items: center; gap: var(--space-2); }
.participant-note { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
.excuse-editor > summary { min-height: 26px; padding: 2px 8px; font-size: 12px; white-space: nowrap; }
.face-candidate { margin-top: var(--space-3); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--panel-radius); background: var(--surface); }
.face-candidate p { margin: 0 0 var(--space-2); }
.photo-confirm { max-width: 18rem; margin: 0 0 var(--space-2); white-space: normal; text-align: left; }
.recovery-codes { columns: 2; margin: var(--space-3) 0; padding-left: var(--space-5); font-size: 15px; }
.recovery-codes code, .totp-secret { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 0.04em; }
.setup-steps { margin: 0 0 var(--space-3); padding-left: var(--space-5); }
.totp-qr { display: block; margin: 0 0 var(--space-3); border: 1px solid var(--line); border-radius: 8px; image-rendering: pixelated; }
@media (max-width: 520px) { .recovery-codes { columns: 1; } }

/* Attendance analytics: compact metrics, daily stacked columns and department shares. The four
   outcome colors were checked for color-vision deficiency on white; a legend, the summary and
   the table always carry the same values, so color is never the only channel. */
.analytics { --series-on_time: #008300; --series-late: #eda100; --series-no_show: #e34948; --series-failed: #6250d6; display: grid; gap: var(--space-3); margin: 0 0 var(--space-5); }
.analytics-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-4); }
.analytics-head h2, .section-title { margin: 0; font-size: 17px; }
.analytics-head p { margin: 0; }
.analytics-filters { margin: 0; }
.analytics-body { display: grid; gap: var(--space-3); min-width: 0; }
.analytics-period, .analytics-summary { margin: 0; color: var(--muted); font-size: 13px; }
.analytics-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: var(--panel-radius); }
.analytics-metrics > div { min-width: 0; padding: var(--space-3) var(--space-4); border-left: 1px solid var(--line); }
.analytics-metrics > div:first-child { border-left: 0; }
.analytics-metrics dt { color: var(--muted); font-size: 12px; }
.analytics-metrics dd { margin: 2px 0 0; font-size: 22px; font-weight: 600; line-height: 1.2; }
.analytics-metrics dd span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.35; }
.analytics-legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0; padding: 0; list-style: none; font-size: 13px; }
.analytics-legend li { display: inline-flex; align-items: center; gap: 6px; }
.analytics-swatch { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 2px; background: var(--series); }
.is-on_time { --series: var(--series-on_time); }
.is-late { --series: var(--series-late); }
.is-no_show { --series: var(--series-no_show); }
.is-failed { --series: var(--series-failed); }
.analytics-bar { fill: var(--series); }
.analytics-chart, .analytics-departments { position: relative; min-width: 0; margin: 0; }
.analytics-chart figcaption, .analytics-departments h3 { margin: 0 0 var(--space-2); font-size: 14px; font-weight: 600; }
.analytics-plot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px var(--space-2); }
.analytics-axis { display: flex; flex-direction: column; justify-content: space-between; color: var(--muted); font-size: 12px; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; }
.analytics-days { display: block; width: 100%; height: 180px; overflow: visible; }
.analytics-grid { stroke: var(--line); stroke-width: 1; }
.analytics-baseline { stroke: var(--control-line); stroke-width: 1; }
.analytics-hit { fill: transparent; }
.analytics-day:focus, .analytics-department:focus { outline: none; }
.analytics-day:focus-visible .analytics-hit, .analytics-day.is-active .analytics-hit { fill: var(--accent-soft); }
.analytics-day:focus-visible .analytics-hit { stroke: var(--accent); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.analytics-ticks { grid-column: 2; display: flex; justify-content: space-between; gap: var(--space-2); color: var(--muted); font-size: 12px; }
.analytics-tooltip { position: absolute; z-index: 5; min-width: 180px; max-width: 260px; padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 6px 18px rgb(16 24 40 / 12%); font-size: 12px; pointer-events: none; }
.analytics-tooltip strong { display: block; margin-bottom: 4px; font-size: 13px; }
.analytics-tooltip dl { display: grid; gap: 2px; margin: 0; }
.analytics-tooltip dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.analytics-tooltip dd { margin: 0; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.analytics-tooltip dt { color: var(--muted); }
.analytics-departments ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.analytics-department { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto; grid-template-areas: "name bar value"; align-items: center; gap: 4px var(--space-3); padding: 6px; border-radius: 6px; font-size: 14px; }
/* Rows share one set of columns, so every share bar starts and ends at the same place. */
@supports (grid-template-columns: subgrid) {
  .analytics-departments ul { grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto; }
  .analytics-department { grid-column: 1 / -1; grid-template-columns: subgrid; }
}
.analytics-department-name { grid-area: name; min-width: 0; overflow-wrap: anywhere; }
.analytics-department-value { grid-area: value; color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.analytics-share { grid-area: bar; display: block; width: 100%; height: 12px; }
.analytics-department:focus-visible, .analytics-department.is-active { background: var(--hover); }
.analytics-department:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.analytics-table { min-width: 0; }
.analytics-table > summary { font-size: 14px; }
/* Daily table: one short line per day at every width. It scrolls inside its own frame (both
   ways, header and day column stay in place) instead of squeezing the dates letter by letter,
   stretching the page or turning every day into a card. */
.table-wrap.analytics-table-shell { max-height: min(440px, 70vh); margin: var(--space-2) 0 0; overflow: auto; border: 1px solid var(--line); background: var(--surface); }
.analytics-days-table { font-size: 13px; }
.analytics-days-table :is(th, td) { padding: 6px 12px; overflow-wrap: normal; white-space: nowrap; }
.analytics-days-table thead th { position: sticky; top: 0; z-index: 1; min-width: 88px; vertical-align: bottom; white-space: normal; box-shadow: inset 0 -1px var(--line); }
.analytics-days-table tbody th { position: sticky; left: 0; color: var(--text); font-size: 13px; font-weight: 500; background: var(--surface); }
.analytics-days-table thead th:first-child { left: 0; z-index: 2; min-width: 0; }
.analytics-days-table tbody tr:hover > th { background: var(--hover); }
/* Journals below: words wrap whole, so a narrow window never splits «Подробнее» or a status. */
:is(.arrivals-table, .assignments-table) td { overflow-wrap: break-word; }
/* The arrival time, statuses and «Подробнее» stay on one line; names wrap between words, so a long
   full name never pushes a phone-width card past the screen edge. */
.arrivals-table td:first-child strong, :is(.arrivals-table, .assignments-table) :is(.status, .inline-details > summary) { white-space: nowrap; }
/* In a phone card the status shares a half-width column: a long label wraps between its words. */
@media (max-width: 800px) { :is(.arrivals-table, .assignments-table) .status { white-space: normal; } }
.analytics-empty { margin: 0; padding: var(--space-4); border: 1px dashed var(--line); border-radius: var(--panel-radius); color: var(--muted); }
.analytics-empty strong { display: block; color: var(--text); }
.section-title { margin-bottom: var(--space-3); }
@media (max-width: 800px) {
  .analytics-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analytics-metrics > div:nth-child(3n + 1) { border-left: 0; }
  .analytics-metrics > div:nth-child(n + 4) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .analytics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-metrics > div:nth-child(3n + 1) { border-left: 1px solid var(--line); }
  .analytics-metrics > div:nth-child(2n + 1) { border-left: 0; }
  .analytics-metrics > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .analytics-metrics dd { font-size: 19px; }
  .analytics-days { height: 140px; }
  .analytics-department { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name value" "bar bar"; }
  .analytics-filters label.filters-date { flex: 1 1 calc(50% - var(--space-3)); }
}
