/* Capresso Premium: presentation layer; business values remain in app.js. */
:root {
  --sidebar: 232px;
  --radius: 16px;
  --cp-motion: 160ms;
  --cp-ease: cubic-bezier(.2, .7, .2, 1);
  --bg: #f5f5f3;
  --surface-2: #f6f6f4;
  --muted: #62625e;
  --border: #e1e1dc;
  --accent-text: #bb211c;
  --shadow: 0 8px 28px rgb(0 0 0 / .07);
}
body[data-theme="dark"] {
  --bg: #131313;
  --surface: #1c1c1b;
  --surface-2: #252524;
  --border: #41413c;
  --muted: #b6b6ae;
  --accent-text: #ff8b85;
  --shadow: 0 8px 28px rgb(0 0 0 / .22);
}
body { font-size: 14px; line-height: 1.5; }
h1, h2 { line-height: 1.2; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { touch-action: manipulation; }
button { line-height: 1.35; }
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgb(226 33 28 / .09);
}
.skip-link { position: fixed; z-index: 150; top: 12px; left: 16px; padding: 12px 18px; background: var(--surface); color: var(--text); border-radius: 10px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.button, .icon-button, .text-button, .nav-link, .resource-tab, .quick-link {
  transition: background-color var(--cp-motion) var(--cp-ease), border-color var(--cp-motion) var(--cp-ease), box-shadow var(--cp-motion) var(--cp-ease), transform var(--cp-motion) var(--cp-ease);
}
.button { min-height: 44px; padding: 11px 17px; border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 650; }
.button.primary { background: linear-gradient(180deg, #e2211c, #cf1e19); box-shadow: 0 2px 4px rgb(226 33 28 / .12); }
.button.primary:hover { background: #c51b17; box-shadow: 0 4px 12px rgb(226 33 28 / .16); }
.button:hover { transform: none; }
.button:active, .icon-button:active { transform: translateY(1px); }
.button:disabled, .icon-button:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; transform: none; }
.button.secondary { background: var(--surface); }
.button.secondary:hover, .icon-button:hover { background: var(--surface-2); border-color: var(--muted); }
.icon-button { width: 44px; height: 44px; flex-shrink: 0; display: inline-grid; place-items: center; border-radius: 10px; background: var(--surface); }
.text-button { min-height: 44px; padding: 8px 3px; text-align: left; font-size: 13px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.app-shell { min-height: 100dvh; }
.main-area { display: flex; flex-direction: column; }
.sidebar { background: #111110; border-right: 1px solid #2b2b28; overflow-y: auto; overscroll-behavior: contain; }
.brand-block { height: 100px; flex: 0 0 100px; padding: 24px; }
.brand-full { width: 144px; height: 54px; }
.sidebar nav { padding: 16px 12px; gap: 4px; }
.nav-group-label { margin: 18px 14px 6px; color: #a8a8a1; font-size: 10px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.nav-group-label:first-child { margin-top: 0; }
.nav-link { min-height: 46px; border: 1px solid transparent; padding: 11px 13px; color: #d2d2cd; font-size: 13px; font-weight: 550; }
.nav-symbol { width: 22px; flex: 0 0 22px; font-family: "Segoe UI Symbol", "Segoe UI", sans-serif; font-size: 19px; }
.nav-link:hover { background: #252522; color: #fff; }
.nav-link.active { border-color: #44443e; background: #2a2926; color: #fff; box-shadow: inset 3px 0 var(--cp-red); }
#sideCreate { margin-top: 14px; background: #e2211c; color: #fff; font-weight: 650; }
#sideCreate:hover { background: #c51b17; }
.sidebar-evolution { margin: auto 16px 16px; padding: 16px 0; border: 0; border-top: 1px solid #343430; border-radius: 0; background: transparent; }
.sidebar-evolution strong { font-size: 13px; font-weight: 600; }
.sidebar-evolution p { font-size: 12px; color: #afafa7; }
.sidebar-evolution .mini-label { color: #e6aaa6; font-size: 10px; }
.logout { flex-shrink: 0; margin-bottom: 18px; }
.nav-close, .nav-backdrop { display: none; }
body.sidebar-collapsed .nav-group-label { display: none; }
body.sidebar-collapsed .nav-link { padding: 10px; }
.topbar { display: grid; grid-template-columns: 44px minmax(170px, 1fr) minmax(180px, 260px) auto auto 44px 44px; gap: 12px; min-height: 88px; padding: 18px 28px; backdrop-filter: blur(10px); }
.title-block { min-width: 0; }
.title-block h1 { font-size: 22px; }
.title-block .eyebrow { font-size: 10px; letter-spacing: .09em; }
.global-search { width: 100%; min-width: 0; margin: 0; padding: 10px 13px; min-height: 44px; }
.global-search input { min-height: 20px; font-size: 13px; }
.global-search:focus-within { outline: 2px solid var(--accent-text); outline-offset: 2px; }
#headerCreate, #headerCreateAsset { white-space: nowrap; }
.topbar > .button.primary { display: inline-flex; align-items: center; justify-content: center; }
.user-chip { padding: 0; gap: 8px; }
.avatar { width: 34px; height: 34px; font-size: 12px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.user-chip strong { font-size: 12px; font-weight: 600; max-width: 110px; }
.user-chip small { font-size: 11px; }
.notification-panel { width: min(390px, calc(100vw - 32px)); max-height: min(65dvh, 600px); }
.notification-head h2 { font-size: 22px; }
.notification-count { font-size: 10px; }
.content { flex: 1; width: 100%; max-width: 1600px; padding: 32px 32px 48px; }
.dashboard-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, .48fr); gap: 24px; }
.hero-panel { min-height: 224px; padding: 28px 32px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 20px; border: 1px solid var(--border); border-left: 3px solid var(--cp-red); border-radius: 16px; box-shadow: none; color: var(--text); background: linear-gradient(120deg, var(--surface), var(--surface-2)); }
.hero-panel .eyebrow { color: var(--accent-text); }
.hero-panel h2 { max-width: 580px; margin: 12px 0; font-size: clamp(26px, 2.6vw, 38px); }
.hero-panel p:last-child { max-width: 500px; font-size: 14px; line-height: 1.6; opacity: 1; color: var(--muted); }
.quick-access { padding: 22px 24px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.quick-access > p { margin-bottom: 12px; color: var(--muted); }
.quick-link { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 14px; padding: 14px 0; text-align: left; color: var(--text); background: transparent; border: 0; cursor: pointer; }
.quick-link + .quick-link { border-top: 1px solid var(--border); }
.quick-link strong { display: block; font-weight: 650; font-size: 14px; }
.quick-link small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.quick-link > span:last-child { font-size: 22px; color: var(--accent-text); }
.quick-link:hover { color: var(--accent-text); }
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin: 24px 0 36px; }
.kpi-card { grid-column: span 2; min-width: 0; padding: 20px; border-radius: 14px; box-shadow: 0 3px 14px rgb(0 0 0 / .025); }
#dashboardView .kpi-card:nth-child(n+4) { grid-column: span 3; }
.kpi-card span { font-size: 12px; font-weight: 600; color: var(--text); }
.kpi-card strong { font-size: 32px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; margin: 12px 0 5px; }
.kpi-card small { font-size: 12px; line-height: 1.5; }
#dashboardView .kpi-card:first-child { border-top: 3px solid var(--cp-red); padding-top: 18px; }
.asset-kpis, .resource-kpis, #preventiveView .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.asset-kpis .kpi-card, .resource-kpis .kpi-card, #preventiveView .kpi-card { grid-column: auto; }
.section-heading { gap: 20px; margin: 0 0 20px; flex-wrap: wrap; align-items: flex-end; }
.section-heading h2 { font-size: 24px; }
.cases-heading { flex-direction: row; }
.section-heading p:not(.eyebrow), .section-intro { color: var(--muted); max-width: 760px; line-height: 1.6; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.case-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.case-card { border-radius: 14px; padding: 22px; transition: border-color var(--cp-motion), box-shadow var(--cp-motion); }
.case-card:hover { transform: none; border-color: var(--muted); box-shadow: var(--shadow); }
.case-card h3 { font-size: 17px; margin: 16px 0 8px; line-height: 1.4; overflow-wrap: anywhere; }
.case-card-top strong { font-size: 12px; font-weight: 650; }
.case-card-action { padding: 14px 0; margin-top: 8px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: transparent; border-radius: 0; }
.case-card-action span { font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.case-card-action strong { font-size: 13px; font-weight: 600; }
.case-card-meta { flex-wrap: wrap; font-size: 12px; }
.badge, .due-chip { font-size: 12px; font-weight: 600; }
.filter-panel { margin: 0 0 20px; padding: 0 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.filter-panel > summary { padding: 16px 0; cursor: pointer; font-size: 14px; font-weight: 650; }
.filter-summary { margin-left: 14px; color: var(--muted); font-size: 12px; font-weight: 400; }
.filter-panel .filter-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 4px 0 14px; }
.filter-row label { min-width: 0; display: grid; gap: 7px; font-size: 12px; font-weight: 600; color: var(--muted); }
.filter-row select { width: 100%; min-width: 0; min-height: 44px; color: var(--text); font-size: 13px; background: var(--surface); }
.filter-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.table-panel { border-radius: 14px; }
.table-wrap { scrollbar-width: thin; scrollbar-color: var(--muted) var(--surface-2); }
th { padding: 14px 18px; font-size: 10px; font-weight: 650; color: var(--muted); }
td { padding: 18px; font-size: 13px; line-height: 1.5; vertical-align: top; }
td strong { font-weight: 600; }
td small { display: block; font-size: 12px; margin-top: 4px; }
tbody tr:last-child td { border-bottom: 0; }
.empty-state { padding: 48px 24px; }
.empty-state strong { font-size: 17px; color: var(--text); }
.empty-state span { font-size: 13px; }
.resource-tabs { border-radius: 12px; padding: 5px; gap: 4px; background: var(--surface-2); }
.resource-tab { min-height: 44px; font-size: 13px; font-weight: 600; border-radius: 9px; }
.resource-tab.active { background: var(--surface); color: var(--accent-text); box-shadow: 0 2px 5px rgb(0 0 0 / .06); border: 1px solid var(--border); }
.resource-guidance { box-shadow: none; }
.resource-action { border-radius: 14px; }
.resource-action > summary { padding: 16px; min-height: 48px; font-weight: 600; }
.form-grid { gap: 20px; }
.form-grid label { gap: 8px; font-size: 13px; font-weight: 600; line-height: 1.5; }
.form-grid :is(input, select, textarea), .installation-toolbar input, .installation-form input:not([type=checkbox]) { min-height: 44px; padding: 11px 13px; background: var(--surface); border-radius: 10px; font-size: 14px; }
.form-grid :is(input, select, textarea):focus-visible { outline: 2px solid var(--accent-text); }
.form-grid :is(input[type=checkbox], input[type=radio]) { min-height: 20px; width: 20px; height: 20px; padding: 0; }
.field-help, .form-feedback, .selected-files { font-size: 12px; line-height: 1.6; }
.form-intro { font-size: 14px; line-height: 1.65; }
.modal { max-height: calc(100dvh - 40px); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 24px 80px rgb(0 0 0 / .2); overscroll-behavior: contain; }
.modal::backdrop { background: rgb(0 0 0 / .48); backdrop-filter: blur(3px); }
html:has(dialog[open]), body:has(dialog[open]) { overflow: hidden; }
.modal form > .modal-head { position: sticky; top: -28px; z-index: 5; margin: -28px -28px 0; padding: 24px 28px 18px; background: var(--surface); border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 24px; }
.modal-head > div { min-width: 0; }
.modal-head .icon-button { margin-left: 14px; }
.modal form > .modal-actions { padding: 16px 28px; background: var(--surface); backdrop-filter: none; }
.qr-intake { padding: 18px; background: var(--surface-2); border-left-width: 3px; }
.qr-intake-actions { justify-content: flex-start; }
.qr-options { margin-bottom: 24px; border: 1px solid var(--border); border-radius: 12px; }
.qr-options > summary { min-height: 48px; padding: 14px 16px; cursor: pointer; font-weight: 600; font-size: 13px; }
.qr-options > summary .optional { margin-left: 8px; color: var(--muted); font-weight: 400; }
.qr-options > .qr-intake { margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0 0 12px 12px; }
.detail-drawer { display: flex; flex-direction: column; max-height: 100dvh; }
.drawer-head { flex: 0 0 auto; height: auto; min-height: 90px; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { overflow-wrap: anywhere; }
.drawer-scroll { height: auto; min-height: 0; flex: 1; padding: 24px; overscroll-behavior: contain; }
.case-accordion { border-radius: 14px; }
.case-accordion > summary { min-height: 48px; font-size: 14px; }
.detail-drawer :is(input, select, textarea) { max-width: 100%; }
.detail-drawer :is(.work-actions, .cost-controls, .cost-item-head, .composer-actions) { flex-wrap: wrap; }
.detail-drawer .attachment-preview { flex-shrink: 0; }
.asset-metric-grid strong, .case-metric-grid strong { font-variant-numeric: tabular-nums; }
.preventive-card { padding: 20px; border-radius: 14px; }
.preventive-date strong { font-variant-numeric: tabular-nums; }
.poes-card, .poes-document { border-radius: 14px; }
.poes-card h3 { font-size: 17px; }
footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 32px; font-size: 12px; background: #ba211c; }
footer strong { font-weight: 600; }
.auth-card { padding: 36px; border-radius: 18px; }
.auth-card h1 { font-size: 30px; }
.auth-card .button { width: 100%; margin-top: 12px; }
@media (min-width: 1200px) {
  #dashboardView .kpi-grid { grid-template-columns: 1.2fr repeat(4, minmax(0, 1fr)); }
  #dashboardView .kpi-card:nth-child(n) { grid-column: auto; }
}
@media (min-width: 1400px) { .case-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-height: 760px) { .sidebar-evolution { display: none !important; } .sidebar .logout { margin-top: auto; } }
@media (max-width: 1440px) { .user-chip > span:last-child { display: none; } }
@media (max-width: 1280px) {
  .topbar { grid-template-columns: 44px minmax(0, 1fr) auto 34px 44px 44px; gap: 10px; }
  .global-search { display: flex; grid-row: 2; grid-column: 1 / -1; width: 100%; }
  .title-block { min-width: 0; }
  .asset-kpis, .resource-kpis, #preventiveView .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  :root, body.sidebar-collapsed { --sidebar: 0px; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .main-area { grid-column: 1; }
  .sidebar { width: min(300px, calc(100vw - 48px)); z-index: 50; transform: translateX(-105%); transition: transform var(--cp-motion) var(--cp-ease); }
  body.mobile-menu { overflow: hidden; }
  body.mobile-menu .sidebar { transform: none; }
  .nav-backdrop:not([hidden]) { display: block; position: fixed; z-index: 40; inset: 0; width: 100%; height: 100dvh; padding: 0; border: 0; background: rgb(0 0 0 / .44); cursor: pointer; }
  .nav-close { display: inline-grid; margin-left: auto; color: #fff; background: #242422; border-color: #454540; }
  body.sidebar-collapsed .brand-full, body.sidebar-collapsed .nav-link span:last-child, body.sidebar-collapsed .sidebar-evolution, body.sidebar-collapsed .nav-group-label { display: block; }
  body.sidebar-collapsed .brand-icon { display: none; }
  body.sidebar-collapsed .brand-block { justify-content: flex-start; padding: 24px; }
  body.sidebar-collapsed .nav-link { justify-content: flex-start; padding: 11px 13px; }
  .content { padding: 28px 24px 40px; }
  .filter-panel .filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heading-actions { width: 100%; }
  .dashboard-intro { gap: 16px; }
}
@media (max-width: 760px) {
  .topbar { grid-template-columns: 44px minmax(0, 1fr) 44px 44px; padding: 14px 16px; gap: 10px; }
  .title-block .eyebrow { font-size: 9px; letter-spacing: .06em; }
  .title-block h1 { font-size: 19px; }
  .user-chip { display: none; }
  .global-search { grid-row: 2; grid-column: 1 / 3; order: initial; width: 100%; }
  #headerCreate, #headerCreateAsset { grid-row: 2; grid-column: 3 / 5; font-size: 13px; }
  .notification-center { grid-row: 1; grid-column: 3; }
  #cpThemeToggle { grid-row: 1; grid-column: 4; }
  .notification-panel { top: 130px; right: 16px; }
  .content { padding: 24px 16px 32px; }
  .dashboard-intro { grid-template-columns: minmax(0, 1fr); }
  .hero-panel { padding: 24px; min-height: 0; }
  .hero-panel h2 { font-size: 28px; }
  .quick-access { padding: 16px 20px; }
  .quick-access .quick-link { padding: 12px 0; }
  .kpi-grid, .asset-kpis, .resource-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 20px 0 28px; }
  .kpi-card, #dashboardView .kpi-card:nth-child(n+4) { grid-column: auto; padding: 16px; }
  #dashboardView .kpi-card:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 16px; }
  #dashboardView .kpi-card:last-child strong { grid-column: 2; grid-row: 1 / 3; margin: 0; }
  .kpi-card strong { font-size: 28px; }
  .kpi-card span, .kpi-card small { font-size: 12px; }
  .case-cards { grid-template-columns: minmax(0, 1fr); }
  .section-heading { gap: 12px; margin-bottom: 16px; align-items: flex-start; }
  .section-heading h2 { font-size: 22px; }
  .heading-actions { display: flex; flex-wrap: wrap; }
  .heading-actions .button { flex: 1 1 auto; }
  .filter-panel { padding: 0 16px; }
  .filter-summary { display: block; margin: 4px 0 0 18px; }
  .filter-panel .filter-row { gap: 12px; }
  #casesBody, #inventoryBody, #assetsBody { gap: 12px; padding: 12px; }
  #casesBody tr, #assetsBody tr, #inventoryBody tr { padding: 18px; gap: 12px; box-shadow: none; border-radius: 12px; }
  #casesBody td, #assetsBody td, #inventoryBody td { grid-template-columns: minmax(84px, 30%) minmax(0, 1fr); font-size: 13px; overflow-wrap: anywhere; }
  #casesBody td::before, #assetsBody td::before, #inventoryBody td::before { font-size: 10px; line-height: 1.6; }
  #casesBody td small, #assetsBody td small, #inventoryBody td small { grid-column: 2; justify-self: stretch; }
  #casesBody td[data-label="Trabajo"], #assetsBody td[data-label="Activo"] { font-size: 15px; }
  #casesBody td[data-label="Trabajo"] { display: block; text-align: left; padding: 10px 0; border-block: 1px solid var(--border); }
  #casesBody td[data-label="Trabajo"]::before { display: block; margin-bottom: 6px; }
  #casesBody td[data-label="Trabajo"] strong, #casesBody td[data-label="Trabajo"] small { text-align: left; }
  .form-grid { gap: 18px; }
  .form-grid :is(input, select, textarea), .filter-row select, #poesView :is(input, select, textarea), .installation-form input:not([type=checkbox]) { font-size: 16px; }
  .modal { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 16px; }
  .modal form { padding: 20px; }
  .modal form > .modal-head { top: -20px; margin: -20px -20px 0; padding: 18px 20px; }
  .modal-head h2 { font-size: 22px; }
  .modal form > .modal-actions { margin: 20px -20px -20px; padding: 14px 20px; }
  .modal-actions .button { flex: 1; }
  .qr-intake { padding: 16px; }
  .qr-intake-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .drawer-head { padding: 18px; min-height: 82px; }
  .drawer-scroll { height: auto; padding: 18px; }
  .resource-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-inline: 0; }
  .resource-tab { white-space: normal; padding: 10px; }
  .resource-catalog-grid { grid-template-columns: minmax(0, 1fr); }
  .case-section-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .case-section-nav button { min-height: 44px; font-size: 12px; }
  .case-accordion > summary { top: 110px; }
  .case-accordion, #nextActionPanel { scroll-margin-top: 126px; }
  .workflow-summary { font-size: 13px; }
  .installations-header h2 { font-size: 22px; }
  .preventive-card { padding: 16px; gap: 14px; }
  .label-sheet { justify-content: start; overflow-x: auto; max-width: 100%; }
  footer { padding: 16px; flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .filter-panel .filter-row { grid-template-columns: minmax(0, 1fr); }
  .hero-panel h2 { font-size: 26px; }
  .hero-panel .button { width: 100%; }
  .title-block h1 { font-size: 17px; }
  .title-block .eyebrow { letter-spacing: 0; }
  .global-search input { font-size: 16px; }
  .case-card { padding: 20px; }
  .notification-panel { right: 10px; width: calc(100vw - 20px); }
}
@media (pointer: coarse) {
  .text-button, summary, .evidence-classification .text-button { min-height: 44px; }
  input[type=checkbox], input[type=radio] { min-width: 20px; min-height: 20px; }
  .selection-cell { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
  .case-loading-spinner { animation: none; border-style: dotted; }
}
@media screen {
  .labels-modal > div { padding: 24px; }
  .labels-modal .modal-head { gap: 20px; margin-bottom: 24px; }
  .labels-modal .label-print-controls { align-items: end; gap: 20px; margin-bottom: 16px; }
  .labels-modal .label-print-controls label { display: grid; gap: 8px; min-width: 160px; }
  .labels-modal .label-print-controls select { min-height: 44px; }
  .labels-modal #labelSelectionSummary { align-self: center; font-weight: 600; }
  .labels-modal .form-intro { margin: 0 0 20px; }
  @media (max-width: 760px) {
    .labels-modal > div { padding: 16px; }
    .labels-modal .label-print-controls { align-items: stretch; gap: 16px; }
    .labels-modal #labelSelectionSummary { align-self: start; }
  }
}
@media print {
  .topbar, .sidebar, .nav-backdrop, .skip-link { display: none !important; }
  .label-sheet { overflow: visible; }
}

/* Server paginated lists and actionable role queues. */
.list-pager { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 20px; border-top:1px solid var(--border); color:var(--muted); font-size:13px; }
.pager-actions { display:flex; align-items:end; gap:10px; }
.pager-actions label { display:grid; gap:5px; font-size:12px; }
.pager-actions select { min-height:44px; width:85px; }
.queue-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:20px 0; }
.queue-tabs button { border:1px solid var(--border); border-radius:12px; background:var(--surface); color:var(--text); padding:12px 18px; min-height:44px; font:600 14px "Segoe UI",sans-serif; cursor:pointer; }
.queue-tabs button[aria-selected="true"] { background:var(--text); color:var(--surface); border-color:var(--text); }
.queue-tabs button:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.queue-list { display:grid; gap:12px; }
.queue-card { display:flex; gap:20px; align-items:center; justify-content:space-between; padding:22px; background:var(--surface); border:1px solid var(--border); border-radius:16px; }
.queue-card h3 { margin:7px 0; font-size:18px; }
.queue-card p { margin:5px 0 12px; color:var(--muted); }
.queue-meta { display:flex; flex-wrap:wrap; gap:10px 16px; align-items:center; font-size:12px; color:var(--muted); }
.asset-option-tools { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:8px; }
.asset-option-tools input { min-width:140px; flex:1; min-height:44px; }
.asset-option-tools button { min-height:44px; }
.asset-option-tools small { width:100%; }
@media(max-width:760px) { .list-pager,.queue-card { flex-direction:column; align-items:stretch; padding:16px; } .pager-actions { justify-content:space-between; flex-wrap:wrap; } .queue-card>.button { width:100%; } .queue-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* One assigned operational profile at a time, backed by AuthSystem. */
.active-profile-control { min-width:0; display:grid; align-self:center; gap:4px; }
.active-profile-control label { margin:0; color:var(--muted); font-size:11px; line-height:1.2; font-weight:650; }
.active-profile-control select { width:100%; min-width:0; min-height:44px; padding:9px 30px 9px 12px; border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--text); font-size:13px; font-weight:650; }
.active-profile-control select:disabled { opacity:1; color:var(--muted); background:var(--surface-2); cursor:default; }
.active-profile-control[aria-busy="true"] select { cursor:progress; }
.active-profile-status { font-size:11px; line-height:1.35; color:var(--accent-text); max-width:240px; }
.active-profile-status:empty { display:none; }
.active-profile-control .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.topbar { grid-template-columns:44px minmax(150px,1fr) minmax(145px,180px) minmax(170px,230px) auto auto 44px 44px; }
.topbar > #cpSidebarToggle { grid-row:1; grid-column:1; }
.topbar > .title-block { grid-row:1; grid-column:2; }
.topbar > .active-profile-control { grid-row:1; grid-column:3; }
.topbar > .global-search { grid-row:1; grid-column:4; }
.topbar > #headerCreate,.topbar > #headerCreateAsset { grid-row:1; grid-column:5; }
.topbar > .user-chip { grid-row:1; grid-column:6; }
.topbar > .notification-center { grid-row:1; grid-column:7; }
.topbar > #cpThemeToggle { grid-row:1; grid-column:8; }
.profile-change-dialog { max-width:540px; padding:24px; }
.profile-change-dialog > .modal-head { margin:0 0 16px; }
.profile-change-dialog > .modal-head h2 { margin:0; }
.profile-change-dialog > p { margin:0; color:var(--muted); line-height:1.6; }
.profile-change-dialog > .modal-actions { margin-top:24px; gap:12px; }
@media(max-width:1280px) {
  .topbar { grid-template-columns:44px minmax(0,1fr) auto 34px 44px 44px; }
  .topbar > #cpSidebarToggle { grid-column:1; grid-row:1; }
  .topbar > .title-block { grid-column:2; grid-row:1; }
  .topbar > #headerCreate,.topbar > #headerCreateAsset { grid-column:3; grid-row:1; }
  .topbar > .user-chip { grid-column:4; grid-row:1; }
  .topbar > .notification-center { grid-column:5; grid-row:1; }
  .topbar > #cpThemeToggle { grid-column:6; grid-row:1; }
  .topbar > .active-profile-control { grid-column:1 / 3; grid-row:2; }
  .topbar > .global-search { grid-column:3 / -1; grid-row:2; align-self:end; }
}
@media(max-width:760px) {
  .topbar { grid-template-columns:44px minmax(0,1fr) 44px 44px; }
  .topbar > .active-profile-control { grid-row:2; grid-column:1 / 3; }
  .topbar > #headerCreate,.topbar > #headerCreateAsset { grid-row:2; grid-column:3 / -1; align-self:end; white-space:normal; }
  .topbar > .notification-center { grid-row:1; grid-column:3; }
  .topbar > #cpThemeToggle { grid-row:1; grid-column:4; }
  .topbar > .global-search { grid-row:3; grid-column:1 / -1; }
  .active-profile-control label { font-size:10px; }
  .active-profile-control select { font-size:16px; padding-left:10px; }
  .active-profile-status { max-width:none; }
  .profile-change-dialog .modal-actions { flex-direction:column-reverse; }
  .profile-change-dialog .modal-actions .button { width:100%; }
}
