/* Shared screen language: use these classes for new and refreshed business screens. */
.workspace-screen{--workspace-blue:#2563eb;--workspace-ink:#0f172a;--workspace-muted:#64748b;--workspace-border:#e2e8f0;color:var(--workspace-ink);max-width:1440px;margin-inline:auto}
.workspace-screen .workspace-hero{position:relative;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:20px;padding:24px 28px;margin-bottom:18px;color:#fff;background:linear-gradient(135deg,#1d4ed8 0%,#2563eb 55%,#4f46e5 100%);border:0;border-radius:18px;box-shadow:0 12px 30px #2563eb24}
.workspace-screen .workspace-hero :is(h1,h2,h3){color:#fff!important;margin:0;font-weight:800}.workspace-screen .workspace-hero h1{font-size:clamp(1.4rem,2.4vw,2rem)}.workspace-screen .workspace-hero p{color:#dbeafe!important;margin:7px 0 0;line-height:1.65}.workspace-screen .workspace-hero [class$="title-icon"]{background:#ffffff20;color:#fff}
.workspace-panel{background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:24px;box-shadow:0 3px 12px #0f172a0f;margin-bottom:18px}.workspace-panel h2{font-size:1.25rem;font-weight:800;margin:0 0 12px}.workspace-muted{color:#64748b;line-height:1.7}.workspace-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}.workspace-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:43px;padding:10px 16px;border:1px solid #bfdbfe;border-radius:10px;background:#eff6ff;color:#1d4ed8;text-decoration:none;font-weight:750;cursor:pointer}.workspace-button.primary{background:#2563eb;border-color:#2563eb;color:#fff}.workspace-button:disabled{opacity:.55;cursor:not-allowed}.workspace-button:hover{filter:brightness(.97)}.workspace-status{display:inline-flex;border-radius:999px;padding:6px 11px;font-size:.75rem;font-weight:800;background:#eff6ff;color:#1d4ed8}.workspace-status.warning{background:#fef3c7;color:#92400e}.workspace-status.success{background:#dcfce7;color:#166534}
.workspace-screen :is(button,a,input,select,textarea,summary):focus-visible{outline:3px solid #93c5fd;outline-offset:3px}.workspace-screen .workspace-empty{text-align:center;padding:40px 20px;border:1px dashed #cbd5e1;border-radius:14px;background:#fff;color:#64748b}.workspace-screen .workspace-alert{padding:14px 18px;border:1px solid #fecaca;border-radius:12px;background:#fef2f2;color:#991b1b;margin-bottom:16px;line-height:1.7}.workspace-screen :is(.dashboard-card,.comparison-card,.report-card,.filter-panel){border-radius:16px;border-color:#e2e8f0;box-shadow:0 3px 12px #0f172a0a}.workspace-screen :is(table th){color:#475569;background:#f8fafc}.workspace-screen :is(table td,table th){font-variant-numeric:tabular-nums}.workspace-screen :is(.btn,.filter-button,.preview-print-button){border-radius:10px;min-height:38px}.workspace-screen .report-context{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;color:#64748b;font-size:.8rem;margin:10px 0 16px}
@media(max-width:768px){.workspace-screen .workspace-hero{padding:22px 20px;align-items:flex-start;flex-direction:column}.workspace-panel{padding:20px}.workspace-actions>*{flex:1 1 auto}}
@media(prefers-reduced-motion:reduce){.workspace-screen *{scroll-behavior:auto!important;transition:none!important}}
@media print{.workspace-screen .workspace-hero{background:none!important;color:#0f172a!important;box-shadow:none;border:0}.workspace-screen .workspace-hero :is(h1,h2,h3,p){color:#0f172a!important}.workspace-actions,.workspace-screen .report-context{display:none!important}}
@media screen{.workspace-screen .workspace-hero.workspace-hero{background:linear-gradient(135deg,#1d4ed8 0%,#2563eb 55%,#4f46e5 100%);border:0;border-radius:18px}.workspace-screen .workspace-hero [class*="subtitle"]{color:#dbeafe!important}}
.workspace-screen button:disabled,.workspace-screen .btn.disabled{opacity:.5;cursor:not-allowed}.workspace-screen .workspace-hero .so-breadcrumb,.workspace-screen .workspace-hero .so-breadcrumb-link{color:#dbeafe!important}.workspace-screen .workspace-hero .so-title-icon,.workspace-screen .workspace-hero .pos-heading-icon{background:#ffffff20;color:#fff}
.workspace-screen .workspace-hero .btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;background:#fff;color:#1d4ed8;border:1px solid #dbeafe;text-decoration:none}.workspace-screen .workspace-hero .btn:hover{background:#eff6ff;color:#1e40af}

/* Application-wide design tokens. Semantic success, warning, and danger colors remain distinct. */
:root {
    --n365-primary: #2563eb;
    --n365-primary-dark: #1d4ed8;
    --n365-primary-soft: #eff6ff;
    --n365-success: #15803d;
    --n365-success-soft: #ecfdf5;
    --n365-danger: #b91c1c;
    --n365-warning: #b45309;
    --n365-ink: #0f172a;
    --n365-muted: #64748b;
    --n365-border: #e2e8f0;
    --n365-canvas: #f4f7fb;
    --n365-radius: 16px;
    --n365-control-radius: 10px;
    --n365-hero: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #4f46e5 100%);
    --n365-auth-showcase: linear-gradient(135deg, #3267b3 0%, #3d70b8 55%, #5c68b1 100%);
    --n365-navigation: var(--n365-auth-showcase);
    --n365-shadow: 0 3px 12px rgb(15 23 42 / 5%);
}
.workspace-screen, .brand-screen { font-family: Arial, Helvetica, sans-serif; }
.workspace-screen *, .brand-screen * { box-sizing: border-box; }
.workspace-screen .workspace-hero :is(.title-icon,[class$="-title-icon"],.admin-icon,.company-icon,.page-icon) {
    display: grid; place-items: center; width: 52px; height: 52px; flex: 0 0 52px;
    border-radius: 14px; font-size: 24px; color: #fff; background: #ffffff20;
}
.workspace-screen .workspace-hero-heading { display: flex; align-items: center; gap: 15px; min-width: 0; }
.workspace-screen .workspace-hero-heading > div { min-width: 0; }
.workspace-screen .workspace-hero :is(.page-subtitle,[class$="-description"],[class$="-eyebrow"]) { color: #dbeafe; }
.workspace-screen .workspace-surface {
    background-color: #fff; border-color: var(--n365-border); border-radius: var(--n365-radius); box-shadow: var(--n365-shadow);
}
.workspace-screen .workspace-data-table { width: 100%; min-width: 640px; border-collapse: collapse; margin: 0; }
.workspace-screen .workspace-data-table :is(th,td) { padding: .75rem .9rem; border-bottom: 1px solid var(--n365-border); vertical-align: middle; font-size: .875rem; }
.workspace-screen .workspace-data-table th { font-weight: 800; white-space: nowrap; }
.workspace-screen .workspace-data-table tbody tr:hover { background: var(--n365-canvas); }
.sales-payment-print-source, .sales-invoice-print-source { display: none; }
.sales-print-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 1.15em; }
.sales-print-icon .sales-reprint-mark { position: absolute; right: -.45em; bottom: -.35em; display: grid; place-items: center; width: 1.05em; height: 1.05em; border-radius: 50%; background: #fff; font-size: .68em; font-weight: 900; }

/* Freight charge maintenance follows the other maintenance tables. */
.workspace-screen .jar-surface:has(.freight-table-wrap) { overflow: hidden; }
.workspace-screen .jar-surface:has(.freight-table-wrap) .maintenance-list-filters { padding: 16px; border-bottom: 1px solid var(--n365-border); grid-template-columns: minmax(0, 1fr); }
.workspace-screen .freight-table-wrap { overflow-x: auto; }
.workspace-screen .freight-table :is(th, td) { padding: 12px 15px; font-size: 11px; text-align: left; }
.workspace-screen .freight-table th { --bs-table-bg: #f7f9fc; background: #f7f9fc; color: #52657f; font-weight: 800; }
.workspace-screen .freight-table .freight-amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.workspace-screen .freight-table .freight-actions { text-align: center; width: 90px; }
.workspace-screen .freight-edit { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; color: #0369a1; background: #e0f2fe; }
.workspace-screen .freight-status { display: inline-block; padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.workspace-screen .freight-status.is-active { color: #047857; background: #d1fae5; }
.workspace-screen .freight-status.is-inactive { color: #64748b; background: #f1f5f9; }
@media (max-width: 650px) { .workspace-screen .freight-table { min-width: 560px; } .workspace-screen .freight-edit { width: 44px; height: 44px; } }
.workspace-screen .workspace-code { display: inline-flex; max-width: 100%; padding: .25rem .55rem; border-radius: 7px; color: var(--n365-primary-dark); background: var(--n365-primary-soft); font-weight: 800; overflow-wrap: anywhere; }
.workspace-screen .workspace-status.muted { color: var(--n365-muted); background: var(--n365-border); }
.workspace-screen .maintenance-list-filters { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(160px, 1fr) auto; gap: .75rem; align-items: end; padding: 1rem 0; }
.workspace-screen .maintenance-list-filters label { display: block; margin-bottom: .35rem; color: var(--n365-muted); font-size: .8rem; font-weight: 700; }
.workspace-screen .maintenance-search-box { display: block; position: relative; }
.workspace-screen .maintenance-search-box > i { position: absolute; left: .85rem; top: 50%; color: var(--n365-muted); transform: translateY(-50%); pointer-events: none; }
.workspace-screen .maintenance-search-input { padding-left: 2.5rem; padding-right: 2.5rem; }
.workspace-screen .maintenance-search-clear { position: absolute; right: .45rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--n365-muted); padding: .4rem; }
.workspace-screen .maintenance-list-filters > .btn { min-height: 43px; }
@media (max-width: 650px) { .workspace-screen .maintenance-list-filters { grid-template-columns: 1fr; } }
.workspace-screen .workspace-dialog, .workspace-dialog {
    border-radius: 18px; border-color: var(--n365-border); box-shadow: 0 24px 60px rgb(15 23 42 / 24%);
}
.workspace-screen :is(.form-control,.form-select,.field-control), .brand-screen :is(.form-control,.form-select) {
    border-color: #cbd5e1; border-radius: var(--n365-control-radius); min-height: 43px; font-size: 13px;
}
.workspace-screen :is(.form-control,.form-select,.field-control):focus,
.brand-screen :is(.form-control,.form-select):focus { border-color: #2563eb; box-shadow: 0 0 0 3px #2563eb1a; }
.workspace-screen :is(.field-label,.form-label) { color: #475569; font-size: 12px; font-weight: 700; }
.workspace-screen :is(.btn,.action-button,.audit-button) { border-radius: 10px; font-family: inherit; font-size: 13px; font-weight: 700; }
.workspace-screen .btn-primary { color: #fff; background: #2563eb; border-color: #2563eb; }
.workspace-screen .btn-primary:hover:not(:disabled) { background: #1d4ed8; border-color: #1d4ed8; }
.workspace-screen :is(.alert,.page-alert,.status-message) { border-radius: 12px; }
.workspace-screen :is(.table-wrap,.table-container) { max-width: 100%; overflow-x: auto; }
.workspace-screen :is(a,button,input,select,textarea):focus-visible,
.brand-screen :is(a,button,input,select,textarea):focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
.workspace-screen .workspace-hero :is(.action-button,.audit-button) { background: #fff; color: #1d4ed8; border-color: #dbeafe; }
.workspace-screen.workspace-special :is(.about-hero,.contact-hero,.welcome-hero) { display: block; text-align: center; }
.workspace-screen.workspace-special :is(.about-hero,.contact-hero) h1 span { color: #fff; }
.workspace-screen .welcome-hero .welcome-company { color: #fff; }
.brand-screen :is(.login-button,.signup-button,.button-primary) { background: var(--n365-hero); border-color: #2563eb; border-radius: 10px; }
.brand-screen :is(.login-button,.signup-button,.button-primary):hover:not(:disabled) { filter: brightness(.96); }
.brand-screen :is(.login-card,.signup-card) { border-radius: 18px; border-color: var(--n365-border); }
@media screen {
    .workspace-screen.workspace-business { width: 100%; margin: 0 auto; padding: 0 0 24px; background: transparent; min-width: 0; }
    .workspace-screen.workspace-business > :is(.inventory-dashboard,.sales-dashboard,.dashboard-container,.comparison-page,.aging-page,.statement-page,.stock-card-page,.variance-page,.inventory-transaction-page,.audit-page,.system-error-page,.visitor-page,.sh-page) { margin: 0; padding: 0; }
    .workspace-screen table :is(th,td) { font-size: 12px; }
    .workspace-screen .workspace-hero.workspace-hero { padding: 24px 28px; margin-bottom: 18px; }
}
@media (max-width: 768px) {
    .workspace-screen .workspace-hero.workspace-hero { padding: 22px 20px; }
    .workspace-screen .workspace-hero :is(.header-actions,.page-actions,.action-buttons,.adjustment-actions,.opening-actions) { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
    .workspace-screen .workspace-hero :is(.header-actions,.page-actions,.action-buttons,.adjustment-actions,.opening-actions) > :is(button,a) { flex: 1 1 auto; }
    .workspace-screen.workspace-special :is(.about-hero,.contact-hero) h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) { .brand-screen * { animation: none !important; transition: none !important; } }

/* Layout controls live outside the routed screen. */
.layout-skip-link { position: fixed; top: -80px; left: 16px; z-index: 11000; padding: 12px 18px; background: #fff; color: #1d4ed8; border: 2px solid #2563eb; border-radius: 10px; font-weight: 700; }
.layout-skip-link:focus { top: 12px; }
.app-shell .top-bar { height: auto; }
.sidebar-close-button { display: none; position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; place-items: center; color: #fff; background: #ffffff14; border: 1px solid #ffffff50; border-radius: 10px; cursor: pointer; z-index: 2; }
.sidebar-container.open .sidebar-close-button { display: grid; }
.sidebar-container.open .n365-brand { padding-right: 25px; }
.app-shell :is(.mobile-menu-button,.sidebar-close-button,.user-button,.branch-selector):focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
#main-content:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { .app-shell :is(.sidebar-container,.main-area,.user-button) { transition: none !important; } }
@media print { .layout-skip-link,.sidebar-close-button { display: none !important; } }

@media screen and (max-width: 600px) {
    .workspace-screen.workspace-business .workspace-hero.workspace-hero { padding: 16px; gap: 12px; margin-bottom: 14px; }
    .workspace-screen.workspace-business .workspace-hero p { margin-top: 4px; line-height: 1.45; }
    .workspace-screen.workspace-business .workspace-hero :is(.title-icon,[class$="-title-icon"],.admin-icon,.company-icon,.page-icon) { width: 40px; height: 40px; flex-basis: 40px; font-size: 20px; }
    .workspace-screen.workspace-business :is(.btn,.workspace-button) { min-height: 44px; }
    .workspace-screen.workspace-business .workspace-hero > * { min-width: 0; max-width: 100%; }
    .workspace-screen.workspace-business .workspace-hero :is(h1,h2,h3,p) { overflow-wrap: anywhere; }
}

/* Page isolation must not turn one dashboard's landscape page into every report's default. */
@media print {
    body:has(.print-report) * { visibility: hidden !important; }
    body:has(.print-report) .print-report, body:has(.print-report) .print-report * { visibility: visible !important; }
}

/* Signature green separators preserve inline brand typography. */
.n365-brand-dot { color: var(--n365-brand-accent, #15803d); font: inherit; }

.master-editor-header-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; min-width: 0; }
.master-editor-header-actions .btn { min-height: 44px; white-space: normal; }
@media (max-width: 768px) { .master-editor-header-actions { width: 100%; justify-content: flex-start; } }

/* Self-contained alert dismissal; no Bootstrap CSS dependency. */
.alert.alert-dismissible { position: relative; box-sizing: border-box; min-height: 56px; margin-bottom: 16px; padding: 16px 60px 16px 16px; border: 1px solid transparent; border-radius: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.alert.alert-dismissible > i { margin-right: 8px; }
.alert.alert-dismissible.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert.alert-dismissible.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert.alert-dismissible.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.btn-close { position: relative; display: inline-block; flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; vertical-align: middle; }
.btn-close::before, .btn-close::after { content: ""; position: absolute; top: 21px; left: 13px; width: 18px; height: 2px; border-radius: 1px; background: currentColor; transform: rotate(45deg); }
.btn-close::after { transform: rotate(-45deg); }
.alert-dismissible > .btn-close { position: absolute; top: 6px; right: 6px; }
.btn-close:hover:not(:disabled) { background: rgb(0 0 0 / 8%); }
.btn-close:focus-visible { outline: 3px solid currentColor; outline-offset: 1px; }
.btn-close:disabled { opacity: .5; cursor: not-allowed; }
.workspace-pagination{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;padding:12px 16px;border-top:1px solid var(--n365-border,#dbe4ef);background:#fff;color:var(--n365-muted,#64748b);font-size:12px}.workspace-pagination-summary strong{color:var(--n365-ink,#172033);font-variant-numeric:tabular-nums}.workspace-pagination-controls{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.workspace-page-size-label{display:flex;align-items:center;gap:8px;margin:0;font-size:12px}.workspace-page-size-label .form-select{width:76px;min-height:36px;padding:5px 26px 5px 9px;border-color:var(--n365-border,#dbe4ef);font-size:12px}.workspace-page-status{margin:0 4px 0 8px;white-space:nowrap}.workspace-page-button{display:grid;place-items:center;min-width:36px;height:36px;padding:0 9px;border:1px solid var(--n365-border,#dbe4ef);border-radius:8px;background:#fff;color:var(--n365-ink,#172033);font-weight:700}.workspace-page-button:hover:not(:disabled){border-color:var(--n365-primary,#2563eb);color:var(--n365-primary,#2563eb);background:var(--n365-primary-soft,#eff6ff)}.workspace-page-button.active{border-color:var(--n365-primary,#2563eb);background:var(--n365-primary,#2563eb);color:#fff}.workspace-page-button:disabled{opacity:.45;cursor:not-allowed}@media(max-width:600px){.workspace-pagination{align-items:flex-start;flex-direction:column}.workspace-pagination-controls{width:100%;justify-content:flex-start}.workspace-page-status{margin-left:auto}}

/* Shared role-permission notice rendered by MainLayout on CRUD-capable screens. */
.view-only-access-banner{display:flex;align-items:flex-start;gap:12px;margin:0 0 16px;padding:13px 16px;border:1px solid #bfdbfe;border-radius:12px;background:#eff6ff;color:#1e3a8a;line-height:1.5}
.view-only-access-banner>i{flex:0 0 auto;margin-top:2px;color:#2563eb;font-size:18px}
.view-only-access-banner>div{display:grid;gap:2px;min-width:0}
.view-only-access-banner strong{font-size:13px;font-weight:800}
.view-only-access-banner span{font-size:13px;color:#334e75}
#main-content[data-view-only="true"] [data-view-only-disabled]{opacity:.58;cursor:not-allowed}
@media(max-width:600px){.view-only-access-banner{padding:12px;gap:9px}}
.n365-legal-hero-content { min-width:0; width:100%; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:1.25rem; }
.n365-legal-hero-title { flex:1 1 18rem; min-width:0; text-align:right; }
.n365-legal-brand { display:inline-flex; align-items:center; gap:.75rem; margin:0; color:#fff; text-decoration:none; }
.n365-legal-brand:hover { color:#fff; }
.n365-legal-brand img { flex:0 0 58px; width:58px; height:58px; border-radius:14px; background:#fff; }
.n365-legal-brand span { display:flex; flex-direction:column; line-height:1.2; }
.n365-legal-brand strong { font-size:1.12rem; letter-spacing:.025em; }
.n365-legal-brand strong b, .n365-legal-brand small b { color:#bbf7d0; }
.n365-legal-brand small { margin-top:.2rem; color:#e2eaff; font-size:.62rem; font-weight:800; letter-spacing:.08em; }
.n365-legal-brand .n365-legal-brand-tagline { color:#e2eaff; font-size:.73rem; letter-spacing:0; }

/* On phones, keep each list's pager after its results. */
@media (max-width: 650px) {
    :is(section, div):has(> .workspace-pagination ~ :is(div, section):has(table), > .workspace-pagination ~ .order-list):not(:has(> .workspace-pagination ~ .workspace-pagination)) {
        display: flex;
        flex-direction: column;
    }
    :is(section, div):has(> .workspace-pagination ~ :is(div, section):has(table), > .workspace-pagination ~ .order-list):not(:has(> .workspace-pagination ~ .workspace-pagination)) > .workspace-pagination {
        order: 1;
    }
}
.pager-mobile-only { display: none; }
/* Consistent selected state for the established transaction and maintenance tabs. */
.workspace-screen button:is(.tab, .adjustment-tab, .catalog-tab, .chart-tab, .error-tab, .lookup-tab, .opening-tab, .pc-tab, .permission-tab, .shipment-tab).active,
.workspace-screen .nav-tabs .nav-link.active,
.workspace-screen button[role="tab"][aria-selected="true"] {
    background-color: #dbeafe;
    color: #123b91;
    font-weight: 750;
}
@media (max-width: 650px) {
    .pager-desktop-only { display: none; }
    .pager-mobile-only { display: block; }
}
