:root {
  --color-brand-50: #f2e6e2;
  --color-brand-100: #ead3cd;
  --color-brand-300: #a65a4d;
  --color-brand-500: #802010;
  --color-brand-600: #5f160b;
  --color-brand-700: #4b1108;
  --font-outfit: AtkinsonNext, Arial, sans-serif;
}

.brand-line { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 4px; background: #802010; }
.brand-mark img { display: block; width: 34px; height: 34px; object-fit: contain; }
.brand-name { font-size: 18px; white-space: nowrap; }
.session-warning { position: fixed; inset-block-end: 20px; inset-inline: 20px; z-index: 100; width: max-content; max-width: calc(100vw - 40px); margin-inline: auto; padding: 12px 16px; border-radius: 6px; background: #263244; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.session-warning[hidden] { display: none; }
.nav-item-unavailable { cursor: default; position: relative; }
.nav-item-unavailable > span { min-width: 0; }
.kpi-unavailable-tooltip { position: absolute; inset-block-start: calc(100% + 4px); inset-inline-start: 0; z-index: 10; width: max-content; max-width: 220px; padding: 6px 9px; border-radius: 5px; background: #263244; color: #fff; font-size: 12px; line-height: 1.3; box-shadow: 0 4px 12px rgba(0,0,0,.18); visibility: hidden; pointer-events: none; }
.nav-item-unavailable:is(:hover,:focus) .kpi-unavailable-tooltip,
.team-tab-unavailable:is(:hover,:focus) .kpi-unavailable-tooltip { visibility: visible; }
.field textarea { min-height: 80px; resize: vertical; }
.field-error input, .field-error select { border: 2px solid var(--error); }
.field small.error-text { color: var(--error); }
.delete-form { max-width: 34rem; margin-block-start: 24px; }
.delete-form fieldset { display: grid; gap: 10px; margin-block-end: 16px; border: 1px solid var(--line); padding: 14px; }
.delete-form legend { font-weight: 600; }
.delete-form p { margin-block-end: 16px; }
.delete-form label { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }
.danger-link { color: #a5291f; }
.alert a { text-decoration: underline; }
.sort-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; min-width: min(360px, 100%); }
.sort-field label { grid-column: 1 / -1; }
.sort-field button { align-self: end; }
input:user-invalid, select:user-invalid, textarea:user-invalid { border-color: var(--error); }

@media (pointer: coarse) {
  .button, .nav-item, .row-link, .field input, .field select, .field textarea { min-height: 44px; }
}
@media (max-width: 700px) {
  .topbar { gap: 8px; }
  .topbar-title { display: none; }
}
.bulk-mobile-select { display: flex; align-items: center; gap: .5rem; margin-block: .5rem; }
.records-table input[type="checkbox"], .bulk-mobile-select input[type="checkbox"] { width: 1.2rem; height: 1.2rem; accent-color: #802010; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: #d6d2ca; border: 1px solid #d6d2ca; }
.metric { display: flex; flex-direction: column; gap: .3rem; min-height: 110px; padding: 1rem; background: white; color: #202124; text-decoration: none; }
.metric strong { font-size: 2rem; line-height: 1.1; font-weight: 600; }
.metric span { color: #58615f; }
.metric:hover, .metric:focus-visible { background: #f5f3ef; outline: 2px solid #802010; outline-offset: -2px; }
.output-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; padding: 0; list-style: none; }
.output-card { display: flex; flex-direction: column; gap: .35rem; padding: 1rem; border: 1px solid #d6d2ca; background: white; }
.output-card strong { font-size: 1.1rem; }
.output-serial { color: #58615f; font-size: .875rem; }
.results { container: output-results / inline-size; }
[hidden] { display: none !important; }
.output-mobile { display: none; padding: 0; margin: 0; list-style: none; }
@container output-results (width < 790px) { .output-mobile { display: grid; gap: .6rem; } }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; padding: 0; list-style: none; }
.team-selector { display: flex; align-items: end; gap: .75rem; flex-wrap: wrap; }
.team-selector .field { min-width: min(100%, 220px); }
.team-form-grid, .kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: .75rem 1rem; }
.team-form-grid .field { margin-block: .3rem; }
.team-form-grid .field input[type=checkbox] { inline-size: 1.25rem; min-block-size: 1.25rem; accent-color: #802010; }
.kpi-grid { margin: 0; }
.kpi-grid div { border-block-end: 1px solid #d6d2ca; padding: .6rem 0; min-width: 0; overflow-wrap: anywhere; }
.kpi-grid dt { color: #58615f; font-size: .875rem; }
.kpi-grid dd { margin: .2rem 0 0; font-weight: 600; }
.score-panel { border-inline-start: 4px solid #802010; padding: .5rem 1rem; background: #f5f3ef; }
.score-panel strong { font-size: 2rem; }
.score-panel p { color: #58615f; }
.team-history { list-style: none; padding: 0; }
.team-history li { display: flex; justify-content: space-between; gap: .7rem; padding: .5rem 0; border-block-end: 1px solid #d6d2ca; }
.team-grid .row-link + .row-link { margin-inline-start: .75rem; }
.kpi-details { border-block-start: 1px solid #d6d2ca; padding-block: 1rem; }
.kpi-details summary { color: #802010; font-weight: 600; cursor: pointer; padding-block: .4rem; }
@media (max-width: 700px) { .team-selector { display: grid; } .team-history li { flex-direction: column; } }

.metric-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); background: #fff; }
.results[aria-labelledby="research-heading"] .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { min-height: 94px; padding: 14px 16px; }
.metric strong { font-variant-numeric: tabular-nums; }
.records-table td:nth-child(3) { min-width: 160px; font-weight: 500; }
.records-table td:nth-child(6) { color: var(--ink); }
.table-scroll-hint { display: none; margin: 0; padding: 8px 10px; color: var(--muted); font-size: 13px; }
.mobile-records { gap: 0; }
.mobile-record { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 0; }
.mobile-record-head > div { min-width: 0; }
.mobile-record-head b { line-height: 1.3; overflow-wrap: break-word; }
.mobile-record-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-top: 4px; }
.mobile-stage { min-width: 0; color: var(--muted); font-size: 14px; }
.mobile-record .row-link { margin: 0; }
.mobile-record details { margin-top: 2px; padding: 0; border: 0; }
.mobile-record details summary { min-height: 36px; }
.mobile-record dl { grid-template-columns: minmax(85px, 1fr) 2fr; }
.mobile-record .bulk-mobile-select { min-height: 44px; margin: 8px 0 0; }
@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .title-row > .title-actions { justify-content: flex-start; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results[aria-labelledby="production-heading"] .metric:last-child { grid-column: 1 / -1; }
  .results[aria-labelledby="research-heading"] .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results[aria-labelledby="research-heading"] .metric:last-child { grid-column: 1 / -1; }
  .metric { min-height: 86px; }
}
@media (max-width: 420px) {
  .title-row > .title-actions { width: 100%; }
  .title-row > .title-actions .button-primary { flex: 1; }
  .mobile-record-head { gap: 8px; }
  .mobile-record-head .status { align-self: flex-start; }
}
@container record-results (width >= 600px) and (width < 790px) {
  .records-table { display: table; min-width: 1050px; }
  .mobile-records { display: none; }
}
@container record-results (width >= 600px) and (width < 1100px) {
  .table-scroll-hint { display: block; }
}

/* Vertical Studio Records shell. */
.shell { grid-template-columns: 256px minmax(0, 1fr); }
.sidebar { padding: 28px 16px 22px; background: var(--maroon); color: #fff; }
.brand { padding: 0 7px 24px; border-color: #ffffff5c; }
.brand-line { gap: 13px; user-select: none; }
.brand-mark { width: 54px; height: 68px; background: transparent; }
.brand-mark img { width: 54px; height: 68px; }
.brand-text { display: flex; flex-direction: column; gap: 5px; line-height: 1.15; }
.brand-name { color: #fff; font-size: 18px; letter-spacing: -.015em; }
.brand-caption { margin: 0; color: #e5bdb5; font-size: 11px; font-weight: 400; }
.sidebar-create { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; margin: 22px 7px 0; padding: 9px 14px; border: 1px solid #ffffffa8; border-radius: 5px; background: transparent; color: #fff; font-weight: 600; text-decoration: none; }
.sidebar-create:hover { background: #ffffff1c; border-color: #fff; }
.sidebar-create svg, .add-icon { width: 19px; height: 19px; flex: none; }
.sidebar nav { gap: 3px; margin-top: 21px; padding-block: 20px 27px; border-top: 1px solid #ffffff5c; }
.nav-item { min-height: 44px; padding: 8px 13px; border-radius: 3px; color: #f6ded8; font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 12px; }
.nav-item svg { width: 19px; height: 19px; flex: none; fill: currentColor; }
.nav-item:hover { background: #ffffff1c; color: #fff; }
.nav-item.active { padding-inline-start: 13px; border: 0; background: #fff; color: var(--maroon); }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding: 12px 7px 0; border-top: 1px solid #ffffff5c; color: #fff; }
.sidebar-account { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 15px; }
.sidebar-account svg { width: 24px; height: 24px; flex: none; fill: currentColor; }
.sidebar-foot strong { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot form { margin: 0; }
.sidebar-foot button { position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: #fff; }
.sidebar-foot button::before { position: absolute; inset: 4px; border: 1px solid #ffffffa8; border-radius: 5px; content: ""; }
.sidebar-foot button:hover::before { border-color: #fff; background: #ffffff1c; }
.sidebar-foot button svg { position: relative; width: 16px; height: 16px; }
.sidebar :where(a, button):focus-visible { outline-color: #fff; }
.topbar { display: none; }
.topbar-brand { display: none; }
.sheet { inline-size: 100%; min-height: 100dvh; margin: 0; padding: 32px; border: 0; border-radius: 0; background: var(--canvas); }
h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.15; }
.button { border-radius: 3px; }
.button-quiet { background: transparent; }
.status-due { background: var(--error-bg); color: var(--error); }

@media (max-width: 900px) {
  html.drawer-scroll-locked, body.nav-open { overflow: hidden; }
  .sidebar { inset-block-start: 68px; width: min(80vw, 280px); block-size: calc(100dvh - 68px); overflow-y: auto; border-top: 1px solid #ffffff5c; }
  .sidebar .brand { display: none; }
  .nav-open::before { inset-block-start: 68px; }
  .topbar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; min-height: 68px; padding-inline: 22px; background: var(--maroon); color: #fff; }
  .topbar-brand { grid-column: 2; grid-row: 1; display: flex; align-items: center; justify-self: center; gap: 9px; color: #fff; font-size: 18px; font-weight: 600; white-space: nowrap; }
  .topbar-brand img { width: 42px; height: 48px; object-fit: contain; }
  .menu-button { grid-column: 1; grid-row: 1; justify-content: center; width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; border-color: #ffffff5c; background: transparent; color: #fff; }
  .menu-button svg { width: 16px; height: 16px; }
  .sheet { min-height: calc(100dvh - 68px); padding: 26px 22px 60px; }
}
@media (max-width: 700px) {
  .sidebar { inset-block-start: 60px; block-size: calc(100dvh - 60px); }
  .nav-open::before { inset-block-start: 60px; }
  .topbar { min-height: 60px; padding-inline: 16px; }
  .topbar-brand { font-size: 16px; }
  .topbar-brand img { width: 36px; height: 42px; }
  .sheet { min-height: calc(100dvh - 60px); padding: 22px 16px 54px; }
}

/* Dashboard panels follow the approved TailAdmin composition. */
.dashboard-head { margin-bottom: 20px; }
.dashboard-head { flex-wrap: wrap; align-items: center; }
.dashboard-date-filter { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-inline-start: auto; }
.dashboard-date-filter label, .dashboard-date-filter small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dashboard-date-input { position: relative; }
.dashboard-date-input > svg { position: absolute; inset-inline-start: 12px; inset-block-start: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: currentColor; pointer-events: none; }
.dashboard-date-input input { width: min(310px, calc(100vw - 32px)); min-height: 42px; padding: 8px 42px 8px 39px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); }
.dashboard-date-clear { position: absolute; inset-inline-end: 5px; inset-block-start: 50%; display: grid; place-items: center; width: 32px; height: 32px; transform: translateY(-50%); border-radius: 4px; color: var(--muted); }
.dashboard-date-clear:hover { background: var(--selected); color: var(--maroon); }
.dashboard-date-clear svg { width: 16px; height: 16px; }
.ndp-container { font-family: AtkinsonNext, Arial, sans-serif; }
.ndp-container.ndp-light .ndp-table td.ndp-selected, .ndp-container.ndp-light .ndp-month-button.ndp-selected, .ndp-container.ndp-light .ndp-year-button.ndp-selected { background: var(--maroon); color: #fff; }
.ndp-container.ndp-light .ndp-table td.ndp-today { color: var(--maroon); }
.ndp-container.ndp-light .ndp-table td.ndp-today.ndp-selected { color: #fff; }
.ndp-container.ndp-light .ndp-range-hover { background: var(--selected); }
@media (max-width: 700px) {
  .dashboard-head { align-items: stretch; }
  .dashboard-date-filter { width: 100%; margin-inline-start: 0; }
  .dashboard-date-filter form { flex: 1 1 100%; }
  .dashboard-date-input input { width: 100%; }
}
.dashboard-panel { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.dashboard-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.dashboard-panel-head h2 { font-size: 20px; }
.dashboard-panel-head p { margin-top: 3px; color: var(--muted); font-size: 14px; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 16px; }
.dashboard-metric { display: flex; min-width: 0; flex-direction: column; gap: 2px; padding: 10px 17px; border-right: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.dashboard-metric:last-child { border: 0; }
.dashboard-metric span { color: var(--muted); font-size: 14px; font-weight: 600; }
.dashboard-metric strong { font-size: 36px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.dashboard-metric small { color: var(--muted); font-size: 13px; line-height: 1.3; }
.dashboard-metric:hover span { text-decoration: underline; text-underline-offset: 3px; }
.dashboard-metric-due strong { color: var(--error); }
.dashboard-breakdowns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.dashboard-breakdown { display: flex; flex-direction: column; container-type: inline-size; }
.dashboard-breakdown dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1; margin: 0; padding: 18px 10px; }
.dashboard-breakdown-orders dl { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-breakdown dl > div { position: relative; min-width: 0; padding: 9px 16px; border-inline-end: 1px solid var(--line); }
.dashboard-breakdown dl > div:last-child { border-inline-end: 0; }
.dashboard-breakdown dl > div:hover { background: var(--selected); }
.dashboard-breakdown dl > div:focus-within { outline: 2px solid var(--maroon); outline-offset: -2px; }
.dashboard-breakdown dl > .dashboard-breakdown-running { background: var(--info-bg); }
.dashboard-breakdown dl > .dashboard-breakdown-due-active { background: var(--error-bg); }
.dashboard-breakdown dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.dashboard-breakdown dd { margin: 8px 0 0; font-size: 36px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.dashboard-breakdown dd a { color: var(--ink); text-decoration: none; }
.dashboard-breakdown dd a::after { position: absolute; inset: 0; content: ""; }
.dashboard-breakdown dd a:focus-visible { outline: none; }
.dashboard-breakdown dl > div:hover dd a { color: var(--maroon); text-decoration: underline; text-underline-offset: 4px; }
.dashboard-breakdown-running dd a { color: var(--info); }
.dashboard-breakdown-due dd a, .dashboard-breakdown dl > .dashboard-breakdown-due:hover dd a { color: var(--error); }
.dashboard-recent { border-top: 1px solid var(--line); padding: 16px 22px 18px; }
.dashboard-recent h3 { font-size: 15px; font-weight: 600; }
.dashboard-recent-table { margin-top: 12px; border: 1px solid var(--line); border-radius: 4px; }
.dashboard-recent-labels, .dashboard-recent li a { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) auto; align-items: center; gap: 10px; }
.dashboard-recent-labels { padding: 8px 10px; border-block-end: 1px solid var(--line); border-radius: 3px 3px 0 0; background: #eae6de; color: var(--ink); font-size: 12px; font-weight: 600; }
.dashboard-recent ol { margin: 0; padding: 0; list-style: none; }
.dashboard-recent li + li { border-top: 1px solid var(--line); }
.dashboard-recent li a { min-height: 52px; padding-inline: 10px; color: var(--ink); font-size: 13px; text-decoration: none; }
.dashboard-recent li a:hover { color: var(--maroon); text-decoration: underline; text-underline-offset: 3px; }
.dashboard-recent li a:focus-visible { outline: 2px solid var(--maroon); outline-offset: 2px; }
.dashboard-recent li a span { min-width: 0; overflow-wrap: anywhere; }
.dashboard-recent-name { font-weight: 600; }
.dashboard-recent-code { font-variant-numeric: tabular-nums; }
.dashboard-recent-empty { padding-block: 8px; color: var(--muted); font-size: 13px; }
@container (max-width: 400px) {
  .dashboard-breakdown dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-breakdown dl > div:nth-child(2n) { border-inline-end: 0; }
  .dashboard-breakdown dl > div:nth-child(n + 3) { border-block-start: 1px solid var(--line); }
  .dashboard-breakdown-new dl > div:last-child { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; }
  .dashboard-breakdown-new dl > div:last-child dd { margin-block-start: 0; }
}
@media (max-width: 1200px) {
  .dashboard-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-metric:nth-child(3) { border-right: 0; }
  .dashboard-metric:nth-child(n + 4) { border-top: 1px solid var(--line); }
}
@media (max-width: 700px) {
  .dashboard-panel-head { padding: 17px 16px; }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px; }
  .dashboard-metric { padding: 10px 12px; }
  .dashboard-metric:nth-child(3) { border-right: 1px solid var(--line); }
  .dashboard-metric:nth-child(even) { border-right: 0; }
  .dashboard-metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .dashboard-metric strong { font-size: 30px; }
  .dashboard-breakdowns { grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
  .dashboard-recent { padding-inline: 16px; }
  .dashboard-recent-labels { display: none; }
  .dashboard-recent li a { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 10px 0; }
  .dashboard-recent li a span::before { display: block; color: var(--maroon); font-size: 11px; font-weight: 600; }
  .dashboard-recent-name::before { content: "Name"; }
  .dashboard-recent-stage::before { content: "Stage"; }
  .dashboard-recent-artist::before { content: "Artist"; }
  .dashboard-recent-code::before { content: "Code"; }
}
/* Register and work ticket use the same panel rhythm. */
body:is([data-screen="records"], [data-screen="book"]) .filters { padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
body:is([data-screen="records"], [data-screen="book"]) .results { padding-top: 22px; }
body:is([data-screen="records"], [data-screen="book"]) .table-region { border-radius: 6px; background: #fff; }
body:is([data-screen="records"], [data-screen="book"]) .records-table th, body:is([data-screen="records"], [data-screen="book"]) .records-table td { padding-block: 10px; }
.table-card { border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.table-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.table-card-head h2 { font-size: 18px; }
.table-card-head p { color: var(--muted); font-size: 13px; }
.table-card-head .filters, body:is([data-screen="records"], [data-screen="book"]) .table-card-head .filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0; border: 0; background: transparent; }
.table-card-head .search-row { margin: 0; align-items: center; }
.table-card-head .search-row .field { width: min(28vw, 280px); }
.table-card-head .field-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.table-card-head .field-search { position: relative; }
.table-card-head .table-search-icon { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.table-card-head .field-search input { padding-inline-start: 38px; }
.table-card-head .field input { min-height: 40px; }
.table-card-head .button { min-height: 40px; }
.table-card-head details { position: relative; }
.table-card-head details > summary, .table-card-head #more-filters > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; list-style: none; }
.table-card-head details > summary svg { width: 18px; height: 18px; flex: none; }
.table-card-head details > summary::-webkit-details-marker { display: none; }
.table-card-head details[open] > summary { border-color: var(--maroon); }
.table-card-head details > .filter-grid { position: absolute; z-index: 10; top: calc(100% + 8px); right: 0; width: min(520px, calc(100vw - 32px)); max-block-size: min(70dvh, var(--filter-panel-room, 70dvh)); overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 12px 28px #2021241c; }
.table-card-head .bs-range-field { grid-column: 1 / -1; }
.table-card-head .sort-field { min-width: 0; }
body:is([data-screen="records"], [data-screen="book"]) .records-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
body:is([data-screen="records"], [data-screen="book"]) .filter-count { display: inline-flex; align-items: center; justify-content: center; min-inline-size: 22px; block-size: 22px; padding-inline: 5px; border-radius: 11px; background: var(--selected); color: var(--maroon); font-size: 12px; }
body:is([data-screen="records"], [data-screen="book"]) #more-filters > .filter-grid { display: flex; flex-direction: column; align-items: stretch; gap: 0; width: min(320px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
body:is([data-screen="records"], [data-screen="book"]) .filter-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-block-end: 1px solid var(--line); }
body:is([data-screen="records"], [data-screen="book"]) .filter-panel-head > div { display: flex; flex-direction: column; gap: 2px; }
body:is([data-screen="records"], [data-screen="book"]) .filter-panel-head strong { font-size: 15px; }
body:is([data-screen="records"], [data-screen="book"]) .filter-panel-head span { color: var(--muted); font-size: 13px; }
body:is([data-screen="records"], [data-screen="book"]) .filter-panel-close { display: grid; place-items: center; flex: none; inline-size: 40px; block-size: 40px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); }
body:is([data-screen="records"], [data-screen="book"]) .filter-panel-close:hover { background: var(--canvas); color: var(--ink); }
body:is([data-screen="records"], [data-screen="book"]) .filter-panel-close svg { inline-size: 18px; block-size: 18px; }
body:is([data-screen="records"], [data-screen="book"]) .filter-panel-fields { flex: 1 1 auto; min-block-size: 0; overflow-y: auto; overscroll-behavior: contain; }
body:is([data-screen="records"], [data-screen="book"]) .filter-group { border-block-end: 1px solid var(--line); }
body:is([data-screen="records"], [data-screen="book"]) .filter-group:last-child { border-block-end: 0; }
body:is([data-screen="records"], [data-screen="book"]) .filter-group > summary { display: flex; align-items: center; gap: 10px; inline-size: 100%; min-block-size: 48px; padding: 8px 16px; border: 0; border-radius: 0; background: transparent; color: var(--ink); list-style: none; cursor: pointer; font-size:15px; font-weight: 600; }
body:is([data-screen="records"], [data-screen="book"]) .filter-group > summary::-webkit-details-marker, body:is([data-screen="records"], [data-screen="book"]) .filter-subgroup > summary::-webkit-details-marker { display: none; }
body:is([data-screen="records"], [data-screen="book"]) .filter-group > summary:hover, body:is([data-screen="records"], [data-screen="book"]) .filter-subgroup > summary:hover { background: var(--canvas); }
body:is([data-screen="records"], [data-screen="book"]) .filter-group-marker,
body:is([data-screen="records"], [data-screen="book"]) .filter-year-marker { display: grid; place-items: center; flex: none; inline-size: 18px; block-size: 18px; margin: 0; appearance: none; border: 1.5px solid var(--input); border-radius: 3px; background: #fff; cursor: pointer; }
body:is([data-screen="records"], [data-screen="book"]) .filter-group-marker:checked,
body:is([data-screen="records"], [data-screen="book"]) .filter-group-marker:indeterminate,
body:is([data-screen="records"], [data-screen="book"]) .filter-year-marker:checked,
body:is([data-screen="records"], [data-screen="book"]) .filter-year-marker:indeterminate { border-color: var(--maroon); background: var(--maroon); }
body:is([data-screen="records"], [data-screen="book"]) .filter-group-marker::after,
body:is([data-screen="records"], [data-screen="book"]) .filter-year-marker::after { inline-size: 8px; block-size: 5px; margin-block-start: -2px; border-inline-start: 2px solid #fff; border-block-end: 2px solid #fff; content: ""; transform: rotate(-45deg) scale(0); }
body:is([data-screen="records"], [data-screen="book"]) .filter-group-marker:checked::after,
body:is([data-screen="records"], [data-screen="book"]) .filter-year-marker:checked::after { transform: rotate(-45deg) scale(1); }
body:is([data-screen="records"], [data-screen="book"]) .filter-group-marker:indeterminate::after,
body:is([data-screen="records"], [data-screen="book"]) .filter-year-marker:indeterminate::after { inline-size: 8px; block-size: 0; margin: 0; border-inline-start: 0; border-block-end: 2px solid #fff; transform: none; }
body:is([data-screen="records"], [data-screen="book"]) .filter-group-marker:focus,
body:is([data-screen="records"], [data-screen="book"]) .filter-year-marker:focus,
body:is([data-screen="records"], [data-screen="book"]) .filter-choice input:focus { outline-color: var(--maroon); }
body:is([data-screen="records"], [data-screen="book"]) .filter-group-name { flex: 1; }
body:is([data-screen="records"], [data-screen="book"]) .filter-group-count { color: var(--muted); font-size: 13px; font-weight: 500; }
body:is([data-screen="records"], [data-screen="book"]) .filter-group-chevron, body:is([data-screen="records"], [data-screen="book"]) .filter-subgroup > summary svg { inline-size: 18px; block-size: 18px; flex: none; color: var(--muted); }
body:is([data-screen="records"], [data-screen="book"]) .filter-group[open] > summary .filter-group-chevron, body:is([data-screen="records"], [data-screen="book"]) .filter-subgroup[open] > summary svg { transform: rotate(180deg); }
body:is([data-screen="records"], [data-screen="book"]) .filter-group-options { display: grid; gap: 2px; padding: 0 16px 12px 41px; }
body:is([data-screen="records"], [data-screen="book"]) .filter-choice { display: flex; align-items: center; gap: 10px; min-block-size: 40px; padding: 5px 8px; margin-inline-start: -8px; border-radius: 4px; cursor: pointer; font-size: 14px; }
body:is([data-screen="records"], [data-screen="book"]) .filter-choice:hover { background: var(--canvas); }
body:is([data-screen="records"], [data-screen="book"]) .filter-choice input { display: grid; place-items: center; inline-size: 18px; block-size: 18px; flex: none; margin: 0; appearance: none; border: 1.5px solid var(--input); background: #fff; }
body:is([data-screen="records"], [data-screen="book"]) .filter-choice input:checked { border-color: var(--maroon); background: var(--maroon); }
body:is([data-screen="records"], [data-screen="book"]) .filter-choice input[type="checkbox"] { border-radius: 3px; }
body:is([data-screen="records"], [data-screen="book"]) .filter-choice input[type="checkbox"]::after { inline-size: 8px; block-size: 5px; margin-block-start: -2px; border-inline-start: 2px solid #fff; border-block-end: 2px solid #fff; content: ""; transform: rotate(-45deg) scale(0); }
body:is([data-screen="records"], [data-screen="book"]) .filter-choice input[type="checkbox"]:checked::after { transform: rotate(-45deg) scale(1); }
body:is([data-screen="records"], [data-screen="book"]) .filter-choice span { overflow-wrap: anywhere; }
body:is([data-screen="records"], [data-screen="book"]) .filter-subgroup > summary { display: flex; align-items: center; gap: 10px; min-block-size: 40px; padding: 6px 8px; margin-inline-start: -8px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); list-style: none; cursor: pointer; font-size: 14px; }
body:is([data-screen="records"], [data-screen="book"]) .filter-subgroup > summary span { flex: 1; }
body:is([data-screen="records"], [data-screen="book"]) .filter-subgroup > summary svg { margin-inline-start: auto; }
body:is([data-screen="records"], [data-screen="book"]) .filter-subgroup-options { padding-inline-start: 16px; }
body:is([data-screen="records"], [data-screen="book"]) .filter-group-empty { padding: 8px 0; color: var(--muted); font-size: 14px; }
body:is([data-screen="records"], [data-screen="book"]) .filter-panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-block-start: 1px solid var(--line); background: #fff; }
body:is([data-screen="records"], [data-screen="book"]) .filter-panel-footer a { display: inline-flex; align-items: center; justify-content: center; min-block-size: 36px; padding-inline: 10px; color: var(--maroon); font-size: 13px; font-weight: 600; text-underline-offset: 3px; }
body:is([data-screen="records"], [data-screen="book"]) .filter-panel-footer .button { min-block-size: 36px; padding: 6px 12px; font-size: 13px; }
body:is([data-screen="records"], [data-screen="book"]) .active-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 18px; border-block-end: 1px solid var(--line); }
body:is([data-screen="records"], [data-screen="book"]) .active-filter-chip { display: inline-flex; align-items: center; gap: 8px; max-inline-size: 100%; min-block-size: 40px; padding: 6px 10px; border: 1px solid #dfcdc7; border-radius: 5px; background: var(--selected); color: var(--maroon); font-size: 14px; text-decoration: none; }
body:is([data-screen="records"], [data-screen="book"]) .active-filter-chip:hover { background: #e9d8d2; }
body:is([data-screen="records"], [data-screen="book"]) .active-filter-chip span { overflow-wrap: anywhere; }
body:is([data-screen="records"], [data-screen="book"]) .active-filter-chip svg { inline-size: 16px; block-size: 16px; flex: none; }
body:is([data-screen="records"], [data-screen="book"]) .active-filters-clear { display: inline-flex; align-items: center; min-block-size: 40px; padding-inline: 8px; color: var(--maroon); font-size: 14px; font-weight: 600; text-underline-offset: 3px; }
body:is([data-screen="records"], [data-screen="book"]) .records-sort > summary { white-space: nowrap; background: var(--canvas); font-weight: 500; }
body:is([data-screen="records"], [data-screen="book"]) .records-sort .sort-icon { inline-size: 18px; block-size: 18px; }
body:is([data-screen="records"], [data-screen="book"]) .records-sort .sort-chevron { inline-size: 16px; block-size: 16px; color: var(--muted); }
body:is([data-screen="records"], [data-screen="book"]) .records-sort[open] .sort-chevron { transform: rotate(180deg); }
body:is([data-screen="records"], [data-screen="book"]) .records-sort .sort-value { padding: 2px 8px; border-radius: 12px; background: #eae6de; font-size: 13px; }
body:is([data-screen="records"], [data-screen="book"]) .records-sort-options { position: absolute; z-index: 11; inset-block-start: calc(100% + 8px); inset-inline-end: 0; min-inline-size: 230px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 12px 28px #2021241c; }
body:is([data-screen="records"], [data-screen="book"]) .sort-choice-group { padding-block: 4px; }
body:is([data-screen="records"], [data-screen="book"]) .sort-choice-group + .sort-choice-group { margin-block-start: 4px; border-block-start: 1px solid var(--line); }
body:is([data-screen="records"], [data-screen="book"]) .sort-choice-group p { padding: 5px 10px; color: var(--muted); font-size: 12px; font-weight: 600; }
body:is([data-screen="records"], [data-screen="book"]) .records-sort-options a { display: flex; align-items: center; gap: 8px; min-block-size: 40px; padding: 8px 10px; border-radius: 4px; color: var(--ink); text-decoration: none; }
body:is([data-screen="records"], [data-screen="book"]) .records-sort-options a::before { content: ""; inline-size: 18px; flex: none; }
body:is([data-screen="records"], [data-screen="book"]) .records-sort-options a[aria-current="true"] { font-weight: 600; }
body:is([data-screen="records"], [data-screen="book"]) .records-sort-options a[aria-current="true"]::before { content: "✓"; }
body:is([data-screen="records"], [data-screen="book"]) .records-sort-options a:hover, body:is([data-screen="records"], [data-screen="book"]) .records-sort-options a:focus-visible { background: var(--canvas); }
.table-card .table-region, body:is([data-screen="records"], [data-screen="book"]) .table-card .table-region { border: 0; border-radius: 0; background: transparent; }
.pagination :is(.page-number, .page-step, .page-ellipsis) { display: inline-flex; flex: none; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 6px 8px; border-radius: 7px; text-decoration: none; }
.pagination .page-step { width: 40px; border: 1px solid var(--line); }
.pagination .page-step svg { width: 18px; height: 18px; }
.pagination .page-ellipsis { min-width: 24px; }
.pagination a:hover { background: var(--selected); }
.pagination .is-current { background: var(--maroon); color: #fff; font-weight: 600; }
.pagination .page-disabled { color: var(--muted); opacity: .6; }
.table-card .empty-state { border: 0; }
.table-scroll-shell { min-width: 0; }
body:is([data-screen="records"], [data-screen="book"]) .table-scroll-shell .table-region { max-block-size: none; overflow: visible; }
.table-scroll-shell .records-table { border-collapse: separate; border-spacing: 0; }
body:is([data-screen="records"], [data-screen="book"]) .records-table tbody tr:last-child > * { border-block-end: 0; }
body:is([data-screen="records"], [data-screen="book"]) .records-table tbody tr:last-child > :first-child { border-end-start-radius: 15px; }
body:is([data-screen="records"], [data-screen="book"]) .records-table tbody tr:last-child > :last-child { border-end-end-radius: 15px; }
body:is([data-screen="records"], [data-screen="book"]) .records-table tbody tr:last-child:hover { background: transparent; }
body:is([data-screen="records"], [data-screen="book"]) .records-table tbody tr:last-child:hover > * { background: #faf9f7; }
body:is([data-screen="records"], [data-screen="book"]) .table-scroll-shell .records-table thead th { position: sticky; inset-block-start: 0; z-index: 2; box-shadow: 0 1px 0 var(--line); }
body:is([data-screen="records"], [data-screen="book"]) .sheet { padding-block-end: 112px; }
.table-results-shell > .pagination { position: fixed; inset-inline-start: 290px; inset-block-end: max(32px, env(safe-area-inset-bottom) + 16px); z-index: 3; display: flex; align-items: center; width: max-content; gap: 2px; margin: 0; padding: 3px; border: 1px solid var(--maroon); border-radius: 16px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; }
.table-results-shell > .pagination .page-step { min-inline-size: 40px; inline-size: 40px; min-block-size: 40px; padding: 10px; border: 0; border-radius: 4px; color: var(--maroon); }
.table-results-shell > .pagination .page-step:first-child { border-start-start-radius: 12px; border-end-start-radius: 12px; }
.table-results-shell > .pagination .page-step:last-child { border-start-end-radius: 12px; border-end-end-radius: 12px; }
.table-results-shell > .pagination .page-step svg { inline-size: 18px; block-size: 18px; }
.table-results-shell > .pagination .page-range { display: inline-flex; align-items: center; justify-content: center; min-inline-size: 64px; padding-inline: 5px; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-results-shell > .pagination .page-disabled { color: var(--muted); }
.table-results-shell > .pagination a:focus-visible { outline: 2px solid var(--maroon); outline-offset: 2px; }
@media (max-width: 900px) { .table-results-shell > .pagination { inset-inline-start: 24px; } }
@media (max-width: 700px) { .table-results-shell > .pagination { inset-inline-start: 18px; } }
@media (min-width: 851px) and (max-width: 1100px) {
  body:is([data-screen="records"], [data-screen="book"]) .table-scroll-shell .table-region { max-block-size: min(72vh, 740px); overflow: auto; }
}
body:is([data-screen="records"], [data-screen="book"]) .records-table { min-width: 960px; }
body[data-screen="book"] .book-table { min-width: 1050px; }
body[data-screen="book"] .book-table td:nth-child(2) { min-inline-size: 110px; font-weight: 400; white-space: nowrap; }
body[data-screen="book"] .book-table tr > :last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
body:is([data-screen="records"], [data-screen="book"]) .records-table thead th { background: #eae6de; color: var(--ink); font-weight: 600; border-block-end-color: var(--line); }
body:is([data-screen="records"], [data-screen="book"]) .records-table tbody th { min-width: 180px; color: var(--ink); }
body:is([data-screen="records"], [data-screen="book"]) .record-statuses { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
body:is([data-screen="records"], [data-screen="book"]) .status-overdue { background: var(--warning-bg); color: var(--warning); }
body:is([data-screen="records"], [data-screen="book"]) .records-table td:nth-child(3) { min-width: 0; }
body:is([data-screen="records"], [data-screen="book"]) .records-table tr > :first-child { padding-inline-start: 18px; }
body:is([data-screen="records"], [data-screen="book"]) .records-table tr > :last-child { width: 1%; padding-inline-end: 18px; text-align: end; }
body:is([data-screen="records"], [data-screen="book"]) .record-actions { white-space: nowrap; }
body:is([data-screen="records"], [data-screen="book"]) .record-actions .row-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-block-size: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff; text-decoration: none; }
body:is([data-screen="records"], [data-screen="book"]) .record-actions svg { inline-size: 17px; block-size: 17px; flex: none; }
body:is([data-screen="records"], [data-screen="book"]) .record-actions .record-action-edit { min-inline-size: 52px; color: var(--maroon); }
body:is([data-screen="records"], [data-screen="book"]) .record-actions .record-action-edit:hover { background: var(--canvas); }
body:is([data-screen="records"], [data-screen="book"]) .record-actions .record-action-delete { min-inline-size: 44px; margin-inline-start: 6px; color: var(--error); }
body:is([data-screen="records"], [data-screen="book"]) .record-actions .record-action-delete:hover { background: var(--error-bg); }
body:is([data-screen="records"], [data-screen="book"]) .mobile-record dl { margin: 12px 0; }
.team-search-field { position: relative; }
.team-search-field svg { position: absolute; left: 12px; bottom: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.team-search-field input { padding-inline-start: 38px; }
@media (max-width: 700px) {
  .table-card-head { align-items: stretch; }
  body:is([data-screen="records"], [data-screen="book"]) .records-toolbar { inline-size: 100%; margin-inline-start: 0; }
  body:is([data-screen="records"], [data-screen="book"]) .records-toolbar > search { flex: 1 1 100%; }
  body:is([data-screen="records"], [data-screen="book"]) .table-card-head #more-filters > .filter-grid { position: fixed; inset: 12px 12px auto; z-index: 110; width: auto; max-block-size: calc(100dvh - 24px); block-size: auto; border-radius: 10px; }
  .table-card-head .filters, body:is([data-screen="records"], [data-screen="book"]) .table-card-head .filters { width: 100%; }
  .table-card-head .search-row { flex: 1 1 100%; flex-direction: row; }
  .table-card-head .search-row .field { width: auto; flex: 1; }
  .table-card-head details > .filter-grid { right: auto; left: 0; width: min(460px, calc(100vw - 48px)); }
}
@media (max-width: 700px) {
  body:is([data-screen="records"], [data-screen="book"]):has(#more-filters[open]) { overflow: hidden; }
  body:is([data-screen="records"], [data-screen="book"]):has(#more-filters[open])::before { position: fixed; z-index: 100; inset: 0; background: #20212466; content: ""; }
  body:is([data-screen="records"], [data-screen="book"]) .active-filters { padding-inline: 18px; }
}
@media (max-width: 420px) { .table-card-head details > .filter-grid { grid-template-columns: 1fr; } .table-card-head .bs-range-field { grid-column: auto; } }
@media (max-width: 700px) {
  body:is([data-screen="records"], [data-screen="book"]) .filters { padding: 14px; }
  body:is([data-screen="records"], [data-screen="book"]) .table-card-head .filters { padding: 0; }
  .table-card-head .search-row .button { width: auto; }
}
.delete-dialog { position: fixed; inset: 0; width: min(480px, calc(100vw - 32px)); max-width: none; max-height: min(82vh, 780px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); box-shadow: 0 14px 40px rgba(22, 25, 23, .18); }
.delete-dialog::backdrop { background: rgba(20, 24, 22, .42); }
.delete-fallback { max-width: 480px; margin: 48px auto; }
.delete-fallback .delete-card { border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.delete-card { padding: 24px; }
.delete-card h2 { margin: 0; font-size: 22px; line-height: 1.25; text-align: center; }
.delete-identity { margin: 7px 0 18px; color: var(--muted); font-size: 14px; }
.delete-details { margin: 18px 0; border-top: 1px solid var(--line); }
.delete-details div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.delete-details dt { color: var(--muted); font-size: 13px; }
.delete-details dd { margin: 0; font-size: 14px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.delete-effects { margin: 16px 0; font-size: 14px; line-height: 1.45; }
.delete-effects p + p { margin-top: 6px; }
.delete-unsaved { margin: 12px 0; padding: 9px 11px; border-left: 2px solid var(--maroon); background: var(--canvas); font-size: 13px; }
.delete-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; margin-top: 20px; }
.delete-actions .button { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; text-align: center; }
@media (max-width: 420px) { .delete-card { padding: 20px; } }
