/* Global Styles and Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Poppins', sans-serif;
    font-size: 9px; /* Further reduced from 11px */
    line-height: 1.2;
    color: #333;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(13, 189, 254, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(96, 184, 195, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 91, 116, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Date Filter */
.date-filter-container {
    margin-bottom: 1.5rem;
    background: #fff;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.date-filter-form {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #0dbdfe;
    box-shadow: 0 0 0 3px rgba(13, 189, 254, 0.1);
}

.month-selector {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.month-selector:hover {
    border-color: #0dbdfe;
    background-color: #f8f9fa;
}

.month-selector option {
    padding: 8px 12px;
    background: white;
    color: #333;
    font-weight: 500;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-top: 20px;
}

.filter-actions .btn {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.filter-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive filter layout */
@media (max-width: 768px) {
    .date-filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .filter-actions {
        justify-content: center;
        margin-top: 15px;
    }
}

/* Typography Scale */
h1, .h1 { font-size: 1rem; font-weight: 600; }
h2, .h2 { font-size: 0.9rem; font-weight: 600; }
h3, .h3 { font-size: 0.85rem; font-weight: 500; }
h4, .h4 { font-size: 0.8rem; font-weight: 500; }
h5, .h5 { font-size: 0.75rem; font-weight: 500; }
h6, .h6 { font-size: 0.7rem; font-weight: 500; }

p { font-size: 0.7rem; line-height: 1.2; }
small { font-size: 0.6rem; }

/* Header Styles */
.header {
    background: linear-gradient(135deg, #0dbdfe 0%, #60b8c3 50%, #0099cc 100%);
    color: white;
    padding: 1.2rem 0;
    box-shadow: 0 8px 32px rgba(13, 189, 254, 0.15);
    position: relative;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* User Dropdown Styles */
.user-dropdown {
    position: relative;
    margin-right: 1rem;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
}

.user-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.user-name {
    color: white;
    font-weight: 500;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.user-dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    min-width: 280px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0dbdfe 0%, #60b8c3 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(13, 189, 254, 0.3);
}

.user-details {
    flex: 1;
}

.user-full-name {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    margin-bottom: 2px;
}

.user-role {
    color: #666;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.dropdown-item:hover {
    background: linear-gradient(90deg, rgba(13, 189, 254, 0.05), rgba(96, 184, 195, 0.05));
    color: #0dbdfe;
    transform: translateX(5px);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
}

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

.header-logo {
    display: flex;
    align-items: center;
}

.main-logo {
    height: 40px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.main-logo:hover {
    transform: scale(1.05);
}

.header-left h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    white-space: nowrap;
    font-family: 'Poppins', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.5px;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo i {
    font-size: 2rem;
    color: #fff;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.date-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.date-display i {
    color: #fff;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #0dbdfe, #0099cc);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800, #f57c00);
    color: white;
}

.btn-warning:disabled {
    background: #6c757d;
    color: #fff;
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.btn-outline {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Reduced from 250px */
    gap: 0.8rem; /* Reduced from 1rem */
    margin-bottom: 1.5rem; /* Reduced from 2rem */
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 0.9rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.summary-card .card-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.summary-card .icon {
    width: 40px; /* Reduced from default */
    height: 40px; /* Reduced from default */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-card .icon i {
    font-size: 1rem; /* Reduced icon size */
    color: white;
}

.summary-card .text-content {
    flex: 1;
    min-width: 0;
}

.summary-card .title {
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 0.3rem; /* Further reduced */
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    line-height: 1.2;
}

.summary-card .amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    font-family: 'Poppins', sans-serif;
    line-height: 1.2;
}

.summary-card:hover {
    transform: translateY(-3px); /* Reduced from -5px */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* Reduced shadow */
}

.summary-card:nth-child(1) .card-icon {
    background: linear-gradient(135deg, #0dbdfe 0%, #0099cc 100%);
}

.summary-card:nth-child(2) .card-icon {
    background: linear-gradient(135deg, #ff5b74 0%, #ff4757 100%);
}

.summary-card:nth-child(3) .card-icon {
    background: linear-gradient(135deg, #60b8c3 0%, #4a9ba5 100%);
}

.summary-card h3 {
    color: #666;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.summary-card .amount {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

/* Ledger Card */
.ledger-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(222, 226, 230, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.card-header h2 {
    color: #333;
    font-size: 1rem; /* Further reduced from 1.1rem */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.card-header h2 i {
    color: #0dbdfe;
}

.card-header h3 {
    color: #495057;
    font-size: 0.9rem; /* Further reduced from 1rem */
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

.card-header p {
    margin: 3px 0;
    color: #6c757d;
    font-size: 0.7rem; /* Further reduced from 0.8rem */
    font-family: 'Poppins', sans-serif;
}

.card-header p strong {
    color: #0dbdfe;
    font-weight: 600;
}

.card-header p em {
    color: #28a745;
    font-style: italic;
}

.card-actions {
    display: flex;
    gap: 1rem;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    padding: 1rem;
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.6rem;
    font-family: 'Poppins', sans-serif;
}

.ledger-table th,
.ledger-table td {
    padding: 0.5rem; /* Reduced from 0.6rem */
    text-align: center;
    border: 1px solid #e9ecef;
    min-width: 100px;
    font-family: 'Poppins', sans-serif;
}

.ledger-table th {
    background: linear-gradient(135deg, #0dbdfe 0%, #0099cc 100%);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.7rem; /* Further reduced from 0.8rem */
}

.ledger-table th:first-child {
    min-width: 160px; /* Reduced from 180px */
    text-align: left;
    font-size: 0.7rem; /* Further reduced from 0.8rem */
}

.ledger-table th.today {
    background: linear-gradient(135deg, #ff5b74 0%, #ff4757 100%);
    animation: pulse 2s infinite;
}

.ledger-table td {
    background: white;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ledger-table td:hover {
    background: #f8f9fa;
    transform: scale(1.02);
}

.ledger-table td.today {
    background: #fff3cd;
    border-color: #ffeaa7;
    font-weight: 600;
}

.ledger-table td.has-data {
    background: #e8f5e8;
    border-color: #c3e6c3;
    font-weight: 500;
}

.ledger-table .category-name {
    text-align: left;
    font-weight: 500;
    color: #333;
    background: #f8f9fa;
}

.ledger-table .total-column {
    background: #e3f2fd;
    font-weight: 600;
    color: #1976d2;
}

.ledger-table .description-cell {
    background-color: #f8f9fa;
    text-align: center;
    padding: 0.5rem;
    border-left: 1px solid #dee2e6;
    min-width: 40px;
}

.ledger-table .description-cell i {
    color: #6c757d;
    cursor: help;
    font-size: 0.9rem;
}

.ledger-table .description-cell i:hover {
    color: #0d6efd;
}

.ledger-table .commission-cell {
    background-color: #f8f9fa;
    font-weight: 500;
    text-align: right;
    padding: 0.5rem 1rem;
    border-left: 1px solid #dee2e6;
}

.ledger-table .summary-row td {
    background: #f8f9fa;
    font-weight: 600;
}

.ledger-table .summary-row.sub-total td {
    background: #e8f5e8;
    color: #2e7d32;
}

.ledger-table .summary-row.lipa-faida td {
    background: #fff3e0;
    color: #f57c00;
}

.ledger-table .summary-row.grand-total td {
    background: #e3f2fd;
    color: #1976d2;
    font-size: 1.1rem;
}

.ledger-table .grand-total-cell {
    background: #bbdefb !important;
    color: #1565c0 !important;
}

.ledger-table .summary-row.expenses td {
    background: #ffebee;
    color: #c62828;
}

.ledger-table .summary-row.loans td {
    background: #fff8e1;
    color: #ff8f00;
}

.negative-amount {
    color: #c62828 !important;
    font-weight: bold;
}

.ledger-table th.future-date {
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    color: #757575;
    opacity: 0.6;
}

.ledger-table td.future-date {
    background: #f5f5f5 !important;
    color: #9e9e9e !important;
    cursor: not-allowed;
    opacity: 0.6;
    border-color: #e0e0e0 !important;
}

.ledger-table td.future-date:hover {
    background: #f5f5f5 !important;
    transform: none !important;
}

.ledger-table .summary-row td.future-date {
    background: #f5f5f5 !important;
    color: #9e9e9e !important;
    opacity: 0.6;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.modal-header {
    background: linear-gradient(135deg, #0dbdfe, #0099cc);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

.modal-header .close {
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 28px; /* Reduced from 30px */
    height: 28px; /* Reduced from 30px */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-header .close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem; /* Reduced from 0.5rem */
    font-weight: 500;
    color: #333;
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem; /* Further reduced from 0.85rem */
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.4rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.6rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0dbdfe;
    box-shadow: 0 0 0 3px rgba(13, 189, 254, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        padding: 0 1rem;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .summary-cards {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .user-dropdown {
        order: -1;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .user-dropdown-toggle {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .user-dropdown-menu {
        min-width: 260px;
        right: -10px;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .card-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .ledger-table {
        font-size: 0.8rem;
    }
    
    .ledger-table th,
    .ledger-table td {
        padding: 0.5rem 0.25rem;
        min-width: 80px;
    }
    
    .ledger-table th:first-child {
        min-width: 150px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main-content {
        margin: 1rem auto;
    }
    
    .summary-card {
        padding: 1.5rem;
    }
    
    .summary-card .amount {
        font-size: 1.5rem;
    }
    
    .ledger-table th,
    .ledger-table td {
        padding: 0.25rem;
        font-size: 0.7rem;
        min-width: 60px;
    }
    
    .ledger-table th:first-child {
        min-width: 120px;
    }
}

/* Print Styles */
@media print {
    .header,
    .card-actions,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .ledger-table {
        font-size: 0.7rem;
    }
    
    .ledger-table th,
    .ledger-table td {
        padding: 0.25rem;
    }
} 

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px; /* Start hidden on mobile */
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    z-index: 10000; /* Much higher z-index to ensure it's above everything */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateZ(0); /* Force hardware acceleration */
    pointer-events: auto; /* Ensure clicks work */
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    left: 0;
    transform: translateZ(0);
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    gap: 10px;
    position: relative;
}

.sidebar-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}

.sidebar-logo-img {
    height: 50px;
    width: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 0.9rem; /* Further reduced from 1rem */
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

.sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 0.9rem; /* Further reduced from 1rem */
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10005;
    pointer-events: auto;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-nav {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    min-height: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    pointer-events: auto; /* Ensure clicks work */
    cursor: pointer; /* Ensure cursor shows as clickable */
    z-index: 10002; /* Ensure it's above other elements */
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #0dbdfe;
    color: white;
    transform: translateX(5px);
}

.nav-item.active {
    background: rgba(13, 189, 254, 0.2);
    border-left-color: #0dbdfe;
    color: white;
    box-shadow: inset 0 0 20px rgba(13, 189, 254, 0.1);
}

.nav-item i {
    margin-right: 12px;
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.nav-item span {
    font-weight: 500;
    font-size: 0.7rem;
}

/* Mobile Sidebar Toggle Button */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    min-height: 44px;
    min-width: 44px;
    z-index: 10004;
    position: relative;
    pointer-events: auto;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999; /* Lower than sidebar but higher than other content */
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: auto; /* Ensure clicks work */
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive Sidebar */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar {
        left: -280px;
        width: 280px;
        max-width: 85vw; /* Ensure it doesn't exceed screen width */
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar.active {
        left: 0;
        transform: translateX(0);
    }
    
    .header-content {
        justify-content: space-between;
    }
    
    .header-right {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    /* Hide other buttons in header-right on mobile, but keep user dropdown */
    .header-right .btn {
        display: none;
    }
    
    .header-left {
        display: flex;
        align-items: center;
        gap: 15px;
    }
    
    .header-left h1 {
        font-size: 1.3rem;
    }
    
    /* Ensure sidebar content is visible */
    .sidebar * {
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Force sidebar to be above everything */
    .sidebar.active {
        z-index: 10001 !important;
        position: fixed !important;
        display: block !important;
    }
}

/* Desktop sidebar behavior */
@media (min-width: 769px) {
    .main-content {
        margin-left: 280px; /* Push content to the right of sidebar */
    }
    
    .header {
        margin-left: 280px; /* Push header to the right of sidebar */
        width: calc(100% - 280px); /* Adjust header width */
        position: relative;
        z-index: 100;
        border-left: 1px solid rgba(255, 255, 255, 0.2); /* Visual separation from sidebar */
    }
    
    .sidebar {
        left: 0; /* Always visible on desktop */
        z-index: 1001;
        position: fixed;
        top: 0;
        left: 0;
        border-right: 1px solid rgba(255, 255, 255, 0.2); /* Visual separation from header */
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    .sidebar-close {
        display: none;
    }
    
    .sidebar-overlay {
        display: none;
    }
    
    /* Ensure proper layout on desktop */
    body {
        overflow-x: hidden; /* Prevent horizontal scroll */
    }
}

/* Main Content Adjustment */
.main-content {
    margin-left: 0; /* Start with no margin on mobile */
    padding: 20px;
    min-height: calc(100vh - 80px);
    transition: margin-left 0.3s ease;
}

/* Page Content */
.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

/* Page Header Styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, #0dbdfe 0%, #60b8c3 50%, #0099cc 100%);
    border-radius: 24px;
    color: white;
    box-shadow: 0 10px 30px rgba(13, 189, 254, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.3));
}

.page-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-header h2 i {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.page-header h3 {
    margin: 0 0 8px 0;
    font-size: 0.9rem; /* Further reduced from 1rem */
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

.page-header p {
    margin: 4px 0;
    font-size: 0.7rem; /* Further reduced from 0.8rem */
    font-family: 'Poppins', sans-serif;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

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


/* Commission cell styling */
.commission-cell {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.commission-cell:hover {
    background-color: #f0f8ff !important;
    border: 2px solid #0dbdfe !important;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(13, 189, 254, 0.3);
}

.commission-cell:active {
    transform: scale(0.98);
    background-color: #e6f3ff !important;
}

.commission-cell::after {
    content: "✏️";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.commission-cell:hover::after {
    opacity: 1;
}

/* Commission Cell Modal Styling */
.commission-modal {
    max-width: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.commission-modal .modal-header {
    background: linear-gradient(135deg, #0dbdfe, #007acc);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 20px;
    margin: 0;
}

.commission-modal .modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.commission-modal .close {
    color: white;
    font-size: 24px;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.commission-modal .close:hover {
    opacity: 1;
}

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

.commission-modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input,
.input-with-icon select {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.input-with-icon input:focus,
.input-with-icon select:focus {
    outline: none;
    border-color: #0dbdfe;
    box-shadow: 0 0 0 3px rgba(13, 189, 254, 0.1);
}

.input-with-icon i {
    position: absolute;
    right: 12px;
    color: #6c757d;
    font-size: 14px;
    pointer-events: none;
}

.commission-modal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    margin: 0;
}

.commission-modal .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.commission-modal .btn-secondary {
    background: #6c757d;
    color: white;
}

.commission-modal .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.commission-modal .btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.commission-modal .btn-success:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
}

.commission-modal .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Responsive design for page header */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    
    .page-header h2 {
        font-size: 1.5rem;
    }
}

/* Inventory Table Styles */
.inventory-card {
    margin-top: 20px;
}

.inventory-card .card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
}

.inventory-card .card-header h3 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
}

.inventory-card .card-header p {
    margin: 5px 0;
    color: #6c757d;
    font-size: 0.95rem;
}

.inventory-card .card-header p strong {
    color: #0dbdfe;
    font-weight: 600;
}

.inventory-card .card-header p em {
    color: #28a745;
    font-style: italic;
}

/* Inventory table styles */
.inventory-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 1200px; /* Ensure table can accommodate all 5 columns */
}

.inventory-table th,
.inventory-table td {
    padding: 0.4rem;
    text-align: center;
    border: 1px solid #e0e0e0;
    font-size: 0.6rem;
    min-width: 70px; /* Ensure minimum width for each column */
}

.inventory-table th {
    background: linear-gradient(135deg, #0dbdfe, #0099cc);
    color: white;
    font-weight: 600;
    font-size: 0.6rem;
}

.inventory-table .sub-header th {
    background: linear-gradient(135deg, #60b8c3, #4a9ba5);
    font-size: 0.55rem;
    padding: 0.25rem;
}

/* Ensure each date column has all 5 sub-columns */
.inventory-table .date-column {
    min-width: 400px; /* 5 columns × 80px each */
}

.inventory-cell {
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    position: relative;
    height: 40px; /* Consistent height for all cells */
    vertical-align: middle;
}

.inventory-cell:hover {
    background-color: #f8f9fa;
    transform: scale(1.02);
}

.inventory-cell[data-type="open"] {
    background-color: #e8f5e8;
    border-left: 3px solid #28a745;
}

.inventory-cell[data-type="purchases"] {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
}

.inventory-cell[data-type="sales"] {
    background-color: #d1ecf1;
    border-left: 3px solid #17a2b8;
}

.inventory-cell[data-type="expenses"] {
    background-color: #f8d7da;
    border-left: 3px solid #dc3545;
    color: #721c24;
}

.inventory-cell[data-type="expenses"]:hover {
    background-color: #f5c6cb !important;
    transform: scale(1.02);
}

.inventory-cell[data-type="closing"] {
    background-color: #e2e3e5;
    border-left: 3px solid #6c757d;
    cursor: default;
}

.inventory-cell.auto-calculated {
    background-color: #fff3cd !important;
    border: 2px dashed #ffc107;
    cursor: not-allowed;
    position: relative;
}

.inventory-cell.auto-calculated::after {
    content: "🔄";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.6rem;
    color: #ffc107;
}

.inventory-cell.future-date {
    background-color: #f8f9fa !important;
    color: #6c757d;
    cursor: not-allowed;
}

.total-cell {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
    font-weight: 600;
    border-top: 2px solid #0dbdfe;
}

/* Ensure the table container can scroll horizontally if needed */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Item name column styling */
.inventory-table .item-name {
    background: linear-gradient(135deg, #ff5b74, #e04a5f);
    color: white;
    font-weight: bold;
    text-align: left;
    padding: 8px;
    min-width: 120px;
    position: sticky;
    left: 0;
    z-index: 10;
    font-size: 0.7rem;
}

/* Date header styling */
.inventory-table .date-header {
    background: linear-gradient(135deg, #0dbdfe, #0099cc);
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 8px 4px;
    min-width: 400px; /* 5 columns × 80px each */
    font-size: 0.7rem;
    border: 1px solid #e0e0e0;
}

/* Ensure proper alignment of date headers with their sub-columns */
.inventory-table th[colspan="5"] {
    text-align: center;
    vertical-align: middle;
}

/* Sub-header styling for the 5 columns under each date */
.inventory-table .sub-header {
    background: linear-gradient(135deg, #60b8c3, #4a9ba5);
    color: white;
    font-weight: bold;
    padding: 5px 4px;
    min-width: 80px;
    font-size: 0.65rem;
    border: 1px solid #e0e0e0;
}

.inventory-table .inventory-cell {
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 80px;
    position: relative;
    border: 1px solid #e0e0e0;
}

.inventory-table .inventory-cell:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(13, 189, 254, 0.2);
    border-color: #0dbdfe;
}

.inventory-table .inventory-cell:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, #0dbdfe 0%, #60b8c3 100%);
    color: white;
}

.inventory-table .inventory-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.inventory-table .inventory-cell:hover::before {
    opacity: 1;
}

.inventory-table .inventory-cell::after {
    content: '✏️';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.inventory-table .inventory-cell:hover::after {
    opacity: 0.7;
}

/* Add a subtle pulse animation for empty cells to indicate they're clickable */
.inventory-table .inventory-cell:empty {
    animation: subtlePulse 2s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% {
        background: #f8f9fa;
    }
    50% {
        background: #e3f2fd;
    }
}

/* Remove pulse animation on hover */
.inventory-table .inventory-cell:hover {
    animation: none;
}

.inventory-table .total-cell {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    font-weight: bold;
    min-width: 80px;
    position: relative;
    cursor: default;
}

.inventory-table .total-cell::before {
    content: '📊';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    opacity: 0.7;
}

.inventory-table .total-cell::after {
    content: 'Auto-calculated';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 6px;
    opacity: 0.6;
    white-space: nowrap;
}

.inventory-table .total-row .item-name {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    font-weight: bold;
    text-align: left;
    padding: 12px;
    min-width: 120px;
    position: sticky;
    left: 0;
    z-index: 90;
    box-shadow: 2px 0 0 rgba(0,0,0,0.06);
}

/* Total row cells styling for better visibility */
.inventory-table .total-row .inventory-cell {
    background: linear-gradient(135deg, #343a40, #212529) !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
    border: 2px solid #ffffff !important;
    font-size: 0.9rem !important;
    padding: 12px 10px !important;
    text-align: center !important;
    letter-spacing: 0.5px !important;
}

.inventory-table .total-row .inventory-cell:hover {
    background: linear-gradient(135deg, #495057, #343a40) !important;
    color: #ffffff !important;
    transform: none;
    box-shadow: none;
    border: 2px solid #ffffff !important;
}

/* Ensure total row stands out */
.inventory-table .total-row {
    border-top: 4px solid #000000 !important;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3) !important;
    background: linear-gradient(135deg, #343a40, #212529) !important;
}

.inventory-table .total-row td {
    border-top: 3px solid #ffffff !important;
    border-bottom: 2px solid #000000 !important;
}

/* Force override any conflicting styles for total row */
.inventory-table .total-row td,
.inventory-table .total-row .inventory-cell,
.inventory-table .total-row .total-cell {
    background: linear-gradient(135deg, #343a40, #212529) !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
    border: 2px solid #ffffff !important;
    font-size: 0.9rem !important;
    padding: 12px 10px !important;
    text-align: center !important;
    letter-spacing: 0.5px !important;
}

.inventory-table .future-date {
    opacity: 0.4;
    background: #f0f0f0 !important;
    cursor: not-allowed;
}

.inventory-table .future-date:hover {
    background: #f0f0f0 !important;
}

/* Horizontal scrolling container for inventory table */
.table-container {
    overflow-x: auto;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Responsive design for inventory table */
@media (max-width: 768px) {
    .inventory-table {
        min-width: 600px;
    }
    
    .inventory-table th,
    .inventory-table td {
        padding: 6px 4px;
        font-size: 12px;
        min-width: 60px;
    }
    
    .inventory-table .date-header {
        min-width: 240px; /* 4 columns * 60px */
        padding: 8px 2px;
    }
    
    .inventory-table .item-name {
        min-width: 100px;
        padding: 8px;
    }
}

.inventory-table .inventory-cell.auto-calculated {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px dashed #ffc107;
    position: relative;
}

.inventory-table .inventory-cell.auto-calculated::after {
    content: "🔄";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    opacity: 0.7;
}

.inventory-table .inventory-cell.auto-calculated:hover {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
}

/* Responsive Sidebar */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-actions {
        gap: 1rem;
    }
} 

/* Mobile-specific improvements */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .page-header {
        padding: 12px 15px;
        margin-bottom: 15px;
    }
    
    .page-header h2 {
        font-size: 1rem;
    }
    
    .header-content {
        padding: 0 15px;
    }
    
    .main-logo {
        height: 32px;
    }
    
    .sidebar-logo-img {
        height: 40px;
    }
    
    .header-left h1 {
        font-size: 1.1rem;
    }
    
    /* More compact summary cards on mobile */
    .summary-cards {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* Even smaller on mobile */
        gap: 0.6rem; /* Tighter spacing on mobile */
        margin-bottom: 1rem;
    }
    
    .summary-card {
        padding: 0.7rem; /* Smaller padding on mobile */
        min-height: 70px; /* Smaller height on mobile */
    }
    
    .summary-card .icon {
        width: 32px; /* Smaller icons on mobile */
        height: 32px;
    }
    
    .summary-card .icon i {
        font-size: 0.9rem; /* Smaller icon size on mobile */
    }
    
    .summary-card .title {
        font-size: 0.65rem; /* Smaller title on mobile */
        margin-bottom: 0.2rem;
    }
    
    .summary-card .amount {
        font-size: 1rem; /* Smaller amount on mobile */
    }
    
    /* Improve table scrolling on mobile */
    .table-container {
        margin: 0 -15px;
        border-radius: 0;
    }
    
    .inventory-table {
        min-width: 600px;
        font-size: 0.65rem;
    }
    
    .inventory-table th,
    .inventory-table td {
        padding: 4px 3px;
        min-width: 60px;
        font-size: 0.65rem;
    }
    
    /* Better button sizing on mobile */
    .btn {
        padding: 6px 12px;
        font-size: 0.65rem;
    }
    
    /* Improve modal on mobile */
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
        max-width: none;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Smaller fonts for mobile */
    body {
        font-size: 10px;
    }
    
    .ledger-table {
        font-size: 0.65rem;
    }
    
    .ledger-table th,
    .ledger-table td {
        padding: 0.4rem;
        font-size: 0.65rem;
    }
    
    .inventory-table th,
    .inventory-table td {
        font-size: 0.65rem;
    }
}

/* Desktop sidebar behavior */
@media (min-width: 769px) {
    .main-content {
        margin-left: 280px; /* Push content to the right of sidebar */
    }
    
    .sidebar {
        left: 0; /* Always visible on desktop */
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    .sidebar-close {
        display: none;
    }
    
    .sidebar-overlay {
        display: none;
    }
}

/* Smooth transitions for all screen sizes */
.sidebar,
.main-content,
.sidebar-overlay {
    transition: all 0.3s ease;
}

/* Improve sidebar scroll on mobile */
.sidebar {
    -webkit-overflow-scrolling: touch;
}

/* Better touch targets on mobile */
.nav-item {
    min-height: 44px; /* Apple's recommended minimum touch target */
    display: flex;
    align-items: center;
}

/* Ensure sidebar is always clickable */
.sidebar * {
    pointer-events: auto !important;
}

/* Force sidebar elements to be interactive */
.sidebar.active .nav-item,
.sidebar.active .sidebar-close,
.sidebar.active .sidebar-header {
    pointer-events: auto !important;
    z-index: 10003 !important;
    position: relative !important;
}

/* Ensure sidebar content is not transparent or faded */
.sidebar.active {
    opacity: 1 !important;
    visibility: visible !important;
}

.sidebar.active .nav-item {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Prevent other elements from interfering with sidebar */
.sidebar {
    isolation: isolate; /* Create new stacking context */
}

/* =====================================================
   REPORTS PAGE STYLES
   ===================================================== */

/* Report Cards */
.report-card {
    margin-bottom: 2.5rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.report-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.report-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(222, 226, 230, 0.5);
    backdrop-filter: blur(10px);
}

.report-card .card-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.report-card .card-header h3 i {
    color: #0dbdfe;
    font-size: 1.1rem;
}

/* Report Tables */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

.report-table th,
.report-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.report-table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 700;
    color: #333;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #0dbdfe;
    position: sticky;
    top: 0;
    z-index: 10;
}

.report-table tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.report-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(13, 189, 254, 0.05), rgba(96, 184, 195, 0.05));
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.report-table .amount {
    text-align: right;
    font-weight: 600;
    color: #333;
    font-family: 'Poppins', sans-serif;
}

.report-table .total-row {
    background: linear-gradient(135deg, #0dbdfe 0%, #60b8c3 100%);
    color: white;
    font-weight: 700;
    border-top: 3px solid #0099cc;
    position: relative;
}

.report-table .total-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.report-table .total-row td {
    padding: 20px;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.report-table .total-row .amount {
    color: white;
    font-size: 1.2rem;
}

/* Loan Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.paid {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.unpaid {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loan Row Styles */
.paid-loan {
    background-color: #f8fff8;
}

.unpaid-loan {
    background-color: #fff8f8;
}

/* Small Buttons */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 4px;
}

/* Date Filter for Reports */
.date-filter-form {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.date-filter-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0dbdfe, #60b8c3, #0099cc);
}

.date-filter-form label {
    font-weight: 600;
    color: #333;
    margin: 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-filter-form input[type="date"] {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.date-filter-form input[type="date"]:focus {
    outline: none;
    border-color: #0dbdfe;
    box-shadow: 0 0 0 3px rgba(13, 189, 254, 0.1);
    transform: scale(1.02);
}

.date-filter-form .btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(13, 189, 254, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.date-filter-form .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 189, 254, 0.4);
}

/* Responsive Design for Reports */
@media (max-width: 768px) {
    .report-table {
        font-size: 0.9rem;
    }
    
    .report-table th,
    .report-table td {
        padding: 8px 6px;
    }
    
    .date-filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-filter-form > * {
        margin-bottom: 0.5rem;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

/* =====================================================
   REPORTS PAGE ENHANCEMENTS
   ===================================================== */

/* Empty State Styling */
.report-table tbody tr:only-child td {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
    font-style: italic;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.report-table tbody tr:only-child td::before {
    content: '📊';
    display: block;
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Report Section Animations */
.report-card {
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.report-card:nth-child(1) { animation-delay: 0.1s; }
.report-card:nth-child(2) { animation-delay: 0.2s; }
.report-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Report Headers */
.report-card .card-header h3 i {
    background: linear-gradient(135deg, #0dbdfe 0%, #60b8c3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.3rem;
}

/* Commission Report Icon */
.report-card:nth-child(1) .card-header h3 i {
    background: linear-gradient(135deg, #ff5b74 0%, #ff4757 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Expenses Report Icon */
.report-card:nth-child(2) .card-header h3 i {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loans Report Icon */
.report-card:nth-child(3) .card-header h3 i {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced Table Content */
.report-table tbody tr td:first-child {
    font-weight: 600;
    color: #495057;
}

.report-table tbody tr td:nth-child(2) {
    color: #6c757d;
}

.report-table tbody tr td:nth-child(3) {
    color: #6c757d;
    font-style: italic;
}

/* Loading State */
.report-table.loading tbody tr {
    opacity: 0.6;
    pointer-events: none;
}

.report-table.loading::after {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #0dbdfe;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Inventory Date Filter Styling */
#inventory-page .date-filter-container {
    margin-bottom: 2rem;
}

#inventory-page .date-filter-form {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 1px solid #0dbdfe;
    box-shadow: 0 4px 12px rgba(13, 189, 254, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
}

#inventory-page .date-filter-form::before {
    background: linear-gradient(90deg, #0dbdfe, #60b8c3, #0099cc);
}

/* Responsive Enhancements for Reports */
@media (max-width: 768px) {
    .date-filter-form {
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .page-header {
        padding: 1.5rem 2rem;
        margin-bottom: 2rem;
    }
    
    .page-header h2 {
        font-size: 1.4rem;
    }
    
    .report-card .card-header {
        padding: 1.2rem 1.5rem;
    }
    
    .report-card .card-header h3 {
        font-size: 1.1rem;
    }
    
    .report-table th,
    .report-table td {
        padding: 12px 16px;
    }
    
    .report-table .total-row td {
        padding: 16px;
        font-size: 1rem;
    }
}

/* =====================================================
   USER MANAGEMENT STYLES
   ===================================================== */

/* User Status Badges */
.status-badge.active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.inactive {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Role Badges */
.role-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.role-badge.admin {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.role-badge.user {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* User Row Styles */
.active-user {
    background-color: #f8fff8;
}

.inactive-user {
    background-color: #fff8f8;
    opacity: 0.7;
}

/* Current User Badge */
.current-user-badge {
    background-color: #0dbdfe;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    margin-left: 8px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    white-space: nowrap;
}

/* Text Muted */
.text-muted {
    color: #6c757d;
    font-style: italic;
    font-size: 0.8rem;
}

/* Responsive Design for User Management */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .action-buttons .btn {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    .current-user-badge {
        display: block;
        margin-left: 0;
        margin-top: 4px;
        width: fit-content;
    }
}

.sidebar-toggle {
    min-height: 44px;
    min-width: 44px;
}

/* =====================================================
   MODERN ANIMATIONS & ENHANCEMENTS
   ===================================================== */

/* Smooth page transitions */
.page-content {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card hover animations */
.ledger-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12);
}

.summary-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Button ripple effect */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Loading animation for forms */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced focus states */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #0dbdfe;
    box-shadow: 0 0 0 3px rgba(13, 189, 254, 0.1);
    transform: scale(1.02);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Enhanced table hover effects */
.ledger-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(13, 189, 254, 0.05), rgba(96, 184, 195, 0.05));
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Modern notification styles */
.notification {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Enhanced mobile responsiveness */
@media (max-width: 480px) {
    .header-left h1 {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.75rem;
    }
    
    .card-header {
        padding: 1rem 1.5rem;
    }
    
    .nav-item {
        padding: 12px 16px;
        font-size: 0.85rem;
    }
    
    .user-dropdown-toggle {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .user-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    
    .user-dropdown-menu {
        min-width: 240px;
        right: -20px;
        z-index: 1001; /* Ensure it's above other elements */
    }
    
    /* Ensure user dropdown is always visible on mobile */
    .user-dropdown {
        display: flex !important;
        align-items: center;
    }
    
    .user-dropdown-toggle {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        padding: 6px 10px;
        font-size: 0.75rem;
        min-width: auto;
    }
    
    .user-name {
        display: block !important;
        font-size: 0.7rem;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Additional mobile optimizations */
    .user-dropdown-toggle .dropdown-arrow {
        font-size: 0.6rem;
    }
    
    /* Ensure dropdown menu is properly positioned on mobile */
    .user-dropdown-menu {
        position: fixed !important;
        top: 60px !important;
        right: 10px !important;
        left: auto !important;
        width: calc(100vw - 20px) !important;
        max-width: 280px !important;
        min-width: 240px !important;
    }
    
    .dropdown-header {
        padding: 16px;
    }
    
    .user-avatar-large {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .user-full-name {
        font-size: 0.9rem;
    }
    
    .user-role {
        font-size: 0.7rem;
    }
    
    .dropdown-item {
        padding: 12px 16px;
        font-size: 0.8rem;
    }
}

/* Large screen enhancements */
@media (min-width: 1400px) {
    .header-content {
        max-width: 1400px;
    }
    
    .main-content {
        max-width: 1400px;
        margin: 0 auto;
        margin-left: 280px;
    }
    
    .summary-cards {
        grid-template-columns: repeat(4, 1fr);
    }
} 

/* Report Summary Cards */
.report-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.report-summary .summary-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.report-summary .summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.report-summary .summary-icon i {
    font-size: 1.2rem;
    color: white;
}

.report-summary .summary-title {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.3rem;
    font-weight: 500;
    line-height: 1.2;
}

.report-summary .summary-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.report-summary .summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Responsive design for report summary */
@media (max-width: 1200px) {
    .report-summary {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .report-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .report-summary {
        grid-template-columns: 1fr;
    }
    
    .report-summary .summary-card {
        padding: 0.8rem;
        min-height: 80px;
    }
    
    .report-summary .summary-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 0.3rem;
    }
    
    .report-summary .summary-icon i {
        font-size: 1rem;
    }
    
    .report-summary .summary-title {
        font-size: 0.7rem;
    }
    
    .report-summary .summary-value {
        font-size: 1.1rem;
    }
}

/* Inventory Statistics Cards */
.inventory-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.inventory-stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 80px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card .stat-icon i {
    font-size: 1rem;
    color: white;
}

.stat-card .stat-content {
    flex: 1;
    min-width: 0;
}

.stat-card .stat-title {
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 0.3rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    line-height: 1.2;
}

.stat-card .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    font-family: 'Poppins', sans-serif;
    line-height: 1.2;
}

/* Mobile responsive for inventory stats */
@media (max-width: 768px) {
    .inventory-stats {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .inventory-stats-cards {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.6rem;
        margin-bottom: 1rem;
    }
    
    .stat-card {
        padding: 0.7rem;
        min-height: 70px;
    }
    
    .stat-card .stat-icon {
        width: 32px;
        height: 32px;
    }
    
    .stat-card .stat-icon i {
        font-size: 0.9rem;
    }
    
    .stat-card .stat-title {
        font-size: 0.65rem;
        margin-bottom: 0.2rem;
    }
    
    .stat-card .stat-value {
        font-size: 1rem;
    }
}

/* Tablet responsive for inventory stats */
@media (min-width: 769px) and (max-width: 1024px) {
    .inventory-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Large screen responsive for inventory stats */
@media (min-width: 1025px) {
    .inventory-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.2rem;
    }
} 

.form-group small.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    color: #6c757d;
    font-style: italic;
    line-height: 1.3;
}

.form-group small.form-help strong {
    color: #495057;
    font-weight: 600;
} 

/* Quick Navigation Button */
.btn-outline-secondary {
    background: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

/* Loading overlay styles */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Ensure proper table structure and visual separation */
.inventory-table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* Visual separation between date columns */
.inventory-table th.date-header:not(:first-child) {
    border-left: 2px solid #ffffff;
}

.inventory-table td:first-child {
    border-left: 2px solid #ffffff;
}

/* Ensure consistent column widths */
.inventory-table th,
.inventory-table td {
    box-sizing: border-box;
    position: relative;
}

/* Add subtle borders to separate date groups */
.inventory-table td[data-type="closing"] {
    border-right: 2px solid #e0e0e0;
} 

/* Sticky first column for inventory table */
.inventory-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 100; /* keep above date headers */
    background: linear-gradient(135deg, #0dbdfe, #0099cc);
}

/* Ensure all first cells stick, not only ones with .item-name */
.inventory-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 90; /* keep above other cells */
    background: linear-gradient(135deg, #ff5b74, #e04a5f);
    color: #fff;
    cursor: default; /* Item names are not clickable */
}

/* Make item names look more like labels */
.inventory-table td:first-child:hover {
    background: linear-gradient(135deg, #ff5b74, #e04a5f);
    transform: none;
    box-shadow: none;
    border-color: #e0e0e0;
}

.inventory-table .item-name {
    position: sticky;
    left: 0;
    z-index: 90;
    box-shadow: 2px 0 0 rgba(0,0,0,0.06);
}


/* Readable Closing Amount cells (non-total rows) */
.inventory-row:not(.total-row) td.total-cell[data-type="closing"] {
    background: #e9ecef; /* light gray */
    color: #333;        /* dark text for readability */
    font-weight: 600;
} 