:root {
    --color-primary: #0b132b;
    --color-accent: #6f0c1b;
    --color-bg-light: #f4f5f7;
    --color-text-dark: #0b132b;
    --color-white: #ffffff;
    --color-gray-50: #f8f9fa;
    --color-gray-100: #f1f3f5;
    --color-gray-200: #e9ecef;
    --color-gray-300: #dee2e6;
    --color-gray-400: #ced4da;
    --color-gray-500: #adb5bd;
    --color-gray-600: #868e96;
    --color-gray-700: #495057;
    --color-gray-800: #343a40;
    --color-gray-900: #212529;
    --color-success: #2e7d32;
    --color-warning: #ed6c02;
    --color-danger: #d32f2f;
    --color-info: #0288d1;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
    --font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-serif: 'Roboto', Georgia, 'Times New Roman', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6,
.page-title, .card-title, .modal-title,
.login-title, .report-header-section h1 {
    font-family: 'Roboto', var(--font-family);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--color-primary);
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
    transform: translateX(-100%);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.logo img {
    height: 40px;
    width: auto;
}

.close-sidebar {
    display: none;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 1.25rem;
    cursor: pointer;
}

.sidebar-user {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    opacity: 0.8;
}

.nav-menu {
    list-style: none;
    padding: 15px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    margin: 2px 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: var(--color-white);
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--color-danger);
}

.main-content {
    flex: 1;
    margin-left: 0;
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-area {
    padding: 25px;
    flex: 1;
}

.app-footer {
    text-align: center;
    padding: 15px 25px;
    border-top: 1px solid var(--color-gray-200);
    color: var(--color-gray-500);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.top-header {
    background: var(--color-white);
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--color-primary);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.current-date {
    color: var(--color-gray-600);
    font-size: 0.9rem;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.overlay.active {
    display: block;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background: #1a2744;
}

.btn-accent {
    background: var(--color-accent);
    color: var(--color-white);
}

.btn-accent:hover {
    background: #8a1024;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-success {
    background: var(--color-success);
    color: var(--color-white);
}

.btn-success:hover {
    background: #1b5e20;
}

.btn-danger {
    background: var(--color-danger);
    color: var(--color-white);
}

.btn-danger:hover {
    background: #b71c1c;
}

.btn-warning {
    background: var(--color-warning);
    color: var(--color-white);
}

.btn-warning:hover {
    background: #b25a00;
}

.btn-info {
    background: var(--color-info);
    color: var(--color-white);
}

.btn-info:hover {
    background: #01579b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-600);
    cursor: pointer;
    min-width: 72px;
}

.filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(11,19,43,0.1);
}

.form-control.error {
    border-color: var(--color-danger);
}

.form-error {
    color: var(--color-danger);
    font-size: 0.85rem;
    margin-top: 5px;
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.input-group {
    display: flex;
}

.input-group .form-control {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .btn {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-primary);
}

.card-body {
    padding: 25px;
}

.card-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--color-gray-200);
    background: var(--color-gray-50);
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--color-gray-200);
}

th {
    background: var(--color-gray-50);
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
}

tr:hover {
    background: var(--color-gray-50);
}

.table-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.action-btn view {
    background: var(--color-info);
    color: var(--color-white);
}

.action-btn edit {
    background: var(--color-warning);
    color: var(--color-white);
}

.action-btn delete {
    background: var(--color-danger);
    color: var(--color-white);
}

.action-btn:hover {
    transform: scale(1.1);
}

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #e8f5e9;
    color: var(--color-success);
    border-left: 4px solid var(--color-success);
}

.alert-error {
    background: #ffebee;
    color: var(--color-danger);
    border-left: 4px solid var(--color-danger);
}

.alert-warning {
    background: #fff3e0;
    color: var(--color-warning);
    border-left: 4px solid var(--color-warning);
}

.alert-info {
    background: #e3f2fd;
    color: var(--color-info);
    border-left: 4px solid var(--color-info);
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
}

.modal-dialog {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: min(90vw, 500px);
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlide 0.3s ease;
    margin: auto;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-lg {
    max-width: min(90vw, 700px);
}

.modal-xl {
    max-width: min(90vw, 900px);
}

.modal-sm {
    max-width: min(90vw, 350px);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--color-gray-600);
}

.modal-close:hover {
    color: var(--color-danger);
}

.modal-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--color-gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-active, .status-paid, .status-completed {
    background: #e8f5e9;
    color: var(--color-success);
}

.status-inactive, .status-unpaid, .status-cancelled {
    background: #ffebee;
    color: var(--color-danger);
}

.status-pending {
    background: #fff3e0;
    color: var(--color-warning);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--color-primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb i {
    color: var(--color-gray-400);
    font-size: 0.75rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 25px;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    color: var(--color-text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: var(--color-gray-100);
}

.pagination-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box .form-control {
    flex: 1;
    min-width: 200px;
}

.search-box .btn {
    white-space: nowrap;
}

.filter-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-item label {
    font-size: 0.9rem;
    color: var(--color-gray-600);
}

.filter-item select, .filter-item input {
    padding: 8px 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.stat-card-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card-icon.primary {
    background: rgba(11,19,43,0.1);
    color: var(--color-primary);
}

.stat-card-icon.accent {
    background: rgba(111,12,27,0.1);
    color: var(--color-accent);
}

.stat-card-icon.success {
    background: rgba(46,125,50,0.1);
    color: var(--color-success);
}

.stat-card-icon.warning {
    background: rgba(237,108,2,0.1);
    color: var(--color-warning);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.quick-action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid transparent;
}

.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.quick-action-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.quick-action-icon.sale {
    background: rgba(5, 150, 105, 0.12);
    color: #059669;
}

.quick-action-icon.purchase {
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
}

.quick-action-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.quick-action-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 2px;
}

.quick-action-desc {
    font-size: 0.8rem;
    color: var(--color-gray-500);
}

.quick-action-arrow {
    color: var(--color-gray-400);
    font-size: 0.85rem;
    transition: var(--transition);
}

.quick-action-card:hover .quick-action-arrow {
    color: var(--color-primary);
    transform: translateX(3px);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--color-gray-600);
    font-size: 0.9rem;
}

.ledger-table th:nth-child(3),
.ledger-table th:nth-child(4),
.ledger-table td:nth-child(3),
.ledger-table td:nth-child(4) {
    text-align: right;
}

.ledger-table th:last-child,
.ledger-table td:last-child {
    text-align: right;
}

.amount-positive {
    color: var(--color-success);
}

.amount-negative {
    color: var(--color-danger);
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-gray-500);
}

.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }
.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 15px; }

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .close-sidebar {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    .top-header {
        padding: 12px 15px;
    }
    
    .page-title {
        font-size: 1.2rem;
    }
    
    .content-area {
        padding: 15px;
    }
    
    .card-header {
        padding: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        min-width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 10px 12px;
    }
    
    .modal {
        padding: 0;
    }
    
    .modal-dialog {
        max-width: 100%;
        width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100%;
    }
}

@media (max-width: 480px) {
    .header-actions .current-date {
        display: none;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box .form-control {
        min-width: 100%;
    }
    
    .filter-group {
        flex-direction: column;
    }
}

@media print {
    .sidebar, .top-header, .btn, .pagination, .search-box, .filter-group {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Statement/Report Styles */
.qb-report { font-family: var(--font-family); }
.qb-header-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 3px solid var(--color-primary); }
.qb-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 25px; }
.qb-card { background: #f8f9fa; border-radius: 8px; padding: 16px; text-align: center; border-left: 4px solid var(--color-primary); }
.qb-card.success { border-left-color: var(--color-success); }
.qb-card.danger { border-left-color: var(--color-danger); }
.qb-card-label { font-size: 0.75rem; text-transform: uppercase; color: var(--color-gray-600); letter-spacing: 0.5px; margin-bottom: 6px; }
.qb-card-value { font-size: 1.3rem; font-weight: 700; color: var(--color-primary); }
.qb-card.success .qb-card-value { color: var(--color-success); }
.qb-card.danger .qb-card-value { color: var(--color-danger); }
.qb-table { width: 100%; border-collapse: collapse; }
.qb-table th { background: var(--color-primary); color: #fff; padding: 12px 16px; text-align: left; font-size: 0.8rem; text-transform: uppercase; }
.qb-table th.text-right { text-align: right; }
.qb-table td { padding: 12px 16px; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.qb-table td.text-right { text-align: right; }
.qb-table tr:hover { background: #f8f9fa; }
.qb-table tr.type-invoice td:first-child,
.qb-table tr.type-purchase td:first-child { border-left: 3px solid var(--color-primary); }
.qb-table tr.type-payment td:first-child { border-left: 3px solid var(--color-success); }
.qb-table tr.type-credit-note td:first-child { border-left: 3px solid var(--color-warning); }
.qb-table tr.type-advance td:first-child { border-left: 3px solid #9b59b6; }
.qb-table tr.advance-receipt { background: rgba(155, 89, 182, 0.05); }
.qb-table tr.advance-receipt:hover { background: rgba(155, 89, 182, 0.1); }
.advance-amount { color: #9b59b6; font-weight: 600; }
.qb-type-badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.qb-type-badge.invoice, .qb-type-badge.purchase { background: rgba(0, 123, 255, 0.1); color: var(--color-primary); }
.qb-type-badge.payment { background: rgba(40, 167, 69, 0.1); color: var(--color-success); }
.qb-type-badge.credit-note { background: rgba(255, 193, 7, 0.1); color: #e67e00; }
.qb-type-badge.advance { background: rgba(155, 89, 182, 0.1); color: #9b59b6; }
.qb-mode-badge { display: inline-block; padding: 2px 6px; border-radius: 3px; font-size: 0.7rem; font-weight: 600; background: #e9ecef; color: #495057; text-transform: uppercase; }
.qb-balance-positive { color: var(--color-success); font-weight: 600; }
.qb-balance-negative { color: var(--color-danger); font-weight: 600; }

/* Statement Template Specific */
.qb-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 25px; padding-bottom: 20px; border-bottom: 3px solid var(--color-primary); }
.qb-company { flex: 1; }
.qb-company h1 { font-size: 1.4rem; color: var(--color-primary); margin: 0 0 5px; }
.qb-company p { margin: 2px 0; color: var(--color-gray-600); font-size: 0.9rem; }
.qb-entity { text-align: right; flex: 1; }
.qb-entity h2 { font-size: 1.2rem; color: var(--color-accent); margin: 0 0 5px; }
.qb-entity p { margin: 2px 0; color: var(--color-gray-600); font-size: 0.9rem; }
.qb-filters { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 20px; padding: 16px; background: #f8f9fa; border-radius: 8px; }
.qb-filters .form-group { margin-bottom: 0; }
.qb-filters label { font-size: 0.8rem; text-transform: uppercase; color: var(--color-gray-600); margin-bottom: 4px; display: block; }
.qb-summary-card { background: #f8f9fa; border-radius: 8px; padding: 16px; text-align: center; border-left: 4px solid var(--color-primary); }
.qb-summary-card.success { border-left-color: var(--color-success); }
.qb-summary-card.warning { border-left-color: var(--color-warning); }
.qb-summary-card.danger { border-left-color: var(--color-danger); }
.qb-summary-label { font-size: 0.75rem; text-transform: uppercase; color: var(--color-gray-600); letter-spacing: 0.5px; margin-bottom: 6px; }
.qb-summary-value { font-size: 1.3rem; font-weight: 700; color: var(--color-primary); }
.qb-summary-card.success .qb-summary-value { color: var(--color-success); }
.qb-summary-card.warning .qb-summary-value { color: var(--color-warning); }
.qb-summary-card.danger .qb-summary-value { color: var(--color-danger); }
.qb-footer { margin-top: 20px; padding-top: 15px; border-top: 2px solid var(--color-primary); text-align: right; }
.qb-footer-total { font-size: 1.1rem; font-weight: 700; }
@media print { .qb-filters, .no-print { display: none !important; } .qb-table th { background: #333 !important; color: #fff !important; -webkit-print-color-adjust: exact; } }

.stmt-container { font-family: var(--font-family); background: #fafbfc; min-height: 100vh; padding: 30px; }
.stmt-report { max-width: 1100px; margin: 0 auto; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-radius: 8px; overflow: hidden; }
.stmt-header { display: flex; justify-content: space-between; padding: 28px 32px; background: linear-gradient(135deg, #0b132b 0%, #1a2942 100%); color: #fff; }
.stmt-company-info { flex: 1; }
.stmt-company-info h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; letter-spacing: 0.5px; }
.stmt-company-info p { font-size: 0.85rem; opacity: 0.85; line-height: 1.5; }
.stmt-title-section { text-align: center; flex: 2; padding: 0 20px; }
.stmt-title-section h2 { font-size: 1.2rem; text-transform: uppercase; letter-spacing: 2px; font-weight: 600; margin-bottom: 8px; }
.stmt-title-section p { font-size: 0.85rem; opacity: 0.9; }
.stmt-customer-section { text-align: right; flex: 1; }
.stmt-customer-section h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.stmt-customer-section p { font-size: 0.82rem; opacity: 0.85; margin: 2px 0; }
.stmt-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; background: #f8f9fa; border-bottom: 1px solid #e9ecef; }
.stmt-period { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: #495057; }
.stmt-period strong { color: #0b132b; }
.stmt-filters { display: flex; gap: 10px; }
.stmt-filters input[type="date"] { padding: 6px 10px; border: 1px solid #ced4da; border-radius: 4px; font-size: 0.85rem; }
.stmt-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 24px 32px; background: #fff; border-bottom: 1px solid #e9ecef; }
.stmt-summary-card { padding: 16px; border-radius: 6px; background: #f8f9fa; border-left: 4px solid #0b132b; }
.stmt-summary-card.ob { border-left-color: #6c757d; }
.stmt-summary-card.invoice { border-left-color: #d32f2f; }
.stmt-summary-card.payment { border-left-color: #2e7d32; }
.stmt-summary-card.balance { border-left-color: #0b132b; }
.stmt-summary-card.alert { border-left-color: #d32f2f; background: #fff5f5; }
.stmt-summary-card.success { border-left-color: #2e7d32; background: #f0fff4; }
.stmt-summary-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: #6c757d; margin-bottom: 6px; font-weight: 600; }
.stmt-summary-value { font-size: 1.25rem; font-weight: 700; color: #0b132b; }
.stmt-summary-card.invoice .stmt-summary-value { color: #d32f2f; }
.stmt-summary-card.payment .stmt-summary-value { color: #2e7d32; }
.stmt-summary-card.alert .stmt-summary-value { color: #d32f2f; }
.stmt-summary-card.success .stmt-summary-value { color: #2e7d32; }

.stmt-table-wrap { padding: 0 32px 24px; }
.stmt-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.stmt-table thead th { background: #0b132b; color: #fff; padding: 14px 16px; text-align: left; font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
.stmt-table thead th:first-child { border-radius: 6px 0 0 0; }
.stmt-table thead th:last-child { border-radius: 0 6px 0 0; text-align: right; }
.stmt-table thead th.th-right { text-align: right; }
.stmt-table tbody tr { border-bottom: 1px solid #e9ecef; transition: background 0.15s; }
.stmt-table tbody tr:hover { background: #f8f9fa; }
.stmt-table tbody tr:nth-child(even) { background: #fafbfc; }
.stmt-table tbody tr:nth-child(even):hover { background: #f0f2f5; }
.stmt-table tbody td { padding: 14px 16px; vertical-align: middle; }
.stmt-table tbody td:first-child { font-weight: 600; color: #495057; white-space: nowrap; }
.stmt-table .ref-cell { display: flex; align-items: center; gap: 8px; }
.stmt-table .ref-number { font-family: 'Courier New', monospace; font-size: 0.82rem; color: #212529; }
.stmt-table .badge { display: inline-block; padding: 3px 8px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; border-radius: 3px; letter-spacing: 0.3px; }
.stmt-table .badge-inv { background: #fce4e4; color: #c62828; }
.stmt-table .badge-pay { background: #e8f5e9; color: #2e7d32; }
.stmt-table .badge-cr { background: #fff3e0; color: #e65100; }
.stmt-table .badge-ref { background: #e3f2fd; color: #1565c0; }
.stmt-table .badge-adv { background: #f3e5f5; color: #7b1fa2; }
.stmt-table .badge-bank { background: #e0f2f1; color: #00695c; }
.stmt-table .badge-other { background: #eceff1; color: #546e7a; }
.stmt-table .desc-main { color: #212529; font-weight: 500; margin-bottom: 2px; }
.stmt-table .desc-sub { font-size: 0.78rem; color: #868e96; font-style: italic; }
.stmt-table td.num { text-align: right; font-family: 'Courier New', monospace; font-weight: 600; }
.stmt-table td.num-red { color: #d32f2f; }
.stmt-table td.num-green { color: #2e7d32; }
.stmt-table td.balance { font-weight: 700; color: #0b132b; }
.stmt-table td.balance.owed { color: #d32f2f; }
.stmt-table td.balance.credit { color: #2e7d32; }
.stmt-opening-row td { background: #e9ecef !important; border-top: 2px solid #0b132b; font-weight: 700; }
.stmt-opening-row td:first-child { border-left: 4px solid #0b132b; }
.stmt-totals-row td { background: #0b132b !important; color: #fff; font-weight: 700; padding: 16px !important; }
.stmt-totals-row td { border-color: #0b132b !important; }
.stmt-totals-row .total-label { text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.5px; }
.stmt-totals-row td.num { font-size: 1rem; }
.stmt-totals-row td.balance { font-size: 1.1rem; }
.stmt-empty-row td { text-align: center; padding: 48px !important; color: #868e96; font-style: italic; }
.stmt-footer { padding: 20px 32px; background: #f8f9fa; border-top: 1px solid #e9ecef; display: flex; justify-content: space-between; font-size: 0.8rem; color: #6c757d; }
.stmt-footer-left { display: flex; flex-direction: column; gap: 4px; }
.stmt-footer-right { text-align: right; }
.stmt-footer strong { color: #0b132b; }
.stmt-divider { height: 3px; background: linear-gradient(90deg, #0b132b 0%, #1a2942 50%, #0b132b 100%); }
@media print { 
    .stmt-container { padding: 0; background: #fff; }
    .stmt-report { box-shadow: none; border-radius: 0; max-width: 100%; }
    .stmt-toolbar { display: none; }
    .stmt-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .stmt-table thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .stmt-totals-row td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
