/* ==========================================================================
   Pioneers Enterprise — Accounting & Financial Systems Visual Style
   Unified with Brand Guidelines: Pioneers Burgundy (#7C193F), Charcoal (#322E29),
   Heritage Bronze (#B39A6D), Warm Ivory (#FCFAF6), Soft Cream (#F2EEE6)
   ========================================================================== */

:root {
    --ac-burgundy: #7C193F;
    --ac-burgundy-dark: #651331;
    --ac-burgundy-subtle: rgba(124, 25, 63, 0.08);
    --ac-gold: #B39A6D;
    --ac-gold-light: #E8DEC8;
    --ac-gold-subtle: rgba(179, 154, 109, 0.12);
    --ac-ink: #181715;
    --ac-ink-2: #322E29;
    --ac-stone: #5B534A;
    --ac-cream: #F2EEE6;
    --ac-paper: #FCFAF6;
    --ac-surface: #FFFFFF;
    --ac-muted: #746F68;
    --ac-line: #D8D0C4;
    --ac-line-subtle: #EBE5DC;
    --ac-green: #1B6A3B;
    --ac-green-bg: #EAF5EE;
    --ac-red: #7C193F;
    --ac-red-bg: #FDF0F3;
    --ac-amber: #9A5B13;
    --ac-amber-bg: #FDF4E6;
    --ac-blue: #3E5A74;
    --ac-blue-bg: #EDF3F8;
    --ac-shadow: 0 1px 3px rgba(50, 46, 41, 0.05), 0 4px 16px rgba(50, 46, 41, 0.04);
    --ac-border: var(--ac-line);
}

/* Topbar Company Selector */
.topbar-company-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--ac-line);
    color: var(--ac-ink);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(23, 28, 38, 0.04);
    transition: all 0.2s ease;
}

.topbar-company-select:hover {
    border-color: var(--ac-gold);
    box-shadow: 0 4px 12px rgba(185, 154, 93, 0.15);
}

.company-badge-icon {
    color: var(--ac-gold);
    font-size: 13px;
}

/* Financial Heading & Actions */
.finance-page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 26px;
    flex-wrap: wrap;
    gap: 16px;
}

.finance-page-heading h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--ac-ink);
    margin: 4px 0 6px 0;
    letter-spacing: -0.5px;
}

.finance-page-heading p {
    color: var(--ac-muted);
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

.heading-actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Financial KPI Summary Cards */
.financial-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1100px) {
    .financial-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .financial-kpi-grid {
        grid-template-columns: 1fr;
    }
}

.financial-kpi-card {
    background: var(--ac-paper);
    border: 1px solid var(--ac-line);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--ac-shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.financial-kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--ac-gold);
}

.financial-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    height: 3px;
    background: var(--ac-line);
}

.financial-kpi-card.kpi-receivable::before { background: var(--ac-blue); }
.financial-kpi-card.kpi-payable::before { background: var(--ac-amber); }
.financial-kpi-card.kpi-cash::before { background: var(--ac-green); }
.financial-kpi-card.kpi-gold::before { background: var(--ac-gold); }

.kpi-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.kpi-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ac-muted);
}

.kpi-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 15px;
}

.kpi-icon-badge.gold { background: #f4eee1; color: #9a7c42; }
.kpi-icon-badge.blue { background: #e9eef4; color: #4b6481; }
.kpi-icon-badge.green { background: #e7f1ed; color: #437565; }
.kpi-icon-badge.amber { background: #fef3c7; color: #b45309; }

.kpi-val {
    font-family: "DM Sans", "Noto Kufi Arabic", sans-serif;
    font-size: 24px;
    font-weight: 750;
    color: var(--ac-ink);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.kpi-foot {
    font-size: 11px;
    color: var(--ac-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Unified Panels and Tables */
.finance-panel {
    background: var(--ac-paper);
    border: 1px solid var(--ac-line);
    border-radius: 10px;
    box-shadow: var(--ac-shadow);
    padding: 0;
    margin-bottom: 24px;
    overflow: hidden;
}

.finance-toolbar {
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--ac-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.finance-search-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--ac-line);
    background: #faf9f7;
    padding: 7px 14px;
    border-radius: 7px;
    width: 320px;
    max-width: 100%;
    transition: all 0.2s ease;
}

.finance-search-box:focus-within {
    background: #ffffff;
    border-color: var(--ac-gold);
    box-shadow: 0 0 0 3px rgba(185, 154, 93, 0.15);
}

.finance-search-box input {
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ac-ink);
    font-size: 12px;
    width: 100%;
}

.finance-table {
    width: 100%;
    border-collapse: collapse;
    text-align: start;
}

.finance-table th {
    padding: 12px 18px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ac-muted);
    background: #faf9f7;
    border-bottom: 1px solid var(--ac-line);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.finance-table td {
    padding: 14px 18px;
    font-size: 13px;
    color: var(--ac-ink);
    border-bottom: 1px solid var(--ac-line-subtle);
    vertical-align: middle;
}

.finance-table tbody tr:hover {
    background: #fdfbf7;
}

.finance-table td.num-col, .finance-table th.num-col {
    text-align: end;
    font-feature-settings: "tnum";
    font-family: "DM Sans", "Noto Kufi Arabic", sans-serif;
}

/* Status Badges */
.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.status-tag.paid, .status-tag.posted, .status-tag.active, .status-tag.converted {
    background: var(--ac-green-bg);
    color: var(--ac-green);
}

.status-tag.draft {
    background: #f1f3f5;
    color: #495057;
}

.status-tag.sent, .status-tag.open, .status-tag.issued {
    background: var(--ac-blue-bg);
    color: var(--ac-blue);
}

.status-tag.overdue, .status-tag.void, .status-tag.rejected {
    background: var(--ac-red-bg);
    color: var(--ac-red);
}

.status-tag.partiallypaid, .status-tag.pendingapproval {
    background: var(--ac-amber-bg);
    color: var(--ac-amber);
}

/* Report Viewers & Printable Statements */
.statement-card {
    background: var(--ac-paper);
    border: 1px solid var(--ac-line);
    border-radius: 10px;
    padding: 32px 36px;
    box-shadow: var(--ac-shadow);
    margin-bottom: 24px;
}

.statement-header-banner {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ac-line);
}

.statement-header-banner h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--ac-ink);
    margin: 0 0 4px 0;
}

.statement-header-banner h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--ac-gold);
    margin: 0 0 6px 0;
    letter-spacing: 0.5px;
}

.statement-header-banner .report-date-range {
    font-size: 12px;
    color: var(--ac-muted);
}

.statement-table-view {
    width: 100%;
    border-collapse: collapse;
}

.statement-table-view th {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ac-muted);
    border-bottom: 2px solid var(--ac-line);
}

.statement-table-view td {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--ac-ink);
    border-bottom: 1px solid var(--ac-line-subtle);
}

.statement-table-view tr.section-header td {
    background: #faf8f4;
    color: var(--ac-ink);
    font-weight: 750;
    font-size: 13px;
    padding-top: 14px;
    padding-bottom: 14px;
    border-top: 1px solid var(--ac-line);
    border-bottom: 1px solid var(--ac-line);
}

.statement-table-view tr.section-total td {
    font-weight: 750;
    background: #fdfcf9;
    border-top: 1px solid var(--ac-line);
    border-bottom: 2px solid var(--ac-line);
}

.statement-table-view tr.grand-total td {
    font-size: 15px;
    font-weight: 850;
    color: var(--ac-ink);
    border-top: 2px solid var(--ac-ink);
    border-bottom: 3px double var(--ac-ink);
    background: #fbf9f4;
}

/* Modals & Drawers */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(23, 28, 38, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease-out;
}

.modal-dialog-card {
    background: #ffffff;
    border: 1px solid var(--ac-line);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(23, 28, 38, 0.2);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    color: var(--ac-ink);
    animation: slideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header-bar {
    padding: 18px 24px;
    border-bottom: 1px solid var(--ac-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #faf8f4;
}

.modal-header-bar h2, .modal-header-bar h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 750;
    color: var(--ac-ink);
}

.modal-body-content {
    padding: 24px;
}

.modal-footer-bar {
    padding: 16px 24px;
    border-top: 1px solid var(--ac-line);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #faf8f4;
}

/* Modal Form Inputs */
.finance-input, .finance-select {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--ac-line);
    color: var(--ac-ink);
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 13px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.finance-input:focus, .finance-select:focus {
    border-color: var(--ac-gold);
    box-shadow: 0 0 0 3px rgba(185, 154, 93, 0.18);
    outline: none;
}

.finance-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #4d5663;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Clean Button Styles */
.btn-gold {
    background: var(--ac-gold);
    color: #ffffff;
    border: 1px solid #a88a4e;
    padding: 9px 18px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(185, 154, 93, 0.2);
}

.btn-gold:hover {
    background: #a88a4e;
    transform: translateY(-1px);
}

.btn-soft {
    background: #ffffff;
    color: var(--ac-ink);
    border: 1px solid var(--ac-line);
    padding: 9px 16px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-soft:hover {
    background: #f7f5f0;
    border-color: #d1cdc4;
    text-decoration: none;
}

.btn-soft:focus,.btn-soft:active,.btn-soft:visited { text-decoration:none; }

.btn-soft.active {
    background: var(--ac-ink);
    color: #ffffff;
    border-color: var(--ac-ink);
}

.btn-danger-soft {
    background: var(--ac-red-bg);
    color: var(--ac-red);
    border: 1px solid #fecaca;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.btn-danger-soft:hover {
    background: #fee2e2;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive accounting workspaces */
@media (max-width: 760px) {
    .finance-toolbar { align-items: stretch; padding: 14px; }
    .finance-toolbar > * { max-width: 100%; }
    .finance-search-box { width: 100%; min-height: 44px; }
    .finance-panel > .finance-table,
    .modal-body-content > .finance-table,
    .statement-card .statement-table-view {
        display: block;
        width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }
    .finance-panel > .finance-table thead,
    .finance-panel > .finance-table tbody,
    .modal-body-content > .finance-table thead,
    .modal-body-content > .finance-table tbody,
    .statement-card .statement-table-view thead,
    .statement-card .statement-table-view tbody { display:table; width:720px; table-layout:auto; }
    .finance-table th,.finance-table td { padding: 12px 14px; white-space: nowrap; }
    .statement-card { padding: 22px 16px; overflow:hidden; }
    .modal-overlay { padding: 8px; align-items: flex-end; }
    .modal-dialog-card { max-height: calc(100dvh - 16px); border-radius: 10px 10px 0 0; }
    .modal-header-bar,.modal-body-content,.modal-footer-bar { padding-inline: 16px; }
    .modal-footer-bar { position: sticky; bottom: 0; z-index: 2; flex-wrap: wrap; }
    .modal-footer-bar > button,.modal-footer-bar > a { min-height: 44px; flex: 1 1 140px; justify-content: center; }
    .financial-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
    .financial-kpi-card { padding: 15px; }
}
@media (max-width: 390px) { .financial-kpi-grid { grid-template-columns: 1fr; } }

/* Financial statements print as documents, never as application screenshots. */
@media print {
    @page { size: A4 portrait; margin: 14mm 12mm 16mm; }

    html,body {
        width:auto!important;
        min-width:0!important;
        margin:0!important;
        padding:0!important;
        overflow:visible!important;
        background:#fff!important;
        color:#111!important;
    }

    .sidebar,.topbar,.mobile-nav-backdrop,.command-palette-backdrop,
    .user-menu-backdrop,.user-dropdown-menu,.quick-create-dropdown,
    .action-center-dropdown { display:none!important; }

    .app-shell,.app-shell.sidebar-collapsed {
        display:block!important;
        min-height:0!important;
        background:#fff!important;
    }

    html[dir] .app-shell main,.app-shell main,.app-shell.sidebar-collapsed main {
        width:auto!important;
        min-height:0!important;
        margin:0!important;
        padding:0!important;
        background:#fff!important;
    }

    .content {
        width:auto!important;
        max-width:none!important;
        margin:0!important;
        padding:0!important;
        background:#fff!important;
    }

    .content > *:not(.statement-card) { display:none!important; }

    .statement-card {
        display:block!important;
        width:100%!important;
        max-width:none!important;
        margin:0!important;
        padding:0!important;
        overflow:visible!important;
        border:0!important;
        border-radius:0!important;
        box-shadow:none!important;
        background:#fff!important;
        break-inside:auto;
    }

    .statement-header-banner { margin-bottom:14mm; padding-bottom:7mm; }
    .statement-table-view { display:table!important; width:100%!important; overflow:visible!important; }
    .statement-table-view thead,.statement-table-view tbody { display:table-row-group!important; width:auto!important; }
    .statement-table-view thead { display:table-header-group!important; }
    .statement-table-view tr { break-inside:avoid; page-break-inside:avoid; }
    .statement-table-view th,.statement-table-view td { padding:7px 9px; }
    .statement-card,.statement-card * { box-shadow:none!important; text-shadow:none!important; }
    .statement-card a { color:inherit!important; text-decoration:none!important; }
}

/* Shared previews for transaction documents. */
.document-sheet{background:#fff}
.document-print-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:22px;padding-bottom:16px;border-bottom:2px solid var(--ac-line)}
.document-print-heading h2{margin:0 0 4px;font-size:20px;color:var(--ac-ink)}
.document-print-heading small{display:block;color:var(--ac-gold);font-weight:800;letter-spacing:.14em}
.document-print-heading>div:last-child{display:grid;justify-items:end;gap:7px;font-family:monospace}
.document-print-meta{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-bottom:20px;color:var(--ac-ink);font-size:12px}
.document-print-meta>div{display:flex;flex-direction:column;gap:4px}.document-print-meta>div:last-child{text-align:end}.document-print-meta small{color:var(--ac-muted);font-weight:700}.document-print-meta b{font-size:14px}
.document-print-totals{width:min(100%,320px);margin:18px 0 0 auto;display:flex;flex-direction:column;gap:7px;font-size:12px}.document-print-totals>span,.document-print-totals>strong{display:flex;justify-content:space-between;gap:20px}.document-print-totals>strong{padding-top:8px;border-top:1px solid var(--ac-line);font-size:14px}
@media(max-width:600px){.document-print-heading{flex-direction:column}.document-print-meta{grid-template-columns:1fr}.document-print-heading>div:last-child{justify-items:start}.document-print-meta>div:last-child{text-align:start}.document-print-totals{width:100%}}

.entity-name-link{display:inline-flex;align-items:center;gap:6px;color:var(--ac-ink);font-weight:750;text-decoration:none}.entity-name-link span{color:var(--ac-gold);font-size:10px;opacity:0;transform:translate(-3px,3px);transition:.15s}.entity-name-link:hover{color:#76583e;text-decoration:underline;text-underline-offset:3px}.entity-name-link:hover span{opacity:1;transform:none}
.customer-profile-loading,.customer-profile-empty{padding:70px 24px;text-align:center;color:var(--ac-muted)}
.customer-profile-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:24px}.customer-profile-head h1{margin:8px 0 5px;font-size:42px;line-height:1;color:var(--ac-ink)}.customer-profile-head p{margin:0;color:var(--ac-muted)}.profile-back-link{display:block;width:max-content;margin-bottom:24px;color:#76583e;font-size:11px;font-weight:700;text-decoration:none}
.customer-metric-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:18px}.customer-metric-grid article{padding:20px;background:#fff;border:1px solid var(--ac-line);border-top:3px solid #a98662}.customer-metric-grid small,.customer-metric-grid strong{display:block}.customer-metric-grid small{color:var(--ac-muted);font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.07em}.customer-metric-grid strong{margin-top:10px;color:var(--ac-ink);font-size:22px}
.customer-profile-layout{display:grid;grid-template-columns:.8fr 1.2fr;gap:16px}.customer-info-card{grid-row:span 2;padding:24px}.customer-info-card header,.customer-activity-card header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-bottom:15px;border-bottom:1px solid var(--ac-line)}.customer-info-card h2,.customer-activity-card h2{margin:0;font-size:16px}.customer-info-card dl{display:grid;grid-template-columns:1fr 1fr;gap:0;margin:8px 0 0}.customer-info-card dl>div{padding:15px 0;border-bottom:1px solid #eee8df}.customer-info-card dl>div:nth-child(odd){padding-inline-end:14px}.customer-info-card .wide{grid-column:1/-1}.customer-info-card dt{color:var(--ac-muted);font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.07em}.customer-info-card dd{margin:5px 0 0;color:var(--ac-ink);font-size:12px;font-weight:600}.customer-info-card dd a{color:#76583e}
.customer-activity-card{padding:20px}.customer-activity-card header>a{color:#76583e;font-size:10px;font-weight:700;text-decoration:none}.profile-empty-state{padding:35px 10px;text-align:center;color:var(--ac-muted);font-size:11px}.profile-transaction-list{display:flex;flex-direction:column}.profile-transaction-list>a{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:12px 3px;border-bottom:1px solid #eee8df;color:var(--ac-ink);text-decoration:none}.profile-transaction-list>a:last-child{border:0}.profile-transaction-list>a:hover b{color:#76583e}.profile-transaction-list b,.profile-transaction-list small{display:block}.profile-transaction-list b{font-size:11px}.profile-transaction-list small{margin-top:3px;color:var(--ac-muted);font-size:9px}.profile-transaction-list strong{font-size:11px}.profile-transaction-list .received{color:var(--ac-green)}
@media(max-width:900px){.customer-profile-head{align-items:flex-start;flex-direction:column}.customer-metric-grid{grid-template-columns:1fr 1fr}.customer-profile-layout{grid-template-columns:1fr}.customer-info-card{grid-row:auto}}
@media(max-width:560px){.customer-profile-head h1{font-size:30px}.customer-profile-head .heading-actions{width:100%}.customer-profile-head .heading-actions>*{flex:1;justify-content:center}.customer-metric-grid{grid-template-columns:1fr}.customer-info-card dl{grid-template-columns:1fr}.customer-info-card .wide{grid-column:auto}}

/* Separate record navigation from transaction creation. */
.transaction-create-zone{display:flex!important;flex-direction:column;align-items:flex-start!important;gap:7px!important;padding:12px!important;border:1px solid #d8cfc3;background:#f8f4ed;overflow:visible!important}
.transaction-zone-label{color:#84694f;font-size:8px;font-weight:800;letter-spacing:.14em;line-height:1;text-transform:uppercase}
.transaction-create-zone .primary-button{min-width:220px}
.record-view-switcher{display:grid;grid-template-columns:180px repeat(2,minmax(250px,1fr));gap:8px;margin:-8px 0 18px;padding:8px;border:1px solid #d9d0c4;background:#eae2d7}
.record-view-intro{display:flex;flex-direction:column;justify-content:center;padding:8px 12px;border-inline-end:1px solid #cfc3b5}.record-view-intro span{color:#8a6848;font-size:8px;font-weight:800;letter-spacing:.13em}.record-view-intro strong{margin-top:4px;color:#282521;font-size:11px}
.record-view-option{min-height:62px;display:grid;grid-template-columns:34px 1fr auto;align-items:center;gap:10px;padding:9px 13px;border:1px solid transparent;background:rgba(255,255,255,.55);color:#282521;text-align:start;cursor:pointer;transition:.16s ease}.record-view-option:hover{border-color:#b69a7d;background:#fff}.record-view-option.active{border-color:#282521;background:#282521;color:#fff;box-shadow:inset 3px 0 #c29a72}.record-view-icon{width:32px;height:32px;display:grid;place-items:center;border:1px solid #cdbda9;color:#8a6848;font-size:15px}.record-view-option.active .record-view-icon{border-color:#765e47;color:#d5ad84}.record-view-copy b,.record-view-copy small{display:block}.record-view-copy b{font-size:11.5px}.record-view-copy small{margin-top:3px;color:#7d756d;font-size:8.5px}.record-view-option.active .record-view-copy small{color:#c8beb4}.record-view-count{min-width:26px;height:26px;display:grid;place-items:center;border:1px solid #cfc3b5;border-radius:50%;font-size:9px;font-weight:800}.record-view-option.active .record-view-count{border-color:#725d49;color:#d9b58f}
@media(max-width:900px){.record-view-switcher{grid-template-columns:1fr 1fr;margin-top:0}.record-view-intro{grid-column:1/-1;display:block;border-inline-end:0;border-bottom:1px solid #cfc3b5}.record-view-intro strong{margin-inline-start:8px}.transaction-create-zone{width:auto!important;flex:none!important}}
@media(max-width:600px){.record-view-switcher{grid-template-columns:1fr}.record-view-option{min-width:0}.transaction-create-zone,.transaction-create-zone .primary-button{width:100%!important}.record-view-intro{grid-column:auto}.record-view-intro strong{display:block;margin:4px 0 0}}

.sales-workflow-strip{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:-8px 0 18px;padding:11px 14px;border:1px solid #d9d0c4;background:#f8f4ed}.sales-workflow-strip>span{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border:1px solid #d8cfc3;background:#fff;color:#766f67;font-size:9px}.sales-workflow-strip>span.active{border-color:#a98662;color:#282521}.sales-workflow-strip>span b{font-size:10px}.sales-workflow-strip>i{color:#a98662;font-style:normal}.sales-workflow-strip>small{margin-inline-start:auto;color:#766f67;font-size:9px}.order-source-reference{display:block;margin-top:3px;color:#817970;font-size:8px;font-family:var(--font-sans)}.workflow-conversion-note{display:flex;align-items:center;gap:12px;margin-bottom:18px;padding:13px;border:1px solid #dbcdbd;background:#faf7f1}.workflow-conversion-note>span{font-size:22px}.workflow-conversion-note b,.workflow-conversion-note small{display:block}.workflow-conversion-note b{font-size:12px}.workflow-conversion-note small{margin-top:4px;color:#766f67;font-size:9.5px}.finance-error{margin:10px 0;padding:10px 13px;border:1px solid #e4aaa4;background:#fff1ef;color:#8f3028;font-size:10px;white-space:pre-wrap}.workflow-error{margin-top:-8px;margin-bottom:16px}.finance-form-grid.two-cols{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media(max-width:650px){.sales-workflow-strip>small{width:100%;margin:0}.finance-form-grid.two-cols{grid-template-columns:1fr}}

/* Procurement sourcing workflow */
.procurement-workflow-strip{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:-8px 0 18px;padding:11px 14px;border:1px solid #d9d0c4;background:#f8f4ed}.procurement-workflow-strip>span{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border:1px solid #d8cfc3;background:#fff;color:#766f67;font-size:9px}.procurement-workflow-strip>span.active{border-color:#a98662;color:#282521}.procurement-workflow-strip>span b{font-size:10px}.procurement-workflow-strip>i{color:#a98662;font-style:normal}.procurement-workflow-strip>small{margin-inline-start:auto;color:#766f67;font-size:9px}.quotation-comparison-list{display:grid;gap:16px}.quotation-comparison-card{overflow:hidden;border:1px solid #ded6cc;background:#fff;box-shadow:0 10px 28px rgba(49,41,32,.06)}.quotation-comparison-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 18px;border-bottom:1px solid #e5ded5;background:#faf8f4}.quotation-comparison-header h3{margin:0;font-size:15px}.quotation-comparison-header small{display:block;margin-top:4px;color:#7a736b;font-size:9px}.comparison-table-wrap{overflow-x:auto}.comparison-table-wrap table{min-width:780px}.best-quotation{background:#fbf7ef}.best-price-label{display:inline-flex;margin-inline-start:6px;padding:3px 7px;border:1px solid #c7a879;background:#fff8e9;color:#775b32;font-size:8px;font-weight:700}.quote-header-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.quote-lines-table td small{display:block;color:#7a736b;font-size:8px}.quote-lines-table input{min-width:88px}.quote-lines-table td:first-child{min-width:190px}
@media(max-width:650px){.procurement-workflow-strip{gap:6px;padding:9px}.procurement-workflow-strip>span{flex:1 1 calc(50% - 6px);justify-content:center;text-align:center}.procurement-workflow-strip>i{display:none}.procurement-workflow-strip>small{width:100%;margin:0}.quotation-comparison-header{align-items:flex-start;flex-direction:column}.quote-header-grid{grid-template-columns:1fr}}

/* Readable customer directory */
.customer-table-scroll{width:100%;overflow:hidden}.customer-directory-table{width:100%;min-width:0;table-layout:fixed}.customer-directory-table th{padding:13px 12px;line-height:1.45;white-space:normal}.customer-directory-table td{padding:15px 12px;line-height:1.5;overflow-wrap:anywhere}.customer-directory-table tbody tr:nth-child(even){background:#fcfaf7}.customer-directory-table tbody tr:hover{background:#f8f2e9}.customer-directory-table .customer-col-identity{width:24%}.customer-directory-table .customer-col-contact{width:24%}.customer-directory-table .customer-col-tax{width:14%}.customer-directory-table .customer-col-finance{width:24%}.customer-directory-table .customer-col-controls{width:14%}.customer-company-name{margin-top:4px;color:var(--ac-muted);font-size:11px;font-weight:600}.customer-contact-cell{color:#495057;font-size:12px}.customer-contact-cell>a{display:block;margin-bottom:3px;color:var(--ac-ink);text-decoration:none}.customer-contact-cell>a:hover{text-decoration:underline}.customer-finance-cell{display:flex;align-items:center;gap:18px}.customer-finance-cell>div{min-width:0}.customer-finance-cell small,.customer-finance-cell strong{display:block}.customer-finance-cell small{margin-bottom:3px;color:var(--ac-muted);font-size:8px}.customer-finance-cell strong{font-size:11px;white-space:nowrap}.customer-controls-cell{text-align:center}.customer-controls-cell>.status-tag{margin-bottom:7px}.customer-controls-cell>.btn-soft{margin:auto;white-space:nowrap}.customer-directory-table .entity-name-link{font-size:13px}
@media(max-width:760px){.customer-table-scroll{overflow:visible}.customer-directory-table{display:block!important;min-width:0}.customer-directory-table colgroup,.customer-directory-table thead{display:none!important}.customer-directory-table tbody{display:grid!important;width:auto!important;padding:12px;gap:12px}.customer-directory-table tr{display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--ac-line);border-radius:8px;background:#fff!important;overflow:hidden}.customer-directory-table td{display:flex;min-width:0;padding:10px 12px!important;border-bottom:1px solid var(--ac-line-subtle);white-space:normal!important;align-items:flex-start;justify-content:space-between;gap:12px;text-align:start!important}.customer-directory-table td::before{content:attr(data-label);flex:0 0 42%;color:var(--ac-muted);font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.35px}.customer-directory-table td:first-child{grid-column:1/-1;display:block;padding:14px!important;background:#faf8f4}.customer-directory-table td:first-child::before{display:none}.customer-directory-table .customer-contact-cell{grid-column:1/-1}.customer-directory-table .customer-finance-cell{display:flex;align-items:flex-start}.customer-directory-table .customer-controls-cell{align-items:center}.customer-directory-table .customer-controls-cell>.status-tag{margin:0}.customer-directory-table .customer-controls-cell>.btn-soft{margin:0;justify-content:center}}
@media(max-width:480px){.customer-directory-table tr{grid-template-columns:1fr}.customer-directory-table td,.customer-directory-table .customer-contact-cell{grid-column:1}.customer-directory-table td:first-child{grid-column:1}}

.customer-issue-menu{position:relative;z-index:6}.customer-issue-trigger{display:inline-flex;align-items:center;gap:7px;white-space:nowrap}.customer-issue-trigger b{margin-inline-start:3px;color:#d8bd91;font-size:12px}.customer-issue-backdrop{position:fixed;inset:0;z-index:1;border:0;background:transparent}.customer-issue-dropdown{position:absolute;z-index:2;top:calc(100% + 8px);inset-inline-end:0;width:310px;border:1px solid #d8cec1;background:#fff;box-shadow:0 20px 50px rgba(33,28,23,.18);padding:7px}.customer-issue-dropdown header{padding:10px 11px 12px;border-bottom:1px solid #eee7de}.customer-issue-dropdown header small,.customer-issue-dropdown header strong{display:block}.customer-issue-dropdown header small{color:var(--ac-muted);font-size:8px}.customer-issue-dropdown header strong{margin-top:3px;font-size:11px}.customer-issue-dropdown>a{display:flex;align-items:center;gap:11px;padding:11px;color:var(--ac-ink);text-decoration:none;border-bottom:1px solid #f0ebe4}.customer-issue-dropdown>a:last-child{border:0}.customer-issue-dropdown>a:hover{background:#f8f4ed}.customer-issue-dropdown>a>span{flex:none;width:31px;height:31px;display:grid;place-items:center;background:#f1ebe2;color:#8b6746}.customer-issue-dropdown a b,.customer-issue-dropdown a small{display:block}.customer-issue-dropdown a b{font-size:10px}.customer-issue-dropdown a small{margin-top:2px;color:var(--ac-muted);font-size:8px}
@media(max-width:560px){.customer-issue-menu{flex:1}.customer-issue-trigger{width:100%;justify-content:center}.customer-issue-dropdown{position:fixed;inset:auto 10px 10px;width:auto;max-height:calc(100dvh - 80px);overflow:auto}}
.customer-items-card{grid-column:2}.customer-items-card header>span{color:var(--ac-muted);font-size:9px}.profile-item-list>div{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:11px 3px;border-bottom:1px solid #eee8df}.profile-item-list>div:last-child{border:0}.profile-item-list span:last-child{text-align:end}.profile-item-list b,.profile-item-list small,.profile-item-list strong{display:block}.profile-item-list b{font-size:10px}.profile-item-list small{margin-top:3px;color:var(--ac-muted);font-size:8px}.profile-item-list strong{font-size:10px}.vendor-profile-layout .customer-info-card{grid-row:span 3}@media(max-width:900px){.customer-items-card{grid-column:auto}.vendor-profile-layout .customer-info-card{grid-row:auto}}

/* Inventory pages use the shared accounting primitives below. */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow-y: auto;
    background: rgba(27, 24, 21, .58);
    backdrop-filter: blur(5px);
    animation: fadeIn .16s ease-out;
}

.modal-content {
    width: min(100%, 640px);
    max-height: min(88vh, 880px);
    max-height: min(88dvh, 880px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d9d0c4;
    border-radius: 12px;
    box-shadow: 0 28px 80px rgba(24, 20, 17, .28);
    color: var(--ac-ink);
    animation: slideUp .2s cubic-bezier(.16,1,.3,1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ac-line);
    background: var(--ac-surface);
}

.modal-header h2,.modal-header h3 { margin:0; font-size:18px; line-height:1.4; }
.modal-close {
    width: 38px;
    height: 38px;
    flex: none;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #d7cec2;
    border-radius: 8px;
    background: #fff;
    color: #4e4841;
    font-size: 17px;
    cursor: pointer;
}
.modal-close:hover { border-color:#8a6848; background:#f5efe7; }
.modal-body { padding:24px; overflow-y:auto; overscroll-behavior:contain; }
.modal-footer {
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:10px;
    padding:16px 24px;
    border-top:1px solid var(--ac-line);
    background:var(--ac-surface);
}

.form-input {
    width:100%;
    min-height:44px;
    padding:9px 12px;
    border:1px solid #cfc5b8;
    border-radius:8px;
    background:#fff;
    color:var(--ac-ink);
    font:inherit;
    font-size:13px;
    outline:0;
    transition:border-color .15s,box-shadow .15s;
}
.form-input:focus { border-color:#8a6848; box-shadow:0 0 0 3px rgba(138,104,72,.12); }
.catalog-modal-error{padding:10px 12px;border:1px solid #e6b9b3;border-radius:6px;background:#fbefed;color:#913d36;font-size:12px;font-weight:600}

/* Reduce visual noise while preserving clear hierarchy. */
.financial-kpi-card { min-height:0; padding:18px; }
.financial-kpi-card .kpi-label { line-height:1.45; letter-spacing:.045em; }
.financial-kpi-card .kpi-foot { flex-wrap:wrap; row-gap:4px; }
.finance-panel { border-radius:8px; box-shadow:0 8px 24px rgba(36,31,26,.045); }
.finance-panel .finance-toolbar h3 { line-height:1.35; }
.finance-panel a[href*="operations/inventory/"] { transition:border-color .15s,background .15s,transform .15s; }
.finance-panel a[href*="operations/inventory/"]:hover { transform:translateY(-1px); border-color:#aa8a68!important; }
.inventory-empty-state { min-height:300px; display:grid; place-items:center; align-content:center; gap:8px; padding:36px 20px; text-align:center; }
.inventory-empty-state>span { width:52px; height:52px; display:grid; place-items:center; border-radius:50%; background:#f1ebe2; color:#8a6848; font-size:22px; }
.inventory-empty-state h2 { margin:4px 0 0; font-size:19px; }
.inventory-empty-state p { max-width:520px; margin:0 0 12px; color:var(--ac-muted); font-size:12px; }

/* Inventory dashboard follows the charcoal / brass / warm-paper brand system. */
.inventory-kpi-grid .financial-kpi-card {
    border-top:3px solid #a98662!important;
    background:#fff;
}
.inventory-kpi-grid .financial-kpi-card::before { display:none; }
.inventory-kpi-grid .kpi-icon-badge {
    background:#f1ebe3!important;
    color:#76583e!important;
}
.inventory-kpi-grid .kpi-foot [style*="var(--ac-blue)"],
.inventory-kpi-grid [style*="color:var(--ac-blue)"] { color:#8a6848!important; }

.inventory-action-hub>div:last-child { gap:10px!important; }
.inventory-action-hub>div:last-child>a {
    min-height:126px;
    padding:16px!important;
    background:#faf7f1!important;
    border:1px solid #ded4c7!important;
    border-radius:6px!important;
    color:#282521!important;
}
.inventory-action-hub>div:last-child>a:hover {
    background:#f1e9df!important;
    border-color:#a98662!important;
    transform:translateY(-1px);
}
.inventory-action-hub>div:last-child>a>span { color:#8a6848!important; filter:grayscale(1) sepia(.3); }
.inventory-action-hub>div:last-child>a strong { color:#282521!important; }
.inventory-action-hub>div:last-child>a small { color:#766f67!important; }

@media (max-width:760px) {
    .modal-backdrop { place-items:end center; padding:8px 8px 0; }
    .modal-content { width:100%!important; max-width:none!important; max-height:calc(100dvh - 8px); border-radius:12px 12px 0 0; }
    .modal-header,.modal-body,.modal-footer { padding-inline:16px; }
    .modal-body [style*="grid-template-columns:1fr 1fr"] { grid-template-columns:1fr!important; }
    .modal-footer { position:sticky; bottom:0; flex-wrap:wrap; }
    .modal-footer>button,.modal-footer>a { flex:1 1 140px; min-height:44px; justify-content:center; }
    .heading-actions>div { flex:0 0 auto; overflow-x:auto; max-width:calc(100vw - 28px); scrollbar-width:none; }
    .heading-actions>div::-webkit-scrollbar { display:none; }
    .finance-panel [style*="grid-template-columns:1fr 1fr"] { grid-template-columns:1fr!important; }
}
