/* THE VESSEL CODE — Application Styles v2.1 */
:root {
    --navy: #1a365d; --blue: #2b6cb0; --bg: #edf2f7;
    --red: #e53e3e; --green: #38a169; --amber: #dd6b20;
    --deep-navy: #0c1929;
    --deep-navy-mid: #122640;
    --login-accent: #2b6cb0;
    --design-w: 1920;
    --design-h: 1080;
    --ui-scale: 1;
    --ui-base-font: 16px;
    --space-xs: calc(4px * var(--ui-scale));
    --space-sm: calc(8px * var(--ui-scale));
    --space-md: calc(12px * var(--ui-scale));
    --space-lg: calc(16px * var(--ui-scale));
    --space-xl: calc(20px * var(--ui-scale));
    --btn-pad-y: calc(8px * var(--ui-scale));
    --btn-pad-x: calc(16px * var(--ui-scale));
    --btn-font: calc(14px * var(--ui-scale));
    --table-font: calc(13px * var(--ui-scale));
    --table-cell-pad-x: calc(8px * var(--ui-scale));
    --table-cell-pad-y: calc(7px * var(--ui-scale));
    --list-row-h: calc(40px * var(--ui-scale));
    --list-item-font: 12px;
    --list-item-head-font: 11px;
    --list-visible-rows: 20;
    --list-table-head-h: calc(40px * var(--ui-scale));
    --list-table-scroll-h: calc(1000px * var(--ui-scale));
    --hist-list-max-h: calc(1000px * var(--ui-scale));
}
* { box-sizing: border-box; }
html {
    scrollbar-gutter: stable;
}
body { margin: 0; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: #2d3748; font-size: var(--ui-base-font, 16px); }
.hidden { display: none !important; }

/* ── Login (Enterprise SaaS) ───────────────────────────────────── */
.login-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 32px 20px 24px;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(43, 108, 176, 0.18) 0%, transparent 55%),
        linear-gradient(165deg, var(--deep-navy) 0%, var(--deep-navy-mid) 45%, #0f1f33 100%);
    color: #fff;
}

.login-file-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 10px 16px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    text-align: center;
    border-bottom: 1px solid #fcd34d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.login-file-banner code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
    text-align: center;
    flex-shrink: 0;
}
.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: none;
    box-shadow: none;
    background: transparent;
}
.login-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.login-brand-text { display: flex; flex-direction: column; gap: 6px; }
.login-brand-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
}
.login-brand-tag {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.55);
}

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 440px;
    padding: 24px 0;
}

.login-card {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    padding: 36px 32px 28px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 4px 6px rgba(0, 0, 0, 0.04),
        0 12px 32px rgba(0, 0, 0, 0.18),
        0 24px 64px rgba(0, 0, 0, 0.12);
    color: #1a202c;
}

.login-card-head { margin-bottom: 24px; }
.login-card-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.02em;
}
.login-card-sub {
    margin: 0;
    font-size: 13px;
    color: #718096;
    line-height: 1.45;
}

.login-form { display: flex; flex-direction: column; gap: 0; }
.login-field { margin-bottom: 18px; }
.login-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    letter-spacing: 0.02em;
}
.login-field input,
.login-field select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    color: #1a202c;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    outline: none;
}
.login-field input::placeholder { color: #a0aec0; }
.login-field input:hover,
.login-field select:hover { border-color: #cbd5e0; }
.login-field input:focus,
.login-field select:focus {
    border-color: var(--login-accent);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
    background: #fff;
}
.login-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.login-submit {
    width: 100%;
    margin-top: 4px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: var(--navy);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.35);
}
.login-submit:hover {
    background: #234876;
    box-shadow: 0 4px 16px rgba(43, 108, 176, 0.4);
}
.login-submit:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(26, 54, 93, 0.3);
}
.login-submit:disabled,
.login-submit.is-busy {
    opacity: 0.85;
    cursor: wait;
    transform: none;
}
.login-submit:disabled:hover,
.login-submit.is-busy:hover {
    background: var(--navy);
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.35);
}
.login-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.35), 0 4px 16px rgba(43, 108, 176, 0.35);
}

.login-err {
    margin-top: 12px;
    min-height: 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--red);
    text-align: center;
}

.login-hint {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #edf2f7;
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
}
.login-hint-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 8px;
}
.login-hint-list {
    margin: 8px 0 0;
    padding-left: 18px;
}
.login-hint-list li { margin-bottom: 4px; }
.login-hint strong { color: var(--navy); font-weight: 600; }

.login-beta-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #2b6cb0;
    background: rgba(43, 108, 176, 0.12);
    border: 1px solid rgba(43, 108, 176, 0.25);
}

.login-download {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #edf2f7;
    text-align: center;
}
.login-download-btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    background: #f7fafc;
    border: 1px solid #cbd5e0;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.login-download-btn:hover {
    background: #edf2f7;
    border-color: var(--login-accent);
}
.login-download-note {
    margin: 8px 0 0;
    font-size: 11px;
    color: #94a3b8;
}

.tvc-web-deploy .login-hint { display: none !important; }

.login-main-site-link {
    margin: 0 0 8px;
    font-size: 12px;
}
.login-main-site-link a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-weight: 600;
}
.login-main-site-link a:hover { color: #fff; text-decoration: underline; }

.tvc-embed .login-screen { min-height: 100vh; }
.tvc-embed #loginFileBanner { display: none !important; }

.app-main-site-link {
    font-size: 12px;
    margin-right: 12px;
}
.app-main-site-link a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 600;
}
.app-main-site-link a:hover { text-decoration: underline; }

.login-footer {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.38);
    text-align: center;
    padding-bottom: 8px;
}

@media (max-width: 480px) {
    .login-card { padding: 28px 22px 22px; border-radius: 10px; }
    .login-brand-name { font-size: 18px; letter-spacing: 0.1em; }
}

.btn-block { width: 100%; margin-top: 8px; }

/* ═══════════ CMAXS Main Menu (work-centric) ═══════════ */
#mainMenuScreen { max-width: 1180px; margin: 0 auto; padding: 0 0 40px; }

/* Header: ship info (left) + dept toggle & actions (right) */
.cmaxs-header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: linear-gradient(135deg, var(--navy), #234876); color: #fff;
    padding: 12px 20px; flex-wrap: wrap;
}
.cmaxs-ship { display: flex; align-items: center; gap: 14px; }
.ship-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}
.ship-flag { font-size: 34px; line-height: 1; }
.ship-fields { display: flex; flex-direction: column; gap: 4px; }
.ship-name-row { display: flex; align-items: baseline; gap: 8px; }
.ship-name { font-size: 22px; letter-spacing: .3px; }
.fld-label { font-size: 10px; text-transform: uppercase; opacity: .7; letter-spacing: .5px; }
.fld-value { font-weight: 600; }
.ship-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; align-items: center; }
.ship-meta .fld-value { opacity: .95; }

.cmaxs-toprite { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dept-toggle {
    display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.12);
    padding: 4px 6px 4px 10px; border-radius: 8px;
}
.dept-label { font-size: 11px; text-transform: uppercase; opacity: .8; margin-right: 4px; }
.dept-btn {
    border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff;
    padding: 6px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 13px;
    transition: background .12s, color .12s;
}
.dept-btn:hover { background: rgba(255,255,255,.15); }
.dept-btn.active { background: #fff; color: var(--navy); }
.dept-fixed { font-size: 11px; padding: 4px 10px; letter-spacing: .02em; }
.dept-lock { font-size: 12px; opacity: .85; margin-left: 4px; }
.q-dept { font-size: 10px; font-weight: 700; color: #fff; background: var(--blue); border-radius: 6px; padding: 1px 6px; }
.btn-ghost { background: rgba(255,255,255,.15) !important; color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn-ghost:hover { background: rgba(255,255,255,.28) !important; }

/* dashboard dept toggle (dark on light) */
.dept-toggle-sm { background: #edf2f7; padding: 3px 4px; }
.dept-toggle-sm .dept-btn { border-color: #cbd5e0; color: #4a5568; padding: 5px 12px; font-size: 12px; }
.dept-toggle-sm .dept-btn:hover { background: #e2e8f0; }
.dept-toggle-sm .dept-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.cmaxs-legend {
    background: #fffbeb; border-bottom: 1px solid #f0e6c0; color: #7b5c1e;
    font-size: 12px; padding: 7px 20px;
}
.cmaxs-legend b { color: var(--navy); }

/* 메뉴(CMAXS 스타일): 선박=4열 workflow, HQ=Ship List + 메뉴 */
.cmaxs-body { padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.cmaxs-body.hq-mode { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
.menu-main-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.menu-main-col.hidden { display: none !important; }
.menu-right-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* HQ — Ship List와 메뉴 카드 분리(세로 스택) */
.hq-left-col {
    display: flex; flex-direction: column; gap: 16px; min-width: 0; align-self: start;
}
.hq-left-col.hidden { display: none !important; }
.hq-menu-cards { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hq-menu-cards .work-card { min-width: 0; }
.hq-menu-cards .wc-title { word-break: keep-all; overflow-wrap: break-word; }
.hq-menu-cards .mi-label { word-break: keep-all; overflow-wrap: break-word; line-height: 1.35; }

/* HQ Fleet ship list */
.fleet-list-panel {
    background: #fff; border-radius: 12px; border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,.06); overflow: hidden;
    display: flex; flex-direction: column;
}
.fleet-list-head { padding: 12px 14px; font-weight: 700; color: var(--navy); border-bottom: 1px solid #edf2f7; background: #f7fafc; }
.fleet-list-toolbar { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid #edf2f7; }
.fleet-view-btn {
    flex: 1; padding: 5px 8px; font-size: 11px; font-weight: 600; border: 1px solid #cbd5e0;
    background: #f7fafc; border-radius: 6px; cursor: pointer; color: #4a5568;
}
.fleet-view-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.fleet-search-bar { padding: 8px 10px; border-bottom: 1px solid #edf2f7; }
.fleet-search-bar .search-input { width: 100%; box-sizing: border-box; }
.admin-company-field {
    padding: 8px 10px 10px;
    border-bottom: 1px solid #edf2f7;
    background: #fff;
}
.admin-company-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 4px;
}
.admin-company-select {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 7px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 400;
    line-height: 1.4;
    background: #fff;
    color: #2d3748;
}
.admin-company-select:disabled {
    background: #edf2f7;
    color: #4a5568;
    cursor: default;
}
.fleet-list-panel[data-admin-layout="1"] .fleet-list-toolbar { display: none; }
.cmaxs-body.hq-mode:has(#fleetListPanel[data-admin-layout="1"]) {
    grid-template-columns: minmax(460px, 580px) minmax(0, 1fr);
}
.fleet-list-panel[data-admin-layout="1"] .fleet-table-wrap {
    overflow: auto;
    max-height: min(420px, 52vh);
    -webkit-overflow-scrolling: touch;
}
.fleet-list-panel[data-admin-layout="1"] .fleet-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
    font-size: 12px;
}
.fleet-list-panel[data-admin-layout="1"] .fleet-table th,
.fleet-list-panel[data-admin-layout="1"] .fleet-table td {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}
.fleet-list-panel[data-admin-layout="1"] .fleet-table .fleet-col-no { width: 40px; min-width: 40px; }
.fleet-list-panel[data-admin-layout="1"] .fleet-table .fleet-col-company { width: 96px; min-width: 96px; }
.fleet-list-panel[data-admin-layout="1"] .fleet-table .fleet-col-name { width: 148px; min-width: 128px; }
.fleet-list-panel[data-admin-layout="1"] .fleet-table .fleet-col-imo { width: 76px; min-width: 76px; }
.fleet-list-panel[data-admin-layout="1"] .fleet-table .fleet-col-delivery { width: 96px; min-width: 96px; }
.fleet-list-panel[data-admin-layout="1"] .fleet-table .fleet-col-appver { width: 80px; min-width: 72px; }
.fleet-list-panel[data-admin-layout="1"] .fleet-table .fleet-col-docs { width: 56px; min-width: 52px; }
.fleet-list-panel[data-admin-layout="1"] .fleet-table th:first-child,
.fleet-list-panel[data-admin-layout="1"] .fleet-table td:first-child { text-align: center; }
.fleet-list-panel[data-admin-layout="1"] .fleet-table.fleet-table--with-company th:nth-child(4),
.fleet-list-panel[data-admin-layout="1"] .fleet-table.fleet-table--with-company td:nth-child(4),
.fleet-list-panel[data-admin-layout="1"] .fleet-table:not(.fleet-table--with-company) th:nth-child(3),
.fleet-list-panel[data-admin-layout="1"] .fleet-table:not(.fleet-table--with-company) td:nth-child(3) {
    text-align: center;
}
.fleet-table-wrap { flex: 1; min-height: 0; overflow-y: auto; max-height: 300px; -webkit-overflow-scrolling: touch; }
.fleet-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.fleet-table .fleet-col-no { width: 32px; }
.fleet-table .fleet-col-imo { width: 58px; }
.fleet-table .fleet-col-delivery { width: 88px; }
.fleet-table .fleet-col-appver { width: 72px; }
.fleet-table .fleet-col-docs { width: 52px; }
.fleet-table .fleet-col-company { width: 72px; font-size: 10px; }
.fleet-table .fleet-col-name { width: auto; }
.fleet-table th { position: sticky; top: 0; background: var(--navy); color: #fff; padding: 7px 6px; text-align: left; font-weight: 600; z-index: 1; }
.fleet-table th:first-child,
.fleet-table td:first-child { text-align: center; padding-left: 4px; padding-right: 4px; }
.fleet-table th:nth-child(3),
.fleet-table td:nth-child(3) { text-align: center; padding-left: 4px; padding-right: 4px; }
.fleet-table th:nth-child(4),
.fleet-table td:nth-child(4) { white-space: nowrap; }
.fleet-table td:nth-child(2),
.fleet-table th:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-table td { padding: 7px 6px; border-bottom: 1px solid #edf2f7; }
.fleet-table th.fleet-cell-ver,
.fleet-table td.fleet-cell-ver,
.fleet-table th.fleet-cell-docs,
.fleet-table td.fleet-cell-docs {
    text-align: center;
}
/* HQ Ship List — all column headers and cells center-aligned */
.cmaxs-body.hq-mode .fleet-table th,
.cmaxs-body.hq-mode .fleet-table td {
    text-align: center;
}
.fleet-table td.fleet-cell-ver,
.fleet-table td.fleet-cell-docs {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}
.fleet-docs-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: #2d3748;
    cursor: pointer;
    line-height: 0;
    vertical-align: middle;
}
.fleet-docs-link:hover { color: #2b6cb0; }
.fleet-docs-icon {
    display: block;
    width: 16px;
    height: 16px;
}
.fleet-row { cursor: pointer; }
.fleet-row:hover { background: #ebf4ff; }
.fleet-row.selected { background: #bee3f8; font-weight: 600; }

.cmaxs-cards { min-width: 0; }
#cmaxsCards.cmaxs-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Shared section card — Menu / SPARE visual grouping */
.tvc-section-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    overflow: hidden;
    min-width: 0;
}
.tvc-section-head {
    padding: 12px 16px;
    border-bottom: 1px solid #edf2f7;
    background: #f7fafc;
}
.tvc-section-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.01em;
}
.tvc-section-sub {
    margin: 4px 0 0;
    font-size: 11px;
}
.tvc-section-body {
    padding: 14px 16px 16px;
    min-width: 0;
}
.tvc-section-body > .spare-flow-panel,
.tvc-section-body > .menu-flow-panel.spare-flow-panel {
    padding: 0;
}
.tvc-section-inventory .tvc-section-body {
    padding: 0;
}
.tvc-section-inventory .spare-import-banner {
    margin: 12px 16px 0;
}
.tvc-section-inventory .spare-layout {
    padding: 12px 16px 16px;
    min-height: calc(100vh - 320px);
}

.menu-flow-panel { padding: 0; }
/* Vessel Menu — 3 columns in one row (Daily / Monthly / If Necessary) */
.menu-flow-panel.spare-flow-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cmaxs-body.hq-mode .menu-flow-panel.spare-flow-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.menu-flow-panel .spare-flow-item {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.menu-flow-panel .mi-auth { font-size: 10px; font-weight: 700; color: #718096; flex-shrink: 0; }
.menu-flow-panel .mi-label { flex: 1; min-width: 0; }
.menu-flow-panel .mi-badge { margin-left: auto; flex-shrink: 0; }
.menu-flow-empty { font-size: 12px; padding: 8px 4px; margin: 0; text-align: center; }
.spare-flow-col.tone-daily { border-top: 3px solid var(--red); }
.spare-flow-col.tone-defect { border-top: 3px solid #805ad5; }
.spare-flow-col.tone-monthly { border-top: 3px solid var(--blue); }
.hq-menu-cards .menu-flow-panel { padding: 0; }
.work-card {
    background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06); display: flex; flex-direction: column;
    border-top: 4px solid var(--blue);
}
.work-card.tone-red { border-top-color: var(--red); }
.work-card.tone-blue { border-top-color: var(--blue); }
.work-card.tone-green { border-top-color: var(--green); }
.work-card.tone-amber { border-top-color: var(--amber); }
.work-card.tone-purple { border-top-color: #805ad5; }
.wc-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #f7fafc; border-bottom: 1px solid #edf2f7; }
.wc-icon { font-size: 26px; }
.wc-title { font-weight: 700; color: var(--navy); font-size: 15px; }
.wc-sub { font-size: 11px; color: #718096; }
.wc-items { display: flex; flex-direction: column; padding: 8px; gap: 4px; }
.work-card.flow-linear .wc-items,
.work-card.flow-monthly .wc-items { background: #fefce8; padding: 14px 12px; }

/* CMAXS workflow arrows */
.menu-flow { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.menu-flow-arrow { display: flex; justify-content: center; padding: 2px 0; line-height: 1; }
.menu-flow-arrow-icon {
    display: inline-block; font-size: 14px; color: #1a202c; font-weight: 900;
    text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.menu-flow-note {
    text-align: center; font-size: 12px; font-weight: 600; color: #2d3748;
    padding: 8px 10px; line-height: 1.45; border: 1px dashed #cbd5e0;
    border-radius: 8px; background: rgba(255,255,255,.65);
}
.menu-flow-split {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start;
    margin: 0 0 2px;
}
.menu-flow-col-main { display: flex; flex-direction: column; align-items: center; }
.menu-flow-col-opt {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    border-left: 2px solid #2d3748; padding-left: 10px;
}
.menu-flow-if {
    font-size: 11px; font-weight: 700; color: #4a5568; text-align: center;
    padding: 4px 0 6px; font-style: italic;
}
.menu-flow-monthly .menu-flow-col-main .menu-flow-arrow { width: 100%; }

.menu-item {
    display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px;
    cursor: pointer; font-size: 13px; color: #2d3748; transition: background .12s, border-color .12s, transform .08s, box-shadow .12s;
}
.menu-item:hover { background: #ebf4ff; border-color: #90cdf4; transform: translateX(2px); box-shadow: 0 2px 6px rgba(43,108,176,.12); }
.menu-item:active { transform: translateX(4px); background: #bee3f8; border-color: var(--blue); }
.menu-item.navigating { background: #bee3f8; border-color: var(--navy); pointer-events: none; }
.menu-item.disabled { color: #a0aec0; cursor: default; justify-content: center; font-size: 12px; }
.menu-item.disabled:hover { background: #fff; border-color: #e2e8f0; transform: none; }
.menu-item .mi-lock { margin-left: auto; font-size: 12px; opacity: .7; }
.mi-auth { font-weight: 700; color: var(--blue); font-size: 12px; min-width: 22px; }
.mi-label { flex: 1; }
.mi-go { color: #a0aec0; font-size: 18px; line-height: 1; }
.mi-badge { font-size: 11px; font-weight: 700; color: #fff; border-radius: 10px; padding: 1px 8px; }
.mi-red { background: var(--red); }
.mi-amber { background: var(--amber); }
.mi-blue { background: var(--blue); }
.mi-green { background: var(--green); }

/* Import & Export History panel (Menu) */
.hist-panel {
    background: #fff; border-radius: 12px; border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,.06); overflow: hidden;
    min-width: 0; max-width: 100%;
}
.cmaxs-body > .hist-panel,
.cmaxs-body > .hq-left-col,
.cmaxs-body > .menu-main-col,
.cmaxs-body > .menu-right-col { min-width: 0; }
.hist-head {
    padding: 12px 16px; font-weight: 700; font-size: 14px; color: var(--navy);
    border-bottom: 1px solid #edf2f7; display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 6px;
}
.hist-dept-note { font-size: 12px; font-weight: 500; color: #718096; white-space: nowrap; }
.hist-view-tabs { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid #edf2f7; flex-wrap: wrap; }
.hist-view-btn {
    flex: 1 1 auto; min-width: 0; border: 1px solid #cbd5e0; background: #f7fafc; color: #4a5568;
    padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700; text-align: center;
    transition: background .15s, border-color .15s, color .15s;
}
.hist-view-btn:hover { background: #edf2f7; }
.hist-view-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 2px 6px rgba(26,54,93,.25); }
.hist-panel .hist-table-wrap { max-height: 260px; overflow-x: hidden; overflow-y: auto; border-top: 1px solid #e2e8f0; }
.hist-panel .hist-table.hist-table-simple {
    width: 100%; min-width: 0; max-width: 100%; table-layout: fixed;
    border-collapse: collapse; font-size: 12px;
}
.hist-panel .hist-table-simple th,
.hist-panel .hist-table-simple td { white-space: normal; word-break: break-word; }
.hist-table-simple th:nth-child(1) { width: 48px; text-align: center; }
.hist-table-simple td:nth-child(1) { text-align: center; font-weight: 600; color: var(--navy); }
.hist-table-simple th:nth-child(2),
.hist-table-simple th:nth-child(3) { width: auto; }
.hist-empty { text-align: center !important; padding: 20px 10px !important; font-size: 12px; }
.hist-tabs { display: flex; gap: 4px; padding: 8px 12px 0; }
.hist-tab { border: 1px solid #e2e8f0; border-bottom: none; background: #f7fafc; color: #4a5568; padding: 6px 16px; border-radius: 8px 8px 0 0; cursor: pointer; font-size: 12px; font-weight: 600; }
.hist-tab.active { background: #fff; color: var(--navy); border-color: #cbd5e0; }
.hist-panel .hist-table-simple th { position: sticky; top: 0; background: var(--navy); color: #fff; padding: 8px 10px; text-align: left; font-weight: 600; }
.hist-panel .hist-table-simple td { padding: 7px 10px; border-bottom: 1px solid #edf2f7; }
.hist-panel .hist-table-simple tbody tr:nth-child(even) { background: #fbfdff; }
.hist-panel .hist-table-simple tbody tr:hover { background: #ebf4ff; }
.hist-file { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* legacy tiles (kept for compatibility) */
.cmaxs-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; padding: 32px; max-width: 1100px; margin: 0 auto; }
.menu-tile { border-radius: 12px; padding: 28px 20px; cursor: pointer; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.15); transition: transform .15s; min-height: 140px; display: flex; flex-direction: column; justify-content: center; }
.menu-tile:hover { transform: translateY(-4px); }
.tile-red { background: linear-gradient(145deg, #c53030, #9b2c2c); }
.tile-blue { background: linear-gradient(145deg, #2b6cb0, #1a365d); }
.tile-green { background: linear-gradient(145deg, #38a169, #276749); }
.tile-amber { background: linear-gradient(145deg, #dd6b20, #c05621); }
.tile-icon { font-size: 36px; margin-bottom: 8px; }
.tile-title { font-size: 18px; font-weight: 700; }
.tile-desc { font-size: 12px; opacity: .9; margin-top: 6px; }

/* Topbar */
.topbar { background: var(--navy); color: #fff; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.topbar h1 { margin: 0; font-size: 18px; }
.sub-bar { background: #2d3748; }
.btn-back { background: #4a5568 !important; }
.user-chip { text-align: right; font-size: 12px; }
#seedBanner { background: #fefcbf; border-bottom: 2px solid var(--amber); padding: 10px 20px; font-size: 13px; }

/* Dashboard */
.dashboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 16px 20px 0; }
.stat-card { background: #fff; border-radius: 10px; padding: 16px; border-left: 4px solid var(--blue); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat-card.overdue { border-left-color: var(--red); }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--navy); }
.stat-card .lbl { font-size: 12px; color: #718096; }
.stat-card.stat-filter { cursor: pointer; transition: box-shadow .15s, transform .1s; user-select: none; }
.stat-card.stat-filter:hover { box-shadow: 0 2px 10px rgba(0,0,0,.1); transform: translateY(-1px); }
.stat-card.stat-filter.active { background: #f7fafc; box-shadow: 0 0 0 2px var(--navy); }
.stat-card.overdue.stat-filter.active { box-shadow: 0 0 0 2px var(--red); background: #fff5f5; }
.actual-dashboard .stat-card.stat-filter[data-act-stat="pending"].active { box-shadow: 0 0 0 2px #d69e2e; background: #fffff0; }
.actual-dashboard .stat-card.stat-filter[data-act-stat="due30"].active { box-shadow: 0 0 0 2px var(--blue); }

.main-layout { display: grid; grid-template-columns: 220px 1fr 240px; gap: 12px; padding: 16px 20px; }
.panel { background: #fff; border-radius: 10px; border: 1px solid #e2e8f0; display: flex; flex-direction: column; overflow: hidden; min-height: 480px; }
.panel-head { padding: 10px 14px; border-bottom: 1px solid #e2e8f0; font-weight: 700; color: var(--navy); font-size: 13px; }
.panel-body { padding: 8px; overflow: auto; flex: 1; }

/* GROUP Tree */
.tree-panel { min-height: 460px; }
.tree-search-bar { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; }
.tree-search-bar .search-input { width: 100%; box-sizing: border-box; }
.tree-panel .panel-body.tree-scroll {
    flex: 1; min-height: 0; max-height: 420px;
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
.tree-empty { padding: 12px 10px; font-size: 12px; text-align: center; }
.tree-dept { font-size: 11px; font-weight: 700; color: #718096; padding: 8px 8px 2px; text-transform: uppercase; }
.tree-dept-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 4px;
    border-radius: 4px;
    margin: 2px 0 0;
}
.tree-dept-toggle:hover { color: #2c5282; background: #edf2f7; }
.tree-dept-chevron { font-size: 10px; line-height: 1; color: #4a5568; width: 10px; flex-shrink: 0; }
.tree-node { padding: 7px 10px; cursor: pointer; border-radius: 6px; font-size: 12px; display: flex; justify-content: space-between; align-items: center; margin: 1px 0; }
.tree-node:hover { background: #ebf8ff; }
.tree-node.selected { background: #bee3f8; font-weight: 600; }
.tree-badge { font-size: 10px; background: var(--red); color: #fff; padding: 1px 6px; border-radius: 8px; }
.tree-node-critical { font-weight: 600; color: #9b2c2c; }
.tree-node-critical:hover { background: #fff5f5; }
.tree-node-critical.selected { background: #fed7d7; color: #742a2a; }
.tree-actions { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px; border-bottom: 1px solid #e2e8f0; background: #f7fafc; }
.tree-actions .btn { flex: 1 1 auto; font-size: 11px; padding: 4px 6px; }
.tree-actions .btn:disabled { opacity: .45; cursor: not-allowed; }
.tree-node-empty { opacity: 0.85; font-style: italic; }
.tree-empty-tag { font-size: 10px; color: #718096; background: #edf2f7; border-radius: 8px; padding: 0 5px; margin-left: 4px; }
.group-editor-hint { font-size: 12px; margin: 0 0 10px; }
.tree-badge-crit { background: #c53030; margin-left: 4px; }
.tree-badge-crit-sm { background: #dd6b20; font-size: 9px; margin-left: 2px; }
.spare-sidebar .tree-count { font-size: 10px; color: #718096; margin-left: auto; margin-right: 4px; }

/* Filters */
.filter-bar { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap; align-items: center; }
.filter-tab { padding: 5px 12px; border-radius: 16px; border: 1px solid #cbd5e0; background: #fff; cursor: pointer; font-size: 12px; font-weight: 600; }
.filter-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.filter-tab.overdue-tab.active { background: var(--red); border-color: var(--red); }
.act-period-filter { display: flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid #cbd5e0; border-radius: 16px; background: #fff; font-size: 11px; }
.act-period-filter.active { border-color: var(--navy); background: #ebf8ff; }
.act-period-label { font-weight: 600; color: #4a5568; white-space: nowrap; margin-right: 2px; }
.act-period-input { padding: 3px 4px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 11px; width: 118px; }
.act-period-sep { color: #718096; font-weight: 600; }
.act-period-clear:hover { background: #2c5282; }
.search-input { flex: 1; min-width: 100px; padding: 6px 10px; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 12px; }
.list-filter-group-search-wrap {
    margin-bottom: 8px;
}
.search-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 100px;
}
.search-field-wrap .search-input {
    width: 100%;
    box-sizing: border-box;
    padding-right: 28px;
}
.tree-search-bar .search-field-wrap { width: 100%; min-width: 0; }
.spare-list-search-bar .search-field-wrap { flex: 1; min-width: 220px; }
.hist-toolbar .search-field-wrap,
.hist-toolbar .act-period-filter { flex-shrink: 0; }
.filter-bar .search-field-wrap { flex: 1; min-width: 140px; max-width: 320px; }
.search-clear-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: #e2e8f0;
    color: #4a5568;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.search-clear-btn:hover { background: #cbd5e0; color: #1a202c; }
.search-clear-btn.hidden { display: none; }
.fleet-search-bar .search-field-wrap,
.spare-consume-pick-search .search-field-wrap,
.spics-tx-search .search-field-wrap,
.tree-search-bar .search-field-wrap {
    width: 100%;
    min-width: 0;
}
.spare-consume-pick-search .search-field-wrap .search-input,
.spics-tx-search .search-field-wrap .search-input {
    width: 100%;
    box-sizing: border-box;
}
.count-label { padding: 4px 14px; font-size: 11px; color: #718096; }

/* Virtual List */
.virtual-scroll { height: 420px; overflow: auto; position: relative; border-top: 1px solid #e2e8f0; }
.wp-scroll { height: calc(100vh - 280px); min-height: 400px; }
.vl-viewport { position: relative; width: 100%; }
.vl-row { overflow: hidden; border-bottom: 1px solid #f0f0f0; }
.vl-head, .vl-head-wrap .vl-head {
    display: flex; align-items: center; font-size: var(--list-item-head-font); font-weight: 700; color: #4a5568;
    background: #f7fafc; padding: 8px 6px; border-bottom: 2px solid #e2e8f0;
}
/* 좁은 화면에서 좌우 스크롤 — 헤더는 JS로 스크롤 동기화 */
.vl-head-wrap { overflow: hidden; }
.sheet-scroll-actual .vl-inner,
.sheet-scroll-original .vl-inner { min-width: 924px; }
.vl-head-wrap.sheet-scroll-actual .vl-head,
.vl-head-wrap.sheet-scroll-original .vl-head { min-width: 924px; }
.sheet-scroll-actual .vl-cells,
.sheet-scroll-actual.vl-head-wrap .vl-head,
.sheet-scroll-original .vl-cells,
.sheet-scroll-original.vl-head-wrap .vl-head { min-width: 924px; }
.act-batch-btn:disabled { opacity: .45; cursor: not-allowed; }
.batch-report-modal { max-width: 920px; width: 96%; max-height: 90vh; overflow: auto; padding: 0; }
.batch-report-head { background: var(--navy); color: #fff; padding: 12px 18px; }
.batch-report-head h3 { margin: 0; font-size: 15px; }
.batch-report-head .muted { color: rgba(255,255,255,.85); margin: 4px 0 0; font-size: 12px; }
.batch-shared-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px 18px; background: #edf2f7; border-bottom: 1px solid #e2e8f0; }
.batch-shared-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; color: #4a5568; }
.batch-shared-fields input { padding: 6px 8px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 12px; }
.batch-cards { padding: 14px 18px; display: flex; flex-direction: column; gap: 14px; max-height: 52vh; overflow: auto; }
.batch-job-card { border: 1px solid #9ae6b4; border-radius: 8px; background: #f0fff4; padding: 12px 14px; }
.batch-card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.batch-card-head strong { color: #1a365d; font-size: 14px; }
.batch-card-sub { font-size: 12px; color: #553c9a; font-weight: 600; }
.batch-card-detail { font-size: 11px; margin: 0 0 8px; }
.batch-lbl { display: block; font-size: 11px; font-weight: 700; color: #22543d; margin: 8px 0 4px; }
.batch-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.batch-card-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: #22543d; }
.batch-card-grid input, .batch-card-grid select { padding: 5px 6px; border: 1px solid #9ae6b4; border-radius: 4px; font-size: 12px; }
.batch-chks { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; font-weight: 600; color: #22543d; }
.batch-actions { padding: 12px 18px; background: #edf2f7; margin: 0; }
.batch-wr-jobs {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 6px;
    background: #edf2f7;
}
.batch-wr-job-tag {
    padding: 5px 12px; border: 1px solid #cbd5e0; border-radius: 14px;
    background: #fff; font-size: 11px; font-weight: 700; color: #4a5568;
}
.batch-wr-job-tab {
    padding: 5px 12px; border: 1px solid #cbd5e0; border-radius: 14px;
    background: #fff; font-size: 11px; font-weight: 700; cursor: pointer; color: #4a5568;
}
.batch-wr-job-tab:hover { border-color: var(--navy); color: var(--navy); }
.batch-wr-job-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.batch-job-picker {
    grid-column: 1 / -1; margin: 4px 0 12px; padding: 8px;
    background: #fff; border: 1px solid #cbd5e0; border-radius: 6px;
    display: flex; flex-direction: column; gap: 6px;
}
.batch-job-picker-row {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    width: 100%; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 4px;
    background: #f7fafc; cursor: pointer; text-align: left;
}
.batch-job-picker-row:hover { border-color: var(--navy); background: #edf2f7; }
.batch-job-picker-row.active { border-color: var(--navy); background: #ebf4ff; }
.batch-job-picker-code { font-size: 12px; font-weight: 700; color: var(--navy); }
.batch-job-picker-item { font-size: 11px; color: #4a5568; line-height: 1.35; }
.batch-wr-stack { max-height: 62vh; overflow-y: auto; background: #edf2f7; }
.batch-wr-section { margin: 0; border-bottom: 2px solid #a0aec0; }
.batch-wr-section:last-child { border-bottom: none; }
.batch-wr-section .wr-page { max-height: none; overflow: visible; }
.batch-wr-scroll-field {
    width: auto; padding: 2px 5px; border: 1px solid #cbd5e0; border-radius: 3px;
    background: #edf2f7; font-size: 11px; text-align: left; cursor: pointer; color: #2d3748;
    height: 22px; box-sizing: border-box;
}
.batch-wr-scroll-field:hover { border-color: var(--navy); background: #e2e8f0; }
.batch-wr-scroll-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 22px; height: auto; }
.side-batch-codes {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; padding: 8px;
    background: #edf2f7; border-radius: 6px; border: 1px solid #cbd5e0;
}
.side-batch-code {
    padding: 3px 10px; border-radius: 12px; background: var(--navy); color: #fff;
    font-size: 11px; font-weight: 700;
}
.side-batch-btn { width: 100%; margin-top: 8px; }
.side-batch-btn:disabled { opacity: .45; cursor: not-allowed; }
.side-report-btns { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.orig-toolbar .btn-red { background: #c53030; color: #fff; border: none; }
.orig-toolbar .btn-red:disabled { opacity: .45; cursor: not-allowed; }
.orig-toolbar-sep { width: 1px; height: 22px; background: #cbd5e0; margin: 0 4px; }
.tab-toolbar-end { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.orig-toolbar .btn:disabled { opacity: .45; cursor: not-allowed; }
.orig-job-editor { max-width: 640px; width: 96%; }
.orig-job-editor h3 { margin: 0 0 12px; color: var(--navy); font-size: 16px; }
.orig-job-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.orig-job-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; color: #4a5568; }
.orig-job-form label.span2 { grid-column: span 2; }
.orig-job-form input, .orig-job-form select, .orig-job-form textarea {
    padding: 6px 8px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 12px;
}
.orig-job-form textarea { min-height: 56px; resize: vertical; }
.orig-job-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.vl-cells { display: flex; align-items: center; font-size: var(--list-item-font); padding: 0 6px; cursor: pointer; height: 100%; }
.vl-cells:hover { background: #f7fafc; }
.vl-cells.row-selected { background: rgba(66, 153, 225, 0.35) !important; }
.vl-cells.row-selected:hover { background: rgba(66, 153, 225, 0.45) !important; }
.vl-cells.row-overdue { background: #fff5f5; }
.vl-cells.row-overdue.row-selected { background: rgba(66, 153, 225, 0.35) !important; }
.sortable { cursor: pointer; color: var(--blue); }

.c-chk {
    width: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.c-crit {
    width: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    color: #9b2c2c;
    font-size: 11px;
    font-weight: 700;
}
.plan-crit-mark { display: block; }
.orig-inline-critical {
    width: 100%;
    min-width: 52px;
    padding: 4px 4px;
    font-size: 11px;
    box-sizing: border-box;
}
.sheet-original .c-chk { cursor: pointer; }
.c-chk input[type="checkbox"].orig-chk-disabled {
    cursor: pointer;
    opacity: 0.35;
    accent-color: #cbd5e0;
}
.c-chk input[type="checkbox"]:disabled:not(.orig-chk-disabled) {
    cursor: not-allowed;
    opacity: 0.35;
    accent-color: #cbd5e0;
}
.c-code { width: 72px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-s1,
.c-d1,
.c-d2 {
    flex: 1 1 0;
    min-width: 100px;
    position: relative;
    overflow: visible;
}
.c-s1 { color: #2c5282; font-weight: 600; }
.c-d1 { color: #553c9a; font-weight: 600; }
.vl-cell-tip-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}
.vl-cell-tip.vl-cell-tip-active::after {
    content: attr(data-tip);
    position: absolute;
    left: 0;
    top: calc(100% + 2px);
    padding: 6px 10px;
    background: #1a365d;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
    max-width: min(440px, 85vw);
    width: max-content;
    min-width: 100px;
    z-index: 300;
    border-radius: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
    pointer-events: none;
}
.plan-vl-scroll .vl-row { overflow: visible; z-index: 0; }
.plan-vl-scroll .vl-row.vl-row-tip-open { z-index: 50; }
.c-dept { width: 56px; flex-shrink: 0; }
.c-per { width: 56px; flex-shrink: 0; }
.c-pic { width: 48px; flex-shrink: 0; }
.c-next { width: 88px; flex-shrink: 0; }
.c-last { width: 88px; flex-shrink: 0; }
.vl-head .c-per,
.vl-head .c-pic,
.vl-head .c-next,
.vl-head .c-last,
.vl-head .c-st,
.vl-cells .c-per,
.vl-cells .c-pic,
.vl-cells .c-next,
.vl-cells .c-last,
.vl-cells .c-st {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
}
.c-st {
    width: 40px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.plan-st-mark { display: inline-flex; align-items: center; justify-content: center; }
.plan-st-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}
.plan-st-overdue .plan-st-badge { background: var(--red); }
.plan-st-due .plan-st-badge { background: var(--amber); }
.plan-st-postponed .plan-st-badge { background: #805ad5; }
.plan-st-ok.pill { font-size: 10px; padding: 2px 5px; }
.c-act { width: 72px; flex-shrink: 0; text-align: right; }

.pill { font-size: 10px; padding: 2px 6px; border-radius: 8px; font-weight: 700; color: #fff; background: #718096; white-space: nowrap; }
.pill-mark { margin-right: 2px; font-weight: 800; letter-spacing: 0; }
.btn-sm.btn-green:disabled, .btn.btn-green:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.3); }
.pill.overdue { background: var(--red); }
.pill.warn { background: var(--amber); }
.pill.ok { background: var(--green); }
.pill.postponed { background: #805ad5; }
.pill.pending-apr { background: #3182ce; }
.pill.defect { background: #c05621; }

/* Actual Plan — status dashboard filters */
.act-filter-dashboard {
    padding: 10px 14px 6px;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.act-filter-dashboard-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    min-width: min-content;
}
.act-dash-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 88px;
    padding: 8px 12px 10px;
    border-radius: 10px;
    border: 2px solid transparent;
    background: #f7fafc;
    cursor: pointer;
    font-family: inherit;
    transition: transform .1s, box-shadow .15s;
    flex-shrink: 0;
}
.act-dash-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.act-dash-btn.active { box-shadow: 0 0 0 2px currentColor; font-weight: 700; }
.act-dash-count {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}
.act-dash-label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}
.act-dash-sep {
    width: 1px;
    align-self: stretch;
    min-height: 48px;
    background: #cbd5e0;
    margin: 0 4px;
    flex-shrink: 0;
}
.act-dash-overdue { color: var(--red); background: #fff5f5; border-color: #fed7d7; }
.act-dash-overdue.active { background: var(--red); color: #fff; border-color: var(--red); }
.act-dash-overdue.active .act-dash-count { color: #fff; }
.act-dash-due30 { color: #c05621; background: #fffaf0; border-color: #feebc8; }
.act-dash-due30.active { background: var(--amber); color: #fff; border-color: var(--amber); }
.act-dash-due30.active .act-dash-count { color: #fff; }
.act-dash-postponed { color: #6b46c1; background: #faf5ff; border-color: #e9d8fd; }
.act-dash-postponed.active { background: #805ad5; color: #fff; border-color: #805ad5; }
.act-dash-postponed.active .act-dash-count { color: #fff; }
.act-dash-critical { color: #9b2c2c; background: #fff5f5; border-color: #feb2b2; }
.act-dash-critical.active { background: #9b2c2c; color: #fff; border-color: #9b2c2c; }
.act-dash-critical.active .act-dash-count { color: #fff; }
.act-dash-pending { color: #2b6cb0; background: #ebf8ff; border-color: #bee3f8; }
.act-dash-pending.active { background: #3182ce; color: #fff; border-color: #3182ce; }
.act-dash-pending.active .act-dash-count { color: #fff; }
.act-dash-total { color: #4a5568; background: #edf2f7; border-color: #e2e8f0; }
.act-dash-total.active { background: #718096; color: #fff; border-color: #718096; }
.act-dash-total.active .act-dash-count { color: #fff; }
@media (max-width: 720px) {
    .act-filter-dashboard-inner {
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
    .act-dash-btn { min-width: 76px; padding: 6px 10px 8px; }
    .act-dash-count { font-size: 17px; }
    .act-dash-label { font-size: 10px; white-space: normal; max-width: 72px; }
}
@media (max-width: 480px) {
    .act-filter-dashboard-inner {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        min-width: 0;
        overflow: visible;
    }
    .act-dash-sep { display: none; }
    .act-dash-total { grid-column: 1 / -1; }
    .act-filter-dashboard { overflow-x: visible; }
}

/* Captain Hub — All / Deck / Engine view dashboard */
.captain-view-dashboard {
    margin: 12px 16px 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    border-radius: 10px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(26, 54, 93, .25);
}
.captain-dash-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin-bottom: 10px; }
.captain-dash-title { font-weight: 800; font-size: 15px; }
.captain-dash-sub { font-size: 12px; opacity: .85; }
.captain-view-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.captain-view-btn {
    padding: 6px 16px; border: 1px solid rgba(255,255,255,.35); border-radius: 20px;
    background: rgba(255,255,255,.08); color: #fff; font-weight: 700; font-size: 12px; cursor: pointer;
}
.captain-view-btn.active { background: #fff; color: var(--navy); border-color: #fff; }
.captain-view-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.captain-stat-card {
    background: rgba(255,255,255,.12); border-radius: 8px; padding: 10px 12px; text-align: center;
}
.captain-stat-card.warn { background: rgba(237, 137, 54, .35); }
.captain-stat-card.deck { border-left: 3px solid #63b3ed; }
.captain-stat-card.engine { border-left: 3px solid #f6ad55; }
.captain-stat-num { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; }
.captain-stat-lbl { display: block; font-size: 10px; opacity: .9; margin-top: 4px; }

/* Account title badge (Header) — Officer / Engineer / Captain / Chief engineer / Superintendent */
.title-badge { background: var(--navy); color: #fff; font-size: 11px; letter-spacing: .02em; padding: 3px 9px; border-radius: 8px; display: inline-block; }

/* Work Plan toolbar */
.wp-toolbar {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    padding: 12px 20px; background: #fff; border-bottom: 1px solid #e2e8f0;
}
.wp-toolbar label { font-size: 12px; display: flex; align-items: center; gap: 4px; }
.wp-selected { font-size: 12px; margin-left: auto; }
.wp-head { margin: 0 20px; border-radius: 8px 8px 0 0; }
.wp-selected-row { background: #ebf8ff !important; outline: 1px solid var(--blue); }

/* Buttons */
.btn, button.btn { padding: 8px 14px; border: none; border-radius: 6px; font-weight: 700; cursor: pointer; color: #fff; background: var(--blue); font-size: 12px; }
.btn:disabled, .wp-tool:disabled { opacity: .4; cursor: not-allowed; }
.btn-green { background: var(--green); }
.btn-red { background: var(--red); }
.btn-sm { padding: 3px 8px; font-size: 11px; border: none; border-radius: 4px; cursor: pointer; color: #fff; background: var(--blue); }
.btn-sm.btn-green { background: var(--green); }
.btn-excel {
    background: #217346;
    border: 1px solid #185c37;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-excel:hover { background: #185c37; }
.btn-excel-icon {
    display: inline-grid;
    place-items: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border-radius: 2px;
    background: #fff;
    color: #217346;
    font-weight: 800;
    font-size: 10px;
    line-height: 1;
    font-family: "Segoe UI", Calibri, sans-serif;
}

/* Modals */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal.modal-over-consume { z-index: 10050; }
#spareItemHistoryModal { z-index: 10050; }
#spareConsumeModal.modal-over-spare-hist,
#spareReqWorkModal.modal-over-spare-hist { z-index: 10100; }
#spareItemHistoryModal .modal-box.wp-modal {
    width: 820px;
    max-width: 820px;
    min-width: 820px;
    height: auto;
    max-height: min(92vh, 720px);
    min-height: 0;
    padding: 24px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-sizing: border-box;
}
#spareItemHistoryModal .modal-box.wp-modal > .modal-x {
    flex-shrink: 0;
}
#spareItemHistoryBody {
    flex: 0 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
}
#spareItemHistoryBody .spare-item-hist-part-wrap { margin-bottom: 12px; }
#spareItemHistoryBody .spare-item-hist-table-panel {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
#spareItemHistoryBody .spare-data-table.spare-item-hist-table {
    min-width: 0 !important;
    width: 100%;
    table-layout: fixed;
}
#spareItemHistoryBody .spare-data-table.spare-item-hist-table th,
#spareItemHistoryBody .spare-data-table.spare-item-hist-table td {
    text-align: center !important;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 4px;
}
#spareItemHistoryBody .spare-data-table.spare-item-hist-table th {
    background: #f7fafc;
    font-weight: 700;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
}
#spareItemHistoryBody .spare-data-table.spare-item-hist-table tbody td {
    border-top: 1px solid #edf2f7;
}
#spareItemHistoryBody .spare-data-table.spare-item-hist-table .c-pno,
#spareItemHistoryBody .spare-data-table.spare-item-hist-table .c-cls,
#spareItemHistoryBody .spare-data-table.spare-item-hist-table .c-stk {
    color: inherit;
    font-weight: inherit;
}
#spareItemHistoryBody .spare-data-table tr.spare-row-focused.row-selected { cursor: default; }
#spareItemHistoryBody .spare-item-hist-consume-table,
#spareItemHistoryBody .spare-item-hist-req-table {
    table-layout: fixed;
    width: 100%;
}
#spareItemHistoryBody .spare-item-hist-req-table col {
    width: calc(100% / 9);
}
#spareItemHistoryBody .spare-item-hist-consume-table th,
#spareItemHistoryBody .spare-item-hist-consume-table td,
#spareItemHistoryBody .spare-item-hist-req-table th,
#spareItemHistoryBody .spare-item-hist-req-table td {
    text-align: center !important;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 8px;
}
#spareItemHistoryBody .wp-table .spare-consume-log-type {
    text-align: center;
    width: auto;
    padding-left: 8px;
    padding-right: 8px;
}
#spareItemHistoryBody .wp-table .spare-req-list-type {
    text-align: center !important;
}
#spareItemHistoryBody > .wp-title,
#spareItemHistoryBody > .spare-item-hist-part-wrap,
#spareItemHistoryBody > .wp-tabs {
    flex-shrink: 0;
}
#spareItemHistoryBody > .wp-tab-pane {
    min-height: 0;
    overflow: auto;
}
#spareItemHistoryBody > .wp-tab-pane-note {
    flex: 0 1 auto;
}
#spareItemHistoryBody > .wp-tab-pane-consumed,
#spareItemHistoryBody > .wp-tab-pane-requisition {
    flex: 0 1 auto;
    min-height: 280px;
    max-height: calc(min(92vh, 720px) - 280px);
    overflow: auto;
}
#spareItemHistoryBody > .wp-modal-actions {
    flex-shrink: 0;
    margin-top: 6px;
}
#spareItemHistoryBody .wp-proc-box,
#spareItemHistoryBody .wp-proc-input {
    min-height: 280px;
    max-height: none;
    box-sizing: border-box;
    resize: none;
}
#spareItemHistoryBody .wp-table-wrap {
    overflow-x: hidden;
    max-height: none;
    min-height: 280px;
    height: auto;
    box-sizing: border-box;
}
.modal-box { background: #fff; border-radius: 12px; padding: 24px; max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; position: relative; }
.modal-box.wide { max-width: 640px; }
.modal-box.wp-modal { max-width: 820px; width: 96%; }

/* Work Procedure / Documents modal — content-height (max 720px); History tab scrolls inside pane */
#workProcedureModal .modal-box.wp-modal,
#vesselDocsModal .modal-box.wp-modal {
    width: 820px;
    max-width: 820px;
    min-width: 820px;
    height: auto;
    max-height: min(92vh, 720px);
    min-height: 0;
    padding: 24px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-sizing: border-box;
}
#workProcedureModal .modal-box.wp-modal > .modal-x,
#vesselDocsModal .modal-box.wp-modal > .modal-x {
    flex-shrink: 0;
}
#workProcedureBody {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
}
#workProcedureBody > .wp-title,
#workProcedureBody > .wp-job-head,
#workProcedureBody > .wp-job-detail,
#workProcedureBody > .wp-tabs {
    flex-shrink: 0;
}
#workProcedureBody > .wp-tab-pane {
    min-height: 0;
    overflow: auto;
}
#workProcedureBody > .wp-tab-pane-procedure {
    flex: 0 1 auto;
}
#workProcedureBody > .wp-tab-pane-history {
    flex: 0 1 auto;
    min-height: 280px;
    max-height: calc(min(92vh, 720px) - 240px);
    overflow: auto;
}
#workProcedureBody > .wp-modal-actions,
#vesselDocsBody > .wp-modal-actions {
    flex-shrink: 0;
    margin-top: 6px;
}
#workProcedureBody .wp-proc-box,
#workProcedureBody .wp-proc-input {
    min-height: 280px;
    max-height: none;
    box-sizing: border-box;
}
#workProcedureBody .wp-table-wrap {
    max-height: none;
    min-height: 280px;
    height: auto;
    box-sizing: border-box;
}
#workProcedureBody .wp-table th {
    text-align: center;
    vertical-align: middle;
}
#workProcedureBody .wp-table td {
    text-align: center;
    vertical-align: middle;
}
#workProcedureBody .wp-table td.hist-type {
    white-space: nowrap;
}

#vesselDocsBody {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
}
#vesselDocsBody > .wp-title,
#vesselDocsBody > .wp-job-head,
#vesselDocsBody > .wp-job-detail {
    flex-shrink: 0;
}
#vesselDocsBody .vessel-docs-list {
    flex: 1 1 auto;
    min-height: 280px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    background: #f7fafc;
    box-sizing: border-box;
}
#vesselDocsBody .vessel-docs-empty {
    margin: 0;
    text-align: center;
    padding: 48px 12px;
}
#vesselDocsBody .vessel-docs-list .wr-attach-list-wrap {
    max-height: none;
    text-align: left;
}
#vesselDocsBody .vessel-docs-list .wr-attach-item {
    justify-content: flex-start;
}

.wp-title { margin: 0 0 8px; color: var(--navy); font-size: 18px; }
.wp-job-head { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #4a5568; margin-bottom: 4px; }
.wp-job-detail { font-size: 13px; color: #2d3748; margin: 0 0 12px; }
.wp-tabs { display: flex; gap: 4px; border-bottom: 2px solid #e2e8f0; margin-bottom: 12px; }
.wp-tab {
    border: none; background: #f7fafc; color: #4a5568; padding: 8px 14px; font-size: 12px; font-weight: 600;
    cursor: pointer; border-radius: 8px 8px 0 0; border: 1px solid #e2e8f0; border-bottom: none; margin-bottom: -2px;
}
.wp-tab.active { background: #fff; color: var(--navy); border-color: #cbd5e0; border-bottom: 2px solid #fff; }
.wp-meta-row { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; margin-bottom: 10px; color: #4a5568; }
.wp-label { font-size: 12px; font-weight: 700; color: var(--navy); display: block; margin-bottom: 6px; }
.wp-proc-box { min-height: 160px; max-height: 320px; }
.wp-proc-input {
    width: 100%;
    min-height: 160px;
    max-height: 320px;
    box-sizing: border-box;
    font-size: 13px;
    line-height: 1.45;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f7fafc;
    resize: vertical;
    font-family: inherit;
}
.wp-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    justify-content: space-between;
}
.wp-modal-actions-left {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.wp-modal-actions-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}
.wp-modal-actions-right.wp-attach-panel {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 160px;
    max-width: 300px;
}
.wp-modal-actions-right .wr-attach-list-wrap {
    width: 100%;
    max-height: 120px;
    overflow-y: auto;
    text-align: right;
}
.wp-modal-actions-right .wr-attach-item {
    justify-content: flex-end;
}
.wp-section { margin-bottom: 14px; }
.wp-section-head { font-weight: 700; font-size: 13px; color: var(--navy); margin-bottom: 6px; }
.wp-table-wrap { max-height: 200px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 8px; }
.wp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wp-table th { position: sticky; top: 0; background: #edf2f7; padding: 6px 8px; text-align: left; font-weight: 600; }
.wp-table td { padding: 6px 8px; border-top: 1px solid #edf2f7; }
.wp-hist-row { cursor: pointer; }
.wp-hist-row:hover { background: #ebf4ff; }
.wp-hist-hint { font-weight: 400; font-size: 11px; }

/* CMAXS Work Report / Defect Report — fixed modal width (layout never reflows) */
.modal-box.wr-modal {
    width: 1000px;
    max-width: 1000px;
    min-width: 1000px;
    height: min(92vh, 920px);
    max-height: 92vh;
    min-height: min(92vh, 920px);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
#workReportModal,
#defectReportModal,
#workPermitModal,
#spareConsumeModal {
    overflow: auto;
    align-items: flex-start;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
}
#workReportModal.modal-hist-swapping,
#defectReportModal.modal-hist-swapping,
#workPermitModal.modal-hist-swapping,
#spareConsumeModal.modal-hist-swapping {
    background: transparent;
    pointer-events: none;
}
#workReportModal.modal-hist-swapping .modal-box,
#defectReportModal.modal-hist-swapping .modal-box,
#workPermitModal.modal-hist-swapping .modal-box,
#spareConsumeModal.modal-hist-swapping .modal-box {
    visibility: hidden;
}
/* Work Procedure 위 data view — WP backdrop만 사용 (이중 dim / Prev·Next 깜빡임 방지) */
#workReportModal.modal-over-wp,
#defectReportModal.modal-over-wp,
#spareConsumeModal.modal-over-wp {
    background: transparent;
    pointer-events: none;
}
#workReportModal.modal-over-wp .modal-box,
#defectReportModal.modal-over-wp .modal-box,
#spareConsumeModal.modal-over-wp .modal-box {
    pointer-events: auto;
}
#workReportModal .modal-box.wr-modal,
#defectReportModal .modal-box.wr-modal,
#workPermitModal .modal-box.wr-modal {
    margin: auto;
}
#defectReportModal .modal-box.wr-modal.spare-req-work-modal,
#workPermitModal .modal-box.wr-modal.spare-req-work-modal {
    width: 1000px;
    max-width: 1000px;
    min-width: 1000px;
    height: min(92vh, 920px);
    min-height: min(92vh, 920px);
    max-height: 92vh;
}
.modal-box.wr-modal .wr-maint-approval { flex-wrap: nowrap; }
#workReportBody {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#workReportBody > .wr-titlebar,
#workReportBody > .batch-wr-jobs,
#workReportBody > .wr-tabsel,
#workReportBody > .wr-pagetabs-bar,
#workReportBody > .modal-actions,
#defectReportBody > .df-modal-inner > .wr-titlebar,
#defectReportBody > .df-modal-inner > .wr-pagetabs-bar,
#defectReportBody > .df-modal-inner > .modal-actions,
#workPermitBody > .df-modal-inner > .wr-titlebar,
#workPermitBody > .df-modal-inner > .wr-pagetabs-bar,
#workPermitBody > .df-modal-inner > .modal-actions {
    flex-shrink: 0;
}
#defectReportBody {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#defectReportBody > .df-modal-inner {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#defectReportBody > .df-modal-inner > .wr-page {
    flex: 1;
    min-height: 0;
    overflow: auto;
}
#workPermitBody {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#workPermitBody > .df-modal-inner {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#workPermitBody > .df-modal-inner > .wr-page {
    flex: 1;
    min-height: 0;
    overflow: auto;
}
#workPermitBody .wr-titlebar.wp-list-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 48px 10px 14px;
}
#workPermitBody .wr-titlebar.wp-list-head .wp-list-head-title {
    font-size: inherit;
    font-weight: inherit;
    margin: 0;
}
#workPermitModal .modal-x {
    top: 10px;
    right: 12px;
    z-index: 80;
    color: #fff;
}
#workReportBody > .wr-page {
    flex: 1;
    min-height: 0;
    max-height: none;
}
.wr-spare-job-context {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #d8e2ec;
    border-radius: 6px;
    font-size: 12px;
    flex-shrink: 0;
}
.wr-page .wr-spare-meta-form {
    margin: 0 0 10px;
}
.wr-spare-meta-form.wr-maint-body {
    gap: 10px;
}
.wr-spare-meta-form .wr-maint-field textarea.wr-ro {
    min-height: 68px;
    resize: none;
}
.wr-page2-job-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.wr-page2-job-rows .wr-page2-job-row {
    margin-top: 0;
}
.wr-spare-meta-form .wr-maint-job-pick,
#defectReportBody .wr-maint-job-pick,
#workPermitBody .wr-maint-job-pick,
#workReportBody .wr-maint-job-pick,
#spareConsumeBody .wr-maint-job-pick {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    background: #fff;
    color: #2d3748;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: unset;
    cursor: pointer;
}
.wr-page2-job-rows,
#defectReportBody .df-page1-job-rows,
#workPermitBody .df-page1-job-rows,
#workReportBody .df-page1-job-rows,
#spareConsumeBody .consume-report-meta .wr-page2-job-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#defectReportBody .df-page1-job-rows .wr-maint-grid-gap,
#workPermitBody .df-page1-job-rows .wr-maint-grid-gap,
#workReportBody .df-page1-job-rows .wr-maint-grid-gap,
#spareConsumeBody .consume-report-meta .wr-page2-job-rows .wr-maint-grid-gap {
    margin-top: 0;
}
.wr-spare-meta-form .wr-page2-job-grid-batch,
#defectReportBody .df-maint-job-grid-batch,
#workPermitBody .df-maint-job-grid-batch,
#workReportBody .df-maint-job-grid-batch,
#spareConsumeBody .consume-report-meta .df-maint-job-grid-batch {
    grid-template-columns: repeat(4, minmax(0, 1fr)) 36px;
}
.wr-spare-meta-form .wr-page2-job-row-act,
#defectReportBody .df-maint-job-row-act,
#workPermitBody .df-maint-job-row-act,
#workReportBody .df-maint-job-row-act,
#spareConsumeBody .consume-report-meta .df-maint-job-row-act {
    justify-content: flex-end;
    align-items: flex-end;
    padding-bottom: 2px;
}
.wr-spare-work-layout {
    flex: 1;
    min-height: 480px;
    min-width: 0;
}
.spare-layout.wr-spare-full-width,
.spare-layout.wr-spare-full-width.plan-layout,
.wr-spare-work-layout.wr-spare-full-width.plan-layout,
.spare-consume-work-layout.wr-spare-full-width.plan-layout,
.spare-req-work-layout.wr-spare-full-width.plan-layout,
.spare-receive-work-layout.wr-spare-full-width.plan-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0;
    padding: 0 !important;
}
#spareReqWorkModal .spare-req-work-layout.wr-spare-full-width,
#spareConsumeModal .spare-consume-work-layout.wr-spare-full-width,
#spareConsumeModal .spare-req-work-layout.wr-spare-full-width,
#spareReceiveModal .spare-receive-work-layout.wr-spare-full-width {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0;
}
.spare-receive-work-layout.wr-spare-full-width > .spare-main {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}
.spare-req-work-layout.wr-spare-full-width > .spare-main,
.spare-consume-work-layout.wr-spare-full-width > .spare-main,
.wr-spare-work-layout.wr-spare-full-width > .spare-main {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}
.wr-spare-toolbar {
    position: relative;
    z-index: 30;
    flex-wrap: nowrap;
    gap: 8px;
}
.wr-spare-toolbar-spacer {
    flex: 1 1 auto;
    min-width: 8px;
}
.wr-spare-toolbar-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
}
.wr-spare-tree-toggle-wrap {
    position: relative;
    display: inline-flex;
}
.wr-spare-tree-toggle-btn {
    max-width: min(240px, 42vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wr-spare-tree-toggle-btn.is-active,
.wr-spare-tree-toggle-btn.is-active:hover {
    background: #ebf8ff;
    border-color: #4299e1;
    color: #2b6cb0;
}
.wr-spare-tree-caret {
    font-size: 10px;
    opacity: 0.75;
    margin-left: 2px;
}
.wr-spare-tree-pop {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 220;
    width: min(320px, 92vw);
    max-height: min(420px, 58vh);
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
    flex-direction: column;
    overflow: hidden;
}
.wr-spare-tree-pop.is-open {
    display: flex;
}
.wr-spare-tree-pop-head {
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #2d3748;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
}
.wr-spare-tree-pop .tree-search-bar {
    padding: 8px 10px;
    border-bottom: 1px solid #edf2f7;
}
.wr-spare-tree-pop-body {
    flex: 1;
    min-height: 180px;
    max-height: min(340px, 48vh);
    overflow-y: auto;
    padding: 6px 0;
}
.wr-titlebar {
    background: var(--navy); color: #fff; font-weight: 700; font-size: 14px; padding: 10px 18px;
    cursor: grab; user-select: none; touch-action: none;
}
.wr-titlebar:active { cursor: grabbing; }
#workReportModal .wr-titlebar,
#defectReportModal .wr-titlebar,
#workPermitModal .wr-titlebar {
    cursor: default;
    touch-action: auto;
    user-select: text;
}
#workReportModal .wr-titlebar:active,
#defectReportModal .wr-titlebar:active,
#workPermitModal .wr-titlebar:active {
    cursor: default;
}
.modal-box.modal-is-dragged { transition: none; }
.wr-tabsel { display: flex; gap: 18px; padding: 8px 14px 0; background: #edf2f7; }
.wr-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #4a5568; cursor: pointer; padding-bottom: 6px; border-bottom: 3px solid transparent; }
.wr-radio.active { color: var(--navy); border-bottom-color: var(--green); }
.wr-radio.locked,
.wr-radio.locked input { cursor: not-allowed; opacity: 0.45; pointer-events: none; }
.wr-kind-tab {
    appearance: none;
    background: none;
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 0 2px 6px;
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    font-family: inherit;
}
.wr-kind-tab.active { color: var(--navy); border-bottom-color: var(--green); }
.wr-kind-tab.locked { cursor: not-allowed; opacity: 0.45; }
.wr-postpone-hq-opt { margin-top: 4px; }
.wr-postpone-hq-opt label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: #2d3748; }
.wr-pagetabs-bar {
    background: #edf2f7; padding: 0 14px; border-bottom: 1px solid #cbd5e0;
}
.wr-pagetabs { display: flex; gap: 4px; padding-top: 6px; }
.wr-pagetab {
    border: 1px solid #cbd5e0; border-bottom: none; background: #e2e8f0; color: #4a5568;
    padding: 5px 16px; font-size: 11px; font-weight: 700; cursor: pointer; border-radius: 6px 6px 0 0;
    min-width: 64px;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.wr-pagetab.active {
    background: #fff; color: var(--navy); border-color: #cbd5e0;
    box-shadow: none; margin-bottom: -1px; position: relative; z-index: 1;
}
.wr-page { padding: 8px 12px; overflow: auto; background: #eef1f5; font-size: 11px; }
.wr-page.tone-repair,
.wr-page.tone-trouble,
.wr-page.tone-postpone,
.wr-page.tone-defect { background: #eef1f5; padding: 12px 14px; }

/* Repair & Maintenance — Maintenance Report form */
.wr-maint-form { display: flex; flex-direction: column; gap: 10px; }
.wr-maint-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 12px 14px; box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
.wr-maint-body { display: flex; flex-direction: column; gap: 0; }
#defectReportBody .wr-maint-body,
#workPermitBody .wr-maint-body,
#workReportBody .wr-maint-body { gap: 10px; }
.wr-maint-grid-gap { margin-top: 12px; }
#defectReportBody .wr-maint-body > .wr-maint-grid-gap,
#workPermitBody .wr-maint-body > .wr-maint-grid-gap,
#workReportBody .wr-maint-body > .wr-maint-grid-gap { margin-top: 0; }
.wr-maint-body > .wr-maint-pms-crit-row {
    margin-top: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}
.wr-maint-pms-crit-row .spare-gh-label {
    font-size: 10px;
    font-weight: 700;
    color: #1a202c;
    text-transform: uppercase;
    letter-spacing: .03em;
    line-height: inherit;
}
.wr-maint-pms-crit-row .wr-pms-crit-pms-inner input.wr-ro,
.wr-maint-pms-crit-row .wr-pms-crit-pms-inner .spare-consume-pick-trigger,
.wr-maint-pms-crit-row .spare-gh-field > input.wr-ro,
.wr-maint-pms-crit-row .spare-gh-value {
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    color: #2d3748;
    min-height: auto;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    line-height: 1.4;
}
.wr-maint-pms-crit-row .wr-pms-crit-pms-inner input.wr-ro,
.wr-maint-pms-crit-row .spare-gh-field > input.wr-ro,
.wr-maint-pms-crit-row .spare-gh-value:not(.empty) {
    background: #f7fafc;
    color: #4a5568;
}
.wr-maint-pms-crit-row .wr-pms-crit-pms-inner .spare-consume-pick-trigger:disabled {
    background: #f7fafc;
    color: #4a5568;
    opacity: 1;
    cursor: default;
}
.wr-maint-pms-crit-row .spare-gh-value.empty {
    color: #a0aec0;
    background: #f7fafc;
}
.wr-maint-pms-crit-row .spare-consume-meta-pick { width: 100%; }
.wr-maint-grid { display: grid; gap: 10px 12px; }
.wr-maint-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wr-maint-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wr-maint-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wr-maint-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wr-maint-field.wr-maint-span-all { grid-column: 1 / -1; }
.wr-maint-field > label {
    font-size: 10px; font-weight: 700; color: #1a202c;
    text-transform: uppercase; letter-spacing: .03em;
}
.wr-maint-field .tvc-date-input-wrap {
    width: 100%;
    box-sizing: border-box;
}
.wr-maint-field input,
.wr-maint-field textarea,
.wr-maint-field select,
.wr-maint-batch-code {
    width: 100%; box-sizing: border-box;
    padding: 6px 8px; border: 1px solid #cbd5e0; border-radius: 5px;
    font-family: inherit;
    font-size: 11px; background: #fff; color: #2d3748;
    transition: border-color .15s, box-shadow .15s;
}
.wr-maint-field input:focus,
.wr-maint-field textarea:focus,
.wr-maint-field select:focus {
    outline: none; border-color: #4299e1; box-shadow: 0 0 0 2px rgba(66, 153, 225, .2);
}
/* Date text inputs — always show YYYY-MM-DD + optional calendar picker */
.tvc-date-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    vertical-align: middle;
    position: relative;
}
.tvc-date-input-wrap .tvc-date-input {
    flex: 1 1 auto;
    min-width: 7.5em;
    width: auto;
}
.tvc-date-picker-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: #f7fafc;
    color: #4a5568;
    cursor: pointer;
    line-height: 1;
}
.tvc-date-picker-btn:hover:not(:disabled) {
    background: #edf2f7;
    border-color: #a0aec0;
    color: #2d3748;
}
.tvc-date-picker-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.tvc-date-picker-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
}
.act-period-filter .tvc-date-input-wrap {
    width: 142px;
}
.act-period-filter .tvc-date-input-wrap .tvc-date-input {
    min-width: 0;
}
.spare-req-meta-date-range .tvc-date-input-wrap,
.spare-req-meta-audit .tvc-date-input-wrap {
    flex: 1;
    min-width: 0;
}
input.tvc-date-input {
    font-variant-numeric: tabular-nums;
    min-width: 9.8em;
}
input.tvc-date-input::placeholder {
    color: #718096;
}
.wr-maint-field input.wr-ro,
.wr-maint-field textarea.wr-ro { background: #f7fafc; color: #4a5568; }
.wr-maint-textarea { min-height: 68px; resize: vertical; line-height: 1.45; }
.wr-maint-approval {
    display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center;
    background: #fff;
    border-color: #e2e8f0;
}
#workReportBody .wr-page > .wr-maint-approval,
#defectReportBody .wr-page > .wr-maint-approval,
#workPermitBody .wr-page > .wr-maint-approval { margin-bottom: 10px; }
#defectReportBody .wr-maint-form > .wr-maint-approval,
#workPermitBody .wr-maint-form > .wr-maint-approval { margin-bottom: 0; }
.wr-maint-approval .wr-maint-date,
.wr-maint-approval .wr-ro {
    padding: 6px 8px; border: 1px solid #cbd5e0; border-radius: 5px;
    background: #f7fafc; font-size: 11px;
    width: auto !important; min-width: 118px; max-width: 240px; flex: 0 0 auto;
}
.wr-maint-approval-item { display: flex; align-items: center; gap: 8px; }
.spare-req-work-scroll > .wr-maint-approval,
.spare-consume-meta-form > .wr-maint-approval { margin-bottom: 10px; }
#spareConsumeBody .spare-req-work-scroll > .consume-report-meta {
    margin: 0;
    padding: 12px 14px 0;
    background: #eef1f5;
    font-size: 11px;
    font-family: inherit;
    flex-shrink: 0;
}
#spareConsumeBody .consume-report-meta > .wr-maint-approval {
    margin: 0;
    flex-wrap: nowrap;
    gap: 16px 28px;
    padding: 12px 14px;
    font-size: 11px;
}
#spareConsumeBody .consume-report-meta > .wr-maint-approval .wr-maint-chk {
    font-size: 11px;
    font-weight: 600;
    color: #2d3748;
    pointer-events: none;
    cursor: default;
}
#spareConsumeBody .consume-report-meta > .wr-maint-approval .wr-maint-chk input[type="checkbox"] {
    width: 15px;
    height: 15px;
    pointer-events: none;
    cursor: default;
}
#spareConsumeBody .consume-report-meta > .wr-maint-approval .wr-maint-date,
#spareConsumeBody .consume-report-meta > .wr-maint-approval .wr-ro {
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    background: #f7fafc;
    font-size: 11px;
    font-family: inherit;
    width: auto !important;
    min-width: 118px;
    max-width: 240px;
    flex: 0 0 auto;
}
#spareConsumeBody .consume-report-meta > .wr-maint-card.spare-consume-meta-form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
    padding: 12px 14px;
    margin: 0;
    gap: 10px;
}
#spareConsumeBody .consume-report-meta > .wr-maint-card.spare-consume-meta-form > .wr-page2-job-rows {
    margin-top: 0;
}
#spareConsumeModal .spare-req-work-scroll > .consume-report-meta .wr-spare-meta-form.wr-maint-card {
    margin: 0 14px 12px;
    flex-shrink: 0;
}
.wr-maint-chk {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 600; color: #2d3748; white-space: nowrap;
}
.wr-maint-chk input[type="checkbox"] { width: 15px; height: 15px; accent-color: #2b6cb0; }
.wr-maint-date { width: 118px !important; flex: 0 0 auto; }
.wr-maint-chk-field { justify-content: flex-end; padding-top: 18px; }
.wr-maint-labor { align-items: end; }
.wr-maint-field .spare-consume-meta-pick { width: 100%; min-width: 0; }
.wr-maint-field .spare-consume-pick-trigger { width: 100%; box-sizing: border-box; }
.wr-maint-chk-field .wr-footer-flag {
    margin: 0;
    white-space: normal;
}
.wr-maint-field .wr-attach-block { margin: 0; }
.wr-footer-flags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    padding: 12px 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.wr-footer-flag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    user-select: none;
}
.wr-footer-flag input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--navy);
    flex-shrink: 0;
}
.wr-footer-labor {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 200px)) minmax(0, 1fr);
    gap: 12px 20px;
    align-items: end;
}
.wr-footer-labor > .wr-footer-flag {
    align-self: end;
    margin-bottom: 6px;
    min-width: 0;
}
.wr-footer-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.wr-footer-section.wr-footer-company {
    background: #fafbfd;
}
.wr-footer-section .wr-maint-field > label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4a5568;
}
.wr-footer-attach { margin-top: 2px; }
.wr-footer-attach .wr-attach-block { margin: 0; }
@media (max-width: 640px) {
    .wr-footer-labor { grid-template-columns: 1fr; }
    .wr-footer-flags { flex-direction: column; align-items: flex-start; }
}
.wr-maint-attach-wrap { margin-top: 10px; }
.wr-maint-attach-wrap .wr-attach-block { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.wr-maint-attach-wrap .wr-attach-btn {
    align-self: flex-start;
    padding: 6px 12px; border: 1px solid #90cdf4; border-radius: 5px;
    background: #ebf8ff; color: #2c5282; font-size: 11px; font-weight: 600;
    cursor: pointer; transition: background .15s, border-color .15s;
}
.wr-maint-attach-wrap .wr-attach-btn:hover { background: #bee3f8; border-color: #63b3ed; }
.wr-maint-attach-wrap .wr-attach-label {
    font-size: 10px; font-weight: 700; color: #1a202c;
    text-transform: uppercase; letter-spacing: .03em;
}
.wr-maint-attach-wrap .wr-attach-list {
    margin: 0; padding: 0; list-style: none;
    border: 1px solid #e2e8f0; border-radius: 5px; background: #f8fafc;
}
.wr-maint-attach-wrap .wr-attach-item {
    padding: 6px 10px; font-size: 11px; border-bottom: 1px solid #edf2f7;
}
.wr-maint-attach-wrap .wr-attach-item:last-child { border-bottom: none; }
.wr-maint-attach-wrap .wr-attach-remove {
    width: 20px; height: 20px; font-size: 12px;
    background: #fff; border: 1px solid #feb2b2; color: #c53030; border-radius: 4px;
}
.wr-maint-attach-wrap .wr-attach-remove:hover { background: #fff5f5; }
.wr-maint-batch-code {
    text-align: left; cursor: pointer; background: #ebf8ff; border-color: #90cdf4;
    font-weight: 600; color: #2c5282;
}
.wr-maint-batch-code:hover { background: #bee3f8; }
.wr-maint-batch-job-list {
    margin-top: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}
.wr-maint-batch-job-header {
    padding: 6px 10px;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
}
.wr-maint-batch-h {
    font-size: 10px;
    font-weight: 700;
    color: #1a202c;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.wr-maint-job-col-head {
    font-size: 10px;
    font-weight: 700;
    color: #1a202c;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.wr-maint-job-rows-header { margin-bottom: 2px; }
.wr-batch-job-rows .wr-maint-batch-job-row { cursor: pointer; }
.wr-batch-job-rows .wr-maint-batch-job-row:hover { background: #f7fafc; }
.wr-batch-job-rows .wr-maint-batch-job-row-active { background: #e8f1ff !important; }
.wr-maint-batch-job-row {
    padding: 7px 10px;
    border-bottom: 1px solid #edf2f7;
    font-size: 11px;
    cursor: pointer;
    align-items: center;
    transition: background .12s;
}
.wr-maint-batch-job-row:last-child { border-bottom: none; }
.wr-maint-batch-job-row:hover { background: #f7fafc; }
.wr-maint-batch-job-row-active { background: #e8f1ff !important; }
.wr-maint-batch-cell {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #2d3748;
}
.wr-maint-batch-cell .wr-maint-batch-code { font-weight: 700; color: var(--navy); }
.wr-maint-field-nolabel label { display: none; }
.wr-maint-field-nolabel { gap: 0; }
.wr-page2-job-header { margin-bottom: 2px; }
.wr-page2-job-header .wr-maint-batch-h { padding-bottom: 0; }
.wr-page2-job-header .wr-maint-job-col-head { padding-bottom: 0; }
@media (max-width: 900px) {
    .wr-maint-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wr-maint-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .wr-maint-grid-4, .wr-maint-grid-3, .wr-maint-grid-2 { grid-template-columns: 1fr; }
}

/* CMAXS-style horizontal rows: label beside input */
.wr-form { display: flex; flex-direction: column; gap: 0; }
.wr-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    padding: 3px 0; border-bottom: 1px solid #e2e8f0;
}
.wr-row:last-child { border-bottom: none; }
.wr-fld {
    display: inline-flex; flex-direction: row; align-items: center; gap: 4px;
    flex: 0 1 auto; min-height: 24px;
}
.wr-fld label { font-size: 11px; font-weight: 600; color: #4a5568; white-space: nowrap; margin: 0; }
.wr-fld input, .wr-fld select {
    padding: 2px 5px; border: 1px solid #cbd5e0; border-radius: 3px;
    font-size: 11px; background: #fff; height: 22px; box-sizing: border-box;
    width: auto; min-width: 44px; max-width: 110px;
}
.wr-fld input.wr-ro { background: #f7fafc; color: #4a5568; }
.wr-fld.wr-grow { flex: 1 1 180px; min-width: 0; }
.wr-fld.wr-grow input, .wr-fld.wr-grow select, .wr-fld.wr-grow .batch-wr-scroll-field { flex: 1; max-width: none; width: 100%; min-width: 80px; }
.wr-fld.wr-in-code input, .wr-fld.wr-in-code .batch-wr-scroll-field { max-width: 72px; min-width: 56px; }
.wr-fld.wr-in-pic input { max-width: 48px; min-width: 36px; }
.wr-fld.wr-in-type input { max-width: 40px; min-width: 32px; }
.wr-fld.wr-in-date input { max-width: 118px; }
.wr-fld.wr-in-num input { max-width: 56px; min-width: 44px; text-align: right; }
.wr-fld.wr-in-sm input { max-width: 80px; }
.wr-fld.wr-in-reporter input { max-width: 96px; min-width: 48px; }
.wr-fld.wr-in-voy input { max-width: 64px; }
.wr-fld.wr-in-result select { max-width: 100px; }
.wr-fld.wr-chk label.wr-chk-inline, .wr-fld.wr-chk .wr-chk-inline {
    display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: #4a5568;
}
.wr-fld.wr-chk-active { background: #ebf8ff; border-radius: 4px; padding: 0 4px; }
.wr-fld.wr-chk-active input[type="checkbox"] { width: 14px; height: 14px; accent-color: #2b6cb0; }
.wr-fld.wr-chkline label { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #4a5568; }
.wr-fld.wr-chkline input[type="checkbox"] { width: 14px; height: 14px; }

/* legacy grid aliases → form rows */
.wr-head-grid, .wr-grid { display: contents; }

.wr-block {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 4px 0; border-bottom: 1px solid #e2e8f0;
}
.wr-block .wr-label {
    flex: 0 0 auto; min-width: 118px; max-width: 200px;
    font-size: 11px; font-weight: 600; color: #4a5568; margin: 4px 0 0; line-height: 1.3;
}
.wr-block .wr-area { flex: 1; min-width: 0; margin: 0; }
.wr-stack {
    display: block; padding: 4px 0;
    border-bottom: 1px solid #e2e8f0;
}
.wr-stack .wr-label {
    display: block; font-size: 11px; font-weight: 600; color: #4a5568;
    margin: 0 0 3px; line-height: 1.3;
}
.wr-stack .wr-area { width: 100%; margin: 0; }
.wr-label { display: block; font-size: 11px; font-weight: 700; color: #4a5568; margin: 6px 0 3px; }
.wr-area {
    width: 100%; box-sizing: border-box; padding: 4px 6px; border: 1px solid #cbd5e0;
    border-radius: 3px; font-family: inherit; font-size: 11px; resize: vertical; min-height: 44px;
}
.wr-area.wr-ro { background: #f7fafc; color: #718096; }
.wr-postpone-note { background: #fefcbf; border: 1px solid #f6e05e; border-radius: 4px; padding: 6px 10px; font-size: 11px; color: #744210; margin-bottom: 6px; }
.wr-postpone-critical-banner { background: #fff3cd; border: 1px solid #856404; border-radius: 4px; padding: 8px 10px; font-size: 11px; color: #744210; margin-bottom: 10px; }
.wr-postpone-approved-date input[type="date"] { border-color: var(--amber, #d69e2e); background: #fffaf0; font-weight: 600; }
.wr-maint-postpone-note { margin: 0 0 8px; }
.wr-postpone-date input { border-color: var(--red); background: #fffaf0; font-weight: 700; }
.wr-actions { padding: 10px 14px; background: #edf2f7; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.wr-actions.wr-actions-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(min-content, 1fr);
    align-items: center;
    gap: 12px;
    justify-content: stretch;
    flex-shrink: 0;
}
.wr-modal-actions-left,
.wr-modal-actions-center,
.wr-modal-actions-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.wr-modal-actions-left { justify-content: flex-start; }
.wr-modal-actions-center { justify-content: center; }
.wr-modal-actions-right { justify-content: flex-end; min-width: min-content; flex-wrap: wrap; }
.wr-spare-page { margin-top: 4px; }
.wr-spare-search { margin-bottom: 4px; }
.wr-spare-search-input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 13px; margin-bottom: 8px; }
.wr-table-wrap {
    overflow: auto;
    border: 1px solid #d8e2ec;
    border-radius: 6px;
    background: #fff;
    margin-bottom: 12px;
}
.wr-spare-hits { max-height: 200px; }
.wr-spare-used-wrap { max-height: 240px; }
.wr-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wr-table th {
    position: sticky; top: 0; z-index: 1;
    background: #edf2f7; padding: 6px 8px; text-align: left; font-weight: 600;
}
.wr-table td { padding: 6px 8px; border-top: 1px solid #edf2f7; }
.wr-spare-hit { cursor: pointer; }
.wr-spare-hit:hover { background: #ebf8ff; }
.wr-spare-qty { width: 64px; padding: 4px 6px; text-align: center; border: 1px solid #cbd5e0; border-radius: 4px; }
.wr-spare-empty { font-size: 12px; margin: 0 0 10px; }
.wr-attach-block {
    margin: 4px 0 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}
.wr-attach-toolbar {
    flex: 0 0 auto;
}
.wr-attach-list-wrap {
    width: 100%;
    margin-top: 8px;
    box-sizing: border-box;
}
.wr-maint-inline-box {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    background: #fff;
    box-sizing: border-box;
}
.wr-maint-inline-box .wr-maint-chk { margin: 0; }
.wr-maint-inline-attach { padding: 6px 8px; }
.wr-maint-inline-attach .wr-attach-block { margin: 0; }
.df-ship-initial-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}
.df-ship-initial-actions .wr-attach-block { margin: 0; }
.df-ship-initial-pair { width: 100%; }
@media (max-width: 640px) {
    .df-ship-initial-pair { grid-template-columns: 1fr; }
}
.wr-attach-btn { background: #2f855a; color: #fff; border: none; border-radius: 4px; padding: 5px 12px; font-size: 11px; cursor: pointer; }
.wr-attach-btn:hover:not(:disabled) { background: #276749; }
.wr-attach-btn:disabled { opacity: .65; cursor: not-allowed; }
.wr-attach-list { list-style: none; margin: 0; padding: 0; }
.wr-attach-item { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 0; border-bottom: 1px solid #e2e8f0; }
.wr-attach-link { color: #2b6cb0; text-decoration: none; font-weight: 600; }
.wr-attach-link:hover { text-decoration: underline; }
.wr-attach-size { font-size: 11px; color: #718096; }
.wr-attach-remove { margin-left: auto; border: none; background: #fed7d7; color: #c53030; width: 22px; height: 22px; border-radius: 4px; cursor: pointer; font-size: 14px; line-height: 1; }
.wr-attach-remove:hover { background: #feb2b2; }
.wr-attach-preview-btn {
    background: none; border: none; padding: 0; font: inherit; cursor: pointer;
    color: #2b6cb0; font-weight: 600; text-align: left; max-width: min(100%, 280px);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wr-attach-preview-btn:hover { text-decoration: underline; }
.wr-attach-name { color: #2b6cb0; font-weight: 600; max-width: min(100%, 280px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wr-attach-dl-btn {
    margin-left: auto; flex-shrink: 0;
    border: 1px solid #cbd5e0; background: #edf2f7; color: #2d3748;
    width: 24px; height: 22px; border-radius: 4px; cursor: pointer; font-size: 13px; line-height: 1;
}
.wr-attach-dl-btn:hover { background: #e2e8f0; }
.wr-attach-item:has(.wr-attach-remove) .wr-attach-dl-btn { margin-left: 0; }
.tvc-attach-preview-modal {
    z-index: 10350;
}
.tvc-attach-preview-box {
    width: min(calc(210mm + 48px), 96vw);
    max-width: min(calc(210mm + 48px), 96vw);
    max-height: 96vh;
    display: flex; flex-direction: column; overflow: hidden;
    box-sizing: border-box;
}
.tvc-attach-preview-title {
    margin: 0 32px 10px 0; font-size: 15px; word-break: break-all;
    flex-shrink: 0;
}
.tvc-attach-preview-body {
    flex: 0 1 auto;
    width: 210mm;
    max-width: 100%;
    height: 297mm;
    max-height: min(297mm, calc(96vh - 132px));
    margin: 0 auto;
    overflow: auto;
    background: #fff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
    box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
}
.tvc-attach-preview-body .tvc-attach-preview-doc,
.tvc-attach-preview-body .tvc-attach-preview-sheet,
.tvc-attach-preview-body .tvc-attach-preview-frame {
    align-self: stretch; width: 100%; height: 100%;
}
.tvc-attach-preview-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.tvc-attach-preview-frame { width: 100%; height: 100%; min-height: 0; border: none; background: #fff; }
.tvc-attach-preview-doc,
.tvc-attach-preview-sheet {
    width: 100%; height: 100%; max-height: none; overflow: auto;
    background: #fff; padding: 12mm 15mm; text-align: left;
    font-size: 13px; line-height: 1.55; box-sizing: border-box;
}
.tvc-attach-preview-doc p { margin: 0 0 8px; }
.tvc-attach-preview-table {
    border-collapse: collapse; width: 100%; font-size: 12px;
}
.tvc-attach-preview-table td,
.tvc-attach-preview-table th {
    border: 1px solid #cbd5e0; padding: 4px 6px; vertical-align: top;
}
.tvc-attach-preview-loading { margin: 24px 12px; text-align: center; }
.tvc-attach-preview-fallback { margin: 24px 12px; text-align: center; }
.tvc-attach-preview-actions { flex-shrink: 0; }
.wr-attach-empty { font-size: 12px; padding: 4px 0; }
.dept-pick-box { max-width: 380px; text-align: center; }
.dept-pick-box h3 { margin: 0 0 6px; color: var(--navy); }
.dept-pick-row { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }
.dept-pick-btn { flex: 1; padding: 18px 12px; font-size: 14px; line-height: 1.6; border-radius: 10px; }
.dept-pick-btn.deck { background: var(--blue); }
.dept-pick-btn.engine { background: var(--amber); }
.modal-x { position: absolute; top: 12px; right: 16px; border: none; background: none; font-size: 24px; cursor: pointer; color: #718096; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.proc-box { background: #f7fafc; border: 1px solid #e2e8f0; padding: 12px; border-radius: 8px; font-size: 13px; white-space: pre-wrap; max-height: 200px; overflow: auto; }

.detail-dl { font-size: 12px; display: grid; grid-template-columns: 90px 1fr; gap: 4px; }
.muted { color: #a0aec0; font-size: 12px; }
.queues { padding: 0 20px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.queue-panel { background: #fff; border-radius: 10px; border: 1px solid #e2e8f0; padding: 14px; }
.queue-item { padding: 8px; border: 1px solid #e2e8f0; border-radius: 6px; margin-bottom: 6px; font-size: 12px; }

@media (max-width: 960px) {
    .main-layout { grid-template-columns: 1fr; }
    .dashboard { grid-template-columns: 1fr 1fr; }
    /* 좁은 화면에서는 열을 숨기지 않고 좌우 스크롤로 전체를 확인 */
    .actual-layout { grid-template-columns: 1fr; }
}

/* ═══════════ CMAXS Tab Navigation ═══════════ */
#appShell { max-width: 1280px; margin: 0 auto; }
.tab-bar {
    display: flex; gap: 2px; background: var(--navy); padding: 0 12px;
    position: sticky; top: 0; z-index: 50; overflow-x: auto; overflow-y: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.tab-btn {
    border: none; background: transparent; color: #cbd5e0; cursor: pointer;
    padding: 12px 18px; font-size: 13px; font-weight: 600; white-space: nowrap;
    border-bottom: 3px solid transparent; transition: color .12s, background .12s, border-color .12s, box-shadow .12s;
    position: relative;
}
.tab-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.tab-btn.active {
    color: var(--navy); background: var(--bg); font-weight: 800;
    border-bottom: 4px solid var(--amber);
    box-shadow: inset 0 2px 0 rgba(255,255,255,.6);
}
.tab-btn.active::after {
    content: ''; position: absolute; bottom: -1px; left: 8px; right: 8px;
    height: 2px; background: var(--bg); border-radius: 2px 2px 0 0;
}
.tab-bar-settings {
    margin-left: auto;
    align-self: center;
    border: 1px solid rgba(255,255,255,.28);
    background: rgba(255,255,255,.08);
    color: #e2e8f0;
    cursor: pointer;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 8px;
    transition: background .12s, color .12s, border-color .12s;
}
.tab-bar-settings:hover {
    color: #fff;
    background: rgba(255,255,255,.16);
    border-color: rgba(255,255,255,.45);
}

.modal-box.settings-modal { max-width: 560px; padding: 22px 24px 18px; }
.settings-title { margin: 0 0 18px; color: var(--navy); font-size: 20px; }
.settings-section + .settings-section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #edf2f7;
}
.settings-section-title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #64748b;
}
.settings-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}
.settings-row-main { min-width: 0; flex: 1; }
.settings-label { font-size: 12px; font-weight: 700; color: #334155; margin-bottom: 4px; }
.settings-path {
    font-size: 12px;
    color: #1a202c;
    word-break: break-all;
    line-height: 1.45;
}
.settings-note { margin-top: 6px; font-size: 11px; line-height: 1.4; }
.settings-row-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}
.settings-outline-btn {
    background: #fff !important;
    color: var(--blue) !important;
    border: 1px solid #cbd5e0 !important;
    min-width: 96px;
}
.settings-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.settings-field input {
    padding: 8px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 13px;
}
.settings-actions { margin-top: 4px; }
.settings-msg {
    margin: 10px 0 0;
    font-size: 12px;
    font-weight: 600;
}
.settings-msg.is-error { color: #c53030; }
.settings-msg.is-ok { color: #276749; }
.settings-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #edf2f7;
    display: flex;
    justify-content: flex-end;
}

.wr-file-no-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.wr-file-no-row input { flex: 1; min-width: 0; }
.wr-file-no-pick-btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 11px;
    padding: 6px 10px;
}
.wr-file-no-pick-btn.is-open {
    background: #ebf8ff;
    border-color: #4299e1;
    color: #2b6cb0;
}
.wr-file-no-anchor {
    position: relative;
    overflow: visible;
}
.wr-file-no-anchor.is-file-no-pick-open {
    z-index: 500;
}
.wr-file-no-popover {
    left: 0;
    right: auto;
    width: 760px;
    min-width: 0;
    max-width: min(760px, 100%);
    box-sizing: border-box;
    overflow-x: hidden;
}
.wr-file-no-popover.spare-req-hist-popover {
    width: 760px;
    min-width: 0;
    max-width: min(760px, 100%);
    overflow-x: hidden;
}
#workPermitBody .wp-meta-form .wr-file-no-popover.spare-req-hist-popover {
    width: 760px;
    min-width: 0;
    max-width: min(760px, 100%);
    overflow-x: hidden;
}
.wr-file-no-popover .file-no-pick-search {
    margin: 0 12px 10px;
}
.wr-file-no-popover .file-no-pick-table-wrap {
    margin: 0 12px;
    max-height: min(360px, 50vh);
    overflow-x: hidden;
    overflow-y: auto;
    max-width: calc(100% - 24px);
}
.wr-file-no-popover .spare-req-hist-hint {
    margin: 8px 12px 10px;
}
.file-no-pick-search { margin: 0 0 12px; }
.file-no-pick-table-wrap {
    max-height: min(420px, 55vh);
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.file-no-pick-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 12px;
}
.file-no-pick-table th,
.file-no-pick-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}
.file-no-pick-table th {
    background: #f7fafc;
    position: sticky;
    top: 0;
    z-index: 1;
}
.file-no-pick-row { cursor: pointer; }
.file-no-pick-row:hover { background: #ebf8ff; }
.file-no-pick-empty { padding: 16px 4px; text-align: center; }
.file-no-pick-table .hist-type-h,
.file-no-pick-table .hist-type {
    width: 5%;
    text-align: center;
    padding: 4px 2px;
    vertical-align: middle;
}
.file-no-pick-table .hist-type-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}
.file-no-pick-table .hist-type-defect .hist-type-mark { background: #c05621; }
.file-no-pick-table .hist-type-postpone .hist-type-mark { background: #805ad5; }
.file-no-pick-table .hist-type-maint .hist-type-mark { background: #2b6cb0; }
.file-no-pick-table .hist-type-wp .hist-type-mark { background: #0d9488; }
.file-no-pick-table .hist-file-h,
.file-no-pick-table .hist-file { width: 22%; }
.file-no-pick-table .hist-code-h,
.file-no-pick-table .hist-code { width: 16%; }
.file-no-pick-table .hist-sort1-h,
.file-no-pick-table .hist-sort1 { width: 32%; }
.file-no-pick-table .hist-date-h,
.file-no-pick-table .hist-date {
    width: 20%;
    white-space: normal;
}
.file-no-pick-table .hist-crit-h,
.file-no-pick-table .hist-crit {
    width: 5%;
    text-align: center;
    padding: 4px 2px;
    vertical-align: middle;
    box-sizing: border-box;
}
.file-no-pick-table .hist-crit .plan-crit-mark { display: block; margin: 0 auto; }
.file-no-pick-table .hist-th-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    gap: 1px;
}

#tabContent { background: var(--bg); min-height: 60vh; }
.tab-pane { animation: fade .15s ease; }
@keyframes fade { from { opacity: .4; } to { opacity: 1; } }

/* Sheet headings */
.sheet-head { display: flex; align-items: baseline; gap: 12px; padding: 16px 20px 4px; }
.sheet-head h2 { margin: 0; color: var(--navy); font-size: 20px; }
.plan-calc-msg { font-size: 12px; color: #276749; font-weight: 600; background: #f0fff4; padding: 4px 10px; border-radius: 6px; border: 1px solid #9ae6b4; }
.plan-calc-modal { z-index: 20000; pointer-events: none; background: rgba(0,0,0,.35); }
.plan-calc-modal.hidden { display: none !important; }
.plan-calc-box { max-width: 420px; text-align: center; padding: 28px 32px; pointer-events: auto; }
.plan-calc-title { margin: 0 0 12px; color: var(--navy); font-size: 18px; }
.plan-calc-text { margin: 0 0 16px; font-size: 13px; color: #4a5568; }
.plan-calc-track { height: 22px; background: #e2e8f0; border: 1px solid #cbd5e0; border-radius: 4px; overflow: hidden; }
.plan-calc-fill { height: 100%; width: 0; background: linear-gradient(90deg, #48bb78, #38a169); transition: width .08s linear; }
.plan-update-box { max-width: 520px; background: #ece9d8; border: 1px solid #808080; }
.plan-update-title { margin: 0 0 12px; font-size: 16px; color: #003399; text-align: center; }
.plan-update-msg { font-size: 12px; line-height: 1.5; color: #000; margin: 0 0 12px; }
.plan-update-status { font-size: 12px; margin: 0 0 10px; }
.plan-update-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 12px; background: #fff; }
.plan-update-table th, .plan-update-table td { border: 1px solid #808080; padding: 6px 10px; text-align: center; }
.plan-update-table th { background: #d4d0c8; font-weight: 600; }
.plan-update-table td:first-child { text-align: left; font-weight: 600; }
.plan-up-rate { color: #c53030; font-weight: 700; }
.plan-update-pending { font-size: 11px; color: #744210; background: #fefcbf; border: 1px solid #f6e05e; padding: 6px 8px; border-radius: 4px; margin-bottom: 10px; }
.plan-update-sign label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.plan-update-sign input { flex: 1; padding: 4px 8px; border: 1px solid #808080; font-size: 12px; max-width: 120px; }
.plan-update-actions { justify-content: flex-end; gap: 8px; margin-top: 14px; }
.sheet-sub { font-size: 12px; color: #718096; }

/* Plan layout (Original / Actual) */
.plan-layout { display: grid; grid-template-columns: 240px 1fr; gap: 12px; padding: 12px 20px 24px; }
.orig-layout, .actual-layout { grid-template-columns: 240px 1fr; }
.plan-layout .panel { min-height: 460px; }
.plan-layout main.panel.plan-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.plan-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 8px 20px 12px;
}
.plan-group-header {
    padding: 0 12px;
    flex-shrink: 0;
}
.plan-list-panel {
    flex: 1;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.plan-vl-scroll {
    flex: 1;
    min-height: 280px;
    max-height: calc(100vh - 380px);
    height: auto;
    scrollbar-gutter: stable;
}
#origHead.vl-head-wrap,
#actHead.vl-head-wrap {
    overflow: hidden;
    box-sizing: border-box;
    background: #f7fafc;
    box-shadow: inset 0 -2px 0 #e2e8f0;
}
.plan-filter-bar {
    border-bottom: none;
    padding-bottom: 4px;
}
.plan-group-header .spare-group-header-card {
    margin: 0;
}
.plan-group-header .spare-group-header {
    margin: 0;
}
.orig-job-edit-block:empty {
    display: none;
}
.orig-job-inline-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: #fff;
    border-bottom: 1px solid #bee3f8;
}
.orig-job-inline-meta-label {
    font-size: 11px;
    font-weight: 700;
    color: #4a5568;
    flex-shrink: 0;
}
.orig-job-inline-table {
    width: 100%;
    min-width: 1044px;
    table-layout: fixed;
    border-collapse: collapse;
}
.orig-job-inline-table th,
.orig-job-inline-table td {
    display: table-cell;
    flex: none;
    box-sizing: border-box;
    vertical-align: middle;
}
.orig-job-inline-table .c-chk {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    text-align: center;
    padding: 0 4px;
}
.orig-job-inline-table .c-crit {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    text-align: center;
    padding: 0 4px;
}
.orig-job-inline-table .c-code {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
}
.orig-job-inline-table .c-s1,
.orig-job-inline-table .c-d1,
.orig-job-inline-table .c-d2 {
    width: auto;
    min-width: 100px;
}
.orig-job-inline-table .c-per {
    width: 100px;
    min-width: 100px;
}
.orig-job-inline-table .c-pic {
    width: 80px;
    min-width: 80px;
}
.orig-inline-pic {
    width: 100%;
    min-width: 72px;
    max-width: 80px;
    font-size: 11px;
    padding: 4px 2px;
    box-sizing: border-box;
}
.orig-job-inline-table .c-next,
.orig-job-inline-table .c-last {
    width: 130px;
    min-width: 130px;
}
.orig-job-inline-table .c-next .tvc-date-input-wrap,
.orig-job-inline-table .c-last .tvc-date-input-wrap {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    gap: 2px;
}
.orig-job-inline-table .c-next .tvc-date-input-wrap .tvc-date-input,
.orig-job-inline-table .c-last .tvc-date-input-wrap .tvc-date-input,
.orig-inline-date {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    font-size: 12px;
    font-family: inherit;
    padding: 3px 6px;
    box-sizing: border-box;
}
.orig-job-inline-table .c-next .tvc-date-picker-btn,
.orig-job-inline-table .c-last .tvc-date-picker-btn {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}
.orig-inline-period {
    display: flex;
    align-items: center;
    gap: 4px;
}
.orig-inline-period .spare-inline-input-num {
    max-width: none;
    width: 48px;
    min-width: 48px;
    flex-shrink: 0;
    margin: 0;
}
.orig-inline-unit {
    width: 44px;
    min-width: 44px;
    padding: 4px 2px;
    flex-shrink: 0;
}
.orig-inline-ro {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--navy);
}
.plan-action-batch-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-right: 4px;
}
.plan-action-batch-code {
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--navy);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}
.plan-action-btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.plan-action-btns .btn:disabled { opacity: .45; cursor: not-allowed; }
.plan-action-btns .btn.plan-selected-filter-active {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.plan-action-btns .btn.plan-selected-filter-active:hover {
    background: #234876;
    border-color: #234876;
}
.plan-action-btns .plan-new-defect-btn {
    margin-left: auto;
}
.queues-side .panel-body { display: flex; flex-direction: column; gap: 12px; }

/* Sheet tables (History / Run Hrs) */
.sheet-table-wrap { margin: 12px 20px 24px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; overflow: auto; max-height: 68vh; }
/* Work History / Defect Report — scrollable list (≈20 rows) */
#tab-history .list-table-scroll-wrap,
#tab-defect .list-table-scroll-wrap {
    max-height: var(--hist-list-max-h);
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #a0aec0 #edf2f7;
}
#tab-history .list-table-scroll-wrap::-webkit-scrollbar,
#tab-defect .list-table-scroll-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
#tab-history .list-table-scroll-wrap::-webkit-scrollbar-track,
#tab-defect .list-table-scroll-wrap::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 4px;
}
#tab-history .list-table-scroll-wrap::-webkit-scrollbar-thumb,
#tab-defect .list-table-scroll-wrap::-webkit-scrollbar-thumb {
    background: #a0aec0;
    border-radius: 4px;
}
#tab-history .list-table-scroll-wrap::-webkit-scrollbar-thumb:hover,
#tab-defect .list-table-scroll-wrap::-webkit-scrollbar-thumb:hover {
    background: #718096;
}
.sheet-table-wrap.list-table-scroll-wrap {
    max-height: var(--list-table-scroll-h);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}
#tab-defect .list-table-scroll-wrap .hist-table tbody tr,
#tab-history .list-table-scroll-wrap .hist-table tbody tr {
    height: var(--list-row-h);
}
#tab-defect .list-table-scroll-wrap .hist-table td,
#tab-history .list-table-scroll-wrap .hist-table td {
    padding: 6px 10px;
    vertical-align: middle;
    line-height: 1.25;
    box-sizing: border-box;
}
#tab-defect .list-table-scroll-wrap .hist-table th,
#tab-history .list-table-scroll-wrap .hist-table th {
    padding: 8px 10px;
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--navy);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
.hist-toolbar { padding: 8px 14px; }
.spare-hist-req-host {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}
.spare-hist-req-host .spare-hist-req-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
    background: transparent;
    gap: 8px;
    width: 100%;
}
.spare-hist-req-host .hist-toolbar-stack {
    margin: 0;
    width: 100%;
}
#histPmsPane .hist-legend {
    margin: 0;
}
.spare-hist-req-host .req-list-phase-tabs {
    padding-left: 0;
    padding-right: 0;
    background: transparent;
    border-bottom: none;
}
.hist-scope-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 20px 0;
    border-bottom: 2px solid #e2e8f0;
    margin: 0 0 8px;
}
.hist-scope-tab {
    border: 1px solid #e2e8f0;
    border-bottom: none;
    background: #f7fafc;
    color: #4a5568;
    padding: 8px 18px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    margin-bottom: -2px;
}
.hist-scope-tab:hover { color: var(--navy); background: #edf2f7; }
.hist-scope-tab.active {
    background: #fff;
    color: var(--navy);
    border-color: #cbd5e0;
    border-bottom: 2px solid #fff;
}
.hist-table .hist-type-consume .hist-type-mark { background: #2f855a; }
.hist-table .hist-type-req .hist-type-mark { background: #3182ce; }
.hist-toolbar-stack {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0 20px 8px;
}
.hist-toolbar-stack .hist-toolbar-actions {
    padding-bottom: 4px;
    border-bottom: none;
}
.hist-toolbar-stack .hist-toolbar-filters {
    padding-top: 6px;
    padding-bottom: 8px;
}
.hist-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px 6px;
    margin: 0 20px 8px;
    font-size: 11px;
    color: #718096;
}
.hist-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.hist-legend-dot {
    color: #a0aec0;
    font-weight: 700;
}
.hist-legend .hist-type-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    flex-shrink: 0;
}
.hist-legend-mark-w { background: #0d9488; }
.hist-legend-mark-m { background: #2b6cb0; }
.hist-legend-mark-d { background: #c05621; }
.hist-legend-mark-p { background: #805ad5; }
.hist-legend-mark-c { background: #2f855a; }
.hist-legend-crit {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: block;
}
.hist-table .hist-chk-h, .hist-table .hist-chk {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    text-align: center;
    padding: 4px 2px;
    vertical-align: middle;
    box-sizing: border-box;
}
.hist-table .hist-type-h, .hist-table .hist-type { width: 24px; min-width: 24px; text-align: center; padding: 4px 2px; vertical-align: middle; }
.hist-table .hist-crit-h, .hist-table .hist-crit {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    text-align: center;
    padding: 4px 2px;
    vertical-align: middle;
    box-sizing: border-box;
}
#tab-defect .list-table-scroll-wrap .hist-table th.hist-chk-h,
#tab-defect .list-table-scroll-wrap .hist-table th.hist-crit-h,
#tab-defect .list-table-scroll-wrap .hist-table td.hist-chk,
#tab-defect .list-table-scroll-wrap .hist-table td.hist-crit,
#tab-history .list-table-scroll-wrap .hist-table th.hist-chk-h,
#tab-history .list-table-scroll-wrap .hist-table th.hist-crit-h,
#tab-history .list-table-scroll-wrap .hist-table td.hist-chk,
#tab-history .list-table-scroll-wrap .hist-table td.hist-crit {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    padding: 4px 2px;
    text-align: center;
}
.hist-table .hist-crit .plan-crit-mark { display: block; margin: 0 auto; }
.hist-table .hist-type-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 3px;
    font-size: 10px; font-weight: 800; line-height: 1; color: #fff;
}
.hist-table .hist-type-mark::after { content: none !important; display: none !important; }
.hist-table .hist-type-defect .hist-type-mark { background: #c05621; }
.hist-table .hist-type-postpone .hist-type-mark { background: #805ad5; }
.hist-table .hist-type-maint .hist-type-mark { background: #2b6cb0; }
.hist-table .hist-type-wp .hist-type-mark { background: #0d9488; }
.list-filter-wrap { position: relative; flex-shrink: 0; }
.list-filter-btn { min-width: 64px; }
.list-filter-btn:hover { background: #2c5282; }
.list-filter-btn-active { background: var(--navy); color: #fff; border: none; font-weight: 700; }
.list-filter-btn-active:hover { background: #153050; }
.list-filter-pop {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 260px;
    max-width: 320px;
    max-height: 380px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    padding: 10px 12px;
}
.list-filter-pop-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}
.list-filter-pop-history {
    max-height: min(680px, calc(100vh - 48px));
}
.list-filter-pop-history .list-filter-group-list {
    max-height: 300px;
}
.list-filter-dept-block + .list-filter-dept-block { margin-top: 2px; }
.list-filter-dept-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--navy, #2c5282);
    letter-spacing: 0.03em;
    margin: 8px 0 4px;
    padding-top: 6px;
    border-top: 1px solid #edf2f7;
}
.list-filter-dept-block:first-child .list-filter-dept-title {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.list-filter-pop-history .list-filter-actions {
    position: static;
    flex-shrink: 0;
    background: #fff;
    z-index: 1;
}
.list-filter-pop-float {
    position: fixed;
    /* Above .modal (10000) / spare overlay modals so Consumption List Filter is visible */
    z-index: 11000;
    top: 0;
    left: 0;
}
.list-filter-section { margin-bottom: 10px; }
.list-filter-section-title { font-size: 11px; font-weight: 700; color: #4a5568; margin-bottom: 6px; }
.list-filter-check { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 0; cursor: pointer; }
.list-filter-check .muted { font-size: 10px; }
.list-filter-open-only { margin: 8px 0; padding-top: 8px; border-top: 1px solid #edf2f7; }
.list-filter-group-search { width: 100%; box-sizing: border-box; margin-bottom: 6px; font-size: 12px; padding: 5px 8px; }
.list-filter-group-list { max-height: 160px; overflow-y: auto; border: 1px solid #edf2f7; border-radius: 6px; padding: 4px 8px; margin-bottom: 4px; }
.list-filter-empty { font-size: 11px; margin: 6px 0; }
.list-filter-type-seg { display: flex; gap: 4px; margin-bottom: 4px; }
.list-filter-type-btn {
    flex: 1;
    padding: 5px 4px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}
.list-filter-type-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.list-filter-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #edf2f7; }
.list-filter-period-row .list-filter-wrap { margin-left: 4px; }
.hist-table .hist-chk input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; accent-color: var(--navy); pointer-events: auto; }
.hist-table .hist-chk input[type="checkbox"]:disabled { cursor: not-allowed; opacity: 0.4; }
.hist-toolbar .btn:disabled { opacity: .45; cursor: not-allowed; }
#tab-history .hist-table,
#tab-defect .hist-table,
.sheet-table-wrap .hist-table { min-width: 1200px; font-size: 11px; table-layout: fixed; }
#tab-history .hist-table th,
#tab-history .hist-table td,
#tab-defect .hist-table th,
#tab-defect .hist-table td,
.sheet-table-wrap .hist-table th,
.sheet-table-wrap .hist-table td { white-space: nowrap; }
.hist-table th.hist-sort1-h,
.hist-table td.hist-sort1 { width: 130px; max-width: 130px; position: relative; overflow: hidden; }
.hist-table th.hist-sort2-h,
.hist-table td.hist-sort2 { width: 120px; max-width: 120px; position: relative; overflow: hidden; }
.hist-table th.hist-detail-h,
.hist-table td.hist-detail { width: 200px; max-width: 200px; position: relative; overflow: hidden; white-space: nowrap; }
.hist-table td.hist-sort1 .hist-cell-tip,
.hist-table td.hist-sort2 .hist-cell-tip,
.hist-table td.hist-detail .hist-cell-tip { display: block; position: relative; max-width: 100%; }
.hist-table td.hist-cell-tip-open { overflow: visible; z-index: 50; }
.hist-table .hist-cell-tip.vl-cell-tip-active::after { content: none; }
.hist-cell-tip-floater {
    position: fixed;
    z-index: 10100;
    padding: 6px 10px;
    background: #1a365d;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
    max-width: min(440px, 85vw);
    width: max-content;
    min-width: 100px;
    border-radius: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
    pointer-events: none;
}
.hist-table .hist-code { min-width: 72px; width: 72px; }
.hist-table .hist-date { min-width: 84px; width: 84px; }
.hist-table .hist-flag-h, .hist-table .hist-flag { text-align: center; width: 32px; padding-left: 4px; padding-right: 4px; }
.hist-table .hist-at-h, .hist-table .hist-at { text-align: center; min-width: 72px; font-size: 10px; }
.hist-table .hist-at-kb { color: #718096; font-size: 10px; }
.hist-th-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    gap: 1px;
}
.hist-table tbody tr.row-selected { background: #bee3f8 !important; }
.hist-table tbody tr { cursor: pointer; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: 13px; }

@media (max-width: 768px) {
    #tab-history .list-table-scroll-wrap,
    #tab-defect .list-table-scroll-wrap {
        max-height: 50vh;
    }
}

.sheet-table th { position: sticky; top: 0; background: var(--navy); color: #fff; padding: 10px 12px; text-align: left; font-weight: 600; }
.sheet-table td { padding: 9px 12px; border-bottom: 1px solid #edf2f7; }
.sheet-table tbody tr:nth-child(even) { background: #fbfdff; }
.hist-row { cursor: pointer; user-select: none; }
.hist-row:hover { background: #ebf4ff; }
.hist-row.row-selected,
.sheet-table tbody tr.hist-row.row-selected { background: rgba(66, 153, 225, 0.35) !important; }
.hist-row.row-selected:hover { background: rgba(66, 153, 225, 0.45) !important; }
.rh-input { width: min(120px, 92%); max-width: 100%; padding: 6px 8px; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 13px; box-sizing: border-box; }
.rh-input.rh-readonly { background: #f1f5f9; color: #475569; cursor: default; }
.runhrs-table { table-layout: fixed; width: 100%; }
.runhrs-table col.rh-col-equip { width: 27%; }
.runhrs-table col.rh-col-jobs { width: 15%; }
.runhrs-table col.rh-col-hours { width: 19.33%; }
.runhrs-table th {
    vertical-align: middle;
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
    word-break: keep-all;
}
.runhrs-table th.rh-equip-h,
.runhrs-table td.rh-equip {
    white-space: normal;
    overflow: visible;
    word-break: keep-all;
    line-height: 1.35;
}
.runhrs-table th.rh-jobs-h {
    padding-left: 8px;
    padding-right: 8px;
}
.runhrs-table td.rh-jobs {
    white-space: nowrap;
}
.runhrs-table th:first-child,
.runhrs-table td:first-child {
    text-align: left;
    padding-left: calc(16px * var(--ui-scale, 1));
}
.runhrs-table th:nth-child(n+2),
.runhrs-table td:nth-child(n+2) {
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.runhrs-table td.rh-prev .rh-input,
.runhrs-table td.rh-exp .rh-input {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: min(100px, 92%);
}
.runhrs-table td.rh-total-cell .rh-total-display {
    display: inline-block;
    min-width: 72px;
    padding: 6px 8px;
    text-align: center;
}
.rh-total { font-weight: 700; color: #1a365d; font-variant-numeric: tabular-nums; }
.rh-total.rh-total-live { color: #276749; background: #f0fff4; }
.rh-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 0 20px 12px;
    padding: 10px 14px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
#runHoursModal .rh-content-frame {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}
#runHoursModal .rh-content-frame .rh-toolbar {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}
#runHoursModal .rh-content-frame .sheet-table-wrap {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    scrollbar-gutter: auto;
    max-height: min(60vh, 520px);
    overflow: auto;
}
.runhrs-modal {
    max-width: min(1080px, 96vw);
    width: 100%;
}
.runhrs-modal-head {
    margin: 0 0 12px;
    padding-right: 28px;
}
.runhrs-modal-head h2 {
    margin: 0 0 4px;
}
.rh-toolbar-sep {
    width: 1px;
    height: 28px;
    background: #cbd5e0;
    margin: 0 4px;
}
.rh-last-label {
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
}
.rh-last-input {
    width: 132px;
    padding: 6px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    background: #fff;
    color: #1a365d;
    font-weight: 600;
}
.rh-last-input:placeholder-shown { color: #a0aec0; font-weight: 400; }
#rhRevertBtn:disabled { opacity: .45; cursor: not-allowed; }

/* Menu — Outstanding Tasks dashboard */
.menu-main-col .outstanding-tasks-host {
    padding: 0;
    min-width: 0;
}
.menu-main-col .outstanding-tasks-panel {
    margin-bottom: 0;
}
.outstanding-tasks-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    padding: 14px 16px 16px;
    min-width: 0;
}
.ot-head {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 8px;
}
.ot-head-loading { margin-bottom: 4px; }
.ot-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
}
.ot-loading { font-size: 11px; }
.ot-section + .ot-section { margin-top: 14px; }
.ot-section-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.01em;
}
.ot-pms-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}
.ot-pms-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 12px;
}
.ot-pms-table th,
.ot-pms-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #edf2f7;
    text-align: center;
    vertical-align: middle;
}
.ot-pms-table thead th {
    background: #f7fafc;
    font-weight: 700;
    color: #4a5568;
}
.ot-pms-table tbody tr:last-child th,
.ot-pms-table tbody tr:last-child td { border-bottom: none; }
.ot-pms-corner { width: 110px; }
.ot-pms-row-label {
    text-align: left !important;
    font-weight: 700;
    color: #2d3748;
    white-space: nowrap;
}
.ot-pms-row-total .ot-pms-row-label { color: var(--navy); }
.ot-pms-row-total { background: #f8fafc; }
.ot-pms-rate-h,
.ot-pms-rate {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: #4a5568;
}
.ot-pms-rate { font-weight: 700; }
.ot-pms-plain {
    display: inline-block;
    min-width: 2ch;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #2d3748;
}
.ot-pms-colhead {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #4a5568;
    font: inherit;
    font-weight: 700;
}
.ot-pms-colhead-static {
    cursor: default;
}
.ot-pms-colhead.ot-hot.ot-pms-overdue { color: var(--red); }
.ot-pms-colhead.ot-hot.ot-pms-due { color: #c05621; }
.ot-pms-colhead.ot-hot.ot-pms-postponed { color: #6b46c1; }
.ot-pms-colhead.ot-hot.ot-pms-defect { color: #c05621; }
.ot-pms-metric {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #718096;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.15;
}
.ot-pms-metric:disabled {
    cursor: default;
    opacity: 0.55;
}
.ot-pms-metric:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.ot-pms-metric.active { box-shadow: 0 0 0 2px currentColor; font-weight: 700; }
.ot-pms-metric-count {
    font-size: 16px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.ot-pms-metric.ot-hot.ot-pms-overdue { color: var(--red); background: #fff5f5; border-color: #fed7d7; }
.ot-pms-metric.ot-hot.ot-pms-due { color: #c05621; background: #fffaf0; border-color: #feebc8; }
.ot-pms-metric.ot-hot.ot-pms-postponed { color: #6b46c1; background: #faf5ff; border-color: #e9d8fd; }
.ot-pms-metric.ot-hot.ot-pms-defect { color: #c05621; background: #fffaf0; border-color: #fbd38d; }
.ot-pms-col-btn { padding: 8px 6px; }
.ot-pms-rate-note {
    margin: 6px 2px 0;
    font-size: 10px;
}
.ot-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 8px;
}
@media (max-width: 480px) {
    .ot-badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ot-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 72px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 2px solid transparent;
    background: #f7fafc;
    color: #718096;
    cursor: pointer;
    font-family: inherit;
    transition: transform .1s, box-shadow .15s;
}
.ot-badge:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.ot-badge:disabled { cursor: default; opacity: .55; }
.ot-badge.active { box-shadow: 0 0 0 2px currentColor; font-weight: 700; }
.ot-badge.ot-hot:not(:disabled) { color: #1a365d; background: #fff; border-color: #e2e8f0; }
.ot-badge.ot-defect.ot-hot { color: #c05621; background: #fffaf0; border-color: #fbd38d; }
.ot-badge.ot-overdue.ot-hot { color: var(--red); background: #fff5f5; border-color: #fed7d7; }
.ot-badge.ot-due.ot-hot { color: #c05621; background: #fffaf0; border-color: #feebc8; }
.ot-badge.ot-postponed.ot-hot { color: #6b46c1; background: #faf5ff; border-color: #e9d8fd; }
.ot-badge.ot-lowstock.ot-hot { color: #c05621; background: #fffaf0; border-color: #fbd38d; }
.ot-badge.ot-requisition.ot-hot { color: #2b6cb0; background: #ebf8ff; border-color: #bee3f8; }
.ot-badge.ot-monthly-confirm.ot-hot { color: #276749; background: #f0fff4; border-color: #9ae6b4; }
.ot-badge.ot-monthly-rh.ot-hot { color: #2b6cb0; background: #ebf8ff; border-color: #90cdf4; }
.ot-badge.ot-monthly-plan.ot-hot { color: #744210; background: #fffff0; border-color: #f6e05e; }
.ot-badge.ot-legal-low.ot-hot { color: #9b2c2c; background: #fff5f5; border-color: #feb2b2; }
.ot-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    flex-shrink: 0;
}
.ot-mark-defect { background: #c05621; }
.ot-mark-overdue { background: #e53e3e; }
.ot-mark-due { background: #ed8936; }
.ot-mark-postponed { background: #805ad5; }
.ot-mark-lowstock {
    background: #fffaf0;
    border: 1px solid #fbd38d;
    font-size: 15px;
    line-height: 1;
}
.ot-mark-requisition {
    background: #3182ce;
    font-size: 14px;
    line-height: 1;
}
.ot-mark-monthly-confirm { background: #38a169; }
.ot-mark-monthly-rh { background: #3182ce; }
.ot-mark-monthly-plan { background: #d69e2e; }
.ot-mark-legal-low { background: #c53030; font-size: 13px; }
.ot-mark-clock { display: block; }
.ot-badge-label { font-size: 11px; font-weight: 600; }
.ot-badge-count { font-size: 20px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ot-detail {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #edf2f7;
}
.ot-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #4a5568;
}
.ot-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}
.ot-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fbfdff;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s, box-shadow .12s;
}
.ot-card:hover { background: #ebf8ff; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.ot-card-title { font-size: 13px; font-weight: 700; color: var(--navy); }
.ot-card-sub {
    font-size: 11px;
    color: #4a5568;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.ot-card-meta { font-size: 10px; color: #718096; }
.ot-more { margin: 8px 0 0; font-size: 11px; }
.ot-detail-empty { font-size: 12px; padding: 8px 0; }

.dept-warn { color: var(--red); font-size: 12px; font-weight: 700; align-self: center; }
.q-dept { font-size: 10px; font-weight: 700; color: #fff; background: var(--blue); border-radius: 6px; padding: 1px 6px; }

@media (max-width: 1100px) {
    .cmaxs-body, .cmaxs-body.hq-mode { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
    .plan-layout, .actual-layout, .spare-layout, .spare-layout.panel-open { grid-template-columns: 1fr; }
    .sr-cols { grid-template-columns: 1fr !important; }
}

/* ── BOM in Actual Plan side panel ─────────────────────────────── */
.side-bom { margin: 8px 0; }
.bom-head { font-size: 11px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.bom-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.bom-table th { background: #eef2f7; color: #334; padding: 3px 4px; text-align: left; border-bottom: 1px solid #d7dee7; }
.bom-table td { padding: 3px 4px; border-bottom: 1px solid #eef1f5; }
.bom-table tr.bom-low td { background: #fff4f4; color: #a11; font-weight: 600; }

/* ── SpareRequest tab ──────────────────────────────────────────── */
.sr-wrap { padding: 4px 2px; }
.sr-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sr-check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.sr-cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; }
.sr-panel { border: 1px solid #dce3ec; border-radius: 8px; background: #fff; overflow: hidden; }
.sr-panel-head { background: #1f3a5f; color: #fff; font-weight: 700; font-size: 13px; padding: 7px 12px; }
.sr-scroll { max-height: 420px; overflow: auto; }
.sr-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sr-table th { position: sticky; top: 0; background: #eef2f7; color: #2a3b52; padding: 6px 8px; text-align: left; border-bottom: 1px solid #d3dbe5; z-index: 1; }
.sr-table td { padding: 5px 8px; border-bottom: 1px solid #f0f3f7; }
.sr-table tbody tr:hover { background: #f6f9fd; cursor: default; }
.sr-table tr.sr-low td { background: #fff5f5; }
.sr-badge { background: var(--red); color: #fff; border-radius: 6px; padding: 1px 7px; font-size: 10px; font-weight: 700; }
.sr-req-sel td { background: #e8f1ff !important; }
.sr-status { border-radius: 6px; padding: 1px 8px; font-size: 10px; font-weight: 700; color: #fff; }
.sr-DRAFT { background: #6b7280; } .sr-EXPORTED { background: #d97706; }
.sr-QUOTED { background: #2563eb; } .sr-HQ_REVIEW { background: #7c3aed; } .sr-APPROVED { background: #16a34a; }
.sr-detail { border-top: 1px solid #e5ebf2; padding: 8px; }
.sr-detail-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.sr-detail-table th { background: #f3f6fa; }

/* search + row actions */
.sr-search { flex: 0 1 320px; min-width: 200px; padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; }
.sr-search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.sr-act { border: 1px solid #d7dee7; background: #fff; border-radius: 6px; padding: 2px 6px; cursor: pointer; font-size: 13px; line-height: 1; }
.sr-act:hover { background: #eef2f7; }
.sr-act-del:hover { background: #fdecec; border-color: #f2b8b8; }

/* spare editor */
.sr-editor { border: 1px solid #cfe0f5; background: #f6faff; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.sr-editor-head { font-weight: 700; color: #1f3a5f; margin-bottom: 10px; }
.sr-editor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 12px; }
.sr-editor-grid label { display: flex; flex-direction: column; font-size: 11px; font-weight: 600; color: #4a5568; gap: 3px; }
.sr-editor-grid input { padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; font-weight: 400; }
.sr-editor-grid input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.sr-editor-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── Unified SPARE Module ─────────────────────────────────────────── */
.spare-import-banner {
    background: #fffbeb; border: 1px solid #f6e05e; color: #744210;
    padding: 10px 14px; border-radius: 8px; margin: 0 20px 8px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px;
}
.spare-import-banner.ok { background: #f0fff4; border-color: #9ae6b4; color: #22543d; }
.spare-import-banner.file-mode { background: #fff5f5; border-color: #fc8181; color: #742a2a; }
label.spare-file-pick { cursor: pointer; margin: 0; display: inline-flex; align-items: center; }
label.spare-file-pick input[type=file] { display: none; }
.file-protocol-banner {
    background: #fff5f5; border-bottom: 1px solid #fc8181; color: #742a2a;
    padding: 8px 16px; font-size: 13px; text-align: center;
}
.file-protocol-banner code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }
.file-protocol-list { margin: 12px 0; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.modal-actions { margin-top: 16px; text-align: right; }
.spare-import-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(15, 23, 42, 0.45);
    display: none; align-items: center; justify-content: center;
}
.spare-import-loading {
    background: #fff; padding: 28px 36px; border-radius: 12px; text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,.2); font-size: 15px; color: var(--navy);
    min-width: 280px;
}
.spare-import-loading small { display: block; margin-top: 8px; color: #718096; font-size: 12px; }
.spare-spinner {
    width: 36px; height: 36px; margin: 0 auto 12px;
    border: 3px solid #e2e8f0; border-top-color: var(--blue);
    border-radius: 50%; animation: spare-spin .8s linear infinite;
}
@keyframes spare-spin { to { transform: rotate(360deg); } }
.spare-unified {
    padding: 20px 0 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.spare-unified > .tvc-section-card {
    margin: 0 20px;
}
.spare-unified > .tvc-section-card:last-child {
    margin-bottom: 20px;
}
.spare-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 12px;
    padding: 12px 20px 24px;
    transition: grid-template-columns 0.25s ease;
}
.spare-layout.panel-open { grid-template-columns: 240px 1fr 360px; }
.spare-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
#spareMenuBody {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}
#tab-spare {
    overflow: hidden;
}
#tab-spare .spare-layout {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
#tab-spare .spare-layout > * {
    min-height: 0;
}
#tab-spare .spare-main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
#tab-spare .spare-list-panel {
    flex: 1;
    min-height: 0;
}
#tab-spare #spareListScroll.virtual-scroll {
    flex: 1;
    min-height: 280px;
    height: auto;
    max-height: calc(100vh - 380px);
    overflow: auto;
}
.spare-main #spareFilterDashboard.act-filter-dashboard {
    margin: 0;
    padding: 0 14px 4px;
    border-bottom: none;
    background: transparent;
    overflow-x: visible;
}
.spare-main #spareFilterDashboard .act-filter-dashboard-inner {
    flex-wrap: wrap;
    gap: 8px;
}
.spare-main #spareFilterDashboard .act-dash-btn {
    border: 2px solid transparent;
}
.spare-main #spareFilterDashboard .act-dash-due30 { border-color: #fbd38d; } /* Low Stock — matches Menu OT */
.spare-main #spareFilterDashboard .act-dash-critical { border-color: #feb2b2; } /* Legal Low Stock — matches Menu OT */
.spare-main #spareFilterDashboard .act-dash-pending { border-color: #bee3f8; }
.spare-main #spareFilterDashboard .act-dash-postponed { border-color: #e9d8fd; }
.spare-main #spareFilterDashboard .act-dash-total { border-color: #e2e8f0; }
.spare-main #spareFilterDashboard .act-dash-label {
    white-space: normal;
    max-width: 88px;
    line-height: 1.15;
}
.spare-item-toolbar { flex-wrap: wrap; }
.spare-item-toolbar .sr-check { margin: 0; }
.spare-list-search-bar {
    padding: 8px 14px;
    border-bottom: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.list-filter-stack {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: visible;
}
.list-filter-stack .list-filter-period-row,
.list-filter-stack .list-filter-search-row {
    border-bottom: none;
    flex-wrap: nowrap;
    align-items: center;
}
.list-filter-stack .list-filter-period-row {
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}
.list-filter-stack .list-filter-period-row .count-label {
    margin-left: auto;
}
.list-filter-stack .list-filter-search-row {
    padding-top: 6px;
}
.list-filter-stack .list-filter-search-row .search-field-wrap {
    flex: 1;
    min-width: 0;
    max-width: none;
}
.hist-toolbar-filters.list-filter-stack {
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.hist-toolbar-stack .hist-toolbar-filters.list-filter-stack {
    padding-top: 0;
    padding-bottom: 0;
}
.spare-list-search-input { flex: 1; min-width: 220px; }
.req-work-groups {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}
.req-work-group-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
    background: #fff;
}
.req-work-group-rows {
    width: 100%;
}
.req-work-group-section .spare-group-header-in-list {
    margin: 0;
}
.req-work-group-section .spare-group-header-in-list .spare-group-header-card {
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    background: #f8fafc;
    padding: 10px 14px 12px;
}
.req-work-group-section .req-work-group-head {
    overflow: visible;
    box-sizing: border-box;
    background: #f7fafc;
    box-shadow: inset 0 -2px 0 #e2e8f0;
    margin: 0;
    padding: 0 14px;
}
.req-work-group-section .req-work-group-rows {
    padding: 0 14px 2px;
    box-sizing: border-box;
}
.req-work-group-section .req-work-group-head .spare-data-table,
.req-work-group-rows .spare-data-table-req {
    width: 100%;
    max-width: none;
}
.req-work-group-section .req-work-group-head .spare-data-head th {
    overflow: visible;
    text-overflow: clip;
    padding: 6px 2px;
    font-size: var(--list-item-head-font);
    line-height: 1.2;
}
.req-work-group-section .req-work-group-head .spare-data-head .c-rcvd,
.req-work-group-section .req-work-group-head .spare-data-head .c-assess,
.req-work-group-section .req-work-group-head .spare-data-head .c-req,
.req-work-group-section .req-work-group-head .spare-data-head .c-await,
.req-work-group-section .req-work-group-head .spare-data-head .c-need,
.req-work-group-section .req-work-group-head .spare-data-head .c-work,
.req-work-group-section .req-work-group-head .spare-data-head .c-std,
.req-work-group-section .req-work-group-head .spare-data-head .c-stk {
    padding-left: 1px;
    padding-right: 1px;
}
#reqWorkListHead.is-grouped-inline {
    display: none;
}
.req-work-group-rows .spare-data-row {
    margin-bottom: 0;
}
.spare-group-header-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.spare-group-header.is-idle .spare-group-header-card {
    background: #fafbfc;
}
.spare-gh-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 14px;
    align-items: start;
}
.spare-gh-row-primary {
    grid-template-columns: 1fr;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}
.spare-gh-row-primary-split {
    grid-template-columns: 1fr 1fr;
}
.spare-gh-row-plan-split.spare-gh-row-primary-split {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.spare-gh-field-span2 {
    grid-column: span 2;
}
.spare-gh-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 16px;
}
.spare-gh-manage-btn {
    border: none;
    background: transparent;
    color: #4a5568;
    font-size: 11px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
}
.spare-gh-manage-btn:hover {
    background: #edf2f7;
    color: var(--navy);
}
#spareEquipmentListModal .modal-box.spare-equipment-list-modal {
    width: min(1840px, calc(100vw - 32px));
    max-width: min(1840px, calc(100vw - 32px));
    max-height: min(720px, calc(100vh - 32px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#spareEquipmentListBody {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    flex: 1;
}
.spare-equipment-list-sub {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
}
.spare-equipment-list-wrap {
    flex: 1;
    min-height: 180px;
    max-height: 420px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}
.spare-equipment-list-table {
    width: 100%;
    table-layout: fixed;
    font-size: 12px;
}
.spare-equipment-list-table th,
.spare-equipment-list-table td {
    padding: 6px 8px;
    vertical-align: middle;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.spare-equipment-list-table thead th {
    white-space: nowrap;
}
.spare-equipment-list-table .c-eqno {
    text-align: center;
    width: 52px;
}
.spare-equipment-list-table .c-num {
    text-align: center;
    width: 56px;
}
.spare-equipment-list-table .c-act {
    white-space: nowrap;
    width: 88px;
}
.spare-equipment-list-table tr.is-editing {
    background: #ebf8ff;
}
.spare-equipment-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
}
.spare-equipment-list-actions {
    justify-content: space-between;
}
.spare-equipment-list-table .empty-row {
    text-align: center;
    padding: 18px 8px;
}
.spare-gh-row-plan-split {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
}
.spare-gh-field-span3 {
    grid-column: span 3;
}
.spare-gh-select {
    display: block;
    width: 100%;
    font-size: 12px;
    color: #2d3748;
    min-height: 28px;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    line-height: 1.4;
    box-sizing: border-box;
    cursor: pointer;
}
.spare-gh-select:disabled {
    opacity: .65;
    cursor: not-allowed;
    background: #f7fafc;
}
.spare-gh-row-quad {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.spare-gh-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.spare-gh-field-wide { min-width: 0; }
.spare-gh-label {
    font-size: 11px;
    font-weight: 600;
    color: #718096;
    line-height: 1.2;
}
.spare-gh-value {
    display: block;
    font-size: 12px;
    color: #2d3748;
    min-height: 28px;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    line-height: 1.4;
    word-break: break-word;
}
.spare-gh-value-primary {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    border-color: #cbd5e0;
    background: #fff;
}
.spare-gh-value.empty {
    color: #a0aec0;
}
.spare-gh-idle-hint {
    font-size: 12px;
    font-weight: 500;
    color: #a0aec0;
}
.spare-group-header.is-editing .spare-group-header-card {
    border-color: #90cdf4;
    background: #ebf8ff;
    box-shadow: 0 0 0 1px rgba(66, 153, 225, 0.25);
}
.spare-gh-input {
    width: 100%;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 12px;
    color: #2d3748;
    background: #fff;
    box-sizing: border-box;
}
.spare-gh-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}
.spare-gh-input-primary {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
}
.spare-gh-group-select {
    position: relative;
    width: 100%;
}
.spare-gh-group-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    box-sizing: border-box;
    text-align: left;
}
.spare-gh-group-trigger:hover { border-color: #90cdf4; background: #f7fafc; }
.spare-gh-group-trigger-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spare-gh-group-trigger-caret {
    flex-shrink: 0;
    font-size: 11px;
    color: #718096;
    transition: transform 0.15s ease;
}
.spare-gh-group-select.open .spare-gh-group-trigger-caret { transform: rotate(180deg); }
.spare-gh-group-pick {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 30;
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: #fff;
    padding: 4px;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.spare-gh-group-select.open .spare-gh-group-pick { display: flex; }
.spare-gh-group-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background: transparent;
    font-size: 12px;
    cursor: pointer;
    color: #2d3748;
    line-height: 1.35;
    min-height: 30px;
    box-sizing: border-box;
}
.spare-gh-group-item:hover { background: #ebf8ff; }
.spare-gh-group-item.selected {
    background: #bee3f8;
    font-weight: 600;
    color: var(--navy);
}
.spare-gh-group-item.is-empty { opacity: 0.85; font-style: italic; }
.spare-gh-group-empty { display: block; padding: 8px 10px; font-size: 12px; }
.spare-row-editing {
    background: #ebf8ff !important;
}
.spare-row-editing:hover {
    background: #ebf8ff !important;
}
.spare-inline-input {
    width: 100%;
    min-width: 0;
    padding: 3px 6px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    box-sizing: border-box;
}
.spare-item-edit-table .c-dwg,
.spare-item-edit-table .c-pno,
.spare-item-edit-table .c-item {
    width: 146px;
    max-width: 146px;
}
.spare-inline-input-wide { min-width: 0; }
/* Class 선택 — 네이티브 select 대신 커스텀 피커 (잔여 문자/점 표시 방지) */
.spare-class-pick {
    position: relative;
    display: inline-block;
    width: 44px;
    max-width: 100%;
    vertical-align: middle;
}
.spare-class-pick-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 26px;
    padding: 2px 4px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: #2c5282;
    box-sizing: border-box;
    line-height: 1.2;
}
.spare-class-pick-trigger:hover { border-color: #90cdf4; background: #f7fafc; }
.spare-class-pick-val { flex: 0 0 auto; }
.spare-class-pick-caret {
    flex-shrink: 0;
    font-size: 9px;
    color: #718096;
    line-height: 1;
}
.spare-class-pick-menu {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 2px);
    z-index: 10050;
    min-width: 200px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: #fff;
    padding: 4px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
.spare-class-pick.open .spare-class-pick-menu { display: block; }
.spare-class-pick-menu-portal {
    display: block;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}
.spare-item-edit-table-wrap { overflow-x: auto; overflow-y: visible; }
.spare-item-edit-table td,
.spare-item-edit-table .c-cls {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}
.spare-class-pick-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 8px;
    border: none;
    border-radius: 4px;
    background: transparent;
    font-size: 12px;
    cursor: pointer;
    color: #2d3748;
    line-height: 1.3;
    box-sizing: border-box;
    white-space: nowrap;
}
.spare-class-pick-item:hover { background: #ebf8ff; }
.spare-class-pick-item.selected {
    background: #bee3f8;
    font-weight: 600;
    color: var(--navy);
}
.spare-row-editing .c-cls { text-align: center; overflow: visible; }
.spare-inline-input-num { text-align: center; max-width: 56px; margin: 0 auto; display: block; }
.spare-inline-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}
.spare-item-edit-panel {
    margin-top: 0;
    border: 1px solid #90cdf4;
    border-radius: 8px;
    background: #ebf8ff;
    overflow: visible;
    box-shadow: 0 0 0 1px rgba(66, 153, 225, 0.15);
}
.spare-item-edit-head {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--navy);
    border-bottom: 1px solid #bee3f8;
    background: #dbeafe;
}
.spare-item-edit-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    background: #fff;
}
.spare-item-edit-table {
    min-width: 948px;
    margin: 0;
}
.spare-item-edit-table thead th {
    background: #f7fafc;
    font-size: 11px;
    font-weight: 700;
    color: #4a5568;
    padding: 8px 6px;
    border-bottom: 2px solid #e2e8f0;
}
.spare-item-edit-table tbody td {
    padding: 6px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}
.spare-edit-stock {
    display: block;
    text-align: center;
    color: #718096;
    font-size: 12px;
}
.spare-item-edit-actions {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid #bee3f8;
    background: #ebf8ff;
}
.spare-tree-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}
.spare-tree-head > span {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    letter-spacing: -0.01em;
}
.spare-tree-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.spare-tree-action-btn,
.spare-tree-modify-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    border-radius: 4px;
    background: transparent;
    color: #4a5568;
    border: none;
    cursor: pointer;
}
.spare-tree-action-btn:hover:not(:disabled),
.spare-tree-modify-btn:hover:not(:disabled) {
    background: #edf2f7;
    color: #2d3748;
}
.spare-tree-action-btn:disabled,
.spare-tree-modify-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.spare-gh-edit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #bee3f8;
}
.spare-gh-edit-hint {
    flex: 1;
    font-size: 12px;
    color: #2b6cb0;
}
.spare-group-header.is-group-editing {
    box-shadow: inset 0 0 0 2px #90cdf4;
    border-radius: 8px;
}
@media (max-width: 900px) {
    .spare-gh-row { grid-template-columns: 1fr 1fr; }
    .spare-gh-row .spare-gh-field:last-child { grid-column: 1 / -1; }
    .spare-gh-row-quad { grid-template-columns: 1fr 1fr; }
    .spare-gh-row-quad .spare-gh-field:last-child { grid-column: auto; }
    .spare-gh-row-plan-split .spare-gh-field-span3 { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .spare-gh-row { grid-template-columns: 1fr; }
    .spare-gh-row .spare-gh-field:last-child { grid-column: auto; }
    .spare-gh-row-quad { grid-template-columns: 1fr; }
}
.spare-list-panel { flex: 1; min-height: 280px; display: flex; flex-direction: column; min-width: 0; }
.spare-vl-scroll {
    flex: 1;
    min-height: 240px;
    height: auto;
    max-height: calc(100vh - 380px);
    scrollbar-gutter: auto;
}
#spareListHead.vl-head-wrap {
    overflow: hidden;
    box-sizing: border-box;
    background: #f7fafc;
    box-shadow: none;
}
#spareListScroll.virtual-scroll {
    border-top: none;
}
#spareListScroll .vl-row {
    overflow: visible;
    border-bottom: none;
}
#spareListScroll .spare-data-table td {
    border-bottom: 1px solid #f0f0f0;
}
.spare-data-table .c-chk,
.spare-item-edit-table .c-chk {
    display: table-cell;
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    text-align: center;
    vertical-align: middle;
    padding: 0 4px;
    box-sizing: border-box;
}
.spare-item-edit-table tbody tr.spare-row-editing td {
    border-bottom: 1px solid #bee3f8;
}
#spareListHead .spare-head-track,
#reqWorkListHead .spare-head-track {
    overflow: hidden;
}
#reqWorkListHead.vl-head-wrap {
    overflow: hidden;
    box-sizing: border-box;
    background: #f7fafc;
    box-shadow: inset 0 -2px 0 #e2e8f0;
}
#consumeListHead.vl-head-wrap {
    overflow: hidden;
    box-sizing: border-box;
    background: #f7fafc;
    box-shadow: inset 0 -2px 0 #e2e8f0;
}
#spareListScroll.sheet-scroll-original .vl-inner {
    min-width: 948px;
}
/* 컨테이너 기준으로 항상 채워 넓힐 때 오른쪽 여백이 생기지 않도록 (JS 폭 계산 타이밍 비의존) */
#spareListScroll .vl-inner {
    width: 100% !important;
    min-width: 948px !important;
}
#reqWorkListScroll .vl-inner {
    width: 100% !important;
    min-width: 0 !important;
}
#spareReqWorkModal #reqWorkListScroll .vl-inner {
    min-width: 0 !important;
}
#consumeListScroll .vl-inner {
    width: 100% !important;
    min-width: 898px !important;
}
/* SPARE list — real <table> (avoids .vl-cells flex override) */
.spare-data-table {
    width: 100%;
    min-width: 948px;
    table-layout: fixed;
    border-collapse: collapse;
    font-family: inherit;
    font-size: var(--list-item-font);
    box-sizing: border-box;
}
.spare-req-work-layout .spare-data-table,
.spare-req-work-layout #reqWorkListScroll .vl-inner,
.spare-data-table-req {
    min-width: 0;
}
#spareReqWorkModal .spare-req-work-layout .spare-data-table,
#spareReqWorkModal .spare-req-work-layout #reqWorkListScroll .vl-inner,
#spareReqWorkModal .spare-data-table-req {
    min-width: 0;
}
#spareListScroll .spare-data-row {
    width: 100% !important;
    min-width: 948px;
    max-width: none !important;
}
#reqWorkListScroll .spare-data-row {
    width: 100% !important;
    min-width: 0;
    max-width: none !important;
}
#spareReqWorkModal #reqWorkListScroll .spare-data-row {
    min-width: 0;
}
#consumeListScroll .spare-data-row {
    width: 100% !important;
    min-width: 898px;
    max-width: none !important;
}
.spare-data-head {
    margin: 0;
    background: #f7fafc;
    font-size: var(--list-item-head-font);
    font-weight: 700;
    color: #4a5568;
}
.spare-data-head th {
    padding: 8px 4px;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
    font-weight: 700;
    vertical-align: middle;
    overflow: hidden;
    line-height: 1.2;
}
#reqWorkListHead .spare-data-head th {
    padding: 6px 3px;
    font-size: var(--list-item-head-font);
    line-height: 1.15;
    min-height: 38px;
}
#consumeListHead .spare-data-head th {
    padding: 6px 3px;
    font-size: var(--list-item-head-font);
    line-height: 1.15;
    min-height: 38px;
}
.spare-data-table td {
    padding: 0 5px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    height: var(--list-row-h, 40px);
}
.spare-data-table .c-num { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.spare-data-table .c-cls { text-align: center; font-weight: 700; color: #2c5282; }
.spare-data-table .c-item { text-align: left; }
.spare-data-table-req .c-item,
#reqWorkListHead .c-item,
#reqWorkListScroll .c-item {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spare-data-table .c-dwg,
.spare-data-table .c-pno,
.spare-data-table .c-unit,
.spare-data-table .c-work,
.spare-data-table .c-std,
.spare-data-table .c-stk,
.spare-data-table .c-await,
.spare-data-table .c-need,
.spare-data-table .c-ord,
.spare-data-table .c-reqd,
.spare-data-table .c-req,
.spare-data-table .c-assess,
.spare-data-table .c-rcvd,
.spare-data-table .c-recv,
.spare-data-head .c-dwg,
.spare-data-head .c-pno,
.spare-data-head .c-unit,
.spare-data-head .c-work,
.spare-data-head .c-std,
.spare-data-head .c-stk,
.spare-data-head .c-await,
.spare-data-head .c-need,
.spare-data-head .c-ord,
.spare-data-head .c-reqd,
.spare-data-head .c-req,
.spare-data-head .c-assess,
.spare-data-head .c-rcvd,
.spare-data-head .c-recv {
    text-align: center !important;
    padding-left: 4px;
    padding-right: 4px;
    box-sizing: border-box;
}
.spare-data-table .c-pno { color: #553c9a; font-weight: 600; }
.spare-data-table .c-unit,
.spare-data-table .c-work { font-weight: 600; color: #4a5568; }
.spare-data-head .c-dwg,
.spare-data-head .c-pno,
.spare-data-head .c-unit,
.spare-data-head .c-work,
.spare-data-head .c-std,
.spare-data-head .c-stk,
.spare-data-head .c-await,
.spare-data-head .c-need,
.spare-data-head .c-ord,
.spare-data-head .c-reqd,
.spare-data-head .c-req,
.spare-data-head .c-assess,
.spare-data-head .c-rcvd,
.spare-data-head .c-recv {
    padding-top: 8px;
    padding-bottom: 8px;
}
.spare-data-head .c-num,
.spare-data-head .c-cls,
.spare-data-head .c-dwg,
.spare-data-head .c-pno,
.spare-data-head .c-unit,
.spare-data-head .c-work,
.spare-data-head .c-std,
.spare-data-head .c-stk,
.spare-data-head .c-await,
.spare-data-head .c-need,
.spare-data-head .c-ord,
.spare-data-head .c-reqd,
.spare-data-head .c-req,
.spare-data-head .c-assess,
.spare-data-head .c-rcvd,
.spare-data-head .c-recv { text-align: center; }
.spare-data-table .c-req,
.spare-data-table .c-assess,
.spare-data-table .c-rcvd,
.spare-data-table .c-cons,
.spare-data-table .c-recv { color: #2b6cb0; font-weight: 600; }
.spare-data-table .c-cons { color: #276749; }
.spare-data-table .c-recv { color: #2b6cb0; }
.spare-data-table .c-need .qty-na { font-weight: 400; color: #a0aec0; }
.spare-data-head .c-cons,
.spare-data-head .c-recv { text-align: center; }
.spare-data-table .c-cons {
    text-align: center !important;
    padding-left: 4px;
    padding-right: 4px;
    box-sizing: border-box;
}
.spare-data-table-wrspare .c-cons,
.spare-data-table-consume .c-cons {
    overflow: visible;
    text-overflow: clip;
}
.spare-data-head .spare-col-head-stack {
    white-space: normal;
    line-height: 1.15;
    overflow: visible;
    word-break: keep-all;
}
.spare-data-head .spare-col-head-stack .spare-head-sub {
    display: block;
    text-align: center;
    font-size: var(--list-item-head-font);
    font-weight: 500;
    color: #718096;
}
.spare-data-head .c-pno.spare-col-head-stack {
    white-space: normal;
    line-height: 1.15;
}
.spare-data-head .c-pno .spare-head-sub {
    display: block;
    text-align: center;
    font-size: var(--list-item-head-font);
    font-weight: 500;
    color: #718096;
}
#spareListScroll .spare-data-table tr:hover { background: #f7fafc; }
#spareListScroll .spare-data-table tr.row-overdue { background: #fff5f5; }
#spareListScroll .spare-data-table tr.row-selected,
#spareListScroll .spare-data-table tr.spare-row-focused.row-selected {
    background: rgba(66, 153, 225, 0.35) !important;
}
#spareListScroll .spare-data-table tr.row-selected:hover,
#spareListScroll .spare-data-table tr.spare-row-focused.row-selected:hover {
    background: rgba(66, 153, 225, 0.45) !important;
}
#reqWorkListScroll .spare-data-table tr:hover { background: #f7fafc; }
#reqWorkListScroll .spare-data-table tr.row-overdue { background: #fff5f5; }
#reqWorkListScroll .spare-data-table td.qty-mismatch,
.spare-data-table td.qty-mismatch {
    background: #fff8e6;
    color: #9a6700;
    font-weight: 600;
}
#reqWorkListScroll .spare-data-table tr.row-selected td.qty-mismatch,
#reqWorkListScroll .spare-data-table tr.spare-row-focused.row-selected td.qty-mismatch {
    background: #fde68a;
}
.spare-data-table td.spare-cos-over-rob {
    color: #c53030 !important;
    font-weight: 700;
    background: #fff5f5;
    box-shadow: inset 0 -2px 0 #c53030;
}
.spare-data-table tr.row-selected td.spare-cos-over-rob,
.spare-data-table tr.spare-row-focused.row-selected td.spare-cos-over-rob {
    background: #fed7d7;
}
.spare-data-table td.spare-cos-over-rob .spare-consume-qty-input,
.spare-consume-qty-input.spare-cos-over-rob-input {
    color: #c53030;
    border-color: #c53030;
    font-weight: 700;
}
#reqWorkListScroll .spare-data-table tr.row-selected,
#reqWorkListScroll .spare-data-table tr.spare-row-focused.row-selected {
    background: rgba(66, 153, 225, 0.35) !important;
}
#reqWorkListScroll .spare-data-table tr.row-selected:hover,
#reqWorkListScroll .spare-data-table tr.spare-row-focused.row-selected:hover {
    background: rgba(66, 153, 225, 0.45) !important;
}
#consumeListScroll .spare-data-table tr:hover { background: #f7fafc; }
#consumeListScroll .spare-data-table tr.row-overdue { background: #fff5f5; }
#wrSpareListScroll .spare-data-table tr:hover { background: #f7fafc; }
#wrSpareListScroll .spare-data-table tr.row-overdue { background: #fff5f5; }
#consumeListScroll .spare-data-table tr.row-selected,
#consumeListScroll .spare-data-table tr.spare-row-focused.row-selected,
#wrSpareListScroll .spare-data-table tr.row-selected,
#wrSpareListScroll .spare-data-table tr.spare-row-focused.row-selected {
    background: rgba(66, 153, 225, 0.35) !important;
}
#consumeListScroll .spare-data-table tr.row-selected:hover,
#consumeListScroll .spare-data-table tr.spare-row-focused.row-selected:hover,
#wrSpareListScroll .spare-data-table tr.row-selected:hover,
#wrSpareListScroll .spare-data-table tr.spare-row-focused.row-selected:hover {
    background: rgba(66, 153, 225, 0.45) !important;
}
#receiveListScroll .spare-data-table tr.row-selected,
#receiveListScroll .spare-data-table tr.spare-row-focused.row-selected {
    background: rgba(66, 153, 225, 0.35) !important;
}
#receiveListScroll .spare-data-table tr.row-selected:hover,
#receiveListScroll .spare-data-table tr.spare-row-focused.row-selected:hover {
    background: rgba(66, 153, 225, 0.45) !important;
}
.spare-wr-qty-input {
    width: 56px;
    padding: 3px 4px;
    text-align: center;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.spare-wr-qty-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.25);
}
.spare-wr-qty-input:disabled {
    background: #f7fafc;
    color: #4a5568;
}
.sheet-scroll-original .spare-data-table,
.sheet-scroll-original #spareListHead .spare-data-table { min-width: 948px; }
.sheet-scroll-original #reqWorkListHead .spare-data-table,
.spare-req-work-layout #reqWorkListScroll .spare-data-table { min-width: 0; }
.spare-row .c-chk { cursor: pointer; }
.spare-row-chk { cursor: pointer; width: 14px; height: 14px; accent-color: var(--blue); }
.spare-head-chk { cursor: pointer; width: 14px; height: 14px; accent-color: var(--blue); vertical-align: middle; }
.spare-data-head .c-chk { text-align: center; }
.spare-req-qty-input {
    width: 36px;
    max-width: 100%;
    padding: 2px 2px;
    text-align: center;
    border: 1px solid #4299e1;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #2b6cb0;
    background: #fff;
    box-sizing: border-box;
    -moz-appearance: textfield;
    appearance: textfield;
}
.spare-req-qty-input::-webkit-outer-spin-button,
.spare-req-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.spare-req-qty-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.25);
}
.spare-consume-qty-input {
    width: 48px;
    max-width: 100%;
    padding: 2px 4px;
    text-align: center;
    border: 1px solid #48bb78;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #276749;
    background: #fff;
    box-sizing: border-box;
    -moz-appearance: textfield;
    appearance: textfield;
}
.spare-consume-qty-input::-webkit-outer-spin-button,
.spare-consume-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.spare-consume-qty-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.25);
}
/* Consumed Parts — 상단 메타 폼 */
.spare-consume-meta-form {
    flex-shrink: 0;
    margin: 0 14px 12px;
    padding: 16px 18px 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 48%);
    border: 1px solid #d8e2ec;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: visible;
}
.spare-consume-meta-form.is-consume-hist-open {
    z-index: 500;
}
#spareConsumeModal .spare-req-work-wrap.is-consume-hist-open .spare-req-work-head {
    z-index: 1;
}
#spareConsumeModal .spare-req-work-wrap.is-consume-hist-open .spare-req-work-scroll {
    position: relative;
    z-index: 100;
}
#spareConsumeBody .consume-report-meta.is-consume-hist-open {
    position: relative;
    z-index: 500;
}
.spare-consume-meta-form.is-consume-hist-open .spare-req-hist-popover,
#spareConsumeBody .consume-report-meta.is-consume-hist-open .spare-req-hist-popover {
    z-index: 600;
}
.spare-consume-meta-form .spare-req-no-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.spare-consume-meta-form .spare-req-hist-popover {
    left: 0;
    right: auto;
}
.spare-consume-meta-row {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: center;
    gap: 12px 14px;
    min-height: 36px;
}
.spare-consume-meta-row-pms {
    padding-top: 0;
}
.spare-consume-meta-row-top {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 14px 18px;
    align-items: center;
}
.spare-consume-meta-field {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
}
.spare-consume-meta-inline-label {
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}
.spare-consume-meta-label {
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.02em;
    white-space: nowrap;
    padding-top: 1px;
}
.spare-consume-meta-input {
    width: 100%;
    box-sizing: border-box;
    min-height: 34px;
}
.spare-consume-meta-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 52px;
    max-height: 140px;
    padding: 8px 10px;
    resize: vertical;
    line-height: 1.45;
    font-family: inherit;
}
.spare-consume-meta-comments {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 0;
}
.spare-consume-meta-comments .spare-consume-meta-col-head {
    margin-bottom: 0;
}
.spare-consume-meta-pick {
    position: relative;
    min-width: 0;
}
.spare-consume-pick-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #1e3a5f;
    box-sizing: border-box;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.spare-consume-pick-trigger:hover:not(:disabled) {
    border-color: #93c5fd;
    background: #f8fafc;
}
.spare-consume-pick-trigger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f1f5f9;
    color: #64748b;
}
.spare-consume-pick-trigger.open,
.spare-consume-meta-pick.open .spare-consume-pick-trigger {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}
.spare-consume-pick-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spare-consume-pick-caret {
    flex-shrink: 0;
    font-size: 10px;
    color: #64748b;
}
.spare-consume-pick-menu {
    display: none;
    flex-direction: column;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}
.spare-consume-pick-menu-portal {
    display: flex !important;
}
.spare-consume-pick-search {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}
.spare-consume-pick-search .search-input {
    width: 100%;
    font-size: 12px;
    padding: 6px 8px;
    box-sizing: border-box;
}
.spare-consume-pick-head {
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 600;
    border-bottom: 1px solid #edf2f7;
    background: #fff;
    flex-shrink: 0;
}
.spare-consume-pick-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    max-height: 300px;
    padding: 4px;
}
.spare-consume-pick-dept {
    font-size: 10px;
    font-weight: 700;
    color: #718096;
    padding: 6px 8px 2px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.spare-consume-pick-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 7px 10px;
    border: none;
    border-radius: 4px;
    background: transparent;
    font-size: 12px;
    cursor: pointer;
    color: #2d3748;
    line-height: 1.35;
    box-sizing: border-box;
}
.spare-consume-pick-item:hover { background: #eff6ff; }
.spare-consume-pick-item.selected {
    background: #dbeafe;
    font-weight: 600;
    color: var(--navy);
}
.spare-consume-pick-item-job {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
.spare-consume-pick-item-none {
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 4px;
    padding-bottom: 8px;
}
.spare-consume-pick-item-none .spare-consume-pick-job-code {
    font-weight: 600;
    color: #64748b;
}
.spare-consume-pick-item-none.selected .spare-consume-pick-job-code {
    color: var(--navy);
}
.spare-consume-pick-job-code { font-weight: 700; color: #1e40af; }
.spare-consume-pick-job-sub {
    font-size: 10px;
    color: #64748b;
    font-weight: 500;
}
.spare-consume-pick-empty {
    padding: 14px 10px;
    text-align: center;
    font-size: 12px;
}
.spare-consume-meta-job-grid {
    display: grid;
    grid-template-columns: minmax(72px, 0.82fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.18fr);
    gap: 12px 14px;
    align-items: end;
    padding-top: 0;
}
.spare-consume-meta-job-grid.batch {
    grid-template-columns: minmax(72px, 0.82fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.18fr) 36px;
}
.spare-consume-meta-jobs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.spare-consume-meta-job-row .spare-consume-job-pick-trigger {
    width: 100%;
    box-sizing: border-box;
}
.spare-consume-meta-job-col-act {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 2px;
}
.spare-consume-job-row-rm {
    min-width: 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    line-height: 1;
    font-size: 18px;
}
.spare-consume-meta-job-add {
    display: flex;
    justify-content: flex-start;
    padding-top: 2px;
}
.spare-consume-job-row-add {
    font-weight: 700;
}
.consume-log-jobs-mini {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.consume-log-jobs-mini th,
.consume-log-jobs-mini td {
    border: 1px solid #cbd5e1;
    padding: 4px 8px;
    text-align: left;
    vertical-align: top;
}
.consume-log-jobs-mini th {
    background: #f1f5f9;
    font-size: 10px;
    letter-spacing: 0.04em;
}
.spare-consume-job-pick-host {
    display: none !important;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}
.spare-consume-job-pick-host.hidden { display: none; }
.spare-consume-meta-job-col-job { min-width: 0; }
.spare-consume-meta-col-head {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #1a202c;
    letter-spacing: 0.03em;
    margin-bottom: 5px;
    text-transform: uppercase;
}
.spare-consume-meta-job-col { min-width: 0; }
@media (max-width: 900px) {
    .spare-consume-meta-row-top {
        grid-template-columns: 1fr;
    }
    .spare-consume-meta-field {
        grid-template-columns: 88px minmax(0, 1fr);
    }
    .spare-consume-meta-row {
        grid-template-columns: 88px minmax(0, 1fr);
    }
    .spare-consume-meta-job-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.spare-consume-item-block {
    border-top: 1px solid #e2e8f0;
    padding: 8px 14px 10px;
    background: #fff;
}
.spare-consume-item-head {
    font-size: 11px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.spare-consume-item-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.spare-consume-item-table th,
.spare-consume-item-table td {
    padding: 4px 6px;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
}
.spare-consume-item-table thead th {
    background: #f7fafc;
    font-weight: 700;
    color: #4a5568;
    text-align: center;
}
.spare-consume-item-table .spare-consume-plan-label {
    background: #f7fafc;
    font-weight: 700;
    color: #2d3748;
    text-align: left;
    white-space: nowrap;
    width: 108px;
}
.spare-consume-item-table .spare-consume-plan-label.action {
    color: #2b6cb0;
}
.spare-consume-item-table .spare-req-meta-input {
    font-size: 11px;
    padding: 5px 8px;
}
.spare-consume-job-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.spare-consume-job-wrap .spare-req-meta-input { flex: 1; min-width: 0; }
.spare-consume-job-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: min(720px, 88vw);
    z-index: 300;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: min(420px, 70vh);
}
.spare-consume-job-popover-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    padding-right: 40px;
    border-bottom: 1px solid #e2e8f0;
    background: #f7fafc;
    font-weight: 700;
    font-size: 12px;
    color: var(--navy);
    position: relative;
}
.spare-consume-job-popover-head .modal-x { top: 6px; right: 8px; }
.spare-consume-job-scroll {
    overflow: auto;
    max-height: 360px;
}
.spare-consume-job-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.spare-consume-job-table th {
    position: sticky;
    top: 0;
    background: #edf2f7;
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #cbd5e0;
    z-index: 1;
}
.spare-consume-job-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}
.spare-consume-job-table tbody tr:hover td { background: #ebf8ff; }
.spare-consume-work-layout #consumeListScroll .spare-data-table,
.spare-consume-work-layout #consumeListScroll .vl-inner,
.wr-spare-work-layout #wrSpareListScroll .spare-data-table,
.wr-spare-work-layout #wrSpareListScroll .vl-inner {
    min-width: 898px;
}
.spare-consume-work-layout #consumeListHead .spare-data-table,
.wr-spare-work-layout #wrSpareListHead .spare-data-table {
    min-width: 898px;
    width: 100%;
}
.spare-data-table-consume,
.spare-data-table-wrspare { min-width: 898px; }
/* Page 2 SPARE table — live Page 2 */
.wr-spare-work-layout .spare-data-table-wrspare th,
.wr-spare-work-layout .spare-data-table-wrspare td {
    text-align: center !important;
}
.wr-spare-work-layout .spare-data-table-wrspare .c-item {
    text-align: left !important;
}
/* Page 2 SPARE table — print / preview */
.wr-print-page .wr-spare-print-table-wrap .spare-data-table-wrspare th,
.wr-print-page .wr-spare-print-table-wrap .spare-data-table-wrspare td,
.wr-print-page .wr-print-spare-table.spare-data-table-wrspare th,
.wr-print-page .wr-print-spare-table.spare-data-table-wrspare td,
.wr-print-page .wr-spare-print-layout .spare-data-table-wrspare th,
.wr-print-page .wr-spare-print-layout .spare-data-table-wrspare td {
    text-align: center !important;
}
.wr-print-page .wr-spare-print-table-wrap .spare-data-table-wrspare .c-item,
.wr-print-page .wr-print-spare-table.spare-data-table-wrspare .c-item,
.wr-print-page .wr-spare-print-layout .spare-data-table-wrspare .c-item {
    text-align: left !important;
}
.spare-detail-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: -4px 0 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    min-height: 480px;
}
.spare-detail-panel.open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}
.spare-detail-inner { padding: 16px; height: 100%; overflow-y: auto; max-height: calc(100vh - 240px); }
.spare-panel-close {
    float: right; border: none; background: #edf2f7; width: 28px; height: 28px;
    border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1;
}
.spare-panel-title { margin: 0 0 4px; font-size: 15px; color: var(--navy); clear: both; }
.spare-panel-sub { margin: 0 0 10px; font-size: 13px; color: #4a5568; }
.spare-panel-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.spare-panel-meta {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px;
    font-size: 12px; margin-bottom: 14px; padding: 10px; background: #f8fafc; border-radius: 8px;
}
.spare-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.spare-panel-scroll { max-height: 140px; overflow: auto; margin-bottom: 10px; }
.spare-rec-hint { font-size: 12px; margin-top: 8px; }
.spare-req-list-modal-wrap { padding: 12px; }
.spare-req-list-modal {
    width: min(96vw, 1360px);
    max-width: min(96vw, 1360px);
    padding: 0;
    overflow: hidden;
}
#spareReqListBody { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.spare-req-list-wrap {
    display: flex;
    flex-direction: column;
    background: #fff;
}
.spare-req-list-main-wrap {
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}
.spare-req-list-main-wrap .spare-req-list-panel-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 14px 14px;
}
.spare-req-list-main-wrap .spare-req-list-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.spare-req-list-main-wrap .spare-req-list-scroll {
    flex: 1;
    min-height: 120px;
    max-height: none;
    overflow: auto;
}
.spare-req-list-main-wrap .req-list-phase-tabs {
    flex-shrink: 0;
}
.spare-req-list-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    padding-right: 44px;
    border-bottom: 1px solid #e2e8f0;
    background: #f7fafc;
    flex-shrink: 0;
    position: relative;
}
.spare-req-list-head-pick {
    padding-right: 44px;
}
.spare-req-list-wrap.is-pick-only .spare-req-list-head .modal-x {
    position: absolute;
    top: 6px;
    right: 10px;
}
.spare-req-list-modal-wrap.is-pick-mode .spare-req-list-modal {
    width: min(92vw, 1200px);
    max-width: min(92vw, 1200px);
}
.spare-req-list-head .modal-x {
    position: absolute;
    top: 6px;
    right: 10px;
}
.spare-req-list-count {
    font-size: 12px;
    font-weight: 500;
    margin-left: 6px;
}
.spare-req-list-panel-wrap {
    padding: 0 14px 14px;
    flex-shrink: 0;
}
.spare-req-list-panel.panel {
    min-height: 0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.spare-req-list-head-wrap {
    flex-shrink: 0;
    overflow: hidden;
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}
.spare-req-list-table {
    width: 100%;
    table-layout: fixed;
    font-family: inherit;
    font-size: var(--list-item-font);
    margin: 0;
    min-width: 980px;
}
.spare-req-list-table col.rl-col-chk { width: 26px; }
.spare-req-list-table col.rl-col-type { width: 72px; }
.spare-req-list-table col.rl-col-reqno { width: 152px; }
.spare-req-list-table col.rl-col-spare-group { width: 148px; }
.spare-req-list-table col.rl-col-req-date { width: 166px; }
.spare-req-list-table col.rl-col-req-port { width: 112px; }
.spare-req-list-table col.rl-col-submitted { width: 96px; }
.spare-req-list-table col.rl-col-status { width: 88px; }
.spare-req-list-table col.rl-col-recv-date { width: 112px; }
.spare-req-list-table col.rl-col-recv-port { width: 112px; }
.spare-req-list-table col.rl-col-os { width: 56px; }
.spare-req-list-table col.rl-col-total { width: 56px; }
.spare-req-list-panel .spare-data-table.spare-req-list-table,
.spare-req-hist-list-panel .spare-data-table.spare-req-list-table {
    min-width: 980px;
}
.req-list-phase-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px 0;
    background: #fff;
    border-bottom: 1px solid #edf2f7;
}
.req-phase-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    font-size: 11px;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}
.req-phase-tab:hover { background: #f7fafc; border-color: #cbd5e0; }
.req-phase-tab.active {
    background: #ebf4ff;
    border-color: #90cdf4;
    color: var(--navy);
}
.req-phase-count {
    display: inline-flex;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    justify-content: center;
}
.req-phase-tab.active .req-phase-count { background: #bee3f8; color: var(--navy); }
.spare-req-list-table .spare-req-list-status { padding: 0 4px; }
.spare-req-list-table .rl-st-Draft { background: #718096; }
.spare-req-list-table .rl-st-Reported { background: #3182ce; }
.spare-req-list-table .rl-st-Confirmed { background: #d97706; }
.spare-req-list-table .rl-st-Exported,
.spare-req-list-table .rl-st-Submitted { background: #5a67d8; }
.spare-req-list-table .rl-st-Requisition { background: #3182ce; }
.spare-req-list-table .rl-st-ReqQuote { background: #5a67d8; }
.spare-req-list-table .rl-st-Evaluating { background: #805ad5; }
.spare-req-list-table .rl-st-Quoted { background: #7c3aed; }
.spare-req-list-table .rl-st-Evaluated { background: #805ad5; }
.spare-req-list-table .rl-st-Ordered { background: #d97706; }
.spare-req-list-table .rl-st-Received { background: #16a34a; }
.spare-req-list-table .rl-st-ReceivedExport { background: #0d9488; }
.spare-req-list-table .rl-st-PartialRecv { background: #38a169; }
.spare-req-list-table .spare-req-list-daterange {
    font-size: var(--list-item-font);
    color: #2d3748;
}
/* Match Work Plan / Consumption List Index (Period + Filter / Search) */
.spare-req-list-filters.hist-toolbar,
.spare-req-list-filters {
    flex-shrink: 0;
    margin: 0 14px 10px;
    padding: 0 !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}
.spare-req-list-filters.list-filter-stack {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: visible;
}
.spare-req-list-filters .list-filter-period-row,
.spare-req-list-filters .list-filter-search-row {
    padding: 8px 14px;
    border-bottom: none;
}
.spare-req-list-filters .list-filter-period-row {
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}
.spare-req-list-filters .list-filter-search-row {
    padding-top: 6px;
}
.spare-req-list-main-wrap .req-list-phase-tabs {
    flex-shrink: 0;
}
.spare-req-list-filters .search-field-wrap {
    flex: 1;
    min-width: 200px;
    max-width: none;
}
.spare-req-hist-popover .spare-req-list-filters {
    margin-left: 14px;
    margin-right: 14px;
    flex-shrink: 0;
}
.spare-req-list-head-table thead th {
    padding: 6px 8px;
    font-size: var(--list-item-head-font);
    font-weight: 700;
    color: #4a5568;
    background: #f7fafc;
    vertical-align: middle;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
    border: none;
    border-right: 1px solid #e2e8f0;
    box-sizing: border-box;
}
.spare-req-list-head-table thead tr th:last-child { border-right: none; }
.spare-req-list-head-table thead tr:first-child th[rowspan="2"] {
    padding: 8px 6px;
}
.spare-req-list-head-table thead th.spare-req-list-th-group {
    padding: 6px 6px 2px;
    vertical-align: bottom;
}
.spare-req-list-head-table thead th.spare-req-list-th-sub {
    padding: 2px 6px 7px;
    font-size: var(--list-item-head-font);
    font-weight: 600;
    color: #718096;
    border-top: 1px solid #e2e8f0;
}
.spare-req-list-head-table thead th.spare-req-list-chk { padding: 6px 2px; }
.spare-req-list-scroll {
    height: 360px;
    min-height: 360px;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}
.spare-req-list-body-table tbody td {
    padding: 0 8px;
    height: 36px;
    border-bottom: 1px solid #f0f3f7;
    vertical-align: middle;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}
.spare-req-list-body-table tbody tr {
    cursor: pointer;
    transition: background .12s ease;
}
.spare-req-list-body-table tbody tr:hover td { background: #f6f9fd; }
.spare-req-list-body-table tbody tr.sr-req-sel td,
.spare-consume-log-body-table tbody tr.sr-req-sel td { background: #e8f1ff !important; }
.spare-req-list-body-table tbody tr.sr-req-sel:hover td { background: #e8f1ff !important; }
.spare-consume-log-body-table tbody tr.sr-req-sel td,
.spare-req-hist-popover .spare-consume-log-body-table tbody tr.sr-req-sel td,
.spare-req-hist-popover .spare-req-list-body-table tbody tr.sr-req-sel td {
    background: rgba(66, 153, 225, 0.35) !important;
}
.spare-consume-log-body-table tbody tr.sr-req-sel:hover td,
.spare-req-hist-popover .spare-consume-log-body-table tbody tr.sr-req-sel:hover td,
.spare-req-hist-popover .spare-req-list-body-table tbody tr.sr-req-sel:hover td {
    background: rgba(66, 153, 225, 0.45) !important;
}
#wpHistListScroll .wp-list-table tbody tr.sr-req-sel td {
    background: #e8f1ff !important;
}
#wpHistListScroll .wp-list-table tbody tr.sr-req-sel:hover td {
    background: #dbeafe !important;
}
.spare-req-hist-list-scroll:focus {
    outline: none;
}
.spare-req-list-table .spare-req-list-chk {
    width: 26px;
    text-align: center;
    padding: 0 2px;
}
.spare-req-list-table .spare-req-list-chk input {
    margin: 0;
    accent-color: var(--blue);
    cursor: pointer;
    width: 13px;
    height: 13px;
}
.spare-req-list-table .spare-req-list-type {
    font-size: var(--list-item-font);
    font-weight: 600;
    text-align: center;
    padding: 0 4px;
    color: #4a5568;
}
.spare-req-list-table .spare-req-list-type.rl-type-urgent { color: #c53030; }
.spare-req-list-table .spare-req-list-type.rl-type-dock { color: #2b6cb0; }
.spare-req-list-head-table thead th.spare-req-list-th-type {
    text-align: center;
    padding-left: 4px;
    padding-right: 4px;
}
.spare-req-list-table .spare-req-list-reqno {
    font-weight: 700;
    color: var(--blue);
    text-align: left;
    padding-left: 6px;
    padding-right: 4px;
    white-space: nowrap;
}
.spare-req-list-table .spare-req-list-spare-group {
    text-align: left;
    padding-left: 6px;
    padding-right: 4px;
    color: #2d3748;
    white-space: nowrap;
}
.spare-req-list-table .spare-req-list-os,
.spare-req-list-table .spare-req-list-total {
    padding-left: 1px;
    padding-right: 1px;
    font-weight: 700;
    font-size: var(--list-item-font);
    font-variant-numeric: tabular-nums;
    color: var(--navy);
    text-align: center;
}
.spare-req-list-head-table thead th.spare-col-head-stack {
    white-space: normal;
    line-height: 1.1;
    overflow: visible;
    padding: 6px 1px;
    font-size: var(--list-item-head-font);
}
.spare-req-list-head-table thead th.spare-col-head-stack .spare-head-sub {
    display: block;
    text-align: center;
    font-size: var(--list-item-head-font);
    font-weight: 600;
    color: #718096;
}
.spare-req-list-head-table thead th.spare-req-list-th-reqno,
.spare-req-list-head-table thead th.spare-req-list-th-spare-group {
    text-align: center;
    padding-left: 2px;
    padding-right: 2px;
}
.spare-req-list-head-table thead th.spare-req-list-chk {
    text-align: center;
    vertical-align: middle;
    padding: 0 2px;
}
.spare-req-list-head-table thead th.spare-req-list-chk .spare-req-list-head-chk {
    margin: 0;
    accent-color: var(--blue);
    cursor: pointer;
    width: 13px;
    height: 13px;
}

/* SPARE Report History — match PMS Report History filter + list chrome */
#tab-history .spare-hist-req-host .spare-req-list-filters.hist-toolbar,
#tab-history .spare-hist-req-host .spare-req-list-filters,
#tab-history .spare-hist-req-host .spare-hist-pms-filters {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 0 !important;
    font-family: inherit;
    font-size: inherit;
}
#tab-history .spare-hist-req-host .spare-req-list-filters .list-filter-period-row,
#tab-history .spare-hist-req-host .spare-req-list-filters .list-filter-search-row {
    padding: 10px 14px;
    font-family: inherit;
}
#tab-history .spare-hist-req-host .spare-req-list-filters .list-filter-period-row {
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}
#tab-history .spare-hist-req-host .spare-req-list-filters .list-filter-search-row {
    padding-top: 6px;
}
#tab-history .spare-hist-req-host .spare-req-list-filters .act-period-filter {
    font-size: 11px;
    font-family: inherit;
}
#tab-history .spare-hist-req-host .spare-req-list-filters .act-period-label,
#tab-history .spare-hist-req-host .spare-req-list-filters .act-period-input,
#tab-history .spare-hist-req-host .spare-req-list-filters .act-period-sep {
    font-family: inherit;
}
#tab-history .spare-hist-req-host .spare-req-list-filters .act-period-input {
    font-size: 11px;
    width: 118px;
}
#tab-history .spare-hist-req-host .spare-req-list-filters .search-input {
    font-size: 12px;
    font-family: inherit;
}
#tab-history .spare-hist-req-host .spare-req-list-filters .count-label {
    font-size: 11px;
    font-family: inherit;
}
#tab-history .spare-hist-req-host .spare-req-list-main-wrap .spare-req-list-panel-wrap,
#tab-history .spare-hist-req-host .spare-req-list-panel-wrap {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    display: flex;
    flex-direction: column;
}
#tab-history .spare-hist-req-host .spare-req-list-main-wrap .spare-req-list-panel,
#tab-history .spare-hist-req-host .spare-req-list-panel.panel {
    flex: 1 1 auto;
    width: 100%;
    box-sizing: border-box;
    min-height: 0;
    max-height: calc(100vh - 420px);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
#tab-history .spare-hist-req-host .spare-req-list-main-wrap .spare-req-list-scroll,
#tab-history .spare-hist-req-host .spare-req-list-scroll {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}
#tab-history .spare-hist-req-host .spare-req-list-head-wrap {
    background: var(--navy);
    border-bottom: none;
    flex-shrink: 0;
}
#tab-history .spare-hist-req-host .spare-req-list-head-table thead th {
    background: var(--navy);
    color: #fff;
    font-weight: 600;
    font-size: var(--list-item-head-font);
    font-family: inherit;
    border-right-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
#tab-history .spare-hist-req-host .spare-req-list-head-table thead th.spare-req-list-th-sub,
#tab-history .spare-hist-req-host .spare-req-list-head-table thead th.spare-col-head-stack .spare-head-sub {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
    border-top-color: rgba(255, 255, 255, 0.2);
}
#tab-history .spare-hist-req-host .spare-req-list-head-table thead th.spare-req-list-chk .spare-req-list-head-chk,
#tab-history .spare-hist-req-host .spare-req-list-table .spare-req-list-chk input {
    accent-color: var(--navy);
}
#tab-history .spare-hist-req-host .spare-req-list-body-table tbody tr {
    height: var(--list-row-h);
}
#tab-history .spare-hist-req-host .spare-req-list-body-table tbody td {
    height: var(--list-row-h);
    padding: 6px 10px;
}
.spare-req-list-table .spare-req-list-date,
.spare-req-list-table .spare-req-list-port {
    padding-left: 4px;
    padding-right: 4px;
}
.spare-req-list-table .spare-req-list-date {
    font-variant-numeric: tabular-nums;
    color: #4a5568;
    font-size: 11px;
}
.spare-req-list-table .spare-req-list-port { color: #2d3748; }
.spare-req-list-empty {
    padding: 48px 16px !important;
    text-align: center;
    height: auto !important;
    border-bottom: none !important;
}
.spare-req-list-empty-icon {
    display: block;
    font-size: 28px;
    margin-bottom: 8px;
    opacity: .45;
}
.spare-req-list-empty-title {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 700;
    color: #4a5568;
}
.spare-req-list-empty-sub {
    margin: 0;
    font-size: 12px;
}
.spare-req-list-hint {
    margin: 0;
    padding: 8px 18px 12px;
    font-size: 11px;
    text-align: right;
}

/* Consumption List (View Consumption List) */
#spareConsumeLogBody { min-height: 0; }
#spareConsumeModal.is-consume-list-window,
#spareConsumeLogModal {
    overflow: auto;
    align-items: flex-start;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
}
#spareConsumeModal.is-consume-list-window .modal-box.spare-req-work-modal,
#spareConsumeLogModal .modal-box.spare-req-list-modal {
    width: 1000px;
    min-width: 1000px;
    max-width: 1000px;
    height: min(92vh, 920px);
    min-height: min(92vh, 920px);
    max-height: 92vh;
    margin: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.wr-consume-preview-scroll {
    background: #edf2f7;
    padding: 12px;
}
.wr-consume-preview-doc .wr-print-page,
.wr-consume-preview-doc.df-print-root .wr-page {
    max-width: 210mm;
    margin: 0 auto;
}
.spare-consume-log-wrap .spare-req-list-modal,
.spare-req-list-modal-wrap #spareConsumeLogBody .spare-req-list-wrap {
    min-width: 0;
}
.spare-consume-log-table {
    min-width: 860px;
    table-layout: fixed;
}
/* Align shared headers with Work History list widths */
.spare-consume-log-table col.cl-col-chk { width: 32px; }
.spare-consume-log-table col.cl-col-type { width: 52px; }
.spare-consume-log-table col.cl-col-file { width: 115px; }
.spare-consume-log-table col.cl-col-job { width: 72px; }
.spare-consume-log-table col.cl-col-sort1 { width: auto; min-width: 130px; }
.spare-consume-log-table col.cl-col-sort2 { width: auto; min-width: 130px; }
.spare-consume-log-table col.cl-col-reported { width: 88px; }
.spare-consume-log-table col.cl-col-status { width: 96px; }
.spare-consume-log-table col.cl-col-total { width: 56px; }
/* Work Permit list — Work History columns through Status (no Total Data) */
.wp-list-table col.wp-col-chk { width: 32px; }
.wp-list-table col.wp-col-type { width: 52px; }
.wp-list-table col.wp-col-file { width: 115px; }
.wp-list-table col.wp-col-crit { width: 36px; }
.wp-list-table col.wp-col-job { width: 72px; }
.wp-list-table col.wp-col-sort1 { width: auto; min-width: 130px; }
.wp-list-table col.wp-col-sort2 { width: auto; min-width: 130px; }
.wp-list-table col.wp-col-reported { width: 88px; }
.wp-list-table col.wp-col-status { width: 96px; }
.wp-list-table .wp-st-Reported { background: #3182ce; }
.wp-list-table .wp-st-Confirmed { background: #d97706; }
.wp-list-table .wp-st-Approved { background: #16a34a; }
.wp-list-table .wp-st-Submitted { background: #d97706; }
.wp-list-panel .spare-data-table.wp-list-table { min-width: 860px; }
#workPermitBody .wp-meta-form {
    margin: 0;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
#workPermitBody .wp-meta-form .spare-req-hist-popover {
    width: 100%;
    max-width: 100%;
}
#workPermitBody .wp-meta-form .spare-req-hist-popover .spare-req-list-table,
#workPermitBody .wp-meta-form .spare-req-hist-popover .wp-list-table {
    width: 100%;
    min-width: 0;
    max-width: 960px;
}
.spare-consume-log-panel .spare-data-table.spare-consume-log-table {
    min-width: 860px;
}
.spare-consume-log-wrap .spare-consume-log-toolbar {
    padding-bottom: 8px;
}
/* Match Work Plan / Work History Index list-filter-stack (Period left edge = table □ column) */
.spare-consume-log-filters.hist-toolbar,
.spare-consume-log-filters {
    flex-shrink: 0;
    margin: 0 14px 10px;
    padding: 0 !important; /* override .hist-toolbar / .filter-bar padding */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}
.spare-consume-log-filters.list-filter-stack {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: visible;
}
.spare-consume-log-filters .list-filter-period-row,
.spare-consume-log-filters .list-filter-search-row {
    padding: 8px 14px;
    border-bottom: none;
}
.spare-consume-log-filters .list-filter-period-row {
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}
.spare-consume-log-filters .list-filter-search-row {
    padding-top: 6px;
}
.spare-consume-log-filters .search-field-wrap {
    flex: 1;
    min-width: 200px;
    max-width: none;
}
/* Hist popover: same horizontal inset as list panel (14px) so Period aligns with □ column */
.spare-req-hist-popover .spare-consume-log-filters {
    margin-left: 14px;
    margin-right: 14px;
    flex-shrink: 0;
}
.spare-consume-log-head-table thead th.cl-col-sort-h {
    font-size: 10px;
    letter-spacing: 0.02em;
}
.spare-consume-log-head-table thead th {
    padding: 8px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #4a5568;
    background: #f7fafc;
    vertical-align: middle;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
    border: none;
    box-sizing: border-box;
}
.spare-consume-log-head-table thead th.spare-consume-log-chk { padding: 6px 4px; }
.spare-consume-log-head-table thead th.spare-consume-log-th-type { width: 52px; padding: 8px 4px; }
.spare-consume-log-head-table thead th.spare-consume-log-th-file { width: 115px; }
.spare-consume-log-head-table thead th.spare-consume-log-th-job { width: 72px; }
.spare-consume-log-head-table thead th.spare-consume-log-th-sort { min-width: 130px; }
.spare-consume-log-head-table thead th.spare-consume-log-th-reported { width: 88px; white-space: normal; }
.spare-consume-log-head-table thead th.spare-consume-log-th-status { width: 96px; }
.spare-consume-log-head-table thead th.spare-consume-log-th-num { width: 56px; white-space: normal; }
.spare-consume-log-body-table tbody td {
    padding: 0 8px;
    height: 36px;
    vertical-align: middle;
    border-bottom: 1px solid #edf2f7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #2d3748;
}
.spare-consume-log-body-table tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}
.spare-consume-log-body-table tbody tr:hover td { background: #f6f9fd; }
.spare-consume-log-table .spare-consume-log-chk {
    text-align: center;
    padding: 0 2px;
    width: 32px;
}
.spare-consume-log-table .spare-consume-log-chk input { margin: 0; accent-color: var(--blue); cursor: pointer; }
.spare-consume-log-table .spare-consume-log-type {
    text-align: center;
    padding: 0 4px;
    width: 52px;
}
.spare-consume-log-table .spare-consume-log-type .hist-type-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}
.spare-consume-log-table .hist-type-defect .hist-type-mark { background: #c05621; }
.spare-consume-log-table .hist-type-maint .hist-type-mark { background: #2b6cb0; }
.spare-consume-log-table .hist-type-consume .hist-type-mark { background: #2f855a; }
.spare-consume-log-table .hist-type-postpone .hist-type-mark { background: #805ad5; }
.spare-consume-log-table .hist-type-wp .hist-type-mark { background: #0d9488; }
.spare-consume-log-table .spare-consume-log-file {
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spare-consume-log-table .spare-consume-log-date,
.spare-consume-log-table .spare-consume-log-made,
.spare-consume-log-table .spare-consume-log-reported {
    text-align: center;
    color: #4a5568;
    font-variant-numeric: tabular-nums;
}
.spare-consume-log-table .spare-consume-log-pms,
.spare-consume-log-table .spare-consume-log-job,
.spare-consume-log-table .spare-consume-log-sort {
    color: #2d3748;
    text-align: center;
}
.spare-consume-log-table .spare-consume-log-job {
    white-space: nowrap;
}
.spare-consume-log-table .spare-consume-log-status {
    text-align: center;
    white-space: nowrap;
}
.spare-consume-log-table .cl-st-Draft { background: #718096; }
.spare-consume-log-table .cl-st-Reported { background: #3182ce; }
.spare-consume-log-table .cl-st-Confirmed { background: #d97706; }
.spare-consume-log-table .cl-st-Approved { background: #16a34a; }
.spare-consume-log-table .spare-consume-log-comments {
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 0;
}
.spare-consume-log-table .spare-consume-log-total {
    text-align: center;
    font-weight: 600;
    color: #2b6cb0;
    font-variant-numeric: tabular-nums;
}

.spare-req-work-modal-wrap { padding: 12px; }
#spareReqWorkModal .modal-box.spare-req-work-modal,
#spareConsumeModal .modal-box.spare-req-work-modal,
#spareReceiveModal .modal-box.spare-req-work-modal {
    width: min(98vw, 1560px);
    max-width: 98vw;
    height: min(92vh, 920px);
    max-height: 92vh;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
/* New Requisition / Consumed / Received Parts — fixed modal width (aligned with WR spare panel) */
#spareReqWorkModal,
#spareConsumeModal,
#spareReceiveModal {
    overflow: auto;
    align-items: flex-start;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
}
#spareReqListModal {
    overflow: auto;
    align-items: flex-start;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
}
#spareReqListModal.is-req-xfer-stack {
    z-index: 10150;
}
#spareReqWorkModal.is-req-xfer-underlay {
    z-index: 10000;
}
#spareReqListModal .modal-box.spare-req-list-modal {
    width: min(96vw, 1360px);
    max-width: min(96vw, 1360px);
    height: min(92vh, 920px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    margin: auto;
}
#spareReqWorkModal .modal-box.spare-req-work-modal,
#spareConsumeModal .modal-box.spare-req-work-modal,
#spareReceiveModal .modal-box.spare-req-work-modal {
    width: min(98vw, 1400px);
    max-width: min(98vw, 1400px);
    min-width: 0;
    flex-shrink: 0;
    margin: auto;
}
#spareReqWorkModal .spare-req-work-layout:not(.is-preview):not(.wr-spare-full-width),
#spareConsumeModal .spare-req-work-layout:not(.spare-consume-preview-layout):not(.wr-spare-full-width) {
    grid-template-columns: 240px 1fr !important;
}
#spareReqWorkModal .spare-req-work-layout .tree-panel,
#spareConsumeModal .spare-req-work-layout .tree-panel {
    max-height: none;
}
/* Work Report — wider spare-req-work-modal; Defect / Work Permit stay 1000px via #id rules above */
#workReportModal .modal-box.wr-modal.spare-req-work-modal {
    width: min(98vw, 1400px);
    max-width: min(98vw, 1400px);
    min-width: 0;
}
#spareReqWorkBody, #spareConsumeBody, #spareReceiveBody { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.spare-req-work-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    position: relative;
}
.spare-req-work-head-block {
    flex-shrink: 0;
    border-bottom: 1px solid #e2e8f0;
    background: #f7fafc;
}
.spare-req-work-head {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 10px 48px 10px 14px;
    border-bottom: none;
    background: transparent;
    flex-shrink: 0;
    position: relative;
    z-index: 60;
}
.spare-req-hq-flow-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 0 14px;
    flex-wrap: wrap;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
}
.spare-req-hq-flow-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 10px 0 8px;
    align-self: flex-end;
}
.spare-req-hq-flow-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 2px;
    flex: 1;
    min-width: 0;
    padding: 6px 0 0;
}
.spare-req-hq-flow-arrow {
    color: #cbd5e0;
    font-size: 11px;
    font-weight: 600;
    user-select: none;
    line-height: 1;
    align-self: flex-end;
    padding: 0 1px 9px;
}
.spare-req-hq-flow-btn-stacked {
    white-space: normal;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
    min-width: 5.75rem;
    padding-top: 6px;
    padding-bottom: 5px;
}
.spare-req-hq-flow-btn-stacked.spare-req-hq-flow-btn-active {
    padding-top: 8px;
    padding-bottom: 5px;
}
.spare-req-hq-flow-btn-label {
    display: block;
}
.spare-req-hq-flow-btn-sub {
    display: block;
    font-size: 10px;
    font-weight: 500;
    opacity: 0.82;
    margin-bottom: 1px;
}
.spare-req-hq-flow-btn {
    appearance: none;
    font-family: inherit;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    padding: 8px 14px 7px;
    margin: 0;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: #edf2f7;
    color: #4a5568;
    cursor: pointer;
    position: relative;
    transition: background .12s, color .12s, border-color .12s, box-shadow .12s;
}
.spare-req-hq-flow-btn:hover:not(:disabled):not(.spare-req-hq-flow-btn-active) {
    background: #ebf4ff;
    color: var(--navy);
    border-color: #bee3f8;
}
.spare-req-hq-flow-btn-active {
    background: #fff;
    border-color: #cbd5e0;
    border-bottom-color: #fff;
    color: var(--navy);
    font-weight: 700;
    z-index: 2;
    bottom: -1px;
    padding-top: 10px;
    padding-bottom: 7px;
    box-shadow: 0 -1px 0 #fff;
}
.spare-req-hq-flow-btn-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 8px 8px 0 0;
    background: var(--blue);
}
.spare-req-hq-flow-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f7fafc;
    color: #a0aec0;
    border-color: #edf2f7;
}
.spare-req-hq-flow-btn:disabled:hover {
    background: #f7fafc;
    color: #a0aec0;
    border-color: #edf2f7;
}
.spare-req-hq-flow-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}
/* × 버튼은 absolute라 flex 흐름 밖 — 헤더 우측 패딩으로 자리 확보 */
.spare-req-work-head .modal-x { top: 10px; right: 12px; }
.spare-req-work-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}
/* Complete 완료 후 잠금 상태 — 입력/버튼은 disabled, 시각적으로 비활성 톤 */
.spare-req-work-scroll.is-req-locked {
    background: #f8fafc;
}
.spare-req-work-scroll.is-req-locked input:disabled,
.spare-req-work-scroll.is-req-locked select:disabled,
.spare-req-work-scroll.is-req-locked textarea:disabled {
    background: #eef2f6;
    color: #64748b;
    cursor: not-allowed;
}
.spare-req-work-scroll.is-req-locked button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.spare-req-work-scroll.is-req-locked #reqWorkHistBtn:not(:disabled) {
    opacity: 1;
    cursor: pointer;
}
/* Hist list (Period / Filter / Index / Print / Preview / checkboxes) must stay usable while form is locked */
.spare-req-work-scroll.is-req-locked #reqWorkHistPanel input:not(:disabled),
.spare-req-work-scroll.is-req-locked #reqWorkHistPanel select:not(:disabled),
.spare-req-work-scroll.is-req-locked #reqWorkHistPanel textarea:not(:disabled) {
    background: #fff;
    color: inherit;
    cursor: text;
}
.spare-req-work-scroll.is-req-locked #reqWorkHistPanel input[type="checkbox"]:not(:disabled) {
    cursor: pointer;
}
.spare-req-work-scroll.is-req-locked #reqWorkHistPanel button:not(:disabled) {
    opacity: 1;
    cursor: pointer;
}
.spare-req-work-scroll.is-req-locked .spare-req-quote-vendor-trigger:not(:disabled),
.spare-req-work-scroll.is-req-locked .spare-req-quote-cur-trigger:not(:disabled),
.spare-req-work-scroll.is-req-locked .spare-req-quote-col-chk:not(:disabled),
.spare-req-work-scroll.is-req-locked .spare-req-quote-row-chk:not(:disabled),
.spare-req-work-scroll.is-req-locked .spare-req-quote-price-input:not(:disabled) {
    opacity: 1;
    cursor: pointer;
}
.spare-req-work-scroll.is-req-locked .spare-req-rcvd-qty-input:not(:disabled) {
    opacity: 1;
    cursor: text;
    background: #fff;
    color: inherit;
}
.spare-req-work-scroll.is-req-locked #reqWorkReceivedOn:not(:disabled),
.spare-req-work-scroll.is-req-locked #reqWorkReceivedPort:not(:disabled),
.spare-req-work-scroll.is-req-locked #reqWorkShipComments:not(:disabled) {
    opacity: 1;
    cursor: text;
    background: #fff;
    color: inherit;
}
.spare-req-work-scroll.is-req-locked .tvc-date-input-wrap:has(#reqWorkReceivedOn:not([readonly])) .tvc-date-picker-btn:not(:disabled),
.spare-req-work-scroll.is-req-locked .tvc-date-input-wrap:has(#reqWorkReceivedOn:not(:disabled)) .tvc-date-picker-btn:not(:disabled) {
    opacity: 1;
    cursor: pointer;
    pointer-events: auto;
}
.spare-req-work-title { margin: 0; font-size: 15px; color: var(--navy); font-weight: 700; }
#spareConsumeBody .spare-consume-draft-wrap .spare-req-work-head {
    background: var(--navy);
    padding: 10px 48px 10px 18px;
}
#spareConsumeBody .spare-consume-draft-wrap .spare-req-work-title {
    color: #fff;
    font-size: 14px;
}
#spareConsumeBody .spare-consume-draft-wrap .spare-req-work-head .modal-x {
    color: #fff;
    top: 8px;
}
#spareConsumeBody .spare-consume-draft-actions {
    flex-shrink: 0;
    border-top: 1px solid #e2e8f0;
}
#spareReqWorkBody .spare-req-draft-wrap .spare-req-work-head-block {
    background: var(--navy);
    border-bottom: none;
}
#spareReqWorkBody .spare-req-draft-wrap .spare-req-work-head {
    background: var(--navy);
    padding: 10px 48px 10px 18px;
}
#spareReqWorkBody .spare-req-draft-wrap .spare-req-work-title {
    color: #fff;
    font-size: 14px;
}
#spareReqWorkBody .spare-req-draft-wrap .spare-req-work-head .modal-x {
    color: #fff;
    top: 8px;
}
#spareReqWorkBody .spare-req-draft-actions {
    flex-shrink: 0;
    border-top: 1px solid #e2e8f0;
}
.spare-req-work-no { color: var(--blue); }
.spare-req-work-lines { font-size: 12px; font-weight: 500; margin-left: 6px; }
.spare-req-work-head-spacer { flex: 1; min-width: 8px; }
.spare-req-work-meta {
    flex-shrink: 0;
    margin: 0 14px 10px;
    padding: 0;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    overflow: visible;
    position: relative;
    z-index: 20;
}
.spare-req-approval-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 10px 14px;
    border-bottom: 1px solid #edf2f7;
    background: #fff;
}
.spare-req-approval-row--split {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
    align-items: center;
    gap: 0;
    padding: 0;
}
.spare-req-approval-left {
    padding: 10px 14px;
    border-right: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.spare-req-approval-row .wr-maint-approval {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
}
#spareReqWorkBody .wr-maint-approval .wr-maint-chk,
#spareReqWorkBody .wr-maint-approval .wr-maint-chk input[type="checkbox"] {
    pointer-events: none;
    cursor: default;
}
.spare-req-approval-status {
    margin: 0;
    min-height: 44px;
    padding: 8px 14px;
    border-bottom: none;
}
.spare-req-hq-flow-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}
.spare-data-table-req.is-quote-view .spare-req-quote-head-meta th {
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 4px 6px;
}
.spare-data-table-req.is-quote-view .spare-req-quote-head-meta-spacer {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0;
}
.spare-data-table-req.is-quote-view .spare-req-quote-head-cols th {
    font-size: 11px;
    text-align: center;
    vertical-align: middle;
}
.spare-data-table-req.is-quote-view .c-quote-cur {
    color: #2d3748;
    padding: 2px 1px;
}
.spare-req-quote-cur-trigger {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e0;
    border-radius: 3px;
    background: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 0;
    cursor: pointer;
    color: #2d3748;
    text-align: center;
    line-height: 1.3;
    letter-spacing: 0.02em;
}
.spare-req-quote-cur-trigger:hover {
    border-color: #2b6cb0;
    color: #1a365d;
}
.spare-req-quote-cur-menu {
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
    padding: 4px 0;
    overflow: hidden;
}
.spare-req-quote-cur-item {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    color: #2d3748;
}
.spare-req-quote-cur-item:hover {
    background: #edf2f7;
}
.spare-req-quote-cur-item.is-active {
    background: #ebf8ff;
    color: #1a365d;
}
.spare-data-table-req.is-quote-view .c-quote-total {
    color: #1a365d;
    font-weight: 700;
}
.spare-data-table-req.is-quote-view .c-quote-chk {
    width: 28px;
    text-align: center;
}
.spare-data-table-req.is-quote-view .spare-req-quote-row-chk,
.spare-data-table-req.is-quote-view .spare-req-quote-col-chk {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #2b6cb0;
}
.spare-data-table-req.is-quote-view .c-quote-vendor,
.spare-data-table-req.is-quote-view .c-quote-price {
    text-align: center;
}
.spare-data-table-req.is-quote-view .c-quote-price {
    text-align: right;
}
.spare-req-quote-vendor-trigger {
    width: 100%;
    border: 1px dashed #cbd5e0;
    border-radius: 4px;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 6px;
    cursor: pointer;
    color: #2d3748;
}
.spare-req-quote-vendor-trigger:hover {
    border-color: #2b6cb0;
    color: #1a365d;
}
.spare-req-quote-price-input {
    width: 100%;
    max-width: 72px;
    text-align: right;
    font-size: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 4px;
}
.spare-req-quote-vendor-menu {
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    max-height: 240px;
    overflow: auto;
    padding: 6px 0;
}
.spare-req-quote-vendor-head {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.spare-req-quote-vendor-index-row {
    padding: 2px 8px 6px;
}
.spare-req-quote-vendor-index-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background: #fff;
    padding-right: 2px;
}
.spare-req-quote-vendor-index-wrap:focus-within {
    border-color: #2b6cb0;
    box-shadow: 0 0 0 2px rgba(43, 108, 176, 0.15);
}
.spare-req-quote-vendor-index-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 12px;
    padding: 5px 6px;
}
.spare-req-quote-vendor-index-input:focus {
    outline: none;
}
.spare-req-quote-vendor-index-clear {
    flex: 0 0 auto;
}
.spare-req-quote-vendor-index-clear.is-hidden {
    visibility: hidden;
    pointer-events: none;
}
.spare-req-quote-vendor-row {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 4px;
}
.spare-req-quote-vendor-row.is-new .spare-req-quote-vendor-item {
    background: #e6fffa;
    font-weight: 700;
}
.spare-req-quote-vendor-item {
    flex: 1;
    min-width: 0;
    display: block;
    text-align: left;
    border: none;
    background: transparent;
    padding: 7px 6px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
}
.spare-req-quote-vendor-item:hover {
    background: #edf2f7;
}
.spare-req-quote-vendor-act {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.spare-req-quote-vendor-act:hover {
    background: #edf2f7;
    color: #1a365d;
}
.spare-req-quote-vendor-del-btn:hover {
    background: #fed7d7;
    color: #c53030;
}
.spare-req-quote-vendor-empty {
    padding: 6px 10px 8px;
    font-size: 11px;
}
.spare-req-quote-vendor-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.spare-req-quote-vendor-add {
    border-top: 1px solid #e2e8f0;
    margin-top: 4px;
    padding-top: 2px;
}
.spare-req-quote-vendor-add-row {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 4px 8px 8px;
}
.spare-req-quote-vendor-add-input {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    padding: 5px 8px;
}
.spare-req-quote-vendor-add-input:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 2px rgba(43, 108, 176, 0.15);
}
.spare-req-quote-vendor-add-btn {
    white-space: nowrap;
    font-size: 11px;
    padding: 5px 10px;
}
.spare-req-quote-vendor-add-status {
    font-size: 11px;
    padding: 0 8px 8px;
}
.spare-req-quote-vendor-add-status.is-ok {
    color: #276749;
    font-weight: 600;
}
.spare-req-quote-vendor-add-status.is-error {
    color: #c53030;
    font-weight: 600;
}
.spare-req-meta-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
    gap: 0;
}
.spare-req-meta-col {
    display: flex;
    flex-direction: column;
}
.spare-req-meta-col-left {
    border-right: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.spare-req-meta-col-right {
    background: #fff;
}
.spare-req-meta-row {
    display: grid;
    grid-template-columns: 118px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 14px;
    border-bottom: 1px solid #edf2f7;
}
.spare-req-meta-row:last-child { border-bottom: none; }
.spare-req-meta-label {
    font-size: 11px;
    font-weight: 700;
    color: #2d3748;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
/* New Requisition meta — match Work Report (wr-maint-field) typography */
.spare-req-work-meta {
    font-family: inherit;
}
.spare-req-work-meta .spare-req-meta-label {
    font-size: 10px;
    font-weight: 700;
    color: #1a202c;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.spare-req-work-meta .spare-req-meta-input,
.spare-req-work-meta textarea.spare-req-meta-input {
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    font-family: inherit;
    font-size: 11px;
    color: #2d3748;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.spare-req-work-meta .spare-req-meta-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}
.spare-req-work-meta .spare-req-meta-input.wr-ro,
.spare-req-work-meta .spare-req-meta-input[readonly]:not(.spare-req-meta-by-name) {
    background: #f7fafc;
    color: #4a5568;
    font-weight: 400;
    border-color: #cbd5e0;
    cursor: default;
}
.spare-req-work-meta .spare-req-meta-input[readonly].spare-req-meta-by-name {
    background: #f7fafc;
    color: #4a5568;
    font-weight: 400;
    border-color: #cbd5e0;
}
.spare-req-work-meta .spare-req-meta-comments-row .spare-consume-meta-col-head {
    font-size: 10px;
    font-weight: 700;
    color: #1a202c;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.spare-req-work-meta .spare-req-meta-comments-textarea {
    min-height: 68px;
    line-height: 1.45;
}
.spare-req-work-meta .spare-req-priority-opt {
    font-size: 11px;
    font-weight: 600;
    color: #2d3748;
}
.spare-req-work-meta .spare-req-meta-by {
    font-size: 10px;
    font-weight: 700;
    color: #718096;
}
.spare-req-work-meta .spare-req-meta-sep {
    font-size: 11px;
}
/* Consumed Spare Parts meta — match New Requisition (spare-req-work-meta) typography */
.spare-consume-meta-form .spare-consume-meta-inline-label,
.spare-consume-meta-form .spare-consume-meta-label {
    font-size: 10px;
    font-weight: 700;
    color: #1a202c;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.spare-consume-meta-form .spare-consume-meta-col-head {
    font-size: 10px;
    font-weight: 700;
    color: #1a202c;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}
.spare-consume-meta-form .spare-req-meta-input,
.spare-consume-meta-form textarea.spare-req-meta-input {
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    font-family: inherit;
    font-size: 11px;
    color: #2d3748;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.spare-consume-meta-form .spare-req-meta-input:focus,
.spare-consume-meta-form textarea.spare-req-meta-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}
.spare-consume-meta-form .spare-req-meta-input.wr-ro,
.spare-consume-meta-form .spare-req-meta-input[readonly] {
    background: #f7fafc;
    color: #4a5568;
    font-weight: 400;
    border-color: #cbd5e0;
    cursor: default;
}
.spare-consume-meta-form .spare-consume-pick-trigger,
.spare-consume-meta-form .wr-maint-job-pick,
.spare-consume-meta-form .spare-consume-job-pick-trigger {
    min-height: auto;
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 400;
    color: #2d3748;
}
.spare-consume-meta-form .spare-consume-meta-textarea {
    min-height: 68px;
    line-height: 1.45;
}
.spare-req-meta-label-spacer { visibility: hidden; }
.spare-req-meta-field { min-width: 0; }
.spare-req-meta-input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    color: #1a202c;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.spare-req-meta-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}
.spare-req-meta-input[readonly] {
    background: #edf2f7;
    color: #2b6cb0;
    font-weight: 700;
    border-color: #bee3f8;
    cursor: default;
}
.spare-req-meta-textarea {
    min-height: 52px;
    max-height: 140px;
    resize: vertical;
    line-height: 1.45;
    font-family: inherit;
}
.spare-req-meta-comments-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    padding: 12px 14px 14px;
    border-top: 1px solid #edf2f7;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.spare-req-meta-comments-row .spare-consume-meta-comments {
    padding-top: 0;
    min-width: 0;
}
.spare-req-meta-comments-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 14px 14px;
    border-top: 1px solid #edf2f7;
}
.spare-req-meta-comments-stack .spare-consume-meta-comments {
    padding-top: 0;
}
.spare-req-meta-comments-textarea {
    min-height: 96px;
    max-height: 220px;
}
.spare-req-meta-row-comments .spare-req-meta-label {
    align-self: flex-start;
    padding-top: 8px;
}
.spare-req-no-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.spare-req-no-wrap .spare-req-meta-input {
    flex: 1;
    min-width: 0;
}
.spare-req-hist-anchor {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
}
.spare-req-hist-btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 11px;
    padding: 5px 10px;
    line-height: 1.2;
}
.spare-req-hist-btn.is-open {
    background: #2b6cb0;
    color: #fff;
    border-color: #2b6cb0;
}
.spare-req-work-meta.is-req-hist-open {
    z-index: 500;
}
.spare-req-hist-popover {
    position: absolute;
    left: 0;
    right: auto;
    width: fit-content;
    max-width: calc(100% + 28px);
    z-index: 2;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: min(560px, 70vh);
    box-sizing: border-box;
}
.spare-req-hist-popover.hidden {
    display: none !important;
}
.spare-req-hist-popover .spare-req-list-table {
    min-width: 0;
    width: 1230px;
    table-layout: fixed;
}
.spare-req-hist-list-panel .spare-data-table.spare-req-list-table {
    min-width: 0;
    width: 1230px;
}
.spare-req-hist-popover .spare-req-list-table col.rl-col-chk { width: 26px; }
.spare-req-hist-popover .spare-req-list-table col.rl-col-type { width: 72px; }
.spare-req-hist-popover .spare-req-list-table col.rl-col-reqno { width: 152px; }
.spare-req-hist-popover .spare-req-list-table col.rl-col-spare-group { width: 148px; }
.spare-req-hist-popover .spare-req-list-table col.rl-col-req-date { width: 166px; }
.spare-req-hist-popover .spare-req-list-table col.rl-col-req-port { width: 112px; }
.spare-req-hist-popover .spare-req-list-table col.rl-col-submitted { width: 96px; }
.spare-req-hist-popover .spare-req-list-table col.rl-col-status { width: 88px; }
.spare-req-hist-popover .spare-req-list-table col.rl-col-recv-date { width: 166px; }
.spare-req-hist-popover .spare-req-list-table col.rl-col-recv-port { width: 112px; }
.spare-req-hist-popover .spare-req-list-table col.rl-col-os { width: 56px; }
.spare-req-hist-popover .spare-req-list-table col.rl-col-total { width: 56px; }
.spare-req-hist-popover .spare-req-list-table .spare-req-list-reqno,
.spare-req-hist-popover .spare-req-list-table .spare-req-list-spare-group {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 148px;
}
.spare-req-hist-popover .spare-req-list-head-table thead th,
.spare-req-hist-popover .spare-req-list-body-table tbody td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spare-req-hist-popover .spare-req-list-head-table thead th {
    white-space: normal;
    line-height: 1.25;
}
.spare-req-hist-popover .spare-req-list-empty,
.spare-req-hist-popover .spare-req-list-empty-sub {
    white-space: normal;
}
.spare-req-hist-popover-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
    padding: 10px 14px;
    padding-right: 44px;
    font-size: 13px;
    font-weight: 700;
    color: var(--navy);
    border-bottom: 1px solid #e2e8f0;
    background: #f7fafc;
    flex-shrink: 0;
}
.spare-req-hist-popover-head.spare-req-list-head {
    padding-right: 44px;
}
.spare-req-hist-popover-head.spare-req-list-head .spare-req-work-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}
.spare-req-hist-popover-head .modal-x,
.spare-req-hist-popover-head.spare-req-list-head .modal-x {
    position: absolute;
    top: 6px;
    right: 10px;
}
.spare-req-hist-panel-wrap {
    padding: 12px 14px 0;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: 100%;
    background: #fff;
}
.spare-req-hist-list-panel.panel {
    min-height: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    background: #fff;
}
.spare-req-hist-list-scroll {
    flex: 1 1 auto;
    min-height: 80px;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    background: #fff;
}
#spareReqWorkModal .wr-spare-toolbar {
    flex-wrap: wrap;
    row-gap: 6px;
}
#spareReqWorkModal .wr-spare-toolbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}
.spare-req-hist-hint {
    margin: 0;
    padding: 8px 18px 12px;
    font-size: 11px;
    line-height: 1.4;
    color: #a0aec0;
    text-align: right;
    flex-shrink: 0;
    border-top: 1px solid #edf2f7;
    background: #fafbfc;
    border-radius: 0 0 8px 8px;
}
.spare-req-hist-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    background: #fff;
}
.spare-req-hist-table { width: 100%; margin: 0; }
.spare-req-hist-table tbody tr { cursor: pointer; }
.spare-req-hist-table tbody tr:hover { background: #ebf8ff; }
.spare-req-meta-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}
.spare-req-meta-date-range .spare-req-meta-input { flex: 1; min-width: 0; }
.spare-req-meta-sep { color: #718096; font-weight: 600; flex-shrink: 0; }
.spare-req-meta-priority {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 18px;
}
.spare-req-priority-opt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    user-select: none;
}
.spare-req-priority-opt input { margin: 0; accent-color: #2b6cb0; }
.spare-req-meta-audit {
    display: grid;
    grid-template-columns: minmax(120px, 140px) auto minmax(100px, 1fr);
    align-items: center;
    gap: 8px;
}
.spare-req-meta-received-inline {
    display: grid;
    grid-template-columns: minmax(120px, 140px) max-content minmax(0, 1fr);
    align-items: center;
    gap: 8px 10px;
    min-width: 0;
}
.spare-req-work-meta .spare-req-meta-inline-label {
    font-size: 10px;
    font-weight: 700;
    color: #1a202c;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.spare-req-meta-by {
    font-size: 11px;
    font-weight: 700;
    color: #718096;
    text-align: center;
}
@media (max-width: 900px) {
    .spare-req-meta-grid { grid-template-columns: 1fr; }
    .spare-req-meta-col-left { border-right: none; border-bottom: 1px solid #e2e8f0; }
    .spare-req-meta-comments-row { grid-template-columns: 1fr; }
}
.spare-req-work-modify-hint {
    margin: 0 12px 8px;
    font-size: 12px;
}
.spare-req-selected-btn.is-active,
.spare-req-selected-btn.plan-selected-filter-active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.spare-req-selected-btn.plan-selected-filter-active:hover {
    background: #234876;
    border-color: #234876;
}
.spare-req-work-layout:not(.wr-spare-full-width) {
    flex: 0 1 auto;
    min-height: 560px;
    min-width: 0;
    padding: 12px;
    grid-template-columns: 240px 1fr !important;
    align-items: stretch;
    overflow: visible;
}
.spare-req-work-layout.wr-spare-full-width,
.spare-consume-work-layout.wr-spare-full-width,
.spare-receive-work-layout.wr-spare-full-width {
    flex: 1;
    min-height: 480px;
    min-width: 0;
    align-items: stretch;
    overflow: visible;
}
.spare-req-work-scroll > .spare-req-work-layout,
.spare-req-work-scroll > .spare-consume-work-layout,
.spare-req-work-scroll > .spare-receive-work-layout {
    margin: 0 14px 14px;
    padding: 0 !important;
    min-width: 0;
    width: auto;
    max-width: calc(100% - 28px);
    box-sizing: border-box;
}
#spareReqWorkModal .spare-req-work-scroll > .spare-req-work-layout .spare-main,
#spareConsumeModal .spare-req-work-scroll > .spare-consume-work-layout .spare-main,
#spareConsumeModal .spare-req-work-scroll > .spare-req-work-layout .spare-main,
#spareReceiveModal .spare-req-work-scroll > .spare-receive-work-layout .spare-main {
    overflow-x: hidden;
    max-width: 100%;
}
#spareReqWorkModal .spare-list-panel,
#spareConsumeModal .spare-list-panel,
#spareReceiveModal .spare-list-panel {
    overflow-x: hidden;
    max-width: 100%;
}
#spareReceiveModal .spare-req-work-scroll > .spare-receive-work-layout .spare-req-table-hscroll {
    overflow-x: hidden;
}
#spareReceiveModal .spare-receive-work-layout .spare-req-table-wide {
    min-width: 0;
}
/* Spare Parts Requisition — received qty meta + list panel (Consumption Report family) */
.spare-receive-meta-form {
    margin-bottom: 12px;
}
.spare-receive-meta-comments-row {
    margin-top: 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}
.spare-receive-meta-row-req {
    padding-bottom: 2px;
}
.spare-receive-req-select {
    min-height: 34px;
}
.spare-receive-meta-row-top {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.35fr);
}
.spare-receive-meta-field-port {
    grid-template-columns: max-content minmax(0, 1fr);
}
#spareReceiveModal .spare-receive-work-layout .spare-main.panel {
    min-height: 0;
    border: 1px solid #d8e2ec;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    background: #fff;
    overflow: hidden;
    gap: 0;
    padding: 0;
}
#spareReceiveModal .spare-receive-work-layout .wr-spare-toolbar {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid #e2e8f0;
    margin: 0;
}
#spareReceiveModal .spare-receive-content-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 14px 14px;
    min-width: 0;
    box-sizing: border-box;
}
#spareReceiveModal .spare-receive-search-bar {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}
#spareReceiveModal #receiveEditBlock {
    margin: 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
#spareReceiveModal #receiveEditBlock .spare-group-header-card {
    margin: 0;
    border-radius: 8px;
}
#spareReceiveModal .spare-receive-table-panel {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    min-height: 480px;
    display: flex;
    flex-direction: column;
}
#spareReceiveModal .spare-receive-table-panel .spare-req-table-hscroll {
    flex: 1;
    min-width: 0;
    width: 100%;
    overflow-x: hidden;
}
#spareReceiveModal .spare-receive-table-panel .spare-req-table-wide {
    width: 100%;
    min-width: 0;
}
#spareReceiveModal .spare-receive-work-layout #receiveListScroll.virtual-scroll,
#spareReceiveModal .spare-receive-work-layout #receiveListScroll {
    width: 100%;
    flex: 0 0 auto;
    height: 468px !important;
    min-height: 468px !important;
    max-height: 468px !important;
    overflow-x: hidden !important;
    overflow-y: auto;
}
#spareReceiveModal #receiveListHead.vl-head-wrap {
    overflow: hidden;
    box-sizing: border-box;
    background: #f7fafc;
    box-shadow: inset 0 -2px 0 #e2e8f0;
}
#spareReceiveModal #receiveListHead .spare-data-head th {
    padding: 6px 3px;
    font-size: var(--list-item-head-font);
    line-height: 1.15;
}
#spareReceiveModal #receiveListScroll .vl-inner,
#spareReceiveModal #receiveListScroll .spare-data-row,
#spareReceiveModal #receiveListScroll .spare-data-table,
#spareReceiveModal #receiveListHead .spare-data-table {
    width: var(--spare-table-w, 100%) !important;
    max-width: var(--spare-table-w, 100%) !important;
    min-width: var(--spare-table-w, 100%) !important;
    box-sizing: border-box;
}
#spareReceiveModal .spare-data-table-receive .c-item,
#spareReceiveModal #receiveListHead .c-item,
#spareReceiveModal #receiveListScroll .c-item {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spare-receive-qty-input {
    width: 36px;
    max-width: 100%;
    padding: 2px 2px;
    text-align: center;
    border: 1px solid #4299e1;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #2b6cb0;
    background: #fff;
    box-sizing: border-box;
    -moz-appearance: textfield;
    appearance: textfield;
}
.spare-receive-qty-input::-webkit-outer-spin-button,
.spare-receive-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.spare-receive-qty-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.25);
}
@media (max-width: 900px) {
    .spare-receive-meta-row-top {
        grid-template-columns: 1fr;
    }
}
.wr-page > .wr-spare-work-layout {
    padding: 0 0 14px !important;
}
.spare-req-work-layout.is-preview {
    grid-template-columns: 1fr !important;
}
.req-preview-scroll {
    background: #e9edf2;
    padding: 20px 0;
    overflow: auto;
}
.req-preview-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.req-preview-page {
    width: 297mm;
    min-height: 210mm;
    max-width: 96%;
    background: #fff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
    border: 1px solid #cbd5e1;
    padding: 10mm 12mm;
    box-sizing: border-box;
}
.req-preview-doc-title {
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    color: #003366;
    letter-spacing: 1px;
    margin: 0 0 10px;
    line-height: 1.25;
}
.req-preview-sheet {
    width: 273mm;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 0 0 6px;
}
.req-preview-sheet th,
.req-preview-sheet td {
    border: 1px solid #64748b;
    padding: 4px 6px;
    font-size: 11px;
    vertical-align: middle;
}
.req-preview-sheet .rpv-label {
    font-weight: 700;
    background: #eef2f7;
    text-align: left;
    white-space: nowrap;
    color: #334155;
}
.req-preview-sheet .rpv-by {
    text-align: center;
    font-weight: 700;
    background: #eef2f7;
}
.req-preview-sheet .rpv-gap {
    border: none;
    background: transparent;
}
.req-preview-group-block .rpv-group-label {
    font-weight: 700;
    text-align: left;
    background: #fff;
    border-bottom: none;
}
.req-preview-group-block .rpv-group-value {
    text-align: left;
    min-height: 18px;
}
.req-preview-items th {
    background: #dde5ef;
    text-align: center;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}
.req-preview-items tbody td {
    text-align: center;
    white-space: normal;
    word-break: break-word;
    line-height: 1.25;
}
.req-preview-items td.rpv-item {
    text-align: left;
}
.req-preview-items td.rpv-code {
    font-weight: 700;
}
.req-preview-items td.rpv-dwg,
.req-preview-items td.rpv-pno {
    word-break: break-all;
}
.req-preview-items td.rpv-req {
    font-weight: 700;
    color: #003366;
}
.req-preview-items td.qty-mismatch {
    background: #fff8e6;
    color: #9a6700;
    font-weight: 700;
}
.req-preview-items .rpv-no,
.req-preview-items th.rpv-no {
    width: 5mm;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.req-preview-empty {
    text-align: center;
    color: #64748b;
    padding: 40px 0;
}
.spare-req-work-wrap.is-preview .spare-vl-scroll input[type="checkbox"],
.spare-req-work-wrap.is-preview #reqWorkListHead input[type="checkbox"] {
    pointer-events: none;
    opacity: .45;
}

/* Requisition List — in-modal document preview (same layout as screen, print-ready) */
.spare-req-work-wrap.is-doc-preview {
    background: #fff;
}
.spare-req-doc-preview-head {
    justify-content: center;
    position: relative;
    padding-bottom: 8px;
    border-bottom: 2px solid #003366;
    margin-bottom: 4px;
}
.spare-req-doc-preview-head .spare-req-work-head-spacer {
    display: none;
}
.spare-req-doc-preview-head .spare-req-work-title,
.spare-req-doc-preview-title {
    flex: 1;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    color: #003366;
    letter-spacing: 2px;
    margin: 0;
}
.spare-req-doc-preview-head .btn,
.spare-req-doc-preview-head .modal-x {
    position: absolute;
    right: 0;
    top: 0;
}
.spare-req-doc-preview-head .modal-x {
    right: 0;
}
.spare-req-doc-preview-head .btn.btn-green {
    right: 72px;
}
.spare-req-work-wrap.is-doc-preview .spare-item-toolbar,
.spare-req-work-wrap.is-doc-preview .spare-list-search-bar,
.spare-req-work-wrap.is-doc-preview .spare-req-work-modify-hint,
.spare-req-work-wrap.is-doc-preview .spare-req-hist-anchor,
.spare-req-work-wrap.is-doc-preview .spare-req-hist-popover {
    display: none !important;
}
.spare-req-work-wrap.is-doc-preview .c-chk,
.spare-req-work-wrap.is-doc-preview #reqWorkListHead .c-chk,
.spare-req-work-wrap.is-doc-preview #reqWorkListScroll .c-chk,
.spare-req-work-wrap.is-doc-preview .spare-head-chk {
    display: none !important;
}
.spare-req-work-wrap.is-doc-preview .spare-req-work-scroll {
    overflow: visible;
    max-height: none;
}
.spare-req-work-wrap.is-doc-preview .spare-req-qty-input,
.spare-req-work-wrap.is-doc-preview .spare-req-work-meta input,
.spare-req-work-wrap.is-doc-preview .spare-req-work-meta select {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    pointer-events: none;
    color: inherit;
    -webkit-appearance: none;
    appearance: none;
}
.spare-req-work-wrap.is-doc-preview .wr-maint-chk input {
    pointer-events: none;
}
#spareReqWorkModal.is-req-doc-preview .modal-box {
    max-width: 100%;
    width: min(1400px, 96vw);
}
@media print {
    body > *:not(#spareReqWorkModal) {
        display: none !important;
    }
    #spareReqWorkModal {
        position: static !important;
        display: block !important;
        background: #fff !important;
        padding: 0 !important;
        overflow: visible !important;
    }
    #spareReqWorkModal .modal-box {
        box-shadow: none !important;
        border: none !important;
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    #spareReqWorkModal .spare-req-doc-preview-head .btn,
    #spareReqWorkModal .spare-req-doc-preview-head .modal-x,
    #spareReqWorkModal .req-preview-wrap .spare-req-work-head .btn,
    #spareReqWorkModal .req-preview-wrap .spare-req-work-head .modal-x {
        display: none !important;
    }
    #spareReqWorkModal .spare-req-work-scroll,
    #spareReqWorkModal .req-preview-scroll {
        overflow: visible !important;
        max-height: none !important;
        background: #fff !important;
        padding: 0 !important;
    }
    #spareReqWorkModal .req-preview-page {
        width: 297mm;
        min-height: 210mm;
        max-width: none;
        box-shadow: none;
        border: none;
        margin: 0 auto;
        page-break-after: always;
    }
    #spareReqWorkModal .req-preview-sheet {
        width: 273mm;
    }
    #spareReqWorkModal .spare-req-table-hscroll {
        overflow: visible !important;
    }
    #spareReqWorkModal .spare-vl-scroll {
        max-height: none !important;
        overflow: visible !important;
    }
}

.spare-req-work-layout .tree-panel {
    min-height: 0;
    min-width: 0;
    max-height: none;
    width: 240px;
    max-width: 240px;
}
.spare-req-work-layout .tree-panel .panel-body.tree-scroll {
    flex: 1;
    min-height: 0;
    max-height: 468px;
    overflow: auto;
}
.spare-req-work-layout.plan-layout .panel {
    min-height: 0;
    min-width: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.spare-req-work-layout .spare-list-panel {
    flex: 0 0 auto;
    min-height: 510px;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: visible;
}
.spare-req-work-layout .spare-req-table-hscroll {
    flex: 0 0 auto;
    min-height: 510px;
    min-width: 0;
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}
#spareReqWorkModal .spare-req-work-layout .spare-req-table-hscroll {
    overflow-x: hidden;
}
#spareReqWorkModal .spare-req-work-layout .spare-req-table-wide {
    min-width: 0;
}
.spare-req-work-layout .spare-req-table-wide {
    min-width: 0;
    width: 100%;
    min-height: 510px;
    display: flex;
    flex-direction: column;
}
.spare-consume-work-layout .spare-req-table-wide {
    min-width: 898px;
}
.spare-req-work-layout .spare-main {
    min-height: 0;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: visible;
}
.spare-req-work-layout #reqWorkListScroll.virtual-scroll,
.spare-req-work-layout .spare-vl-scroll,
.spare-req-work-layout #reqWorkListScroll,
.spare-consume-work-layout #consumeListScroll.virtual-scroll,
.spare-consume-work-layout #consumeListScroll,
.wr-spare-work-layout #wrSpareListScroll.virtual-scroll,
.wr-spare-work-layout #wrSpareListScroll {
    width: 100%;
    flex: 0 0 auto;
    height: 468px !important;
    min-height: 468px !important;
    max-height: 468px !important;
    overflow-x: hidden !important;
    overflow-y: auto;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}
.spare-req-work-layout #reqWorkListHead.vl-head-wrap,
.spare-consume-work-layout #consumeListHead.vl-head-wrap,
.wr-spare-work-layout #wrSpareListHead.vl-head-wrap {
    flex: 0 0 auto;
    flex-shrink: 0;
    width: 100%;
    overflow: visible;
}
.spare-req-work-layout #reqWorkListHead .spare-head-track,
.spare-consume-work-layout #consumeListHead .spare-head-track,
.wr-spare-work-layout #wrSpareListHead .spare-head-track {
    overflow: visible;
    width: 100%;
}
.spare-req-work-layout #reqWorkListScroll .vl-inner,
.spare-consume-work-layout #consumeListScroll .vl-inner,
.wr-spare-work-layout #wrSpareListScroll .vl-inner {
    width: 100%;
}
.spare-req-work-layout #reqWorkListHead .spare-data-table,
.spare-consume-work-layout #consumeListHead .spare-data-table,
.wr-spare-work-layout #wrSpareListHead .spare-data-table {
    width: 100%;
}
.spare-req-work-layout #reqWorkListScroll .vl-inner {
    min-width: 0;
}
.spare-req-work-layout #reqWorkListHead .spare-data-table {
    min-width: 0;
}
#spareReqWorkModal .spare-req-work-layout #reqWorkListScroll .vl-inner,
#spareReqWorkModal .spare-req-work-layout #reqWorkListHead .spare-data-table {
    min-width: 0;
}
.spare-consume-work-layout #consumeListScroll .vl-inner,
.wr-spare-work-layout #wrSpareListScroll .vl-inner {
    min-width: 898px;
}
.spare-consume-work-layout #consumeListHead .spare-data-table {
    min-width: 898px;
}
.spare-consume-preview-layout {
    grid-template-columns: 1fr !important;
}
.spare-consume-preview-layout .spare-main {
    min-width: 0;
}
@media (max-width: 900px) {
    .spare-req-work-layout:not(.wr-spare-full-width) { grid-template-columns: 1fr !important; }
    .spare-req-work-layout .tree-panel { max-height: 180px; }
    #spareReqWorkModal .spare-req-work-layout:not(.is-preview):not(.wr-spare-full-width),
    #spareConsumeModal .spare-req-work-layout:not(.spare-consume-preview-layout):not(.wr-spare-full-width) {
        grid-template-columns: 240px 1fr !important;
    }
    #spareReqWorkModal .spare-req-work-layout .tree-panel,
    #spareConsumeModal .spare-req-work-layout .tree-panel {
        max-height: none;
    }
}

.spare-req-section {
    border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; background: #fafbfc;
}
.spare-req-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
@media (max-width: 1100px) {
    .spare-layout, .spare-layout.panel-open { grid-template-columns: 1fr; }
    .spare-layout .tree-panel { min-height: auto; max-height: 200px; }
    .spare-detail-panel.open { position: fixed; right: 0; top: 120px; bottom: 0; width: min(360px, 92vw); z-index: 50; }
}

.spics-wrap { padding: 0 20px 24px; }
.spics-top-layout { display: flex; flex-direction: column; gap: 0; min-height: 520px; }
.spics-top-bar { flex-shrink: 0; border-bottom: 1px solid #e2e8f0; margin-bottom: 12px; }
.spics-cat-bar { padding: 8px 0 10px; border: none; box-shadow: none; background: transparent; }
.spics-cat-scroll {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.tree-node-inline {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 999px; font-size: 12px; cursor: pointer;
    border: 1px solid #e2e8f0; background: #f8fafc;
}
.tree-node-inline.selected { background: var(--navy); color: #fff; border-color: var(--navy); }
.tree-node-inline .tree-count { font-size: 10px; opacity: 0.75; }
.spics-list-panel { flex: 1; min-height: 400px; display: flex; flex-direction: column; }
.spics-vl-scroll { flex: 1; min-height: 360px; max-height: calc(100vh - 280px); }
.spics-modal-title { margin: 0 0 10px; font-size: 16px; color: var(--navy); }
.spics-modal-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: #4a5568; margin-bottom: 12px; }
.spics-modal-scroll { max-height: 320px; overflow: auto; margin-bottom: 12px; }
.spics-detail-modal { max-width: 720px; }
.spics-search-bar {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
    padding: 12px 0; border-bottom: 1px solid #e2e8f0; margin-bottom: 12px;
}
.spics-search-bar label { display: flex; flex-direction: column; font-size: 11px; font-weight: 600; color: #4a5568; gap: 4px; flex: 1; min-width: 160px; }
.spics-search-bar input { padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; }
.spics-layout { display: grid; grid-template-columns: 220px 1fr 260px; gap: 12px; min-height: 480px; }
.spics-tree-panel .tree-count { font-size: 10px; color: #718096; margin-left: 4px; }
.spics-vl-head-row, .spics-row { min-width: 960px; }
.spics-vl-head-row .c-uni, .spics-row .c-uni { flex: 0 0 100px; }
.spics-vl-head-row .c-grp, .spics-row .c-grp { flex: 0 0 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2c5282; font-weight: 600; font-size: 11px; }
.spics-vl-head-row .c-loc, .spics-row .c-loc { flex: 0 0 100px; }
.spare-group-select { width: 100%; max-width: 220px; padding: 4px 6px; font-size: 12px; border: 1px solid #cbd5e0; border-radius: 4px; }
.sr-editor-hint { font-size: 11px; margin: 6px 0 0; }
.sr-editor-grid select { width: 100%; padding: 6px 8px; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 12px; }
.spics-vl-head-row .c-stk, .spics-row .c-stk, .spics-vl-head-row .c-min, .spics-row .c-min, .spics-vl-head-row .c-std, .spics-row .c-std { flex: 0 0 52px; text-align: center; }
.spics-vl-head-row.spare-vl-head-row,
.vl-cells.spics-row.spare-row { min-width: 948px; }
.spics-crit { background: var(--red); color: #fff; font-size: 9px; padding: 1px 4px; border-radius: 4px; margin-left: 4px; }
.spics-meta { font-size: 12px; line-height: 1.6; color: #4a5568; }
.spics-hist-head { font-size: 11px; font-weight: 700; margin: 10px 0 4px; color: var(--navy); }
.spics-hist-table { width: 100%; font-size: 11px; border-collapse: collapse; }
.spics-hist-table th, .spics-hist-table td { padding: 3px 4px; border-bottom: 1px solid #edf2f7; }
.spics-alert-banner {
    grid-column: 1 / -1; background: #fff5f5; border: 1px solid #feb2b2; color: #9b2c2c;
    padding: 8px 12px; border-radius: 8px; font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 8px;
}
@media (max-width: 1100px) { .spics-layout { grid-template-columns: 1fr; } }

/* SPARE workflow menu — 3-column function panel (Consumed / Requisition / If Necessary) */
.spare-flow-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 0 20px 14px;
}
.spare-sync-modal {
    max-width: 520px;
}
.spare-sync-title {
    margin: 0 0 10px;
    font-size: 16px;
    color: var(--navy);
}
.spare-sync-hint {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.45;
    color: #2d3748;
}
.menu-xfer-type-counts {
    margin: -4px 0 10px;
    font-size: 13px;
    line-height: 1.45;
    color: #4a5568;
    font-variant-numeric: tabular-nums;
}
.menu-xfer-type-counts strong {
    color: var(--navy);
}
.menu-xfer-monthly-plan {
    margin-bottom: 12px;
}
.menu-xfer-monthly-plan p {
    margin: 0 0 6px;
}
.menu-xfer-monthly-rh {
    margin: 8px 0 0;
    padding-left: 18px;
}
.menu-xfer-monthly-plan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.menu-xfer-monthly-block {
    color: #c53030;
    font-weight: 600;
}
.spare-sync-note {
    margin: 0 0 16px;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 12px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.spare-sync-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.spare-sync-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
}
.login-license-badge {
    margin: 8px 0 0;
    font-size: 11px;
    font-weight: 600;
    color: #2b6cb0;
}
.spare-sync-btn.spare-sync-check-btn {
    background: #fff;
    color: #2d3748;
    border: 1px solid #cbd5e0;
}
.spare-sync-btn.spare-sync-check-btn:hover {
    background: #ebf8ff;
    border-color: #90cdf4;
}
.spare-sync-btn.spare-sync-check-btn.is-checked {
    background: #c6f6d5;
    border-color: #38a169;
    color: #22543d;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px #38a169;
}
.spare-sync-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.spare-sync-step-label {
    margin: 0 0 12px;
    font-size: 12px;
}
.spare-sync-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}
.spare-sync-back { margin-right: auto; }

.menu-xfer-wide { max-width: min(1080px, 96vw); }

.admin-sop-modal .modal-box { max-height: min(88vh, 920px); overflow-y: auto; }
.admin-sop-flow {
    font-size: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
    margin: 0 0 12px;
    white-space: pre-wrap;
}
.admin-sop-h { margin: 14px 0 6px; font-size: 14px; }
.admin-sop-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 0 0 8px;
}
.admin-sop-table th,
.admin-sop-table td {
    border: 1px solid #e2e8f0;
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
}
.admin-sop-table th { background: #f1f5f9; font-weight: 600; }
.admin-sop-num { width: 2.5em; text-align: center; }
.admin-sop-table-compact td:first-child { white-space: nowrap; }
.admin-sop-ol { margin: 8px 0 12px; padding-left: 22px; font-size: 13px; line-height: 1.5; }
.admin-lab-banner {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    border-radius: 6px;
    padding: 8px 10px;
    margin: 0 0 10px;
    font-size: 12px;
}
.admin-deploy-workflow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 10px 0 0;
}
.admin-deploy-path {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    font-size: 12px;
}
.admin-deploy-path strong { display: block; margin-bottom: 4px; font-size: 13px; }
.admin-deploy-path-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@media (max-width: 720px) {
    .admin-deploy-workflow { grid-template-columns: 1fr; }
}
.admin-release-log {
    margin: 10px 0 0;
    padding: 8px 10px;
    max-height: 220px;
    overflow: auto;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}
.admin-release-artifacts {
    margin: 8px 0;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.5;
}
.admin-release-modal .spare-sync-actions { flex-wrap: wrap; gap: 8px; }
.tvc-section-admin-commercial .spare-flow-col { border-top-color: #3182ce; }

/* Admin Mode — Commercial + Contract registry side by side (no outer section labels) */
.tvc-admin-menu-grid {
    min-width: 0;
}
.tvc-admin-menu-grid .menu-flow-panel.spare-flow-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0;
}
.tvc-admin-menu-grid .spare-flow-col.tone-daily { border-top-color: #3182ce; }
@media (max-width: 900px) {
    .tvc-admin-menu-grid .menu-flow-panel.spare-flow-panel {
        grid-template-columns: 1fr;
    }
}
.btn-linkish {
    background: none;
    border: none;
    padding: 0;
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}
.btn-linkish:hover { color: #1d4ed8; }

.menu-xfer-case-filters.hist-toolbar-filters.list-filter-stack {
    margin: 0 0 10px;
    border: none;
    border-radius: 0;
}
.menu-xfer-case-filters .filter-bar {
    padding-left: 0;
    padding-right: 0;
}
.menu-xfer-case-filters .list-filter-search-row {
    padding-bottom: 0;
}
.menu-xfer-case-filters .act-period-filter.active {
    background: #fff;
    border-color: #cbd5e0;
}

.menu-xfer-table-wrap {
    max-height: 280px;
    overflow: auto;
    margin: 0 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.menu-xfer-defect-table,
.menu-xfer-postpone-table,
.menu-xfer-work-permit-table,
.menu-xfer-monthly-table {
    min-width: 1060px;
}
.menu-xfer-table col.menu-xfer-col-chk { width: 32px; }
.menu-xfer-table col.menu-xfer-col-type { width: 40px; }
.menu-xfer-table col.menu-xfer-col-file-no { width: 72px; }
.menu-xfer-table col.menu-xfer-col-warn { width: 32px; }
.menu-xfer-table col.menu-xfer-col-job { width: 72px; }
.menu-xfer-table col.menu-xfer-col-sort { width: 120px; }
.menu-xfer-table col.menu-xfer-col-sort2 { width: 120px; }
.menu-xfer-table col.menu-xfer-col-status { width: 72px; }
.menu-xfer-table col.menu-xfer-col-date { width: 88px; }
.menu-xfer-table col.menu-xfer-col-filename { width: 90px; }
.menu-xfer-table .hist-type-h,
.menu-xfer-table .hist-type {
    width: 40px;
    min-width: 40px;
    text-align: center;
    padding: 4px 2px;
    vertical-align: middle;
}
.menu-xfer-table .hist-crit-h,
.menu-xfer-table .hist-crit {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    text-align: center;
    padding: 4px 2px;
    vertical-align: middle;
    box-sizing: border-box;
}
.menu-xfer-table .hist-crit .plan-crit-mark { display: block; margin: 0 auto; }
.menu-xfer-table .hist-th-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    gap: 1px;
}
.menu-xfer-table .hist-type-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}
.menu-xfer-table .hist-type-defect .hist-type-mark { background: #c05621; }
.menu-xfer-table .hist-type-postpone .hist-type-mark { background: #805ad5; }
.menu-xfer-table .hist-type-maint .hist-type-mark { background: #2b6cb0; }
.menu-xfer-table .hist-type-wp .hist-type-mark { background: #0d9488; }
.menu-xfer-table .hist-type-consume .hist-type-mark { background: #2f855a; }
.menu-xfer-block-msg {
    margin: 0 0 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #9b2c2c;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
}
.menu-xfer-summary {
    margin: 0 0 14px;
    padding: 10px 12px 10px 28px;
    font-size: 13px;
    line-height: 1.5;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.menu-xfer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}
.menu-xfer-table th,
.menu-xfer-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    vertical-align: middle;
}
.menu-xfer-table thead th {
    position: sticky;
    top: 0;
    background: #f7fafc;
    font-weight: 600;
    z-index: 1;
}
.menu-xfer-chk { width: 32px; text-align: center; }
.menu-xfer-defect-row-disabled,
.menu-xfer-postpone-row-disabled,
.menu-xfer-work-permit-row-disabled,
.menu-xfer-case-row-disabled,
.menu-xfer-monthly-row-disabled { opacity: 0.55; }
.menu-xfer-empty { text-align: center; padding: 16px 8px; }
.spare-hist-sub {
    margin: -4px 0 12px;
    font-size: 12px;
    flex-shrink: 0;
}
/* Data Export & Import History — fixed shell (Requisition tab proportions) */
#menuHistoryModal .modal-box.menu-hist-modal,
#spareHistoryModal .modal-box.menu-hist-modal {
    width: min(96vw, 780px);
    max-width: min(96vw, 780px) !important;
    min-width: min(96vw, 780px);
    height: min(92vh, 580px);
    max-height: min(92vh, 580px);
    min-height: min(92vh, 580px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
#menuHistoryModal .modal-box.menu-hist-modal > #menuHistoryBody,
#spareHistoryModal .modal-box.menu-hist-modal > #spareHistoryBody {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
#menuHistoryModal .modal-box.menu-hist-modal .spare-sync-title,
#spareHistoryModal .modal-box.menu-hist-modal .spare-sync-title,
#menuHistoryModal .modal-box.menu-hist-modal .menu-hist-cats,
#spareHistoryModal .modal-box.menu-hist-modal .menu-hist-cats,
#menuHistoryModal .modal-box.menu-hist-modal .modal-actions,
#spareHistoryModal .modal-box.menu-hist-modal .modal-actions {
    flex-shrink: 0;
}
#menuHistoryModal .modal-box.menu-hist-modal .menu-hist-table-wrap,
#spareHistoryModal .modal-box.menu-hist-modal .menu-hist-table-wrap {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}
.menu-hist-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}
.menu-hist-cats.menu-hist-cats-hq {
    flex-wrap: nowrap;
}
.menu-hist-cats.menu-hist-cats-hq .menu-hist-cat {
    padding: 6px 10px;
    font-size: 11px;
    white-space: nowrap;
}
.menu-hist-cat {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #4a5568;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}
#menuHistoryModal .menu-hist-cat {
    flex: 1 1 0;
    text-align: center;
}
.menu-hist-cat:hover { background: #f7fafc; }
.menu-hist-cat.active {
    background: #fefcbf;
    border-color: #ecc94b;
    color: #744210;
    box-shadow: 0 0 0 1px #f6e05e inset;
}
.menu-hist-table-wrap { max-height: min(52vh, 420px); }
.menu-hist-table.spics-tx-table,
.menu-hist-table.spics-hist-table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    border: 1px solid #cbd5e0;
}
.menu-hist-table.spics-tx-table th,
.menu-hist-table.spics-tx-table td,
.menu-hist-table.spics-hist-table th,
.menu-hist-table.spics-hist-table td {
    text-align: center !important;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
    border: 1px solid #cbd5e0;
    padding: 8px 10px;
}
.menu-hist-table.spics-tx-table th {
    background: #edf2f7;
    font-weight: 700;
    color: #2d3748;
}
.menu-hist-table td.menu-hist-dir {
    font-weight: 700;
    color: var(--navy);
}
.menu-hist-table col.menu-hist-col-exp { width: 18%; }
.menu-hist-table col.menu-hist-col-imp { width: 18%; }
.menu-hist-table col.menu-hist-col-dir { width: 14%; }
.menu-hist-table col.menu-hist-col-file { width: 50%; }
.menu-hist-table th.menu-hist-file-h,
.menu-hist-table td.menu-hist-file,
.menu-xfer-table th.menu-xfer-file-h,
.menu-xfer-table td.menu-xfer-file {
    text-align: left !important;
    min-width: 0;
    max-width: 90px;
    overflow: hidden;
    white-space: normal;
    word-break: break-all;
    overflow-wrap: anywhere;
    text-overflow: clip;
    font-size: 0.82rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #2d3748;
    vertical-align: top;
}
.menu-hist-file-text,
.menu-xfer-file .menu-hist-file-text {
    display: block;
    overflow: hidden;
    white-space: normal;
    word-break: break-all;
    overflow-wrap: anywhere;
    text-overflow: clip;
}
.spare-flow-col {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
    display: flex;
    flex-direction: column;
}
.spare-flow-col.tone-consume { border-top: 3px solid var(--green); }
.spare-flow-col.tone-req { border-top: 3px solid var(--blue); }
.spare-flow-col.tone-deliver { border-top: 3px solid #38a169; }
.spare-flow-col.tone-monthly { border-top: 3px solid var(--blue); }
.spare-flow-col.tone-necessary { border-top: 3px solid var(--amber); }
.spare-flow-head-long {
    font-size: 11px;
    line-height: 1.25;
    letter-spacing: 0.02em;
    word-break: keep-all;
}
.spare-flow-head {
    padding: 10px 12px;
    background: #f7fafc;
    border-bottom: 1px solid #edf2f7;
    font-size: 11px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.spare-flow-items {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.spare-flow-note {
    margin: 0;
    padding: 8px 10px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    line-height: 1.35;
}
.spare-flow-item {
    display: block;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    padding: 9px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.35;
    transition: background .12s, border-color .12s, transform .08s, box-shadow .12s;
}
.spare-flow-item:hover:not(:disabled) {
    background: #ebf4ff;
    border-color: #90cdf4;
    transform: translateX(2px);
    box-shadow: 0 2px 6px rgba(43, 108, 176, .1);
}
.spare-flow-item.primary {
    background: #fff;
    border-color: #e2e8f0;
    color: #2d3748;
}
.spare-flow-item.primary:hover:not(:disabled) {
    background: #ebf4ff;
    border-color: #90cdf4;
    transform: translateX(2px);
    box-shadow: 0 2px 6px rgba(43, 108, 176, .1);
}
.spare-flow-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
@media (max-width: 1100px) {
    .spare-flow-panel { grid-template-columns: 1fr 1fr; }
    .menu-flow-panel.spare-flow-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .spare-flow-panel { grid-template-columns: 1fr; }
    .spare-unified > .tvc-section-card { margin: 0 12px; }
    .spare-unified > .tvc-section-card:last-child { margin-bottom: 12px; }
    .menu-flow-panel.spare-flow-panel { grid-template-columns: 1fr; }
}

/* legacy SPICS menu (unused) */
.spics-menu-panel {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px;
    background: #fefcbf; border: 1px solid #ecc94b; border-radius: 8px;
    padding: 12px; margin-bottom: 12px;
}
.spics-menu-group h4 {
    font-size: 11px; font-weight: 700; color: #744210; margin: 0 0 8px;
    text-transform: uppercase; letter-spacing: 0.02em;
}
.spics-menu-btn {
    display: block; width: 100%; text-align: left; padding: 8px 10px; margin-bottom: 6px;
    border: 1px solid #cbd5e0; border-radius: 6px; background: #edf2f7;
    font-size: 12px; font-weight: 600; color: var(--navy); cursor: pointer;
}
.spics-menu-btn:hover:not(.disabled) { background: #e2e8f0; border-color: #a0aec0; }
.spics-menu-btn.primary { background: #c6f6d5; border-color: #68d391; color: #22543d; }
.spics-menu-btn.disabled { opacity: 0.5; cursor: not-allowed; }
.spics-tx-modal { max-width: 720px; padding: 20px; position: relative; }
.spics-tx-title { margin: 0 0 8px; color: var(--navy); font-size: 16px; }
.spics-tx-hint { font-size: 12px; color: #718096; margin: 0 0 12px; }
.spics-tx-search label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.spics-tx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.spics-tx-grid label { font-size: 11px; font-weight: 700; display: flex; flex-direction: column; gap: 4px; }
.spics-tx-grid input { padding: 6px 8px; border: 1px solid #cbd5e0; border-radius: 5px; }
.spics-tx-lines-wrap { max-height: 240px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 6px; margin-bottom: 12px; }
.spics-tx-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.spics-tx-table th { position: sticky; top: 0; background: #edf2f7; padding: 6px 8px; text-align: left; }
.spics-tx-table td { padding: 6px 8px; border-top: 1px solid #edf2f7; }
.spics-tx-hit { cursor: pointer; }
.spics-tx-hit:hover { background: #f0fff4; }
.spics-tx-qty { width: 64px; padding: 4px; text-align: center; border: 1px solid #cbd5e0; border-radius: 4px; }
.spics-tx-hits { max-height: 160px; overflow: auto; margin-bottom: 8px; }
.spics-assess-summary { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; margin-bottom: 12px; padding: 8px; background: #edf2f7; border-radius: 6px; }
.spics-hist-table { font-size: 11px; }

/* CMAXS-style Parts Requisition Sheet */
.modal-box.req-sheet-modal {
    max-width: 1080px; width: 98%; padding: 0; overflow: hidden; background: #ece9d8;
}
.req-sheet { background: #ece9d8; font-size: 12px; color: #000; }
.req-sheet-titlebar {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    padding: 8px 12px; background: #ece9d8; border-bottom: 1px solid #808080;
    position: relative;
}
.req-sheet-close { position: absolute; right: 8px; top: 6px; z-index: 2; }
.req-vessel-name { color: #003399; font-weight: 700; font-size: 13px; }
.req-sheet-title { text-align: center; color: #003399; font-weight: 700; font-size: 14px; }
.req-sheet-toolbar { justify-self: end; display: flex; gap: 4px; padding-right: 28px; }
.req-tool-btn {
    padding: 3px 10px; font-size: 11px; border: 1px solid #808080; background: #ece9d8;
    cursor: pointer; border-radius: 2px;
}
.req-tool-btn:hover { background: #fff; }
.req-sheet-form { padding: 10px 14px; border-bottom: 1px solid #a0a0a0; background: #ece9d8; }
.req-form-row { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 8px; align-items: flex-end; }
.req-form-row label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 600; }
.req-form-row select, .req-form-row input, .req-form-row textarea {
    padding: 4px 6px; border: 1px solid #808080; border-radius: 2px; font-size: 12px; background: #fff;
}
.req-form-remarks { width: 100%; }
.req-form-remarks textarea { width: 100%; min-height: 52px; box-sizing: border-box; resize: vertical; }
.req-form-mid .req-priority { display: flex; gap: 12px; align-items: center; padding-top: 14px; }
.req-form-mid .req-priority label { flex-direction: row; align-items: center; font-weight: 600; }
.req-date-range { display: flex; align-items: center; gap: 4px; }
.req-form-track { border-top: 1px dotted #999; padding-top: 8px; }
.req-reqno-display { padding-top: 14px; font-size: 12px; }
.req-flow-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding: 8px 14px; background: #ece9d8; border-bottom: 1px solid #808080; font-size: 12px;
}
.req-flow-step { cursor: pointer; color: #333; }
.req-flow-step.active { color: #c00; font-weight: 700; }
.req-flow-arrow { color: #666; }
.req-sheet-add {
    padding: 10px 14px; background: #f5f3ea; border-bottom: 1px solid #c0c0c0;
}
.req-add-label { display: block; font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.req-sheet-search {
    width: 100%; box-sizing: border-box; padding: 6px 8px;
    border: 1px solid #808080; border-radius: 2px; margin-bottom: 6px;
}
.req-sheet-hits { max-height: 140px; overflow: auto; margin-bottom: 8px; border: 1px solid #c0c0c0; background: #fff; }
.req-sheet-add-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.req-table-scroll { max-height: 280px; overflow: auto; margin: 0; background: #fff; border-top: 1px solid #808080; }
.req-sheet-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.req-sheet-table th {
    position: sticky; top: 0; z-index: 1;
    background: #d4d0c8; border: 1px solid #808080; padding: 4px 6px; text-align: left; font-weight: 600;
}
.req-sheet-table td { border: 1px solid #c0c0c0; padding: 3px 6px; vertical-align: middle; }
.req-line-row { cursor: pointer; }
.req-line-row:hover { background: #f0f0ff; }
.req-line-row.selected { background: #316ac5; color: #fff; }
.req-line-row.selected .req-crit { color: #ffcccc; }
.req-col-parts { max-width: 220px; }
.req-col-icon { width: 18px; text-align: center; }
.req-crit { color: #c00; font-weight: 700; }
.req-order-qty { width: 52px; padding: 2px 4px; text-align: center; border: 1px solid #808080; border-radius: 2px; }
.req-line-row.selected .req-order-qty { color: #000; }
.req-sheet-actions {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
    padding: 12px 14px; background: #ece9d8; border-top: 1px solid #808080;
}
.req-sheet-empty { font-size: 11px; margin: 4px 0; }
.req-hit-row { cursor: pointer; }
.req-hit-row:hover { background: #ebf8ff; }

/* ═══════════ PWA & Mobile Native App UX ═══════════ */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    touch-action: manipulation;
    scrollbar-gutter: stable;
}
body {
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
}
body.pwa-standalone {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.pwa-offline-badge {
    position: sticky;
    top: 0;
    z-index: 60;
    padding: 8px 14px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #744210;
    background: #fefcbf;
    border-bottom: 1px solid #f6e05e;
}

/* Touch-friendly buttons */
.btn, button.btn, .btn-sm, .tab-btn, .login-submit, .dept-btn, .fleet-view-btn,
.mobile-nav-btn, .hist-tab, .wp-tab, .cmaxs-card-item {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}
.btn:active:not(:disabled), button.btn:active:not(:disabled),
.btn-sm:active:not(:disabled), .tab-btn:active,
.login-submit:active, .dept-btn:active, .fleet-view-btn:active,
.mobile-nav-btn:active, .hist-tab:active, .cmaxs-card-item:active {
    transform: scale(0.97);
    filter: brightness(0.92);
}
.btn, button.btn, .btn-sm { min-height: 36px; }
.btn-sm { min-height: 32px; }

input[type="number"], input[inputmode="numeric"], .spare-req-qty-input {
    font-variant-numeric: tabular-nums;
}

/* Mobile hamburger navigation */
.mobile-nav-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin-right: 4px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 8px;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}
.mobile-nav-icon,
.mobile-nav-icon::before,
.mobile-nav-icon::after {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    position: relative;
    transition: transform .2s, opacity .2s, top .2s;
}
.mobile-nav-icon::before,
.mobile-nav-icon::after {
    content: '';
    position: absolute;
    left: 0;
}
.mobile-nav-icon::before { top: -6px; }
.mobile-nav-icon::after { top: 6px; }
body.mobile-nav-open .mobile-nav-icon { background: transparent; }
body.mobile-nav-open .mobile-nav-icon::before { top: 0; transform: rotate(45deg); }
body.mobile-nav-open .mobile-nav-icon::after { top: 0; transform: rotate(-45deg); }

.mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(0,0,0,.45);
}
body.mobile-nav-open .mobile-nav-backdrop { display: block; }

@media (max-width: 768px) {
    .mobile-nav-btn { display: inline-flex; }

    .cmaxs-header {
        padding: 10px 12px;
        gap: 8px;
        position: sticky;
        top: 0;
        z-index: 120;
    }
    .cmaxs-ship { min-width: 0; flex: 1; }
    .ship-name { font-size: 16px; }
    .ship-logo { width: 36px; height: 36px; }
    .ship-flag { font-size: 26px; }
    .ship-meta { gap: 8px; font-size: 11px; }
    .cmaxs-toprite { gap: 6px; }
    .cmaxs-action-print { display: none; }
    .dept-label { display: none; }

    #appShell { max-width: none; }

    .tab-bar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(280px, 86vw);
        z-index: 150;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: calc(12px + env(safe-area-inset-top)) 0 16px;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,.25);
    }
    body.mobile-nav-open .tab-bar { transform: translateX(0); }

    .tab-btn {
        width: 100%;
        text-align: left;
        padding: 14px 18px;
        border-bottom: 1px solid rgba(255,255,255,.08);
        border-left: 4px solid transparent;
        white-space: normal;
        min-height: 48px;
    }
    .tab-btn.active {
        border-left-color: var(--amber);
        border-bottom-color: rgba(255,255,255,.08);
        box-shadow: none;
    }
    .tab-btn.active::after { display: none; }

    .plan-layout,
    .orig-layout,
    .actual-layout {
        grid-template-columns: 1fr;
        padding: 10px 12px 20px;
    }
    .tree-panel { min-height: 280px; }
    .cmaxs-body {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    .fleet-list-panel { max-height: 50vh; }
    .sheet-head { flex-wrap: wrap; padding: 12px 14px 4px; }
    .sheet-head h2 { font-size: 17px; }
    .modal { padding: 10px; align-items: flex-end; }
    .modal-box { max-height: 92vh; border-radius: 12px 12px 0 0; }
    #workReportModal,
    #defectReportModal,
    #workPermitModal,
    #spareReqListModal,
    #spareReqWorkModal,
    #spareConsumeModal,
    #spareReceiveModal {
        align-items: flex-start;
        justify-content: center;
        padding: 12px;
    }
    #workReportModal .modal-box.wr-modal,
    #defectReportModal .modal-box.wr-modal,
    #workPermitModal .modal-box.wr-modal,
    #spareConsumeModal.is-consume-list-window .modal-box.spare-req-work-modal,
    #spareConsumeLogModal .modal-box.spare-req-list-modal {
        width: 1000px;
        min-width: 1000px;
        max-width: 1000px;
        height: min(92vh, 920px);
        min-height: min(92vh, 920px);
        border-radius: 12px;
    }
    #workProcedureModal .modal-box.wp-modal,
    #vesselDocsModal .modal-box.wp-modal {
        width: min(96vw, 820px);
        min-width: min(96vw, 820px);
        max-width: min(96vw, 820px);
        height: auto;
        max-height: min(92vh, 720px);
        min-height: 0;
        border-radius: 12px;
    }
    #spareReqListModal .modal-box.spare-req-list-modal {
        width: min(96vw, 1360px);
        max-width: min(96vw, 1360px);
        border-radius: 12px;
    }
    #spareReqWorkModal .modal-box.spare-req-work-modal,
    #spareConsumeModal .modal-box.spare-req-work-modal,
    #spareReceiveModal .modal-box.spare-req-work-modal {
        width: min(98vw, 1400px);
        min-width: 0;
        max-width: min(98vw, 1400px);
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .cmaxs-legend { font-size: 11px; padding: 6px 12px; }
    .hist-panel { overflow-x: hidden; }
    .dept-btn { padding: 6px 10px; font-size: 12px; }
}

/* ── Defect Report Case ───────────────────────────────── */
.defect-inbox-panel {
    margin-top: 14px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #d8e2ec;
    border-radius: 10px;
    overflow-x: auto;
}
.defect-inbox-head {
    font-weight: 700;
    font-size: 14px;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 8px;
}
.defect-inbox-badge {
    background: #ed8936;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}
.defect-inbox-sub {
    font-size: 11px;
    color: #718096;
    margin: 4px 0 10px;
}
.defect-inbox-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.defect-inbox-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.defect-inbox-table th,
.defect-inbox-table td {
    border: 1px solid #e2e8f0;
    padding: 6px 8px;
    text-align: left;
}
.defect-inbox-table th { background: #edf2f7; }
.defect-inbox-actions { white-space: nowrap; }
.defect-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.defect-status.tone-amber { background: #feebc8; color: #9c4221; }
.defect-status.tone-green { background: #c6f6d5; color: #22543d; }
.defect-status.tone-blue { background: #bee3f8; color: #2c5282; }
.defect-status.tone-gray { background: #edf2f7; color: #4a5568; }

#tab-defect .list-tab-frame,
#tab-history .list-tab-frame {
    margin: 0 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
#tab-defect .list-tab-frame .hist-toolbar-stack,
#tab-history .list-tab-frame .hist-toolbar-stack {
    margin: 0;
    width: 100%;
}
#tab-defect .list-tab-frame .hist-legend,
#tab-history .list-tab-frame .hist-legend {
    margin: 0;
}
#tab-defect .list-tab-frame .sheet-table-wrap,
#tab-history .list-tab-frame .sheet-table-wrap {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    scrollbar-gutter: auto;
}
#histPmsPane .hist-col-chk,
#histPmsPane .hist-col-crit { width: 32px; }
#histPmsPane .hist-col-type { width: 52px; }
#histPmsPane .hist-col-file { width: 115px; }
#histPmsPane .hist-col-code { width: 100px; }
#histPmsPane .hist-col-sort1,
#histPmsPane .hist-col-sort2 { width: auto; }
#histPmsPane .hist-col-date,
#histPmsPane .hist-col-at { width: 88px; }
#histPmsPane .hist-col-status { width: 96px; }
#histPmsPane .hist-col-flag { width: 40px; }
#histPmsPane .hist-col-spare { width: 56px; }
#histPmsPane .spare-req-list-head-wrap .hist-table {
    min-width: 1200px;
}
#histPmsPane .spare-req-list-head-wrap .hist-table th {
    position: static;
    top: auto;
    background: var(--navy);
    color: #fff;
}
#histPmsPane .spare-req-list-head-wrap {
    overflow: hidden;
}
#histPmsPane .spare-req-list-scroll .hist-table {
    min-width: 1200px;
}
#tab-defect .list-tab-frame .hist-toolbar-filters.list-filter-stack,
#tab-history .list-tab-frame .hist-toolbar-filters.list-filter-stack {
    width: 100%;
    box-sizing: border-box;
}
#tab-defect .list-tab-frame .hist-table-defect-list,
#tab-history .list-tab-frame .hist-table-history-list {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}
/* Work History — Type column styling */
#tab-history .hist-table-history-list th.hist-type-h {
    font-size: inherit;
    font-weight: 600;
}
#tab-history .hist-table-history-list td.hist-type::after { content: none !important; display: none !important; }
#tab-history .hist-table-history-list td.hist-type .hist-type-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 10px;
}
/* Shared compact list columns — Defect Report & Work History */
.list-tab-frame .hist-table-defect-list,
.list-tab-frame .hist-table-history-list {
    min-width: 0;
}
.list-tab-frame .hist-table-defect-list th.hist-date-h,
.list-tab-frame .hist-table-defect-list th.hist-at-ship-h,
.list-tab-frame .hist-table-defect-list th.hist-at-company-h,
.list-tab-frame .hist-table-history-list th.hist-date-h,
.list-tab-frame .hist-table-history-list th.hist-at-ship-h,
.list-tab-frame .hist-table-history-list th.hist-at-company-h,
.list-tab-frame .hist-table-history-list th.hist-spare-data-h {
    white-space: normal;
}
/* Defect Report list — fixed columns; SORT-1 / SORT-2 min 130px, grow together */
.list-tab-frame .hist-table-defect-list th.hist-file-h,
.list-tab-frame .hist-table-defect-list td.hist-file {
    width: 115px;
    min-width: 115px;
    max-width: 115px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-tab-frame .hist-table-history-list th.hist-file-h,
.list-tab-frame .hist-table-history-list td.hist-file {
    width: 115px;
    min-width: 115px;
    max-width: 115px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-tab-frame .hist-table-defect-list th.hist-code-h,
.list-tab-frame .hist-table-defect-list td.hist-code {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    white-space: nowrap;
}
.list-tab-frame .hist-table-defect-list th.hist-date-h,
.list-tab-frame .hist-table-defect-list td.hist-date {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    text-align: center;
    white-space: nowrap;
}
.list-tab-frame .hist-table-defect-list th.hist-status-h,
.list-tab-frame .hist-table-defect-list td.hist-status {
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    text-align: center;
    white-space: nowrap;
}
.list-tab-frame .hist-table-defect-list th.hist-flag-h,
.list-tab-frame .hist-table-defect-list td.hist-flag {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    padding-left: 4px;
    padding-right: 4px;
    text-align: center;
    white-space: nowrap;
}
.list-tab-frame .hist-table-defect-list th.hist-at-ship-h,
.list-tab-frame .hist-table-defect-list td.hist-at-ship {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    text-align: center;
    white-space: nowrap;
}
.list-tab-frame .hist-table-defect-list th.hist-at-company-h,
.list-tab-frame .hist-table-defect-list td.hist-at-company {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    text-align: center;
    white-space: nowrap;
}
.list-tab-frame .hist-table-defect-list th.hist-sort1-h,
.list-tab-frame .hist-table-defect-list td.hist-sort1,
.list-tab-frame .hist-table-defect-list th.hist-sort2-h,
.list-tab-frame .hist-table-defect-list td.hist-sort2 {
    width: auto;
    min-width: 130px;
    max-width: none;
}
/* Work History list — fixed columns + Type; SORT-1 / SORT-2 min 130px, grow together */
.list-tab-frame .hist-table-history-list th.hist-type-h,
.list-tab-frame .hist-table-history-list td.hist-type {
    width: 52px;
    min-width: 52px;
    max-width: 52px;
    padding-left: 4px;
    padding-right: 4px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}
#tab-history .list-table-scroll-wrap .hist-table-history-list th.hist-type-h {
    padding: 8px 4px;
    overflow: visible;
    text-overflow: clip;
}
.list-tab-frame .hist-table-history-list th.hist-code-h,
.list-tab-frame .hist-table-history-list td.hist-code {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    white-space: nowrap;
}
.list-tab-frame .hist-table-history-list th.hist-date-h,
.list-tab-frame .hist-table-history-list td.hist-date {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    text-align: center;
    white-space: nowrap;
}
.list-tab-frame .hist-table-history-list th.hist-status-h,
.list-tab-frame .hist-table-history-list td.hist-status {
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    text-align: center;
    white-space: nowrap;
}
.list-tab-frame .hist-table-history-list th.hist-flag-h,
.list-tab-frame .hist-table-history-list td.hist-flag {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    padding-left: 4px;
    padding-right: 4px;
    text-align: center;
    white-space: nowrap;
}
.list-tab-frame .hist-table-history-list th.hist-at-ship-h,
.list-tab-frame .hist-table-history-list td.hist-at-ship {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    text-align: center;
    white-space: nowrap;
}
.list-tab-frame .hist-table-history-list th.hist-at-company-h,
.list-tab-frame .hist-table-history-list td.hist-at-company {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    text-align: center;
    white-space: nowrap;
}
.list-tab-frame .hist-table-history-list th.hist-spare-data-h,
.list-tab-frame .hist-table-history-list td.hist-spare-data {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    text-align: center;
    white-space: nowrap;
}
.list-tab-frame .hist-table-history-list td.hist-spare-data {
    font-weight: 600;
    color: #2b6cb0;
    font-variant-numeric: tabular-nums;
}
.list-tab-frame .hist-table-history-list th.hist-sort1-h,
.list-tab-frame .hist-table-history-list td.hist-sort1,
.list-tab-frame .hist-table-history-list th.hist-sort2-h,
.list-tab-frame .hist-table-history-list td.hist-sort2 {
    width: auto;
    min-width: 130px;
    max-width: none;
}

.tvc-dialog-modal { z-index: 10200; }
.tvc-dialog-box {
    width: min(92vw, 420px);
    padding: 22px 20px 18px;
    text-align: center;
    max-height: min(86vh, 740px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tvc-dialog-box.is-long {
    width: min(94vw, 560px);
    text-align: left;
}
.tvc-dialog-title {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    flex-shrink: 0;
}
.tvc-dialog-title.hidden { display: none; }
.tvc-dialog-msg {
    margin: 0 0 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-y: auto;
    min-height: 0;
    flex: 1 1 auto;
    text-align: inherit;
}
.tvc-dialog-box.is-long .tvc-dialog-msg {
    font-size: 13px;
    font-weight: 500;
}
.tvc-dialog-actions {
    justify-content: center;
    gap: 12px;
    flex-shrink: 0;
}
.tvc-dialog-actions .btn { min-width: 72px; }
.tvc-dialog-extra { margin: 0 0 12px; }
.tvc-dialog-extra.hidden { display: none; }
.tvc-dialog-extra .tvc-dialog-input {
    width: 100%;
    min-height: 72px;
    padding: 8px 10px;
    border: 1px solid var(--border, #c8d0dc);
    border-radius: 6px;
    font: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.wr-maint-textarea.wr-company-comment-edit {
    border-color: var(--accent, #2563eb);
    background: #f8fbff;
}

.df-cancel-confirm-modal { z-index: 10200; }
.df-cancel-confirm-box {
    width: min(92vw, 360px);
    padding: 22px 20px 18px;
    text-align: center;
}
.df-cancel-confirm-msg {
    margin: 0 0 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    line-height: 1.5;
}
.df-cancel-confirm-actions {
    justify-content: center;
    gap: 12px;
}
.df-cancel-confirm-actions .btn { min-width: 72px; }

.spare-close-os-modal { z-index: 10200; }
.spare-close-os-box {
    width: min(96vw, 480px);
    max-width: 96vw;
    padding: 20px 22px 18px;
}
.spare-close-os-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: #1a365d;
}
.spare-close-os-meta { margin: 0 0 6px; font-size: 0.92rem; }
.spare-close-os-os { margin: 0 0 12px; font-size: 0.95rem; }
.spare-close-os-reason { margin-bottom: 12px; }
.spare-close-os-reason-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.88rem;
    font-weight: 600;
}
.spare-close-os-reason-input {
    width: 100%;
    min-height: 72px;
    resize: vertical;
    box-sizing: border-box;
}
.spare-close-os-box .wr-maint-approval { margin: 0 0 14px; }
.spare-close-os-actions {
    justify-content: flex-end;
    gap: 8px;
}

.modal-box.df-modal {
    width: min(98vw, 1200px);
    max-width: 98vw;
    height: min(92vh, 900px);
    max-height: 92vh;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.df-modal-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
#defectReportModal .modal-x {
    top: 10px;
    right: 12px;
    z-index: 20;
    color: #fff;
}
.df-status-pill {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,.2);
}
.df-phase-ship { border-color: #63b3ed; background: #f0f9ff; }
.df-phase-close { border-color: #48bb78; background: #f0fff4; }
.df-phase-note {
    margin: 8px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: #2d3748;
}
.df-radio-label {
    font-size: 11px;
    font-weight: 600;
    color: #4a5568;
    display: block;
    margin-bottom: 4px;
}
.df-radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.df-radio {
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.df-page2-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.df-page2-body .df-phase { margin-bottom: 0; }
.df-workflow-phases {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.df-workflow-phases .df-phase { margin-bottom: 0; }
.df-post-action-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 0;
    width: 100%;
}
.df-post-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.df-post-block.df-company-reply {
    background: #fffaf0;
    border-color: #f6ad55;
}
.df-post-block.df-ship-verify {
    background: #f0f9ff;
    border-color: #63b3ed;
}
.df-post-block.df-company-final {
    background: #fafbfd;
}
.df-post-title {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4a5568;
}
.df-post-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.df-post-title-row .df-post-title {
    margin: 0;
    flex: 1 1 240px;
    min-width: 0;
}
.df-post-date-field {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}
.df-post-date-field label {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4a5568;
    white-space: nowrap;
}
.df-post-date-field input[type="date"],
#defectReportBody .df-post-date-field input.tvc-date-input,
#defectReportBody .df-post-date-field .tvc-date-input-wrap .tvc-date-input {
    width: 148px;
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    font-family: inherit;
    font-size: 11px;
    color: #2d3748;
    box-sizing: border-box;
    background: #fff;
    font-variant-numeric: tabular-nums;
    min-width: 9.8em;
}
#defectReportBody .df-post-date-field input.tvc-date-input::placeholder {
    color: #718096;
}
.df-company-attach-row .wr-attach-block { margin: 0; }
.df-post-date-row {
    max-width: 200px;
}
.df-post-checks {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
}
/* Defect Report — post-action / repair labels match standard field labels */
#defectReportBody .df-post-title,
#defectReportBody .df-post-date-field label,
#defectReportBody .df-checks-label,
#defectReportBody .df-check,
#defectReportBody .df-post-block .wr-footer-flag,
#defectReportBody .df-repair-request-chk,
#defectReportBody .df-ship-initial-actions .wr-maint-chk {
    font-size: 10px;
    font-weight: 700;
    color: #1a202c;
    letter-spacing: .03em;
    text-transform: uppercase;
}
#defectReportBody .df-check,
#defectReportBody .df-post-block .wr-footer-flag,
#defectReportBody .df-repair-request-chk,
#defectReportBody .df-ship-initial-actions .wr-maint-chk {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.df-verify-labor {
    grid-template-columns: repeat(2, minmax(0, 160px)) minmax(0, 1fr);
}
.df-verify-flags {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
#defectReportBody .wr-page > .wr-spare-work-layout {
    flex: 1;
    min-height: 420px;
}
.df-phase {
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fafbfc;
}
.df-phase-hq { border-color: #f6ad55; background: #fffaf0; }
.df-phase-title {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--navy);
}
.df-urgent {
    font-size: 10px;
    background: #e53e3e;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}
.df-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: 8px 12px;
}
.df-field { display: flex; flex-direction: column; gap: 3px; }
.df-field.df-span-2 { grid-column: span 2; }
.df-field label {
    font-size: 11px;
    font-weight: 600;
    color: #4a5568;
}
.df-field input,
.df-field textarea {
    font-size: 12px;
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-family: inherit;
}
.df-field textarea { resize: vertical; min-height: 48px; }
.df-field input[readonly],
.df-field textarea[readonly] { background: #f7fafc; }
.df-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 10px;
    align-items: center;
}
.df-checks-label {
    font-size: 11px;
    font-weight: 700;
    color: #4a5568;
}
.df-check {
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.df-modal-actions {
    flex-shrink: 0;
    border-top: 1px solid #e2e8f0;
    padding: 10px 16px;
    background: #f7fafc;
}
.df-modal-actions.df-modal-actions-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(min-content, 1fr);
    align-items: center;
    gap: 12px;
    justify-content: stretch;
}
.df-modal-actions-left,
.df-modal-actions-center,
.df-modal-actions-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.df-modal-actions-left { justify-content: flex-start; }
.df-modal-actions-center { justify-content: center; }
.df-modal-actions-right { justify-content: flex-end; min-width: min-content; flex-wrap: wrap; }
.df-hq-done {
    margin: 0;
    font-size: 12px;
    color: #22543d;
    font-weight: 600;
}

.defect-tab-body {
    margin: 0 20px 24px;
    padding: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    min-height: 320px;
}

