body { background: #f5f7fb; color: #273444; }
.app-navbar { background: #fff; border-bottom: 1px solid #e8edf3; }
.brand-mark { width: 42px; height: 42px; object-fit: contain; }
.brand-title { color: #17324d; letter-spacing: .04em; line-height: 1.05; }
.brand-company { color: #0f5f9e; font-size: .72rem; letter-spacing: .02em; }
.sidebar { min-height: calc(100vh - 64px); background: #fff; border-right: 1px solid #e9ecef; }
.sidebar .nav-link { color: #52606d; border-radius: .5rem; padding: .55rem .7rem; }
.sidebar .nav-link.active { position: relative; background: #f0f4f8; color: #0f5f9e; font-weight: 600; }
.sidebar .nav-link.active:before { content: ""; position: absolute; left: 0; top: .35rem; bottom: .35rem; width: 3px; border-radius: 3px; background: #0f5f9e; }
.sidebar .nav-link:hover { background: #f7f9fb; color: #0f5f9e; }
.sidebar-heading { width: 100%; border: 0; background: transparent; color: #6c757d; font-size: .75rem; font-weight: 700; letter-spacing: .04em; padding: .75rem .75rem .35rem; display: flex; justify-content: space-between; align-items: center; text-align: left; }
.sidebar-heading .toggle-icon { transition: transform .2s ease; }
.sidebar-heading.is-open .toggle-icon { transform: rotate(90deg); }
.submenu { padding-left: .5rem; }
.submenu .nav-link { font-size: .92rem; }
.sidebar .nav-link.disabled { color: #adb5bd; cursor: not-allowed; }
.stat-card { border-left: 4px solid #0f5f9e !important; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: #f4f7fa; }
.login-card { width: min(460px, 94vw); border: 1px solid #e5ebf1; border-radius: 1rem; }
.login-logo { width: 86px; height: 86px; object-fit: contain; }
.login-app-name { color: #17324d; letter-spacing: .16em; }
.login-company { color: #0f5f9e; font-size: .85rem; letter-spacing: .03em; }
.login-subtitle { color: #6c7a89; }
.login-input .input-group-text { background: #fff; color: #708090; border-right: 0; }
.login-input .form-control { border-left: 0; }
.dataTables_wrapper .dt-buttons { margin-bottom: 1rem; }
.chat-toggle { position: fixed; right: 24px; bottom: 24px; width: 58px; height: 58px; z-index: 1050; }
.chat-panel { position: fixed; right: 24px; bottom: 92px; width: min(360px, calc(100vw - 32px)); z-index: 1050; }
.chat-users { max-height: 360px; overflow-y: auto; }
.chat-messages { height: 260px; overflow-y: auto; background: #f8f9fa; padding: .5rem; border-radius: .5rem; }
.chat-message { max-width: 85%; padding: .4rem .6rem; margin-bottom: .4rem; border-radius: .6rem; font-size: .9rem; }
.chat-message.mine { margin-left: auto; background: #dbeafe; }
.chat-message.theirs { background: #fff; border: 1px solid #e9ecef; }
.invoice-print { background: #fff; padding: 2rem; max-width: 1000px; margin: 0 auto; }
.invoice-totals { margin-left: auto; max-width: 320px; text-align: right; line-height: 1.8; }
.signature-area { margin-top: 4rem; }
.report-document { background: #fff; }
@media (max-width: 767.98px) {
    .sidebar { position: fixed; z-index: 1040; top: 64px; bottom: 0; left: 0; width: min(88vw, 320px); transform: translateX(-105%); transition: transform .2s ease; overflow-y: auto; }
    .sidebar.mobile-open { transform: translateX(0); box-shadow: 0 0 24px rgba(0,0,0,.16); }
    .app-main { width: 100%; }
    .mobile-menu-btn { display: inline-flex !important; }
}
.mobile-menu-btn { display: none; }
@media print {
    @page { size: A4 landscape; margin: 12mm; }
    .navbar, .sidebar, .btn, form, .dataTables_wrapper > .row:first-child, .dataTables_wrapper > .row:last-child, .chat-widget, .d-print-none { display: none !important; }
    main { width: 100% !important; padding: 0 !important; }
    body { background: #fff; font-size: 10pt; }
    .invoice-print { max-width: none; padding: 0; }
    .invoice-print table, .report-document table { width: 100% !important; border-collapse: collapse; }
    .invoice-print th, .invoice-print td, .report-document th, .report-document td { border: 1px solid #444 !important; padding: 5px !important; vertical-align: top; }
    .invoice-print thead { display: table-header-group; }
    .report-document .card { border: 0 !important; box-shadow: none !important; }
    .report-document h2 { margin-top: 0; }
}
