/* Packman Workspace theme. Presentation only; existing screen geometry stays authoritative. */
:root {
    color-scheme: light;
    --erp-font: Arial, "Helvetica Neue", Helvetica, sans-serif;
    --erp-ink: #272d2b;
    --erp-muted: #68716c;
    --erp-page: #f3f4f1;
    --erp-surface: #ffffff;
    --erp-soft: #f6f7f4;
    --erp-line: #d6dcd5;
    --erp-divider: #e7ebe5;
    --erp-accent: #ac4727;
    --erp-accent-hover: #8e391d;
    --erp-accent-soft: #fcf0e7;
    --erp-green: #385e48;
    --erp-green-soft: #edf5ee;
    --erp-danger: #a72e29;
    --erp-danger-soft: #fff3f1;
    --erp-warning: #805c24;
    --erp-warning-soft: #fff8e9;
    --erp-radius-control: 5px;
    --erp-radius-panel: 8px;
    --erp-shadow: 0 2px 4px #27352b04, 0 8px 24px #27352b07;
    --erp-focus: 0 0 0 3px #ac472720;
}
body.erp-theme {
    --blue: var(--erp-accent);
    --blue-dark: var(--erp-accent-hover);
    --line: var(--erp-line);
    --section: var(--erp-soft);
    --ink: var(--erp-ink);
    --muted: var(--erp-muted);
    --error: var(--erp-danger);
    --paper: var(--erp-surface);
    --orange: var(--erp-accent);
    color: var(--erp-ink);
    background: var(--erp-page);
    font-family: var(--erp-font);
    font-stretch: normal;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    accent-color: var(--erp-accent);
}
body.erp-theme :is(button, input, select, textarea) { font-family: var(--erp-font); font-stretch: normal; letter-spacing: normal; }
body.erp-theme :is(a) { color: var(--erp-accent); text-underline-offset: 3px; }
body.erp-theme :is(button) {
    background: #fff;
    color: var(--erp-ink);
    border-color: #cdd4cb;
    border-radius: var(--erp-radius-control);
    box-shadow: 0 1px 2px #25382a07;
    transition: background-color 120ms, border-color 120ms, box-shadow 120ms;
}
body.erp-theme :is(button):hover:not(:disabled) { background: #f2f5ef; border-color: #a7b7a5; }
body.erp-theme :is(button):active:not(:disabled) { box-shadow: inset 0 1px 3px #24372b18; }
body.erp-theme :is(#save, #itemSave, #bpSave, .erp-button-primary, .login-panel form>button[type=submit]) {
    color: #fff;
    background: linear-gradient(180deg, #b84e2b, #a34223);
    border-color: #a34223;
    box-shadow: 0 1px 2px #6a2d1820;
}
body.erp-theme :is(#save, #itemSave, #bpSave, .erp-button-primary, .login-panel form>button[type=submit]):hover:not(:disabled) { background: var(--erp-accent-hover); border-color: var(--erp-accent-hover); }
body.erp-theme :is(#saveNew, #itemSaveNew, #bpSaveNew, #itemNew, #bpNew, .erp-button-soft) { color: #84371f; background: var(--erp-accent-soft); border-color: #e5c6b3; }
body.erp-theme :is(#saveNew, #itemSaveNew, #bpSaveNew, #itemNew, #bpNew, .erp-button-soft):hover:not(:disabled) { background: #f8e3d5; border-color: #ca9b80; }
body.erp-theme #viewRecords { color: #fff; background: #3b4b40; border-color: #3b4b40; }
body.erp-theme #viewRecords:hover:not(:disabled) { background: #293b2e; }
body.erp-theme button.danger { color: #fff; background: var(--erp-danger); border-color: var(--erp-danger); }
body.erp-theme button.danger:hover:not(:disabled) { background: #892521; border-color: #892521; }
body.erp-theme button:disabled { color: #818781; background: #eef0eb; border-color: #dde1d9; opacity: 1; box-shadow: none; cursor: not-allowed; }
body.erp-theme :is(#save, #saveNew, #itemSave, #itemSaveNew, #bpSave, #bpSaveNew, #itemNew, #bpNew, #viewRecords):disabled { color: #818781; background: #eef0eb; border-color: #dde1d9; box-shadow: none; }
body.erp-theme :is(input, select, textarea) { border-color: #c2cbc0; border-radius: var(--erp-radius-control); color: var(--erp-ink); background: #fff; box-shadow: inset 0 1px 2px #20302203; }
body.erp-theme :is(input, select, textarea):hover:not(:disabled):not([readonly]) { border-color: #95a591; }
body.erp-theme :is(input, select, textarea):disabled,
body.erp-theme :is(input, textarea)[readonly] { background: #f0f3ed; color: #65705f; }
body.erp-theme :is(input, textarea)::placeholder { color: #7b8379; }
body.erp-theme :is(input[type=radio], input[type=checkbox]) { accent-color: var(--erp-accent); box-shadow: none; }
body.erp-theme :is(button, input, select, textarea, a, summary):focus-visible { outline: 2px solid var(--erp-accent); outline-offset: 2px; box-shadow: var(--erp-focus); }
body.erp-theme :is(.invalid, [aria-invalid=true]) { border-color: var(--erp-danger)!important; background: var(--erp-danger-soft)!important; }
body.erp-theme :is(.field label, .bp-grid label) { color: #3c443b; }
body.erp-theme :is(.field-help, .item-help, .item-section-help, .muted, .source-note, .restricted, .dialog-note) { color: var(--erp-muted); }
body.erp-theme :is(.workspace, .bp-panel, .grid, .erp-panel) { background: #fff; border-color: var(--erp-line); border-radius: var(--erp-radius-panel); box-shadow: var(--erp-shadow); }
body.erp-theme :is(.panel) { border-color: var(--erp-line); background: #fff; border-radius: 6px; }
body.erp-theme :is(.panel h2, .dialog-heading, .item-dialog .dialog-heading, dialog header) { background: linear-gradient(180deg, #f4f6f0, #edf1e8); color: #354332; border-color: var(--erp-line); }
body.erp-theme .panel h2 span { color: #a24a2b; }
body.erp-theme :is(.bp-panel h2) { color: #465541; }
body.erp-theme :is(.action-bar, .bp-actions) { background: linear-gradient(180deg, #fafbf8, #f0f3ec); border-color: var(--erp-line); box-shadow: 0 2px 4px #2c402608; }
body.erp-theme :is(.draft-status, .entity-context) { color: #52604d; background: #f2f5ee; border-color: #d7dfd0; }
body.erp-theme :is(.draft-status) { font-weight: 600; }
body.erp-theme :is(.entity-context span, .review-label, .review-footer, .signed-user) { color: var(--erp-muted); }
body.erp-theme :is(.review-footer) { border-color: var(--erp-divider); }
body.erp-theme > header { background: #fff; border-color: var(--erp-line); box-shadow: 0 1px 4px #27352b05; }
body.erp-theme .review-header { gap: 12px; padding-inline: 18px; }
body.erp-theme .review-header .brand { gap: 12px; flex-shrink: 0; }
body.erp-theme .review-header .brand img { width: 100px; }
body.erp-theme .review-header .brand strong { font-size: 14px; color: #30392e; }
body.erp-theme .review-header .review-label { font-size: 10px; white-space: nowrap; }
body.erp-theme .header-actions { align-items: center; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
body.erp-theme .header-actions :is(a, button) { white-space: nowrap; font-size: 11px; }
body.erp-theme .header-actions a.quiet { text-decoration: none; padding: 5px 7px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #535e4f; }
body.erp-theme .header-actions a.quiet:hover { color: var(--erp-accent); background: var(--erp-accent-soft); }
body.erp-theme .header-actions a[href$="/dashboard"] { color: var(--erp-accent); background: var(--erp-accent-soft); border-color: #efdbce; font-weight: 600; }
body.erp-theme .quiet { background: #fff; border-color: #cdd4cb; color: #424c3d; }
body.erp-theme .quiet:hover:not(:disabled) { background: #f1f5eb; }
body.erp-theme :is(.add-button, .text-button) { color: var(--erp-accent); }
body.erp-theme .text-button { background: transparent; box-shadow: none; }
body.erp-theme :is(.entry-grid .remove-row, .success-prompt-close) { background: transparent; box-shadow: none; }
body.erp-theme :is(table, th, td, .item-list-scroll, .industry-branch) { border-color: var(--erp-line); }
body.erp-theme :is(th, .entry-grid th, .list-table th, .item-table th, .import-table th, .master-options th, .industry-branch h3) { background: #edf2e8; color: #45523d; border-color: #d3ddcd; }
body.erp-theme :is(.list-table th, .item-table th, .import-table th, .master-options th) { font-weight: 600; }
body.erp-theme :is(.list-table td, .item-table td, .entry-grid td, .master-options td) { border-color: var(--erp-divider); }
body.erp-theme :is(.list-table tbody tr:nth-child(even), .item-table tr:nth-child(even), .grid tbody tr:nth-child(even)) { background: #f8faf6; }
body.erp-theme :is(.list-table tbody tr, .item-table tbody tr, .grid tbody tr):hover { background: #f1f6ec; }
body.erp-theme :is(.list-table td.code) { color: var(--erp-accent); }
body.erp-theme :is(.item-table .item-empty) { color: var(--erp-muted); }
body.erp-theme :is(.bp-grid output, .bp-inherited) { background: var(--erp-green-soft); border-color: #ccddc9; color: var(--erp-green); }
body.erp-theme :is(dialog, .dialog, .item-dialog, .packman-column-dialog) { color: var(--erp-ink); border-color: #c5cfc0; border-radius: 10px; box-shadow: 0 18px 70px #18271930; font-family: var(--erp-font); }
body.erp-theme dialog::backdrop { background: #25302066; }
body.erp-theme :is(.dialog-footer) { background: #f7f8f4; border-color: var(--erp-divider); }
body.erp-theme :is(.history-entry, .import-total, dialog pre) { background: #f7f9f4; border-color: var(--erp-line); }
body.erp-theme .notice, body.erp-theme #bpNotice, body.erp-theme .item-operation-state { color: #3c5844; background: #f0f6ee; border-color: #cbdcc5; }
body.erp-theme .notice.busy, body.erp-theme #bpNotice.busy { color: var(--erp-warning); background: var(--erp-warning-soft); border-color: #e6d5b1; }
body.erp-theme :is(.notice.warning, .pending, #bpUncertain, .item-readonly-note, .pilot-label) { color: var(--erp-warning); background: var(--erp-warning-soft); border-color: #e6d5b1; }
body.erp-theme .notice.error, body.erp-theme #bpNotice.error, body.erp-theme .item-inline-error { color: var(--erp-danger); background: var(--erp-danger-soft); border-color: #e7bdb7; }
body.erp-theme #bpActivate:disabled { color: #818781; background: #eef0eb; border-color: #dde1d9; }
body.erp-theme :is(.success-prompt) { color: #2c543b; background: #f1f8ef; border-color: #9bb896; }
body.erp-theme .success-prompt-icon { background: #46734b; }
/* Shared column manager: same saved-view behaviour, matching visual language. */
body.erp-theme .packman-column-dialog { background: #fff; }
body.erp-theme .packman-column-dialog h2 { color: var(--erp-ink); }
body.erp-theme .packman-column-dialog :is(.column-screen-name, .column-summary, .column-persistence, .column-empty) { color: var(--erp-muted); }
body.erp-theme .packman-column-dialog .column-search { border-color: #bccab6; color: var(--erp-ink); }
body.erp-theme .packman-column-dialog .column-search:focus { outline-color: var(--erp-accent); }
body.erp-theme .packman-column-dialog .column-choice input { accent-color: var(--erp-accent); }
body.erp-theme .packman-column-dialog .column-choice:hover { background: #f7f9f3; border-radius: 5px; }
body.erp-theme .packman-column-dialog .column-selection-actions button { color: var(--erp-accent); box-shadow: none; }
body.erp-theme .packman-column-dialog .column-footer button { border-color: var(--erp-line); color: var(--erp-ink); }
body.erp-theme .packman-column-dialog .column-footer .column-save { color: #fff; background: var(--erp-accent); border-color: var(--erp-accent); }
body.erp-theme .packman-column-dialog .column-footer button:disabled { color: #818781; background: #eef0eb; border-color: #dde1d9; }
/* Authentication uses the same local assets and native forms, with no new scripts or services. */
body.erp-auth { min-width: 0; min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background: radial-gradient(ellipse at 12% 10%, #f4e8db 0, transparent 48%), radial-gradient(ellipse at 90% 95%, #e4eddd 0, transparent 45%), #f6f7f2; }
body.erp-auth .login-panel { width: min(440px,100%); min-width: 0; margin: 0; padding: 34px 36px; border-color: #dce2d4; border-radius: 16px; box-shadow: 0 16px 64px #2c3c2610; }
body.erp-auth .login-panel img { width: 145px; height: 52px; object-fit: contain; object-position: left; }
body.erp-auth .login-panel h1 { color: #30392d; font-size: 27px; line-height: 1.15; margin: 22px 0 8px; letter-spacing: -.5px; }
body.erp-auth .login-panel>p { color: var(--erp-muted); line-height: 1.6; }
body.erp-auth .login-panel h2 { color: var(--erp-ink); font-size: 16px; margin: 24px 0 16px; }
body.erp-auth .login-panel label { font-size: 12px; font-weight: 600; gap: 8px; margin-bottom: 17px; }
body.erp-auth .login-panel input { height: 40px; padding: 8px 11px; font-size: 14px; font-weight: 400; }
body.erp-auth .login-panel form>button[type=submit] { min-height: 40px; border-radius: 7px; }
body.erp-auth .login-panel>form>button { width: 100%; }
body.erp-auth .test-roles form>button[type=submit] { min-height: 28px; font-size: 11px; }
body.erp-auth .pilot-label { border-radius: 6px; font-size: 12px; }
@media(prefers-reduced-motion:reduce) { body.erp-theme * { transition: none!important; scroll-behavior: auto!important; } }
@media print { body.erp-theme { background: white; } body.erp-theme .workspace { box-shadow: none; } }
