:root,
html[data-theme="teal"] {
    --erp-teal: #006666;
    --erp-teal-dark: #004d4d;
    --erp-sidebar: #0a7a75;
    --erp-sidebar-hover: #086660;
    --erp-active: #cc1f1f;
    --erp-label: #1558b0;
    --erp-stripe: #d6eaf8;
    --erp-bg: #ececec;
    --erp-line: #b9b9b9;
    --erp-font: "Noto Sans", Tahoma, sans-serif;
}

html[data-theme="navy"] {
    --erp-teal: #1b3a5f;
    --erp-teal-dark: #12263f;
    --erp-sidebar: #2b5282;
    --erp-sidebar-hover: #1f3f66;
    --erp-stripe: #d6e4f5;
}

html[data-theme="forest"] {
    --erp-teal: #2e5a27;
    --erp-teal-dark: #1f3d1b;
    --erp-sidebar: #3d7a34;
    --erp-sidebar-hover: #2d5c27;
    --erp-stripe: #dff0d8;
}

html[data-theme="maroon"] {
    --erp-teal: #6b1d2a;
    --erp-teal-dark: #4a141d;
    --erp-sidebar: #8a2c3b;
    --erp-sidebar-hover: #6b1d2a;
    --erp-stripe: #f3d6dc;
}

html[data-theme="slate"] {
    --erp-teal: #2f3e46;
    --erp-teal-dark: #1d272c;
    --erp-sidebar: #44555c;
    --erp-sidebar-hover: #334147;
    --erp-stripe: #dde3e6;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: var(--erp-bg);
    color: #222;
    font-family: var(--erp-font);
    font-size: 12px;
}

a { color: inherit; }

.erp-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 8px;
    background: var(--erp-teal);
    color: #fff;
    white-space: nowrap;
    overflow: visible;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.login-topbar { justify-content: flex-start; gap: 10px; }

.brand { font-weight: 700; letter-spacing: 0.4px; }
.brand-sub { opacity: 0.85; font-size: 11px; }

.menu-toggle, .dash-icon, .module-link {
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    font: inherit;
    padding: 0 5px;
}

.menu-toggle { display: flex; align-items: center; gap: 4px; }
.hamburger { font-size: 14px; }

.module-nav {
    display: flex;
    align-items: center;
    overflow-x: auto;
    flex: 1;
}

.module-link {
    white-space: nowrap;
}

.module-link.active {
    color: #ffe27a;
    font-weight: 700;
    text-decoration: underline;
}

.session-box {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 4px;
}

.session-photo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.session-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.session-menu {
    position: absolute;
    top: 28px;
    right: 0;
    z-index: 41;
    width: 280px;
    padding: 6px;
    background: var(--erp-bg);
    color: #222;
    border: 1px solid var(--erp-line);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    white-space: normal;
}

.session-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 8px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.session-item:hover,
.session-item.on {
    background: var(--erp-stripe);
}

.session-logout { color: var(--erp-active); }

.session-note {
    margin: 6px 0 0;
    padding: 5px 8px;
    background: #e8f6e8;
    border: 1px solid #9ccc9c;
}

.session-panel {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--erp-line);
}

.session-who { margin-bottom: 6px; font-weight: 600; }

.session-photo-edit {
    width: 72px;
    height: 84px;
    margin: 0 auto 4px;
}

.erp-app { height: 100%; display: flex; flex-direction: column; overflow: hidden; }

.erp-body { display: flex; flex: 1; min-height: 0; overflow: hidden; }

.erp-sidebar {
    width: 220px;
    background: var(--erp-sidebar);
    color: #fff;
    padding: 8px 6px;
    flex-shrink: 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.menu-search {
    width: 100%;
    height: 22px;
    border: 1px solid #0b4f4c;
    padding: 0 6px;
    margin-bottom: 8px;
    font: inherit;
}

.side-menus {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-anchor: none;
    overscroll-behavior: contain;
}

.side-link, .side-group, .side-folder {
    display: block;
    padding: 4px 6px;
    color: #fff;
    text-decoration: none;
}

.side-folder {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-top: 4px;
}

.side-folder:hover { background: var(--erp-sidebar-hover); }

.side-child { padding-left: 16px; }

.side-folder.side-nested { padding-left: 16px; }

.side-nested-child { padding-left: 28px; }

.side-group { font-weight: 700; opacity: 0.9; margin-top: 6px; }

.side-link:hover { background: var(--erp-sidebar-hover); }

.side-link.active {
    color: var(--erp-active);
    font-weight: 700;
    background: #e8f6f4;
}

.erp-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    background: #fff;
    padding: 8px 10px 16px;
    overflow: auto;
}

.erp-page {
    min-height: 0;
}

.page-head {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 8px;
    margin-bottom: 8px;
}

.page-head.stripe {
    background: repeating-linear-gradient(
        -45deg,
        var(--erp-stripe),
        var(--erp-stripe) 8px,
        #c5def3 8px,
        #c5def3 16px
    );
    border: 1px solid #9ec3e0;
}

.sub-tab {
    display: inline-block;
    background: var(--erp-teal);
    color: #fff;
    padding: 3px 10px;
    margin-bottom: 8px;
}

.sales-doc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.sales-doc-tab {
    border: 1px solid #7a9eb8;
    background: #e8f0f8;
    color: #1a3a52;
    padding: 5px 12px;
    font: inherit;
    cursor: pointer;
}

.sales-doc-tab:hover { background: #d4e6f5; }

.sales-doc-tab.active {
    background: var(--erp-teal);
    color: #fff;
    border-color: var(--erp-teal);
    font-weight: 700;
}

.sales-doc-tab .tab-count {
    display: inline-block;
    min-width: 18px;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.12);
    font-size: 11px;
    text-align: center;
}

.sales-doc-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
}

.erp-input, select.erp-input {
    height: 22px;
    border: 1px solid var(--erp-line);
    padding: 0 5px;
    font: inherit;
    background: #fff;
    width: 100%;
}

.erp-btn {
    height: 24px;
    min-width: 72px;
    border: 1px solid #7a7a7a;
    background: #d8d8d8;
    font: inherit;
    cursor: pointer;
}

.erp-btn.primary { background: #c5d8ea; }
.erp-btn:disabled { opacity: 0.55; cursor: default; }

.login-shell { min-height: 100vh; background: var(--erp-bg); }

.login-page {
    display: flex;
    justify-content: center;
    padding-top: 70px;
}

.login-card {
    width: 360px;
    background: #fff;
    border: 1px solid var(--erp-teal);
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.login-card-head {
    background: var(--erp-teal);
    color: #fff;
    padding: 10px 14px;
}

.login-card-head h1 { margin: 0; font-size: 18px; }
.login-card-head p { margin: 4px 0 0; font-size: 13px; }

.login-card { padding-bottom: 14px; }
.login-card .login-label,
.login-card .login-btn,
.login-card .login-hint,
.login-card .login-error { margin: 10px 14px 0; display: block; }

.login-label span { display: block; margin-bottom: 3px; }
.login-btn { width: calc(100% - 28px); height: 28px; }

.login-error {
    background: #fde8e8;
    color: #a40000;
    padding: 6px 8px;
    border: 1px solid #e4b4b4;
}

.login-warn {
    background: #fff6d6;
    color: #5c4a00;
    padding: 6px 8px;
    border: 1px solid #e0d08a;
    margin: 10px 14px 0;
}

.login-error-detail { margin-top: 4px; font-size: 11px; }
.login-hint { color: #555; }

.user-form { display: flex; gap: 16px; }
.user-form-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 18px;
}

.field {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 6px;
}

.att-form .field { grid-template-columns: 168px 1fr; }

.att-punch td .erp-input { min-width: 0; width: 100%; }
.att-punch .att-time { width: 92px; }
.att-punch .att-mins { width: 72px; }
.att-punch .att-status { width: 140px; }
.att-flow { color: #555; font-size: 13px; line-height: 1.5; margin: 4px 0 12px; }
.att-hist td { white-space: nowrap; }

.day-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.day-picks label {
    display: flex;
    align-items: center;
    gap: 4px;
    text-align: left;
    font-weight: 400;
    color: inherit;
}

.field label { text-align: right; color: #222; }
.field label.blue { color: var(--erp-label); font-weight: 600; }
.field label.green {
    color: #008000 !important;
    font-weight: 700;
}
.field.dual .dual-inputs { display: flex; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.line-picks {
    max-height: 140px;
    overflow: auto;
    border: 1px solid var(--erp-line);
    padding: 6px 8px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.line-picks .line-pick {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    font-weight: 400;
    color: inherit;
    cursor: pointer;
}
.scope-picks { max-height: 240px; }
.scope-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}
.erp-modal-back {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 36px 16px;
    overflow: auto;
}
.erp-modal {
    width: min(980px, 100%);
    max-height: calc(100vh - 72px);
    overflow: auto;
    background: var(--erp-bg);
    border: 1px solid var(--erp-teal);
    padding: 10px 14px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.erp-modal-wide { width: min(1100px, 100%); }
.line-items-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
}
.line-edit-wrap { overflow-x: auto; margin-bottom: 10px; }
.line-edit-table .erp-input.compact {
    min-width: 72px;
    width: 100%;
    padding: 2px 4px;
    font-size: 11px;
}
.line-edit-table .erp-input.num { min-width: 56px; max-width: 88px; }
.line-edit-table td.line-total,
.line-edit-table .invoice-total-value {
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}
.line-edit-table .invoice-total-label {
    text-align: right;
    font-weight: 700;
}
.section-label { font-weight: 700; margin: 0 0 8px; color: var(--erp-teal); }
.erp-area {
    min-height: 58px;
    width: 100%;
    border: 1px solid var(--erp-line);
    padding: 4px 5px;
    font: inherit;
    resize: vertical;
}
.logo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #888;
    background: #f3f3f3;
}
.erp-table tr.on { background: #d6eaf8; }
.priv-table { font-size: 12px; }
.priv-table th, .priv-table td { text-align: center; white-space: nowrap; }
.priv-table th:nth-child(1),
.priv-table td:nth-child(1),
.priv-table th:nth-child(2),
.priv-table td:nth-child(2),
.priv-table th:nth-child(3),
.priv-table td:nth-child(3),
.priv-table th:nth-child(4),
.priv-table td:nth-child(4) { text-align: left; }
.mm-layout { display: flex; gap: 10px; min-height: 480px; }
.mm-list {
    width: 220px;
    border: 1px solid var(--erp-line);
    background: #fff;
    overflow: auto;
    flex-shrink: 0;
}
.mm-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 6px 8px;
    font: inherit;
    cursor: pointer;
}
.mm-item b { display: block; color: var(--erp-teal); }
.mm-item span { display: block; font-size: 11px; }
.mm-item small { color: #008000; font-weight: 700; }
.mm-item.on, .mm-item:hover { background: #eef6f6; }
.mm-main { flex: 1; min-width: 0; }
.mm-flag { margin-right: 10px; }
.mm-child td:first-child { padding-left: 16px; }
.cms-block {
    border: 1px solid var(--erp-line);
    padding: 8px 10px;
    margin: 8px 0;
    background: #fff;
}
.cms-module { display: flex; align-items: center; gap: 8px; }
.cms-module b { color: var(--erp-teal); min-width: 48px; }
.cms-module small, .cms-menus small { color: #008000; font-weight: 700; margin-left: 6px; }
.cms-menus { margin: 6px 0 0 24px; display: grid; gap: 4px; }
.cms-group { font-weight: 700; margin-top: 6px; color: var(--erp-teal); }

.photo-box { width: 150px; flex-shrink: 0; }

.photo-frame {
    position: relative;
    display: block;
    width: 150px;
    height: 170px;
    border: 1px solid var(--erp-line);
    background: #f3f3f3;
    cursor: pointer;
    overflow: hidden;
}

.photo-frame input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #f3f3f3;
}

.photo-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

.header-photo {
    width: 22px;
    height: 22px;
    object-fit: cover;
    border: 1px solid var(--erp-teal-dark);
    background: #e8e8e8;
}

.table-photo {
    width: 28px;
    height: 32px;
    object-fit: cover;
    border: 1px solid #ccc;
    vertical-align: middle;
    background: #f3f3f3;
}

.click-row { cursor: pointer; }
.click-row:hover { background: #f3fafa; }

.pwd-meta { font-size: 11px; }
.pwd-strength.weak { color: #cc1f1f; }
.pwd-strength.medium { color: #c77700; }
.pwd-strength.strong { color: #1a7a2c; }
.hint { color: #666; margin-left: 6px; }

.action-bar { display: flex; gap: 6px; margin: 12px 0; align-items: center; }
.export-group { display: flex; align-items: center; gap: 6px; margin-left: 8px; }

.print-only { display: none; }
.hr-print-head { text-align: center; margin: 0 0 12px; color: #000; }
.hr-print-co { font-size: 16px; font-weight: 700; }
.hr-print-fac { font-size: 13px; margin-top: 2px; }
.hr-print-title { font-size: 15px; font-weight: 700; margin-top: 8px; text-decoration: underline; }
.hr-print-sub { font-size: 12px; margin-top: 4px; }
.hr-print-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 6px;
    border-top: 1px solid #999;
    font-size: 11px;
    color: #000;
}

.print-preview-bar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 40;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--erp-top, #1f4e5f);
    color: #fff;
}
.print-preview-bar span { font-weight: 700; margin-right: 8px; }

.doc-voucher { color: #000; font-size: 12px; }
.doc-voucher .doc-meta {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px 16px;
    margin: 0 0 10px;
}
.doc-voucher .doc-meta div { display: flex; gap: 6px; }
.doc-voucher .doc-meta span { min-width: 92px; color: #333; }
.doc-voucher .doc-meta b { font-weight: 700; }
.doc-voucher table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.doc-voucher th, .doc-voucher td {
    border: 1px solid #000;
    padding: 3px 5px;
    word-wrap: break-word;
}
.doc-voucher th { background: #eee; font-weight: 700; color: #000; }
.doc-voucher td { color: #000; }
.doc-voucher .num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.doc-voucher .doc-sign {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}
.doc-voucher .doc-sign div {
    flex: 1;
    text-align: center;
    font-size: 11px;
}
.doc-voucher .doc-sign .line {
    border-top: 1px solid #000;
    margin: 36px 8px 4px;
}

.erp-app.erp-print-preview .erp-topbar,
.erp-app.erp-print-preview .erp-sidebar { display: none !important; }
.erp-app.erp-print-preview .erp-body { display: block; overflow: visible; }
.erp-app.erp-print-preview .erp-main {
    padding: 16px 20px 40px;
    overflow-x: auto;
    overflow-y: visible;
    background: #c5c5c5;
}
.erp-app.erp-print-preview .hr-print-sheet,
.erp-app.erp-print-preview .ts-voucher,
.erp-app.erp-print-preview .cheque-print {
    width: 210mm;
    max-width: 210mm;
    box-sizing: border-box;
    overflow: hidden;
    margin: 12px auto 0;
    background: #fff;
    padding: 12mm 10mm;
    box-shadow: 0 1px 8px rgba(0,0,0,.28);
    color: #000;
}
.erp-app.erp-print-preview .hr-print-sheet.print-landscape {
    width: 297mm;
    max-width: 297mm;
    padding: 8mm 8mm;
}
.erp-app.erp-print-preview .hr-print-sheet .erp-table,
.erp-app.erp-print-preview .hr-print-sheet table {
    width: 100% !important;
    max-width: 100%;
    table-layout: fixed;
    font-size: 8px;
}
.erp-app.erp-print-preview .hr-print-sheet .erp-table th,
.erp-app.erp-print-preview .hr-print-sheet .erp-table td,
.erp-app.erp-print-preview .hr-print-sheet table th,
.erp-app.erp-print-preview .hr-print-sheet table td {
    padding: 2px 3px;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.erp-app.erp-print-preview .doc-voucher,
.erp-app.erp-print-preview .doc-voucher table {
    font-size: 12px !important;
    table-layout: fixed;
}
.erp-app.erp-print-preview .doc-voucher th,
.erp-app.erp-print-preview .doc-voucher td {
    color: #000 !important;
    font-size: 12px !important;
    padding: 4px 6px !important;
}
.erp-app.erp-print-preview .doc-voucher .num {
    font-size: 13px !important;
    font-weight: 700 !important;
}
.erp-app.erp-print-preview .print-only { display: block !important; }
.erp-app.erp-print-preview .hr-print-foot { display: flex !important; }
.erp-app.erp-print-preview .no-print { display: none !important; }
.erp-app.erp-print-preview .print-preview-bar.no-print { display: flex !important; }
.erp-app.erp-print-preview .ts-screen { display: none !important; }
.erp-app.erp-print-preview .ts-voucher { display: block !important; }
.erp-app.erp-print-preview .cheque-print { display: block !important; }
.erp-app.erp-print-preview input.erp-input,
.erp-app.erp-print-preview select.erp-input {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
    padding: 0;
    min-width: 0;
}

@media print {
    html, body, .erp-app { height: auto; overflow: visible; }
    .erp-topbar, .erp-sidebar, .no-print, #blazor-error-ui { display: none !important; }
    .print-only { display: block !important; }
    .hr-print-foot { display: flex !important; }
    .erp-body { display: block; overflow: visible; }
    .erp-main { padding: 0; overflow: visible; background: #fff; }
    .ts-screen { display: none !important; }
    .ts-voucher { display: block !important; color: #000; }
    .cheque-print { display: block !important; }
    .erp-table th { background: #eee !important; color: #000 !important; }
    .hr-print-sheet, .ts-voucher, .cheque-print, .doc-voucher {
        max-width: none;
        width: auto;
        margin: 0;
        padding: 0;
        box-shadow: none;
        overflow: hidden;
    }
    .hr-print-sheet .erp-table,
    .hr-print-sheet table {
        width: 100% !important;
        max-width: 100%;
        table-layout: fixed;
        font-size: 8px;
    }
    .hr-print-sheet .erp-table th,
    .hr-print-sheet .erp-table td,
    .hr-print-sheet table th,
    .hr-print-sheet table td {
        padding: 2px 3px;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    .doc-voucher,
    .doc-voucher table {
        font-size: 12px !important;
    }
    .doc-voucher th,
    .doc-voucher td {
        color: #000 !important;
        font-size: 12px !important;
        padding: 4px 6px !important;
    }
    .doc-voucher .num {
        font-size: 13px !important;
        font-weight: 700 !important;
    }
    .print-landscape { page: land; }
    input.erp-input, select.erp-input {
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        appearance: none;
        -webkit-appearance: none;
        padding: 0;
    }
    @page { size: A4 portrait; margin: 10mm; }
    @page land { size: A4 landscape; margin: 8mm; }
}

@media (max-width: 1000px) {
    .ts-auth { grid-template-columns: 1fr; }
}
.form-banner { background: #e8f6e8; border: 1px solid #9ccc9c; padding: 5px 8px; margin-bottom: 8px; }

.erp-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.erp-table th, .erp-table td { border: 1px solid #cfcfcf; padding: 4px 6px; text-align: left; }
.erp-table th { background: #e6f2f2; }

.job-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.job-col .field { grid-template-columns: 110px 1fr; margin-bottom: 5px; }
.mini-actions { display: flex; gap: 4px; margin: 8px 0 0 110px; }
.mini-actions .erp-btn { min-width: 0; padding: 0 6px; }

.summary-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #d6eaf8;
    padding: 6px;
    border: 1px solid #9ec3e0;
}

.erp-input.mini { width: 90px; }
.coming-note { color: #555; margin-top: 12px; }

.home-welcome { margin: 8px 0 14px; }
.role-line { color: var(--erp-teal-dark); }
.dash { display: grid; grid-template-columns: 1fr 280px; gap: 14px; align-items: start; }
.dash-chart-box {
    background: #fff;
    border: 1px solid var(--erp-line);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.dash-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.dash-legend { display: flex; align-items: center; gap: 10px; font-size: 11px; color: #555; }
.dash-legend i, .lg-swatch { display: inline-block; width: 12px; height: 10px; border-radius: 2px; }
.s-a { background: var(--erp-teal); }
.s-b { background: color-mix(in srgb, var(--erp-teal) 40%, #fff); border: 1px solid var(--erp-teal); }
.s-c { background: var(--erp-label); }
.s-d { background: color-mix(in srgb, var(--erp-teal-dark) 70%, #fff); }
.dash-plot { display: flex; gap: 8px; height: 260px; }
.dash-y {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 36px;
    font-size: 10px;
    color: #666;
    text-align: right;
}
.dash-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    border-left: 1px solid var(--erp-line);
    border-bottom: 1px solid var(--erp-line);
    background: repeating-linear-gradient(to top, transparent, transparent 31px, #eee 32px);
    padding: 0 8px 0;
}
.dash-col { flex: 1; text-align: center; }
.dash-pair {
    height: 230px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
}
.dash-pair .bar {
    width: 14px;
    min-height: 0;
    border-radius: 3px 3px 0 0;
}
.dash-pair .bar.s-a { background: var(--erp-teal); }
.dash-pair .bar.s-b { background: color-mix(in srgb, var(--erp-teal) 40%, #fff); border: 1px solid var(--erp-teal); }
.dash-line-box { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dash-line-box svg {
    flex: 1;
    width: 100%;
    border-left: 1px solid var(--erp-line);
    border-bottom: 1px solid var(--erp-line);
    background: repeating-linear-gradient(to top, transparent, transparent 31px, #eee 32px);
}
.dash-line-box polyline { fill: none; stroke-width: 2; }
.dash-line-box polyline.s-a { stroke: var(--erp-teal); }
.dash-line-box polyline.s-b { stroke: var(--erp-label); }
.dash-line-labels { display: flex; justify-content: space-between; font-size: 10px; margin-top: 4px; }
.dash-pie-wrap { display: flex; align-items: center; gap: 24px; padding: 16px 8px; }
.dash-pie { width: 160px; height: 160px; transform: rotate(-90deg); }
.dash-pie circle { fill: none; stroke-width: 8; }
.dash-pie circle.s-a { stroke: var(--erp-teal); }
.dash-pie circle.s-b { stroke: color-mix(in srgb, var(--erp-teal) 40%, #fff); }
.dash-pie circle.s-c { stroke: var(--erp-label); }
.dash-pie circle.s-d { stroke: var(--erp-teal-dark); }
.dash-pie-list { list-style: none; margin: 0; padding: 0; }
.dash-pie-list li { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.dash-col small { display: block; margin-top: 4px; font-size: 10px; }
.dash-table { margin-top: 10px; font-size: 11px; }
.dash-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.dash-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 20px rgba(0,0,0,.12);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    min-height: 96px;
}
.dash-tile:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 12px 28px rgba(0,0,0,.16);
    transform: translateY(-1px);
}
.dash-tile.on { border-color: var(--erp-teal); box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 10px 24px rgba(0,0,0,.14), 0 0 0 1px var(--erp-teal); }
.dash-tile span { font-size: 11px; font-weight: 600; color: var(--erp-teal-dark); }
.dash-mini { height: 42px; display: flex; align-items: flex-end; gap: 3px; }
.dash-mini.bars span {
    flex: 1;
    background: var(--erp-teal);
    border-radius: 2px 2px 0 0;
    opacity: .85;
}
.dash-mini.bars span:nth-child(1) { height: 40%; }
.dash-mini.bars span:nth-child(2) { height: 70%; }
.dash-mini.bars span:nth-child(3) { height: 55%; }
.dash-mini.bars span:nth-child(4) { height: 90%; }
.dash-mini.bars span:nth-child(5) { height: 60%; }
.dash-mini svg { width: 100%; height: 42px; }
.dash-mini.line polyline {
    fill: none;
    stroke: var(--erp-teal);
    stroke-width: 2;
}
.dash-mini.area polygon { fill: color-mix(in srgb, var(--erp-teal) 35%, #fff); stroke: var(--erp-teal); }
.dash-mini.pie .pie-a { fill: none; stroke: var(--erp-teal); stroke-width: 8; stroke-dasharray: 50 88; }
.dash-mini.pie .pie-b { fill: none; stroke: color-mix(in srgb, var(--erp-teal) 35%, #fff); stroke-width: 8; stroke-dasharray: 38 88; stroke-dashoffset: -50; }
@media (max-width: 1000px) {
    .dash { grid-template-columns: 1fr; }
}
.home-cards { display: flex; gap: 12px; }
.home-card {
    width: 220px;
    border: 1px solid var(--erp-teal);
    padding: 10px;
    text-decoration: none;
    background: #f4fbfb;
}
.home-card span { color: var(--erp-teal); font-weight: 700; }
.home-card strong { display: block; margin: 4px 0; }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.theme-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.theme-card {
    width: 150px;
    border: 1px solid var(--erp-line);
    background: #fff;
    padding: 8px;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.theme-card.selected { border-color: var(--erp-teal); box-shadow: 0 0 0 1px var(--erp-teal); }

.theme-preview {
    display: flex;
    height: 42px;
    margin-bottom: 6px;
    border: 1px solid #ddd;
}

.theme-bar { flex: 3; }
.theme-side { flex: 1; }

.theme-card small { display: block; color: var(--erp-teal); }

.coa-layout { display: flex; gap: 10px; min-height: 520px; }
.coa-tree {
    width: 260px;
    border: 1px solid var(--erp-line);
    background: #fff;
    overflow: auto;
    padding: 6px 0;
    flex-shrink: 0;
}
.tree-group, .tree-sub, .tree-type { padding: 3px 8px; cursor: pointer; }
.tree-sub { padding-left: 18px; }
.tree-type { padding-left: 32px; }
.tree-type.on, .coa-grid tr.on { background: #d6eaf8; }
.tree-type:hover, .tree-group:hover, .tree-sub:hover { background: #eef6f6; }
.coa-main { flex: 1; min-width: 0; }
.cw-top { display: flex; gap: 10px; min-height: 360px; }
.cw-assign {
    flex: 1;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cw-pick {
    height: 220px;
    overflow: auto;
    border: 1px solid var(--erp-line);
    background: #fff;
}
.cw-acc {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 4px 8px;
    font: inherit;
    cursor: pointer;
}
.cw-acc.on, .cw-acc:hover { background: #d6eaf8; }
.ts-head {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px 16px;
    margin-bottom: 8px;
}
.ts-grid input, .ts-grid select { min-width: 0; }
.ts-grid tfoot td { font-weight: 700; }
.acc-cell { position: relative; }
.acc-list {
    position: absolute;
    z-index: 5;
    left: 0;
    right: 0;
    max-height: 180px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--erp-line);
}
.acc-list button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: #fff;
    padding: 4px 8px;
    font: inherit;
    cursor: pointer;
}
.acc-list button.on,
.acc-list button:hover { background: #d6eaf8; }
.ts-voucher { display: none; }
.ts-voucher .v-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}
.ts-voucher .v-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
}
.ts-voucher .v-brand { flex: 1; text-align: center; }
.ts-voucher .v-company { font-size: 20px; font-weight: 700; letter-spacing: 0.3px; }
.ts-voucher .v-addr { font-size: 12px; margin-top: 2px; }
.ts-voucher .v-title {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 18px;
    border: 1px solid #000;
    font-weight: 700;
}
.ts-voucher .v-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 10px 0;
    align-items: flex-start;
}
.ts-voucher .v-amt table { border-collapse: collapse; font-size: 12px; }
.ts-voucher .v-amt th,
.ts-voucher .v-amt td { border: 1px solid #000; padding: 2px 8px; }
.ts-voucher .v-amt .num,
.ts-voucher .v-grid .num { text-align: right; }
.ts-voucher .v-chq { margin-top: 8px; font-size: 12px; display: flex; align-items: center; gap: 8px; }
.ts-voucher .v-chq .box {
    min-width: 90px;
    min-height: 18px;
    border: 1px solid #000;
    padding: 0 6px;
}
.ts-voucher .v-chq .line { min-width: 90px; border-bottom: 1px solid #000; min-height: 16px; }
.ts-voucher .v-ids { font-size: 12px; min-width: 220px; }
.ts-voucher .v-ids div { display: flex; gap: 8px; margin: 2px 0; }
.ts-voucher .v-ids span { width: 70px; }
.ts-voucher .v-grid { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.ts-voucher .v-grid th,
.ts-voucher .v-grid td { border: 1px solid #000; padding: 3px 6px; }
.ts-voucher .v-grid tfoot td { font-weight: 700; border-bottom: 3px double #000; }
.ts-voucher .v-words { margin: 10px 0 18px; font-size: 12px; font-weight: 700; }
.ts-voucher .v-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-top: 28px;
}
.ts-voucher .v-sign { flex: 1; text-align: center; font-size: 11px; }
.ts-voucher .v-sign .who { min-height: 16px; font-weight: 700; }
.ts-voucher .v-sign .line { border-top: 1px solid #000; margin: 28px 8px 4px; }
.ts-voucher .v-qr {
    width: 72px;
    height: 72px;
    border: 1px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ts-voucher .v-qr img { width: 68px; height: 68px; }
.track-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.track-actions { display: flex; flex-direction: column; gap: 6px; }
.track-grid thead th { background: var(--erp-teal); color: #fff; }
.track-grid td.chk { text-align: center; }
.track-grid input[type="checkbox"] { accent-color: var(--erp-teal); }
.chq-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 12px; align-items: start; }
.chq-ts { max-height: 420px; overflow: auto; border: 1px solid var(--erp-line); background: #fff; margin: 8px 0; }
.cheque-print { display: none; }
.cheque-slip {
    position: relative;
    width: 190mm;
    height: 82mm;
    page-break-after: always;
    font-family: "Times New Roman", serif;
    color: #000;
}
.cheque-slip .cq-date { position: absolute; top: 12mm; right: 18mm; letter-spacing: 2px; }
.cheque-slip .cq-no { position: absolute; top: 8mm; left: 18mm; font-weight: 700; }
.cheque-slip .cq-payee { position: absolute; top: 28mm; left: 32mm; width: 120mm; }
.cheque-slip .cq-words { position: absolute; top: 40mm; left: 18mm; width: 125mm; font-size: 12px; }
.cheque-slip .cq-amt { position: absolute; top: 38mm; right: 16mm; font-weight: 700; }
.cheque-slip .cq-bank { position: absolute; bottom: 10mm; left: 18mm; font-size: 11px; }
.ts-auth { display: grid; grid-template-columns: 300px 1fr; gap: 12px; align-items: start; }
.ts-auth-list { max-height: 560px; overflow: auto; }
.ts-attach { margin: 16px 0; }
label.erp-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; }
label.erp-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
label.erp-btn.is-off { opacity: 0.55; pointer-events: none; }
.cw-arrows { display: flex; gap: 8px; justify-content: center; }
.cw-arrows .erp-btn { min-width: 42px; font-size: 16px; }
.tree-group.on { background: #d6eaf8; }
.coa-form { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.coa-grid thead th { background: var(--erp-teal); color: #fff; }
.exit-btn { color: #c00; }
.ctx-back { position: fixed; inset: 0; z-index: 20; }
.ctx-menu {
    position: fixed;
    z-index: 21;
    background: #fff;
    border: 1px solid var(--erp-line);
    min-width: 160px;
}
.ctx-menu button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: #fff;
    padding: 5px 10px;
    font: inherit;
    cursor: pointer;
}
.ctx-menu button:hover { background: #d6eaf8; }
.rename-box {
    position: fixed;
    z-index: 22;
    left: 50%;
    top: 30%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid var(--erp-teal);
    padding: 12px;
    width: 320px;
}

.portal-title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tenant-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}
.tenant-selector label {
    font-size: 11px;
    opacity: 0.9;
    white-space: nowrap;
}
.tenant-select {
    width: auto !important;
    min-width: 160px;
    max-width: 220px;
    height: 22px;
    font-size: 11px;
    color: #222;
}
.tenant-badge { background: rgba(255,255,255,.15); padding: 2px 8px; border-radius: 2px; }
.header-photo {
    width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--erp-teal);
    display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
}
.header-photo-img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.photo-frame { position: relative; display: block; cursor: pointer; }
.photo-frame input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.profile-photo { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--erp-line); display: block; margin: 0 auto; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat-grid-6 { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.stat-card { border: 1px solid var(--erp-line); padding: 10px; background: #fff; border-radius: 4px; }
.stat-card span { display: block; color: #666; margin-bottom: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; }
.stat-card strong { font-size: 22px; }
.stat-card.ok strong { color: #1a7a1a; }
.stat-card.warn strong { color: #a67c00; }
.stat-card.bad strong { color: #a40000; }
.stat-card.receipt { border-left: 3px solid #5b9bd5; }
.stat-card.receipt strong { color: #1a5276; }
.stat-card.consolidated { border-left: 3px solid #8e44ad; }
.stat-card.consolidated strong { color: #6c3483; }

.dashboard-filters { margin-bottom: 14px; }

.sales-doc-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.sales-doc-stat {
    border: 1px solid var(--erp-line);
    background: #fff;
    border-radius: 4px;
    padding: 8px 10px;
}

.sales-doc-stat span {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #666;
    margin-bottom: 2px;
}

.sales-doc-stat strong { font-size: 20px; color: #1a3a52; }
.sales-doc-stat.ok strong { color: #1a7a1a; }
.sales-doc-stat.warn strong { color: #a67c00; }
.sales-doc-stat.bad strong { color: #a40000; }
.sales-doc-stat.draft strong { color: #555; }
.sales-doc-stat.receipt { border-left: 3px solid #5b9bd5; }
.sales-doc-stat.receipt strong { color: #1a5276; }
.sales-doc-stat.consolidated { border-left: 3px solid #8e44ad; }
.sales-doc-stat.consolidated strong { color: #6c3483; }

.generate-dropdown { position: relative; display: inline-block; }

.generate-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 40;
    min-width: 240px;
    margin-top: 4px;
    border: 1px solid var(--erp-line);
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    border-radius: 4px;
    padding: 4px 0;
}

.generate-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: none;
    font-size: 13px;
    color: #1a3a52;
    text-decoration: none;
    cursor: pointer;
}

.generate-menu-item:hover:not(:disabled) { background: #f0f6fa; }
.generate-menu-item:disabled { color: #999; cursor: not-allowed; }

.pager-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.pager-actions { display: flex; gap: 6px; }

.alert-panel {
    border: 1px solid #e8c872;
    background: #fffbf0;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.alert-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.alert-panel-head a {
    font-size: 12px;
    font-weight: 600;
    color: #006666;
    text-decoration: none;
}

.alert-panel-head a:hover { text-decoration: underline; }

.hint-inline { font-weight: normal; font-size: 12px; color: #666; }

.report-table td.num,
.report-table th.num,
.report-table td.num-ok { text-align: right; }
.report-table td.num-ok { color: #1a7a1a; }
.report-table td.num-warn { text-align: right; color: #a67c00; }
.report-table td.num-bad { text-align: right; color: #a40000; }
.report-total-row td { background: #f4f7fa; border-top: 2px solid #c5d4e3; }

.mis-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.mis-chart-panel {
    border: 1px solid #c5d4e3;
    background: #fff;
    border-radius: 4px;
    padding: 12px 14px;
}

.mis-chart-panel-wide { grid-column: 1 / -1; }

.mis-chart-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a3a52;
    margin-bottom: 2px;
}

.mis-chart-sub {
    font-size: 11px;
    color: #667;
    margin-bottom: 10px;
}

.mis-chart-empty {
    font-size: 12px;
    color: #888;
    padding: 16px 0;
    text-align: center;
}

.mis-hbar-row {
    display: grid;
    grid-template-columns: 110px 1fr 52px;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12px;
}

.mis-hbar-label { color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mis-hbar-val { text-align: right; font-weight: 600; color: #1a3a52; font-variant-numeric: tabular-nums; }

.mis-hbar-track {
    height: 18px;
    background: #eef3f8;
    border: 1px solid #d8e4ef;
    border-radius: 2px;
    overflow: hidden;
}

.mis-hbar-fill {
    height: 100%;
    min-width: 2px;
    border-radius: 1px;
    transition: width .3s ease;
}

.mis-hbar-fill.ok { background: linear-gradient(90deg, #2e8b57, #3cb371); }
.mis-hbar-fill.warn { background: linear-gradient(90deg, #c9a227, #e6c04a); }
.mis-hbar-fill.bad { background: linear-gradient(90deg, #b22222, #dc3545); }
.mis-hbar-fill.draft { background: linear-gradient(90deg, #6c757d, #95a5a6); }
.mis-hbar-fill.receipt { background: linear-gradient(90deg, #2980b9, #5dade2); }
.mis-hbar-fill.consolidated { background: linear-gradient(90deg, #7d3c98, #a569bd); }
.mis-hbar-fill.cancelled { background: linear-gradient(90deg, #566573, #839192); }
.mis-hbar-fill.loc { background: linear-gradient(90deg, #006666, #008080); }

.mis-vbar-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    min-height: 160px;
    padding-top: 8px;
    border-bottom: 2px solid #c5d4e3;
}

.mis-vbar-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mis-vbar-amt {
    font-size: 9px;
    color: #006666;
    font-weight: 600;
    white-space: nowrap;
}

.mis-vbar-bar {
    width: 100%;
    max-width: 36px;
    height: 100px;
    display: flex;
    align-items: flex-end;
    background: #f4f8fb;
    border: 1px solid #d8e4ef;
    border-radius: 2px 2px 0 0;
}

.mis-vbar-fill {
    width: 100%;
    background: linear-gradient(180deg, #008080, #006666);
    border-radius: 1px 1px 0 0;
    min-height: 2px;
}

.mis-vbar-label {
    font-size: 9px;
    color: #666;
    text-align: center;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .mis-chart-grid { grid-template-columns: 1fr; }
    .mis-hbar-row { grid-template-columns: 90px 1fr 48px; }
    .mis-report-split { grid-template-columns: 1fr; }
}

/* MIS Reports — side-by-side table + chart */
.mis-report-section { margin-bottom: 20px; }

.mis-report-split {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.9fr);
    gap: 14px;
    align-items: start;
}

.mis-report-table-col { min-width: 0; overflow-x: auto; }

.mis-report-chart-col {
    border: 1px solid #c5d4e3;
    background: linear-gradient(180deg, #fafcfd 0%, #fff 100%);
    border-radius: 6px;
    padding: 12px 14px;
    position: sticky;
    top: 8px;
}

.mis-side-chart-panel .mis-chart-title:first-child { margin-top: 0; }

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

.mis-kpi {
    border: 1px solid var(--erp-line);
    background: #fff;
    border-radius: 4px;
    padding: 10px 12px;
}

.mis-kpi span {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #666;
    margin-bottom: 4px;
}

.mis-kpi strong { font-size: 20px; color: #1a3a52; }
.mis-kpi.ok strong { color: #1a7a1a; }
.mis-kpi.bad strong { color: #a40000; }
.mis-kpi.amount strong { font-size: 16px; color: #006666; }

.mis-donut-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #c5d4e3;
    background: #fff;
    border-radius: 6px;
}

.mis-donut {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

.mis-donut-hole {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.mis-donut-hole strong { font-size: 22px; color: #1a3a52; line-height: 1; }
.mis-donut-hole span { font-size: 10px; color: #888; text-transform: uppercase; }

.mis-donut-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 6px 16px;
    flex: 1;
    min-width: 200px;
}

.mis-donut-legend li {
    font-size: 12px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mis-donut-legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
    display: inline-block;
}

.mis-donut-legend .dot.ok { background: #2e8b57; }
.mis-donut-legend .dot.warn { background: #c9a227; }
.mis-donut-legend .dot.bad { background: #b22222; }
.mis-donut-legend .dot.draft { background: #6c757d; }
.mis-donut-legend .dot.receipt { background: #2980b9; }
.mis-donut-legend .dot.consolidated { background: #7d3c98; }
.mis-donut-legend .dot.cancelled { background: #839192; }

.mis-vbar-chart-compact { min-height: 120px; }
.mis-vbar-chart-compact .mis-vbar-bar { height: 80px; max-width: 28px; }

.mis-stack-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    min-height: 100px;
    padding-top: 4px;
    border-bottom: 2px solid #d8e4ef;
}

.mis-stack-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.mis-stack-bar {
    width: 100%;
    max-width: 22px;
    height: 88px;
    display: flex;
    flex-direction: column-reverse;
    border: 1px solid #d8e4ef;
    border-radius: 2px 2px 0 0;
    overflow: hidden;
    background: #f4f8fb;
}

.mis-stack-seg { min-height: 2px; }
.mis-stack-seg.ok { background: #2e8b57; }
.mis-stack-seg.warn { background: #c9a227; }
.mis-stack-seg.bad { background: #b22222; }
.mis-stack-seg.receipt { background: #2980b9; }
.mis-stack-seg.draft { background: #6c757d; }

.mis-mini-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    font-size: 10px;
    color: #666;
}

.mis-mini-legend .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 3px;
    vertical-align: middle;
}

.mis-mini-legend .dot.ok { background: #2e8b57; }
.mis-mini-legend .dot.warn { background: #c9a227; }
.mis-mini-legend .dot.bad { background: #b22222; }
.mis-mini-legend .dot.receipt { background: #2980b9; }

.info-box { border: 1px solid #9ec3e0; background: var(--erp-stripe); padding: 8px 10px; margin-bottom: 10px; }
.dev-code {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 10px 12px;
    overflow-x: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    border: 1px solid #555;
    margin: 8px 0 14px;
    white-space: pre-wrap;
    line-height: 1.45;
}
.dev-sample-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.api-ref-table th { width: 140px; text-align: left; vertical-align: top; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 10px; max-width: 900px; }
.form-grid .field.wide { grid-column: 1 / -1; }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.filter-row .erp-input { width: auto; min-width: 120px; }
.upload-box { border: 2px dashed var(--erp-teal); padding: 24px; text-align: center; margin: 10px 0; background: #fafafa; }
.erp-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.erp-table th, .erp-table td { border: 1px solid var(--erp-line); padding: 4px 6px; text-align: left; }
.erp-table th { background: var(--erp-stripe); }
.bad-row { background: #fde8e8; }
.error-cell { color: #a40000; font-size: 11px; max-width: 280px; word-break: break-word; }
.status-validated { color: #1a7a1a; font-weight: 700; }
.status-rejected { color: #a40000; font-weight: 700; }
.status-pending { color: #a67c00; font-weight: 700; }
.status-receipt { color: #0066aa; font-weight: 700; }
.status-consolidated { color: #555; font-weight: 700; }
.hint { color: #555; margin: 4px 0 8px; }
.tier-field-table { max-width: 100%; margin-bottom: 10px; }
.tier-columns-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 12px;
    max-width: 980px;
}
.tier-col-head {
    font-weight: 700;
    padding: 4px 8px;
    margin-bottom: 4px;
}
.mandatory-col .tier-col-head { background: #5B9BD5; color: #fff; border: 1px solid #1F4E79; }
.mandatory-col .tier-field-table thead th { background: #5B9BD5; color: #fff; }
.optional-col .tier-col-head { background: #D9D9D9; color: #333; border: 1px solid #b0b0b0; }
.th-mandatory { background: #5B9BD5 !important; color: #fff !important; }
.th-optional { background: #D9D9D9 !important; color: #333 !important; }
@media (max-width: 900px) {
    .tier-columns-layout { grid-template-columns: 1fr; }
}
.tag-required { background: #fde8e8; color: #a40000; padding: 1px 6px; font-weight: 600; }
.tag-optional { background: #fff6d6; color: #5c4a00; padding: 1px 6px; font-weight: 600; }

.settings-legend {
    max-width: 900px;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: #f8fbff;
    border: 1px solid #9ec3e0;
}
.settings-legend ul {
    margin: 6px 0 0;
    padding-left: 18px;
}
.settings-legend li { margin: 4px 0; line-height: 1.45; }
.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.legend-dot.mandatory { background: #008000; }
.legend-dot.conditional { background: #c77700; }
.legend-dot.optional { background: #888; }

.req-star { color: #cc1f1f; font-weight: 700; margin-left: 2px; }
.field label.conditional {
    color: #a67c00 !important;
    font-weight: 700;
}
.field label.optional {
    color: #666 !important;
    font-weight: 400;
}
.field label.green.inline-label {
    display: inline;
    text-align: left;
}
.lhdn-hint { max-width: 900px; margin-bottom: 8px; }

.settings-form .field {
    grid-template-columns: 168px 1fr;
    align-items: start;
}
.settings-form .field label { padding-top: 3px; }
.field-invalid .erp-input,
.field-invalid select.erp-input {
    border-color: #cc1f1f;
    background: #fff8f8;
}
.field-hint-text {
    display: block;
    grid-column: 2;
    margin-top: 2px;
    color: #666;
    font-size: 10px;
    line-height: 1.35;
}
.field-error-text {
    display: block;
    grid-column: 2;
    margin-top: 2px;
    color: #a40000;
    font-size: 10px;
    font-weight: 600;
}
.field-with-btn {
    display: flex;
    gap: 6px;
    align-items: center;
}
.field-with-btn .erp-input { flex: 1; }

.upload-mode-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    max-width: 900px;
}
.upload-mode-option {
    flex: 1 1 280px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 2px solid #c8d4e0;
    border-radius: 6px;
    background: #f8fafc;
    cursor: pointer;
}
.upload-mode-option.active {
    border-color: #5b9bd5;
    background: #eef5fc;
}
.upload-mode-option input { margin-bottom: 4px; }
.upload-mode-option strong { font-size: 13px; color: #1a3a5c; }
.upload-mode-option span { font-size: 11px; color: #555; line-height: 1.35; }

.erp-table th.actions-col,
.erp-table td.action-cell {
    width: 1%;
    min-width: 96px;
    vertical-align: top;
}

.action-cell {
    position: relative;
    white-space: nowrap;
}

.action-dropdown {
    position: relative;
    display: inline-block;
}

.action-menu-btn {
    min-width: 88px;
}

.action-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 2px);
    z-index: 30;
    min-width: 190px;
    background: #fff;
    border: 1px solid #c5d4e3;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    padding: 4px 0;
}

.action-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    padding: 7px 12px;
    font-size: 12px;
    color: #1a3a5c;
    text-decoration: none;
    cursor: pointer;
}

.action-menu-item:hover {
    background: #eef5fc;
}

.action-menu-item.danger {
    color: #b00020;
}

.bulk-count {
    font-size: 12px;
    color: #555;
    align-self: center;
    margin-right: 4px;
}

.bulk-results {
    margin-top: 14px;
    padding: 10px;
    border: 1px solid #d8e3ef;
    background: #fafcff;
}

.erp-table.compact td,
.erp-table.compact th {
    padding: 4px 8px;
    font-size: 12px;
}

.status-deleted { color: #888; font-style: italic; }

.action-menu-divider {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #888;
    padding: 6px 12px 4px;
    border-top: 1px solid #e8edf2;
    margin-top: 4px;
}

.action-menu-item.subtle {
    font-size: 11px;
    color: #456;
    padding-left: 18px;
}

.print-design-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin: 12px 0 20px;
}

.print-design-card {
    border: 2px solid #d8e3ef;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}

.print-design-card:hover {
    border-color: #5b9bd5;
    box-shadow: 0 4px 12px rgba(0, 80, 120, .08);
}

.print-design-card.selected {
    border-color: #006666;
    box-shadow: 0 0 0 1px #006666;
}

.print-design-preview {
    height: 120px;
    background: #f4f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.print-design-meta {
    padding: 10px 12px 12px;
}

.print-design-name {
    font-weight: 700;
    font-size: 13px;
    color: #1a3a5c;
    display: flex;
    align-items: center;
    gap: 6px;
}

.print-design-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    background: #006666;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
}

.print-design-desc {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    line-height: 1.35;
}

.print-design-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    color: #006666;
    font-weight: 600;
    text-decoration: none;
}

.print-design-link:hover { text-decoration: underline; }

.print-preview {
    width: 140px;
    height: 90px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg, #fff);
    border: 1px solid #ccc;
    position: relative;
}

.print-preview.classic-teal .pv-head {
    height: 18px;
    background: var(--accent, #006666);
    opacity: .15;
}

.print-preview.classic-teal .pv-body {
    display: flex;
    gap: 6px;
    padding: 6px;
}

.print-preview.classic-teal .pv-left,
.print-preview.classic-teal .pv-right {
    flex: 1;
    height: 24px;
    background: #d6eaf8;
    border-radius: 2px;
}

.print-preview.classic-teal .pv-table {
    margin: 0 6px 6px;
    height: 28px;
    background: repeating-linear-gradient(#eee 0 4px, #fff 4px 8px);
}

.print-preview.modern-minimal .pv-line {
    height: 3px;
    background: #111;
    margin: 10px 8px 8px;
}

.print-preview.modern-minimal .pv-grid {
    display: flex;
    gap: 4px;
    padding: 0 8px;
}

.print-preview.modern-minimal .pv-grid span {
    flex: 1;
    height: 22px;
    border: 1px solid #ddd;
}

.print-preview.modern-minimal .pv-rows {
    margin: 8px;
    height: 30px;
    border-top: 2px solid #111;
    background: linear-gradient(#fff 50%, #f5f5f5 50%);
    background-size: 100% 8px;
}

.print-preview.corporate-navy .pv-banner {
    height: 28px;
    background: var(--accent, #1a2744);
}

.print-preview.corporate-navy .pv-panels {
    display: flex;
    gap: 4px;
    padding: 6px;
}

.print-preview.corporate-navy .pv-panels span {
    flex: 1;
    height: 18px;
    background: #e8edf5;
    border-left: 3px solid var(--accent, #1a2744);
}

.print-preview.corporate-navy .pv-table.dark {
    margin: 0 6px 6px;
    height: 24px;
    background: var(--accent, #1a2744);
    opacity: .3;
}

.print-preview.elegant-gold .pv-frame {
    margin: 6px;
    border: 2px solid var(--accent, #b8860b);
    height: calc(100% - 12px);
    padding: 4px;
}

.print-preview.elegant-gold .pv-gold-bar {
    height: 8px;
    background: var(--accent, #b8860b);
    opacity: .5;
    margin-bottom: 4px;
}

.print-preview.elegant-gold .pv-dual {
    display: flex;
    gap: 4px;
}

.print-preview.elegant-gold .pv-dual span {
    flex: 1;
    height: 20px;
    background: #faf6ef;
    border: 1px solid #e8dcc8;
}

.print-preview.compact-pos .pv-receipt {
    width: 70px;
    margin: 0 auto;
    font-size: 6px;
    text-align: center;
}

.print-preview.compact-pos .pv-r-title {
    height: 8px;
    background: #2d3436;
    margin: 8px 4px 4px;
    border-radius: 1px;
}

.print-preview.compact-pos .pv-r-dash {
    border-top: 1px dashed #999;
    margin: 4px 8px;
}

.print-preview.compact-pos .pv-r-lines {
    height: 24px;
    margin: 4px 8px;
    background: repeating-linear-gradient(transparent 0 3px, #ddd 3px 4px);
}

.print-preview.compact-pos .pv-r-total {
    height: 6px;
    background: #2d3436;
    margin: 4px 12px 8px;
}

.action-cell .hint { font-size: 10px; color: #888; }

.lhdn-guide-link {
    display: inline-block;
    grid-column: 2;
    margin-top: 6px;
    padding: 0;
    border: none;
    background: none;
    color: #006666;
    font-size: 11px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.lhdn-guide-link:hover { color: #004d4d; }

.lhdn-guide-modal { max-height: 90vh; overflow-y: auto; }
.lhdn-guide-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #006666;
}
.lhdn-guide-kicker {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #006666;
    margin-bottom: 4px;
}
.lhdn-guide-title {
    margin: 0 0 8px;
    font-size: 18px;
    color: #1a3a5c;
}
.lhdn-guide-lead {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #444;
    max-width: 720px;
}
.lhdn-guide-close { min-width: 36px; padding: 4px 10px; }

.lhdn-guide-steps { display: flex; flex-direction: column; gap: 12px; }
.lhdn-step {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #c8d4e0;
    border-radius: 6px;
    background: #fafcfd;
}
.lhdn-step-no {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #006666;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lhdn-step-body { flex: 1; min-width: 0; }
.lhdn-step-body h3 {
    margin: 0 0 6px;
    font-size: 13px;
    color: #006666;
}
.lhdn-step-body p,
.lhdn-step-body li {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.45;
    color: #333;
}
.lhdn-step-body ul,
.lhdn-step-body ol {
    margin: 4px 0 8px 18px;
    padding: 0;
}
.lhdn-step-body code {
    background: #eef5fc;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
}
.lhdn-step-body a { color: #006666; font-weight: 600; }

.lhdn-guide-warn {
    margin: 8px 0;
    padding: 8px 10px;
    border-left: 4px solid #e6a800;
    background: #fff8e6;
    font-size: 11px;
    line-height: 1.4;
    color: #5c4a00;
}

.lhdn-guide-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lhdn-guide-tip {
    font-size: 11px;
    line-height: 1.4;
    color: #555;
    padding: 8px 10px;
    background: #f4f9fc;
    border-radius: 4px;
}
