:root { --primary:#4f46e5; --primary-hover:#4338ca; --background:#f8fafc; --text-main:#172033; --text-muted:#526277; --border-color:#dce3ec; --card-bg:#fff; --radius:12px; }
body { font-size:.94rem; line-height:1.55; }
body .card, body .modal-content { border-radius:var(--radius)!important; }
body .card { background:var(--card-bg); }
body .btn { border-radius:8px!important; font-weight:600; min-height:38px; }
body .btn-sm { min-height:32px; }
body .btn-primary { background:var(--primary); border-color:var(--primary); }
body .btn-primary:hover, body .btn-primary:focus { background:var(--primary-hover); border-color:var(--primary-hover); }
body .form-control, body .form-select { border-color:var(--border-color); border-radius:8px; min-height:40px; }
body .form-control:focus, body .form-select:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgb(79 70 229 / 15%); }
body .form-label { font-weight:600; color:var(--text-main); }
body .text-secondary, body .text-muted { color:var(--text-muted) !important; }
body .table { font-variant-numeric:tabular-nums; }
body .table th { color:var(--text-muted); font-size:.78rem; letter-spacing:.03em; white-space:nowrap; }
body .table td { vertical-align:middle; }
body .table-responsive { border-radius:10px; overscroll-behavior-inline:contain; }
body .alert { border-radius:10px; }
body a:focus-visible, body button:focus-visible, body input:focus-visible, body select:focus-visible { outline:3px solid #818cf8; outline-offset:3px; }
.workflow-help { font-size:.85rem; color:var(--text-muted); }
.report-basis { font-size:.86rem; }
.report-basis ul { padding-left:1.25rem; }
.action-form { display:inline; }
.record-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:nowrap; gap:6px; }
.record-action-form { display:inline-flex; flex-shrink:0; margin:0; }
body .record-action { flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:34px; min-width:72px; padding:6px 10px; border:1px solid; border-radius:8px!important; font-size:.8rem; line-height:1.2; text-decoration:none; white-space:nowrap; box-shadow:none; }
body .record-action-view { color:#4338ca; background:#eef2ff; border-color:#c7d2fe; }
body .record-action-edit { color:#334155; background:#f8fafc; border-color:#cbd5e1; }
body .record-action-delete { color:#b91c1c; background:#fff1f2; border-color:#fecdd3; }
body .record-action-view:hover { color:#fff; background:#4338ca; border-color:#4338ca; }
body .record-action-edit:hover { color:#fff; background:#475569; border-color:#475569; }
body .record-action-delete:hover { color:#fff; background:#b91c1c; border-color:#b91c1c; }
body .record-action[aria-disabled="true"] { opacity:.6; pointer-events:none; }
body .main-wrapper .card { border:1px solid var(--border-color); box-shadow:0 2px 8px rgb(15 23 42 / 4%); }
body .main-wrapper .card-header, body .main-wrapper .card-footer { background:#fff; border-color:var(--border-color); }
body .main-wrapper .table thead th { background:#f8fafc!important; color:var(--text-muted)!important; font-weight:700; border-bottom:1px solid var(--border-color); padding-top:13px; padding-bottom:13px; }
body .main-wrapper .table tbody td { border-color:#edf1f6; }
body .main-wrapper .table-hover tbody tr:hover { --bs-table-hover-bg:#f5f7ff; }
body .main-wrapper h3, body .main-wrapper h4 { letter-spacing:-.02em; }
body .main-wrapper .modal-header { border-bottom:1px solid var(--border-color); padding:18px 20px; }
body .main-wrapper .modal-footer { border-top:1px solid var(--border-color); padding:16px 20px; }
.record-actions-column { min-width:250px; }
.ui-toast { overflow-wrap:anywhere; }
@media(max-width:767px) { body .main-wrapper { padding:0; } body .content-container { padding:16px 12px; } body .toast-stack { left:12px; right:12px; min-width:0; max-width:none; } body .modal-dialog { margin:12px; } body .form-control, body .form-select { font-size:16px; } body .record-action { min-height:44px; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms!important; transition-duration:.01ms!important; scroll-behavior:auto!important; } }
@media print { .sidebar,.top-header,.no-print,.d-print-none,.toast-stack { display:none!important; } body,.main-wrapper { background:#fff!important; color:#000!important; margin:0!important; padding:0!important; } .card { box-shadow:none!important; break-inside:avoid; } thead { display:table-header-group; } tr { break-inside:avoid; } .table-responsive { overflow:visible!important; } a { color:inherit!important; text-decoration:none!important; } }
@media print { .record-actions, .record-actions-cell { display:none!important; } }

/* Shared screen presentation; printed invoices retain their document layout. */
@media screen {
    body { --bs-primary:#4f46e5; --bs-primary-rgb:79,70,229; --bs-link-color:#4f46e5; --bs-link-hover-color:#4338ca; }
    body .main-wrapper, body .content-container, body .card-body { min-width:0; }
    body .main-wrapper canvas { max-width:100%; }
    body .main-wrapper .card { border-color:var(--border-color)!important; box-shadow:0 2px 8px rgb(15 23 42 / 4%)!important; }
    body .main-wrapper .table { --bs-table-bg:#fff; --bs-table-color:var(--text-main); --bs-table-border-color:var(--border-color); --bs-table-striped-bg:#fff; --bs-table-striped-color:var(--text-main); --bs-table-hover-bg:#eef2ff; --bs-table-hover-color:var(--text-main); font-size:.875rem; }
    body .main-wrapper .table > :not(caption) > * > * { padding:12px 16px!important; vertical-align:middle; border:0!important; border-bottom:1px solid var(--border-color)!important; }
    body .main-wrapper .table thead > tr > * { background:#f8fafc!important; color:var(--text-muted)!important; font-size:.78rem!important; font-weight:700; letter-spacing:.03em; text-transform:uppercase; white-space:nowrap; box-shadow:none; }
    body .main-wrapper .table tbody > tr > * { background-color:#fff; }
    body .main-wrapper .table tbody tr:hover > * { background-color:#eef2ff; }
    body .main-wrapper .table tfoot > tr > * { background:#f8fafc!important; font-weight:700; }
    body .main-wrapper .table-responsive { max-width:100%; overflow-x:auto; }
    body .main-wrapper .record-actions-cell { white-space:nowrap; }
    body .record-actions { width:max-content; min-width:100%; }
    body .btn-outline-primary { --bs-btn-color:#4f46e5; --bs-btn-border-color:#4f46e5; --bs-btn-hover-bg:#4f46e5; --bs-btn-hover-border-color:#4f46e5; --bs-btn-active-bg:#4338ca; --bs-btn-active-border-color:#4338ca; }
    .summary-grid .card { height:100%; }
    .summary-grid .card .d-flex { gap:12px; }
    .summary-grid .card .d-flex > div:first-child { min-width:0; overflow-wrap:anywhere; }
    .summary-grid .rounded-circle { flex-shrink:0; }
    .entry-header-actions { position:static; }
}

/* Colored accents belong to summary cards; table and form panels stay neutral. */
@media screen {
    body .main-wrapper .card { --card-accent:#4f46e5; --card-accent-rgb:79,70,229; }
    body .main-wrapper .card.border-primary { --card-accent:#4f46e5; --card-accent-rgb:79,70,229; }
    body .main-wrapper .card.border-success { --card-accent:#10b981; --card-accent-rgb:16,185,129; }
    body .main-wrapper .card.border-warning { --card-accent:#f59e0b; --card-accent-rgb:245,158,11; }
    body .main-wrapper .card.border-danger { --card-accent:#ef4444; --card-accent-rgb:239,68,68; }
    body .main-wrapper .card.border-info { --card-accent:#0ea5e9; --card-accent-rgb:14,165,233; }
    body .main-wrapper .card.border-purple { --card-accent:#8b5cf6; --card-accent-rgb:139,92,246; }
    body .main-wrapper .card.border-secondary { --card-accent:#64748b; --card-accent-rgb:100,116,139; }
    body .main-wrapper .card {
        border:1px solid var(--border-color)!important;
        box-shadow:0 2px 8px rgb(15 23 42 / 4%)!important;
    }
    body .main-wrapper .card:is(.summary-card,.metric-card,.card-stats,.border-start,.border-bottom.border-4):not(:has(table,form)),
    body .main-wrapper .summary-grid .card:not(:has(table,form)) {
        border-left:4px solid var(--card-accent)!important;
        box-shadow:0 4px 12px rgba(var(--card-accent-rgb),.10)!important;
    }
    body .main-wrapper .card.border-bottom.border-4:not(:has(table,form)) {
        border-left:1px solid var(--border-color)!important;
        border-bottom:4px solid var(--card-accent)!important;
    }
    body .main-wrapper .card:is(.summary-card,.metric-card,.card-stats,.border-start,.border-bottom.border-4):not(:has(table,form)):hover,
    body .main-wrapper .summary-grid .card:not(:has(table,form)):hover {
        box-shadow:0 6px 16px rgba(var(--card-accent-rgb),.16)!important;
    }
}

@media screen {
    body .main-wrapper .table tbody tr.shortcut-selected > * { background-color:#eef2ff; box-shadow:inset 0 2px #c7d2fe,inset 0 -2px #c7d2fe; }
    body .main-wrapper .table tbody tr.shortcut-selected:focus { outline:2px solid #818cf8; outline-offset:-2px; }
}

/* Blue column headings, with neutral data rows and unchanged printed reports. */
@media screen {
    body .main-wrapper .content-container table thead > tr > *,
    body #keyboardShortcutsModal table thead > tr > * {
        background:#1d4ed8!important; color:#fff!important; box-shadow:none;
        border-bottom-color:#1e40af!important;
    }
    body .main-wrapper .content-container table thead :is(.text-primary,.text-secondary,.text-muted,.text-info),
    body #keyboardShortcutsModal table thead :is(.text-primary,.text-secondary,.text-muted,.text-info) { color:#fff!important; }
}
