:root {
    --bg: #f3f6fa;
    --surface: #ffffff;
    --ink: #17263b;
    --muted: #6f7e91;
    --line: #e3e9f0;
    --primary: #087f73;
    --primary-dark: #06685f;
    --primary-soft: #e9f7f4;
    --danger: #d94b55;
    --shadow: 0 12px 40px rgba(30, 52, 78, .07);
    --radius: 18px;
    --page-left: 90mm;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 92% 8%, rgba(8, 127, 115, .08), transparent 26%),
        var(--bg);
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-decoration: none; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.app-header { background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1480px; height: 82px; padding: 0 36px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; color: #fff; border-radius: 13px; background: linear-gradient(145deg, #0b9486, #06685f); box-shadow: 0 7px 18px rgba(8, 127, 115, .2); }
.brand-mark .icon { width: 25px; height: 25px; }
.brand strong { display: block; font-size: 19px; letter-spacing: .5px; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; letter-spacing: 2px; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.storage-badge { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; background: #20ad7d; border-radius: 50%; box-shadow: 0 0 0 4px rgba(32, 173, 125, .11); }

.button { min-height: 42px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; font-weight: 600; font-size: 13px; transition: background .18s, border-color .18s, transform .18s, box-shadow .18s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 5px 13px rgba(8, 127, 115, .16); }
.button-primary:hover:not(:disabled) { background: var(--primary-dark); }
.button-secondary { color: var(--primary); border-color: #cde7e2; background: var(--primary-soft); }
.button-secondary:hover:not(:disabled) { background: #dcf2ed; }
.button-ghost { color: #44546a; border-color: var(--line); background: #fff; }
.button-ghost:hover:not(:disabled) { border-color: #bac8d7; background: #f8fafc; }
.button-danger { color: #fff; background: var(--danger); }
.button-danger:hover:not(:disabled) { background: #bf3b45; }
.button-sm { min-height: 34px; padding: 0 12px; font-size: 12px; }
.count-badge { min-width: 23px; height: 23px; padding: 0 6px; display: inline-grid; place-items: center; color: var(--primary); background: #fff; border-radius: 7px; font-size: 11px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; color: var(--muted); border: 0; border-radius: 10px; background: transparent; }
.icon-button:hover { color: var(--ink); background: #eef2f6; }
.text-button { padding: 0; display: inline-flex; align-items: center; gap: 5px; color: var(--primary); border: 0; background: none; font-weight: 600; font-size: 13px; }
.text-button .icon { width: 16px; height: 16px; }

.app-layout { max-width: 1480px; padding: 30px 36px 40px; margin: auto; display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 28px; align-items: start; }
.sidebar { position: sticky; top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 16px 16px; box-shadow: var(--shadow); }
.sidebar-title { padding: 0 10px 20px; display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 700; }
.sidebar-title span { color: var(--muted); font-size: 11px; font-weight: 400; }
.steps { display: flex; flex-direction: column; gap: 5px; }
.step { position: relative; width: 100%; padding: 13px 11px; display: flex; align-items: center; gap: 12px; text-align: left; color: #768397; border: 0; border-radius: 11px; background: transparent; transition: background .2s, color .2s; }
.step:hover { background: #f6f8fb; }
.step-number { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: #8591a2; border: 1px solid #dce3eb; border-radius: 10px; background: #fff; font-size: 11px; font-weight: 700; }
.step strong { display: block; font-size: 13px; font-weight: 600; }
.step small { display: block; margin-top: 4px; font-size: 10px; color: #98a3b2; }
.step.active { color: var(--primary); background: var(--primary-soft); }
.step.active .step-number { color: #fff; border-color: var(--primary); background: var(--primary); box-shadow: 0 4px 10px rgba(8, 127, 115, .17); }
.step.active strong { font-weight: 700; }
.step.done { color: #3b5c58; }
.step.done .step-number { color: var(--primary); border-color: #b9ded7; background: #e5f5f1; }
.sidebar-note { margin-top: 20px; padding: 15px 12px; display: flex; align-items: flex-start; gap: 10px; color: var(--primary); border-top: 1px solid var(--line); }
.sidebar-note .icon { width: 18px; height: 18px; margin-top: 1px; }
.sidebar-note strong { display: block; color: #42536a; font-size: 11px; }
.sidebar-note p { margin: 6px 0 0; color: #8b97a8; font-size: 10px; line-height: 1.7; }

.main-content { min-width: 0; }
.content-heading { margin: 4px 2px 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.eyebrow, .modal-kicker { color: var(--primary); font-size: 10px; font-weight: 700; letter-spacing: 2px; }
.content-heading h1 { margin: 8px 0 8px; font-size: 28px; line-height: 1.25; letter-spacing: -.5px; }
.content-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.step-progress { display: flex; align-items: baseline; gap: 5px; padding-bottom: 2px; }
.step-progress strong { color: var(--primary); font-size: 24px; font-weight: 500; }
.step-progress span { color: #a2adbb; font-size: 12px; }
.wizard-panel { min-height: 430px; padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-heading { margin-bottom: 28px; display: flex; align-items: center; gap: 14px; }
.heading-with-action > div { flex: 1; }
.heading-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; color: var(--primary); border-radius: 12px; background: var(--primary-soft); }
.panel-heading h2 { margin: 0; font-size: 18px; }
.panel-heading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.required, .form-field em { color: var(--danger); font-style: normal; }

.company-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); gap: 26px; }
.company-form { padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; }
.field-label { display: block; margin-bottom: 9px; color: #435168; font-size: 12px; font-weight: 600; }
.form-control { width: 100%; min-height: 43px; padding: 0 13px; color: var(--ink); border: 1px solid #d7e0e9; border-radius: 9px; outline: none; background: #fff; transition: border-color .18s, box-shadow .18s; }
.form-control:focus { border-color: #4eaaa0; box-shadow: 0 0 0 3px rgba(8, 127, 115, .1); }
.form-control::placeholder { color: #a3adba; }
.form-control-lg { min-height: 50px; font-size: 14px; }
select.form-control { padding-right: 34px; cursor: pointer; }
.add-company-button { margin-top: 16px; }
.field-help { margin: 14px 0 0; color: #8a96a6; font-size: 11px; line-height: 1.7; }
.company-preview { min-height: 240px; padding: 25px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px solid #dcece8; border-radius: 14px; background: linear-gradient(145deg, #f1faf7, #e8f4f2); }
.preview-label { padding: 5px 10px; color: var(--primary); border-radius: 20px; background: rgba(255, 255, 255, .8); font-size: 10px; letter-spacing: 1px; }
.company-avatar { width: 60px; height: 60px; margin: 23px 0 15px; display: grid; place-items: center; color: var(--primary); border-radius: 18px; background: #fff; box-shadow: 0 7px 22px rgba(8, 127, 115, .09); }
.company-avatar .icon { width: 29px; height: 29px; }
.company-preview strong { max-width: 100%; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.company-preview > span:last-child { margin-top: 8px; color: #79908f; font-size: 11px; }

.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.template-card { position: relative; min-height: 292px; padding: 26px 22px 22px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; color: var(--ink); border: 1.5px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .2s, background .2s, transform .2s, box-shadow .2s; }
.template-card:hover { transform: translateY(-3px); border-color: #b9d8d2; box-shadow: 0 12px 26px rgba(30, 52, 78, .07); }
.template-card.selected { border-color: var(--primary); background: #f6fcfb; box-shadow: 0 0 0 3px rgba(8, 127, 115, .06); }
.template-icon { width: 52px; height: 52px; margin-bottom: 24px; display: grid; place-items: center; border-radius: 14px; }
.template-icon .icon { width: 26px; height: 26px; }
.template-icon.teal { color: #087f73; background: #e4f5f1; }
.template-icon.blue { color: #3475c9; background: #eaf2fd; }
.template-icon.violet { color: #7656bf; background: #f0ebfa; }
.template-check { position: absolute; top: 20px; right: 20px; width: 22px; height: 22px; display: none; place-items: center; color: #fff; border-radius: 50%; background: var(--primary); }
.template-check .icon { width: 13px; height: 13px; stroke-width: 2.5; }
.template-card.selected .template-check { display: grid; }
.template-card > strong { font-size: 15px; }
.template-description { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.85; }
.template-tag { margin-top: auto; padding: 5px 9px; color: #778598; border-radius: 6px; background: #f0f3f7; font-size: 10px; }

.vendor-search-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.input-with-icon { position: relative; }
.input-with-icon > .icon { position: absolute; top: 50%; left: 13px; width: 18px; height: 18px; color: #93a0b1; transform: translateY(-50%); pointer-events: none; }
.input-with-icon .form-control { padding-left: 41px; }
.selection-meta { margin: 13px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 11px; }
.vendor-detail { min-height: 104px; padding: 20px; border: 1px dashed #d8e2e9; border-radius: 12px; background: #fafcfd; }
.vendor-placeholder { height: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; color: #95a1b1; font-size: 12px; }
.vendor-card-head { margin-bottom: 17px; display: flex; align-items: center; gap: 10px; }
.vendor-card-head .avatar { width: 34px; height: 34px; display: grid; place-items: center; color: var(--primary); border-radius: 9px; background: var(--primary-soft); }
.vendor-card-head .avatar .icon { width: 17px; height: 17px; }
.vendor-card-head strong { font-size: 14px; overflow-wrap: anywhere; }
.vendor-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.vendor-detail-grid span { display: block; margin-bottom: 5px; color: #8b97a7; font-size: 10px; }
.vendor-detail-grid strong { display: block; color: #3f5068; font-size: 12px; font-weight: 500; line-height: 1.6; overflow-wrap: anywhere; }
.inline-notice { margin-top: 20px; padding: 12px 14px; display: flex; align-items: center; gap: 9px; color: #687b91; border-radius: 9px; background: #f0f4f8; font-size: 11px; line-height: 1.6; }
.inline-notice .icon { width: 16px; height: 16px; color: #6887a5; }

.form-area-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.form-area-grid .field { min-width: 0; }
.field label { display: block; margin-bottom: 7px; color: #58677c; font-size: 11px; font-weight: 600; }
.field input { width: 100%; min-height: 41px; padding: 0 11px; color: var(--ink); border: 1px solid #d7e0e9; border-radius: 8px; outline: none; background: #fff; }
.field input:focus { border-color: #4eaaa0; box-shadow: 0 0 0 3px rgba(8, 127, 115, .09); }
.field input[readonly] { color: #6b798c; background: #f4f7fa; }
.table-scroll { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.grid th, table.grid td { padding: 10px; border: 1px solid #dce3eb; font-size: 12px; }
table.grid th { color: #5c6d82; background: #f3f6f9; font-weight: 600; text-align: left; }
table.grid input { width: 100%; padding: 6px; color: var(--ink); border: 0; outline: none; background: transparent; }
table.grid input:focus { box-shadow: inset 0 0 0 1px #4eaaa0; }
table.grid td.act { width: 58px; text-align: center; }
table.grid .right { text-align: right; }
.delete-row { width: 29px; height: 29px; display: inline-grid; place-items: center; color: #a2adba; border: 0; border-radius: 7px; background: transparent; }
.delete-row:hover { color: var(--danger); background: #fff0f1; }
.delete-row .icon { width: 15px; height: 15px; }
.add-row-button { margin-top: 15px; }

.actionbar { position: sticky; bottom: 18px; z-index: 10; margin-top: 20px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid rgba(217, 226, 235, .9); border-radius: 14px; background: rgba(255, 255, 255, .95); box-shadow: 0 12px 30px rgba(30, 52, 78, .1); backdrop-filter: blur(12px); }
.actionbar-hint { color: #8b97a8; font-size: 11px; }
.preview-panel { min-height: auto; }
.print-settings { margin-bottom: 22px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 25px; border-radius: 12px; background: #f3f7f9; }
.print-settings .field-label { margin-bottom: 4px; }
.print-settings p { margin: 0; color: var(--muted); font-size: 11px; }
.range-control { display: flex; align-items: center; gap: 14px; }
.range-control input { width: 220px; accent-color: var(--primary); }
.range-control output { min-width: 58px; color: var(--primary); font-size: 12px; font-weight: 700; }
.preview-back { margin-bottom: 18px; }
.preview-wrap { padding: 24px; overflow-x: auto; border-radius: var(--radius); background: #e6ebf1; }

.page { width: 297mm; min-height: 210mm; padding: 14mm 14mm 12mm var(--page-left); margin: auto; color: #111; background: #fff; box-shadow: 0 4px 22px rgba(25, 40, 60, .16); font-family: "SimSun", "Songti SC", serif; }
.page h2 { margin: 0 0 4px; text-align: center; font-size: 19px; letter-spacing: 2px; }
.page .sub { margin-bottom: 12px; text-align: center; font-size: 15px; letter-spacing: 8px; }
.page table { width: 100%; border-collapse: collapse; }
.page td, .page th { padding: 5px 8px; border: 1px solid #333; font-size: 13.5px; }
.page .right { text-align: right; }
.page .mt { margin-top: 10px; }
.page .info-line { margin: 6px 0; display: flex; justify-content: space-between; font-size: 13.5px; }
.sig { margin-top: 14px; }
.sig-item { margin-bottom: 11px; display: flex; align-items: flex-end; gap: 10px; font-size: 13.5px; }
.sig-item .lbl { flex: 0 0 32%; line-height: 1.5; }
.sig-item .line { flex: 1; height: 15px; border-bottom: 1px solid #333; }
.sig-item .dtlbl { flex: 0 0 auto; }
.sig-item .dline { flex: 0 0 70px; height: 15px; border-bottom: 1px solid #333; }
.sig-grid { display: flex; flex-wrap: wrap; gap: 0 26px; }
.sig-grid .sig-item { flex: 0 0 calc(50% - 13px); }
.sig-grid .sig-item .lbl { flex: 0 0 24%; }
.pay-table tr { height: 30pt; }
.pay-table td, .pay-table th { height: 30pt; box-sizing: border-box; }
.sig-pay { break-inside: avoid; page-break-inside: avoid; }
.sig-pay .sig-item { height: 30pt; margin-bottom: 3pt; box-sizing: border-box; }
.sig-pay .sig-item .line, .sig-pay .sig-item .dline { height: 22pt; }
.page .cash-title { font-size: 20px; }
.cash-meta { margin: 6px 0 10px; text-align: right; font-size: 13.5px; line-height: 1.7; }
.cash-sheet tr { height: 30pt; }
.cash-sheet td, .cash-sheet th { height: 30pt; box-sizing: border-box; }
.cash-total-cn td { text-align: left; }
.cash-signatures { width: 100%; margin-top: 0; table-layout: fixed; break-inside: avoid; page-break-inside: avoid; }
.cash-signatures td, .cash-signatures th { height: 30pt; box-sizing: border-box; }
.cash-signatures th { font-weight: 400; text-align: left; }
.cash-signatures th:nth-child(3) { text-align: center; }
.cash-signatures tr { break-inside: avoid; page-break-inside: avoid; }
.pay-head { margin-top: 14px; display: flex; align-items: flex-end; gap: 20px; }
.ph-item { min-width: 0; flex: 1; display: flex; align-items: flex-end; gap: 6px; }
.ph-item.short { flex: 0 0 34%; }
.ph-item .lb { flex: 0 0 auto; white-space: nowrap; }
.ph-item .vl { min-width: 0; flex: 1; height: 20px; padding: 0 4px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid #333; text-align: center;}

.modal-backdrop { position: fixed; inset: 0; z-index: 70; padding: 28px; display: flex; align-items: center; justify-content: center; background: rgba(17, 31, 48, .48); backdrop-filter: blur(4px); }
.modal { width: 100%; max-height: calc(100vh - 56px); overflow: auto; border: 1px solid rgba(255, 255, 255, .6); border-radius: 18px; background: #fff; box-shadow: 0 28px 80px rgba(10, 27, 44, .24); animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.supplier-modal { max-width: 1100px; padding: 26px; }
.form-modal { max-width: 650px; padding: 27px; }
.small-modal { max-width: 430px; }
#supplierFormModal, #companyModal, #userFormModal { z-index: 90; }
#confirmModal { z-index: 110; }
.modal-header { margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.modal-header h2 { margin: 7px 0 0; font-size: 21px; }
.manager-toolbar { display: flex; align-items: center; gap: 12px; }
.manager-search { flex: 1; }
.manager-summary { margin: 17px 0 11px; display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 11px; }
.table-wrap { min-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; }
.supplier-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.supplier-table th { position: sticky; top: 0; z-index: 1; padding: 13px 14px; color: #6a7b90; background: #f3f6f9; font-size: 11px; font-weight: 600; text-align: left; }
.supplier-table td { max-width: 240px; padding: 13px 14px; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid #edf1f5; color: #4a5b72; font-size: 12px; }
.supplier-table td:first-child { max-width: 260px; white-space: normal; }
.supplier-table tbody tr:hover { background: #f9fbfc; }
.supplier-name { display: block; color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1.6; }
.supplier-contact { display: block; margin-top: 3px; color: #93a0b0; font-size: 10px; }
.account-number { color: #33465e; font-family: Consolas, "Courier New", monospace; letter-spacing: .25px; }
.row-actions { display: flex; align-items: center; gap: 5px; }
.row-action { width: 31px; height: 31px; display: grid; place-items: center; color: #7b8ba0; border: 1px solid #e0e6ed; border-radius: 7px; background: #fff; }
.row-action .icon { width: 15px; height: 15px; }
.row-action:hover { color: var(--primary); border-color: #bfdcd6; background: var(--primary-soft); }
.row-action.delete:hover { color: var(--danger); border-color: #f0c7cb; background: #fff2f3; }
.actions-column { width: 96px; text-align: center !important; }
.empty-state { min-height: 290px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: #96a2b2; }
.empty-state .icon { width: 34px; height: 34px; margin-bottom: 6px; color: #b4bfcb; }
.empty-state strong { color: #617188; font-size: 13px; }
.empty-state span { font-size: 11px; }
.pager { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 11px; }
.pager > div { display: flex; gap: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-field { display: block; }
.form-field.full { grid-column: 1 / -1; }
.form-field > span { display: block; margin-bottom: 8px; color: #4b5c72; font-size: 12px; font-weight: 600; }
.modal-footer { margin-top: 25px; padding-top: 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.modal-footer.centered { justify-content: center; }
.confirm-backdrop .modal { padding: 30px; text-align: center; }
.confirm-icon { width: 52px; height: 52px; margin: 0 auto 16px; display: grid; place-items: center; color: var(--danger); border-radius: 50%; background: #fff0f1; }
.confirm-icon .icon { width: 24px; height: 24px; }
.confirm-backdrop h2 { margin: 0; font-size: 19px; }
.confirm-backdrop p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.toast-region { position: fixed; top: 98px; right: 28px; z-index: 120; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { min-width: 240px; max-width: 380px; padding: 14px 16px; display: flex; align-items: center; gap: 10px; color: #fff; border-radius: 11px; background: #263c50; box-shadow: 0 12px 28px rgba(20, 40, 60, .2); font-size: 12px; animation: modal-in .2s ease-out; }
.toast.success { background: #087f73; }
.toast.error { background: #c6424d; }
.toast .icon { width: 17px; height: 17px; }
.toast.leaving { opacity: 0; transform: translateY(-5px); transition: .2s; }

.user-badge { min-width: 0; display: flex; align-items: center; gap: 9px; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: var(--primary); border-radius: 10px; background: var(--primary-soft); }
.user-avatar .icon { width: 17px; height: 17px; }
.user-badge strong, .user-badge small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-badge strong { font-size: 12px; }
.user-badge small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.logout-button { border: 1px solid var(--line); }
.manager-data-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.manager-summary-inline { flex: 1; color: var(--muted); font-size: 12px; }
.import-status { margin-bottom: 12px; padding: 11px 13px; color: #166d62; border: 1px solid #cbe8e2; border-radius: 9px; background: #edf9f6; font-size: 12px; line-height: 1.6; }
.user-modal { max-width: 900px; padding: 26px; }
.user-modal .modal-header p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.user-form-modal { max-width: 580px; }
.current-user-tag { display: inline-block; margin-left: 8px; padding: 2px 6px; color: var(--primary); border-radius: 5px; background: var(--primary-soft); font-size: 9px; vertical-align: middle; }

.auth-page { min-height: 100vh; background: #eef4f3; }
.auth-shell { width: min(1320px, calc(100% - 48px)); min-height: min(780px, calc(100vh - 48px)); margin: 24px auto; display: grid; grid-template-columns: 1.02fr .98fr; overflow: hidden; border: 1px solid rgba(255, 255, 255, .8); border-radius: 24px; background: #fff; box-shadow: 0 28px 80px rgba(25, 55, 53, .15); }
.auth-brand-panel { position: relative; padding: 46px 48px; display: flex; flex-direction: column; overflow: hidden; color: #fff; background: linear-gradient(145deg, #075e58 0%, #087f73 52%, #0b9a89 100%); }
.auth-brand-panel::before, .auth-brand-panel::after { content: ""; position: absolute; border: 1px solid rgba(255, 255, 255, .1); border-radius: 50%; pointer-events: none; }
.auth-brand-panel::before { width: 480px; height: 480px; right: -230px; bottom: -180px; box-shadow: 0 0 0 70px rgba(255, 255, 255, .025), 0 0 0 140px rgba(255, 255, 255, .02); }
.auth-brand-panel::after { width: 280px; height: 280px; left: -170px; top: 24%; box-shadow: 0 0 0 60px rgba(255, 255, 255, .025); }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.auth-brand .brand-mark { background: rgba(255, 255, 255, .16); box-shadow: none; }
.auth-brand strong { display: block; font-size: 20px; letter-spacing: .5px; }
.auth-brand small { display: block; margin-top: 4px; color: rgba(255, 255, 255, .65); font-size: 10px; letter-spacing: 2px; }
.auth-brand-copy { position: relative; z-index: 1; margin: auto 0; padding: 60px 0; }
.auth-eyebrow { color: #9be3d7; font-size: 10px; font-weight: 700; letter-spacing: 2.5px; }
.auth-brand-copy h1 { margin: 18px 0 22px; font-size: clamp(30px, 3.2vw, 45px); font-weight: 600; line-height: 1.45; letter-spacing: 1px; }
.auth-brand-copy p { max-width: 440px; margin: 0; color: rgba(255, 255, 255, .72); font-size: 13px; line-height: 2; }
.auth-feature-list { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 15px; }
.auth-feature-list span { display: flex; align-items: center; gap: 11px; color: rgba(255, 255, 255, .85); font-size: 12px; }
.auth-feature-list .icon { width: 18px; height: 18px; color: #9be3d7; }
.auth-brand-footer { position: relative; z-index: 1; margin-top: 42px; padding-top: 20px; color: rgba(255, 255, 255, .45); border-top: 1px solid rgba(255, 255, 255, .12); font-size: 10px; letter-spacing: 1px; }
.auth-main { padding: 44px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 100% 0, rgba(8, 127, 115, .07), transparent 38%), #fff; }
.auth-card { width: 100%; max-width: 500px; }
.auth-mobile-brand { display: none; }
.auth-card-heading h2 { margin: 10px 0 10px; font-size: 27px; letter-spacing: -.4px; }
.auth-card-heading p { margin: 0 0 30px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.auth-message { margin-bottom: 18px; padding: 11px 13px; color: #a7353f; border: 1px solid #f1ccd0; border-radius: 9px; background: #fff3f4; font-size: 12px; line-height: 1.65; }
.auth-message.success { color: #166d62; border-color: #cbe8e2; background: #edf9f6; }
.auth-message.info { color: #385b7c; border-color: #d4e1ed; background: #f1f7fb; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-form .form-field > span { font-size: 12px; }
.auth-password-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.captcha-field { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 14px; }
.captcha-image { display: flex; align-items: center; gap: 9px; }
.captcha-image img { width: 150px; height: 48px; display: block; border: 1px solid #dce4ea; border-radius: 9px; background: #f3f6f8; object-fit: cover; }
.captcha-image .text-button { white-space: nowrap; font-size: 11px; }
.auth-submit { width: 100%; min-height: 48px; margin-top: 3px; font-size: 14px; }
.auth-security-note { margin: 22px 0 0; color: #96a1af; font-size: 10px; line-height: 1.8; text-align: center; }

@media (max-width: 1100px) {
    .header-inner { padding: 0 24px; }
    .header-actions { gap: 10px; }
    .storage-badge { display: none; }
    .user-badge strong, .user-badge small { max-width: 100px; }
    .manager-toolbar { flex-wrap: wrap; }
    .manager-search { flex-basis: 100%; }
    .manager-data-actions { width: 100%; justify-content: flex-start; }
    .auth-shell { width: calc(100% - 32px); margin: 16px auto; }
    .auth-brand-panel { padding: 36px; }
    .auth-main { padding: 32px; }
    .app-layout { padding: 24px; grid-template-columns: 205px minmax(0, 1fr); gap: 20px; }
    .sidebar { padding: 20px 12px 14px; }
    .step { padding: 12px 8px; gap: 9px; }
    .wizard-panel { padding: 24px; }
    .template-grid { grid-template-columns: 1fr; }
    .template-card { min-height: 190px; }
    .template-icon { margin-bottom: 16px; }
    .template-description { max-width: 85%; }
    .company-layout { grid-template-columns: 1fr; }
    .company-preview { min-height: 190px; }
    .vendor-detail-grid { grid-template-columns: 1fr 1fr; }
    .form-area-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .header-inner { height: auto; min-height: 74px; padding: 15px 18px; flex-wrap: wrap; gap: 12px; }
    .header-actions { width: 100%; justify-content: flex-end; }
    .user-badge { display: none; }
    .manager-data-actions .button { flex: 1; padding: 0 9px; white-space: nowrap; }
    .manager-summary-inline { font-size: 11px; }
    .auth-shell { min-height: auto; grid-template-columns: 1fr; border-radius: 18px; }
    .auth-brand-panel { display: none; }
    .auth-main { padding: 28px 22px; }
    .auth-mobile-brand { display: block; margin-bottom: 22px; color: var(--primary); font-size: 15px; font-weight: 700; }
    .auth-card-heading h2 { font-size: 23px; }
    .auth-card-heading p { margin-bottom: 24px; }
    .captcha-field { grid-template-columns: 1fr; }
    .captcha-image { justify-content: space-between; }
    .brand-mark { width: 39px; height: 39px; }
    .brand strong { font-size: 16px; }
    .brand small { font-size: 9px; }
    .storage-badge { display: none; }
    .header-actions .button { min-height: 38px; padding: 0 11px; font-size: 11px; }
    .header-actions .count-badge { display: none; }
    .app-layout { padding: 18px 14px 25px; display: block; }
    .sidebar { position: static; margin-bottom: 18px; padding: 12px; }
    .sidebar-title, .sidebar-note { display: none; }
    .steps { flex-direction: row; justify-content: space-between; gap: 3px; }
    .step { padding: 5px; display: flex; flex-direction: column; gap: 5px; text-align: center; }
    .step-number { width: 29px; height: 29px; }
    .step strong { font-size: 9px; }
    .step small { display: none; }
    .content-heading { margin: 0 3px 17px; }
    .content-heading h1 { font-size: 22px; }
    .content-heading p { font-size: 11px; }
    .step-progress strong { font-size: 19px; }
    .wizard-panel { min-height: auto; padding: 20px 16px; }
    .panel-heading { margin-bottom: 22px; gap: 10px; }
    .heading-icon { width: 38px; height: 38px; }
    .panel-heading h2 { font-size: 16px; }
    .panel-heading p { font-size: 10px; }
    .heading-with-action { flex-wrap: wrap; }
    .heading-with-action .button { width: 100%; }
    .company-form { padding: 19px; }
    .vendor-search-grid { grid-template-columns: 1fr; gap: 15px; }
    .vendor-detail-grid { grid-template-columns: 1fr; gap: 12px; }
    .form-area-grid { grid-template-columns: 1fr; }
    .print-settings { align-items: flex-start; flex-direction: column; gap: 13px; }
    .range-control { width: 100%; }
    .range-control input { width: 100%; }
    .actionbar { bottom: 10px; padding: 11px; }
    .actionbar-hint { display: none; }
    .modal-backdrop { padding: 12px; }
    .modal { max-height: calc(100vh - 24px); }
    .supplier-modal, .form-modal { padding: 20px 16px; }
    .manager-toolbar { align-items: stretch; flex-direction: column; }
    .manager-summary > span:last-child { display: none; }
    .supplier-table th, .supplier-table td { padding: 11px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-field.full { grid-column: auto; }
    .toast-region { top: 82px; right: 14px; left: 14px; }
    .toast { min-width: 0; max-width: none; }
}

@media (max-width: 480px) {
    .auth-password-grid { grid-template-columns: 1fr; }
    .manager-data-actions .button { flex-basis: calc(50% - 4px); }
    .manager-data-actions .button-primary { flex-basis: 100%; }
}

@media print {
    @page { size: A4 landscape; margin: 10mm; }
    html, body { width: 100%; background: #fff; }
    body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .app-header, .sidebar, .content-heading, .wizard-panel, .actionbar, .modal-backdrop, .toast-region { display: none !important; }
    .app-layout, .main-content { display: block !important; max-width: none; margin: 0; padding: 0; }
    .preview-wrap { display: block !important; padding: 0; overflow: visible; background: #fff; }
    .page { width: 100%; min-height: auto; margin: 0; padding: 4mm 4mm 4mm calc(var(--page-left) - 10mm); box-shadow: none; }
}
