:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #64748b;
    --line: #d8e2ee;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --blue-soft: #e8f0ff;
    --green: #15803d;
    --green-soft: #dcfce7;
    --yellow: #a16207;
    --yellow-soft: #fef3c7;
    --red: #b91c1c;
    --red-soft: #fee2e2;
    --sidebar: #0f2747;
    --sidebar-soft: #17365f;
}

/* Training center */
.training-tabs {
    margin-bottom: 16px;
}

.training-hero,
.training-detail-head,
.training-course-hero,
.training-exam-head,
.training-completion-panel,
.training-exam-callout,
.training-confirm-panel,
.training-result-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.training-hero h2,
.training-detail-head h2,
.training-course-hero h2,
.training-exam-head h2 {
    margin: 4px 0 6px;
}

.training-hero p,
.training-detail-head p,
.training-course-hero p,
.training-exam-head p,
.training-objective p,
.training-admin-panel p,
.training-completion-panel p,
.training-exam-callout p,
.training-confirm-panel p {
    margin: 0;
    color: var(--muted);
}

.training-metrics {
    margin-bottom: 16px;
}

.training-table td strong,
.training-table td small {
    display: block;
}

.training-table td small {
    margin-top: 3px;
    color: var(--muted);
}

.training-filter-panel {
    padding-top: 14px;
    padding-bottom: 14px;
}

.training-admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.training-admin-panel {
    margin: 0;
}

.training-admin-panel > summary {
    cursor: pointer;
    font-weight: 700;
}

.training-admin-panel[open] > summary {
    margin-bottom: 14px;
}

.training-resource-grid,
.training-course-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.training-resource-card,
.training-course-card {
    display: flex;
    gap: 14px;
    min-width: 0;
    margin: 0;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.training-resource-card:hover,
.training-course-card:hover {
    transform: translateY(-2px);
    border-color: rgba(42, 127, 149, .42);
    box-shadow: 0 10px 24px rgba(22, 50, 61, .08);
}

.training-resource-card > div:last-child,
.training-course-card {
    min-width: 0;
}

.training-resource-card h3,
.training-course-card h3 {
    margin: 8px 0 6px;
    font-size: 16px;
}

.training-resource-card p,
.training-course-card p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 10px;
    color: var(--muted);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.training-resource-icon {
    display: grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid #c8dce2;
    border-radius: 6px;
    background: #edf6f8;
    color: #1b6679;
    font-size: 11px;
    font-weight: 800;
}

.training-card-meta,
.training-course-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.training-page-head {
    margin-bottom: 14px;
}

.training-course-card {
    display: block;
}

.training-course-score {
    flex: 0 0 auto;
    min-width: 160px;
    padding: 14px 16px;
    border-left: 3px solid var(--accent);
    background: #f3f8f9;
}

.training-course-score span,
.training-course-score strong {
    display: block;
}

.training-course-score span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
}

.training-viewer {
    overflow: hidden;
    padding: 0;
    background: #111b20;
}

.training-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    background: #17262d;
    color: #f5fbfc;
}

.training-viewer-toolbar strong,
.training-viewer-toolbar span {
    display: block;
}

.training-viewer-toolbar > div > span {
    margin-top: 2px;
    color: #b9ccd2;
    font-size: 12px;
}

.training-viewer iframe {
    display: block;
    width: 100%;
    min-height: 72vh;
    border: 0;
    background: #fff;
}

.training-viewer video {
    display: block;
    width: 100%;
    max-height: 76vh;
    background: #000;
}

.training-viewer > img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 76vh;
    margin: 0 auto;
    object-fit: contain;
}

.training-progress-note {
    margin: 0;
    padding: 10px 16px;
    background: #17262d;
    color: #d9e8ec;
    font-size: 12px;
}

.training-completion-panel,
.training-exam-callout,
.training-confirm-panel {
    border-left: 3px solid var(--accent);
}

.training-choice-section {
    margin: 18px 0;
}

.training-choice-section h3 {
    margin: 0 0 10px;
}

.training-permission-layout {
    display: grid;
    grid-template-columns: minmax(230px, 320px) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.training-permission-directory,
.training-permission-editor {
    min-width: 0;
    margin: 0;
}

.training-permission-directory select[size] {
    min-height: 360px;
}

.training-permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.training-permission-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
}

.training-permission-option span,
.training-permission-option strong,
.training-permission-option small {
    display: block;
    min-width: 0;
}

.training-permission-option small {
    margin-top: 3px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.training-department-bulk {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.training-department-bulk > summary {
    cursor: pointer;
    font-weight: 700;
}

.training-participant-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 12px 0;
}

.training-participant-editor td {
    background: #f7fafb;
}

.training-release-overview {
    margin-bottom: 16px;
}

.training-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 350px;
    overflow: auto;
    padding: 2px;
}

.training-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
}

.training-choice > span:not(.training-required-toggle) {
    flex: 1 1 auto;
    min-width: 0;
}

.training-choice strong,
.training-choice small {
    display: block;
}

.training-choice small {
    margin-top: 2px;
    color: var(--muted);
}

.training-required-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
}

.training-assignment-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.training-assignment-picker fieldset {
    max-height: 310px;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--border);
}

.training-assignment-picker label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 3px;
}

.training-assignment-picker label small {
    margin-left: auto;
    color: var(--muted);
}

.training-assignment-list {
    margin-top: 18px;
}

.training-assignment-list > summary {
    cursor: pointer;
    font-weight: 700;
}

.training-assignment-list[open] > summary {
    margin-bottom: 10px;
}

.training-exam-form {
    display: grid;
    gap: 12px;
}

.training-question {
    margin: 0;
}

.training-question legend {
    width: 100%;
    margin-bottom: 12px;
    font-weight: 700;
}

.training-question legend > span,
.training-result-item h3 > span {
    display: inline-grid;
    width: 26px;
    height: 26px;
    margin-right: 8px;
    place-items: center;
    border-radius: 50%;
    background: #e6f2f5;
    color: #19687b;
    font-size: 12px;
}

.training-question legend small {
    margin-left: 8px;
    color: var(--muted);
    font-weight: 400;
}

.training-question > label {
    display: block;
    margin: 6px 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
}

.training-result-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid var(--accent-green);
}

.training-result-hero.is-failed {
    border-left-color: var(--accent-red);
}

.training-result-hero > strong {
    font-size: 40px;
    line-height: 1;
}

.training-result-hero > strong small {
    font-size: 14px;
}

.training-result-list {
    display: grid;
    gap: 10px;
}

.training-result-item {
    margin: 0;
    border-left: 3px solid var(--accent-green);
}

.training-result-item.is-wrong {
    border-left-color: var(--accent-red);
}

.training-result-item h3 {
    margin-top: 0;
}

.training-answer-explanation {
    padding: 10px 12px;
    background: #f5f8f9;
    color: var(--muted);
}

.training-question-manage-grid {
    display: grid;
    grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr);
    gap: 14px;
}

.training-bank-questions {
    display: grid;
    gap: 10px;
}

.training-bank-questions > .panel {
    margin: 0;
}

.training-option-preview {
    margin: 10px 0;
    padding-left: 24px;
}

.training-option-preview .is-answer {
    color: #15784d;
    font-weight: 700;
}

.training-file-grid,
.training-attachment-grid,
.training-linked-resources {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.training-attachment-grid > a,
.training-linked-resources > a {
    display: block;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
}

.training-attachment-grid strong,
.training-attachment-grid small,
.training-linked-resources strong,
.training-linked-resources small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.training-attachment-grid small,
.training-linked-resources small {
    margin-top: 4px;
    color: var(--muted);
}

.training-evidence-form {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin-top: 14px;
}

@media (max-width: 1100px) {
    .training-admin-grid,
    .training-resource-grid,
    .training-course-grid,
    .training-file-grid,
    .training-attachment-grid,
    .training-linked-resources {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .training-hero,
    .training-detail-head,
    .training-course-hero,
    .training-exam-head,
    .training-completion-panel,
    .training-exam-callout,
    .training-confirm-panel,
    .training-result-actions,
    .training-result-hero {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .training-admin-grid,
    .training-resource-grid,
    .training-course-grid,
    .training-choice-grid,
    .training-assignment-picker,
    .training-question-manage-grid,
    .training-file-grid,
    .training-attachment-grid,
    .training-linked-resources,
    .training-evidence-form,
    .training-permission-layout,
    .training-permission-grid,
    .training-participant-editor-grid {
        grid-template-columns: 1fr;
    }

    .training-permission-directory select[size] {
        min-height: 220px;
    }

    .training-choice-grid,
    .training-assignment-picker fieldset {
        max-height: 270px;
    }

    .training-course-score {
        min-width: 0;
    }

    .training-viewer iframe {
        min-height: 62vh;
    }

    .training-result-hero > strong {
        font-size: 32px;
    }
}

/* Linked workflow records and expandable change action plans */
.record-workflow-list {
    display: grid;
    gap: 8px;
}

.record-workflow-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 14px;
    border: 1px solid var(--line, #d7e0e5);
    border-radius: 6px;
    color: inherit;
    background: #fff;
    text-decoration: none;
}

.record-workflow-item:hover {
    border-color: #6aa3b4;
    background: #f7fbfc;
}

.record-workflow-item > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.record-workflow-item > div:last-child {
    justify-items: end;
    text-align: right;
}

.record-workflow-item small {
    color: var(--muted, #61727b);
}

.change-summary-row,
.qms-expandable-summary-row {
    cursor: pointer;
}

/* Keep an expanded detail row from participating in the source table's
   intrinsic column sizing. The header widths remain the single layout source. */
.data-table.qms-expandable-table {
    table-layout: fixed !important;
}

.data-table.qms-expandable-table .qms-inline-detail-row > td {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

.change-summary-row.is-expanded td,
.qms-expandable-summary-row.is-expanded td {
    background: #edf7f9 !important;
    border-bottom-color: #8db8c3;
}

.change-row-toggle,
.qms-inline-row-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 0;
    border: 0;
    color: #12647a;
    background: transparent;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.change-row-toggle span,
.qms-inline-row-toggle > span:first-child {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    color: #397c8e;
    font-size: 20px;
    line-height: 1;
    transition: transform 160ms ease;
}

.change-row-toggle[aria-expanded="true"] span,
.qms-inline-row-toggle[aria-expanded="true"] > span:first-child {
    transform: rotate(90deg);
}

.change-action-detail-row > td,
.qms-inline-detail-row > td {
    padding: 0 !important;
    background: #f7fafb !important;
    white-space: normal !important;
}

.change-inline-actions,
.qms-inline-detail-panel {
    contain: inline-size;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    padding: 14px 18px 18px;
    border-bottom: 1px solid #cbd9de;
}

.change-inline-actions-head,
.qms-inline-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.change-inline-actions-head > div,
.qms-inline-detail-head > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.change-inline-actions-head span,
.change-inline-actions-head small,
.qms-inline-detail-head span,
.qms-inline-detail-head small {
    color: var(--muted, #61727b);
}

.qms-inline-plan-list,
.qms-inline-action-list {
    display: grid;
    gap: 10px;
}

.qms-inline-plan-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid #d5e1e5;
    border-radius: 6px;
    background: #fff;
}

.qms-inline-plan-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 10px;
}

.qms-inline-plan-head > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.qms-inline-plan-head > div:last-child {
    justify-items: end;
    text-align: right;
}

.qms-inline-plan-head a {
    color: #12647a;
    font-weight: 700;
}

.qms-inline-plan-head small,
.qms-inline-empty {
    color: var(--muted, #61727b);
}

.qms-inline-action-row {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(0, .85fr) minmax(0, .8fr) minmax(0, .65fr) minmax(0, .8fr);
    gap: 12px;
    align-items: start;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #e0e8eb;
    border-radius: 5px;
    background: #fbfcfd;
}

.qms-inline-action-row > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.qms-inline-action-row span {
    color: var(--muted, #61727b);
    font-size: 12px;
}

.qms-inline-action-row strong {
    overflow-wrap: anywhere;
    font-weight: 600;
}

.qms-inline-empty {
    padding: 10px 0 2px;
}

@media (max-width: 760px) {
    .record-workflow-item,
    .change-inline-actions-head,
    .qms-inline-detail-head,
    .qms-inline-plan-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .record-workflow-item > div:last-child,
    .qms-inline-plan-head > div:last-child {
        justify-items: start;
        text-align: left;
    }

    .change-inline-actions,
    .qms-inline-detail-panel {
        padding: 12px;
    }

    .qms-inline-action-row {
        grid-template-columns: 1fr;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    color: var(--blue-dark);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 4px;
    font-size: 22px;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 14px;
    font-size: 18px;
    letter-spacing: 0;
}

p {
    color: var(--muted);
}

.app-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--sidebar);
    color: #e7eef9;
    padding: 18px 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 8px;
    background: #ffffff;
    color: var(--sidebar);
    font-weight: 800;
}

.brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 8px;
    background: #ffffff;
}

.brand-title {
    font-size: 18px;
    font-weight: 800;
    word-break: break-word;
}

.brand-subtitle {
    color: #bdd0e8;
    font-size: 12px;
}

.nav {
    padding-top: 14px;
}

.nav a,
.nav-group-title,
.nav-section {
    display: block;
    border-radius: 6px;
}

.nav a {
    padding: 8px 10px;
    color: #d9e7f8;
}

.nav a:hover,
.nav a.active {
    background: var(--sidebar-soft);
    color: #ffffff;
}

.nav-section {
    margin: 16px 0 6px;
    padding: 0 10px;
    color: #8fb0d5;
    font-size: 12px;
    font-weight: 800;
}

.nav-accordion {
    margin-bottom: 8px;
}

.nav-accordion summary {
    display: block;
    cursor: pointer;
    margin: 16px 0 6px;
    padding: 0 10px;
    color: #8fb0d5;
    font-size: 12px;
    font-weight: 800;
    list-style: none;
}

.nav-accordion summary::-webkit-details-marker {
    display: none;
}

.nav-accordion summary::after {
    content: "⌄";
    float: right;
}

.nav-accordion:not([open]) summary::after {
    content: "›";
}

.nav-group {
    margin-bottom: 6px;
}

.nav-group-title {
    padding: 8px 10px 4px;
    color: #ffffff;
    font-weight: 700;
}

.nav-group a {
    margin-left: 8px;
    padding-left: 18px;
    font-size: 13px;
}

.main {
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 76px;
    padding: 18px 28px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.topbar-title {
    min-width: 0;
    flex: 1;
}

.topbar p {
    margin-bottom: 0;
}

.sidebar-toggle {
    display: none;
    width: 40px;
    min-height: 38px;
    padding: 0;
    background: #eef4fb;
    color: #1e3a5f;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.role-badge,
.status-chip {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: #1e40af;
    font-size: 12px;
    font-weight: 700;
}

.status-chip.success-chip {
    background: var(--green-soft);
    color: var(--green);
}

.status-chip.warning-chip {
    background: var(--yellow-soft);
    color: var(--yellow);
}

.status-chip.danger-chip {
    background: var(--red-soft);
    color: var(--red);
}

.status-chip.info-chip {
    background: var(--blue-soft);
    color: #1e40af;
}

.status-chip.muted-chip {
    background: #f1f5f9;
    color: var(--muted);
}

.status-chip.closed-chip {
    background: #a3a3a3;
    color: #ffffff;
}

.status-chip.delayed-closed-chip {
    background: #d4d4d4;
    color: #c00;
}

.content {
    padding: 24px 28px 42px;
}

.admin-link-grid .metric-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-weight: 500;
}

.tab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tab-row a {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-weight: 700;
}

.tab-row a.active {
    border-color: var(--blue);
    background: var(--blue-soft);
    color: var(--blue);
}

.inline-form {
    margin-top: 16px;
}

.panel,
.metric-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.panel {
    margin-bottom: 18px;
    padding: 20px;
}

.panel.narrow {
    max-width: 560px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.metric-card {
    padding: 18px;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    line-height: 1;
}

.metric-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.metric-link {
    color: var(--text);
}

.metric-link:hover {
    border-color: #9bb8dc;
    color: var(--text);
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.tabs a {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--muted);
    font-weight: 700;
}

.tabs a.active {
    border-color: #93c5fd;
    background: var(--blue-soft);
    color: #1e40af;
}

.module-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.module-head p {
    margin-bottom: 0;
}

.module-actions,
.form-actions,
.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.form-actions {
    margin-top: 16px;
    justify-content: flex-end;
}

.form-actions.left {
    justify-content: flex-start;
    margin: -6px 0 14px;
}

.form-actions.left > select {
    width: auto;
    min-width: 168px;
}

.account-delete-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.account-delete-form input[type="password"] {
    width: 132px;
    min-width: 0;
    padding: 6px 8px;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-radius: 6px;
    background: var(--blue);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.button:hover,
button:hover {
    background: var(--blue-dark);
    color: #ffffff;
}

.button.secondary,
button.secondary {
    background: #eef4fb;
    color: #1e3a5f;
}

.button.secondary:hover,
button.secondary:hover {
    background: #dde9f6;
    color: #1e3a5f;
}

.danger-button {
    background: var(--red);
    color: #fff;
}

.danger-button:hover {
    background: #b91c1c;
    color: #fff;
}

.button-link {
    min-height: 0;
    padding: 0;
    background: transparent;
    color: var(--blue);
}

.button-link:hover {
    background: transparent;
    color: var(--blue-dark);
}

.button-link.danger {
    color: var(--red);
}

.form {
    display: grid;
    gap: 14px;
}

.inline-action-plan-fields {
    display: grid;
    min-width: 0;
    max-width: 100%;
    gap: 14px;
}

.inline-action-plan-fields > .table-wrap {
    min-width: 0;
    max-width: 100%;
}

.form-section-title {
    margin-top: 8px;
    padding: 8px 10px;
    border-left: 3px solid var(--blue);
    border-radius: 4px;
    background: #f2f7ff;
    color: #1e3a5f;
    font-weight: 800;
}

.attachment-upload-grid,
.attachment-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.attachment-groups {
    margin-top: 14px;
}

.attachment-group {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafc;
}

.attachment-group h3 {
    margin-bottom: 10px;
    font-size: 15px;
}

.attachment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.attachment-row:last-child {
    border-bottom: 0;
}

.attachment-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.attachment-preview-card {
    display: block;
    min-width: 0;
    padding: 12px 0;
}

.attachment-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    margin-bottom: 10px;
}

.attachment-preview-head > div:first-child {
    min-width: 0;
}

.attachment-preview-head strong {
    display: block;
    overflow-wrap: anywhere;
}

.attachment-inline-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 180px;
    max-height: min(62vh, 720px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #eef2f5;
}

.attachment-inline-image img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(62vh, 720px);
    object-fit: contain;
}

.attachment-inline-image span {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 5px 8px;
    border-radius: 4px;
    background: rgba(15, 31, 39, .78);
    color: #fff;
    font-size: 12px;
    line-height: 1.2;
    pointer-events: none;
}

.attachment-inline-pdf {
    display: block;
    width: 100%;
    height: min(66vh, 680px);
    min-height: 420px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
}

.attachment-inline-video {
    display: block;
    width: 100%;
    max-height: min(66vh, 720px);
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #101820;
}

.attachment-preview-file .attachment-preview-head {
    margin-bottom: 0;
}

.form-grid,
.filter-bar,
.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.dashboard-month-shortcuts {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.dashboard-month-summary {
    display: grid;
    gap: 3px;
    margin-right: auto;
}

.dashboard-month-summary strong {
    color: var(--text);
    font-size: 13px;
}

.dashboard-month-summary span {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-month-links,
.dashboard-month-picker {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.dashboard-month-links .button,
.dashboard-month-picker button {
    min-height: 38px;
    white-space: nowrap;
}

.dashboard-month-links .button.is-active {
    border-color: #8fb5df;
    background: #dcecff;
    color: #163f6d;
}

.dashboard-month-picker label {
    min-width: 168px;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
    gap: 18px;
}

.chart-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #cbd6e2;
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 400;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(37, 99, 235, 0.18);
    border-color: var(--blue);
}

input:disabled {
    background: #f1f5f9;
    color: #475569;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    flex: 0 0 18px;
    width: 18px;
    min-height: 18px;
    height: 18px;
    margin: 1px 0 0;
    padding: 0;
}

.percent-input {
    position: relative;
    display: block;
}

.percent-input input {
    padding-right: 32px;
}

.percent-input b {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.input-with-suffix {
    position: relative;
    display: block;
}

.input-with-suffix input {
    padding-right: 58px;
}

.input-with-suffix b {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 12px;
}

.quantity-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(72px, 0.34fr);
    gap: 8px;
}

.quantity-input-row input {
    min-width: 0;
}

.quantity-input-row input[type="text"] {
    text-align: center;
}

.check-row {
    display: inline-flex;
    align-items: center;
    grid-template-columns: auto auto;
    gap: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
}

.check-row input {
    width: auto;
    min-height: 0;
}

/* Binary controls must never inherit the full-width text-field geometry. */
input[type="checkbox"],
input[type="radio"] {
    box-sizing: border-box;
    display: inline-block;
    flex: 0 0 18px;
    width: 18px;
    min-width: 18px;
    max-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
    border-radius: 3px;
    background: #ffffff;
    box-shadow: none;
    vertical-align: middle;
    accent-color: var(--accent);
}

input[type="radio"] {
    border-radius: 50%;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.product-trace-table {
    min-width: 1200px;
}

.rework-items-table {
    min-width: 1050px;
}

.rework-loss-table {
    min-width: 820px;
}

.rework-list-table {
    min-width: 1380px;
}

.monthly-hours-year-panel {
    padding: 12px 16px;
}

.monthly-hours-year-filter {
    align-items: end;
}

.monthly-hours-editor-panel {
    padding: 0;
    overflow: hidden;
}

.monthly-hours-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.monthly-hours-editor-head h2 {
    margin-bottom: 3px;
}

.monthly-hours-editor-head p {
    margin-bottom: 0;
    font-size: 12px;
}

.monthly-hours-editor-head button {
    flex: 0 0 auto;
}

.monthly-hours-table {
    min-width: 720px;
    table-layout: fixed;
}

.monthly-hours-table th:nth-child(1) { width: 16%; }
.monthly-hours-table th:nth-child(2) { width: 32%; }
.monthly-hours-table th:nth-child(3) { width: 22%; }
.monthly-hours-table th:nth-child(4) { width: 30%; }

.monthly-hours-table td:first-child strong,
.monthly-hours-table td:first-child small {
    display: block;
}

.monthly-hours-table td:first-child small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.monthly-hours-table tr.has-value {
    background: #f7faf9;
}

.monthly-hours-input {
    display: flex;
    max-width: 240px;
    align-items: center;
    gap: 8px;
}

.monthly-hours-input input {
    min-width: 0;
    width: 100%;
}

.monthly-hours-input span {
    color: var(--muted);
    font-weight: 700;
}

.department-tree-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    max-width: 900px;
}

.department-option {
    position: relative;
    margin-left: calc((var(--department-depth) - 1) * 24px);
    padding: 9px 12px;
    border: 1px solid var(--line);
    background: #fff;
}

.department-option.level-1 {
    margin-top: 8px;
    font-weight: 700;
    background: #f4f7fb;
}

.department-option:not(.level-1)::before {
    content: '';
    position: absolute;
    left: -13px;
    top: 50%;
    width: 10px;
    border-top: 1px solid #aebdd0;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.department-tree-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 230px;
    padding-left: calc(var(--tree-depth, 0) * 24px);
}

.department-tree-cell input {
    min-width: 170px;
}

.department-tree-connector {
    width: 15px;
    height: 18px;
    flex: 0 0 15px;
    border-left: 1px solid #9fb2c8;
    border-bottom: 1px solid #9fb2c8;
}

.department-tree-cell.tree-root .department-tree-connector {
    visibility: hidden;
}

.data-table th,
.data-table td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.data-table th.sortable-column {
    padding: 0;
}

.sort-link {
    display: flex;
    min-height: 38px;
    padding: 11px 10px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}

.sort-link:hover,
.sortable-column.is-sorted .sort-link {
    color: var(--primary);
    background: #eef5f5;
}

.sort-indicator {
    color: #8b9aa2;
    font-size: 10px;
    line-height: 1;
}

.button.warning-button {
    border-color: #d59a3a;
    background: #fff7e6;
    color: #8a5a12;
}

.button.warning-button:hover {
    background: #ffefcc;
}

.sortable-column.is-sorted .sort-indicator {
    color: var(--primary);
}

.client-sortable-column {
    cursor: pointer;
    user-select: none;
}

.client-sortable-column .sort-indicator {
    margin-left: 7px;
}

.client-sortable-column:hover,
.client-sortable-column[aria-sort="ascending"],
.client-sortable-column[aria-sort="descending"] {
    color: var(--primary);
    background: #eef5f5;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:not(.row-warning):not(.row-danger):not(.row-marked):hover td {
    background: #f4f8f9;
}

.row-warning td {
    background: #fff9eb;
}

.row-danger td {
    background: #fff1f2;
}

.row-marked td {
    background: #fff4c7;
}

.empty-cell,
.empty-state {
    text-align: center;
}

.empty-state {
    padding: 36px 20px;
}

.org-chart {
    width: 100%;
    min-width: 0;
    padding: 12px 0 4px;
}

.org-tree-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 13px;
}

.org-chart-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px) minmax(280px, 1fr);
    align-items: stretch;
    gap: 24px;
    width: 100%;
    margin: 0 auto;
}

.org-chart-head > .root-node {
    grid-column: 2;
}

.org-rep-side {
    position: relative;
    grid-column: 3;
    display: flex;
    width: min(100%, 500px);
    min-width: 0;
    align-items: center;
    gap: 10px;
    justify-self: start;
}

.org-rep-side::before {
    position: absolute;
    right: 100%;
    top: 50%;
    width: 24px;
    border-top: 1px dashed #7da4d2;
    content: "";
}

.org-rep-caption {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.org-node {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 92px;
    box-sizing: border-box;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    text-align: left;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    overflow-wrap: anywhere;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.org-node:hover {
    border-color: #68a4b2;
    box-shadow: 0 12px 28px rgba(25, 83, 96, .12);
    transform: translateY(-1px);
}

.org-node.root-node {
    border-color: #93c5fd;
    background: #eff6ff;
    text-align: center;
}

.org-node span,
.org-node em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.org-tree-root-connector {
    width: 2px;
    height: 24px;
    margin: 0 auto;
    background: var(--line);
}

.org-tree-primary {
    min-width: 0;
}

.org-rep {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px dashed #93c5fd;
    border-radius: 8px;
    background: #f8fbff;
}

.org-rep .inline-form {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.org-rep input {
    width: 100%;
    min-width: 0;
}

.org-rep button {
    white-space: nowrap;
}

.org-children {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
    align-items: start;
    gap: 14px;
    width: 100%;
    min-width: 0;
}

.org-branch {
    min-width: 0;
    padding: 10px;
    border: 1px solid #dbe6e9;
    border-radius: 8px;
    background: #f8fbfb;
}

.org-tree-branch-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
}

.org-branch.is-leaf .org-tree-branch-head {
    grid-template-columns: minmax(0, 1fr);
}

.org-tree-toggle {
    display: inline-flex;
    min-width: 48px;
    padding: 8px 7px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 1px solid #b8cdd2;
    border-radius: 6px;
    background: #fff;
    color: #285f6c;
}

.org-tree-toggle:hover {
    border-color: #5f97a4;
    background: #eef7f8;
}

.org-tree-toggle-icon {
    font-size: 18px;
    line-height: 1;
}

.org-tree-toggle-text {
    font-size: 11px;
    white-space: nowrap;
}

.org-tree-descendants {
    min-width: 0;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dbe6e9;
}

.org-tree-descendants[hidden] {
    display: none;
}

.org-tree-descendants .org-children {
    grid-template-columns: 1fr;
    gap: 10px;
}

.org-tree-descendants .org-branch {
    padding: 8px;
    background: #fff;
}

@media (max-width: 760px) {
    .org-tree-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .org-chart-head {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .org-chart-head > .root-node,
    .org-rep-side {
        grid-column: 1;
    }

    .org-rep-side::before {
        display: none;
    }

    .org-rep-side {
        align-items: flex-start;
        flex-direction: column;
    }

    .org-children {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .org-rep {
        grid-template-columns: 1fr;
    }

    .org-rep .inline-form {
        grid-template-columns: 1fr;
    }

    .org-rep button {
        width: 100%;
    }

    .org-tree-branch-head {
        grid-template-columns: minmax(0, 1fr) 48px;
    }
}

.trend-panel {
    overflow: hidden;
}

.trend-scroll {
    width: 100%;
    overflow: hidden;
    padding-bottom: 4px;
}

.trend-chart {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
}

.trend-grid-line {
    stroke: #dbe4ef;
    stroke-width: 1;
}

.trend-line {
    fill: none;
    stroke: #2563eb;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rate-trend-line {
    fill: none;
    stroke: #15803d;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rate-trend-point {
    fill: #ffffff;
    stroke: #15803d;
    stroke-width: 3;
}

.distribution-visual {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    margin: 16px 0 20px;
}

.pie-chart {
    position: relative;
    width: 180px;
    height: 180px;
    border-radius: 50%;
}

.pie-chart::after {
    content: '';
    position: absolute;
    inset: 38px;
    border-radius: 50%;
    background: #ffffff;
}

.pie-chart > span {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pie-chart strong {
    font-size: 26px;
}

.pie-chart small {
    color: var(--muted);
}

.chart-legend {
    display: grid;
    gap: 8px;
}

.chart-legend > div {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.chart-legend i {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.chart-legend span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.chart-legend strong {
    font-size: 12px;
}

.combo-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 10px;
}

.combo-legend > div {
    display: flex;
}

.responsibility-legend > div {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    min-width: 120px;
}

.responsibility-legend strong {
    color: var(--text);
    font-size: 11px;
}

.combo-legend .line-key {
    width: 18px;
    height: 3px;
    border-radius: 0;
    background: #172033;
}

.combo-bar-segment {
    opacity: 0.9;
}

.combo-rate-line {
    fill: none;
    stroke: #172033;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.combo-rate-point {
    fill: #ffffff;
    stroke: #172033;
    stroke-width: 3;
}

.combo-rate-label {
    fill: #172033;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
}

.combo-legend .hours-line-key {
    width: 18px;
    height: 3px;
    border-radius: 0;
    background: #15803d;
}

.rework-hours-line,
.rework-rate-line {
    fill: none;
    stroke: #15803d;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rework-hours-point,
.rework-rate-point {
    fill: #ffffff;
    stroke: #15803d;
    stroke-width: 3;
}

.trend-point {
    fill: #ffffff;
    stroke: #2563eb;
    stroke-width: 3;
}

.trend-axis-label,
.trend-month-label,
.trend-value-label {
    fill: #64748b;
    font-family: inherit;
    font-size: 11px;
}

.trend-value-label {
    fill: #1e3a5f;
    font-weight: 700;
}

.module-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.module-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--muted);
    font-weight: 700;
}

.module-tabs a.active {
    border-color: #93c5fd;
    background: var(--blue-soft);
    color: #1e40af;
}

.module-chip {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 4px;
    background: #eef4fb;
    color: #1e3a5f;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.qa-filter-bar {
    margin-top: 16px;
}

.muted {
    color: var(--muted);
}

.flash {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.flash-success {
    color: var(--green);
    background: var(--green-soft);
    border-color: #b7e7c7;
}

.flash-error {
    color: var(--red);
    background: var(--red-soft);
    border-color: #fecaca;
}

.flash-warning {
    color: #92400e;
    background: #fef3c7;
    border-color: #fde68a;
}

.flash-info {
    color: #155e75;
    background: #ecfeff;
    border-color: #a5f3fc;
}

.qms-runtime-notice {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.qms-runtime-notice strong {
    flex: 0 0 auto;
}

@media (max-width: 720px) {
    .qms-runtime-notice {
        display: grid;
        gap: 4px;
    }
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.timeline span {
    color: var(--muted);
}

.pagination {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.pagination a {
    display: inline-flex;
    min-width: 34px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
}

.pagination a.active {
    background: var(--blue);
    color: #ffffff;
    border-color: var(--blue);
}

.qms-pagination {
    align-items: center;
}

.qms-pagination .pagination-summary {
    margin-right: 4px;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.qms-pagination .pagination-control,
.qms-pagination .pagination-page {
    padding: 0 10px;
    white-space: nowrap;
}

.qms-pagination .pagination-page {
    padding: 0 7px;
}

.qms-pagination .is-disabled {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: #9aa8ae;
    background: #f5f7f8;
    cursor: not-allowed;
    white-space: nowrap;
}

.login-body,
.setup-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.login-card,
.setup-card {
    width: min(460px, 100%);
    padding: 28px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.10);
}

.setup-card {
    width: min(760px, 100%);
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 22px;
    text-align: center;
}

.login-brand .brand-mark {
    width: 52px;
    height: 52px;
    background: var(--sidebar);
    color: #ffffff;
}

.login-logo {
    display: block;
    width: auto;
    max-width: min(160px, 70%);
    height: auto;
    max-height: 96px;
    object-fit: contain;
}

.login-brand-copy {
    display: grid;
    justify-items: center;
    width: 100%;
}

.login-brand h1 {
    margin-bottom: 4px;
    text-align: center;
}

.login-brand p {
    margin-bottom: 0;
    text-align: center;
}

.init-list {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.init-item {
    padding: 10px 12px;
    border-radius: 6px;
}

.init-ok {
    color: var(--green);
    background: var(--green-soft);
}

.init-fail {
    color: var(--red);
    background: var(--red-soft);
}

.setup-actions {
    display: flex;
    justify-content: flex-end;
}

.notice-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    width: calc(100% - 48px);
    max-width: 1872px;
    margin: 16px auto 0;
    padding: 12px 14px;
    border: 1px solid #bfd5da;
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    background: #f3f8f9;
    color: var(--text);
}

.notice-banner-with-image {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.notice-banner img {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
}

.notice-content {
    min-width: 0;
}

.notice-detail {
    min-width: 0;
}

.notice-content > strong {
    display: block;
    color: #173d48;
    font-size: 13px;
    line-height: 1.4;
}

.notice-banner p {
    margin: 4px 0 0;
    color: var(--muted);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.notice-detail > a {
    display: inline-flex;
    margin-top: 6px;
}

.notice-close {
    justify-self: end;
    align-self: start;
    width: auto;
    min-height: 32px;
    padding: 6px 10px;
    border: 0;
    background: transparent;
    color: #315e68;
    white-space: nowrap;
    box-shadow: none;
}

.notice-close:hover {
    background: #e2eef0;
    color: #173d48;
}

.notice-banner.is-collapsed {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding-top: 8px;
    padding-bottom: 8px;
}

.notice-banner.is-collapsed img {
    display: none;
}

.notice-banner.is-collapsed .notice-content {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.notice-banner.is-collapsed .notice-content > strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-banner.is-collapsed .notice-detail {
    display: block;
    overflow: hidden;
}

.notice-banner.is-collapsed .notice-detail p {
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-banner.is-collapsed .notice-detail p br,
.notice-banner.is-collapsed .notice-detail > a {
    display: none;
}

.notice-banner.is-collapsed .notice-close {
    min-height: 28px;
    padding: 4px 8px;
}

.logo-preview {
    display: grid;
    gap: 8px;
}

.logo-preview img {
    max-width: 180px;
    max-height: 120px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    padding: 8px;
}

.result-list {
    margin: 0 0 18px;
    padding-left: 20px;
}

.mark-button {
    font-size: 20px;
    line-height: 1;
    color: #a16207;
}

.record-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 2px;
    border-radius: 4px;
    background: #e5e7eb;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.loss-flag { color: #9a6700; }
.deviation-flag { color: #b42318; }
.workflow-flag { color: #176b7b; background: #e7f3f5; }

.workflow-progress-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 190px;
    color: inherit;
    text-decoration: none;
    vertical-align: middle;
}

.workflow-progress-link:not(.is-readonly):hover {
    color: var(--primary);
}

.workflow-progress-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.workflow-progress-stack {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.workflow-progress-copy .status-chip {
    width: fit-content;
}

.workflow-progress-copy small {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.workflow-source-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.workflow-source-links > a {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 10px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #cadbe0;
    border-left: 3px solid #2f7f91;
    border-radius: 5px;
    background: #f7fafb;
    color: var(--text);
    text-decoration: none;
}

.workflow-source-links > a span {
    color: var(--text-soft);
    text-align: right;
}

.workflow-source-links > a small {
    grid-column: 1 / -1;
    overflow-wrap: anywhere;
    color: var(--text-soft);
}

.bar-cell {
    display: inline-block;
    width: 120px;
    height: 8px;
    margin-right: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
    vertical-align: middle;
}

.bar-cell span {
    display: block;
    height: 100%;
    background: #22a06b;
}

.major-badge {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 800;
}

.temp-badge {
    background: var(--red-soft);
    color: var(--red);
}

.change-progress {
    display: grid;
    grid-template-columns: repeat(5, minmax(80px, 1fr)) auto;
    gap: 10px;
    align-items: center;
    margin: 16px 0 20px;
}

.change-progress div {
    position: relative;
    display: grid;
    min-height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafc;
    color: var(--muted);
    font-weight: 800;
}

.change-progress div.done {
    border-color: #b7e7c7;
    background: var(--green-soft);
    color: var(--green);
}

.change-progress div.active {
    border-color: #bfdbfe;
    background: var(--blue-soft);
    color: #1e40af;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.detail-grid div {
    min-height: 58px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafc;
}

.detail-grid b,
.detail-grid span {
    display: block;
}

.detail-grid b {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.action-edit-table textarea,
.action-edit-table input,
.action-edit-table select {
    min-width: 150px;
}

.action-edit-table .input-required-missing {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
    background: #fff7f7;
}

.paste-modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.42);
}

.paste-modal[hidden] {
    display: none;
}

.paste-dialog {
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 20px;
    border-radius: 8px;
    background: #ffffff;
}

.paste-preview {
    margin-top: 12px;
    max-height: 240px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.paste-preview table {
    width: 100%;
    border-collapse: collapse;
}

.paste-preview td {
    padding: 6px 8px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

@media (max-width: 1100px) {
    .app-shell,
    .two-column {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 30;
        width: min(82vw, 280px);
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.18s ease;
        box-shadow: 12px 0 30px rgba(15, 23, 42, 0.24);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: inline-flex;
        position: fixed;
        left: 0;
        top: 50%;
        z-index: 35;
        width: 44px;
        border-radius: 0 999px 999px 0;
        transform: translateY(-50%);
        box-shadow: 8px 0 18px rgba(15, 23, 42, 0.18);
    }

    body.sidebar-open .sidebar-toggle {
        left: min(82vw, 280px);
    }

    .metric-grid,
    .form-grid,
    .filter-bar,
    .filter-grid,
    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .change-progress {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .topbar,
    .module-head {
        flex-direction: column;
        align-items: stretch;
    }

    .user-menu {
        flex-wrap: wrap;
        white-space: normal;
    }

    .metric-grid,
    .form-grid,
    .filter-bar,
    .filter-grid,
    .detail-grid,
    .change-progress,
    .attachment-upload-grid,
    .attachment-groups,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .attachment-preview-head {
        align-items: center;
    }

    .attachment-inline-image {
        min-height: 140px;
        max-height: 58vh;
    }

    .attachment-inline-image img {
        max-height: 58vh;
    }

    .attachment-inline-pdf {
        height: 58vh;
        min-height: 360px;
    }

    .dashboard-month-shortcuts {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .dashboard-month-summary {
        width: 100%;
    }

    .dashboard-month-picker {
        flex: 1 1 240px;
    }

    .dashboard-month-picker label {
        flex: 1 1 auto;
        min-width: 0;
    }

    .content {
        padding: 18px;
    }

    .notice-banner {
        grid-template-columns: minmax(0, 1fr) auto;
        width: calc(100% - 36px);
        margin: 14px auto 0;
    }

    .notice-banner img {
        grid-column: 1 / -1;
        width: 100%;
        height: auto;
        max-height: 160px;
    }

    .distribution-visual {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .distribution-visual .chart-legend {
        width: 100%;
    }
}

.source-workflow-state-link {
    display: inline-flex;
    width: fit-content;
    margin-top: 6px;
    text-decoration: none;
}

.source-workflow-state {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    width: fit-content;
    padding: 2px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.source-workflow-state.is-processing {
    color: #a72d2d;
    background: #fff0f0;
    border-color: #efb9b9;
}

.source-workflow-state.is-approved {
    color: #17633e;
    background: #eaf7ef;
    border-color: #a9d7bb;
}

.source-workflow-state.is-rejected {
    color: #81580c;
    background: #fff8e5;
    border-color: #ead18e;
}

.mobile-account-nav {
    display: none;
}

.employee-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: #a7c7ee;
    text-underline-offset: 3px;
}

.read-only-field {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid #cbd5da;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
}

.person-read-only {
    min-width: 0;
    overflow-wrap: anywhere;
}

.person-read-only .employee-link {
    color: #276f83;
}

.permission-admin-layout {
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.65fr);
    align-items: start;
}

.compact-form-panel {
    position: sticky;
    top: 118px;
}

.permission-workspace {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.permission-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 1fr)) auto;
    align-items: center;
    gap: 18px;
    border-left: 4px solid #2d7f91;
}

.permission-summary > div {
    display: grid;
    gap: 2px;
}

.permission-summary span,
.permission-option small {
    color: var(--muted);
    font-size: 12px;
}

.permission-summary strong {
    font-size: 15px;
}

.permission-matrix th:not(:first-child),
.permission-matrix td:not(:first-child) {
    width: 150px;
    text-align: center;
}

.permission-matrix .check-row {
    justify-content: center;
}

.permission-header-tools {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 5px;
    white-space: nowrap;
}

.permission-header-tools button {
    width: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #2d7186;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    box-shadow: none;
}

.permission-header-tools button + button {
    padding-left: 7px;
    border-left: 1px solid #bfd0d8;
}

.permission-header-tools button:hover,
.permission-header-tools button:focus-visible {
    background: transparent;
    color: #174f62;
    text-decoration: underline;
    transform: none;
}

.permission-section-head {
    align-items: center;
}

.permission-section-tools {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.permission-section-tools .button {
    min-height: 34px;
    padding: 7px 12px;
}

.bulk-permission-scope {
    border-left: 4px solid #2d7f91;
}

.bulk-permission-scope-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.15fr) minmax(240px, 1fr) minmax(220px, 0.85fr);
    align-items: stretch;
    gap: 12px;
}

.bulk-permission-scope-grid > label {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.bulk-permission-scope-grid select {
    width: 100%;
}

.permission-scope-toggle,
.bulk-target-summary {
    min-height: 62px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfdff;
}

.permission-scope-toggle {
    grid-template-columns: 18px minmax(0, 1fr) !important;
    align-items: start;
    cursor: pointer;
}

.permission-scope-toggle input {
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 1px 0 0;
}

.permission-scope-toggle span {
    display: grid;
    gap: 3px;
}

.permission-scope-toggle strong {
    color: var(--text);
    font-size: 13px;
}

.permission-scope-toggle small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.bulk-target-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #365463;
    font-size: 13px;
    text-align: center;
}

.bulk-target-summary strong {
    margin: 0 4px;
    color: #14576b;
    font-size: 22px;
}

.bulk-target-preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.bulk-target-preview span,
.bulk-target-preview em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.bulk-target-preview b {
    padding: 4px 8px;
    border: 1px solid #cad8df;
    border-radius: 4px;
    background: #f4f8fa;
    color: #294956;
    font-size: 12px;
}

.permission-operation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px;
}

.permission-operation-grid label {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    min-height: 70px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfdff;
    cursor: pointer;
}

.permission-operation-grid label.is-selected {
    border-color: #66a2b4;
    background: #edf7f9;
    box-shadow: inset 3px 0 0 #2d7f91;
}

.permission-operation-grid input {
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 1px 0 0;
}

.permission-operation-grid span {
    display: grid;
    gap: 4px;
}

.permission-operation-grid strong {
    color: var(--text);
    font-size: 14px;
}

.permission-operation-grid small {
    color: var(--muted);
    font-size: 12px;
}

.bulk-permission-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.bulk-permission-submit span {
    color: var(--muted);
    font-size: 12px;
}

.bulk-permission-submit button {
    flex: 0 0 auto;
}

.permission-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.permission-option {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    min-height: 78px;
    align-items: start;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfdff;
    cursor: pointer;
}

.permission-option:has(input:checked) {
    border-color: #82aee3;
    background: #f2f7ff;
}

.permission-option input[type="checkbox"] {
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 1px 0 0;
    padding: 0;
}

.permission-option > span {
    display: grid;
    min-width: 0;
    gap: 3px;
    align-content: start;
}

.permission-option > span strong,
.permission-option > span small {
    display: block;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: normal;
}

.permission-option > span strong {
    color: var(--text);
    font-size: 14px;
}

.permission-option > span small {
    font-weight: 500;
}

.permission-option.is-disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.role-badge-light {
    border-color: #cad6e4;
    background: #f2f6fa;
    color: #3d536b;
}

.profile-identity-band {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-left: 4px solid #2d7f91;
    border-radius: 6px;
    background: #ffffff;
}

.profile-avatar {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 6px;
    background: #15334d;
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
}

.profile-identity-copy > span,
.profile-account-state span {
    color: #2d7f91;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.profile-identity-copy h2 {
    margin: 1px 0 2px;
    font-size: 22px;
}

.profile-identity-copy p {
    margin: 0;
}

.profile-account-state {
    display: grid;
    min-width: 112px;
    gap: 2px;
    padding-left: 18px;
    border-left: 1px solid var(--line);
}

.profile-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.profile-kpi-grid > div,
.profile-kpi-grid > a {
    display: grid;
    min-height: 108px;
    align-content: center;
    gap: 2px;
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-top: 3px solid #6b93a3;
    border-radius: 6px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
}

.profile-kpi-grid > div.is-alert,
.profile-kpi-grid > a.is-alert {
    border-top-color: #bf6b38;
    background: #fffaf5;
}

.notification-trigger {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    gap: 6px;
    padding: 0 9px;
    border: 1px solid #40535c;
    border-radius: 4px;
    color: #dbe6e9;
    white-space: nowrap;
}

.notification-trigger:hover,
.notification-trigger.has-unread {
    border-color: #5aa8b8;
    color: #ffffff;
}

.notification-trigger strong {
    display: inline-grid;
    min-width: 20px;
    min-height: 20px;
    place-items: center;
    padding: 0 5px;
    border-radius: 10px;
    background: #c24d3d;
    color: #ffffff;
    font-size: 11px;
    line-height: 1;
}

.notification-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.notification-summary-grid > a {
    display: grid;
    min-height: 94px;
    align-content: center;
    gap: 3px;
    padding: 15px 18px;
    border: 1px solid var(--line);
    border-top: 3px solid #3f8999;
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    text-decoration: none;
}

.notification-summary-grid span {
    color: var(--muted);
    font-size: 12px;
}

.notification-summary-grid strong {
    color: #17384a;
    font-size: 28px;
}

.notification-filter-panel .filter-bar {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.notification-inbox .module-head form {
    margin: 0;
}

.batch-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

.batch-toolbar > label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    min-height: 34px;
    margin: 0;
    padding: 0 4px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.batch-toolbar > button,
.batch-toolbar > .button {
    flex: 0 0 auto;
    width: auto;
}

.notification-list {
    display: grid;
    gap: 8px;
}

.notification-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-left: 4px solid #7994a0;
    border-radius: 5px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
}

.notification-row.is-unread {
    background: #f2f9fb;
    border-left-color: #247f92;
}

.notification-row.level-due_soon {
    border-left-color: #c88b2d;
}

.notification-row.level-overdue,
.notification-row.level-reminder {
    border-left-color: #bd4f43;
}

.notification-row-body {
    min-width: 0;
}

.notification-row-title,
.notification-meta {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.notification-row-title strong,
.notification-row p {
    overflow-wrap: anywhere;
}

.notification-row-title i {
    color: #247f92;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.notification-row p {
    margin: 6px 0;
    color: #314952;
}

.notification-meta {
    color: var(--muted);
    font-size: 11px;
}

.notification-level-chip {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 0 7px;
    border-radius: 4px;
    background: #e8f1f4;
    color: #315f6a;
    font-size: 11px;
    white-space: nowrap;
}

.notification-level-chip.level-due_soon {
    background: #fff2d9;
    color: #8a5b15;
}

.notification-level-chip.level-overdue,
.notification-level-chip.level-reminder {
    background: #fbe8e5;
    color: #9e382d;
}

.notification-row-action {
    white-space: nowrap;
}

.compact-notification-list .notification-row {
    grid-template-columns: minmax(0, 1fr);
}

.notification-rule-table th,
.notification-rule-table td {
    vertical-align: middle;
}

.notification-rule-table select {
    min-width: 112px;
}

.notification-rule-table input[type="number"] {
    width: 82px;
}

.notification-trigger-timing {
    min-width: 210px;
}

.notification-trigger-timing label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.notification-trigger-timing small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    line-height: 1.45;
}

.switch-control {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.sticky-save-bar {
    position: sticky;
    bottom: 12px;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #b8cad1;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(25, 49, 59, 0.12);
}

.notification-failure-panel > summary {
    cursor: pointer;
    font-weight: 800;
}

.notification-history-table td:nth-child(5) {
    min-width: 250px;
    max-width: 420px;
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .notification-summary-grid {
        grid-template-columns: 1fr;
    }

    .notification-row {
        grid-template-columns: 24px minmax(0, 1fr);
    }

    .notification-row-action {
        grid-column: 2;
        justify-self: start;
    }

    .sticky-save-bar {
        bottom: 6px;
        align-items: stretch;
        flex-direction: column;
    }
}

.profile-kpi-grid span,
.profile-kpi-grid small {
    color: var(--muted);
    font-size: 12px;
}

.profile-kpi-grid strong {
    color: #14324a;
    font-size: 28px;
    line-height: 1.05;
}

.profile-submission-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.5fr);
    gap: 14px;
}

.profile-distribution-panel > p {
    margin-top: -8px;
}

.profile-distribution-row {
    display: grid;
    gap: 5px;
    margin-top: 12px;
}

.profile-distribution-row > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.distribution-track {
    height: 7px;
    overflow: hidden;
    border-radius: 3px;
    background: #e9eff5;
}

.distribution-track i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: #2d7f91;
}

.profile-period-summary dl {
    display: grid;
    gap: 0;
    margin: 0;
}

.profile-period-summary dl > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.profile-period-summary dt {
    color: var(--muted);
}

.profile-period-summary dd {
    margin: 0;
    color: #14324a;
    font-size: 22px;
    font-weight: 800;
}

.profile-submissions {
    margin-top: 14px;
}

@media (max-width: 1100px) {
    .permission-admin-layout,
    .profile-submission-layout {
        grid-template-columns: 1fr;
    }

    .compact-form-panel {
        position: static;
    }

    .permission-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bulk-permission-scope-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bulk-target-summary {
        grid-column: 1 / -1;
    }

    .profile-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .mobile-account-nav {
        display: grid;
        gap: 0;
        margin-top: 12px;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
    }

    .mobile-account-nav > div {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 10px 10px;
        color: #ffffff;
    }

    .mobile-account-nav > div span {
        color: #99abb3;
        font-size: 12px;
    }

    .command-nav-row .mobile-account-nav > a {
        display: block;
        min-height: 40px;
        padding: 9px 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        color: #c6d1d5;
    }

    .command-nav-row .mobile-account-nav > a.active {
        background: #29404a;
        color: #ffffff;
    }

    .command-nav-row .mobile-account-nav > a.mobile-logout {
        margin-top: 6px;
        border: 1px solid #78534d;
        border-radius: 4px;
        background: #392b2a;
        color: #ffd8d1;
        text-align: center;
    }

    .permission-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .profile-identity-band {
        grid-template-columns: 46px minmax(0, 1fr);
        padding: 14px;
    }

    .profile-avatar {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    .profile-account-state {
        grid-column: 1 / -1;
        grid-template-columns: 1fr auto;
        padding: 10px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .profile-kpi-grid,
    .permission-card-grid,
    .permission-summary {
        grid-template-columns: 1fr;
    }

    .profile-kpi-grid > div,
    .profile-kpi-grid > a {
        min-height: 92px;
    }

    .permission-summary button {
        width: 100%;
    }

    .permission-section-head,
    .bulk-permission-submit {
        align-items: stretch;
        flex-direction: column;
    }

    .permission-section-tools {
        width: 100%;
    }

    .permission-section-tools .button,
    .bulk-permission-submit button {
        flex: 1 1 0;
        width: 100%;
    }

    .bulk-permission-scope-grid,
    .permission-operation-grid {
        grid-template-columns: 1fr;
    }

    .bulk-target-summary {
        grid-column: auto;
    }
}

/* Home dashboard domains */
.dashboard-domain-section {
    margin: 0 0 24px;
    padding: 0 0 24px;
    border-bottom: 1px solid var(--line);
}

.dashboard-domain-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.dashboard-domain-head > div {
    min-width: 0;
}

.dashboard-domain-head span {
    display: block;
    margin-bottom: 4px;
    color: #6f8088;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
}

.dashboard-domain-head h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
}

.dashboard-domain-head p {
    max-width: 760px;
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.dashboard-domain-head.compact {
    margin-bottom: 9px;
}

.dashboard-domain-head.compact h2 {
    font-size: 17px;
}

.dashboard-domain-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.dashboard-domain-metrics.three-up {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-domain-metrics.four-up {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-domain-metric {
    display: block;
    min-width: 0;
    min-height: 116px;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-top: 3px solid #3f8ea8;
    border-radius: 4px;
    background: #ffffff;
    color: var(--text);
}

a.dashboard-domain-metric:hover {
    border-color: #9eb5bf;
    background: #f9fbfc;
    color: var(--text);
}

.dashboard-domain-metric.is-alert {
    border-top-color: #c7833c;
}

.dashboard-domain-metric.is-positive {
    border-top-color: #4ba083;
}

.dashboard-domain-metric > span,
.dashboard-domain-metric > small,
.dashboard-domain-metric > em {
    display: block;
}

.dashboard-domain-metric > span {
    color: #53666f;
    font-size: 12px;
    font-weight: 700;
}

.dashboard-domain-metric > strong {
    display: block;
    margin: 8px 0 1px;
    font-size: 28px;
    line-height: 1;
}

.dashboard-domain-metric > small {
    margin-top: 5px;
    color: #8b989e;
    font-size: 10px;
}

.dashboard-domain-metric > em {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #edf1f2;
    color: #41545d;
    font-size: 11px;
    font-style: normal;
}

.product-category-metric {
    min-height: 124px;
}

.dashboard-visual-grid {
    display: grid;
    gap: 12px;
    align-items: stretch;
}

.dashboard-visual-grid.material-grid {
    grid-template-columns: minmax(0, 1.75fr) minmax(340px, 0.75fr);
}

.dashboard-visual-grid.rework-grid {
    grid-template-columns: 1fr;
}

.dashboard-chart-panel {
    min-width: 0;
    margin: 0;
    overflow: hidden;
}

.dashboard-chart-full {
    margin-top: 12px;
}

.dashboard-chart-panel .module-head {
    margin-bottom: 8px;
}

.dashboard-chart-panel .module-head h2 {
    margin-bottom: 3px;
}

.dashboard-chart-panel .module-head p {
    font-size: 11px;
}

.dashboard-svg-wrap {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.dashboard-chart-svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.dashboard-chart-legend {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.dashboard-multi-rate-line {
    stroke-width: 3;
    stroke-linecap: round;
}

.dashboard-multi-rate-point {
    stroke: #ffffff;
    stroke-width: 2;
}

.dashboard-distribution {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px;
    margin: 12px 0 6px;
}

.dashboard-distribution .pie-chart {
    width: 146px;
    height: 146px;
}

.dashboard-distribution .pie-chart::after {
    inset: 31px;
}

.dashboard-distribution .pie-chart strong {
    font-size: 22px;
}

.dashboard-data-note {
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px solid #edf1f2;
    color: #7a6760;
    font-size: 10px;
}

.dashboard-pie-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.dashboard-pie-pair > div {
    min-width: 0;
}

.dashboard-pie-pair h3 {
    margin: 0 0 4px;
    font-size: 13px;
}

.dashboard-operations-section {
    margin: 0 0 18px;
}

.dashboard-operation-strip {
    margin-bottom: 0;
}

.command-dashboard-grid.no-command-rail {
    grid-template-columns: 1fr;
}

@media (max-width: 1220px) {
    .dashboard-visual-grid.material-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-domain-metrics.four-up {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .dashboard-domain-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .dashboard-domain-metrics.three-up,
    .dashboard-domain-metrics.four-up,
    .product-category-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-pie-pair {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

@media (max-width: 520px) {
    .dashboard-domain-section {
        margin-bottom: 18px;
        padding-bottom: 18px;
    }

    .dashboard-domain-metrics.three-up,
    .dashboard-domain-metrics.four-up,
    .product-category-metrics {
        grid-template-columns: 1fr;
    }

    .dashboard-domain-metric {
        min-height: 104px;
        padding: 13px 14px;
    }

    .dashboard-domain-metric > strong {
        font-size: 24px;
    }

    .dashboard-chart-panel {
        padding: 12px 8px;
    }

    .dashboard-chart-panel .module-head {
        padding: 0 4px;
    }

    .dashboard-chart-legend {
        max-height: 62px;
        overflow-y: auto;
    }

    .dashboard-distribution {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .dashboard-distribution .chart-legend {
        width: 100%;
    }
}

@media (max-width: 800px) {
    .permission-matrix {
        min-width: 760px;
    }

    .permission-matrix th:first-child,
    .permission-matrix td:first-child {
        min-width: 150px;
    }

    .permission-matrix .check-row {
        white-space: nowrap;
    }
}

/* Quality command center redesign */
:root {
    --bg: #f3f5f6;
    --panel: #ffffff;
    --text: #18242c;
    --muted: #6e7d86;
    --line: #d7dee2;
    --blue: #2f7890;
    --blue-dark: #245d70;
    --blue-soft: #e6f2f4;
    --green: #16745a;
    --green-soft: #e4f3ed;
    --yellow: #9a5b0a;
    --yellow-soft: #fff1d5;
    --red: #b93d36;
    --red-soft: #fae8e6;
    --sidebar: #162128;
    --sidebar-soft: #223039;
    --cyan: #64c1cb;
}

body {
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-shell {
    display: block;
    min-height: 100vh;
}

.command-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--sidebar);
    color: #f5f8f9;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.command-topline {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 8px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    padding: 0;
    border: 0;
    color: #ffffff;
}

.brand:hover {
    color: #ffffff;
}

.brand-mark,
.brand-logo {
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    border-radius: 4px;
}

.brand-mark {
    background: var(--cyan);
    color: #102027;
    font-size: 14px;
}

.brand-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
}

.brand-subtitle {
    margin-top: 2px;
    color: #95a6ae;
    font-size: 9px;
    letter-spacing: 0;
}

.command-tools,
.user-menu {
    display: flex;
    align-items: center;
}

.command-tools {
    min-width: 0;
    justify-content: flex-end;
    gap: 12px;
}

.command-search {
    display: flex;
    width: clamp(260px, 30vw, 430px);
}

.command-search input {
    min-height: 33px;
    border-color: #354750;
    border-right: 0;
    border-radius: 4px 0 0 4px;
    background: #1c2a31;
    color: #ffffff;
}

.command-search input::placeholder {
    color: #a9b8bf;
}

.command-search input:focus {
    outline: 1px solid var(--cyan);
    border-color: var(--cyan);
}

.command-search button {
    min-width: 52px;
    min-height: 33px;
    padding: 0 13px;
    border: 1px solid #46606a;
    border-radius: 0 4px 4px 0;
    background: #24363e;
    color: #dce6e9;
    white-space: nowrap;
}

.user-menu {
    gap: 9px;
    color: #e3e9eb;
    white-space: nowrap;
}

.user-menu a {
    color: #b9c7cc;
}

.user-menu a:hover {
    color: #ffffff;
}

.role-badge {
    min-height: 23px;
    border: 1px solid #3b4d55;
    border-radius: 4px;
    background: #202e35;
    color: #d6e3e6;
    font-weight: 600;
}

.command-nav-row {
    min-height: 43px;
    padding: 0 24px;
}

.command-nav-row .nav {
    display: flex;
    align-items: stretch;
    gap: 24px;
    height: 43px;
    padding: 0;
}

.command-nav-row .nav > a,
.command-nav-row .nav-accordion > summary {
    display: flex;
    min-height: 43px;
    align-items: center;
    margin: 0;
    padding: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: #b8c4c9;
    font-size: 12px;
    font-weight: 600;
}

.command-nav-row .nav > a:hover,
.command-nav-row .nav > a.active,
.command-nav-row .nav-accordion:hover > summary,
.command-nav-row .nav-accordion:focus-within > summary {
    border-bottom-color: var(--cyan);
    background: transparent;
    color: #ffffff;
}

.command-nav-row .nav-accordion {
    position: relative;
    margin: 0;
}

.command-nav-row .nav-accordion > summary::after {
    content: "";
}

.command-nav-row .nav-menu {
    display: none;
    position: absolute;
    top: 41px;
    left: -12px;
    z-index: 45;
    width: 220px;
    max-height: min(70vh, 560px);
    overflow-y: auto;
    margin: 0;
    padding: 7px;
    border: 1px solid #cfd8dc;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(16, 30, 38, 0.16);
}

.command-nav-row .nav-accordion:hover > .nav-menu,
.command-nav-row .nav-accordion:focus-within > .nav-menu {
    display: block;
}

.command-nav-row .nav-menu a,
.command-nav-row .nav-group a {
    display: block;
    margin: 0;
    padding: 8px 10px;
    border-radius: 3px;
    color: #33444d;
    font-size: 13px;
}

.command-nav-row .nav-menu a:hover,
.command-nav-row .nav-menu a.active {
    background: #e9f3f5;
    color: #205d6c;
}

.command-nav-row .nav-group-title {
    padding: 7px 10px 4px;
    color: #839099;
    font-size: 11px;
}

.main {
    min-width: 0;
}

.topbar {
    min-height: 82px;
    padding: 17px 24px;
    border-bottom: 1px solid var(--line);
    background: #f7f8f9;
}

.topbar h1 {
    margin-bottom: 3px;
    font-size: 22px;
}

.topbar p {
    color: #70818a;
    font-size: 12px;
}

.topbar-action {
    flex: 0 0 auto;
}

.content {
    width: 100%;
    padding: 18px 24px 40px;
}

.panel,
.metric-card {
    border-color: var(--line);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(19, 35, 44, 0.03);
}

.panel {
    padding: 16px;
}

.metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.metric-card {
    padding: 14px;
}

.metric-card strong {
    margin-top: 6px;
    font-size: 24px;
}

h2 {
    font-size: 16px;
}

.button,
button {
    border-radius: 4px;
}

.button.secondary {
    border-color: #c7d1d6;
    background: #ffffff;
    color: #344750;
}

.command-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #ffffff;
}

.command-kpi {
    display: block;
    min-width: 0;
    padding: 13px 15px 12px;
    border-right: 1px solid var(--line);
    color: var(--text);
}

.command-kpi:last-child {
    border-right: 0;
}

a.command-kpi:hover {
    background: #f7fafb;
    color: var(--text);
}

.command-kpi span,
.command-kpi small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.command-kpi span {
    color: #697a83;
    font-size: 11px;
}

.command-kpi strong {
    display: block;
    margin: 5px 0 2px;
    font-size: 24px;
    line-height: 1.1;
}

.command-kpi strong em {
    margin-left: 2px;
    font-size: 12px;
    font-style: normal;
}

.command-kpi small {
    color: #99a4aa;
    font-size: 10px;
}

.positive-value { color: var(--green); }
.warning-value { color: var(--yellow); }
.danger-value { color: var(--red); }

.command-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.command-main-column,
.command-rail {
    min-width: 0;
}

.command-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: -2px 0 12px;
}

.command-section-head h2 {
    margin: 1px 0 0;
}

.command-section-head > a {
    color: var(--blue);
    font-size: 12px;
}

.section-kicker {
    display: block;
    color: #8a979e;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0;
}

.workload-list {
    display: grid;
    gap: 3px;
}

.workload-list a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    padding: 9px 0;
    border-bottom: 1px solid #edf1f2;
    color: #30424b;
}

.workload-list a:last-child {
    border-bottom: 0;
}

.workload-list strong {
    color: #263840;
}

.workload-list i {
    grid-column: 1 / -1;
    height: 5px;
    overflow: hidden;
    background: #e6ecee;
}

.workload-list i b {
    display: block;
    height: 100%;
    background: #4ba1b4;
}

.workload-list a:nth-child(2) i b { background: #ca7e34; }
.workload-list a:nth-child(3) i b { background: #45a084; }
.workload-list a:nth-child(4) i b { background: #7d73b1; }
.workload-list a:nth-child(5) i b { background: #bd5d5d; }

.priority-list {
    margin: 0 -4px -4px;
}

.priority-list > a {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 54px;
    padding: 7px 4px;
    border-bottom: 1px solid #edf1f2;
    color: #263840;
}

.priority-list > a:last-child {
    border-bottom: 0;
}

.priority-list > a > span:nth-child(2) {
    min-width: 0;
}

.priority-list strong,
.priority-list small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.priority-list strong {
    font-size: 12px;
}

.priority-list small {
    margin-top: 2px;
    color: #87949b;
    font-size: 10px;
}

.priority-list em {
    color: #7b8990;
    font-size: 10px;
    font-style: normal;
}

.priority-index {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 3px;
    background: #e8eef0;
    color: #58707b;
    font-size: 10px;
    font-weight: 800;
}

.priority-index.is-urgent {
    background: var(--red-soft);
    color: var(--red);
}

.compact-empty {
    padding: 22px 8px;
}

.command-main-column > .trend-panel {
    margin-bottom: 16px;
    padding: 16px;
}

.command-main-column > .trend-panel .module-head {
    margin-bottom: 2px;
}

.command-main-column > .trend-panel .module-head h2 {
    margin-bottom: 2px;
}

.command-main-column > .trend-panel .module-head p {
    font-size: 11px;
}

.command-main-column .trend-scroll {
    width: 100%;
    overflow: hidden;
}

.command-main-column .trend-chart {
    display: block;
    width: 100%;
    height: auto;
    min-width: 0;
}

.combo-bar-segment {
    opacity: 0.86;
}

.combo-rate-line {
    stroke: #bb4a42;
}

.event-matrix-panel {
    padding: 0;
    overflow: hidden;
}

.event-matrix-panel .command-section-head {
    align-items: center;
    margin: 0;
    padding: 14px 16px 11px;
    border-bottom: 1px solid var(--line);
}

.command-table th,
.command-table td {
    padding: 9px 11px;
}

.command-table {
    table-layout: fixed;
    min-width: 0;
}

.command-table th:nth-child(1) { width: 88px; }
.command-table th:nth-child(2) { width: 190px; }
.command-table th:nth-child(3) { width: 88px; }
.command-table th:nth-child(4) { width: 210px; }
.command-table th:nth-child(5) { width: 82px; }
.command-table th:nth-child(6) { width: 100px; }
.command-table th:nth-child(7) { width: 82px; }
.command-table th:nth-child(8) { width: 54px; }

.command-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.command-table td strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.command-table td small {
    display: block;
    margin-top: 2px;
    color: #89969c;
    font-size: 10px;
}

.module-chip,
.status-chip {
    min-height: 21px;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 10px;
}

.data-table th {
    background: #f5f7f8;
    color: #6f7f87;
    font-size: 11px;
}

.data-table th,
.data-table td {
    border-bottom-color: #e2e7e9;
}

.form-grid,
.filter-bar,
.filter-grid {
    gap: 10px;
}

input,
select,
textarea {
    min-height: 36px;
    border-color: #cbd5da;
    border-radius: 4px;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(74, 160, 179, 0.16);
    border-color: #4a9db0;
}

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.settings-disclosure {
    padding: 0;
}

.settings-disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px;
    cursor: pointer;
    list-style: none;
}

.settings-disclosure > summary::-webkit-details-marker {
    display: none;
}

.settings-disclosure > summary span {
    display: grid;
    gap: 3px;
}

.settings-disclosure > summary strong {
    color: var(--text);
    font-size: 15px;
}

.settings-disclosure > summary small {
    color: var(--muted);
    font-size: 11px;
}

.settings-disclosure > summary::after {
    content: "展开设置";
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.settings-disclosure[open] > summary {
    border-bottom: 1px solid var(--line);
}

.settings-disclosure[open] > summary::after {
    content: "收起设置";
}

.settings-disclosure-body {
    padding: 18px;
}

.tabs a,
.tab-row a {
    border-radius: 4px;
}

.flash,
.notice-banner {
    border-radius: 4px;
}

@media (max-width: 1100px) {
    .command-dashboard-grid {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .command-search {
        width: min(340px, 31vw);
    }

    .user-name {
        display: none;
    }
}

@media (max-width: 900px) {
    .command-header {
        position: relative;
    }

    .command-topline {
        padding: 10px 14px;
    }

    .command-search,
    .user-menu a,
    .user-menu .role-badge {
        display: none;
    }

    .command-nav-row {
        min-height: 42px;
        padding: 0 14px;
    }

    .sidebar-toggle {
        display: inline-flex;
        position: static;
        width: auto;
        min-height: 32px;
        margin: 5px 0;
        padding: 0 12px;
        border: 1px solid #43555e;
        border-radius: 4px;
        background: #223038;
        color: #ffffff;
        transform: none;
        box-shadow: none;
    }

    .command-nav-row .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 50;
        width: min(88vw, 340px);
        height: calc(100vh - 98px);
        overflow-y: auto;
        padding: 10px;
        background: var(--sidebar);
        box-shadow: 14px 12px 30px rgba(15, 28, 35, 0.25);
    }

    body.sidebar-open .command-nav-row .nav {
        display: block;
    }

    .command-nav-row .nav > a,
    .command-nav-row .nav-accordion > summary {
        min-height: 42px;
        padding: 0 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .command-nav-row .nav-accordion > summary::after {
        content: "+";
        margin-left: auto;
    }

    .command-nav-row .nav-accordion[open] > summary::after {
        content: "−";
    }

    .command-nav-row .nav-menu,
    .command-nav-row .nav-accordion:hover > .nav-menu,
    .command-nav-row .nav-accordion:focus-within > .nav-menu {
        display: none;
        position: static;
        width: auto;
        max-height: none;
        margin: 0;
        border: 0;
        background: #1c2a31;
        box-shadow: none;
    }

    .command-nav-row .nav-accordion[open] > .nav-menu {
        display: block;
    }

    .command-nav-row .nav-menu a,
    .command-nav-row .nav-group a {
        color: #c6d1d5;
    }

    .command-nav-row .nav-menu a:hover,
    .command-nav-row .nav-menu a.active {
        background: #29404a;
        color: #ffffff;
    }

    .command-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .command-rail {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (max-width: 620px) {
    .brand {
        min-width: 0;
    }

    .brand-subtitle,
    .user-name {
        display: none;
    }

    .topbar {
        min-height: 70px;
        padding: 13px 14px;
    }

    .topbar h1 {
        font-size: 19px;
    }

    .topbar-action {
        align-self: flex-start;
    }

    .content {
        padding: 12px 12px 30px;
    }

    .command-kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .command-kpi {
        border-bottom: 1px solid var(--line);
    }

    .command-kpi:nth-child(even) {
        border-right: 0;
    }

    .command-kpi strong {
        font-size: 21px;
    }

    .command-rail {
        grid-template-columns: 1fr;
    }

    .command-main-column > .trend-panel {
        padding: 12px 8px;
    }

    .combo-legend {
        max-height: 54px;
        overflow-y: auto;
    }

    .command-table th,
    .command-table td {
        padding: 8px 9px;
    }

    .command-table {
        min-width: 920px;
        table-layout: fixed;
    }
}

.license-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 14px 24px 0;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.license-banner.flash-warning {
    border-color: #e7c979;
    background: var(--yellow-soft);
    color: #71480a;
}

.license-banner.flash-error {
    border-color: #e2aaa5;
    background: var(--red-soft);
    color: #8d302b;
}

.license-banner div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.license-banner span {
    font-size: 12px;
}

.license-banner a {
    white-space: nowrap;
    font-weight: 700;
}

.license-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.license-status-card {
    margin-bottom: 0;
}

.license-status-card > span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.license-status-card > strong {
    display: block;
    margin-top: 7px;
    font-size: 23px;
}

.license-status-card > p {
    margin: 6px 0 0;
    font-size: 12px;
}

.license-state-active,
.license-state-development { color: var(--green); }
.license-state-grace { color: var(--yellow); }
.license-state-expired,
.license-state-revoked,
.license-state-suspended,
.license-state-verification_overdue,
.license-state-domain_mismatch,
.license-state-clock_invalid,
.license-state-invalid { color: var(--red); }

.license-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.configuration-check-list {
    display: grid;
    gap: 0;
    margin-bottom: 14px;
    border-top: 1px solid var(--line);
}

.configuration-check-list > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.check-ok { color: var(--green); }
.check-pending { color: var(--yellow); }
.check-fail { color: var(--red); }

.monospace-value {
    overflow-wrap: anywhere;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
}

.license-access-panel {
    margin-inline: auto;
}

.role-badge.role-badge-light {
    border-color: #cad6e4;
    background: #f2f6fa;
    color: #3d536b;
}

button:disabled,
.button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@media (max-width: 720px) {
    .license-banner {
        align-items: flex-start;
        margin: 12px 12px 0;
    }

    .license-banner div {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .license-status-grid,
    .license-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .dashboard-chart-legend.combo-legend {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
        gap: 8px 12px;
        overflow: visible;
    }

    .dashboard-chart-legend.combo-legend > div {
        min-width: 0;
    }

    .dashboard-chart-legend.combo-legend span {
        overflow-wrap: anywhere;
    }
}

/* Statistics contract: QC results and QA causes are deliberately separated. */
.statistics-dimension {
    min-width: 0;
    margin: 20px 0 26px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.statistics-dimension-head {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin: 0 0 12px;
    padding: 12px 14px;
    border-left: 4px solid #438b70;
    background: #f3f8f6;
}

.statistics-dimension-head.is-qa {
    border-left-color: #c47a36;
    background: #faf6f0;
}

.statistics-dimension-head > span {
    flex: 0 0 auto;
    min-width: 52px;
    padding-top: 2px;
    color: #5e7078;
    font-size: 11px;
    font-weight: 800;
}

.statistics-dimension-head > div {
    min-width: 0;
}

.statistics-dimension-head h2,
.supporting-analysis-head h2 {
    margin: 0;
    font-size: 17px;
    line-height: 1.3;
}

.statistics-dimension-head p,
.supporting-analysis-head p,
.panel-note {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.record-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card.is-positive,
.dashboard-domain-metric.cause-site {
    border-top: 3px solid #438b70;
}

.metric-card.is-alert {
    border-top: 3px solid #c45b4d;
}

.change-summary-table {
    min-width: 760px;
    table-layout: fixed;
}

.change-summary-table th:first-child,
.change-summary-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 112px;
    background: #f8fafc;
}

.change-summary-table td,
.change-summary-table th {
    text-align: center;
}

.change-summary-table th:first-child {
    text-align: left;
}

.cross-module-note {
    margin: -4px 0 14px;
    padding: 10px 12px;
    border-left: 3px solid #3f8ea8;
    background: #f4f8fb;
}

.cause-metric-grid,
.qa-cause-domain-metrics,
.qc-domain-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cause-metric,
.qa-cause-domain-metrics .dashboard-domain-metric {
    border-top: 3px solid #9aa8ae;
}

.cause-metric.cause-material,
.dashboard-domain-metric.cause-material {
    border-top-color: #c47a36;
}

.cause-metric.cause-process,
.dashboard-domain-metric.cause-process {
    border-top-color: #3f7f9f;
}

.cause-metric.cause-site,
.dashboard-domain-metric.cause-site {
    border-top-color: #438b70;
}

.cause-metric.cause-performance,
.dashboard-domain-metric.cause-performance {
    border-top-color: #7772a6;
}

.cause-metric.cause-unclassified,
.dashboard-domain-metric.cause-unclassified {
    border-top-color: #9aa8ae;
}

.workflow-metric-grid {
    grid-template-columns: minmax(220px, 320px);
}

.qa-analysis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.supporting-analysis-section {
    min-width: 0;
    margin: 22px 0 8px;
}

.supporting-analysis-head {
    margin-bottom: 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
}

.analysis-grid-three {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.analysis-grid-three > .panel,
.qa-analysis-grid > .panel {
    min-width: 0;
}

.analysis-grid-three .distribution-visual {
    grid-template-columns: 138px minmax(0, 1fr);
    gap: 14px;
}

.analysis-grid-three .pie-chart {
    width: 132px;
    height: 132px;
}

.analysis-grid-three .pie-chart::after {
    inset: 29px;
}

.qc-result-panel,
.qc-unqualified-panel,
.qa-cause-trend-panel {
    min-width: 0;
}

.qc-result-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.source-quality-action-list {
    display: grid;
    gap: 8px;
}

.source-quality-action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border-color, #d9e2e7);
    border-radius: 6px;
    color: inherit;
    background: var(--surface-subtle, #f7fafb);
    text-decoration: none;
    transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.source-quality-action-item:hover {
    border-color: #5c98aa;
    background: #f0f7f9;
    transform: translateY(-1px);
}

.source-quality-action-item > span {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.source-quality-action-item > span:last-child {
    justify-items: end;
    flex: 0 0 auto;
}

.source-quality-action-item strong,
.source-quality-action-item small {
    overflow-wrap: anywhere;
}

.source-quality-action-item small {
    color: var(--text-muted, #687b85);
}

.loss-stat-distributions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.loss-stat-distributions > .panel {
    min-width: 0;
    margin-bottom: 0;
}

.loss-stat-metrics .metric-card strong {
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
    .source-quality-action-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .source-quality-action-item > span:last-child {
        justify-items: start;
    }

    .loss-stat-distributions {
        grid-template-columns: 1fr;
    }
}

.qc-result-chart-grid > .panel {
    min-width: 0;
    height: 100%;
    margin-bottom: 0;
    padding: 16px;
}

.qc-result-chart-grid .module-head {
    margin-bottom: 8px;
}

.qc-result-chart-grid .module-head h2 {
    font-size: 16px;
}

.qc-result-chart-grid .module-head p {
    font-size: 11px;
}

.qc-rate-key,
.qc-normal-rate-line {
    background: #1f6f78;
    stroke: #1f6f78;
}

.qc-normal-rate-point {
    fill: #ffffff;
    stroke: #1f6f78;
    stroke-width: 3;
}

.qc-unqualified-rate-key,
.qc-unqualified-rate-line {
    background: #922f37;
    stroke: #922f37;
}

.qc-unqualified-rate-point {
    fill: #ffffff;
    stroke: #922f37;
    stroke-width: 3;
}

.qa-domain-section {
    padding-top: 2px;
}

@media (max-width: 1280px) {
    .cause-metric-grid,
    .qa-cause-domain-metrics,
    .qc-domain-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .analysis-grid-three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .qc-result-chart-grid {
        grid-template-columns: 1fr;
    }

    .record-summary-grid,
    .cause-metric-grid,
    .qa-cause-domain-metrics,
    .qc-domain-metrics,
    .qa-analysis-grid,
    .analysis-grid-three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analysis-grid-three .distribution-visual {
        grid-template-columns: 150px minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .monthly-hours-editor-head {
        align-items: stretch;
        flex-direction: column;
    }

    .monthly-hours-editor-head button {
        width: 100%;
    }

    .statistics-dimension-head {
        gap: 9px;
        padding: 11px 10px;
    }

    .statistics-dimension-head > span {
        min-width: 46px;
    }

    .record-summary-grid,
    .cause-metric-grid,
    .qa-cause-domain-metrics,
    .qc-domain-metrics,
    .qa-analysis-grid,
    .analysis-grid-three,
    .workflow-metric-grid {
        grid-template-columns: 1fr;
    }

    .analysis-grid-three .distribution-visual {
        grid-template-columns: 124px minmax(0, 1fr);
    }

    .analysis-grid-three .pie-chart {
        width: 116px;
        height: 116px;
    }

    .analysis-grid-three .pie-chart::after {
        inset: 25px;
    }
}

/* Sitewide visual polish and responsive data-table layer */
:root {
    --surface-subtle: #f7f9fa;
    --surface-raised: #ffffff;
    --line-strong: #c7d2d8;
    --text-soft: #50616a;
    --accent: #2f7890;
    --accent-strong: #245d70;
    --accent-soft: #e7f2f4;
    --focus-ring: rgba(73, 168, 184, 0.24);
    --shadow-sm: 0 1px 2px rgba(21, 38, 47, 0.06);
    --shadow-md: 0 10px 28px rgba(21, 38, 47, 0.09);
    --motion-fast: 150ms;
    --motion-base: 260ms;
    --motion-slow: 520ms;
    --ease-standard: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html {
    min-width: 320px;
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: #cfe8ec;
    color: #102a34;
}

a,
button,
input,
select,
textarea,
summary {
    transition:
        color var(--motion-fast) ease,
        background-color var(--motion-fast) ease,
        border-color var(--motion-fast) ease,
        box-shadow var(--motion-fast) ease,
        opacity var(--motion-fast) ease,
        transform var(--motion-fast) var(--ease-standard);
}

.command-header {
    box-shadow: 0 2px 10px rgba(10, 23, 30, 0.16);
}

.command-topline,
.command-nav-row,
.topbar,
.content {
    width: 100%;
    max-width: 1920px;
    margin-right: auto;
    margin-left: auto;
}

.command-search input {
    box-shadow: inset 0 1px 2px rgba(5, 15, 20, 0.18);
}

.command-search button:hover {
    border-color: #5e7b87;
    background: #2c424b;
}

.command-nav-row .nav > a,
.command-nav-row .nav-accordion > summary {
    position: relative;
}

.command-nav-row .nav > a::after,
.command-nav-row .nav-accordion > summary::before {
    position: absolute;
    right: 0;
    bottom: -2px;
    left: 0;
    height: 2px;
    background: var(--cyan);
    content: "";
    opacity: 0;
    transform: scaleX(0.4);
    transform-origin: center;
    transition: opacity var(--motion-fast) ease, transform var(--motion-base) var(--ease-standard);
}

.command-nav-row .nav > a:hover::after,
.command-nav-row .nav > a.active::after,
.command-nav-row .nav-accordion:hover > summary::before,
.command-nav-row .nav-accordion:focus-within > summary::before {
    opacity: 1;
    transform: scaleX(1);
}

.command-nav-row .nav-menu {
    transform-origin: top left;
    animation: qms-menu-in var(--motion-base) var(--ease-standard) both;
}

.topbar {
    align-items: center;
    background: #f8fafb;
}

.topbar-title h1 {
    color: #13242d;
    line-height: 1.25;
}

.content {
    padding-top: 22px;
    padding-bottom: 52px;
}

.content > .qms-enter {
    animation: qms-content-in var(--motion-slow) var(--ease-standard) backwards;
    animation-delay: var(--qms-enter-delay, 0ms);
}

.panel,
.metric-card,
.command-kpi-strip {
    border-color: var(--line);
    border-radius: 6px;
    background: var(--surface-raised);
    box-shadow: var(--shadow-sm);
}

.panel {
    margin-bottom: 16px;
    padding: 18px;
}

.panel > :first-child,
.metric-card > :first-child {
    margin-top: 0;
}

.panel > :last-child,
.metric-card > :last-child {
    margin-bottom: 0;
}

.metric-grid,
.record-summary-grid,
.workflow-metric-grid,
.cause-metric-grid,
.qa-cause-domain-metrics,
.qc-domain-metrics {
    gap: 12px;
}

.metric-card,
.command-kpi {
    position: relative;
    overflow: hidden;
}

.metric-card::before,
.command-kpi::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
    content: "";
    opacity: 0;
    transform: scaleX(0.45);
    transform-origin: left;
    transition: opacity var(--motion-fast) ease, transform var(--motion-base) var(--ease-standard);
}

.metric-card:hover,
a.command-kpi:hover {
    border-color: #b6cbd3;
    box-shadow: 0 7px 18px rgba(22, 58, 70, 0.08);
    transform: translateY(-1px);
}

.metric-card:hover::before,
.command-kpi:hover::before {
    opacity: 1;
    transform: scaleX(1);
}

.metric-card span,
.metric-card small,
.command-kpi span,
.command-kpi small {
    color: var(--text-soft);
}

.metric-card strong,
.command-kpi strong {
    color: #142c36;
    font-variant-numeric: tabular-nums;
}

.module-head,
.command-section-head,
.monthly-hours-editor-head {
    align-items: flex-start;
    gap: 20px;
}

.module-head h2,
.command-section-head h2,
.monthly-hours-editor-head h2 {
    margin-bottom: 4px;
    color: #172a33;
    line-height: 1.35;
}

.module-head p,
.command-section-head p,
.monthly-hours-editor-head p {
    max-width: 920px;
    color: var(--text-soft);
    line-height: 1.6;
}

.button:not(.button-link),
button:not(.button-link) {
    box-shadow: 0 1px 2px rgba(21, 57, 70, 0.12);
}

.button:not(.button-link):hover,
button:not(.button-link):hover {
    box-shadow: 0 5px 12px rgba(21, 57, 70, 0.15);
    transform: translateY(-1px);
}

.button:not(.button-link):active,
button:not(.button-link):active {
    box-shadow: 0 1px 2px rgba(21, 57, 70, 0.1);
    transform: translateY(0);
}

.button.secondary,
button.secondary {
    border: 1px solid #c7d3d9;
    background: #ffffff;
    color: #314851;
}

.button.secondary:hover,
button.secondary:hover {
    border-color: #9eb7c1;
    background: #f1f7f8;
    color: #173f4c;
}

.tabs,
.tab-row {
    gap: 6px;
}

.tabs a,
.tab-row a {
    min-height: 36px;
    padding: 8px 12px;
    border-color: #d4dde1;
    color: #52636b;
}

.tabs a:hover,
.tab-row a:hover {
    border-color: #a8bec7;
    background: #f4f8f9;
    color: #244b58;
}

.tabs a.active,
.tab-row a.active {
    border-color: #8db8c3;
    background: var(--accent-soft);
    color: #205d6c;
    box-shadow: inset 0 -2px 0 var(--accent);
}

.form,
.settings-disclosure-body {
    gap: 16px;
}

.form-grid,
.filter-bar,
.filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: 12px 14px;
}

.filter-bar > button,
.filter-grid > button,
.form-grid > button {
    min-width: 112px;
}

label {
    color: #53656e;
    line-height: 1.35;
}

input,
select,
textarea {
    border-color: #c8d3d8;
    background: #ffffff;
    color: #1d3039;
    box-shadow: inset 0 1px 1px rgba(25, 46, 56, 0.03);
}

input:hover,
select:hover,
textarea:hover {
    border-color: #9fb5be;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 0;
    border-color: #4e9bac;
    box-shadow: 0 0 0 1px #4e9bac;
}

.form-section-title {
    margin-top: 12px;
    padding: 10px 12px;
    border-left-color: var(--accent);
    border-radius: 3px;
    background: #edf5f6;
    color: #214c59;
}

.flash,
.notice-banner,
.license-banner {
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    animation: qms-notice-in var(--motion-base) var(--ease-standard) both;
}

.detail-grid > div,
.attachment-group,
.settings-disclosure {
    border-color: #d8e0e4;
    background: var(--surface-subtle);
}

.settings-disclosure[open] {
    box-shadow: var(--shadow-sm);
}

.settings-disclosure > summary:hover {
    background: #f1f6f7;
}

.two-column,
.chart-pair,
.qc-result-chart-grid,
.analysis-grid,
.analysis-grid-three {
    align-items: stretch;
}

.two-column > .panel,
.chart-pair > .panel,
.qc-result-chart-grid > .panel,
.analysis-grid > .panel,
.analysis-grid-three > .panel {
    min-width: 0;
    height: 100%;
}

.trend-panel,
.distribution-panel,
.qc-result-panel,
.qc-unqualified-panel,
.qa-cause-trend-panel {
    overflow: hidden;
}

.dashboard-svg-wrap,
.trend-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: #9fb4bc #eef2f4;
}

.dashboard-svg-wrap::-webkit-scrollbar,
.trend-scroll::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.table-scroll-region::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dashboard-svg-wrap::-webkit-scrollbar-track,
.trend-scroll::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.table-scroll-region::-webkit-scrollbar-track {
    background: #eef2f4;
}

.dashboard-svg-wrap::-webkit-scrollbar-thumb,
.trend-scroll::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.table-scroll-region::-webkit-scrollbar-thumb {
    border: 2px solid #eef2f4;
    border-radius: 8px;
    background: #9fb4bc;
}

.trend-chart,
.dashboard-chart-svg {
    display: block;
    max-width: 100%;
}

.trend-chart polyline,
.trend-chart .dashboard-multi-rate-line {
    stroke-dasharray: 1800;
    stroke-dashoffset: 1800;
    animation: qms-line-draw 900ms var(--ease-standard) 120ms both;
}

.trend-chart .qms-chart-bar {
    transform-box: fill-box;
    transform-origin: center bottom;
    animation: qms-bar-rise 620ms var(--ease-standard) both;
    animation-delay: var(--qms-chart-delay, 0ms);
}

.trend-chart circle {
    transform-box: fill-box;
    transform-origin: center;
    animation: qms-point-in 320ms var(--ease-standard) 430ms both;
}

.pie-chart {
    animation: qms-pie-in 620ms var(--ease-standard) both;
}

.chart-legend > div {
    min-width: 0;
}

.chart-legend span,
.chart-legend strong {
    overflow-wrap: anywhere;
}

.table-wrap,
.table-scroll-region {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: #8ca6b0 #edf2f4;
    isolation: isolate;
}

.table-scroll-region {
    border: 1px solid #dbe3e6;
    border-radius: 5px;
}

.panel > .table-scroll-region {
    margin-top: 12px;
}

.qms-table-scroll-host.has-overflow:not(.is-scrolled-end) {
    box-shadow: inset -18px 0 18px -18px rgba(27, 54, 65, 0.38);
}

.qms-scroll-meter {
    position: sticky;
    bottom: 0;
    left: 0;
    z-index: 7;
    width: 100%;
    height: 3px;
    overflow: hidden;
    background: #e2eaed;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-fast) ease;
}

.qms-table-scroll-host.has-overflow .qms-scroll-meter {
    opacity: 1;
}

.qms-scroll-meter > i {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transform: translateX(0);
    transition: transform 80ms linear;
}

.data-table {
    border-collapse: separate;
    border-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.data-table.qms-wide-table {
    width: max(100%, var(--qms-table-min-width, 980px));
    min-width: var(--qms-table-min-width, 980px);
    table-layout: auto;
}

.data-table th,
.data-table td {
    min-width: 88px;
    height: 50px;
    padding: 10px 12px;
    vertical-align: middle;
    line-height: 1.45;
}

.data-table th {
    position: relative;
    background: #f3f6f7;
    color: #556870;
    font-size: 11px;
    letter-spacing: 0;
}

.data-table thead th {
    border-top: 1px solid #dbe3e6;
    border-bottom-color: #cfd9dd;
}

.data-table tbody tr:nth-child(even):not(.row-warning):not(.row-danger):not(.row-marked) td {
    background: #fbfcfc;
}

.data-table tbody tr:not(.row-warning):not(.row-danger):not(.row-marked):hover td {
    background: #edf5f6;
}

.data-table tbody tr td {
    transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease;
}

.data-table a:not(.button) {
    color: #276f83;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
}

.data-table a:not(.button):hover {
    color: #174f61;
    text-decoration: underline;
    text-decoration-color: #78aab7;
}

.data-table.qms-wide-table th,
.data-table.qms-wide-table td {
    white-space: nowrap;
    word-break: normal;
}

.data-table .qms-col-compact {
    width: 58px;
    min-width: 58px;
    max-width: 72px;
    text-align: center;
}

.data-table .qms-col-date {
    width: 116px;
    min-width: 116px;
}

.data-table .qms-col-number {
    width: 112px;
    min-width: 112px;
    text-align: right;
}

.data-table .qms-col-status {
    width: 108px;
    min-width: 96px;
    max-width: 120px;
    text-align: center;
}

.data-table .qms-col-owner {
    width: 156px;
    min-width: 132px;
    max-width: 176px;
}

.data-table .qms-col-person {
    width: 124px;
    min-width: 108px;
    max-width: 144px;
}

.data-table.qms-wide-table .qms-col-status,
.data-table.qms-wide-table .qms-col-owner,
.data-table.qms-wide-table .qms-col-person {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.data-table .qms-col-copy {
    width: 220px;
    min-width: 180px;
    max-width: 320px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.55;
}

.data-table.qms-wide-table .qms-col-copy {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.data-table.action-alert-table.qms-wide-table {
    width: max(100%, 1480px);
    min-width: 1480px;
    table-layout: fixed;
}

.action-alert-table th:nth-child(1) { width: 86px; }
.action-alert-table th:nth-child(2) { width: 110px; }
.action-alert-table th:nth-child(3) { width: 130px; }
.action-alert-table th:nth-child(4) { width: 300px; }
.action-alert-table th:nth-child(5) { width: 120px; }
.action-alert-table th:nth-child(6) { width: 190px; }
.action-alert-table th:nth-child(7) { width: 360px; }
.action-alert-table th:nth-child(8) { width: 120px; }
.action-alert-table th:nth-child(9) { width: 80px; }

.data-table.action-alert-table.qms-wide-table th:nth-child(4),
.data-table.action-alert-table.qms-wide-table td:nth-child(4),
.data-table.action-alert-table.qms-wide-table th:nth-child(6),
.data-table.action-alert-table.qms-wide-table td:nth-child(6),
.data-table.action-alert-table.qms-wide-table th:nth-child(7),
.data-table.action-alert-table.qms-wide-table td:nth-child(7) {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.data-table.action-alert-table td:nth-child(4),
.data-table.action-alert-table td:nth-child(6),
.data-table.action-alert-table td:nth-child(7) {
    vertical-align: top;
}

.data-table .qms-col-actions {
    width: 160px;
    min-width: 150px;
    max-width: 176px;
    white-space: nowrap;
}

.data-table td.table-actions {
    display: table-cell;
    white-space: nowrap;
}

.data-table td.table-actions > a,
.data-table td.table-actions > form,
.data-table td.table-actions > span {
    display: inline-flex;
    margin: 2px 8px 2px 0;
    vertical-align: middle;
}

.data-table.qms-wide-table .qms-col-actions {
    position: sticky;
    right: 0;
    z-index: 4;
    background: #ffffff;
    box-shadow: -1px 0 0 #d8e1e5, -8px 0 14px rgba(29, 54, 64, 0.07);
}

.data-table.qms-wide-table thead .qms-col-actions {
    z-index: 6;
    background: #eef3f4;
}

.data-table.qms-wide-table tr:nth-child(even):not(.row-warning):not(.row-danger):not(.row-marked) .qms-col-actions {
    background: #fbfcfc;
}

.data-table.qms-wide-table tr:hover:not(.row-warning):not(.row-danger):not(.row-marked) .qms-col-actions {
    background: #edf5f6;
}

.data-table.qms-wide-table .row-warning .qms-col-actions { background: #fff9eb; }
.data-table.qms-wide-table .row-danger .qms-col-actions { background: #fff1f2; }
.data-table.qms-wide-table .row-marked .qms-col-actions { background: #fff4c7; }

.data-table.qms-wide-table .qms-key-column {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #ffffff;
    box-shadow: 1px 0 0 #d8e1e5, 5px 0 10px rgba(29, 54, 64, 0.04);
}

.data-table.qms-wide-table thead .qms-key-column {
    z-index: 5;
    background: #eef3f4;
}

.data-table.qms-wide-table tr:nth-child(even):not(.row-warning):not(.row-danger):not(.row-marked) .qms-key-column {
    background: #fbfcfc;
}

.data-table.qms-wide-table tr:hover:not(.row-warning):not(.row-danger):not(.row-marked) .qms-key-column {
    background: #edf5f6;
}

.data-table.qms-wide-table .row-warning .qms-key-column { background: #fff9eb; }
.data-table.qms-wide-table .row-danger .qms-key-column { background: #fff1f2; }
.data-table.qms-wide-table .row-marked .qms-key-column { background: #fff4c7; }

@media (min-width: 1280px) {
    .data-table.qms-wide-table.qms-adaptive-list {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    .data-table.qms-wide-table.qms-adaptive-list th,
    .data-table.qms-wide-table.qms-adaptive-list td {
        min-width: 0;
        max-width: none;
        height: 46px;
        padding: 8px 6px;
        overflow-wrap: anywhere;
        white-space: normal;
        word-break: normal;
        line-height: 1.35;
    }

    .data-table.qms-wide-table.qms-adaptive-list .sort-link {
        min-height: 34px;
        padding: 8px 6px;
        gap: 4px;
    }

    .data-table.qms-wide-table.qms-adaptive-list .qms-col-compact {
        width: 44px;
        min-width: 0;
        max-width: none;
    }

    .data-table.qms-wide-table.qms-adaptive-list .qms-col-date {
        width: 76px;
        min-width: 0;
    }

    .data-table.qms-wide-table.qms-adaptive-list .qms-col-number {
        width: 70px;
        min-width: 0;
    }

    .data-table.qms-wide-table.qms-adaptive-list .qms-col-status {
        width: 76px;
        min-width: 0;
        max-width: none;
    }

    .data-table.qms-wide-table.qms-adaptive-list .qms-col-owner {
        width: 92px;
        min-width: 0;
        max-width: none;
    }

    .data-table.qms-wide-table.qms-adaptive-list .qms-col-person {
        width: 82px;
        min-width: 0;
        max-width: none;
    }

    .data-table.qms-wide-table.qms-adaptive-list .qms-col-copy {
        width: 14%;
        min-width: 0;
        max-width: none;
    }

    .data-table.qms-wide-table.qms-adaptive-list .qms-col-actions {
        position: static;
        right: auto;
        width: 98px;
        min-width: 0;
        max-width: none;
        white-space: normal;
        box-shadow: none;
    }

    .data-table.qms-wide-table.qms-adaptive-list .qms-key-column {
        position: static;
        left: auto;
        min-width: 0;
        box-shadow: none;
    }

    .data-table.qms-wide-table.qms-adaptive-list td.table-actions {
        white-space: normal;
    }

    .data-table.qms-wide-table.qms-adaptive-list td.table-actions > a,
    .data-table.qms-wide-table.qms-adaptive-list td.table-actions > form,
    .data-table.qms-wide-table.qms-adaptive-list td.table-actions > span {
        margin: 2px 4px 2px 0;
    }

    .data-table.action-alert-table.qms-wide-table.qms-adaptive-list {
        width: 100%;
        min-width: 0;
    }

    .data-table.action-alert-table.qms-adaptive-list th:nth-child(1) { width: 6%; }
    .data-table.action-alert-table.qms-adaptive-list th:nth-child(2) { width: 7%; }
    .data-table.action-alert-table.qms-adaptive-list th:nth-child(3) { width: 8%; }
    .data-table.action-alert-table.qms-adaptive-list th:nth-child(4) { width: 17%; }
    .data-table.action-alert-table.qms-adaptive-list th:nth-child(5) { width: 8%; }
    .data-table.action-alert-table.qms-adaptive-list th:nth-child(6) { width: 13%; }
    .data-table.action-alert-table.qms-adaptive-list th:nth-child(7) { width: 25%; }
    .data-table.action-alert-table.qms-adaptive-list th:nth-child(8) { width: 9%; }
    .data-table.action-alert-table.qms-adaptive-list th:nth-child(9) { width: 7%; }
}

.status-chip,
.module-chip,
.record-flag,
.role-badge {
    font-weight: 750;
    letter-spacing: 0;
}

.pagination {
    gap: 5px;
}

.pagination a {
    min-width: 34px;
    min-height: 34px;
    border-color: #d1dadd;
    border-radius: 4px;
}

.login-body,
.setup-body {
    background: #edf2f4;
}

.login-card,
.setup-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #cfdade;
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(21, 38, 47, 0.12);
    animation: qms-login-in 560ms var(--ease-standard) both;
}

.login-card::before,
.setup-card::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: var(--accent);
    content: "";
}

@keyframes qms-content-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes qms-menu-in {
    from { opacity: 0; transform: translateY(-5px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes qms-notice-in {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes qms-line-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes qms-bar-rise {
    from { opacity: 0.28; transform: scaleY(0.08); }
    to { opacity: 1; transform: scaleY(1); }
}

@keyframes qms-point-in {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes qms-pie-in {
    from { opacity: 0; transform: scale(0.9) rotate(-6deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes qms-login-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    .command-header {
        position: sticky;
        top: 0;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open::before {
        position: fixed;
        inset: 99px 0 0;
        z-index: 39;
        background: rgba(10, 23, 30, 0.46);
        content: "";
        animation: qms-notice-in var(--motion-fast) ease both;
    }

    .command-nav-row .nav {
        display: block;
        position: fixed;
        top: 99px;
        bottom: 0;
        left: 0;
        width: min(86vw, 330px);
        height: auto;
        max-height: none;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transform: translateX(-102%);
        transition:
            visibility 0s linear var(--motion-base),
            opacity var(--motion-base) ease,
            transform var(--motion-base) var(--ease-standard);
    }

    body.sidebar-open .command-nav-row .nav {
        display: block;
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
        transition-delay: 0s;
    }

    .command-nav-row .nav > a::after,
    .command-nav-row .nav-accordion > summary::before {
        display: none;
    }

    .module-head,
    .command-section-head,
    .monthly-hours-editor-head {
        gap: 14px;
    }

    .two-column,
    .chart-pair,
    .analysis-grid,
    .analysis-grid-three {
        grid-template-columns: 1fr;
    }

    .analysis-grid-three .distribution-visual {
        grid-template-columns: minmax(118px, 138px) minmax(0, 1fr);
    }
}

@media (max-width: 700px) {
    .topbar {
        align-items: flex-start;
        gap: 12px;
    }

    .content {
        padding: 14px 12px 36px;
    }

    .notice-banner {
        width: calc(100% - 24px);
    }

    .panel {
        margin-bottom: 12px;
        padding: 14px;
    }

    .module-head,
    .command-section-head,
    .monthly-hours-editor-head {
        flex-direction: column;
        align-items: stretch;
    }

    .module-actions,
    .form-actions,
    .table-actions {
        width: 100%;
    }

    .module-actions .button,
    .form-actions .button,
    .form-actions > button {
        flex: 1 1 auto;
    }

    .tabs,
    .tab-row {
        flex-wrap: nowrap;
        max-width: 100%;
        overflow-x: auto;
        padding-bottom: 3px;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar,
    .tab-row::-webkit-scrollbar {
        display: none;
    }

    .tabs a,
    .tab-row a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .form-grid,
    .filter-bar,
    .filter-grid,
    .attachment-upload-grid,
    .attachment-groups {
        grid-template-columns: 1fr;
    }

    .filter-bar > button,
    .filter-grid > button,
    .form-grid > button {
        width: 100%;
    }

    .dashboard-month-shortcuts,
    .dashboard-month-links,
    .dashboard-month-picker {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .dashboard-month-summary {
        width: 100%;
    }

    .dashboard-svg-wrap .trend-chart,
    .trend-scroll .trend-chart {
        width: 620px;
        max-width: none;
    }

    .distribution-visual,
    .analysis-grid-three .distribution-visual {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .distribution-visual .chart-legend {
        width: 100%;
    }

    .table-wrap.panel {
        padding-right: 12px;
        padding-left: 12px;
    }

    .data-table th,
    .data-table td {
        height: 46px;
        padding: 9px 10px;
        font-size: 12px;
    }

    .data-table .qms-col-copy {
        min-width: 168px;
        max-width: 250px;
    }

    .login-body,
    .setup-body {
        padding: 14px;
    }

    .login-card,
    .setup-card {
        padding: 22px 20px;
    }
}

/* Document management hub */
.document-category-metrics {
    margin-top: 18px;
}

.document-category-metrics .metric-card {
    min-height: 112px;
    text-decoration: none;
}

.document-category-metrics .metric-card.is-active {
    border-color: #4b91a2;
    box-shadow: inset 0 0 0 1px #4b91a2;
}

.document-quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.document-quick-filters a {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
}

.document-quick-filters a:hover,
.document-quick-filters a.active {
    border-color: #4b91a2;
    background: #edf7f8;
    color: #1f6676;
}

.document-search-form {
    display: grid;
    gap: 14px;
}

.document-category-selector {
    margin: 0;
    padding: 0;
    border: 0;
}

.document-category-selector legend {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.document-category-selector > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.document-category-option {
    display: inline-flex;
    min-width: 0;
    cursor: pointer;
}

.document-category-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.document-category-option span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
}

.document-category-option small {
    min-width: 20px;
    padding: 1px 5px;
    border-radius: 9px;
    background: #edf2f4;
    color: var(--muted);
    text-align: center;
}

.document-category-option input:checked + span {
    border-color: #4b91a2;
    background: #edf7f8;
    color: #1f6676;
}

.document-category-option input:focus-visible + span {
    outline: 3px solid rgba(49, 132, 151, .25);
    outline-offset: 2px;
}

.document-search-controls {
    margin: 0;
}

.document-search-controls label:has(input[name="q"]) {
    min-width: min(420px, 100%);
    flex: 1 1 340px;
}

.document-category-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 4px;
    background: #edf4f5;
    color: #315f69;
    white-space: nowrap;
}

.document-recent-panel .data-table td:nth-child(2) {
    max-width: 360px;
}

@media (max-width: 700px) {
    .document-category-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .document-category-metrics .metric-card {
        min-height: 96px;
    }

    .document-category-option {
        flex: 1 1 calc(50% - 4px);
    }

    .document-category-option span {
        justify-content: space-between;
        width: 100%;
    }
}

.document-control-statusbar,
.permission-default-note,
.permission-readonly-note,
.document-format-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 14px;
    padding: 11px 13px;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    color: var(--text);
}

.document-control-statusbar {
    flex-wrap: wrap;
    justify-content: space-between;
}

.document-format-note {
    display: grid;
    grid-template-columns: auto 1fr;
}

.document-format-note small {
    grid-column: 2;
    color: var(--muted);
}

.document-category-create-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    align-items: end;
    gap: 12px;
    margin-top: 18px;
}

.document-category-admin-table {
    min-width: 1320px;
}

.document-category-admin-table input,
.document-category-admin-table select {
    min-width: 130px;
}

.document-category-admin-table td:nth-child(2) input {
    padding-left: calc(10px + var(--tree-depth, 0) * 16px);
}

.document-category-admin-table td small {
    display: block;
    max-width: 180px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    white-space: normal;
}

.document-version-input {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: stretch;
}

.document-version-input > span {
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-right: 0;
    background: #edf3f4;
    color: var(--accent-strong);
    font-weight: 800;
}

.document-version-input > input {
    min-width: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.document-upload-rule-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.document-upload-rule-grid > div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    background: #f6f9f9;
}

.document-upload-rule-grid span {
    color: var(--muted);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.document-upload-rule-grid code {
    color: var(--accent-strong);
}

.document-batch-upload-form input[type="file"] {
    min-height: 48px;
}

.document-batch-result .data-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.document-batch-errors {
    margin-top: 16px;
    padding: 14px;
    border-left: 3px solid var(--accent-red);
    background: var(--accent-red-soft);
}

.document-batch-errors h3,
.document-batch-errors ul {
    margin: 0;
}

.document-batch-errors ul {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding-left: 20px;
}

.document-batch-errors li span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
}

.document-manual-upload-panel > summary {
    cursor: pointer;
    font-weight: 800;
}

.document-manual-upload-panel[open] > summary {
    margin-bottom: 18px;
}

.document-permission-department-filter {
    align-items: end;
}

.document-permission-matrix th:not(:first-child),
.document-permission-matrix td:not(:first-child) {
    text-align: center;
}

.document-permission-matrix td:first-child {
    min-width: 210px;
    text-align: left;
}

.document-permission-matrix td:first-child small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.document-category-tree-name {
    display: block;
    padding-left: calc(var(--tree-depth, 0) * 18px);
    font-weight: 700;
}

.permission-checkbox {
    display: inline-grid;
    justify-items: center;
    gap: 3px;
    min-width: 58px;
    cursor: pointer;
}

.permission-checkbox input {
    inline-size: 20px;
    block-size: 20px;
}

.permission-checkbox span {
    color: var(--muted);
    font-size: 12px;
}

.permission-source-badge,
.status-badge,
.document-index-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.permission-source-badge.is-inherited,
.status-badge.muted,
.document-index-status.is-metadata,
.document-index-status.is-empty {
    background: #edf1f2;
    color: #68767b;
}

.status-badge.success,
.document-index-status.is-indexed {
    background: var(--accent-green-soft);
    color: var(--accent-green);
}

.status-badge.danger {
    background: var(--accent-red-soft);
    color: var(--accent-red);
}

.status-badge.info,
.document-index-status.is-processing {
    background: #e6f3f6;
    color: #176b7d;
}

.status-badge.warning {
    background: #fff3d5;
    color: #8a5a00;
}

.document-index-status.is-failed {
    background: var(--accent-red-soft);
    color: var(--accent-red);
}

.document-permission-savebar {
    position: sticky;
    bottom: 10px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 24px rgba(24, 48, 56, .12);
}

.document-recent-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.document-recent-column {
    min-width: 0;
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    background: #fff;
}

.document-recent-column-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--border);
}

.document-recent-column-head h3,
.document-recent-column-head p {
    margin: 0;
}

.document-recent-column-head p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.document-recent-column ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.document-recent-column li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 58px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.document-recent-column li:last-child {
    border-bottom: 0;
}

.document-recent-column li a {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.document-recent-column li small,
.document-recent-column li time {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.document-title-link {
    font-weight: 700;
}

.document-list-table td:nth-child(3) small {
    display: block;
    max-width: 360px;
    margin-top: 4px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.document-inline-preview {
    margin-top: 18px;
    border: 1px solid var(--border);
    background: #f5f7f7;
    overflow: hidden;
}

.document-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 54px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.document-preview-toolbar > div:first-child {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.document-preview-toolbar span {
    color: var(--muted);
    font-size: 12px;
}

.document-preview-surface {
    min-height: 70vh;
    background: #e8edef;
}

.document-processing-notice,
.document-processing-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    padding: 11px 13px;
    border: 1px solid #c8dfe5;
    border-left: 3px solid var(--accent);
    background: #f2f8f9;
    color: #35545c;
}

.document-processing-notice strong {
    flex: 0 0 auto;
    color: var(--text);
}

.document-processing-summary.is-ready {
    border-color: #cce7d8;
    border-left-color: var(--accent-green);
    background: #f2faf5;
}

.document-processing-summary.is-partial {
    border-color: #ead9a8;
    border-left-color: #b77a08;
    background: #fffaf0;
}

.document-processing-summary.is-failed {
    border-color: #edc7c7;
    border-left-color: var(--accent-red);
    background: #fff5f5;
}

.document-inline-preview iframe {
    display: block;
    width: 100%;
    min-height: 70vh;
    border: 0;
}

.document-inline-preview:fullscreen,
.document-inline-preview:-webkit-full-screen {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    margin: 0;
    border: 0;
    background: #111a1e;
}

.document-inline-preview:fullscreen .document-preview-toolbar,
.document-inline-preview:-webkit-full-screen .document-preview-toolbar {
    flex: 0 0 auto;
}

.document-inline-preview:fullscreen .document-preview-surface,
.document-inline-preview:-webkit-full-screen .document-preview-surface {
    flex: 1 1 auto;
    min-height: 0;
}

.document-inline-preview:fullscreen iframe,
.document-inline-preview:-webkit-full-screen iframe {
    height: 100%;
    min-height: 0;
}

.document-inline-preview:fullscreen img,
.document-inline-preview:-webkit-full-screen img {
    max-height: calc(100vh - 54px);
}

.document-inline-preview.is-restricted iframe,
.document-inline-preview.is-restricted img {
    user-select: none;
    -webkit-user-drag: none;
}

.document-inline-preview img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 76vh;
    margin: 0 auto;
    object-fit: contain;
}

.document-text-preview {
    margin-top: 18px;
    border: 1px solid var(--border);
}

.document-text-preview summary {
    padding: 12px 14px;
    font-weight: 700;
    cursor: pointer;
}

.document-text-preview div {
    max-height: 62vh;
    padding: 16px;
    overflow: auto;
    border-top: 1px solid var(--border);
    background: #fff;
    line-height: 1.75;
    white-space: normal;
}

.document-search-group-row td {
    padding: 9px 12px;
    border-top: 2px solid #bfd7dd;
    background: #eef6f7;
    color: #274750;
}

.document-search-group-row strong,
.document-search-group-row span {
    display: inline-block;
}

.document-search-group-row span {
    margin-left: 10px;
    color: var(--muted);
    font-size: 12px;
}

.document-search-match-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 6px;
    border: 1px solid #bed8df;
    background: #edf7f9;
    color: #176b80;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

.document-search-match-badge.is-content {
    border-color: #decf9b;
    background: #fff8df;
    color: #795b00;
}

.document-search-snippet {
    display: block;
    max-width: 720px !important;
    margin-top: 7px !important;
    color: #435861 !important;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.65;
}

.document-search-snippet b {
    display: block;
    margin-bottom: 2px;
    color: #536b74;
    font-size: 11px;
}

.document-search-highlight {
    padding: 0 2px;
    background: #ffe16a;
    color: #352b00;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

@media print {
    .document-inline-preview.is-restricted {
        display: none !important;
    }
}

.document-description {
    margin-top: 16px;
    padding: 14px;
    background: #f6f8f8;
}

.document-description p {
    margin: 6px 0 0;
}

.document-delete-form {
    margin-top: 14px;
}

.obsolete-document-warning {
    max-width: 720px;
    margin-inline: auto;
    border-left: 4px solid var(--accent-red);
}

.obsolete-document-warning h2 {
    margin: 14px 0 8px;
}

.document-version-obsolete,
.document-obsolete-table tbody tr {
    background: #f2f4f4;
    color: #6f797d;
}

.document-version-obsolete a,
.document-obsolete-table a {
    color: #5e6e73;
}

.document-archive-filter {
    align-items: end;
}

.access-denied-panel {
    max-width: 680px;
    margin-inline: auto;
}

@media (max-width: 980px) {
    .document-category-create-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .document-recent-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .document-recent-column li:nth-child(n + 4) {
        display: none;
    }

    .document-category-create-form,
    .document-format-note,
    .document-upload-rule-grid {
        grid-template-columns: 1fr;
    }

    .document-format-note small {
        grid-column: 1;
    }

    .document-permission-savebar {
        align-items: stretch;
        flex-direction: column;
    }

    .document-inline-preview iframe {
        min-height: 62vh;
    }

    .document-preview-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .document-preview-toolbar .table-actions {
        width: 100%;
    }

    .document-preview-toolbar .table-actions .button,
    .document-preview-toolbar .table-actions button {
        flex: 1 1 0;
    }

    .document-search-group-row span {
        display: block;
        margin: 3px 0 0;
    }
}

/* Product photography and cross-module traceability */
.trace-link {
    color: #176b80;
    font-weight: 700;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.trace-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.trace-separator {
    color: #8aa0a8;
}

.trace-version {
    color: var(--muted);
    font-weight: 600;
}

.product-photo-page {
    display: grid;
    gap: 14px;
}

.product-photo-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-top: 3px solid var(--accent);
}

.product-photo-hero h2,
.batch-trace-head h2 {
    margin: 3px 0 4px;
}

.product-photo-hero p,
.batch-trace-head p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
}

.product-photo-upload-panel {
    border-left: 3px solid var(--accent-green);
    background: #fbfefd;
}

.product-photo-upload-form {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.4fr) minmax(180px, 0.6fr);
    align-items: end;
    gap: 14px;
    margin: 0;
}

.product-photo-upload-form label {
    display: grid;
    gap: 7px;
    margin: 0;
}

.product-photo-upload-form label > span:first-child,
.product-photo-session-row > div > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.product-photo-batch-field input {
    min-height: 48px;
    font-size: 17px;
    font-weight: 700;
}

.product-photo-file-picker {
    min-height: 78px;
    padding: 11px 13px;
    border: 1px dashed #80aeb9;
    border-radius: 5px;
    background: #f1f8f9;
    cursor: pointer;
}

.product-photo-file-picker:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.file-picker-title {
    color: #214653;
    font-weight: 800;
}

.file-picker-hint,
.product-photo-upload-form small,
.product-photo-selection {
    color: var(--muted);
    font-size: 12px;
}

.product-photo-file-picker input[type="file"] {
    width: 100%;
    min-height: 34px;
    padding: 4px;
    background: #fff;
}

.product-photo-submit {
    grid-column: 3;
    grid-row: 1;
    min-height: 48px;
}

.product-photo-selection {
    grid-column: 2;
    min-height: 18px;
}

.product-photo-upload-form > small {
    grid-column: 1 / -1;
}

.product-photo-filter-panel .filter-bar {
    margin: 0;
}

.product-photo-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-photo-session-form {
    margin: 0;
}

.product-photo-list-panel {
    margin: 0;
}

.product-photo-check-all {
    min-height: 36px;
    padding: 0 8px;
}

.product-photo-session-list {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--line);
}

.product-photo-session-row {
    display: grid;
    grid-template-columns: 34px minmax(180px, 1.2fr) minmax(145px, 0.75fr) minmax(120px, 0.65fr) 82px;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 12px 14px;
    background: #fff;
}

.product-photo-session-row:not(:has(.product-photo-row-check)) {
    grid-template-columns: minmax(180px, 1.2fr) minmax(145px, 0.75fr) minmax(120px, 0.65fr) 82px;
}

.product-photo-row-check {
    display: grid;
    place-items: center;
    min-height: 34px;
}

.product-photo-session-row > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.product-photo-session-row strong {
    overflow-wrap: anywhere;
}

.product-photo-attachments,
.product-photo-locked {
    grid-column: 1 / -1;
    min-width: 0;
}

.product-photo-attachments {
    padding-top: 9px;
    border-top: 1px solid #e4ecef;
}

.product-photo-attachments summary,
.batch-trace-photo-session summary {
    color: var(--accent-strong);
    font-weight: 800;
    cursor: pointer;
}

.product-photo-locked {
    color: var(--muted);
    font-size: 12px;
}

.product-photo-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.product-photo-media {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #f5f8f9;
}

.product-photo-media > a,
.product-photo-media > video {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #e8eef0;
}

.product-photo-media img,
.product-photo-media video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-photo-media figcaption {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 10px;
    padding: 9px 10px;
    background: #fff;
}

.product-photo-media figcaption strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-photo-media figcaption span {
    grid-column: 1;
    color: var(--muted);
    font-size: 11px;
}

.product-photo-media figcaption a {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
}

.batch-trace-head {
    border-top: 3px solid var(--accent);
}

.batch-trace-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 15px;
}

.batch-trace-photo-sessions {
    display: grid;
    gap: 8px;
}

.batch-trace-photo-session {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fbfcfd;
}

.batch-trace-photo-session > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.batch-trace-photo-session > summary > span:first-child {
    display: grid;
    gap: 2px;
}

.batch-trace-photo-session > summary small {
    color: var(--muted);
    font-weight: 500;
}

.batch-trace-business-attachments .attachment-groups {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--line);
}

@media (max-width: 1100px) {
    .product-photo-upload-form {
        grid-template-columns: 1fr 1.35fr;
    }

    .product-photo-submit {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .product-photo-selection {
        grid-column: 2;
    }

    .batch-trace-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .product-photo-page {
        gap: 10px;
    }

    .product-photo-hero {
        display: none;
    }

    .product-photo-upload-panel,
    .product-photo-list-panel,
    .product-photo-filter-panel {
        padding: 14px;
    }

    .product-photo-upload-form {
        grid-template-columns: 1fr;
    }

    .product-photo-selection,
    .product-photo-submit,
    .product-photo-upload-form > small {
        grid-column: 1;
    }

    .product-photo-batch-field input,
    .product-photo-submit {
        min-height: 52px;
    }

    .product-photo-file-picker {
        min-height: 96px;
    }

    .product-photo-metrics,
    .batch-trace-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-grid.product-photo-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .product-photo-metrics .metric-card {
        min-height: 78px;
        padding: 12px;
    }

    .product-photo-metrics .metric-card strong {
        font-size: 24px;
    }

    .product-photo-list-panel .module-head {
        align-items: stretch;
    }

    .product-photo-list-panel .module-actions {
        justify-content: space-between;
        width: 100%;
    }

    .product-photo-session-row,
    .product-photo-session-row:not(:has(.product-photo-row-check)) {
        grid-template-columns: 32px minmax(0, 1fr) 74px;
        gap: 10px;
        padding: 12px;
    }

    .product-photo-session-row:not(:has(.product-photo-row-check)) {
        grid-template-columns: minmax(0, 1fr) 74px;
    }

    .product-photo-batch {
        grid-column: 2;
        grid-row: 1;
    }

    .product-photo-session-row:not(:has(.product-photo-row-check)) .product-photo-batch {
        grid-column: 1;
    }

    .product-photo-time {
        grid-column: 2;
        grid-row: 2;
    }

    .product-photo-session-row:not(:has(.product-photo-row-check)) .product-photo-time {
        grid-column: 1;
    }

    .product-photo-uploader {
        grid-column: 2;
        grid-row: 3;
    }

    .product-photo-session-row:not(:has(.product-photo-row-check)) .product-photo-uploader {
        grid-column: 1;
    }

    .product-photo-count {
        grid-column: 3;
        grid-row: 1 / span 3;
        align-self: center;
        text-align: right;
    }

    .product-photo-session-row:not(:has(.product-photo-row-check)) .product-photo-count {
        grid-column: 2;
    }

    .product-photo-row-check {
        grid-column: 1;
        grid-row: 1 / span 3;
    }

    .product-photo-attachments,
    .product-photo-locked {
        grid-column: 1 / -1;
    }

    .product-photo-media-grid {
        grid-template-columns: 1fr;
    }

    .product-photo-media > a,
    .product-photo-media > video {
        aspect-ratio: 16 / 12;
    }

    .batch-trace-photo-session > summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}

/* Release notes */
.notification-trigger.release-notes-trigger.is-active {
    border-color: #5aa8b8;
    background: #21363f;
    color: #ffffff;
}

.release-note-editor {
    max-width: 980px;
}

.release-note-form {
    display: grid;
    gap: 15px;
}

.release-note-version-field {
    max-width: 360px;
}

.release-note-form textarea {
    min-height: 148px;
    line-height: 1.65;
}

.release-note-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.release-note-submit-row span {
    color: var(--muted);
    font-size: 12px;
}

.release-note-history-head {
    margin: 22px 0 12px;
}

.release-note-list {
    display: grid;
    gap: 10px;
}

.release-note-item {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
    gap: 22px;
    margin-bottom: 0;
    padding: 16px 18px;
    border-left: 3px solid var(--accent);
}

.release-note-meta {
    display: grid;
    align-content: start;
    gap: 4px;
}

.release-note-meta strong {
    color: #173f4c;
    font-size: 17px;
    overflow-wrap: anywhere;
}

.release-note-meta time,
.release-note-meta span {
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.release-note-content {
    min-width: 0;
    color: #263b44;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.release-note-empty {
    color: var(--muted);
    text-align: center;
}

.release-note-pagination {
    margin-top: 16px;
}

@media (max-width: 700px) {
    .release-note-submit-row {
        align-items: stretch;
        flex-direction: column;
    }

    .release-note-submit-row button {
        width: 100%;
    }

    .release-note-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .release-note-meta {
        padding-bottom: 10px;
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 420px) {
    .command-topline {
        gap: 10px;
        padding-right: 12px;
        padding-left: 12px;
    }

    .brand-title {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar {
        flex-direction: column;
    }

    .topbar-action {
        width: 100%;
    }

    .metric-grid,
    .record-summary-grid,
    .workflow-metric-grid,
    .cause-metric-grid,
    .qa-cause-domain-metrics,
    .qc-domain-metrics,
    .command-kpi-strip {
        grid-template-columns: 1fr;
    }

    .command-kpi {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .command-kpi:last-child {
        border-bottom: 0;
    }
}

.rich-editor-field {
    margin: 16px 0;
}

.rich-editor-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    color: #1b3741;
    font-weight: 700;
}

.rich-editor-label small {
    color: #6e8188;
    font-size: 12px;
    font-weight: 400;
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border: 1px solid #bdcdd3;
    border-bottom: 0;
    background: #eef4f6;
}

.rich-editor-toolbar button,
.rich-editor-toolbar select {
    width: auto;
    min-width: 36px;
    min-height: 32px;
    margin: 0;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    color: #183842;
    box-shadow: none;
    font-size: 13px;
    line-height: 1.2;
}

.rich-editor-toolbar select {
    min-width: 82px;
    border-color: #b8c9cf;
    background: #fff;
}

.rich-editor-toolbar button:hover,
.rich-editor-toolbar button:focus-visible {
    border-color: #70a7b5;
    background: #fff;
    color: #0f6579;
}

.rich-editor-toolbar button:disabled {
    cursor: not-allowed;
    opacity: .42;
}

.rich-editor-surface {
    min-height: calc(var(--rich-editor-rows, 4) * 1.55em + 34px);
    max-height: 680px;
    overflow: auto;
    padding: 14px 16px;
    border: 1px solid #bdcdd3;
    background: #fff;
    color: #172e37;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.rich-editor-surface:focus {
    border-color: #27849a;
    outline: 2px solid rgba(39, 132, 154, .14);
    outline-offset: 0;
}

.rich-editor-surface:empty::before {
    color: #819198;
    content: attr(data-placeholder);
    pointer-events: none;
}

.rich-editor-surface p,
.complaint-rich-content p {
    margin: 0 0 10px;
}

.rich-editor-surface h3,
.complaint-rich-content h3 {
    margin: 16px 0 8px;
    color: #143b48;
    font-size: 16px;
}

.rich-editor-surface blockquote,
.complaint-rich-content blockquote {
    margin: 12px 0;
    padding: 8px 12px;
    border-left: 3px solid #3b94a8;
    background: #eef6f8;
    color: #3d5963;
}

.rich-editor-surface figure,
.complaint-rich-content figure {
    margin: 14px 0;
}

.rich-editor-surface img,
.complaint-rich-content img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 720px;
    margin: 0 auto;
    border: 1px solid #c8d5da;
    background: #f6f8f9;
    object-fit: contain;
}

.rich-editor-surface figcaption,
.complaint-rich-content figcaption {
    padding-top: 5px;
    color: #657b84;
    font-size: 12px;
    text-align: center;
}

.rich-editor-surface table,
.complaint-rich-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.rich-editor-surface td,
.rich-editor-surface th,
.complaint-rich-content td,
.complaint-rich-content th {
    padding: 7px;
    border: 1px solid #c6d4d9;
}

.rich-editor-status {
    min-height: 20px;
    padding-top: 3px;
    color: #526b74;
    font-size: 12px;
}

.rich-editor-status.is-error {
    color: #a63232;
}

.complaint-evidence-panel > .module-head {
    margin-bottom: 0;
}

.complaint-evidence-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
}

.complaint-evidence-section {
    min-width: 0;
    padding: 18px 0 14px;
    border-top: 1px solid #ccd9de;
}

.complaint-evidence-section header {
    margin-bottom: 12px;
}

.complaint-evidence-section h3 {
    margin: 0;
    color: #135f73;
    font-size: 16px;
}

.complaint-evidence-section header p {
    margin: 3px 0 0;
    color: #71838a;
    font-size: 12px;
}

.complaint-evidence-investigation_process,
.complaint-evidence-functional_test_result {
    grid-column: 1 / -1;
}

.complaint-rich-content {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .rich-editor-label {
        display: block;
    }

    .rich-editor-label small {
        display: block;
        margin-top: 2px;
    }

    .rich-editor-toolbar {
        position: sticky;
        z-index: 2;
        top: var(--sticky-header-offset, 0);
    }

    .rich-editor-toolbar button,
    .rich-editor-toolbar select {
        min-height: 38px;
    }

    .complaint-evidence-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .complaint-evidence-investigation_process,
    .complaint-evidence-functional_test_result {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }
}

/* Online feedback workflow */
.online-feedback-entry-panel {
    max-width: 1180px;
    margin-inline: auto;
}

.online-feedback-department-grid,
.online-feedback-permission-forms,
.permission-explainer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.online-feedback-department-grid fieldset {
    min-width: 0;
    margin: 0;
    padding: 14px;
    border: 1px solid #cbd8dc;
    border-radius: 6px;
}

.online-feedback-department-grid legend {
    padding: 0 6px;
    color: #173f4c;
    font-weight: 700;
}

.online-feedback-department-grid .choice-grid {
    max-height: 330px;
    overflow-y: auto;
    align-content: start;
}

.online-feedback-send-bar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.online-feedback-send-bar > div {
    align-self: center;
}

.online-feedback-send-bar > div span,
.online-feedback-time-grid,
.online-feedback-assignment-head small {
    display: block;
    color: #637980;
    font-size: 12px;
}

.online-feedback-summary {
    min-width: 220px;
    max-width: 430px;
    white-space: normal;
}

.risk-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.risk-chip {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.risk-low {
    border-color: #9dccb2;
    background: #e9f6ee;
    color: #17613b;
}

.risk-medium {
    border-color: #dec97a;
    background: #fff7d9;
    color: #735700;
}

.risk-high {
    border-color: #dfaaa8;
    background: #fff0ef;
    color: #9b2c2a;
}

.online-feedback-timeline ol {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.online-feedback-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
    padding-right: 14px;
    color: #718087;
}

.online-feedback-timeline li::after {
    position: absolute;
    z-index: 0;
    top: 14px;
    right: 0;
    left: 30px;
    height: 2px;
    background: #d3dde0;
    content: "";
}

.online-feedback-timeline li:last-child::after {
    display: none;
}

.online-feedback-timeline li > span {
    z-index: 1;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #c4d1d5;
    border-radius: 50%;
    background: #fff;
    font-size: 12px;
    font-weight: 800;
}

.online-feedback-timeline li.is-complete,
.online-feedback-timeline li.is-current {
    color: #174c5c;
}

.online-feedback-timeline li.is-complete > span {
    border-color: #5d9b7a;
    background: #e9f6ee;
    color: #17613b;
}

.online-feedback-timeline li.is-current > span {
    border-color: #287f98;
    background: #287f98;
    color: #fff;
}

.online-feedback-timeline li div {
    position: relative;
    z-index: 1;
    min-width: 0;
    background: var(--surface, #fff);
}

.online-feedback-timeline li strong,
.online-feedback-timeline li small {
    display: block;
}

.online-feedback-timeline li small {
    overflow: hidden;
    margin-top: 3px;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.online-feedback-assignment-list {
    display: grid;
    gap: 0;
}

.online-feedback-assignment-card,
.online-feedback-cc-card {
    padding: 16px 2px;
    border-bottom: 1px solid #d9e2e5;
    border-left: 4px solid #9fb3ba;
}

.online-feedback-assignment-card:last-child,
.online-feedback-cc-card:last-child {
    border-bottom: 0;
}

.online-feedback-assignment-card.risk-border-low {
    border-left-color: #4f9b70;
}

.online-feedback-assignment-card.risk-border-medium {
    border-left-color: #c39b18;
}

.online-feedback-assignment-card.risk-border-high {
    border-left-color: #c4534f;
}

.online-feedback-assignment-head,
.online-feedback-time-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    align-items: center;
    justify-content: space-between;
}

.online-feedback-time-grid {
    justify-content: flex-start;
    margin: 8px 0 12px;
}

.online-feedback-comment,
.online-feedback-remediation-copy {
    padding: 12px 0;
    border-bottom: 1px solid #e0e7e9;
}

.online-feedback-comment:last-child,
.online-feedback-remediation-copy:last-child {
    border-bottom: 0;
}

.online-feedback-optional-plan summary,
.online-feedback-manual-send summary,
.online-feedback-transfer summary {
    cursor: pointer;
    color: #1a596b;
    font-weight: 700;
}

.online-feedback-risk-metrics .risk-low-card {
    border-top-color: #4f9b70;
}

.online-feedback-risk-metrics .risk-medium-card {
    border-top-color: #c39b18;
}

.online-feedback-risk-metrics .risk-high-card {
    border-top-color: #c4534f;
}

@media (max-width: 900px) {
    .online-feedback-department-grid,
    .online-feedback-permission-forms,
    .permission-explainer-grid,
    .online-feedback-send-bar {
        grid-template-columns: 1fr;
    }

    .online-feedback-timeline {
        overflow-x: auto;
    }

    .online-feedback-timeline ol {
        min-width: 720px;
    }

    .online-feedback-detail-head {
        align-items: flex-start;
    }
}

/* Batch record management */
.batch-record-tabs {
    display: flex;
    gap: 4px;
    align-items: center;
    margin: 0 0 16px;
    padding: 4px;
    overflow-x: auto;
    border: 1px solid #cfdbdf;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.78);
}

.batch-record-tabs a {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 4px;
    color: #37535d;
    font-weight: 700;
    text-decoration: none;
}

.batch-record-tabs a:hover,
.batch-record-tabs a.active {
    background: #e4f1f3;
    color: #0d6678;
}

.batch-record-filter-grid {
    grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(130px, 0.8fr)) repeat(2, minmax(145px, 0.9fr)) auto;
}

.batch-record-list-table .batch-record-select-column {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    text-align: center;
}

.batch-record-list-table .batch-record-product-column {
    min-width: 210px;
    max-width: 330px;
}

.batch-record-list-table .batch-record-model-column,
.batch-record-list-table .batch-record-order-column {
    min-width: 120px;
    max-width: 210px;
}

.batch-record-change-flag {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid #d05454;
    border-radius: 4px;
    background: #fff2f1;
    color: #a92828;
    font-size: 13px;
    font-weight: 800;
}

.batch-record-quick-control {
    display: inline-flex;
    margin: 0;
}

.batch-record-control-toggle {
    min-height: 0;
    padding: 4px 8px;
    border: 1px solid currentColor;
    box-shadow: none;
    cursor: pointer;
    font: inherit;
    line-height: 1.2;
}

.batch-record-control-toggle:hover,
.batch-record-control-toggle:focus-visible {
    outline: 2px solid rgba(23, 107, 123, 0.22);
    outline-offset: 2px;
    filter: brightness(0.97);
}

.batch-record-status-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    color: #586c74;
}

.batch-record-detail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.batch-record-detail-grid .detail-item {
    min-width: 0;
}

.batch-record-detail-grid .detail-item strong {
    overflow-wrap: anywhere;
}

.batch-record-raw-value {
    margin-top: 12px;
    padding: 10px 12px;
    border-top: 1px solid #d8e1e4;
}

.batch-record-raw-value summary {
    color: #176b7b;
    cursor: pointer;
    font-weight: 700;
}

.batch-record-issue-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.75fr);
    gap: 16px;
    align-items: start;
}

.batch-record-pending-wrap {
    overflow: hidden;
}

.batch-record-pending-table {
    width: 100%;
    table-layout: fixed;
}

.batch-record-pending-table th,
.batch-record-pending-table td {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.batch-record-pending-table th:nth-child(1) { width: 17%; }
.batch-record-pending-table th:nth-child(2) { width: 16%; }
.batch-record-pending-table th:nth-child(3) { width: auto; }
.batch-record-pending-table th:nth-child(4) { width: 310px; }

.batch-record-pending-key,
.batch-record-pending-type,
.batch-record-pending-message {
    min-width: 0;
}

.batch-record-pending-key strong,
.batch-record-pending-key small,
.batch-record-pending-type strong,
.batch-record-pending-type small,
.batch-record-pending-message strong {
    display: block;
}

.batch-record-pending-key small,
.batch-record-pending-type small {
    margin-top: 5px;
    color: #6b7d84;
    font-size: 12px;
}

.batch-record-pending-message strong {
    color: #233f49;
}

.batch-record-pending-message p {
    margin: 5px 0 0;
    color: #536a73;
}

.batch-record-pending-action {
    width: 310px;
}

.batch-record-pending-detail {
    display: inline-flex;
    margin-bottom: 7px;
    font-weight: 700;
}

.batch-record-review-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    margin: 0;
}

.batch-record-review-form input,
.batch-record-review-form button {
    width: 100%;
    min-width: 0;
}

.batch-record-review-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.batch-record-review-actions button.secondary {
    border-color: #9fb4bc;
    background: #ffffff;
    color: #355a66;
}

.batch-record-review-actions button.secondary:hover,
.batch-record-review-actions button.secondary:focus-visible {
    background: #eef4f5;
    color: #183f4c;
}

.batch-record-review-actions button {
    white-space: nowrap;
}

.batch-record-confirm-import,
.batch-record-batch-control {
    margin-top: 16px;
}

.batch-record-trace-panel .table-wrap {
    margin-top: 14px;
}

.batch-record-release-list th:nth-child(5),
.batch-record-release-list td:nth-child(5) {
    min-width: 210px;
    max-width: 320px;
}

.batch-record-empty-link {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 52px;
    border-top: 1px solid #d8e1e4;
}

.batch-record-empty-link p {
    margin: 0;
}

.batch-record-issue-section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #d8e1e4;
}

.batch-record-issue-list {
    display: grid;
    gap: 8px;
}

.batch-record-issue-list article {
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 10px 12px;
    border-left: 3px solid #d05454;
    background: #fff9f7;
}

.batch-record-issue-list p {
    margin: 4px 0;
}

.batch-record-issue-form {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) minmax(160px, 0.8fr) auto;
    gap: 10px;
    align-items: end;
    margin-top: 12px;
}

.batch-record-product-panel .metric-grid {
    margin-bottom: 14px;
}

.batch-record-manual-form {
    display: grid;
    gap: 18px;
}

.batch-record-form-section {
    padding-top: 14px;
    border-top: 1px solid #d8e1e4;
}

.batch-record-form-section h3 {
    margin: 0 0 12px;
    color: #203d47;
    font-size: 15px;
}

.batch-record-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.batch-record-form-grid label {
    min-width: 0;
}

.batch-record-form-grid input,
.batch-record-form-grid select,
.batch-record-form-grid textarea {
    width: 100%;
    min-width: 0;
}

.batch-record-form-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.batch-record-form-grid .span-2 {
    grid-column: 1 / -1;
}

.batch-record-manual-issue-section {
    padding: 14px;
    border: 1px solid #d5e1e4;
    border-left: 3px solid #2f8292;
    background: #f7fafb;
}

.batch-record-manual-issue-section > p {
    margin: -5px 0 12px;
    color: #60757d;
    font-size: 13px;
}

.batch-record-manual-form .required {
    color: #b63131;
}

.batch-record-manual-form .form-actions {
    justify-content: flex-start;
    align-items: center;
}

.batch-record-manual-form .form-actions span {
    color: #60727a;
    font-size: 13px;
}

.batch-record-manual-actions {
    flex-wrap: wrap;
}

.batch-record-product-names .flash {
    margin-bottom: 12px;
}

@media (max-width: 1180px) {
    .batch-record-filter-grid,
    .batch-record-detail-grid,
    .batch-record-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .batch-record-issue-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .batch-record-tabs {
        margin-right: -12px;
        margin-left: -12px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .batch-record-filter-grid,
    .batch-record-detail-grid,
    .batch-record-issue-form,
    .batch-record-form-grid {
        grid-template-columns: 1fr;
    }

    .batch-record-pending-table {
        width: 780px;
        min-width: 780px;
    }

    .batch-record-pending-table th:nth-child(1) { width: 140px; }
    .batch-record-pending-table th:nth-child(2) { width: 130px; }
    .batch-record-pending-table th:nth-child(3) { width: 240px; }
    .batch-record-pending-table th:nth-child(4) { width: 270px; }

    .batch-record-pending-action {
        width: 270px;
    }

    .batch-record-review-actions {
        grid-template-columns: repeat(2, minmax(88px, 1fr));
        max-width: 220px;
    }
}

/* Controlled-document version review */
.document-compare-shell {
    margin-bottom: 16px;
}

.document-compare-picker {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 32px minmax(240px, 1fr) auto;
    align-items: end;
    margin: 16px 0;
}

.document-compare-arrow {
    align-self: center;
    color: #287e8f;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
}

.document-compare-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.document-compare-metrics .metric-card {
    min-height: 104px;
}

.document-compare-metrics .metric-card small {
    display: block;
    overflow: hidden;
    margin-top: 5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-compare-metrics .is-positive {
    border-top-color: #2f8f68;
}

.document-compare-metrics .is-negative {
    border-top-color: #c6534d;
}

.document-compare-viewers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.document-compare-pane {
    overflow: hidden;
    min-width: 0;
    border: 1px solid #cbd8df;
    border-radius: 6px;
    background: #edf3f5;
}

.document-compare-pane > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 10px 14px;
    border-bottom: 1px solid #cbd8df;
    background: #fff;
}

.document-compare-pane > header div,
.document-compare-pane > header span,
.document-compare-pane > header strong {
    display: block;
}

.document-compare-pane > header span,
.document-compare-pane > header small {
    color: #62767e;
    font-size: 12px;
}

.document-compare-pane > header strong {
    margin-top: 2px;
    color: #16333c;
    font-size: 16px;
}

.document-compare-pane.is-old {
    border-top: 3px solid #83959c;
}

.document-compare-pane.is-new {
    border-top: 3px solid #287e8f;
}

.document-compare-pane iframe,
.document-compare-preview-empty {
    display: block;
    width: 100%;
    height: clamp(520px, 64vh, 880px);
    border: 0;
    background: #fff;
}

.document-compare-preview-empty {
    box-sizing: border-box;
    padding: 42px 24px;
    color: #62767e;
    text-align: center;
}

.document-compare-preview-empty strong {
    display: block;
    margin-bottom: 8px;
    color: #16333c;
}

.document-compare-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(340px, 0.7fr);
    gap: 16px;
    align-items: start;
}

.document-diff-panel,
.document-annotation-panel {
    margin: 0;
}

.document-diff-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    color: #5d7078;
    font-size: 12px;
}

.document-diff-legend span {
    padding: 4px 8px;
    border: 1px solid #d7e0e4;
    border-radius: 4px;
    background: #fff;
}

.document-diff-legend .is-added {
    border-color: #8fc8ac;
    background: #e7f5ed;
    color: #176242;
}

.document-diff-legend .is-deleted {
    border-color: #e0aaa5;
    background: #fae9e7;
    color: #92362f;
    text-decoration: line-through;
}

.document-diff-legend small {
    margin-left: auto;
}

.document-diff-content {
    max-height: 660px;
    overflow: auto;
    padding: 22px;
    border: 1px solid #d4dfe4;
    border-radius: 6px;
    background: #fff;
    color: #23373f;
    font-size: 14px;
    line-height: 2;
}

.document-diff-block {
    margin-right: 5px;
    padding: 2px 1px;
    border-radius: 2px;
}

.document-diff-block.is-added {
    background: #dff3e8;
    color: #145f40;
    box-shadow: inset 0 -2px 0 #58a880;
}

.document-diff-block.is-deleted {
    background: #f9e4e2;
    color: #983c35;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.document-annotation-form {
    padding-bottom: 16px;
    border-bottom: 1px solid #d7e1e5;
}

.document-annotation-form .form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
}

.document-annotation-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.document-annotation-item {
    padding: 12px;
    border: 1px solid #d6e0e4;
    border-left: 3px solid #d49332;
    border-radius: 5px;
    background: #fff;
}

.document-annotation-item.is-resolved {
    border-left-color: #3b926c;
    background: #f7fbf9;
}

.document-annotation-item header,
.document-annotation-item footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.document-annotation-item blockquote {
    margin: 10px 0;
    padding: 8px 10px;
    border-left: 2px solid #8baab4;
    background: #f1f6f7;
    color: #52676f;
    font-size: 12px;
}

.document-annotation-item p {
    margin: 10px 0;
    line-height: 1.65;
}

.document-annotation-item footer {
    color: #718189;
    font-size: 12px;
}

/* External AI connection center */
.ai-center-hero,
.ai-center-grid,
.ai-connection-list {
    margin-bottom: 16px;
}

.ai-boundary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.ai-boundary-grid > div {
    min-height: 82px;
    padding: 12px;
    border: 1px solid #d3dfe4;
    border-radius: 6px;
    background: #f7fafb;
}

.ai-boundary-grid strong,
.ai-boundary-grid span {
    display: block;
}

.ai-boundary-grid strong {
    margin-bottom: 5px;
    color: #205d6a;
}

.ai-boundary-grid span {
    color: #64767d;
    font-size: 12px;
    line-height: 1.6;
}

.ai-center-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.ai-center-grid > .panel {
    margin: 0;
}

.compact-fieldset {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid #d2dde2;
    border-radius: 5px;
}

.compact-fieldset legend {
    padding: 0 6px;
    color: #566b73;
    font-size: 12px;
}

.compact-fieldset label,
.toggle-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 7px;
}

.compact-fieldset input,
.toggle-row input {
    width: auto;
}

.ai-trial-result {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #a9cfc0;
    border-radius: 6px;
    background: #f1faf6;
}

.ai-trial-result > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ai-trial-result pre {
    overflow: auto;
    max-height: 420px;
    margin: 12px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    font: inherit;
    line-height: 1.7;
}

.ai-connection-list code {
    overflow-wrap: anywhere;
    color: #355861;
}

.ai-connection-list td small {
    display: block;
    margin-top: 4px;
    color: #73848b;
}

.ai-job-summary {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1080px) {
    .document-compare-metrics,
    .ai-boundary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .document-compare-lower-grid,
    .ai-center-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .document-compare-picker,
    .document-compare-viewers,
    .document-compare-metrics,
    .ai-boundary-grid {
        grid-template-columns: 1fr;
    }

    .document-compare-arrow {
        transform: rotate(90deg);
    }

    .document-compare-pane iframe,
    .document-compare-preview-empty {
        height: 62vh;
        min-height: 430px;
    }

    .document-annotation-form .form-row {
        grid-template-columns: 1fr;
    }

    .document-diff-content {
        max-height: 520px;
        padding: 14px;
    }
}

/* Artwork control: one controlled folder per material version. */
.artwork-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 14px;
    padding: 4px;
    overflow-x: auto;
    border: 1px solid #cbd8dd;
    border-radius: 6px;
    background: #eef3f5;
}

.artwork-tabs a {
    min-width: max-content;
    padding: 8px 14px;
    border-radius: 4px;
    color: #35515c;
    font-weight: 700;
    text-decoration: none;
}

.artwork-tabs a.active {
    background: #fff;
    color: #0f6879;
    box-shadow: 0 1px 3px rgba(20, 45, 54, 0.14);
}

.artwork-list-table td small,
.artwork-validation-label {
    display: block;
    margin-top: 3px;
    color: #6a7f87;
}

.artwork-pending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 12px;
}

.artwork-pending-card {
    margin: 0;
    border-top: 3px solid #d49a31;
}

.artwork-pending-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.artwork-pending-card h3 {
    margin: 8px 0 3px;
    font-size: 18px;
}

.artwork-pending-card p,
.artwork-pending-card time {
    color: #657981;
    overflow-wrap: anywhere;
}

.artwork-pending-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 14px 0;
    background: #d9e2e5;
}

.artwork-pending-card dl div {
    padding: 10px;
    background: #f7f9fa;
}

.artwork-pending-card dt {
    color: #687c84;
    font-size: 12px;
}

.artwork-pending-card dd {
    margin: 4px 0 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.artwork-upload-panel {
    max-width: 1120px;
}

.artwork-upload-choices {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.artwork-upload-choice {
    display: grid;
    gap: 8px;
    align-content: start;
    min-height: 150px;
    padding: 18px;
    border: 1px dashed #8daab4;
    border-radius: 6px;
    background: #f6f9fa;
}

.artwork-upload-choice strong {
    color: #173d49;
    font-size: 16px;
}

.artwork-upload-choice span {
    min-height: 38px;
    color: #627780;
}

.artwork-upload-choice input[type="file"] {
    align-self: end;
    width: 100%;
}

.artwork-upload-or {
    align-self: center;
    color: #73878e;
    font-weight: 700;
}

.artwork-detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-left: 4px solid #237e91;
}

.artwork-detail-hero h2 {
    margin: 8px 0 2px;
    font-size: clamp(22px, 2vw, 30px);
    letter-spacing: 0;
}

.artwork-detail-hero p {
    margin: 0;
    color: #5c7179;
    overflow-wrap: anywhere;
}

.artwork-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1px;
    padding: 0;
    overflow: hidden;
    background: #d8e2e5;
}

.artwork-summary-grid > div {
    min-width: 0;
    padding: 14px;
    background: #fff;
}

.artwork-summary-grid span,
.artwork-summary-grid strong {
    display: block;
}

.artwork-summary-grid span {
    color: #6a7d85;
    font-size: 12px;
}

.artwork-summary-grid strong {
    margin-top: 6px;
    overflow-wrap: anywhere;
}

.artwork-confirm-panel {
    border-top: 3px solid #d49a31;
}

.artwork-diff-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0;
}

.artwork-diff-summary > div {
    padding: 12px;
    border: 1px solid #d6e0e3;
    border-radius: 4px;
    background: #f7f9fa;
}

.artwork-diff-summary span,
.artwork-diff-summary strong {
    display: block;
}

.artwork-diff-summary strong {
    margin-top: 3px;
    color: #163e49;
    font-size: 24px;
}

.artwork-diff-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.artwork-diff-details details {
    padding: 10px;
    border: 1px solid #d6e0e3;
    border-radius: 4px;
}

.artwork-diff-details ul {
    max-height: 190px;
    margin: 8px 0 0;
    padding-left: 20px;
    overflow: auto;
}

.artwork-diff-details li {
    margin: 4px 0;
    overflow-wrap: anywhere;
}

.artwork-code-exception {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 520px;
    margin: 0 0 10px;
    padding: 9px 11px;
    border: 1px solid #dfb4b4;
    border-radius: 4px;
    background: #fff5f5;
    color: #8a2f2f;
}

.artwork-code-exception input {
    width: 18px;
    min-width: 18px;
    height: 18px;
}

.artwork-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.artwork-preview-card {
    min-width: 0;
    border: 1px solid #d3dee2;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
}

.artwork-preview-card a {
    display: grid;
    grid-template-rows: 150px auto auto;
    color: inherit;
    text-decoration: none;
}

.artwork-preview-card img,
.artwork-pdf-preview {
    width: 100%;
    height: 150px;
    object-fit: contain;
    background: #eef3f5;
}

.artwork-pdf-preview {
    display: grid;
    place-items: center;
    color: #a63e3e;
    font-size: 28px;
    font-weight: 800;
}

.artwork-preview-card strong,
.artwork-preview-card small {
    padding: 8px 10px 0;
    overflow-wrap: anywhere;
}

.artwork-preview-card small {
    padding-top: 3px;
    padding-bottom: 10px;
    color: #687d85;
}

.artwork-history-list {
    display: grid;
    gap: 6px;
}

.artwork-history-list a {
    display: grid;
    grid-template-columns: minmax(150px, 0.7fr) minmax(90px, 0.3fr) minmax(260px, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #d5dfe2;
    border-radius: 4px;
    color: #183d48;
    text-decoration: none;
}

.artwork-history-list a.active {
    border-color: #2a8598;
    background: #edf7f8;
}

.artwork-history-list a.is-history {
    color: #75858a;
    background: #f4f6f7;
}

.artwork-history-list small {
    overflow-wrap: anywhere;
}

.artwork-trace-list {
    display: grid;
    gap: 7px;
}

.artwork-trace-list > a {
    display: grid;
    grid-template-columns: minmax(150px, 0.35fr) auto minmax(260px, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #d5dfe2;
    border-radius: 4px;
    color: #173d49;
    text-decoration: none;
}

.artwork-trace-list small {
    color: #657a82;
    overflow-wrap: anywhere;
}

.artwork-permission-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.artwork-permission-panel form:first-child {
    flex: 1 1 520px;
}

@media (max-width: 1100px) {
    .artwork-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .artwork-upload-choices,
    .artwork-diff-details {
        grid-template-columns: 1fr;
    }

    .artwork-upload-or {
        justify-self: center;
    }

    .artwork-detail-hero {
        display: grid;
    }

    .artwork-summary-grid,
    .artwork-diff-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .artwork-history-list a {
        grid-template-columns: 1fr auto;
    }

    .artwork-history-list small {
        grid-column: 1 / -1;
    }

    .artwork-trace-list > a {
        grid-template-columns: 1fr auto;
    }

    .artwork-trace-list small {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .artwork-pending-card dl {
        grid-template-columns: 1fr;
    }

    .artwork-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .artwork-diff-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* BOM control center */
.document-bom-entry {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    padding: 12px 14px;
    border: 1px solid #b9d2d8;
    border-left: 3px solid #197d91;
    border-radius: 6px;
    background: #f4fafb;
    color: #173b48;
    text-decoration: none;
}

.document-bom-entry:hover {
    border-color: #78abb7;
    background: #eef7f9;
}

.document-bom-entry-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 4px;
    background: #176f82;
    color: #fff;
    font-weight: 800;
    font-size: 12px;
}

.document-bom-entry > span:nth-child(2) {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.document-bom-entry small {
    color: var(--muted);
}

.bom-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 14px;
    padding: 4px;
    overflow-x: auto;
    border: 1px solid #cbdce1;
    border-radius: 6px;
    background: #edf4f6;
}

.bom-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 4px;
    color: #355763;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.bom-tabs a:hover,
.bom-tabs a.active {
    background: #fff;
    color: #0e6578;
    box-shadow: 0 1px 4px rgba(20, 59, 70, 0.12);
}

.bom-tabs a span {
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    padding: 0 5px;
    border-radius: 10px;
    background: #b4534c;
    color: #fff;
    font-size: 11px;
}

.bom-metric-grid,
.bom-preview-metrics {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.bom-filter-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.bom-list-panel,
.bom-item-panel,
.bom-preview-panel {
    position: relative;
}

.bom-list-table {
    table-layout: fixed;
}

.bom-list-table th,
.bom-list-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.bom-list-table th:nth-last-child(1),
.bom-list-table td:nth-last-child(1) {
    width: 82px;
}

.bom-list-table .qms-col-name {
    width: 18%;
}

.bom-history-row td {
    color: #74868d;
    background: #f5f7f8;
}

.bom-recent-drawer {
    position: fixed;
    z-index: 42;
    right: 0;
    top: 32%;
    width: min(390px, 92vw);
    transform: translateX(calc(100% - 48px));
    border: 1px solid #aac5cc;
    border-right: 0;
    border-radius: 6px 0 0 6px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(20, 48, 58, 0.16);
    transition: transform 180ms ease;
}

.bom-recent-drawer[open] {
    transform: translateX(0);
}

.bom-recent-drawer > summary {
    display: grid;
    position: absolute;
    left: -1px;
    top: -1px;
    width: 48px;
    min-height: 154px;
    place-items: center;
    padding: 10px 8px;
    border: 1px solid #7eabb6;
    border-radius: 6px 0 0 6px;
    background: #176f82;
    color: #fff;
    font-weight: 700;
    text-align: center;
    writing-mode: vertical-rl;
    cursor: pointer;
    list-style: none;
}

.bom-recent-drawer > summary::-webkit-details-marker {
    display: none;
}

.bom-recent-drawer > div {
    min-height: 154px;
    max-height: 58vh;
    margin-left: 48px;
    padding: 15px;
    overflow-y: auto;
}

.bom-recent-drawer h3,
.bom-recent-drawer p {
    margin-top: 0;
}

.bom-recent-drawer > div > a {
    display: grid;
    gap: 2px;
    padding: 9px 0;
    border-top: 1px solid #e0e8eb;
    color: #1e4857;
    text-decoration: none;
}

.bom-recent-drawer small,
.bom-recent-drawer p {
    color: var(--muted);
}

.bom-detail-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
    padding: 18px 20px;
    border: 1px solid #bfd3d9;
    border-top: 3px solid #197d91;
    border-radius: 6px;
    background: #fff;
}

.bom-detail-title {
    display: grid;
    gap: 5px;
    margin-top: 12px;
}

.bom-detail-title > span {
    color: #19758a;
    font-weight: 800;
}

.bom-detail-title h2,
.bom-detail-title p {
    margin: 0;
}

.bom-promote-form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.bom-promote-form label,
.bom-promote-form input {
    width: 88px;
    margin: 0;
}

.bom-promote-form input,
.bom-promote-form button {
    min-height: 36px;
}

.bom-header-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    border-top: 1px solid #d6e2e6;
    border-left: 1px solid #d6e2e6;
}

.bom-header-grid > div {
    min-width: 0;
    min-height: 78px;
    padding: 11px 12px;
    border-right: 1px solid #d6e2e6;
    border-bottom: 1px solid #d6e2e6;
}

.bom-header-grid dt {
    margin-bottom: 5px;
    color: #687f88;
    font-size: 12px;
}

.bom-header-grid dd {
    margin: 0;
    color: #183a47;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.bom-version-timeline {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.bom-version-timeline a {
    display: grid;
    flex: 0 0 150px;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #cbd9dd;
    border-radius: 5px;
    color: #244b59;
    background: #fff;
    text-decoration: none;
}

.bom-version-timeline a.active {
    border-color: #3b91a3;
    background: #edf8fa;
}

.bom-version-timeline a.is-history {
    color: #72838a;
    background: #f4f6f7;
}

.bom-import-rules .bom-rule-grid,
.bom-material-summary,
.bom-conflict-compare {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.bom-rule-grid > div,
.bom-material-summary > div,
.bom-conflict-compare > div {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border: 1px solid #d2e0e4;
    border-radius: 5px;
    background: #f7fafb;
}

.bom-rule-grid span,
.bom-material-summary small,
.bom-conflict-compare span,
.bom-conflict-compare small {
    color: var(--muted);
}

.bom-message {
    margin: 5px 0;
    color: #687b83;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.bom-message.is-warning {
    color: #98620b;
}

.bom-message.is-error {
    color: #b03d3d;
}

.bom-confirm-import {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 14px;
}

.bom-issue-list {
    display: grid;
    gap: 12px;
}

.bom-issue-card {
    margin: 0;
}

.bom-issue-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.bom-issue-head h3,
.bom-issue-head p {
    margin: 7px 0 0;
}

.bom-issue-head time {
    color: var(--muted);
    white-space: nowrap;
}

.bom-issue-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 10px;
    margin-top: 12px;
}

.bom-permission-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.bom-permission-grid label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 8px;
    min-width: 0;
    padding: 12px;
    border: 1px solid #cfdee2;
    border-radius: 5px;
    background: #f8fbfc;
}

.bom-permission-grid label input {
    grid-row: 1 / span 2;
    width: 18px;
    height: 18px;
}

.bom-permission-grid label span {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
    .bom-filter-grid,
    .bom-metric-grid,
    .bom-preview-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bom-permission-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .document-bom-entry {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .document-bom-entry > span:last-child {
        display: none;
    }

    .bom-filter-grid,
    .bom-header-grid,
    .bom-import-rules .bom-rule-grid,
    .bom-material-summary,
    .bom-conflict-compare,
    .bom-permission-grid,
    .bom-issue-form {
        grid-template-columns: 1fr;
    }

    .bom-metric-grid,
    .bom-preview-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bom-detail-hero,
    .bom-issue-head,
    .bom-confirm-import {
        align-items: stretch;
        flex-direction: column;
    }

    .bom-promote-form,
    .bom-promote-form label,
    .bom-promote-form input,
    .bom-promote-form button {
        width: 100%;
    }

    .bom-recent-drawer {
        top: auto;
        bottom: 76px;
    }

    .bom-list-table {
        table-layout: auto;
    }
}

/* Editable tables are working surfaces, not read-only data grids. */
.data-table.qms-edit-table {
    width: 100%;
    min-width: var(--qms-edit-compact-min-width, 720px);
    table-layout: fixed;
}

.data-table.qms-edit-table.qms-wide-table {
    width: 100%;
    min-width: var(--qms-edit-min-width, 980px);
    table-layout: fixed;
}

.data-table.qms-edit-table th,
.data-table.qms-edit-table td,
.data-table.qms-edit-table.qms-wide-table th,
.data-table.qms-edit-table.qms-wide-table td {
    min-width: 0;
    max-width: none;
    height: auto;
    padding: 8px;
    vertical-align: top;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
}

.data-table.qms-edit-table th {
    vertical-align: middle;
}

.data-table.qms-edit-table input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]),
.data-table.qms-edit-table select,
.data-table.qms-edit-table textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
}

.data-table.qms-edit-table input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]),
.data-table.qms-edit-table select {
    min-height: 38px;
}

.data-table.qms-edit-table textarea {
    min-height: 64px;
    line-height: 1.45;
    resize: vertical;
}

.data-table.qms-edit-table td > :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]), select, textarea) + :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]), select, textarea) {
    margin-top: 6px;
}

.data-table.qms-edit-table [class*="qms-col-"] {
    min-width: 0;
    max-width: none;
}

.data-table.qms-edit-table.qms-wide-table .qms-key-column {
    position: static;
    left: auto;
    box-shadow: none;
}

.data-table.qms-edit-table.qms-wide-table .qms-col-actions {
    right: 0;
    width: 88px;
    min-width: 0;
    max-width: none;
    padding-left: 6px;
    padding-right: 6px;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
}

.data-table.change-action-edit-table {
    --qms-edit-min-width: 1080px;
}

.change-action-edit-table th:nth-child(1) { width: 12%; }
.change-action-edit-table th:nth-child(2) { width: 10%; }
.change-action-edit-table th:nth-child(3) { width: 11%; }
.change-action-edit-table th:nth-child(4) { width: 10%; }
.change-action-edit-table th:nth-child(5) { width: 17%; }
.change-action-edit-table th:nth-child(6) { width: 11%; }
.change-action-edit-table th:nth-child(7) { width: 23%; }
.change-action-edit-table th:nth-child(8) { width: 6%; }

.data-table.quality-action-edit-table {
    --qms-edit-min-width: 1160px;
}

.quality-action-edit-table th:nth-child(1) { width: 13%; }
.quality-action-edit-table th:nth-child(2) { width: 10%; }
.quality-action-edit-table th:nth-child(3) { width: 10%; }
.quality-action-edit-table th:nth-child(4) { width: 9%; }
.quality-action-edit-table th:nth-child(5) { width: 15%; }
.quality-action-edit-table th:nth-child(6) { width: 10%; }
.quality-action-edit-table th:nth-child(7) { width: 12%; }
.quality-action-edit-table th:nth-child(8) { width: 15%; }
.quality-action-edit-table th:nth-child(9) { width: 6%; }

@media (max-width: 720px) {
    .data-table.qms-edit-table,
    .data-table.qms-edit-table.qms-wide-table {
        min-width: var(--qms-edit-mobile-min-width, var(--qms-edit-min-width, 980px));
    }
}

/* 2026-07 data-density pass: semantic widths, clearer hierarchy and quieter motion. */
:root {
    --accent-warm: #b86f2a;
    --accent-warm-soft: #fff3e4;
    --accent-green: #2d8064;
    --accent-green-soft: #e9f5ef;
    --accent-red: #b64d4d;
    --accent-red-soft: #fff0ef;
}

.module-head,
.command-section-head,
.dashboard-domain-head {
    position: relative;
}

.module-head::before,
.dashboard-domain-head::before {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: -14px;
    width: 3px;
    border-radius: 2px;
    background: var(--accent);
    content: "";
}

.panel,
.metric-card,
.command-kpi {
    box-shadow: 0 1px 2px rgba(21, 38, 47, 0.045), 0 8px 22px rgba(21, 38, 47, 0.035);
}

.metric-card,
.command-kpi {
    position: relative;
    overflow: hidden;
}

.metric-card::after,
.command-kpi::after {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    content: "";
    opacity: 0.62;
}

.metric-card.is-alert::after,
.command-kpi:has(.danger-value)::after {
    background: var(--accent-red);
}

.command-kpi:has(.warning-value)::after {
    background: var(--accent-warm);
}

.metric-card:hover,
.command-kpi:hover {
    border-color: #b9cbd1;
    box-shadow: 0 8px 24px rgba(21, 38, 47, 0.08);
    transform: translateY(-1px);
}

.dashboard-chart-panel {
    border-top: 2px solid #dcebed;
}

.dashboard-chart-panel .chart-legend i,
.dashboard-chart-legend i {
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(36, 93, 112, 0.12);
}

.data-table .qms-col-code,
.data-table .qms-col-batch {
    width: var(--qms-col-width, 116px);
    min-width: var(--qms-col-min-width, 104px);
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
    font-variant-numeric: tabular-nums;
}

.data-table .qms-col-name {
    width: var(--qms-col-width, 184px);
    min-width: var(--qms-col-min-width, 150px);
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.5;
}

.data-table .qms-col-compact,
.data-table .qms-col-date,
.data-table .qms-col-number,
.data-table .qms-col-status,
.data-table .qms-col-owner,
.data-table .qms-col-person,
.data-table .qms-col-copy,
.data-table .qms-col-actions {
    width: var(--qms-col-width);
    min-width: var(--qms-col-min-width);
}

.data-table.qms-wide-table .qms-col-date,
.data-table.qms-wide-table .qms-col-number,
.data-table.qms-wide-table .qms-col-status {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
}

.data-table.qms-wide-table .qms-col-owner,
.data-table.qms-wide-table .qms-col-person,
.data-table.qms-wide-table .qms-col-name,
.data-table.qms-wide-table .qms-col-copy {
    overflow-wrap: break-word;
    word-break: normal;
}

.data-table.qms-wide-table.qms-adaptive-list.qms-fit-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.data-table.qms-wide-table.qms-adaptive-list.qms-fit-table th,
.data-table.qms-wide-table.qms-adaptive-list.qms-fit-table td {
    width: var(--qms-col-width, auto);
    min-width: 0;
    max-width: none;
    height: 48px;
    padding: 8px 8px;
}

.data-table.qms-wide-table.qms-adaptive-list.qms-fit-table .qms-col-code,
.data-table.qms-wide-table.qms-adaptive-list.qms-fit-table .qms-col-batch,
.data-table.qms-wide-table.qms-adaptive-list.qms-fit-table .qms-col-date,
.data-table.qms-wide-table.qms-adaptive-list.qms-fit-table .qms-col-number,
.data-table.qms-wide-table.qms-adaptive-list.qms-fit-table .qms-col-status {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table.qms-wide-table.qms-adaptive-list.qms-fit-table .qms-col-actions,
.data-table.qms-wide-table.qms-adaptive-list.qms-fit-table .qms-key-column {
    position: static;
    box-shadow: none;
}

.data-table.qms-wide-table.qms-adaptive-list:not(.qms-fit-table) .qms-key-column {
    position: sticky;
}

.data-table.qms-wide-table.qms-adaptive-list:not(.qms-fit-table) .qms-col-actions {
    position: sticky;
}

.data-table.qms-wide-table td {
    text-wrap: pretty;
}

.data-table.qms-wide-table td.qms-col-code,
.data-table.qms-wide-table td.qms-col-batch,
.data-table.qms-wide-table td.qms-col-date {
    text-wrap: nowrap;
}

.qms-table-scroll-host.has-overflow {
    scrollbar-gutter: stable;
}

.qms-table-scroll-host.has-overflow::after {
    position: sticky;
    right: 8px;
    bottom: 8px;
    z-index: 8;
    display: block;
    width: max-content;
    margin: -28px 8px 8px auto;
    padding: 3px 8px;
    border: 1px solid #c9d8dd;
    border-radius: 4px;
    color: #4d626b;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
    content: "横向滑动查看更多";
    font-size: 11px;
    opacity: 0.88;
    pointer-events: none;
}

.qms-table-scroll-host.is-scrolled-end::after {
    display: none;
}

@media (min-width: 1280px) {
    .data-table.qms-wide-table.qms-adaptive-list:not(.qms-fit-table) {
        width: max(100%, var(--qms-table-min-width, 940px));
        min-width: var(--qms-table-min-width, 940px);
        table-layout: auto;
    }

    .data-table.qms-wide-table.qms-adaptive-list:not(.qms-fit-table) th,
    .data-table.qms-wide-table.qms-adaptive-list:not(.qms-fit-table) td {
        width: var(--qms-col-width, auto);
        min-width: var(--qms-col-min-width, 88px);
        max-width: none;
        padding: 9px 10px;
    }

    .data-table.qms-wide-table.qms-adaptive-list:not(.qms-fit-table) .qms-key-column {
        left: 0;
    }

    .data-table.qms-wide-table.qms-adaptive-list:not(.qms-fit-table) .qms-col-actions {
        right: 0;
        width: var(--qms-col-width, 116px);
        min-width: var(--qms-col-min-width, 96px);
    }
}

@media (max-width: 760px) {
    .module-tabs,
    .module-actions {
        scrollbar-width: none;
    }

    .module-tabs::-webkit-scrollbar,
    .module-actions::-webkit-scrollbar {
        display: none;
    }

    .dashboard-svg-wrap {
        border-radius: 4px;
        background:
            linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(47, 120, 144, 0.06) 100%);
    }

    .qms-table-scroll-host.has-overflow::after {
        content: "左右滑动";
    }
}

/* Super-admin analysis report workspace */
.analysis-report-head {
    align-items: end;
    padding: 4px 2px 2px;
}

.analysis-report-head .section-kicker {
    color: var(--accent);
}

.analysis-report-export {
    min-width: 148px;
    background: var(--accent);
    box-shadow: 0 8px 18px rgba(47, 120, 144, 0.18);
}

.analysis-report-export:hover {
    background: var(--accent-strong);
    transform: translateY(-1px);
}

.report-scope-panel {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 18px;
}

.report-scope-form {
    flex: 0 1 520px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.report-scope-meta {
    display: grid;
    gap: 2px;
    min-width: 260px;
    text-align: right;
}

.report-scope-meta span,
.report-scope-meta small {
    color: var(--muted);
    font-size: 12px;
}

.report-scope-meta strong {
    color: #254551;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.report-preview-kpis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.report-outline-panel {
    padding: 18px;
}

.report-slide-count {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 10px;
    border: 1px solid #c6d9de;
    border-radius: 4px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    font-size: 12px;
    font-weight: 750;
}

.report-outline-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--line);
}

.report-outline-grid article {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    min-height: 94px;
    padding: 17px;
    background: #fff;
}

.report-outline-grid article > span {
    color: #88a0a9;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.report-outline-grid strong {
    color: #203d48;
}

.report-outline-grid p {
    margin: 5px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.report-method-panel {
    border-top: 2px solid #dcebed;
}

.report-method-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-top: 14px;
}

.report-method-grid > div {
    padding-left: 14px;
    border-left: 2px solid #b9d2d8;
}

.report-method-grid strong {
    color: #294955;
}

.report-method-grid p {
    margin: 5px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.input-with-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 6px;
    align-items: center;
}

.input-with-action .qms-icon-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid #c7d3d9;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: none;
    color: var(--accent-strong);
    font-size: 20px;
    line-height: 1;
}

.input-with-action .qms-icon-button:hover {
    border-color: #8eabb6;
    background: #edf5f6;
    box-shadow: none;
    color: #173f4c;
    transform: none;
}

.qms-field-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.qms-info-tip {
    --qms-tip-shift: 0px;
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    vertical-align: middle;
}

button.qms-info-tip-trigger {
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
    border: 1px solid #8ea9b3;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: none;
    color: #376471;
    font-family: Georgia, serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
}

button.qms-info-tip-trigger:hover,
button.qms-info-tip-trigger:active {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: none;
    color: var(--accent-strong);
    transform: none;
}

.qms-info-tip-panel {
    position: absolute;
    z-index: 120;
    top: calc(100% + 8px);
    left: 50%;
    width: max-content;
    max-width: min(320px, calc(100vw - 24px));
    padding: 9px 11px;
    border: 1px solid #b8cbd2;
    border-radius: 5px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(21, 57, 70, 0.16);
    color: #29434d;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(-50% + var(--qms-tip-shift))) translateY(-3px);
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
    visibility: hidden;
    white-space: normal;
}

.qms-info-tip.is-open .qms-info-tip-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(calc(-50% + var(--qms-tip-shift))) translateY(0);
    visibility: visible;
}

.qms-info-tip:hover .qms-info-tip-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(calc(-50% + var(--qms-tip-shift))) translateY(0);
    visibility: visible;
}

@media (max-width: 700px) {
    .input-with-action {
        grid-template-columns: minmax(0, 1fr) 38px;
    }
}

@media (min-width: 1280px) {
    .metric-grid:has(> .metric-card:nth-child(7)):not(:has(> .metric-card:nth-child(9))) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .metric-grid:has(> .metric-card:nth-child(9)):not(:has(> .metric-card:nth-child(11))) {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .report-preview-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .report-outline-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-method-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .analysis-report-head,
    .report-scope-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .analysis-report-export {
        width: 100%;
    }

    .report-scope-form {
        flex-basis: auto;
        width: 100%;
    }

    .report-scope-meta {
        min-width: 0;
        text-align: left;
    }

    .report-preview-kpis,
    .report-outline-grid,
    .report-method-grid {
        grid-template-columns: 1fr;
    }
}

/* Restricted production photo terminal */
.product-photo-terminal-body {
    background: #f2f6f7;
}

.product-photo-terminal-shell .command-topline,
.product-photo-terminal-shell .topbar,
.product-photo-terminal-shell .content {
    max-width: 980px;
}

.product-photo-terminal-shell .command-topline {
    min-height: 62px;
}

.product-photo-terminal-shell .brand {
    min-width: 0;
}

.product-photo-terminal-account {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}

.product-photo-terminal-account strong {
    color: #ffffff;
    font-size: 14px;
}

.product-photo-terminal-account a {
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #49606a;
    border-radius: 4px;
    color: #e5edef;
}

.product-photo-terminal-account a:hover {
    border-color: #77a8b3;
    background: #263b44;
    color: #ffffff;
}

.product-photo-terminal-shell .topbar {
    min-height: 72px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.product-photo-terminal-shell .content {
    padding-top: 16px;
}

.product-photo-terminal-page {
    max-width: 920px;
    margin: 0 auto;
}

.product-photo-terminal-page .product-photo-upload-panel {
    border-top: 3px solid var(--accent-green);
    border-left-width: 1px;
}

.product-photo-terminal-page .product-photo-upload-form {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 13px;
}

.product-photo-terminal-page .product-photo-selection,
.product-photo-terminal-page .product-photo-submit,
.product-photo-terminal-page .product-photo-upload-form > small {
    grid-column: 1;
    grid-row: auto;
}

.product-photo-terminal-page .product-photo-batch-field input,
.product-photo-terminal-page .product-photo-submit {
    min-height: 54px;
}

.product-photo-terminal-page .product-photo-submit {
    font-size: 16px;
}

.product-photo-terminal-page .product-photo-file-picker {
    min-height: 104px;
}

.product-photo-terminal-page .product-photo-filter-panel .filter-bar {
    align-items: end;
}

.permission-option.is-fixed {
    border-color: #8ebcc5;
    background: #f1f8f9;
    cursor: default;
}

.permission-option.is-fixed::before {
    color: #247287;
    content: "✓";
    font-size: 18px;
    font-weight: 800;
}

@media (max-width: 700px) {
    .product-photo-terminal-shell .command-topline {
        min-height: 56px;
        padding: 8px 14px;
    }

    .product-photo-terminal-shell .brand-title {
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .product-photo-terminal-shell .brand-subtitle {
        display: none;
    }

    .product-photo-terminal-account {
        gap: 8px;
    }

    .product-photo-terminal-account strong {
        display: none;
    }

    .product-photo-terminal-account a {
        min-height: 36px;
        padding: 8px 11px;
    }

    .product-photo-terminal-shell .topbar {
        min-height: 64px;
        padding: 11px 14px;
    }

    .product-photo-terminal-shell .topbar h1 {
        font-size: 20px;
    }

    .product-photo-terminal-shell .content {
        padding: 10px 10px 28px;
    }

    .product-photo-terminal-page .product-photo-upload-panel,
    .product-photo-terminal-page .product-photo-filter-panel,
    .product-photo-terminal-page .product-photo-list-panel {
        padding: 12px;
    }
}

/* 2026-07-30 personal workspace, action hub and unified glass surface */
:root {
    --glass-surface: rgba(255, 255, 255, 0.84);
    --glass-surface-strong: rgba(255, 255, 255, 0.94);
    --glass-line: rgba(178, 197, 204, 0.72);
    --glass-shadow: 0 12px 32px rgba(26, 49, 58, 0.075);
    --nav-height-desktop: 105px;
}

body:not(.login-body):not(.setup-body) {
    background:
        linear-gradient(180deg, #eaf1f2 0, #f5f7f8 42%, #edf1f2 100%);
    background-attachment: fixed;
}

.command-header {
    border-bottom: 1px solid rgba(126, 163, 174, 0.25);
    background: rgba(18, 32, 39, 0.96);
    -webkit-backdrop-filter: blur(16px) saturate(125%);
    backdrop-filter: blur(16px) saturate(125%);
    box-shadow: 0 8px 24px rgba(12, 27, 34, 0.16);
}

.command-topline {
    min-height: 60px;
}

.command-nav-row {
    min-height: 45px;
}

.command-nav-row .nav > a,
.command-nav-row .nav-accordion > summary {
    min-height: 43px;
    padding: 11px 15px;
    font-size: 14px;
    font-weight: 760;
}

.command-nav-row .nav-menu a,
.command-nav-row .nav-group a {
    min-height: 39px;
    padding: 9px 13px;
    font-size: 13px;
}

.topbar {
    background: rgba(248, 250, 251, 0.88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.panel,
.metric-card,
.command-kpi,
.profile-identity-band,
.profile-kpi-grid > div,
.profile-kpi-grid > a,
.notification-summary-grid > a {
    border-color: var(--glass-line);
    background: var(--glass-surface);
    -webkit-backdrop-filter: blur(14px) saturate(125%);
    backdrop-filter: blur(14px) saturate(125%);
    box-shadow: var(--glass-shadow);
}

.panel:hover {
    border-color: rgba(142, 173, 183, 0.78);
}

.status-chip,
.module-chip,
.notification-level-chip,
.record-flag,
.role-badge,
.major-badge {
    border: 1px solid rgba(82, 128, 142, 0.15);
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.status-chip.success-chip {
    border-color: rgba(45, 128, 100, 0.2);
}

.status-chip.warning-chip,
.major-badge {
    border-color: rgba(184, 111, 42, 0.2);
}

.status-chip.danger-chip {
    border-color: rgba(182, 77, 77, 0.2);
}

.row-marked td {
    background: rgba(255, 246, 201, 0.9);
}

.mark-button.is-marked {
    color: #ad6a15;
    font-size: 19px;
    line-height: 1;
}

.profile-workspace {
    display: grid;
    grid-template-columns: minmax(230px, 0.78fr) minmax(620px, 2.9fr) minmax(260px, 0.95fr);
    align-items: start;
    gap: 16px;
}

.profile-workspace.is-employee-detail {
    grid-template-columns: minmax(0, 1fr);
}

.profile-main-column {
    min-width: 0;
}

.profile-side-rail {
    position: sticky;
    top: 122px;
    max-height: calc(100vh - 142px);
    min-width: 0;
    margin-bottom: 0;
    padding: 14px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #9db2ba transparent;
}

.profile-rail-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(192, 207, 212, 0.72);
}

.profile-rail-head h2,
.profile-rail-head p {
    margin: 0;
}

.profile-rail-head h2 {
    font-size: 16px;
}

.profile-rail-head p {
    color: var(--muted);
    font-size: 11px;
}

.profile-rail-head > a,
.profile-rail-more {
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 750;
}

.profile-drawer-close,
.profile-mobile-handles,
.profile-drawer-backdrop {
    display: none;
}

.profile-notification-summary .notification-list {
    gap: 7px;
}

.profile-notification-summary .notification-row {
    padding: 10px;
    border-radius: 5px;
}

.profile-notification-summary .notification-row-title {
    align-items: flex-start;
}

.profile-notification-summary .notification-row-title strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.45;
}

.profile-notification-summary .notification-row p {
    display: -webkit-box;
    margin: 5px 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: 12px;
}

.profile-notification-summary .notification-meta {
    display: grid;
    gap: 2px;
}

.profile-incomplete-list {
    display: grid;
    gap: 8px;
}

.profile-incomplete-item {
    display: grid;
    gap: 7px;
    padding: 11px;
    border: 1px solid #e0d4b7;
    border-left: 3px solid #c88b2d;
    border-radius: 5px;
    background: rgba(255, 250, 239, 0.9);
}

.profile-incomplete-item > div:first-child,
.profile-incomplete-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 7px;
}

.profile-incomplete-item time,
.profile-incomplete-item small {
    color: var(--muted);
    font-size: 11px;
}

.profile-incomplete-item strong {
    color: #5c4c2f;
    font-size: 12px;
    line-height: 1.55;
}

.profile-incomplete-item h3 {
    margin: 0;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.profile-incomplete-item .profile-incomplete-record-no {
    color: var(--ink);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.profile-incomplete-actions {
    justify-content: flex-start;
}

.profile-incomplete-actions form,
.profile-incomplete-documents .table-actions form {
    display: inline-flex;
    margin: 0;
}

.button-link.muted-action {
    color: #78868c;
}

.profile-rail-more {
    display: block;
    margin-top: 12px;
    padding: 9px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.action-plan-view-tabs {
    margin-bottom: 14px;
}

.action-plan-view-tabs a span {
    display: inline-grid;
    min-width: 20px;
    min-height: 20px;
    margin-left: 5px;
    place-items: center;
    padding: 0 5px;
    border-radius: 10px;
    background: #dcebed;
    font-size: 11px;
}

.action-plan-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.action-plan-summary-grid .metric-card.is-warning {
    border-top-color: var(--accent-warm);
    background: rgba(255, 249, 239, 0.88);
}

.action-plan-hub-table td:nth-child(5),
.action-plan-hub-table td:nth-child(6),
.action-plan-hub-table td:nth-child(7) {
    white-space: normal;
    overflow-wrap: anywhere;
}

.action-plan-hub-table .table-subline {
    margin-top: 4px;
}

.qms-floating-table-head {
    position: fixed;
    z-index: 38;
    overflow: hidden;
    border: 1px solid rgba(183, 201, 207, 0.9);
    border-top: 0;
    background: rgba(239, 245, 246, 0.97);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    backdrop-filter: blur(12px) saturate(120%);
    box-shadow: 0 8px 20px rgba(22, 48, 58, 0.12);
    pointer-events: none;
}

.qms-floating-head-table,
.qms-floating-head-table.qms-wide-table,
.qms-floating-head-table.qms-wide-table.qms-adaptive-list {
    width: auto;
    min-width: 0;
    margin: 0;
    table-layout: fixed;
    transform-origin: left top;
}

.qms-floating-head-table th,
.qms-floating-head-table .qms-key-column,
.qms-floating-head-table .qms-col-actions {
    position: static !important;
    height: 42px;
    min-width: 0;
    max-width: none;
    padding: 8px 10px;
    background: rgba(239, 245, 246, 0.98) !important;
    box-shadow: none !important;
}

.qms-floating-head-table .sort-indicator {
    opacity: 0.65;
}

@media (max-width: 1250px) {
    .profile-workspace {
        grid-template-columns: minmax(210px, 0.8fr) minmax(520px, 2.2fr) minmax(230px, 0.9fr);
        gap: 12px;
    }

    .action-plan-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    html,
    body {
        overflow-x: hidden;
    }

    .command-header {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .profile-workspace {
        display: block;
    }

    .profile-mobile-handles {
        position: fixed;
        z-index: 78;
        top: 42%;
        right: 0;
        display: grid;
        gap: 4px;
    }

    .profile-mobile-handles button {
        position: relative;
        display: grid;
        width: 54px;
        min-width: 54px;
        min-height: 44px;
        place-items: center;
        padding: 7px 5px;
        border: 1px solid #9db5bd;
        border-right: 0;
        border-radius: 6px 0 0 6px;
        background: rgba(255, 255, 255, 0.94);
        color: #244d59;
        box-shadow: 0 5px 14px rgba(21, 45, 54, 0.13);
        font-size: 11px;
    }

    .profile-mobile-handles button strong {
        position: absolute;
        top: -6px;
        left: -6px;
        display: grid;
        min-width: 20px;
        min-height: 20px;
        place-items: center;
        padding: 0 4px;
        border-radius: 10px;
        background: #b64d4d;
        color: #fff;
        font-size: 10px;
    }

    .profile-side-rail {
        position: fixed;
        z-index: 82;
        top: 99px;
        bottom: 0;
        width: min(88vw, 370px);
        max-height: none;
        visibility: hidden;
        margin: 0;
        border-radius: 0;
        opacity: 0;
        pointer-events: none;
        transition:
            visibility 0s linear var(--motion-base),
            opacity var(--motion-base) ease,
            transform var(--motion-base) var(--ease-standard);
    }

    .profile-notification-summary {
        left: 0;
        transform: translateX(-102%);
    }

    .profile-incomplete-rail {
        right: 0;
        transform: translateX(102%);
    }

    .profile-side-rail.is-mobile-open {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
        transition-delay: 0s;
    }

    .profile-drawer-close {
        display: grid;
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
        place-items: center;
        padding: 0;
        border: 1px solid #c6d3d8;
        border-radius: 4px;
        background: #fff;
        color: #425b65;
        box-shadow: none;
        font-size: 20px;
    }

    .profile-drawer-backdrop:not([hidden]) {
        position: fixed;
        z-index: 81;
        inset: 99px 0 0;
        display: block;
        width: 100%;
        height: auto;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: rgba(11, 25, 31, 0.46);
        box-shadow: none;
    }

    body.profile-drawer-open {
        overflow: hidden;
    }

    .action-plan-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .profile-mobile-handles {
        top: auto;
        bottom: 88px;
    }

    .profile-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-kpi-grid > div,
    .profile-kpi-grid > a {
        min-height: 84px;
        padding: 12px;
    }

    .profile-kpi-grid strong {
        font-size: 23px;
    }

    .action-plan-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
