/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-header h2 {
    color: #495057;
    font-size: 1.5rem;
    font-weight: 600;
}

.sidebar-header i {
    color: #007bff;
    margin-right: 10px;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #6c757d;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav li.active a {
    background-color: #f8f9fa;
    color: #007bff;
    border-left-color: #007bff;
}

.sidebar-nav i {
    width: 20px;
    margin-right: 12px;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    width: calc(100% - 250px);
    max-width: calc(100% - 250px);
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Header */
.header {
    background: #fff;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #495057;
    font-size: 1.8rem;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: #6c757d;
    font-weight: 500;
}

.logout-btn {
    color: #dc3545;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: #f8d7da;
}

.header-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.header-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* Content */
.content {
    flex: 1;
    padding: 30px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 25px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #495057;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Force 4 columns on larger screens */
@media (min-width: 1201px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.stat-icon.blue { color: #007bff; }
.stat-icon.green { color: #28a745; }
.stat-icon.orange { color: #fd7e14; }
.stat-icon.red { color: #dc3545; }
.stat-icon.purple { color: #6f42c1; }

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-success {
    background-color: #28a745;
    color: #fff;
}

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

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #545b62;
}

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

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.form-control[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Tables */
.table-container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

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

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

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

/* Filters */
.filters {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    text-decoration: none;
    color: #007bff;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #007bff;
    color: #fff;
}

.pagination .active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    margin: 1% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 95vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #e9ecef;
    position: relative;
}

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

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    background: white;
    max-height: calc(95vh - 200px);
    min-height: 400px;
    scrollbar-width: thin;
    scrollbar-color: #007bff #f8f9fa;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

.modal-footer {
    padding: 25px 30px;
    border-top: 2px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #495057;
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-header p {
    color: #6c757d;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    /* Old sidebar rules removed - see Mobile Hamburger Menu section below */
    
    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .content {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .modal-content {
        width: 95%;
        margin: 0.5% auto;
        max-height: 98vh;
    }
    
    .modal-body {
        padding: 20px;
        max-height: calc(98vh - 180px);
    }
    
    .items-container {
        max-height: 300px;
        padding: 10px;
    }
    
    .item-group {
        padding: 15px;
        margin-bottom: 15px;
    }
}

/* Item Groups */
.item-group {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background: #ffffff;
    position: relative;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.item-group:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.item-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.item-group-title {
    font-weight: 600;
    color: #007bff;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.remove-item-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.3);
}

.remove-item-btn:hover {
    background: #c82333;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.add-item-btn {
    background: linear-gradient(145deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    margin: 25px auto;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.add-item-btn:hover {
    background: linear-gradient(145deg, #1e7e34, #17a2b8);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.items-container {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #007bff #f8f9fa;
}

.items-container::-webkit-scrollbar {
    width: 6px;
}

.items-container::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

.items-container::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 3px;
}

.items-container::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

.items-container h4 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    background: #f8f9fa;
    padding: 10px 0;
    z-index: 5;
}

/* Invoice Summary */
.invoice-summary {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
}

.summary-value {
    font-weight: 700;
    color: #007bff;
    font-size: 1.1rem;
}

.total-row {
    border-top: 2px solid #007bff;
    padding-top: 12px;
    margin-top: 8px;
}

.total-row .summary-label {
    font-size: 1.2rem;
    color: #007bff;
}

.total-row .summary-value {
    font-size: 1.3rem;
    color: #28a745;
}

/* Items List in View Modal */
.items-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    background: #f8f9fa;
}

.item-row {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    background: #ffffff;
    border-radius: 6px;
    margin-bottom: 8px;
}

.item-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.item-description {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
    color: #6c757d;
}

.item-details span {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; } 
/* ===================================
   ENHANCED MODAL STYLES FOR QUOTATIONS
   =================================== */

.modern-modal {
    max-width: 900px;
    width: 95%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease-out;
}

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

.modern-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 30px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.header-text .modal-title {
    color: white;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.header-text .modal-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 400;
    margin: 0;
}

.modern-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
}

.modern-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modern-body {
    padding: 30px;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
    background: #f8f9fa;
}

.modern-body::-webkit-scrollbar {
    width: 8px;
}

.modern-body::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.modern-body::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

.modern-body::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.modern-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modern-group.full-width {
    grid-column: span 2;
}

.modern-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
}

.modern-label i {
    color: #667eea;
    font-size: 16px;
}

.modern-control {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
    font-family: inherit;
}

.modern-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modern-control:hover {
    border-color: #cbd5e0;
}

.modern-control[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.items-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.items-section h4 {
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.items-section h4::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.items-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

.form-row .form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 150px;
}

.form-row .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

.form-row .form-control {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-row .form-control:focus {
    outline: none;
    border-color: #667eea;
}

.items-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

.item-row:hover {
    border-color: #667eea;
    background: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-info strong {
    color: #495057;
    font-size: 15px;
}

.item-info span {
    color: #6c757d;
    font-size: 13px;
}

.item-total {
    display: flex;
    align-items: center;
    gap: 16px;
}

.item-total strong {
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
}

.btn-icon-sm {
    background: #dc3545;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-sm:hover {
    background: #c82333;
    transform: scale(1.05);
}

.no-items {
    text-align: center;
    padding: 40px;
    color: #adb5bd;
    font-style: italic;
}

.items-total {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 15px;
}

.total-row span {
    color: #6c757d;
}

.total-row strong {
    color: #495057;
    font-weight: 600;
}

.total-row.grand-total {
    border-top: 2px solid #e9ecef;
    margin-top: 10px;
    padding-top: 16px;
    font-size: 18px;
}

.total-row.grand-total span {
    color: #495057;
    font-weight: 700;
}

.total-row.grand-total strong {
    color: #667eea;
    font-size: 22px;
    font-weight: 700;
}

.modern-footer {
    padding: 20px 30px;
    background: white;
    border-top: 2px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-radius: 0 0 12px 12px;
}

.modern-footer .btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modern-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.modern-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.modern-footer .btn-secondary {
    background: white;
    border: 2px solid #e9ecef;
    color: #6c757d;
}

.modern-footer .btn-secondary:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

/* Checkbox Styling */
.modern-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #667eea;
}

.modern-label:has(input[type="checkbox"]) {
    flex-direction: row;
    cursor: pointer;
    padding: 12px 16px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modern-label:has(input[type="checkbox"]):hover {
    border-color: #667eea;
    background: #f8f9fa;
}

/* View Details Styling */
.view-details {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.view-row {
    display: flex;
    padding: 14px 0;
    border-bottom: 1px solid #e9ecef;
}

.view-row:last-child {
    border-bottom: none;
}

.view-label {
    font-weight: 600;
    color: #495057;
    min-width: 180px;
}

.view-value {
    color: #6c757d;
    flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-modal {
        width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .modern-header {
        border-radius: 0;
    }
    
    .modern-footer {
        border-radius: 0;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-row .form-group {
        max-width: none !important;
    }
}


/* ===================================
   ACTIONS DROPDOWN STYLES
   =================================== */

.actions-dropdown {
    position: relative;
    display: inline-block;
}

.actions-toggle-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #495057;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.actions-toggle-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: scale(1.05);
}

.actions-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    padding: 8px 0;
    animation: dropdownSlide 0.2s ease-out;
}

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

.actions-dropdown-menu.show {
    display: block;
}

.actions-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.actions-dropdown-menu a:hover {
    background: #f8f9fa;
    color: #667eea;
}

.actions-dropdown-menu a i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.actions-dropdown-menu a.text-danger {
    color: #dc3545;
}

.actions-dropdown-menu a.text-danger:hover {
    background: #fff5f5;
    color: #c82333;
}

.actions-dropdown-menu a:first-child {
    border-radius: 8px 8px 0 0;
}

.actions-dropdown-menu a:last-child {
    border-radius: 0 0 8px 8px;
}

/* Table Actions Column */
table td:has(.actions-dropdown) {
    text-align: center;
    vertical-align: middle;
}


/* Actions Dropdown Divider */
.actions-dropdown-menu hr {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 8px 0;
}

/* Status-specific action colors */
.actions-dropdown-menu a[onclick*="accepted"] {
    color: #28a745;
}

.actions-dropdown-menu a[onclick*="accepted"]:hover {
    background: #f0f9f4;
    color: #218838;
}

.actions-dropdown-menu a[onclick*="rejected"] {
    color: #ffc107;
}

.actions-dropdown-menu a[onclick*="rejected"]:hover {
    background: #fffbf0;
    color: #e0a800;
}

.actions-dropdown-menu a[onclick*="converted"] {
    color: #17a2b8;
}

.actions-dropdown-menu a[onclick*="converted"]:hover {
    background: #f0f9fb;
    color: #138496;
}

/* Table overflow fix for dropdowns */
.table-container {
    overflow: visible !important;
    position: relative;
}

.table-container table {
    position: relative;
}


/* ===================================
   QUOTES PAGE SPECIFIC STYLES
   =================================== */

/* Page Header */
.quotes-page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 30px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.quotes-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.quotes-title-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.quotes-icon-badge {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.quotes-title-text h1 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 6px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quotes-title-text p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    margin: 0;
    font-weight: 400;
}

.quotes-header-actions {
    display: flex;
    gap: 12px;
}

.btn-add-quote {
    background: white;
    color: #667eea;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-add-quote:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: #f8f9ff;
}

.btn-add-quote i {
    font-size: 18px;
}

/* Stats Cards */
.quotes-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.quotes-stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quotes-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--card-color);
}

.quotes-stat-card.blue {
    --card-color: #2196F3;
}

.quotes-stat-card.orange {
    --card-color: #FF9800;
}

.quotes-stat-card.green {
    --card-color: #4CAF50;
}

.quotes-stat-card.purple {
    --card-color: #9C27B0;
}

.quotes-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.stat-card-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--card-color);
    background: color-mix(in srgb, var(--card-color) 10%, white);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filters Section */
.quotes-filters-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.quotes-filters-section .filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.quotes-filters-section .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quotes-filters-section .form-label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.quotes-filters-section .form-control {
    padding: 10px 14px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.quotes-filters-section .form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.quotes-filters-section .filters-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-clear {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background: #e9ecef;
    border-color: #cbd5e0;
}

.btn-apply {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Responsive Design for Quotes Page */
@media (max-width: 768px) {
    .quotes-page-header {
        padding: 24px;
        border-radius: 12px;
    }
    
    .quotes-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .quotes-title-section {
        width: 100%;
    }
    
    .quotes-icon-badge {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
    
    .quotes-title-text h1 {
        font-size: 22px;
    }
    
    .quotes-header-actions {
        width: 100%;
    }
    
    .btn-add-quote {
        width: 100%;
        justify-content: center;
    }
    
    .quotes-stats-container {
        grid-template-columns: 1fr;
    }
    
    .quotes-filters-section .filters-row {
        grid-template-columns: 1fr;
    }
    
    .quotes-filters-section .filters-actions {
        flex-direction: column;
    }
    
    .btn-clear,
    .btn-apply {
        width: 100%;
        justify-content: center;
    }
}


/* ===================================
   DASHBOARD PAGE SPECIFIC STYLES
   =================================== */

/* Dashboard Stats Cards */
.dashboard-stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.dashboard-stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 140px;
    max-height: 140px;
    display: flex;
    flex-direction: column;
}

.dashboard-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--card-color);
}

.dashboard-stat-card.blue {
    --card-color: #2196F3;
}

.dashboard-stat-card.green {
    --card-color: #4CAF50;
}

.dashboard-stat-card.orange {
    --card-color: #FF9800;
}

.dashboard-stat-card.red {
    --card-color: #dc3545;
}

.dashboard-stat-card.warning {
    --card-color: #ff9800;
}

.dashboard-stat-card.purple {
    --card-color: #9C27B0;
}

.dashboard-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.dashboard-stat-card .stat-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    height: 100%;
    overflow: hidden;
}

.dashboard-stat-card .stat-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--card-color);
    background: color-mix(in srgb, var(--card-color) 10%, white);
    flex-shrink: 0;
}

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

.dashboard-stat-card .stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
    word-break: break-word;
    line-height: 1.2;
}

.dashboard-stat-card .stat-value-small {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.dashboard-stat-card .stat-label {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

/* Top Companies List in Dashboard */
.dashboard-stat-card .top-companies-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 65px;
    overflow-y: auto;
    padding-right: 4px;
}

.dashboard-stat-card .top-companies-list::-webkit-scrollbar {
    width: 5px;
}

.dashboard-stat-card .top-companies-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dashboard-stat-card .top-companies-list::-webkit-scrollbar-thumb {
    background: #9C27B0;
    border-radius: 3px;
}

.dashboard-stat-card .top-companies-list::-webkit-scrollbar-thumb:hover {
    background: #7B1FA2;
}

.dashboard-stat-card .company-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.85rem;
}

.dashboard-stat-card .company-rank {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

.dashboard-stat-card .company-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: #495057;
}

.dashboard-stat-card .company-amount {
    font-weight: 600;
    color: #9C27B0;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.dashboard-stat-card .no-data {
    text-align: center;
    padding: 12px;
    color: #adb5bd;
    font-style: italic;
    font-size: 0.9rem;
}

/* Responsive Dashboard Stats */
@media (max-width: 1200px) {
    .dashboard-stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-stats-container {
        grid-template-columns: 1fr;
    }
    
    .dashboard-stat-card {
        padding: 20px;
    }
    
    .dashboard-stat-card .stat-icon-wrapper {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .dashboard-stat-card .stat-value {
        font-size: 22px;
    }
}


/* ===================================
   SALES PAGE SPECIFIC STYLES
   =================================== */

/* Sales Stats Cards */
.sales-stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* Sales Filters - Modern Design */
.sales-filters-container {
    margin-bottom: 25px;
}

.sales-filters-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.sales-filters-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    user-select: none;
}

.filters-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.filters-title i {
    font-size: 18px;
    opacity: 0.95;
}

.btn-toggle-filters {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-toggle-filters:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.btn-toggle-filters i {
    transition: transform 0.3s ease;
}

.btn-toggle-filters.collapsed i {
    transform: rotate(180deg);
}

.filters-body {
    padding: 24px;
    background: #fafbfc;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
    max-height: 500px;
    overflow: hidden;
}

.filters-body.collapsed {
    max-height: 0;
    padding: 0 24px;
    opacity: 0;
}

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

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item-wide {
    grid-column: span 2;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0;
    letter-spacing: 0.2px;
}

.filter-label i {
    font-size: 12px;
    color: #667eea;
    opacity: 0.8;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    color: #495057;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.filter-input:focus,
.filter-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.filter-input::placeholder {
    color: #adb5bd;
    font-size: 13px;
}

.filter-select {
    cursor: pointer;
    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='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.filters-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 4px;
}

.btn-filter-apply,
.btn-filter-reset {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-filter-apply {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-filter-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-filter-apply:active {
    transform: translateY(0);
}

.btn-filter-reset {
    background: white;
    color: #6c757d;
    border: 2px solid #e9ecef;
    box-shadow: none;
}

.btn-filter-reset:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

/* Responsive Filters */
@media (max-width: 1200px) {
    .filters-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .filter-item-wide {
        grid-column: span 3;
    }
}

@media (max-width: 768px) {
    .filters-header {
        padding: 15px 18px;
    }
    
    .filters-title {
        font-size: 14px;
        gap: 10px;
    }
    
    .filters-body {
        padding: 18px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .filter-item-wide {
        grid-column: span 1;
    }
    
    .filters-actions {
        flex-direction: column;
    }
    
    .btn-filter-apply,
    .btn-filter-reset {
        width: 100%;
        justify-content: center;
    }
}

/* Column Visibility Toggle */
.column-visibility-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    width: 320px;
    z-index: 1000;
    display: none;
    border: 1px solid #e9ecef;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

.column-visibility-dropdown.show {
    display: block;
}

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

.column-visibility-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.column-visibility-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.3px;
}

.column-visibility-header h4 i {
    font-size: 18px;
    opacity: 0.95;
}

.btn-close-dropdown {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.btn-close-dropdown:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.column-visibility-body {
    padding: 12px 8px;
    max-height: 400px;
    overflow-y: auto;
}

.column-toggle-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 4px 8px;
    user-select: none;
}

.column-toggle-item:hover {
    background: #f8f9fa;
}

.column-toggle-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
    margin-right: 12px;
}

.column-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    flex: 1;
}

.column-name i {
    font-size: 13px;
    color: #667eea;
    width: 18px;
    text-align: center;
    opacity: 0.8;
}

.column-visibility-footer {
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.btn-reset-columns {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #6c757d;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset-columns:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

.btn-reset-columns i {
    font-size: 12px;
}

/* Ensure the header-actions has relative positioning for dropdown */
.header-actions {
    position: relative;
}

/* Mobile responsiveness for column visibility */
@media (max-width: 768px) {
    .column-visibility-dropdown {
        position: fixed;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: 400px;
        margin: 0 auto;
    }
}

/* Form Section Styling */
.form-section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e9ecef 20%, #e9ecef 80%, transparent);
    margin: 30px 0 20px 0;
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title i {
    color: #667eea;
    font-size: 18px;
}

.form-section-description {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 20px;
    line-height: 1.5;
}

.sales-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 130px;
    max-height: 130px;
    display: flex;
    flex-direction: column;
}

.sales-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--card-color);
}

.sales-stat-card.blue {
    --card-color: #2196F3;
}

.sales-stat-card.green {
    --card-color: #4CAF50;
}

.sales-stat-card.orange {
    --card-color: #FF9800;
}

.sales-stat-card.success {
    --card-color: #28a745;
}

.sales-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.sales-stat-card .stat-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    height: 100%;
    overflow: hidden;
}

.sales-stat-card .stat-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--card-color);
    background: color-mix(in srgb, var(--card-color) 10%, white);
    flex-shrink: 0;
}

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

.sales-stat-card .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
    line-height: 1.3;
}

.sales-stat-card .stat-label {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

/* Responsive Sales Stats */
@media (max-width: 1200px) {
    .sales-stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sales-stats-container {
        grid-template-columns: 1fr;
    }
    
    .sales-stat-card {
        padding: 20px;
    }
    
    .sales-stat-card .stat-icon-wrapper {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .sales-stat-card .stat-value {
        font-size: 22px;
    }
}


/* ===================================
   DUE SALES PAGE SPECIFIC STYLES
   =================================== */

/* Due Sales Stats Cards */
.due-sales-stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.due-sales-stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 140px;
    max-height: 140px;
    display: flex;
    flex-direction: column;
}

.due-sales-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--card-color);
}

.due-sales-stat-card.red {
    --card-color: #dc3545;
}

.due-sales-stat-card.orange {
    --card-color: #FF9800;
}

.due-sales-stat-card.warning {
    --card-color: #ff9800;
}

.due-sales-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.due-sales-stat-card .stat-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    height: 100%;
    overflow: hidden;
}

.due-sales-stat-card .stat-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--card-color);
    background: color-mix(in srgb, var(--card-color) 10%, white);
    flex-shrink: 0;
}

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

.due-sales-stat-card .stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
    word-break: break-word;
    line-height: 1.2;
}

.due-sales-stat-card .stat-label {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

/* Responsive Due Sales Stats */
@media (max-width: 1200px) {
    .due-sales-stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .due-sales-stats-container {
        grid-template-columns: 1fr;
    }
    
    .due-sales-stat-card {
        padding: 20px;
    }
    
    .due-sales-stat-card .stat-icon-wrapper {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .due-sales-stat-card .stat-value {
        font-size: 22px;
    }
}


/* ===================================
   PURCHASES PAGE SPECIFIC STYLES
   =================================== */

/* Purchases Stats Cards */
.purchases-stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.purchases-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 130px;
    max-height: 130px;
    display: flex;
    flex-direction: column;
}

.purchases-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--card-color);
}

.purchases-stat-card.blue {
    --card-color: #2196F3;
}

.purchases-stat-card.green {
    --card-color: #4CAF50;
}

.purchases-stat-card.orange {
    --card-color: #FF9800;
}

.purchases-stat-card.purple {
    --card-color: #9C27B0;
}

.purchases-stat-card.success {
    --card-color: #28a745;
}

.purchases-stat-card.red {
    --card-color: #dc3545;
}

.purchases-stat-card.warning {
    --card-color: #ff9800;
}

.purchases-stat-card.danger {
    --card-color: #c82333;
}

.purchases-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.purchases-stat-card .stat-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    height: 100%;
    overflow: hidden;
}

.purchases-stat-card .stat-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--card-color);
    background: color-mix(in srgb, var(--card-color) 10%, white);
    flex-shrink: 0;
}

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

.purchases-stat-card .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
    line-height: 1.3;
}

.purchases-stat-card .stat-label {
    font-size: 11px;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

/* Responsive Purchases Stats */
@media (max-width: 1400px) {
    .purchases-stats-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .purchases-stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .purchases-stats-container {
        grid-template-columns: 1fr;
    }
    
    .purchases-stat-card {
        padding: 20px;
        min-height: 120px;
        max-height: 120px;
    }
    
    .purchases-stat-card .stat-icon-wrapper {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .purchases-stat-card .stat-value {
        font-size: 18px;
    }
}


/* ===================================
   VAT PAGE SPECIFIC STYLES
   =================================== */

/* VAT Stats Cards */
.vat-stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.vat-stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 150px;
    max-height: 150px;
    display: flex;
    flex-direction: column;
}

.vat-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--card-color);
}

.vat-stat-card.blue {
    --card-color: #2196F3;
}

.vat-stat-card.green {
    --card-color: #4CAF50;
}

.vat-stat-card.red {
    --card-color: #dc3545;
}

.vat-stat-card.success {
    --card-color: #28a745;
}

.vat-stat-card.orange {
    --card-color: #FF9800;
}

.vat-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.vat-stat-card .stat-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    height: 100%;
    overflow: hidden;
}

.vat-stat-card .stat-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--card-color);
    background: color-mix(in srgb, var(--card-color) 10%, white);
    flex-shrink: 0;
}

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

.vat-stat-card .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
    line-height: 1.3;
}

.vat-stat-card .stat-label {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
    margin-bottom: 4px;
}

.vat-stat-card .stat-count {
    font-size: 11px;
    color: #adb5bd;
    font-weight: 500;
    margin-top: 4px;
}

/* VAT Exclusive Card Special Styling */
.vat-stat-card.vat-exclusive-card .stat-label {
    font-size: 12px;
    margin-bottom: 10px;
}

.vat-stat-card.vat-exclusive-card .stat-card-inner {
    position: relative;
}

.vat-carousel-container {
    position: relative;
    overflow: hidden;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vat-carousel-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateX(100%);
    opacity: 0;
    transition: all 0.5s ease-in-out;
    text-align: left;
    width: 100%;
}

.vat-carousel-slide.active {
    transform: translate(-50%, -50%) translateX(0);
    opacity: 1;
}

.vat-carousel-label {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vat-carousel-value {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.vat-carousel-value.success {
    color: #28a745;
}

.vat-carousel-value.primary {
    color: #007bff;
}

.vat-carousel-toggle {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #dee2e6;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
    font-size: 12px;
    z-index: 10;
}

.vat-carousel-toggle:hover {
    background: white;
    border-color: #FF9800;
    color: #FF9800;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.vat-carousel-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.vat-carousel-toggle i {
    transition: transform 0.3s ease;
}

.vat-carousel-toggle:hover i {
    transform: rotate(180deg);
}

/* Responsive VAT Stats */
@media (max-width: 1200px) {
    .vat-stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .vat-stats-container {
        grid-template-columns: 1fr;
    }
    
    .vat-stat-card {
        padding: 20px;
        min-height: 140px;
        max-height: 140px;
    }
    
    .vat-stat-card .stat-icon-wrapper {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .vat-stat-card .stat-value {
        font-size: 20px;
    }
    
    .vat-exclusive-value {
        font-size: 16px;
    }
}

/* ===================================
   VAT RETURN CALENDAR
   =================================== */

.vat-calendar-section {
    margin: 30px 0;
}

.vat-calendar-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.vat-calendar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vat-calendar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-year {
    font-size: 14px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

.vat-calendar-body {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px;
    padding: 30px;
    background: #f8f9fa;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    /* Force 4 columns - updated v2 */
}

.vat-quarter-cell {
    background: white;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    min-height: 200px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 1 !important;
    visibility: visible !important;
}

.vat-quarter-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 12px 12px 0 0;
}

.vat-quarter-cell.completed {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0%, rgba(32, 201, 151, 0.05) 100%);
    border-color: #c3e6cb;
}

.vat-quarter-cell.completed::before {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.vat-quarter-cell.current {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 152, 0, 0.1) 100%);
    border-color: #ffc107;
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.3);
    transform: scale(1.05);
}

.vat-quarter-cell.current::before {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

.vat-quarter-cell.upcoming {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.03) 0%, rgba(0, 86, 179, 0.03) 100%);
    border-color: #d6e9ff;
}

.vat-quarter-cell.upcoming::before {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.vat-quarter-cell:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.vat-quarter-cell.current:hover {
    transform: scale(1.05) translateY(-5px);
}

.quarter-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.vat-quarter-cell.completed .quarter-icon {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #28a745;
}

.vat-quarter-cell.current .quarter-icon {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #ff9800;
    animation: pulse-icon 2s infinite;
}

.vat-quarter-cell.upcoming .quarter-icon {
    background: linear-gradient(135deg, #cfe2ff 0%, #b8daff 100%);
    color: #007bff;
}

.vat-quarter-cell:hover .quarter-icon {
    transform: scale(1.1) rotate(5deg);
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 12px rgba(255, 152, 0, 0);
    }
}

.quarter-label {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: 1px;
}

.quarter-period {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
    margin-top: 5px;
}

.quarter-vat-info {
    margin: 12px 0 8px 0;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vat-amount-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.vat-label {
    font-size: 10px;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.vat-label-small {
    font-size: 11px;
    color: #adb5bd;
    font-style: italic;
}

.vat-value {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.vat-value.payable {
    color: #dc3545;
}

.vat-value.refundable {
    color: #28a745;
}

.vat-quarter-cell.current .quarter-vat-info {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.vat-quarter-cell.completed .quarter-vat-info {
    background: rgba(40, 167, 69, 0.05);
    border: 1px solid rgba(40, 167, 69, 0.1);
}

.quarter-status {
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vat-quarter-cell.completed .quarter-status {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.vat-quarter-cell.current .quarter-status {
    background: rgba(255, 193, 7, 0.15);
    color: #ff9800;
    animation: pulse-status 2s infinite;
}

.vat-quarter-cell.upcoming .quarter-status {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

@keyframes pulse-status {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.vat-calendar-footer {
    padding: 15px 25px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.completed {
    background: #28a745;
}

.legend-dot.current {
    background: #ffc107;
    animation: pulse-dot 2s infinite;
}

.legend-dot.upcoming {
    background: #007bff;
}

@keyframes pulse-dot {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(255, 193, 7, 0);
    }
}

/* Responsive VAT Calendar */
@media (max-width: 1200px) {
    .vat-calendar-body {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 25px;
    }
}

@media (max-width: 768px) {
    .vat-calendar-body {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 20px;
    }
    
    .vat-quarter-cell {
        padding: 20px 15px;
        min-height: 130px;
    }
    
    .quarter-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
    
    .quarter-label {
        font-size: 18px;
    }
    
    .quarter-period {
        font-size: 11px;
    }
    
    .quarter-status {
        font-size: 10px;
        padding: 5px 12px;
    }
    
    .vat-calendar-header {
        padding: 15px 20px;
    }
    
    .vat-calendar-header h3 {
        font-size: 14px;
    }
    
    .calendar-year {
        font-size: 12px;
        padding: 3px 10px;
    }
    
    .calendar-legend {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .vat-calendar-body {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ===================================
   END VAT RETURN CALENDAR
   =================================== */


/* ===================================
   PAYMENTS PAGE SPECIFIC STYLES
   =================================== */

.payments-stats-grid {
    grid-template-columns: repeat(5, 1fr) !important; /* 5 columns for desktop */
    gap: 20px !important;
    margin-bottom: 30px !important;
}

.payments-stats-grid .dashboard-stat-card {
    height: 130px; /* Fixed height for all cards */
    padding: 20px;
}

.payments-stats-grid .stat-icon-wrapper {
    width: 50px;
    height: 50px;
    font-size: 22px;
}

.payments-stats-grid .stat-value {
    font-size: 18px; /* Smaller font for numbers to fit 5 columns */
    line-height: 1.2;
    word-break: break-word;
}

.payments-stats-grid .stat-label {
    font-size: 11px; /* Smaller font for labels */
    margin-top: 4px;
}

/* Responsive adjustments for Payments Stats */
@media (max-width: 1600px) {
    .payments-stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 1024px) {
    .payments-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .payments-stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===================================
   PDC PAGE SPECIFIC STYLES
   =================================== */

.pdc-stats-grid {
    grid-template-columns: repeat(5, 1fr) !important; /* 5 columns for desktop */
    gap: 20px !important;
    margin-bottom: 30px !important;
}

.pdc-stats-grid .dashboard-stat-card {
    height: 130px; /* Fixed height for all cards */
    padding: 20px;
}

.pdc-stats-grid .stat-icon-wrapper {
    width: 50px;
    height: 50px;
    font-size: 22px;
}

.pdc-stats-grid .stat-value {
    font-size: 18px; /* Smaller font for numbers to fit 5 columns */
    line-height: 1.2;
    word-break: break-word;
}

.pdc-stats-grid .stat-label {
    font-size: 11px; /* Smaller font for labels */
    margin-top: 4px;
}

.pdc-stats-grid .stat-count {
    font-size: 10px;
    color: #6c757d;
    margin-top: 4px;
}

/* Responsive adjustments for PDC Stats */
@media (max-width: 1600px) {
    .pdc-stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 1024px) {
    .pdc-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .pdc-stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===================================
   MOBILE HAMBURGER MENU
   =================================== */

.hamburger-menu {
    display: none;
    background: none;
    border: none;
    color: #2c3e50;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    margin-right: 15px;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.hamburger-menu:hover {
    background: #f8f9fa;
    color: #667eea;
}

.hamburger-menu:active {
    transform: scale(0.95);
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Mobile Responsive Sidebar */
@media (max-width: 768px) {
    .hamburger-menu {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 1001 !important;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        background: white;
        transform: none !important; /* Override any conflicting transform */
    }
    
    .sidebar.active {
        left: 0 !important;
        transform: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }
    
    .header {
        padding: 15px 20px;
    }
    
    .header-left {
        display: flex;
        align-items: center;
    }
    
    .header-left h1 {
        font-size: 18px;
        margin: 0;
    }
    
    .user-menu {
        gap: 8px;
    }
    
    .user-name {
        display: none;
    }
    
    .header-add-btn span {
        display: none;
    }
    
    .header-add-btn i {
        margin-right: 0 !important;
    }
    
    .logout-btn {
        padding: 8px 12px;
    }
    
    .content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .hamburger-menu {
        font-size: 20px;
        margin-right: 10px;
        padding: 6px;
    }
    
    .header {
        padding: 12px 15px;
    }
    
    .header-left h1 {
        font-size: 16px;
    }
    
    .sidebar {
        width: 260px;
        left: -260px;
    }
    
    .sidebar.active {
        left: 0 !important;
    }
    
    .logout-btn span {
        display: none;
    }
    
    .logout-btn {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .header-add-btn {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .content {
        padding: 10px;
    }
}

/* ===================================
   QUOTES PAGE MOBILE RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    /* Header Section */
    .quotes-page-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .quotes-header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .quotes-title-section {
        flex-direction: column;
        text-align: center;
    }
    
    .quotes-icon-badge {
        margin: 0 auto 10px;
    }
    
    .quotes-title-text h1 {
        font-size: 20px;
    }
    
    .quotes-title-text p {
        font-size: 13px;
    }
    
    .btn-add-quote {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    
    /* Stats Section */
    .quotes-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .quotes-stat-card {
        min-height: auto;
        padding: 20px;
    }
    
    /* Filters Section */
    .quotes-filters-card {
        margin-bottom: 20px;
    }
    
    .quotes-filters-body {
        padding: 20px;
    }
    
    .filters-row {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .filters-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-clear,
    .btn-apply {
        width: 100%;
        justify-content: center;
    }
    
    /* Table Section - Mobile */
    .table-container {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        margin: 0 -20px 20px -20px;
        padding: 0 20px;
        border-radius: 8px;
        position: relative;
        width: calc(100% + 40px);
    }
    
    .table {
        min-width: 1000px !important;
        width: 100%;
        font-size: 13px;
        margin-bottom: 0;
        display: table !important;
    }
    
    .table th,
    .table td {
        padding: 12px 10px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
        vertical-align: middle;
    }
    
    /* Ensure proper column widths */
    .table th:first-child,
    .table td:first-child {
        min-width: 120px;
    }
    
    .table th:nth-child(2),
    .table td:nth-child(2) {
        min-width: 150px;
    }
    
    .table th:nth-child(3),
    .table td:nth-child(3) {
        min-width: 100px;
    }
    
    .table th:nth-child(4),
    .table td:nth-child(4) {
        min-width: 100px;
    }
    
    .table th:nth-child(5),
    .table td:nth-child(5) {
        min-width: 100px;
    }
    
    .table th:nth-child(6),
    .table td:nth-child(6) {
        min-width: 120px;
    }
    
    .table th:nth-child(7),
    .table td:nth-child(7) {
        min-width: 100px;
    }
    
    .table th:last-child,
    .table td:last-child {
        min-width: 80px;
        text-align: center;
    }
    
    /* Add scroll indicator gradient */
    .table-container::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 40px;
        background: linear-gradient(to left, rgba(248,249,250,0.95), transparent);
        pointer-events: none;
        z-index: 2;
    }
    
    .table-container.scrolled-end::after {
        display: none;
    }
    
    /* Custom scrollbar for mobile */
    .table-container::-webkit-scrollbar {
        height: 6px;
    }
    
    .table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .table-container::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 3px;
    }
    
    .table-container::-webkit-scrollbar-thumb:hover {
        background: #5568d3;
    }
    
    /* Actions Dropdown on Mobile */
    .actions-dropdown {
        position: static !important;
    }
    
    .actions-toggle-btn {
        padding: 8px 12px;
        font-size: 16px;
        min-width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .actions-dropdown-menu {
        position: fixed !important;
        min-width: 200px;
        max-width: 280px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
        z-index: 10000 !important;
        border: 1px solid #dee2e6;
    }
    
    .actions-dropdown-menu a {
        padding: 14px 18px !important;
        font-size: 15px !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .actions-dropdown-menu a i {
        width: 20px;
        font-size: 15px;
    }
    
    .actions-dropdown-menu.show {
        animation: slideUp 0.2s ease-out;
    }
    
    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Modal on Mobile */
    .quotes-modal {
        padding: 0;
    }
    
    .quotes-modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .quotes-modal-header {
        padding: 20px;
        border-radius: 0;
        position: sticky;
        top: 0;
        z-index: 10;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .quotes-modal-header h3 {
        font-size: 18px;
    }
    
    .quotes-modal-body {
        padding: 20px;
    }
    
    .quotes-form-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    /* Items Section in Modal */
    .quotes-items-section {
        margin-top: 20px;
    }
    
    .quotes-item-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .quotes-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .quotes-item-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .quotes-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    /* Totals Section */
    .quotes-totals-section {
        padding: 15px;
    }
    
    /* Modal Footer */
    .quotes-modal-footer {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .quotes-modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Pagination */
    .quotes-pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        padding: 10px;
    }
    
    .quotes-pagination a,
    .quotes-pagination span {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 36px;
    }
    
    /* Status badges */
    .status-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    /* Custom scrollbar for horizontal scroll */
    .quotes-table-container::-webkit-scrollbar {
        height: 6px;
    }
    
    .quotes-table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .quotes-table-container::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 3px;
    }
    
    .quotes-table-container::-webkit-scrollbar-thumb:hover {
        background: #5568d3;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .quotes-page-header {
        padding: 15px;
    }
    
    .quotes-title-text h1 {
        font-size: 18px;
    }
    
    .quotes-title-text p {
        font-size: 12px;
    }
    
    .btn-add-quote {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .quotes-filters-body {
        padding: 15px;
    }
    
    /* Table even more compact on small phones */
    .table-container {
        margin: 0 -15px 15px -15px;
        padding: 0 15px;
        width: calc(100% + 30px);
    }
    
    .table {
        min-width: 900px !important;
    }
    
    .table th,
    .table td {
        padding: 10px 6px !important;
        font-size: 11px !important;
    }
    
    /* Smaller column widths for compact view */
    .table th:first-child,
    .table td:first-child {
        min-width: 100px;
    }
    
    .table th:nth-child(2),
    .table td:nth-child(2) {
        min-width: 130px;
    }
    
    .table th:nth-child(3),
    .table td:nth-child(3) {
        min-width: 90px;
    }
    
    .table th:nth-child(4),
    .table td:nth-child(4) {
        min-width: 90px;
    }
    
    .table th:nth-child(5),
    .table td:nth-child(5) {
        min-width: 90px;
    }
    
    .table th:nth-child(6),
    .table td:nth-child(6) {
        min-width: 100px;
    }
    
    .table th:nth-child(7),
    .table td:nth-child(7) {
        min-width: 90px;
    }
    
    .table th:last-child,
    .table td:last-child {
        min-width: 70px;
    }
    
    .quotes-modal-header {
        padding: 15px;
    }
    
    .quotes-modal-header h3 {
        font-size: 16px;
    }
    
    .quotes-modal-body {
        padding: 15px;
    }
    
    .quotes-item-card {
        padding: 12px;
    }
    
    .quotes-totals-section {
        padding: 12px;
    }
    
    .quotes-modal-footer {
        padding: 12px 15px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-control,
    .form-select {
        font-size: 14px;
        padding: 8px 12px;
    }
}

/* Landscape mode optimizations for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .quotes-modal-content {
        max-height: 100vh;
    }
    
    .quotes-modal-body {
        max-height: calc(100vh - 140px);
        overflow-y: auto;
    }
}
