:root {
    --navy: #12263f;
    --navy-2: #193653;
    --blue: #1976d2;
    --blue-dark: #0d5fab;
    --ink: #172334;
    --muted: #64748b;
    --line: #dce4ed;
    --surface: #ffffff;
    --canvas: #f3f6f9;
    --success: #168354;
    --danger: #c63e47;
    font-family: "Segoe UI", "Noto Sans TC", Arial, sans-serif;
    color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .btn { cursor: pointer; }

.employee-shell { min-height: 100vh; }
.employee-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 30; width: 264px;
    display: flex; flex-direction: column; color: #fff;
    background: linear-gradient(180deg, var(--navy), #0b1d30);
    box-shadow: 8px 0 30px rgba(15, 35, 55, .12);
}
.employee-brand { display: flex; align-items: center; gap: 12px; min-height: 86px; padding: 18px 24px; border-bottom: 1px solid rgba(255,255,255,.1); }
.employee-brand img { border-radius: 10px; background: #fff; }
.employee-brand span { display: flex; flex-direction: column; letter-spacing: .08em; }
.employee-brand strong { font-size: 16px; }
.employee-brand small { margin-top: 3px; color: #b8c9d9; letter-spacing: .18em; }
.employee-nav { display: grid; gap: 5px; padding: 22px 14px; }
.employee-nav a { display: flex; gap: 13px; align-items: center; padding: 12px 15px; border-radius: 9px; color: #d7e2ec; font-weight: 600; }
.employee-nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
.employee-nav a span { width: 22px; color: #70b9ff; text-align: center; }
.employee-nav-group { border-radius: 9px; }
.employee-nav-group summary { display: flex; gap: 13px; align-items: center; padding: 12px 15px; border-radius: 9px; color: #d7e2ec; cursor: pointer; font-weight: 600; list-style: none; }
.employee-nav-group summary::-webkit-details-marker { display: none; }
.employee-nav-group summary:hover { color: #fff; background: rgba(255,255,255,.1); }
.employee-nav-group summary > span:first-child { width: 22px; color: #70b9ff; text-align: center; }
.employee-nav-summary-label { flex: 1; }
.employee-nav-chevron { display: inline-flex; align-items: center; justify-content: center; width: 22px !important; height: 22px; color: #fff; transition: transform .2s ease; }
.employee-nav-chevron::before { content: ""; display: block; width: 10px; height: 10px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; border-radius: 1px; transform: translateY(-2px) rotate(45deg); }
.employee-nav-group[open] .employee-nav-chevron { transform: rotate(180deg); }
.employee-nav-subitems { display: grid; gap: 2px; margin: 2px 0 3px 35px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.18); }
.employee-nav a.employee-nav-subitem { gap: 8px; padding: 9px 12px; color: #b9cad9; font-size: 14px; font-weight: 500; }
.employee-nav a.employee-nav-subitem span { width: 14px; color: #70b9ff; font-size: 12px; }
.employee-nav a.employee-nav-subitem:hover { color: #fff; background: rgba(255,255,255,.08); }
.employee-sidebar-footer { display: grid; gap: 10px; margin-top: auto; padding: 20px 18px; border-top: 1px solid rgba(255,255,255,.1); }
.employee-sidebar-footer a, .employee-sidebar-footer button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; color: #d7e2ec; background: transparent; text-align: left; }
.employee-sidebar-footer a:hover, .employee-sidebar-footer button:hover { color: #fff; background: rgba(255,255,255,.1); }
.employee-main { min-height: 100vh; margin-left: 264px; }
.employee-topbar { height: 72px; display: flex; justify-content: flex-end; align-items: center; padding: 0 36px; background: #fff; border-bottom: 1px solid var(--line); }
.employee-topbar > div { display: flex; flex-direction: column; text-align: right; }
.employee-topbar small { color: var(--muted); font-size: 12px; }
.employee-topbar strong { font-size: 15px; }
.sidebar-toggle { display: none; margin-right: auto; border: 0; background: transparent; font-size: 24px; }
.employee-content { max-width: 1440px; margin: 0 auto; padding: 38px; }
.sidebar-backdrop { display: none; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 26px; }
.page-heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-heading h1 { margin: 5px 0 6px; font-size: clamp(28px, 3vw, 38px); line-height: 1.15; }
.page-heading p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.metric-card, .content-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(30, 55, 80, .05); }
.metric-card { min-height: 168px; padding: 24px; }
.metric-card span { color: var(--muted); font-size: 14px; }
.metric-card strong { display: block; margin: 16px 0 8px; color: var(--navy); font-size: 25px; }
.metric-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.metric-card strong { overflow-wrap: anywhere; }
.dashboard-recent-features p { margin: 0 0 12px; }
.dashboard-recent-features ul { display: grid; gap: 10px; margin: 0; padding-left: 20px; color: var(--muted); }
.dashboard-recent-features li { padding-left: 4px; }
.dashboard-recent-features li strong { display: inline-block; margin-right: 8px; color: var(--navy); }
.content-card { padding: 26px; }
.content-card h2 { margin-top: 0; }

.btn { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 9px 18px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; }
.btn-primary { color: #fff; background: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { width: 100%; color: #587086; border-color: var(--line); background: #edf2f6; cursor: not-allowed; }
.btn-ghost { color: var(--ink); border-color: var(--line); background: #fff; }
.alert { margin-bottom: 20px; padding: 13px 16px; border-radius: 9px; line-height: 1.5; }
.alert-success { color: #0d6944; background: #e7f7ef; border: 1px solid #b9e7cf; }
.alert-error, .validation { color: #a22530; }
.alert-error { background: #fff0f1; border: 1px solid #f0c2c6; }
.alert-info { color: #164f82; background: #edf6ff; border: 1px solid #c6e1fa; }

.form-card { max-width: 920px; }
.form-stack { display: grid; gap: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 19px 22px; }
.form-grid > div { display: grid; gap: 7px; }
.form-wide { grid-column: 1 / -1; }
label { font-weight: 700; font-size: 14px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); border: 1px solid #becbd7; border-radius: 8px; background: #fff; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(25,118,210,.16); border-color: var(--blue); }
.navigation-admin-check input[type="checkbox"]:focus { outline: none; box-shadow: none; }
.field-validation-error { color: var(--danger); font-size: 13px; }
.form-note, .form-grid small { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.checkbox-field label { display: flex; align-items: center; gap: 10px; }
.checkbox-field input[type="checkbox"] { width: 18px; min-height: 18px; margin: 0; padding: 0; }
.checkbox-field small { display: block; margin: 6px 0 0 28px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.form-actions { display: flex !important; flex-direction: row; justify-content: flex-end; gap: 10px !important; margin-top: 10px; }
.audit-filter-card { margin-bottom: 22px; }
.audit-filters { display: grid; grid-template-columns: repeat(3, minmax(170px, 1fr)) auto; gap: 16px; align-items: end; }
.audit-filters > div { display: grid; gap: 7px; }
.audit-filter-actions { display: flex !important; flex-direction: row; gap: 8px !important; }
.audit-filter-actions .btn { white-space: nowrap; }

.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.audit-pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.audit-pagination-summary { white-space: nowrap; }
.audit-pagination-nav { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.audit-pagination-nav a, .audit-pagination-nav span { display: inline-flex; min-width: 36px; min-height: 34px; align-items: center; justify-content: center; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-weight: 700; }
.audit-pagination-nav a { color: var(--blue-dark); }
.audit-pagination-nav a:hover, .audit-pagination-nav a:focus-visible { border-color: #a9c6df; background: #f2f7fc; outline: none; }
.audit-pagination-nav .is-current { color: #fff; border-color: var(--blue-dark); background: var(--blue-dark); }
.audit-pagination-nav .is-disabled { color: #a7b4c1; background: #f7f9fb; cursor: not-allowed; }
.audit-pagination-nav .audit-pagination-ellipsis { min-width: 20px; padding-inline: 2px; border-color: transparent; background: transparent; font-size: 17px; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 15px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #53677a; background: #f8fafc; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
td { font-size: 14px; }
td small { display: block; margin-top: 4px; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
.role-badge, .status-badge { display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.role-badge { color: #22547e; background: #eaf3fb; }
.status-badge.enabled { color: #0f744a; background: #e5f6ed; }
.status-badge.disabled { color: #a12f38; background: #fdebed; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px 11px; align-items: center; }
.row-actions a, .row-actions button, .table-link { padding: 0; color: var(--blue-dark); border: 0; background: transparent; font-weight: 650; white-space: nowrap; }
.row-actions .is-danger { color: #c62828; }
.row-actions form { display: inline; }
code { color: #42556a; font-family: Consolas, monospace; font-size: 12px; }

.permission-list { display: grid; }
.permission-row { display: grid; grid-template-columns: 1fr minmax(210px, 280px); gap: 24px; align-items: center; padding: 18px 4px; border-bottom: 1px solid var(--line); }
.permission-row > div:first-of-type { display: grid; gap: 4px; }
.permission-row small { color: var(--muted); line-height: 1.5; }
.permission-module { width: fit-content; padding: 2px 7px; border-radius: 4px; color: #22547e; background: #eaf3fb; font-size: 11px; }
.permission-control { display: grid; gap: 7px; }
.permission-control span { color: var(--muted); font-size: 12px; }
.role-permission-toggle { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.role-permission-toggle input { width: 18px; min-height: 18px; margin: 0; padding: 0; }
.muted-action { color: var(--muted); font-size: 13px; }
.sticky-actions { position: sticky; bottom: 0; margin: 0 -4px -4px; padding: 16px 4px 4px; background: rgba(255,255,255,.94); }

.product-page-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.product-page-summary > div { display: grid; gap: 5px; }
.product-page-summary span, .product-page-summary small { color: var(--muted); }
.product-page-summary strong { color: var(--navy); font-size: 21px; }
.product-admin-thumbnail { display: block; width: 112px; height: 76px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #edf2f6; }
.product-admin-id { font-family: Consolas, monospace; font-size: 11px; }
.product-admin-actions button:disabled { color: #9aa8b5; cursor: not-allowed; }
.product-editor-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.4fr); gap: 22px; margin-bottom: 22px; }
.product-image-editor, .product-content-editor { min-width: 0; }
.product-image-preview-wrap { margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #edf2f6; }
.product-image-preview { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.product-image-preview.is-empty { opacity: .45; }
.product-button-editor { margin-bottom: 18px; }
.product-editor-section-heading h2 { margin-bottom: 5px; }
.product-editor-section-heading p { margin: 0 0 20px; color: var(--muted); }
.product-button-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.product-button-card { display: grid; gap: 7px; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.product-button-card strong { margin-bottom: 5px; color: var(--navy); }
.product-editor-actions { margin-bottom: 28px; }
.service-system-admin-note { display: flex; margin-bottom: 22px; }
.service-system-admin-note > div { display: grid; gap: 5px; }
.service-system-admin-note span, .service-system-admin-note small { color: var(--muted); }
.service-system-admin-note strong { color: var(--navy); font-size: 21px; }
.service-detail-editor { margin-bottom: 18px; }
.service-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.service-detail-heading h2 { margin-bottom: 5px; }
.service-detail-heading p { margin: 0; color: var(--muted); }
.service-detail-list { display: grid; gap: 10px; }
.service-detail-row { display: grid; grid-template-columns: 34px minmax(240px, 1fr) auto; align-items: center; gap: 10px; }
.service-detail-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #eaf2ff; color: var(--blue); font-weight: 800; }
.service-detail-actions { display: flex; align-items: center; gap: 6px; }
.service-detail-actions button { min-width: 36px; min-height: 38px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--blue); }
.service-detail-actions button:disabled { color: #9aa8b5; cursor: not-allowed; }
.asset-safety-note { margin-bottom: 28px; border-left: 4px solid var(--blue); }
.asset-safety-note strong { color: var(--navy); }
.asset-safety-note p { margin: 7px 0 0; color: var(--muted); }
.asset-section { margin-bottom: 36px; }
.asset-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.asset-section-heading h2 { margin: 3px 0 0; color: var(--navy); }
.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.asset-card { min-width: 0; padding: 0; overflow: hidden; }
.asset-card > img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #edf2f6; }
.asset-card-body { display: grid; gap: 10px; padding: 18px; }
.asset-card-body code { overflow-wrap: anywhere; }
.asset-card-body small { color: var(--muted); }
.asset-card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.asset-card-title strong { min-width: 0; overflow-wrap: anywhere; color: var(--navy); }
.asset-status { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.asset-status-use { background: #e7f6ed; color: #19733c; }
.asset-status-backup { background: #fff4d6; color: #8a5a00; }
.asset-status-unused { background: #edf2f6; color: #526476; }
.asset-status-trash { background: #fbe9ea; color: #a92d36; }
.asset-references { display: grid; gap: 4px; padding: 10px; border-radius: 8px; background: #f7f9fb; font-size: 12px; }
.asset-references span { color: var(--muted); overflow-wrap: anywhere; }
.asset-card form, .asset-card form .btn, .asset-card-body > .btn { width: 100%; }
.asset-trash-section { padding-top: 12px; border-top: 1px solid var(--line); }
.brochure-upload-card { display: grid; grid-template-columns: minmax(240px, .75fr) minmax(420px, 1.25fr); gap: 28px; margin-bottom: 32px; }
.brochure-upload-card h2 { margin-bottom: 8px; }
.brochure-upload-card p { margin: 0; color: var(--muted); line-height: 1.65; }
.brochure-upload-form { display: grid; gap: 14px; }
.brochure-upload-form > div { display: grid; gap: 7px; }
.brochure-upload-form .btn { justify-self: end; }
.brochure-replace-option { padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; }
.brochure-table { min-width: 1040px; }
.brochure-table td > span, .brochure-table td > small, .brochure-file-name { display: block; }
.brochure-table td > small { margin-top: 5px; color: var(--muted); }
.brochure-file-name { max-width: 250px; overflow-wrap: anywhere; color: var(--navy); }
.brochure-references { margin-top: 8px; min-width: 190px; }
.brochure-actions { min-width: 180px; }
.brochure-actions button:disabled { color: #9aa8b5; cursor: not-allowed; }
.brochure-safety-note { margin-bottom: 16px; }
.copy-feedback { position: fixed; right: 24px; bottom: 24px; z-index: 40; max-width: min(460px, calc(100vw - 32px)); color: #fff; background: rgba(18, 38, 63, .94); border-radius: 9px; box-shadow: 0 10px 28px rgba(10, 25, 40, .2); }
.copy-feedback:not(:empty) { padding: 11px 15px; }

.tool-series-section { margin-bottom: 24px; padding: 0 24px 24px; border-radius: 24px; overflow: hidden; }
.tool-series-cover-wrap { margin: 0 -24px; }
.tool-series-cover { display: block; width: 100%; height: 220px; object-fit: cover; border-radius: 24px 24px 0 0; background: #edf2f6; }
.tool-series-heading { margin: 22px 0 18px; }
.tool-series-heading h2 { margin: 0 0 5px; color: var(--navy); }
.tool-series-heading p { margin: 0; color: var(--muted); line-height: 1.55; }
.tool-series-divider { position: relative; display: flex; align-items: center; justify-content: center; height: 1px; margin: 34px 24px; background: linear-gradient(90deg, transparent 0, #c7d8ee 20%, #7ca8df 50%, #c7d8ee 80%, transparent 100%); }
.tool-series-divider span { position: absolute; width: 14px; height: 14px; border: 3px solid var(--canvas); background: var(--blue); transform: rotate(45deg); box-shadow: 0 0 0 1px #91b4e2, 0 4px 14px rgba(25, 118, 210, .25); }
.tool-product-list { display: grid; gap: 14px; }
.tool-product-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 22px; min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.tool-product-image-wrap { width: 150px; }
.tool-product-image { display: block; width: 150px; height: 110px; object-fit: contain; border-radius: 11px; background: #edf2f6; }
.tool-product-content { display: grid; align-content: center; gap: 8px; min-width: 0; }
.tool-product-title h3 { margin: 0 0 4px; color: var(--blue); font-size: 21px; }
.tool-product-version { color: #d97706; font-size: 13px; font-weight: 700; }
.tool-product-description { margin: 0; line-height: 1.6; }
.tool-info-block { display: grid; gap: 5px; padding-top: 8px; border-top: 1px solid var(--line); }
.tool-info-block strong { color: var(--navy); font-size: 13px; }
.tool-info-block ul { margin: 0; padding-left: 19px; }
.tool-info-block li { margin: 3px 0; }
.tool-card-actions { display: flex; flex-direction: column; flex-wrap: wrap; gap: 8px; min-width: 108px; margin-top: 0; }
.tool-card-actions .btn { width: 100%; white-space: nowrap; }
.tool-internal-link-button { color: #9a5a12; border-color: #f0c98f; background: #fff4df; }
.tool-internal-link-button:hover { color: #7a4308; border-color: #e7b66d; background: #ffe9c2; }
.tool-resource-editor { margin-bottom: 22px; }
.tool-resource-list { display: grid; gap: 12px; }
.tool-resource-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.tool-resource-fields { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(190px, .8fr) minmax(240px, 1.4fr); gap: 12px; min-width: 0; }
.tool-resource-fields > div { display: grid; align-content: start; gap: 6px; min-width: 0; }
.tool-resource-fields label { color: var(--muted); font-size: 12px; font-weight: 700; }
.tool-resource-fields input, .tool-resource-fields select { width: 100%; }
.tool-resource-fields [hidden] { display: none; }
.resource-current-file { color: var(--navy); overflow-wrap: anywhere; }
.tool-resource-actions { align-self: center; white-space: nowrap; }
.tool-resource-actions button { min-width: 32px; }
.tool-links-editor { margin-bottom: 22px; }
.tool-admin-note { margin-bottom: 24px; }
.tool-admin-page-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.tool-admin-page-summary h2 { margin: 0 0 5px; color: var(--navy); }
.tool-admin-page-summary p { margin: 0; color: var(--muted); }
.tool-admin-series { margin-bottom: 22px; }
.tool-admin-series-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.tool-admin-series-heading h2 { margin: 0 0 4px; color: var(--navy); }
.tool-admin-series-heading p { margin: 0; color: var(--muted); }
.tool-admin-series-actions, .tool-admin-product-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: end; }
.tool-admin-product-list { display: grid; gap: 10px; }
.tool-admin-product-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfd; }
.tool-admin-product-row strong { color: var(--navy); }
.tool-admin-product-row small { display: block; margin-top: 4px; color: var(--muted); }
.tool-admin-empty { color: var(--muted); }
.navigation-admin-note { margin-bottom: 22px; }
.navigation-admin-note p { margin: 6px 0 0; color: var(--muted); line-height: 1.6; }
.navigation-admin-create-form, .navigation-admin-edit-form { display: grid; grid-template-columns: auto minmax(180px, 1.4fr) auto auto; align-items: end; gap: 12px; }
.navigation-admin-create-form label, .navigation-admin-edit-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.navigation-admin-create-form input:not([type="checkbox"]), .navigation-admin-edit-form input:not([type="hidden"]):not([type="checkbox"]), .navigation-admin-edit-form select { width: 100%; }
.navigation-admin-icon-field { min-width: 68px; }
.navigation-admin-icon-field select { width: 68px !important; min-width: 68px; padding: 7px 4px; color: var(--blue); font-size: 22px; line-height: 1; text-align: center; }
.navigation-admin-icon-field select option { color: var(--navy); font-size: 20px; text-align: center; }
.navigation-admin-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 7px !important; white-space: nowrap; }

.bvc-license-setting-card, .bvc-license-upload-card, .bvc-license-product-card, .bvc-license-request-card, .bvc-license-grant-card { margin-bottom: 22px; }
.bvc-license-setting-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 26px; align-items: center; }
.bvc-license-setting-card .section-heading { margin: 0; }
.bvc-license-setting-card .section-heading p { max-width: 760px; margin: 7px 0 0; color: var(--muted); line-height: 1.6; }
.bvc-license-toggle-form { justify-self: end; }
.bvc-license-setting-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px 24px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.bvc-license-upload-card .section-heading, .bvc-license-product-card .section-heading { margin-bottom: 18px; }
.bvc-license-upload-card .section-heading p, .bvc-license-product-card .section-heading p, .bvc-license-section-heading p { margin: 7px 0 0; color: var(--muted); line-height: 1.6; }
.bvc-license-product-form { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.bvc-license-product-form .form-actions { align-self: end; }
.bvc-license-product-table, .bvc-license-request-table, .bvc-license-grant-table { min-width: 920px; }
.bvc-license-request-card, .bvc-license-grant-card { overflow: hidden; }
.bvc-license-section-heading { margin: 0; padding: 26px 26px 0; }
.bvc-license-row-error { max-width: 300px; color: var(--danger) !important; overflow-wrap: anywhere; }
.bvc-license-empty { color: var(--muted); text-align: center; }
.status-badge.pending { color: #8a5a00; background: #fff4d6; }
.status-badge.failed { color: #a23c18; background: #fff0e8; }
.bvc-license-gate-warning { margin: 9px 0 0; color: var(--danger) !important; font-weight: 700; }

@media (max-width: 820px) {
    .bvc-license-setting-card { grid-template-columns: 1fr; }
    .bvc-license-toggle-form { justify-self: start; }
    .bvc-license-setting-meta { grid-column: auto; }
}

@media (max-width: 640px) {
    .bvc-license-upload-card, .bvc-license-product-card { padding: 20px; }
    .bvc-license-section-heading { padding: 20px 20px 0; }
    .bvc-license-setting-meta { display: grid; gap: 6px; }
    .bvc-license-upload-card .form-grid, .bvc-license-product-form { grid-template-columns: 1fr; }
    .bvc-license-upload-card .form-wide { grid-column: auto; }
    .bvc-license-product-form .form-actions { justify-content: start; }
}
.navigation-admin-check input { width: 17px; height: 17px; }
.navigation-admin-tree { display: grid; gap: 16px; }
.navigation-admin-node { display: grid; gap: 15px; padding: 20px; }
.navigation-admin-node[data-navigation-item], .navigation-admin-child[data-navigation-item] { cursor: grab; }
.navigation-admin-node.is-dragging, .navigation-admin-child.is-dragging { opacity: .45; }
.navigation-admin-node.navigation-admin-disabled, .navigation-admin-child.navigation-admin-disabled { background: #fff7f7; border-color: #f1d4d7; }
.navigation-admin-edit-row, .navigation-admin-child-edit-row { display: grid; align-items: end; gap: 12px; }
.navigation-admin-edit-row { grid-template-columns: auto minmax(180px, 1fr) auto; }
.navigation-admin-child-edit-row { grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; }
.navigation-admin-edit-row label, .navigation-admin-child-edit-row label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.navigation-admin-edit-row input[readonly], .navigation-admin-child-edit-row input[readonly] { cursor: pointer; background: #f8fafc; }
.navigation-admin-edit-row input.is-editing, .navigation-admin-child-edit-row input.is-editing { cursor: text; background: #fff; box-shadow: 0 0 0 3px rgba(25,118,210,.12); }
.navigation-admin-node-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.navigation-admin-node-heading > div:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; }
.navigation-admin-node-heading strong { color: var(--navy); }
.navigation-admin-node-heading small { color: var(--muted); }
.navigation-admin-icon { display: inline-grid; width: 30px; height: 30px; place-items: center; color: var(--blue); font-size: 21px; }
.navigation-admin-dot { color: #70b9ff; font-size: 13px; }
.navigation-admin-fixed { color: var(--muted); font-size: 13px; }
.navigation-admin-child-list { display: grid; gap: 8px; margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.navigation-admin-child-list.is-drop-ready { padding-bottom: 14px; border: 1px dashed #cbd9e6; border-radius: 11px; background: #fbfdff; }
.navigation-admin-child-list.is-drop-ready::before { display: block; padding: 8px 12px; color: #7890a5; content: "拖曳到這裡即可移動並重新歸類"; font-size: 12px; text-align: center; }
.navigation-admin-child-list.is-drop-target { border-color: #70b9ff; background: #f1f8ff; box-shadow: 0 0 0 3px rgba(112,185,255,.12); }
.navigation-admin-child-list.is-drop-target::before { color: var(--blue-dark); content: "放開後歸類至：" attr(data-parent-label); font-weight: 700; }
.navigation-admin-tree.is-drop-ready { outline: 1px dashed #cbd9e6; outline-offset: 6px; }
.navigation-admin-tree.is-drop-target { outline-color: #70b9ff; background: #f8fbff; }
.navigation-admin-child { display: grid; gap: 8px; margin-left: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfd; will-change: transform; }
.navigation-admin-runtime-child .navigation-admin-icon-field { display: none; }
.navigation-admin-runtime-child .navigation-admin-drag-hint { display: none; }
.navigation-admin-runtime-child .navigation-admin-node-heading { justify-content: flex-start; }
.navigation-admin-runtime-child .navigation-admin-node-heading > div:first-child { justify-content: flex-start; }
.navigation-admin-runtime-child .navigation-admin-icon { display: none; }
.navigation-admin-runtime-root .navigation-admin-child-heading { justify-content: space-between; }
.navigation-admin-runtime-root .navigation-admin-child-edit-row { grid-template-columns: minmax(180px, 1fr) auto; }
.navigation-admin-runtime-root .navigation-admin-parent-label { margin-left: auto !important; }
.navigation-admin-runtime-root .navigation-admin-child-heading { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.navigation-admin-runtime-root .navigation-admin-child-heading .navigation-admin-item-meta { color: var(--muted); font-size: 12px; }
.navigation-admin-runtime-root .navigation-admin-edit-row { grid-template-columns: auto minmax(180px, 1fr) auto; align-items: end; }
.navigation-admin-child-heading { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.navigation-admin-child-heading strong { color: var(--navy); }
.navigation-admin-child-heading small { margin-left: 2px; color: var(--muted); }
.navigation-admin-parent-label { margin-left: auto !important; color: var(--blue-dark) !important; }
.navigation-admin-child-edit-row { gap: 9px; }
.navigation-admin-child-edit-row label { gap: 4px; }
.navigation-admin-child-edit-row input { padding-top: 8px; padding-bottom: 8px; }
.navigation-admin-drag-handle { color: #9aa8b5; font-size: 18px; line-height: 1; user-select: none; cursor: grab; touch-action: none; }
.navigation-admin-drag-handle:active { cursor: grabbing; }
.navigation-admin-drag-hint { color: var(--muted); font-size: 12px; }
.navigation-admin-drop-hint { padding: 14px; color: var(--muted); border: 1px dashed #b9c7d4; border-radius: 9px; text-align: center; }
.navigation-admin-readonly { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
    .navigation-admin-child { will-change: auto; }
}
.tool-details-editor, .tool-links-editor, .tool-package-editor { margin-bottom: 18px; }
.tool-editor-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.tool-editor-section-heading h2 { margin: 0 0 5px; }
.tool-editor-section-heading p { margin: 0; color: var(--muted); }
.tool-feature-list { display: grid; gap: 10px; margin-bottom: 20px; }
.tool-feature-row { display: grid; grid-template-columns: 34px minmax(240px, 1fr) auto; align-items: center; gap: 10px; }
.tool-text-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.tool-text-grid > div, .tool-links-editor .form-grid > div { display: grid; gap: 7px; }
.tool-links-editor .form-grid { align-items: start; }
.tool-package-editor > p { margin: 0 0 10px; }
.tool-package-editor > .btn { margin-bottom: 16px; }
.medical-license-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; min-height: 190px; margin-bottom: 22px; }
.medical-license-summary > div { display: grid; gap: 6px; align-content: start; padding: 6px 0; }
.medical-license-summary:not(.has-license-management) > div { align-content: center; justify-items: center; text-align: center; }
.medical-license-summary:not(.has-license-management) .medical-license-status-summary { padding-left: 28px; border-left: 2px solid #e5e8ec; }
.medical-license-summary span, .medical-license-issue-card p, .medical-license-table-heading p { margin: 0; color: var(--muted); }
.medical-license-summary strong { color: var(--navy); font-size: 22px; }
.medical-license-summary.has-license-management { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.medical-license-summary.has-license-management .medical-license-active-summary { align-content: center; justify-items: center; padding-left: 0; text-align: center; }
.medical-license-summary.has-license-management .medical-license-status-summary { align-content: center; justify-items: center; padding: 0 28px; border-right: 2px solid #e5e8ec; border-left: 2px solid #e5e8ec; text-align: center; }
.medical-license-summary.has-license-management .medical-license-status-summary strong { font-size: 24px; }
.medical-license-summary.has-license-management .medical-license-limit-form { display: block; align-self: center; justify-self: center; padding-top: 0; text-align: center; }
.medical-license-summary.has-license-management .medical-license-limit-field { display: grid; flex: none; gap: 7px; }
.medical-license-limit-controls { display: flex; align-items: center; justify-content: center; gap: 12px; }
.medical-license-summary.has-license-management .medical-license-limit-form label { margin: 0; color: var(--muted); font-size: 16px; font-weight: 400; line-height: 1.5; }
.medical-license-limit-controls .btn { min-height: 44px; }
.medical-license-available { color: var(--success) !important; }
.medical-license-full { color: var(--danger) !important; }
.medical-license-issue-card { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(300px, 1.2fr); gap: 28px; align-items: end; margin-bottom: 22px; }
.medical-license-issue-card h2 { margin: 0 0 6px; color: var(--navy); }
.medical-license-issue-form, .medical-license-limit-form { display: flex; align-items: end; gap: 12px; }
.medical-license-issue-form > div, .medical-license-limit-form > div { display: grid; flex: 1; gap: 7px; }
.medical-license-limit-form input { width: 5.5rem; }
.medical-license-result { margin-bottom: 22px; border-color: #b9e7cf; background: #f5fcf8; }
.medical-license-result h2 { margin: 6px 0 12px; color: var(--navy); }
.medical-license-result p { margin: 12px 0 0; color: var(--muted); }
.medical-license-code-row { display: flex; align-items: center; gap: 10px; }
.medical-license-code { display: inline-block; padding: 10px 14px; color: #0d6944; border: 1px solid #b9e7cf; border-radius: 8px; background: #e7f7ef; font: 800 24px Consolas, monospace; letter-spacing: .08em; }
.medical-license-copy-button { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 0; color: var(--blue-dark); border: 1px solid #b9e7cf; border-radius: 8px; background: #fff; cursor: pointer; transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
.medical-license-copy-button:hover { color: #fff; border-color: var(--blue); background: var(--blue); }
.medical-license-copy-button:focus-visible { outline: 3px solid rgba(25,118,210,.2); outline-offset: 2px; }
.medical-license-copy-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.medical-license-copy-button.is-copied { color: var(--success); border-color: #b9e7cf; background: #e7f7ef; }
.medical-license-table-card { padding: 0; }
.medical-license-table-heading { padding: 26px 26px 8px; }
.medical-license-table-heading h2 { margin: 0 0 6px; color: var(--navy); }
.medical-license-table { min-width: 900px; }
.medical-license-empty { padding: 28px 18px; color: var(--muted); text-align: center; }

.auth-page { min-height: 100vh; background: radial-gradient(circle at 12% 15%, rgba(37,128,209,.16), transparent 28%), linear-gradient(135deg, #edf4fa, #f8fafc 50%, #e5edf4); }
.auth-container { min-height: 100vh; display: grid; place-items: center; padding: 34px 18px; }
.auth-card { width: min(100%, 460px); padding: 36px; background: rgba(255,255,255,.97); border: 1px solid #d8e2eb; border-radius: 18px; box-shadow: 0 26px 70px rgba(24,55,82,.14); }
.auth-brand { display: flex; gap: 13px; align-items: center; margin-bottom: 28px; }
.auth-brand img { border-radius: 12px; }
.auth-brand div { display: flex; flex-direction: column; }
.auth-brand strong { letter-spacing: .1em; }
.auth-brand span { margin-top: 3px; color: var(--muted); font-size: 13px; letter-spacing: .16em; }
.auth-card h1 { margin: 0 0 8px; font-size: 28px; }
.auth-card .muted { margin: 0 0 24px; color: var(--muted); line-height: 1.65; }
.auth-card .form-stack .btn { margin-top: 13px; width: 100%; }
.login-method-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 22px; padding: 5px; border-radius: 10px; background: #edf2f6; }
.login-method-tabs a { padding: 9px 8px; border-radius: 7px; color: #607386; text-align: center; font-size: 14px; font-weight: 700; }
.login-method-tabs a.active { color: var(--blue-dark); background: #fff; box-shadow: 0 2px 8px rgba(24,55,82,.09); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: #8a99a8; font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-back { display: block; margin-top: 24px; color: var(--blue-dark); text-align: center; font-weight: 650; }
.auth-message { text-align: center; }
.auth-message .auth-brand { justify-content: center; }

@media (max-width: 1050px) {
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .product-editor-grid { grid-template-columns: 1fr; }
    .product-button-grid { grid-template-columns: 1fr 1fr; }
    .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tool-text-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .employee-sidebar { transform: translateX(-105%); transition: transform .2s ease; }
    .employee-main { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .employee-topbar { padding: 0 20px; }
    .employee-content { padding: 26px 20px; }
    .sidebar-open .employee-sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(7,22,36,.52); }
}

@media (max-width: 680px) {
    .dashboard-grid, .form-grid, .audit-filters { grid-template-columns: 1fr; }
    .form-wide { grid-column: auto; }
    .page-heading { align-items: stretch; flex-direction: column; }
    .page-heading-actions, .product-page-summary { align-items: stretch; flex-direction: column; }
    .page-heading-actions .btn, .product-page-summary .btn { width: 100%; }
    .product-button-grid { grid-template-columns: 1fr; }
    .service-detail-heading { align-items: stretch; flex-direction: column; }
    .service-detail-heading .btn { width: 100%; }
    .service-detail-row { grid-template-columns: 30px 1fr; }
    .service-detail-actions { grid-column: 2; justify-content: flex-end; }
    .asset-section-heading { align-items: flex-start; flex-direction: column; }
    .asset-grid { grid-template-columns: 1fr; }
    .permission-row { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 22px; }
    .employee-content { padding: 23px 14px; }
    .content-card { padding: 19px; }
    .brochure-upload-card { grid-template-columns: 1fr; }
    .brochure-upload-form .btn { width: 100%; }
    .copy-feedback { right: 16px; bottom: 16px; }
    .audit-filter-actions { align-items: stretch; }
    .audit-filter-actions .btn { flex: 1; }
    .audit-pagination { justify-content: center; padding-inline: 14px; }
    .audit-pagination-nav { justify-content: center; width: 100%; }
    .tool-series-heading, .tool-admin-page-summary, .tool-admin-series-heading { align-items: stretch; flex-direction: column; }
    .tool-admin-series-actions, .tool-admin-product-actions { justify-content: start; }
    .navigation-admin-create-form, .navigation-admin-edit-form, .navigation-admin-group > .navigation-admin-edit-form { grid-template-columns: 1fr; align-items: stretch; }
    .navigation-admin-create-form .btn, .navigation-admin-edit-form .btn { width: 100%; }
    .navigation-admin-edit-row, .navigation-admin-child-edit-row { grid-template-columns: 1fr; align-items: stretch; }
    .page-heading > .btn { width: 100%; }
    .tool-series-section { padding: 0 19px 19px; border-radius: 18px; }
    .tool-series-cover-wrap { margin: 0 -19px; }
    .tool-series-cover { height: 150px; border-radius: 18px 18px 0 0; }
    .tool-series-heading { margin-top: 18px; }
    .tool-series-divider { margin: 28px 20px; }
    .tool-product-row { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 14px; }
    .tool-product-image-wrap, .tool-product-image { width: 96px; }
    .tool-product-image { height: 80px; }
    .tool-card-actions { grid-column: 2; flex-direction: row; min-width: 0; }
    .tool-card-actions .btn { width: auto; }
    .tool-feature-row { grid-template-columns: 30px 1fr; }
    .tool-feature-row .service-detail-actions { grid-column: 2; justify-content: flex-end; }
    .tool-resource-row { grid-template-columns: 30px minmax(0, 1fr); }
    .tool-resource-fields { grid-template-columns: 1fr; }
    .tool-resource-actions { grid-column: 2; justify-content: flex-end; }
    .tool-text-grid { grid-template-columns: 1fr; }
    .medical-license-summary, .medical-license-issue-card { grid-template-columns: 1fr; min-height: 0; }
    .medical-license-summary:not(.has-license-management) .medical-license-status-summary { padding: 18px 0 0; border-top: 1px solid var(--line); border-left: 0; }
    .medical-license-summary.has-license-management .medical-license-status-summary { padding: 18px 0; border-top: 1px solid var(--line); border-right: 0; border-bottom: 1px solid var(--line); border-left: 0; }
    .medical-license-summary.has-license-management .medical-license-limit-form { padding-top: 0; }
    .medical-license-summary.has-license-management .medical-license-limit-controls .btn { width: auto; }
    .medical-license-issue-form, .medical-license-limit-form { align-items: stretch; flex-direction: column; }
    .medical-license-issue-form .btn, .medical-license-limit-form .btn { width: 100%; }
}

/* Engineering product catalog */
.engineering-product-filter-card { margin-bottom: 22px; padding: 18px; }
.engineering-product-filters { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(220px, 1.4fr) auto auto; gap: 12px; align-items: end; }
.engineering-product-filters > div { display: grid; gap: 7px; }
.engineering-product-filters label { color: var(--muted); font-size: 12px; }
.engineering-product-filter-select { max-height: 240px; overflow-y: auto; }
.engineering-product-table-card { margin-bottom: 22px; }
.engineering-product-table-heading { padding: 24px 25px 14px; }
.engineering-product-table-heading h2 { margin: 4px 0 5px; color: var(--navy); }
.engineering-product-table-heading p { margin: 0; color: var(--muted); }
.engineering-product-table { min-width: 1180px; }
.engineering-product-table th, .engineering-product-table td { vertical-align: middle; }
.engineering-product-table tbody tr.is-disabled { opacity: .58; background: #fff8f8; }
.engineering-product-image-cell { width: 116px; text-align: center; }
.engineering-product-image-link { display: inline-block; position: relative; z-index: 1; border-radius: 8px; }
.engineering-product-image-cell img { display: block; width: 86px; height: 68px; margin: 0 auto; object-fit: contain; border: 1px solid #dce5ee; border-radius: 8px; background: #fff; }
.engineering-product-image-link:focus-visible { outline: 3px solid rgba(25,118,210,.24); outline-offset: 3px; }
.engineering-product-image-zoom { position: fixed; z-index: 1100; display: none; width: min(360px, calc(100vw - 24px)); height: min(270px, calc(100vh - 24px)); padding: 8px; border: 1px solid #cbd9e6; border-radius: 12px; background: rgba(255,255,255,.98); box-shadow: 0 18px 45px rgba(17,42,67,.28); pointer-events: none; }
.engineering-product-image-zoom.is-visible { display: block; }
.engineering-product-image-zoom img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 7px; background: #fff; }
.engineering-product-no-image { display: inline-flex; width: 86px; height: 68px; align-items: center; justify-content: center; color: var(--muted); border: 1px dashed #c6d2dd; border-radius: 8px; background: #f8fafc; font-size: 12px; }
.engineering-product-description { min-width: 220px; max-width: 360px; white-space: pre-line; line-height: 1.55; }
.engineering-product-actions { min-width: 175px; }
.engineering-product-actions .status-badge { margin-bottom: 8px; }
.engineering-product-empty { padding: 48px 20px !important; color: var(--muted); text-align: center; }
.engineering-product-dialog { width: min(760px, calc(100% - 28px)); max-width: none; max-height: min(92vh, 820px); margin: auto; padding: 25px; color: var(--navy); border: 1px solid #d4e0ec; border-radius: 14px; background: #fff; box-shadow: 0 24px 70px rgba(24,55,82,.24); }
.engineering-product-dialog::backdrop { background: rgba(7,22,36,.52); }
.engineering-product-dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.engineering-product-dialog-header h2 { margin: 4px 0 0; }
.engineering-product-form-errors { margin-bottom: 16px; padding: 12px 14px; color: #9d2633; border: 1px solid #edbbc1; border-radius: 8px; background: #fff3f4; font-size: 13px; }
.engineering-product-form-errors[hidden] { display: none; }
.engineering-product-form-errors strong { display: block; margin-bottom: 6px; }
.engineering-product-form-errors ul { margin: 0; padding-left: 20px; }
.engineering-product-dialog [aria-invalid="true"] { border-color: #c93745; box-shadow: 0 0 0 3px rgba(201,55,69,.12); }
.engineering-product-field-unit { color: var(--muted); font-size: 12px; font-weight: 500; }
.engineering-product-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 18px; }
.engineering-product-form-grid > div { display: grid; gap: 7px; }
.engineering-product-form-grid small, .engineering-package-dialog small { color: var(--muted); line-height: 1.5; }
.engineering-manual-field { grid-column: 1 / -1; }
.engineering-manual-source-options { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.engineering-manual-source-options label { display: inline-flex; align-items: center; gap: 7px; color: var(--navy); font-size: 13px; font-weight: 600; }
.engineering-manual-source-options input { width: 16px; min-height: 16px; margin: 0; }
.engineering-manual-panel { display: grid; gap: 7px; margin-top: 4px; padding: 13px; border: 1px solid #dce6f1; border-radius: 9px; background: #f8fbfe; }
.engineering-manual-panel[hidden] { display: none; }
.engineering-manual-panel .btn { width: fit-content; }
.engineering-selected-document { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.engineering-document-dialog { width: min(860px, calc(100% - 28px)); }
.engineering-document-search { margin-bottom: 14px; }
.engineering-document-list { display: grid; gap: 8px; max-height: min(55vh, 560px); overflow-y: auto; padding-right: 3px; }
.engineering-document-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 13px; border: 1px solid #e0e8f0; border-radius: 9px; background: #fbfdff; }
.engineering-document-info { display: grid; min-width: 0; gap: 4px; }
.engineering-document-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.engineering-document-info small { color: var(--muted); }
.engineering-document-url { overflow: hidden; color: var(--blue-dark); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.engineering-document-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 5px; }
.engineering-document-actions form { display: flex; }
.engineering-document-actions .row-action { min-height: 34px; padding: 6px 9px; color: var(--blue-dark); border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; white-space: nowrap; }
.engineering-document-actions .row-action:hover, .engineering-document-actions .row-action:focus-visible { border-color: #b7cce1; background: #f2f7fc; outline: none; }
.engineering-document-actions .row-action.is-danger { color: #b4424e; font-size: 16px; }
.engineering-document-empty { margin: 0; padding: 22px 0; color: var(--muted); text-align: center; }
.engineering-product-enabled label { display: inline-flex; align-items: center; gap: 8px; }
.engineering-product-enabled input[type="checkbox"] { width: 18px; min-height: 18px; margin: 0; }
.engineering-product-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.engineering-excel-progress { display: flex; align-items: center; gap: 9px; margin-top: 18px; padding: 11px 13px; color: var(--blue-dark); border: 1px solid #cfe0ef; border-radius: 8px; background: #f3f8fc; font-size: 13px; font-weight: 700; }
.engineering-excel-progress[hidden] { display: none; }
.engineering-excel-spinner { display: inline-block; width: 17px; height: 17px; flex: 0 0 auto; border: 2px solid #b9d2e7; border-top-color: var(--blue); border-radius: 50%; animation: engineering-excel-spin .8s linear infinite; }
.engineering-excel-spinner[hidden] { display: none; }
@keyframes engineering-excel-spin { to { transform: rotate(360deg); } }
.engineering-excel-progress.is-success { color: #1b6b47; border-color: #bfe3cf; background: #f0fbf5; }
.engineering-excel-progress.is-error { color: #a12f38; border-color: #f0c5ca; background: #fff4f5; }
.engineering-product-dialog form[data-engineering-excel-import-form].is-busy .engineering-product-dialog-actions,
.engineering-product-dialog form[data-engineering-excel-export-form].is-busy .engineering-product-dialog-actions { opacity: .72; }
.engineering-product-dialog form[data-engineering-excel-import-form].is-busy .engineering-product-dialog-actions .btn-ghost,
.engineering-product-dialog form[data-engineering-excel-export-form].is-busy .engineering-product-dialog-actions .btn-ghost { pointer-events: none; }
.engineering-package-dialog { width: min(600px, calc(100% - 28px)); }
.engineering-package-dialog p { color: var(--muted); line-height: 1.65; }
.engineering-package-dialog form { display: grid; gap: 8px; }
.engineering-master-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-bottom: 22px; }
.engineering-master-card { min-width: 0; padding: 22px; }
.engineering-master-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.engineering-master-card-heading h2 { margin: 4px 0 0; color: var(--navy); }
.engineering-master-count, .engineering-master-reference { color: var(--muted); font-size: 12px; white-space: nowrap; }
.engineering-master-create { display: grid; gap: 7px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.engineering-master-create label { color: var(--muted); font-size: 12px; font-weight: 700; }
.engineering-master-create-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.engineering-master-type-create-row { grid-template-columns: minmax(0, 1fr) minmax(105px, .7fr) auto; }
.engineering-master-create-row .btn { min-height: 42px; }
.engineering-master-list { display: grid; gap: 9px; padding-top: 16px; }
.engineering-master-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; min-width: 0; padding: 9px 0; border-bottom: 1px solid #edf1f5; }
.engineering-master-row.is-disabled { opacity: .58; }
.engineering-master-edit-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; align-items: center; min-width: 0; }
.engineering-master-type-edit-form { grid-template-columns: minmax(0, 1fr) minmax(90px, .7fr) auto auto; }
.engineering-master-edit-form input:not([type="checkbox"]), .engineering-master-edit-form select { min-width: 0; min-height: 36px; padding: 7px 9px; }
.engineering-master-enabled { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.engineering-master-enabled input { width: 16px; min-height: 16px; margin: 0; }
.engineering-master-row form:last-child { display: flex; }
.engineering-master-row .row-action { min-height: 32px; padding: 5px 8px; color: var(--blue-dark); border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.engineering-master-row .row-action:hover, .engineering-master-row .row-action:focus-visible { border-color: #b7cce1; background: #f2f7fc; outline: none; }
.engineering-master-row .row-action.is-danger { color: #b4424e; font-size: 17px; }
.engineering-master-row .row-action:disabled { color: #aab5c0; cursor: not-allowed; }
.engineering-master-empty { margin: 0; color: var(--muted); font-size: 13px; }
.engineering-master-note { margin-bottom: 22px; padding: 18px 22px; color: var(--muted); }
.engineering-master-note strong { color: var(--navy); }
.engineering-master-note p { margin: 7px 0 0; line-height: 1.65; }

@media (max-width: 1050px) {
    .engineering-product-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .engineering-product-search { grid-column: 1 / -1; }
    .engineering-master-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .engineering-product-filters { grid-template-columns: 1fr; }
    .engineering-product-search { grid-column: auto; }
    .engineering-product-filters .btn { width: 100%; }
    .engineering-product-table-heading { padding: 20px 19px 12px; }
    .engineering-product-dialog { padding: 20px; }
    .engineering-product-form-grid { grid-template-columns: 1fr; }
    .engineering-manual-field { grid-column: auto; }
    .engineering-document-row { align-items: stretch; flex-direction: column; }
    .engineering-document-actions { flex-wrap: wrap; }
    .engineering-product-dialog-actions { flex-direction: column-reverse; }
    .engineering-product-dialog-actions .btn { width: 100%; }
    .engineering-master-card { padding: 18px; }
    .engineering-master-create-row, .engineering-master-type-create-row { grid-template-columns: 1fr; }
    .engineering-master-row { grid-template-columns: minmax(0, 1fr) auto; }
    .engineering-master-edit-form, .engineering-master-type-edit-form { grid-template-columns: 1fr auto; }
    .engineering-master-edit-form .engineering-master-enabled { grid-row: 2; }
    .engineering-master-edit-form .row-action { grid-row: 2; }
    .engineering-master-row > .engineering-master-reference { grid-column: 1; grid-row: 2; }
    .engineering-master-row > form:last-child { grid-column: 2; grid-row: 2; }
}

/* BVCLicense dashboard and product workspace */
.bvc-license-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
.bvc-license-kpi { min-height: 112px; padding: 18px 16px; border: 1px solid #dce6f1; border-top: 3px solid #2c78d2; border-radius: 9px; background: linear-gradient(180deg, #fff, #f7faff); box-shadow: 0 7px 20px rgba(30, 55, 80, .05); }
.bvc-license-kpi span, .bvc-license-kpi small { display: block; color: var(--muted); font-size: 12px; }
.bvc-license-kpi strong { display: block; margin: 7px 0 3px; color: var(--navy); font: 800 27px Manrope, sans-serif; }
.bvc-license-kpi.is-positive { border-top-color: #159a68; }
.bvc-license-kpi.is-warning { border-top-color: #e39a14; }
.bvc-license-kpi.is-danger { border-top-color: #c64d59; }
.bvc-license-kpi-gate { border-top-color: #697b91; }
.bvc-license-section-heading.bvc-license-device-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(190px, max-content); gap: 18px 26px; align-items: center; }
.bvc-license-device-copy { min-width: 0; }
.bvc-license-device-heading h2 { margin: 0 0 5px; color: var(--navy); }
.bvc-license-device-heading p { margin: 0; color: var(--muted); line-height: 1.6; }
.bvc-license-lifetime-form { display: grid; grid-template-columns: max-content 100px 100px; align-items: center; gap: 8px 10px; margin: 0; }
.bvc-license-lifetime-form label { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.bvc-license-lifetime-form input { width: 100%; min-height: 44px; }
.bvc-license-lifetime-form .btn { width: 100%; min-height: 44px; padding-inline: 10px; white-space: nowrap; }
.bvc-license-device-heading .bvc-license-setting-meta { grid-column: auto; display: grid; align-content: center; gap: 6px; min-width: 190px; margin: 0; padding: 0 0 0 22px; border-top: 0; border-left: 1px solid var(--line); white-space: nowrap; }
.bvc-license-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.bvc-license-section-heading > div:first-child { min-width: 0; }
.bvc-license-section-heading h2 { margin: 0 0 5px; color: var(--navy); }
.bvc-license-section-heading p { margin: 0; color: var(--muted); line-height: 1.6; }
.bvc-license-inline-gate-form { display: flex; align-items: center; justify-content: flex-end; flex-shrink: 0; gap: 12px; margin: 0; }
.bvc-license-inline-gate-form .btn { min-height: 42px; }
.bvc-license-toolbar-card { margin-bottom: 22px; padding: 17px; }
.bvc-license-toolbar { display: grid; grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(125px, 1fr)) auto auto; gap: 11px; align-items: end; }
.bvc-license-toolbar > div { display: grid; gap: 6px; }
.bvc-license-toolbar label { color: var(--muted); font-size: 12px; font-weight: 700; }
.bvc-license-toolbar .btn { min-height: 42px; }
.bvc-license-section-heading { padding: 25px 25px 14px; }
.bvc-license-device-card { margin-bottom: 32px; }
.bvc-license-table-card { margin-bottom: 22px; }
.bvc-license-dashboard-table { min-width: 1450px; }
.bvc-license-dashboard-table th, .bvc-license-dashboard-table td { vertical-align: top; }
.bvc-license-dashboard-table td small, .bvc-license-request-table td small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.4; }
.bvc-license-dashboard-table code { max-width: 170px; display: inline-block; overflow-wrap: anywhere; }
.bvc-license-actions { min-width: 126px; white-space: nowrap; }
.bvc-license-actions form { display: inline-flex; }
.bvc-icon-action { display: inline-grid !important; width: 32px; height: 32px; place-items: center; padding: 0 !important; color: var(--blue-dark) !important; border: 1px solid transparent !important; border-radius: 7px; background: transparent !important; font-size: 19px; line-height: 1; text-decoration: none; cursor: pointer; }
.bvc-icon-action:hover, .bvc-icon-action:focus-visible { border-color: #b7cce1 !important; background: #f2f7fc !important; outline: none; }
.bvc-icon-action.is-danger { color: #b4424e !important; }
.bvc-icon-action.is-danger:hover, .bvc-icon-action.is-danger:focus-visible { border-color: #ecc4c9 !important; background: #fff5f6 !important; }
.bvc-icon-action.is-danger { border: 0 !important; }
.bvc-icon-action.is-danger svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.bvc-license-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding: 16px 25px 21px; color: var(--muted); font-size: 13px; }
.bvc-license-pagination a { color: var(--blue-dark); font-weight: 700; }
.bvc-license-request-card { margin-bottom: 22px; }
.bvc-product-safety-note { margin-bottom: 22px; border-color: #c8dcef; background: #f5f9ff; }
.bvc-product-safety-note strong { color: var(--blue-dark); }
.bvc-product-safety-note p { margin: 8px 0 0; color: var(--muted); line-height: 1.7; }
.bvc-product-table-card { margin-bottom: 22px; }
.bvc-product-table-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 25px 25px 14px; }
.bvc-product-table-heading h2 { margin: 0 0 5px; color: var(--navy); }
.bvc-product-table-heading p { margin: 0; color: var(--muted); line-height: 1.6; }
.bvc-product-table { min-width: 1250px; }
.bvc-product-table th, .bvc-product-table td { vertical-align: top; }
.bvc-product-table td strong { display: block; color: var(--navy); }
.bvc-product-table td small { line-height: 1.5; }
.bvc-product-table code { display: inline-block; max-width: 180px; overflow-wrap: anywhere; }
.bvc-product-table td:nth-child(3) { max-width: 220px; }
.bvc-product-capability { display: inline-block; padding: 4px 8px; color: #22547e; border: 1px solid #d2e1ef; border-radius: 5px; background: #f2f7fc; font-size: 12px; font-weight: 700; white-space: nowrap; }
.bvc-product-row-actions { min-width: 205px; white-space: nowrap; }
.bvc-product-row-actions .row-actions { flex-wrap: nowrap; gap: 5px; }
.bvc-product-row-actions form { display: inline-flex; }
.bvc-product-row-actions .bvc-icon-action { flex: 0 0 auto; }
.bvc-product-row-actions .bvc-icon-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.bvc-product-row-actions .bvc-icon-action.is-danger { border: 0 !important; }
.bvc-product-toggle-button { min-height: 32px; padding: 5px 2px; color: var(--blue-dark); border: 0; background: transparent; font-size: 13px; font-weight: 700; }
.bvc-product-toggle-button:hover, .bvc-product-toggle-button:focus-visible { color: var(--blue); border: 0; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.bvc-product-empty { padding: 48px 20px !important; color: var(--muted); text-align: center; }
.bvc-product-dialog { width: min(720px, calc(100% - 28px)); max-width: none; max-height: min(90vh, 760px); margin: auto; padding: 25px; color: var(--navy); border: 1px solid #d4e0ec; border-radius: 14px; background: #fff; box-shadow: 0 24px 70px rgba(24,55,82,.24); }
.bvc-product-dialog::backdrop { background: rgba(7, 22, 36, .52); }
.bvc-product-dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.bvc-product-dialog-header h2 { margin: 3px 0 0; color: var(--navy); }
.bvc-product-dialog-summary { margin: 0 0 20px; color: var(--muted); line-height: 1.65; }
.bvc-product-form-errors { margin-bottom: 16px; padding: 12px 14px; color: #9d2633; border: 1px solid #edbbc1; border-radius: 8px; background: #fff3f4; font-size: 13px; }
.bvc-product-form-errors[hidden], .bvc-product-field-error[hidden] { display: none; }
.bvc-product-form-errors strong { display: block; margin-bottom: 6px; }
.bvc-product-form-errors ul { margin: 0; padding-left: 20px; }
.bvc-product-dialog [aria-invalid="true"] { border-color: #c93745; box-shadow: 0 0 0 3px rgba(201,55,69,.12); }
.bvc-product-field-error { color: var(--danger); font-size: 13px; line-height: 1.45; }
.bvc-product-dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 17px; }
.bvc-product-dialog-grid > div { display: grid; gap: 7px; }
.bvc-product-features-field { grid-column: 1 / -1; }
.bvc-product-features-field small { color: var(--muted); line-height: 1.5; }
.bvc-product-dialog-grid label { color: var(--navy); font-size: 13px; font-weight: 700; }
.bvc-product-dialog-checks { grid-column: 1 / -1; display: flex !important; align-items: center; flex-wrap: wrap; gap: 11px 20px; padding: 13px 14px; border: 1px solid #d4e0ec; border-radius: 8px; background: #f7faff; }
.bvc-product-dialog-checks label { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.bvc-product-dialog-checks .bvc-product-perpetual-toggle { color: var(--blue-dark); }
.bvc-product-dialog-checks input[type="checkbox"] { width: 18px; min-height: 18px; margin: 0; padding: 0; }
.bvc-product-dialog-grid input:disabled { color: var(--muted); background: #eef3f8; cursor: not-allowed; }
.bvc-product-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 23px; }
.bvc-license-upload-dialog { width: min(560px, calc(100% - 28px)); max-width: none; max-height: min(90vh, 680px); margin: auto; padding: 25px; color: var(--navy); border: 1px solid #d4e0ec; border-radius: 14px; background: #fff; box-shadow: 0 24px 70px rgba(24,55,82,.24); }
.bvc-license-upload-dialog::backdrop { background: rgba(7, 22, 36, .52); }
.bvc-license-dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.bvc-license-dialog-header h2 { margin: 3px 0 0; color: var(--navy); }
.bvc-license-dialog-close { width: 34px; height: 34px; padding: 0; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.bvc-license-dialog-close:hover, .bvc-license-dialog-close:focus-visible { color: var(--blue-dark); border-color: #a7c4e2; background: #f4f8fc; }
.bvc-license-dialog-summary { margin: 0 0 16px; color: var(--muted); line-height: 1.65; }
.bvc-license-dialog-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.bvc-license-dialog-meta > div { min-width: 0; padding: 12px 13px; border: 1px solid #dce6f1; background: #f7faff; }
.bvc-license-dialog-meta dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.bvc-license-dialog-meta dd { margin: 5px 0 0; color: var(--navy); font-weight: 700; overflow-wrap: anywhere; }
.bvc-license-dialog-file-field { display: grid; gap: 7px; }
.bvc-license-dialog-file-field label { color: var(--navy); font-size: 13px; font-weight: 700; }
.bvc-license-dialog-file-field input[type=file] { width: 100%; padding: 10px; border: 1px solid #c3d2e2; border-radius: 7px; background: #fff; }
.bvc-license-dialog-file-field small { color: var(--muted); line-height: 1.55; }
.bvc-license-dialog-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 17px; }
.bvc-license-dialog-form-grid > div, .bvc-license-upload-dialog form > label { display: grid; gap: 7px; }
.bvc-license-dialog-form-grid label, .bvc-license-upload-dialog form > label { color: var(--navy); font-size: 13px; font-weight: 700; }
.bvc-license-dialog-form-grid .form-wide { grid-column: 1 / -1; }
.bvc-license-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 23px; }

@media (max-width: 1100px) {
    .bvc-license-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .bvc-license-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .bvc-license-search { grid-column: 1 / -1; }
    .bvc-license-section-heading.bvc-license-device-heading { grid-template-columns: 1fr; align-items: start; }
    .bvc-license-lifetime-form { justify-self: start; }
    .bvc-license-device-heading .bvc-license-setting-meta { min-width: 0; margin-top: 0; padding: 11px 0 0; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 680px) {
    .bvc-license-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .bvc-license-kpi { min-height: 98px; padding: 14px 12px; }
    .bvc-license-kpi strong { font-size: 23px; }
    .bvc-license-lifetime-form { grid-template-columns: minmax(0, 1fr) 100px; width: 100%; }
    .bvc-license-lifetime-form label { grid-column: 1 / -1; }
    .bvc-license-lifetime-form .btn { width: 100%; }
    .bvc-license-toolbar { grid-template-columns: 1fr; }
    .bvc-license-search { grid-column: auto; }
    .bvc-license-toolbar .btn { width: 100%; }
    .bvc-license-device-card { margin-bottom: 26px; }
    .bvc-license-section-heading { align-items: stretch; flex-direction: column; gap: 14px; padding: 20px 19px 12px; }
    .bvc-license-inline-gate-form { justify-content: space-between; }
    .bvc-license-pagination { justify-content: center; padding-inline: 19px; }
    .bvc-product-table-heading { align-items: stretch; flex-direction: column; gap: 8px; padding: 20px 19px 12px; }
    .bvc-product-table-scroll { overflow-x: auto; }
    .bvc-product-row-actions .row-actions { gap: 4px; }
    .bvc-product-dialog { padding: 20px; }
    .bvc-product-dialog-grid { grid-template-columns: 1fr; }
    .bvc-product-dialog-checks { grid-column: auto; align-items: stretch; flex-direction: column; gap: 11px; }
    .bvc-product-dialog-actions { flex-direction: column-reverse; }
    .bvc-product-dialog-actions .btn { width: 100%; }
    .bvc-license-upload-dialog { padding: 20px; }
    .bvc-license-dialog-meta { grid-template-columns: 1fr; }
    .bvc-license-dialog-form-grid { grid-template-columns: 1fr; }
    .bvc-license-dialog-form-grid .form-wide { grid-column: auto; }
    .bvc-license-dialog-actions { flex-direction: column-reverse; }
    .bvc-license-dialog-actions .btn { width: 100%; }
}

.quotation-filter-card { margin-bottom: 20px; }
.quotation-filter-form { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(160px, 1fr)) auto; gap: 13px; align-items: end; }
.quotation-filter-form.is-manager { grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(160px, 1fr)) auto; }
.quotation-filter-form > div { display: grid; gap: 6px; }
.quotation-filter-form label, .quotation-meta-grid label, .quotation-common-create-form label { color: var(--navy); font-size: 13px; font-weight: 700; }
.quotation-filter-actions { display: flex !important; justify-content: flex-end; align-items: center; gap: 8px; margin-left: auto; }
.quotation-table-card, .quotation-lines-card, .quotation-history-card { overflow: hidden; }
.quotation-table-card > .quotation-table-heading { padding: 26px 26px 0; }
.quotation-table-heading, .quotation-lines-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.quotation-table-heading h2, .quotation-lines-heading h2, .quotation-history-card h2 { margin: 4px 0 0; }
.quotation-table-heading p { margin: 5px 0 0; color: var(--muted); }
.quotation-table, .quotation-lines-table { width: 100%; min-width: 780px; border-collapse: collapse; }
.quotation-table th, .quotation-table td, .quotation-lines-table th, .quotation-lines-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.quotation-table th, .quotation-lines-table th { color: var(--muted); background: #f5f8fc; font-size: 12px; white-space: nowrap; }
.quotation-empty, .quotation-lines-empty { padding: 35px !important; color: var(--muted); text-align: center !important; }
.quotation-actions, .quotation-row-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.quotation-actions form { display: inline-flex; }
.quotation-actions .row-action { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px 2px; color: var(--blue-dark); border: 0; border-radius: 0; background: transparent; cursor: pointer; font-size: 13px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.quotation-actions .row-action:hover, .quotation-actions .row-action:focus-visible { color: var(--blue); background: transparent; text-decoration: underline; text-underline-offset: 3px; outline: none; }
.quotation-actions .row-action.is-danger { color: #c62828; }
.quotation-actions .row-action.is-danger:hover, .quotation-actions .row-action.is-danger:focus-visible { color: #a61f1f; background: transparent; }
.quotation-actions .row-action svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.quotation-approved-action-layout { display: grid; grid-template-columns: max-content max-content; align-items: start; column-gap: 18px; }
.quotation-output-main-actions { display: inline-flex; align-self: center; align-items: center; gap: 7px; }
.quotation-output-downloads { display: grid; grid-template-columns: repeat(2, max-content); align-items: center; column-gap: 18px; row-gap: 3px; min-width: max-content; }
.quotation-output-downloads .is-download { color: #0f744a; }
.quotation-output-meta { display: block; grid-column: 1 / -1; justify-self: center; color: var(--muted); font-size: 11px; line-height: 1.35; white-space: nowrap; }
.quotation-status-created { color: #245986; background: #eaf3fb; }
.quotation-status-pendingreview { color: #8a5a00; background: #fff4d6; }
.quotation-status-needsrevision { color: #a23c18; background: #fff0e8; }
.quotation-status-approved { color: #0f744a; background: #e5f6ed; }
.quotation-status-archived { color: #687889; background: #edf1f5; }
.quotation-pagination { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding-top: 18px; }
.quotation-pagination a { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--navy); background: #fff; text-decoration: none; }
.quotation-pagination a.is-current { color: #fff; border-color: var(--blue); background: var(--blue); }
.quotation-pagination a.is-disabled { pointer-events: none; opacity: .45; }
.quotation-meta-card { margin-bottom: 20px; }
.quotation-meta-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 15px; }
.quotation-meta-grid > div { display: grid; gap: 7px; }
.quotation-meta-project { grid-column: 1 / -1; }
.quotation-lines-heading { align-items: flex-start; }
.quotation-line-toolbar, .quotation-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.quotation-common-picker { display: flex; align-items: end; gap: 8px; margin-bottom: 15px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f7faff; }
.quotation-common-picker label { display: grid; gap: 5px; color: var(--navy); font-size: 13px; font-weight: 700; }
.quotation-common-picker select { min-width: min(600px, 100%); }
.quotation-sort-column { width: 70px; text-align: center !important; }
.quotation-line-number { display: block; color: var(--muted); font-weight: 700; text-align: center; }
.quotation-line-content { min-width: 240px; }
.quotation-line-content > * { display: block; max-width: 100%; margin-bottom: 5px; }
.quotation-line-content small { color: var(--muted); }
.quotation-lines-table input, .quotation-lines-table textarea { min-width: 90px; padding: 7px 8px; }
.quotation-lines-table textarea { min-height: 48px; }
.quotation-summary-card { display: flex; justify-content: flex-end; gap: 30px; margin-top: 20px; }
.quotation-summary-card > div { display: grid; gap: 4px; min-width: 120px; color: var(--muted); text-align: right; }
.quotation-summary-card strong { color: var(--navy); font-size: 18px; }
.quotation-summary-card .quotation-total strong { color: var(--blue-dark); font-size: 24px; }
.quotation-form-actions { margin: 20px 0; }
.quotation-history-card { margin-top: 20px; }
.quotation-history-card ul { display: grid; gap: 8px; margin: 0; padding-left: 20px; color: var(--muted); }
.quotation-history-card li strong, .quotation-history-card li span { color: var(--navy); }
.quotation-dialog { width: min(600px, calc(100% - 28px)); max-width: none; max-height: min(88vh, 760px); margin: auto; padding: 25px; border: 1px solid #d4e0ec; border-radius: 14px; background: #fff; box-shadow: 0 24px 70px rgba(24,55,82,.24); }
.quotation-dialog::backdrop { background: rgba(7,22,36,.52); }
.quotation-dialog h2 { margin-top: 0; color: var(--navy); }
.quotation-dialog textarea { width: 100%; min-height: 140px; }
.quotation-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.quotation-output-dialog {
    width: min(560px, calc(100% - 28px));
    max-width: none;
    max-height: min(90vh, 760px);
    margin: auto;
    padding: 25px;
    color: var(--navy);
    border: 1px solid #d4e0ec;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(24, 55, 82, .24);
    overflow: auto;
}

.quotation-output-dialog::backdrop {
    background: rgba(7, 22, 36, .52);
}
.quotation-output-dialog .dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 17px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.quotation-output-dialog .dialog-header h2 { margin: 4px 0 0; }
.quotation-output-dialog .dialog-close { width: 34px; height: 34px; padding: 0; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.quotation-output-dialog .dialog-close:hover, .quotation-output-dialog .dialog-close:focus-visible { color: var(--blue-dark); border-color: #a7c4e2; background: #f4f8fc; }
.quotation-output-dialog .dialog-description { color: var(--muted); line-height: 1.65; }
.quotation-output-fields { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 13px; }
.quotation-output-fields > div { display: grid; gap: 6px; }
.quotation-output-fields label, .quotation-output-options legend { color: var(--navy); font-size: 13px; font-weight: 700; }
.quotation-output-check { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; color: var(--navy); font-weight: 650; }
.quotation-output-check input, .quotation-output-options input { width: 17px; min-height: 17px; margin: 0; }
.quotation-output-options { display: flex; flex-wrap: wrap; gap: 10px 17px; margin: 16px 0 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 8px; }
.quotation-output-options legend { padding: 0 5px; }
.quotation-output-options label { display: inline-flex; align-items: center; gap: 6px; color: var(--navy); font-size: 13px; }
.quotation-output-progress { display: flex; align-items: center; gap: 9px; margin-top: 18px; padding: 11px 13px; color: var(--blue-dark); border: 1px solid #cfe0ef; border-radius: 8px; background: #f3f8fc; font-size: 13px; font-weight: 700; }
.quotation-output-progress[hidden] { display: none; }
.quotation-output-spinner { display: inline-block; width: 17px; height: 17px; flex: 0 0 auto; border: 2px solid #b9d2e7; border-top-color: var(--blue); border-radius: 50%; animation: quotation-output-spin .8s linear infinite; }
@keyframes quotation-output-spin { to { transform: rotate(360deg); } }
.quotation-output-dialog form.is-busy .dialog-actions { opacity: .72; }
.quotation-output-dialog form.is-busy .dialog-actions .btn-ghost { pointer-events: none; }
.quotation-output-dialog form.is-busy .dialog-close { pointer-events: none; }
.quotation-output-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.quotation-dialog-header { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 17px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.quotation-product-dialog { width: min(850px, calc(100% - 28px)); }
.quotation-product-search { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(220px, 1.25fr) auto; gap: 8px; margin-bottom: 15px; }
.quotation-product-search select, .quotation-product-search input { min-width: 0; width: 100%; }
.quotation-product-search button { white-space: nowrap; }
.quotation-product-results { display: grid; gap: 8px; max-height: 55vh; overflow-y: auto; }
.quotation-product-option { display: flex; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; }
.quotation-product-option img { width: 52px; height: 52px; object-fit: contain; border-radius: 5px; background: #f4f7fb; }
.quotation-product-option-info { display: grid; flex: 1; gap: 3px; min-width: 0; }
.quotation-product-option-info small { color: var(--muted); overflow-wrap: anywhere; }
.quotation-common-create-card, .quotation-common-list-card { margin-bottom: 20px; }
.quotation-common-create-card h2, .quotation-common-list-card h2 { margin-top: 0; }
.quotation-common-create-form { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 8px; }
.quotation-site-create-form { display: grid; grid-template-columns: minmax(220px, 1fr) 150px auto; gap: 12px; align-items: end; }
.quotation-site-create-form label { display: grid; gap: 6px; color: var(--navy); font-size: 13px; font-weight: 700; }
.quotation-site-enabled { display: inline-flex; align-items: center; gap: 5px; color: var(--navy); font-size: 13px; white-space: nowrap; }
.quotation-site-enabled input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.quotation-site-enabled input[type="checkbox"]:focus { outline: none; box-shadow: none; }
.quotation-sites-table { min-width: 820px; table-layout: fixed; }
.quotation-sites-table th:nth-child(1), .quotation-sites-table td:nth-child(1) { width: 50%; }
.quotation-sites-table th:nth-child(2), .quotation-sites-table td:nth-child(2) { width: 90px; }
.quotation-sites-table th:nth-child(3), .quotation-sites-table td:nth-child(3) { width: 12%; }
.quotation-sites-table th:nth-child(4), .quotation-sites-table td:nth-child(4) { width: 26%; }
.quotation-sites-table td input:not([type="checkbox"]) { width: 100%; min-width: 0; }
.quotation-sites-table td:nth-child(2) input { width: 90px; }
.quotation-site-actions { display: table-cell; vertical-align: middle; white-space: nowrap; }
.quotation-site-actions > label, .quotation-site-actions > button, .quotation-site-actions > form { display: inline-flex; vertical-align: middle; margin-right: 8px; }
.quotation-site-actions > form:last-child, .quotation-site-actions > button:last-of-type { margin-right: 0; }
.quotation-site-actions form { display: inline; }
.quotation-common-list-card td.quotation-site-actions > form { display: inline-flex; align-items: center; flex-wrap: nowrap; gap: 0; }
.quotation-site-actions .row-action { min-height: 32px; padding: 5px 8px; color: var(--blue-dark); border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; white-space: nowrap; }
.quotation-site-actions .row-action:hover, .quotation-site-actions .row-action:focus-visible { border-color: #b7cce1; background: #f2f7fc; outline: none; }
.quotation-site-actions .row-action.is-danger { color: #b4424e; border-color: transparent; background: transparent; font-size: 17px; }
.quotation-site-actions .row-action.is-danger:hover, .quotation-site-actions .row-action.is-danger:focus-visible { border-color: transparent; background: transparent; color: #8f2632; }
.form-help { color: var(--muted); font-size: 12px; }
.quotation-common-list-card td form { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.quotation-common-list-card td input[name="Text"] { min-width: min(400px, 100%); }

@media (max-width: 900px) {
    .quotation-filter-form, .quotation-filter-form.is-manager { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quotation-filter-actions { grid-column: 1 / -1; }
    .quotation-meta-grid { grid-template-columns: 1fr 1fr; }
    .quotation-meta-grid > div:first-child { grid-column: 1 / -1; }
    .quotation-lines-heading { flex-direction: column; }
    .quotation-line-toolbar { justify-content: flex-start; }
}

@media (max-width: 600px) {
    .quotation-filter-form, .quotation-filter-form.is-manager, .quotation-meta-grid, .quotation-common-create-form, .quotation-site-create-form { grid-template-columns: 1fr; }
    .quotation-filter-actions { grid-column: auto; }
    .quotation-product-search { grid-template-columns: 1fr; }
    .quotation-common-picker { align-items: stretch; flex-direction: column; }
    .quotation-common-picker select { min-width: 0; }
    .quotation-summary-card { justify-content: stretch; flex-direction: column; gap: 12px; }
    .quotation-summary-card > div { text-align: left; }
    .quotation-table-card > .quotation-table-heading { padding: 20px 19px 0; }
    .quotation-form-actions { flex-direction: column; }
    .quotation-form-actions .btn, .quotation-form-actions form { width: 100%; }
    .quotation-form-actions form .btn { width: 100%; }
    .quotation-output-fields { grid-template-columns: 1fr; }
    .quotation-output-dialog .dialog-actions { flex-direction: column-reverse; }
    .quotation-output-dialog .dialog-actions .btn { width: 100%; }
}
