: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;
}

.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;
}

.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-main:has(.page-head.stripe) {
    background: var(--erp-bg);
}

.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;
}

.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; }

.att-monthly-wrap { overflow-x: auto; max-width: 100%; }
.att-monthly-table { font-size: 11px; white-space: nowrap; }
.att-monthly-table .att-m-day { text-align: center; min-width: 22px; padding: 4px 2px; }
.att-monthly-table .att-m-sticky { position: sticky; left: 0; z-index: 1; background: var(--erp-surface, #fff); }
.att-monthly-table .att-m-name { left: 0; min-width: 120px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.att-monthly-table thead .att-m-sticky { background: var(--erp-table-head, #e8eef4); }
.att-monthly-legend { font-size: 12px; color: var(--erp-muted, #555); margin: 0 0 8px; }

.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-item-search {
    position: relative;
    min-width: 200px;
}
.erp-item-search__input {
    width: 100%;
    min-width: 180px;
}
.erp-item-search__panel {
    position: absolute;
    z-index: 1200;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 2px;
    max-height: 220px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--erp-line);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.erp-item-search__panel--fixed {
    position: fixed;
    z-index: 5000;
    right: auto;
    max-height: min(280px, calc(100vh - 16px));
}
/* Item search line grids: same card as stripe tables but allow dropdown overlay */
.erp-page:has(.page-head.stripe) table.erp-table.erp-table--item-search {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.07),
        0 10px 26px rgba(0, 0, 0, 0.12);
    margin: 12px 0;
    overflow: visible;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}
.erp-page:has(.page-head.stripe) table.erp-table.erp-table--item-search td {
    overflow: visible;
    vertical-align: top;
}
.erp-item-search__opt {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: baseline;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--erp-line) 80%, transparent);
    background: #fff;
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.erp-item-search__opt:hover,
.erp-item-search__opt.on {
    background: color-mix(in srgb, var(--erp-teal) 10%, #fff);
}
.erp-item-search__code {
    font-weight: 600;
    font-size: 12px;
}
.erp-item-search__name {
    flex: 1;
    font-size: 12px;
}
.erp-item-search__uom {
    font-size: 11px;
    color: #666;
}
.erp-item-search__empty {
    padding: 8px;
    font-size: 12px;
    color: #666;
}
.section-label { font-weight: 700; margin: 0 0 8px; color: var(--erp-teal); }
.rmg-form-section { margin: 12px 0 16px; }
.rmg-form-section .section-label { margin-top: 4px; }
.rmg-line-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.rmg-line-toolbar .erp-input { max-width: 220px; }
tr.rmg-line-selected { background: color-mix(in srgb, var(--erp-teal) 12%, transparent); cursor: pointer; }

/* ERP form cards (global + Trims multi-card layout) */
.erp-form-layout {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.erp-booking-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin-bottom: 12px;
}
.erp-form-card {
    background: #fff;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.07),
        0 10px 26px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    min-width: 0;
}
.erp-form-card--wide {
    width: 100%;
    margin-bottom: 12px;
}
.erp-booking-cards .erp-form-card__body.coa-form {
    grid-template-columns: 1fr;
}
.erp-booking-cards .att-form .field {
    grid-template-columns: minmax(118px, 150px) minmax(0, 1fr);
}
.erp-form-card .field .erp-input,
.erp-form-card .field select.erp-input {
    width: 100%;
    min-width: 0;
    max-width: none;
}
.erp-form-action-panel {
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.07),
        0 10px 26px rgba(0, 0, 0, 0.12);
    border-top: 3px solid color-mix(in srgb, var(--erp-teal) 55%, var(--erp-line));
}
.erp-form-action-panel .action-bar {
    margin: 0;
    flex-wrap: wrap;
}
.erp-form-layout + .erp-form-action-panel {
    position: sticky;
    bottom: 8px;
    z-index: 3;
}
.erp-doc-list-card {
    width: 100%;
    background: #fff;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.07),
        0 10px 26px rgba(0, 0, 0, 0.12);
    margin: 12px 0;
    overflow: hidden;
}
.erp-doc-list-card > .erp-form-card__head {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}
.erp-doc-list-card > .erp-form-card__body--flush > .erp-table {
    margin-top: 0;
}
.erp-form-card__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--erp-teal-dark);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--erp-stripe) 85%, #fff) 0%,
        color-mix(in srgb, var(--erp-stripe) 55%, #fff) 100%
    );
    border-bottom: 1px solid color-mix(in srgb, var(--erp-teal) 25%, var(--erp-line));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.erp-form-card__head::before {
    content: "";
    width: 4px;
    height: 14px;
    border-radius: 2px;
    background: var(--erp-teal);
    flex-shrink: 0;
}
.erp-form-card__body {
    padding: 10px 12px 12px;
}
.erp-form-card__body.coa-form {
    max-width: none;
}
.erp-form-card__body--flush {
    padding: 0 0 8px;
}
.erp-form-card__body--flush .erp-table {
    margin: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
}
.erp-form-card__body--flush .action-bar {
    margin: 8px 12px;
}
@media (max-width: 960px) {
    .erp-booking-cards { grid-template-columns: 1fr; }
}
@media print {
    .erp-form-card {
        box-shadow: none;
        border-radius: 0;
        border-color: #ccc;
    }
    .erp-form-card__head { display: none; }
    .erp-form-card__body { padding: 0; }
}

/* Auto chrome: pages with stripe header (transaction / master forms) */
.erp-page:has(.page-head.stripe) .att-flow.no-print {
    display: none;
}
.erp-page:has(.page-head.stripe) .hr-print-sheet {
    width: 100%;
    max-width: 100%;
}
.erp-page:has(.page-head.stripe) .coa-form:not(.erp-form-card__body),
.erp-page:has(.page-head.stripe) .user-form-grid {
    background: #fff;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.07),
        0 10px 26px rgba(0, 0, 0, 0.12);
    padding: 10px 12px 12px;
    width: 100%;
    max-width: none !important;
    margin-bottom: 12px;
    box-sizing: border-box;
}
.erp-page:has(.page-head.stripe) .user-form {
    width: 100%;
    max-width: none !important;
}
.erp-page:has(.page-head.stripe) .section-label:has(+ .erp-table):not(.erp-form-card__head) {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 0;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--erp-teal-dark);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--erp-stripe) 85%, #fff) 0%,
        color-mix(in srgb, var(--erp-stripe) 55%, #fff) 100%
    );
    border: 1px solid var(--erp-line);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.erp-page:has(.page-head.stripe) .section-label:has(+ .erp-table)::before {
    content: "";
    width: 4px;
    height: 14px;
    border-radius: 2px;
    background: var(--erp-teal);
    flex-shrink: 0;
}
.erp-page:has(.page-head.stripe) .section-label:has(+ .erp-table) + .erp-table {
    margin-top: 0;
    margin-bottom: 12px;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.07),
        0 10px 26px rgba(0, 0, 0, 0.12);
}
.erp-page:has(.page-head.stripe) .section-label:has(+ .coa-form):not(.erp-form-card__head) {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 0;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--erp-teal-dark);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--erp-stripe) 85%, #fff) 0%,
        color-mix(in srgb, var(--erp-stripe) 55%, #fff) 100%
    );
    border: 1px solid var(--erp-line);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.erp-page:has(.page-head.stripe) .section-label:has(+ .coa-form)::before {
    content: "";
    width: 4px;
    height: 14px;
    border-radius: 2px;
    background: var(--erp-teal);
    flex-shrink: 0;
}
.erp-page:has(.page-head.stripe) .section-label:has(+ .coa-form) + .coa-form {
    margin-top: 0;
    margin-bottom: 0;
    border-top: none;
    border-radius: 0;
    box-shadow: none;
}
.erp-page:has(.page-head.stripe) .section-label:has(+ .coa-form) + .coa-form + .action-bar {
    margin-top: 0;
    margin-bottom: 12px;
    border-top: none;
    border-radius: 0 0 8px 8px;
    position: static;
    z-index: auto;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.07),
        0 10px 26px rgba(0, 0, 0, 0.12);
}
.erp-page:has(.page-head.stripe) .job-grid {
    background: #fff;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.07),
        0 10px 26px rgba(0, 0, 0, 0.12);
    padding: 10px 12px 12px;
    margin-bottom: 12px;
}
.erp-page:has(.page-head.stripe) .action-bar {
    background: #fff;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.07),
        0 10px 26px rgba(0, 0, 0, 0.12);
    border-top: 3px solid color-mix(in srgb, var(--erp-teal) 55%, var(--erp-line));
    padding: 10px 12px;
    margin: 12px 0 0;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    position: static;
    z-index: auto;
}
.erp-page:has(.page-head.stripe) .action-bar:has(.exit-btn) {
    position: sticky;
    bottom: 8px;
    z-index: 3;
    margin-bottom: 8px;
}
.erp-page:has(.page-head.stripe) .section-label:has(+ .coa-form) + .coa-form + .action-bar {
    border-top: 1px solid color-mix(in srgb, var(--erp-teal) 20%, var(--erp-line));
}
.erp-page:has(.page-head.stripe) .erp-form-card .action-bar,
.erp-page:has(.page-head.stripe) .erp-form-card__body--flush .action-bar,
.erp-page:has(.page-head.stripe) .mm-layout .action-bar,
.erp-page:has(.page-head.stripe) .chq-side .action-bar,
.erp-page:has(.page-head.stripe) .ts-attach .action-bar {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    border-top: none;
    padding: 0;
    margin: 8px 12px;
    position: static;
    z-index: auto;
}
.erp-page:has(.page-head.stripe) .erp-form-action-panel {
    position: sticky;
    bottom: 8px;
    z-index: 3;
}
@media print {
    .erp-page:has(.page-head.stripe) .action-bar {
        display: none !important;
    }
    .erp-page:has(.page-head.stripe) .coa-form:not(.erp-form-card__body),
    .erp-page:has(.page-head.stripe) .job-grid,
    .erp-page:has(.page-head.stripe) .section-label:has(+ .erp-table) + .erp-table {
        box-shadow: none;
        border-radius: 0;
    }
}

.erp-page:has(.page-head.stripe) .ts-screen,
.erp-page:has(.page-head.stripe) .chq-wrap {
    width: 100%;
    max-width: 100%;
}
.erp-page:has(.page-head.stripe) .ts-screen > .ts-head {
    background: #fff;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.07),
        0 10px 26px rgba(0, 0, 0, 0.12);
    padding: 10px 12px 12px;
    margin-bottom: 12px;
    box-sizing: border-box;
}
.erp-page:has(.page-head.stripe) .ts-attach {
    background: #fff;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.07),
        0 10px 26px rgba(0, 0, 0, 0.12);
    margin: 12px 0;
    overflow: hidden;
}
.erp-page:has(.page-head.stripe) .ts-attach .section-label {
    margin: 0;
    padding: 7px 12px;
    border: none;
    border-bottom: 1px solid color-mix(in srgb, var(--erp-teal) 25%, var(--erp-line));
    border-radius: 8px 8px 0 0;
}
.erp-page:has(.page-head.stripe) .ts-attach .action-bar,
.erp-page:has(.page-head.stripe) .ts-attach .erp-table {
    margin-left: 12px;
    margin-right: 12px;
}
.erp-page:has(.page-head.stripe) .ts-attach .erp-table {
    margin-bottom: 12px;
}
.erp-page:has(.page-head.stripe) .chq-side,
.erp-page:has(.page-head.stripe) .chq-main,
.erp-page:has(.page-head.stripe) .ts-auth-list,
.erp-page:has(.page-head.stripe) .ts-auth-detail {
    background: #fff;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.07),
        0 10px 26px rgba(0, 0, 0, 0.12);
    padding: 10px 12px 12px;
    box-sizing: border-box;
}
.erp-page:has(.page-head.stripe) .chq-main > .ts-head,
.erp-page:has(.page-head.stripe) .ts-auth-detail > .ts-head {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 8px;
}
.erp-page:has(.page-head.stripe) .chq-side .action-bar,
.erp-page:has(.page-head.stripe) .ts-auth-detail .action-bar,
.erp-page:has(.page-head.stripe) .ts-attach .action-bar {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    border-top: none;
    padding: 0;
    margin: 8px 0;
    position: static;
}
.erp-page:has(.page-head.stripe) .chq-main > .erp-table,
.erp-page:has(.page-head.stripe) .ts-auth-detail > .erp-table {
    margin-top: 8px;
}
.erp-page:has(.page-head.stripe) .form-banner {
    margin-bottom: 10px;
}
/* Data tables on stripe pages (lists, reports, line grids) */
.erp-page:has(.page-head.stripe) table.erp-table:not(.priv-table):not(.erp-table--item-search) {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.07),
        0 10px 26px rgba(0, 0, 0, 0.12);
    margin: 12px 0;
    overflow: hidden;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}
.erp-page:has(.page-head.stripe) .erp-doc-list-card table.erp-table,
.erp-page:has(.page-head.stripe) .erp-form-card__body--flush table.erp-table,
.erp-page:has(.page-head.stripe) .coa-form table.erp-table,
.erp-page:has(.page-head.stripe) .mm-list table.erp-table,
.erp-page:has(.page-head.stripe) .mm-layout table.erp-table,
.erp-page:has(.page-head.stripe) .ts-auth-list table.erp-table,
.erp-page:has(.page-head.stripe) .ts-attach table.erp-table,
.erp-page:has(.page-head.stripe) .chq-side table.erp-table,
.erp-page:has(.page-head.stripe) .dash table.erp-table,
.erp-page:has(.page-head.stripe) .ts-auth-detail table.erp-table {
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    width: 100%;
}
.erp-page:has(.page-head.stripe) .section-label + table.erp-table {
    margin-top: 0;
    border-top: none;
    border-radius: 0 0 8px 8px;
}
.erp-page:has(.page-head.stripe) .section-label + table.erp-table thead tr:first-child th:first-child,
.erp-page:has(.page-head.stripe) .section-label + table.erp-table thead tr:first-child th:last-child {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
.erp-page:has(.page-head.stripe) table.erp-table:not(.priv-table) thead th {
    border-top: none;
}
.erp-page:has(.page-head.stripe) .section-label + table.erp-table thead th {
    border-top: 1px solid #cfcfcf;
}
.erp-page:has(.page-head.stripe) table.erp-table:not(.priv-table) thead tr:first-child th:first-child {
    border-top-left-radius: 7px;
}
.erp-page:has(.page-head.stripe) table.erp-table:not(.priv-table) thead tr:first-child th:last-child {
    border-top-right-radius: 7px;
}
.erp-page:has(.page-head.stripe) .section-label + table.erp-table thead tr:first-child th:first-child,
.erp-page:has(.page-head.stripe) .section-label + table.erp-table thead tr:first-child th:last-child {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
.erp-page:has(.page-head.stripe) table.erp-table:not(.priv-table) tbody tr:last-child td:first-child {
    border-bottom-left-radius: 7px;
}
.erp-page:has(.page-head.stripe) table.erp-table:not(.priv-table) tbody tr:last-child td:last-child {
    border-bottom-right-radius: 7px;
}

.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; }

.erp-form-inline-notice {
    margin: 8px 0 12px;
    padding: 8px 12px;
    border-left: 3px solid var(--erp-primary, #1e6b4a);
    background: var(--erp-surface-alt, #f4f6f8);
    color: var(--erp-text, #222);
}

.form-action-notice {
    margin: 8px 0 12px;
    padding: 8px 12px;
    border-left: 3px solid var(--erp-accent, #c45);
    background: var(--erp-surface-alt, #f8f4f4);
    color: var(--erp-text, #333);
    max-width: 900px;
}

.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; }
/* Transaction forms inside HrReportPrint: print body when no doc-voucher block */
.erp-app.erp-print-preview .hr-print-sheet:has(.doc-voucher.print-only) .coa-form.no-print,
.erp-app.erp-print-preview .hr-print-sheet:has(.doc-voucher.print-only) table.erp-table.no-print,
.erp-app.erp-print-preview .hr-print-sheet:has(.doc-voucher.print-only) .section-label.no-print,
.erp-app.erp-print-preview .hr-print-sheet:has(.doc-voucher.print-only) div.no-print:has(.erp-table),
.erp-app.erp-print-preview .hr-print-sheet .erp-print-skip,
.erp-app.erp-print-preview .hr-print-sheet .erp-doc-list-card,
.erp-app.erp-print-preview .hr-print-sheet .action-bar,
.erp-app.erp-print-preview .hr-print-sheet p.att-flow,
.erp-app.erp-print-preview .hr-print-sheet p.hint { display: none !important; }
.erp-app.erp-print-preview .hr-print-sheet:not(:has(.doc-voucher.print-only)) .coa-form.no-print { display: block !important; }
.erp-app.erp-print-preview .hr-print-sheet:not(:has(.doc-voucher.print-only)) .coa-form.att-form.no-print { display: grid !important; }
.erp-app.erp-print-preview .hr-print-sheet:not(:has(.doc-voucher.print-only)) table.erp-table.no-print { display: table !important; }
.erp-app.erp-print-preview .hr-print-sheet:not(:has(.doc-voucher.print-only)) .section-label.no-print { display: block !important; font-weight: 700; margin: 8px 0 4px; color: #000; }
.erp-app.erp-print-preview .hr-print-sheet:not(:has(.doc-voucher.print-only)) div.no-print:has(table.erp-table) { display: block !important; }
.erp-app.erp-print-preview .hr-print-sheet button,
.erp-app.erp-print-preview .hr-print-sheet .erp-btn { 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; }
    .fs-report-card, .gerp-pdf-target {
        max-width: none;
        box-shadow: none;
        border: none;
        padding: 0;
    }
    .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;
    }
    .hr-print-sheet:has(.doc-voucher.print-only) .coa-form.no-print,
    .hr-print-sheet:has(.doc-voucher.print-only) table.erp-table.no-print,
    .hr-print-sheet:has(.doc-voucher.print-only) .section-label.no-print,
    .hr-print-sheet:has(.doc-voucher.print-only) div.no-print:has(.erp-table),
    .hr-print-sheet .erp-print-skip,
    .hr-print-sheet .erp-doc-list-card,
    .hr-print-sheet .action-bar,
    .hr-print-sheet p.att-flow,
    .hr-print-sheet p.hint { display: none !important; }
    .hr-print-sheet:not(:has(.doc-voucher.print-only)) .coa-form.no-print { display: block !important; }
    .hr-print-sheet:not(:has(.doc-voucher.print-only)) .coa-form.att-form.no-print { display: grid !important; }
    .hr-print-sheet:not(:has(.doc-voucher.print-only)) table.erp-table.no-print { display: table !important; }
    .hr-print-sheet:not(:has(.doc-voucher.print-only)) .section-label.no-print {
        display: block !important;
        font-weight: 700;
        margin: 8px 0 4px;
        color: #000;
    }
    .hr-print-sheet:not(:has(.doc-voucher.print-only)) div.no-print:has(table.erp-table) { display: block !important; }
    .hr-print-sheet button,
    .hr-print-sheet .erp-btn { display: none !important; }
    @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 { display: none; }
.att-pull-banner {
    display: block;
    margin: 8px 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--erp-line);
    font-size: 13px;
    line-height: 1.45;
}
.att-pull-banner.ok {
    background: #e8f5e9;
    border-color: #81c784;
    color: #1b5e20;
}
.att-pull-banner.warn {
    background: #fff8e1;
    border-color: #ffb74d;
    color: #5d4037;
}

.att-device-pull {
    max-width: 920px;
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    background: var(--erp-panel, #f8fafc);
}

.att-quick-steps {
    max-width: 920px;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--erp-teal) 25%, var(--erp-line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--erp-teal) 6%, #fff);
    font-size: 13px;
    line-height: 1.5;
}
.att-quick-steps ol {
    margin: 6px 0 0;
    padding-left: 20px;
}
.att-quick-steps a { font-weight: 600; }

.erp-form-alert-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.erp-form-alert-dialog {
    background: var(--erp-panel, #fff);
    border: 1px solid var(--erp-line, #cfcfcf);
    border-radius: 8px;
    max-width: 480px;
    width: 100%;
    padding: 16px 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.erp-form-alert-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--erp-text, #222);
}

.erp-form-alert-body {
    margin: 0 0 14px;
    line-height: 1.45;
    color: var(--erp-text, #333);
}

.erp-form-alert-actions {
    display: flex;
    justify-content: flex-end;
}

.erp-field-highlight {
    outline: 2px solid var(--erp-accent, #2e7d32) !important;
    outline-offset: 2px;
}

.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; }

/* Financial statement (IS / BS) */
.fs-report-card {
    max-width: 820px;
    margin-top: 12px;
    background: #fff;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    box-shadow: 0 1px 3px color-mix(in srgb, var(--erp-teal) 8%, transparent);
    padding: 12px 14px 16px;
}
.fs-report-banner {
    border-bottom: 2px solid color-mix(in srgb, var(--erp-teal) 35%, var(--erp-line));
    padding-bottom: 10px;
    margin-bottom: 8px;
}
.fs-report-co {
    font-size: 15px;
    font-weight: 700;
    color: var(--erp-teal, #00625a);
}
.fs-report-meta {
    font-size: 12px;
    color: #555;
    margin-top: 2px;
}
.fs-report-diff {
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
}
.fs-diff-ok { color: #1b5e20; }
.fs-diff-warn { color: #b71c1c; }
.fs-report-tip { margin: 0 0 8px; font-size: 11px; }
.fs-table { margin-top: 0; font-size: 13px; }
.fs-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fs-table tr.fs-section td {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--erp-teal, #00625a);
    background: color-mix(in srgb, var(--erp-teal) 10%, #fff);
    border-top: 2px solid color-mix(in srgb, var(--erp-teal) 40%, var(--erp-line));
    padding-top: 8px;
    padding-bottom: 6px;
}
.fs-table tr.fs-header td {
    font-weight: 600;
    color: #333;
    background: #f7fafafa;
}
.fs-table tr.fs-subtotal td {
    font-weight: 600;
    border-top: 1px solid #bbb;
    background: #fafafa;
}
.fs-table tr.fs-total td {
    font-weight: 700;
}
.fs-table tr.fs-grand td {
    font-weight: 800;
    font-size: 13px;
    border-top: 2px double color-mix(in srgb, var(--erp-teal) 50%, #666);
    border-bottom: 2px double color-mix(in srgb, var(--erp-teal) 50%, #666);
    background: color-mix(in srgb, var(--erp-teal) 6%, #fff);
    padding-top: 6px;
    padding-bottom: 6px;
}
.fs-table tr.fs-diff td {
    font-weight: 700;
    color: #b71c1c;
    background: #fff5f5;
}
.fs-table tr.fs-line td:first-child { color: #222; }
.fs-indent-1 td:first-child { padding-left: 18px; }
.fs-indent-2 td:first-child { padding-left: 32px; }
.fs-indent-3 td:first-child { padding-left: 46px; }
.fs-indent-4 td:first-child { padding-left: 60px; }
.fs-drill-btn {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: #1565c0;
    text-decoration: underline;
    cursor: pointer;
    text-align: left;
}
.fs-drill-btn:hover { color: #0d47a1; }
.fs-detail-modal { width: min(1100px, 96vw); }
.fs-detail-head { margin-bottom: 10px; }
.fs-detail-title { font-size: 16px; font-weight: 700; }
.fs-detail-sub { font-size: 12px; color: #666; margin-top: 4px; }
.fs-detail-table { font-size: 12px; }
.fs-detail-table .num { text-align: right; }
.fs-opening-row { background: #f3f8ff; }
.fs-jv-tip { margin: 6px 0 0; font-size: 11px; }
.fs-voucher-modal-back { z-index: 45; }
.fs-voucher-modal-wrap { width: min(920px, 96vw); max-height: calc(100vh - 48px); overflow: auto; }
.fs-voucher-in-modal { margin-top: 8px; }
.fs-detail-modal { width: min(960px, 96vw); }
.fs-detail-card { margin: 0; box-shadow: none; border: none; padding: 0; }
.fs-detail-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 8px 0 10px;
}
.fs-detail-toolbar .erp-btn { min-width: 0; padding: 2px 10px; }

/* Trial Balance */
.tb-report-card { max-width: 100%; }
.tb-table { font-size: 12px; }
.tb-table .tb-group {
    text-align: center;
    background: color-mix(in srgb, var(--erp-teal) 12%, #e6f2f2);
    font-weight: 700;
}
.tb-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tb-drill-name { text-align: left; font-weight: 500; }
.tb-drill-amt { font-variant-numeric: tabular-nums; }
.screen-tb-head {
    display: none;
    text-align: center;
    margin-bottom: 10px;
}
.screen-tb-head .hr-print-co { font-size: 15px; font-weight: 700; }
.screen-tb-head .hr-print-title { font-weight: 700; margin-top: 4px; }
.screen-tb-head .hr-print-sub { font-size: 12px; color: #555; }
@media screen {
    .hr-print-sheet .screen-tb-head { display: block; }
    .hr-print-sheet .hr-print-head.print-only { display: none; }
}
@media print {
    .screen-tb-head { display: none !important; }
}

.fs-ledger-block {
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid color-mix(in srgb, var(--erp-teal) 25%, #ccc);
}
.fs-ledger-block:last-child { border-bottom: none; }
.fs-ledger-head {
    font-size: 13px;
    margin: 0 0 6px;
    padding: 6px 8px;
    background: color-mix(in srgb, var(--erp-teal) 8%, #f4fafa);
}

.report-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 8px 0 12px;
}
.report-pager-size {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.report-pager-size select {
    width: auto;
    min-width: 72px;
    padding: 2px 6px;
}

.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-head--card,
.erp-form-card__body .ts-head {
    margin-bottom: 0;
}
.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;
}

.mgmt-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin: 12px 0 16px;
}
.mgmt-kpi-card {
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.mgmt-kpi-card .label { font-size: 12px; color: #666; }
.mgmt-kpi-card .value { font-size: 20px; font-weight: 700; color: var(--erp-teal); margin-top: 4px; }
.mgmt-kpi-card.danger .value { color: #c0392b; }
.mgmt-kpi-card.ok .value { color: #1e8449; }
.mgmt-kpi-card.warn .value { color: #d68910; }
.erp-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: color-mix(in srgb, var(--erp-teal) 12%, #fff);
    color: var(--erp-teal);
}
.erp-badge--ok { background: #e8f8ef; color: #1e8449; }
.erp-badge--warn { background: #fef9e7; color: #9a7b0a; }
.erp-badge--danger { background: #fdedec; color: #c0392b; }
.erp-badge--info { background: #ebf5fb; color: #1f618d; }
.mgmt-report-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding: 10px 12px;
    margin: 8px 0 12px;
    border: 1px solid var(--erp-line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--erp-teal) 6%, #fff);
    font-size: 13px;
}
