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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #2171db 0%, #3b8dfc 100%);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 20px 0;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 30px;
}

.sidebar-logo {
    width: 100%;
    height: auto;
    background: white;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 10px;
}

.sidebar-nav {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    margin-bottom: 8px;
    border-radius: 10px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 15px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.nav-icon {
    font-size: 20px;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 12px;
    opacity: 0.8;
}

.version {
    margin-top: 5px;
    font-size: 11px;
    opacity: 0.6;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
    background: #f5f7fa;
}

.page-content {
    display: none;
}

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

.page-header {
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 32px;
    color: #2d3748;
    margin-bottom: 8px;
}

.page-header p {
    font-size: 16px;
    color: #718096;
}

/* Date Filter Section */
.date-filter-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.filter-input {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Quicksand', sans-serif;
    transition: all 0.3s ease;
}

.filter-input:focus {
    outline: none;
    border-color: #3b8dfc;
    box-shadow: 0 0 0 3px rgba(59, 141, 252, 0.1);
}

.filter-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #3b8dfc, #72d3fa);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Quicksand', sans-serif;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 141, 252, 0.3);
}

.filter-btn-clear {
    padding: 10px 25px;
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Quicksand', sans-serif;
}

.filter-btn-clear:hover {
    background: #e0e0e0;
}

/* Dashboard Stats */
.date-range-info {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
}

.date-range-info p {
    margin: 0;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
}

.date-range-info span {
    color: #1e293b;
    font-weight: 600;
}

.dashboard-stats {
    margin-bottom: 40px;
}

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

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.stat-icon {
    font-size: 48px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b8dfc 0%, #72d3fa 100%);
    border-radius: 16px;
}

.stat-info h3 {
    font-size: 32px;
    color: #2d3748;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 14px;
    color: #718096;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
}

.action-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    box-sizing: border-box;
}

.action-btn.primary {
    background: #3b8dfc;
    color: white;
}

.action-btn.primary:hover {
    background: #2a7de8;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 141, 252, 0.3);
}

.action-btn.secondary {
    background: white;
    color: #3b8dfc;
    border: 2px solid #3b8dfc;
}

.action-btn.secondary:hover {
    background: #3b8dfc;
    color: white;
}

/* Invoices Table */
.invoices-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 500px;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s;
    height: 48px;
    box-sizing: border-box;
}

.search-box input:focus {
    outline: none;
    border-color: #3b8dfc;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
}

.invoices-table-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

.invoices-list-table thead th {
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.invoices-list-table tbody td {
    padding: 18px 16px;
    font-size: 15px;
    color: #2d3748;
    border-bottom: 1px solid #f7fafc;
}

.invoices-list-table tbody tr:hover {
    background: #f7fafc;
}

.payment-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #e6fffa;
    color: #047857;
}

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

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f7fafc;
}

.btn-icon.view {
    color: #3b8dfc;
}

.btn-icon.view:hover {
    background: #dbeafe;
}

.btn-icon.edit {
    color: #f59e0b;
}

.btn-icon.edit:hover {
    background: #fef3c7;
}

.btn-icon.delete {
    color: #ef4444;
}

.btn-icon.delete:hover {
    background: #fee2e2;
}

.no-data,
.loading,
.error {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-size: 16px;
}

.error {
    color: #e53e3e;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* CSV Import Section */
.csv-import-section {
    margin-bottom: 30px;
}

.csv-import-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 30px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
}

.csv-import-header h3 {
    color: white;
    font-size: 20px;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.csv-import-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin: 0 0 20px 0;
}

.csv-import-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.csv-upload-btn,
.csv-download-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Quicksand', sans-serif;
}

.csv-upload-btn {
    background: white;
    color: #667eea;
}

.csv-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

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

.csv-download-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.csv-download-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: -400px;
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    z-index: 10000;
    transition: right 0.3s ease-in-out;
}

.toast-notification.show {
    right: 20px;
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: #d1fae5;
    color: #047857;
}

.toast-error .toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.toast-info .toast-icon {
    background: #dbeafe;
    color: #2563eb;
}

.toast-warning .toast-icon {
    background: #fef3c7;
    color: #d97706;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: #2d3748;
    font-weight: 500;
}

.toast-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #718096;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.toast-close:hover {
    background: #f7fafc;
}

/* Form Section Styles */
.form-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.form-section h1 {
    color: #3b8dfc;
    font-size: 32px;
    margin-bottom: 30px;
    text-align: center;
}

.form-card h2 {
    color: #333;
    font-size: 20px;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #3b8dfc;
}

.form-card h2:first-child {
    margin-top: 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b8dfc;
}

.item-row {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
}

.item-row .form-group {
    margin-bottom: 15px;
}

.remove-item-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4757;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s;
}

.remove-item-btn:hover {
    background: #ff3838;
}

.add-item-btn {
    width: 100%;
    padding: 12px;
    background: #3b8dfc;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.add-item-btn:hover {
    background: #2a7de8;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.generate-btn,
.sample-btn,
.save-btn {
    flex: 1;
    min-width: 200px;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.generate-btn {
    background: #3b8dfc;
    color: white;
}

.generate-btn:hover {
    background: #2a7de8;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 141, 252, 0.3);
}

.sample-btn {
    background: #e0e0e0;
    color: #333;
}

.sample-btn:hover {
    background: #d0d0d0;
}

.save-btn {
    background: #10b981;
    color: white;
}

.save-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

/* Invoice Section Styles */
.invoice-section {
    max-width: 210mm;
    margin: 0 auto;
}

.action-buttons {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.action-buttons button {
    padding: 12px 24px;
    background: white;
    color: #3b8dfc;
    border: 2px solid #3b8dfc;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.action-buttons button:hover {
    background: #3b8dfc;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 141, 252, 0.3);
}

/* A4 Invoice Page */
.invoice-page {
    width: 210mm;
    min-height: 300mm;
    background: white;
    padding: 12mm;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Header */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    font-family: 'quicksand';
}

.company-info {
    flex: 1;
}

.logo {
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
    display: inline-block;
}

.logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}

.company-name {
    display: none;
}

.company-details {
    font-size: 12px;
    color: #333;
    line-height: 1.5;
    font-weight: 500;
}

.company-details p {
    margin-bottom: 0px;
}

.invoice-title h1 {
    font-size: 48px;
    font-weight: 700;
    color: #333;
    letter-spacing: 2px;
}

/* Bill To & Invoice Info */
.invoice-info-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.bill-to,
.invoice-details {
    flex: 1;
}

.bill-to h3,
.invoice-details h3 {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.bill-to p,
.invoice-details p {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.customer-name {
    font-weight: 600;
    color: #333 !important;
}

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

.invoice-details .label {
    color: #777;
}

/* Items Table */
.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.items-table thead {
    background: #fafafa;
}

.items-table th {
    padding: 15px 10px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #333;
    letter-spacing: 1px;
    border-bottom: 2px solid #ddd;
}

.items-table td {
    padding: 15px 10px;
    font-size: 12px;
    color: #555;
    border-bottom: 1px solid #eee;
}

.items-table .col-sl {
    width: 4%;
}

.items-table .col-items {
    width: 45%;
}

.items-table .col-serial {
    width: 18%;
}

.items-table .col-price,
.items-table .col-qty,
.items-table .col-total {
    width: 11%;
}

.item-details {
    font-size: 11px;
    color: #888;
    margin-top: 5px;
}

.items-table tbody tr:last-child td {
    border-bottom: 2px solid #ddd;
}

.items-table tbody tr {
    background: #fcfcfc;
}

.items-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

/* Totals Section */
.totals-section {
    margin-left: auto;
    width: 350px;
    margin-bottom: 80px;
    min-height: 280px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    background: #fafafa;
    margin-bottom: 2px;
}

.total-label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.total-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.discount-row {
    background: #fff9f9;
    display: none; /* Hidden by default, shown only when discount > 0 */
}

.discount-row .total-value {
    color: #e53e3e;
}

/* Status Badge Styles */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.processing {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fbbf24;
}

.status-badge.completed {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #10b981;
}

.status-badge.on-hold {
    background: #fce7f3;
    color: #be185d;
    border: 1px solid #ec4899;
}

.order-from-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.order-from-badge.website {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

/* Center order-from-badge in table cells */
.invoices-list-table tr td:nth-child(7) {
    text-align: center;
}

.invoices-list-table thead th:nth-child(7) {
    text-align: center;
}

/* Bulk Selection Styles */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.bulk-actions.show {
    display: flex !important;
}

.selected-count {
    font-weight: 600;
    color: #475569;
    font-size: 14px;
}

.bulk-status-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 140px;
    cursor: pointer;
}

.bulk-status-select:focus {
    outline: none;
    border-color: #3b8dfc;
    box-shadow: 0 0 0 3px rgba(59, 141, 252, 0.1);
}

.invoice-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b8dfc;
}

#selectAllCheckbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b8dfc;
}

.search-filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    width: 100%;
}

.date-input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    height: 48px;
    box-sizing: border-box;
    min-width: 140px;
    transition: border-color 0.3s;
    flex-shrink: 0;
}

.date-input:focus {
    outline: none;
    border-color: #3b8dfc;
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    height: 48px;
    box-sizing: border-box;
    min-width: 140px;
    transition: border-color 0.3s;
    flex-shrink: 0;
}

.filter-select:focus {
    outline: none;
    border-color: #3b8dfc;
}

.invoices-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 16px;
    width: 100%;
    overflow-x: auto;
}

.invoices-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.invoices-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 24px;
    font-weight: 600;
}

.grand-total {
    background: #f5f5f5;
    margin-top: 10px;
    padding: 20px;
}

.grand-total .total-label {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.grand-total .total-value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

/* Footer */
.invoice-footer {
    text-align: center;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-top: auto;
}

.invoice-footer p {
    font-size: 16px;
    font-weight: 600;
    color: #555;
    letter-spacing: 2px;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Dashboard Layout */
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 15px;
    }
    
    .sidebar-header {
        text-align: center;
        margin-bottom: 15px;
    }
    
    .sidebar-logo {
        width: 80px;
        height: auto;
    }
    
    .sidebar-nav {
        display: flex;
        flex-direction: row;
        gap: 10px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .nav-item {
        padding: 8px 12px;
        font-size: 14px;
        border-radius: 6px;
        min-width: auto;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-item .nav-icon {
        font-size: 18px;
    }
    
    .sidebar-footer {
        margin-top: 15px;
        text-align: center;
    }
    
    .logout-btn {
        width: auto;
        padding: 8px 16px;
        font-size: 14px;
    }
    
    /* Main Content */
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .page-header p {
        font-size: 14px;
    }
    
    /* CSV Import Section */
    .csv-import-card {
        padding: 20px;
    }
    
    .csv-import-header h3 {
        font-size: 18px;
    }
    
    .csv-import-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .csv-upload-btn,
    .csv-download-btn {
        width: 100%;
        padding: 12px;
    }
    
    /* Date Filter */
    .date-filter-section {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
        gap: 5px;
    }
    
    .filter-group label {
        font-size: 14px;
    }
    
    .filter-input {
        width: 100%;
        padding: 10px;
    }
    
    .filter-btn,
    .filter-btn-clear {
        width: 100%;
        padding: 10px;
    }
    
    /* Dashboard Stats */
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        font-size: 24px;
        width: 40px;
        height: 40px;
    }
    
    .stat-info h3 {
        font-size: 20px;
    }
    
    .stat-info p {
        font-size: 12px;
    }
    
    /* Quick Actions */
    .quick-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .quick-action-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    /* Form Section */
    .form-section {
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group {
        width: 100%;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px;
        font-size: 14px;
    }
    
    /* Items Section */
    .items-section h3 {
        font-size: 18px;
    }
    
    .item-row {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        border-radius: 8px;
    }
    
    .item-row .form-group {
        width: 100%;
    }
    
    .remove-item-btn {
        width: 100%;
        padding: 8px;
        font-size: 14px;
    }
    
    .add-item-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    /* Action Buttons */
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-buttons button {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    /* Invoice Preview */
    .invoice-section {
        padding: 15px;
    }
    
    .invoice-page {
        width: 100%;
        padding: 15px;
        margin: 0;
    }
    
    .invoice-header {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
        text-align: center;
    }
    
    .company-info {
        width: 100%;
    }
    
    .logo {
        padding: 10px 15px;
        margin-bottom: 10px;
    }
    
    .logo-image {
        height: 30px;
    }
    
    .company-details {
        font-size: 11px;
    }
    
    .invoice-title {
        width: 100%;
    }
    
    .invoice-title h2 {
        font-size: 24px;
        padding: 15px;
    }
    
    /* Invoice Details */
    .invoice-details-section {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .bill-to-section,
    .invoice-details {
        width: 100%;
        padding: 15px;
    }
    
    .bill-to-section h3,
    .invoice-details h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .bill-to-section p,
    .invoice-details p {
        font-size: 12px;
        margin-bottom: 5px;
    }
    
    /* Items Table */
    .items-table {
        font-size: 12px;
        margin-bottom: 20px;
    }
    
    .items-table th,
    .items-table td {
        padding: 8px 4px;
    }
    
    .items-table th {
        font-size: 11px;
    }
    
    .col-sl {
        width: 8%;
    }
    
    .col-items {
        width: 35%;
    }
    
    .col-serial {
        width: 20%;
    }
    
    .col-price {
        width: 12%;
    }
    
    .col-qty {
        width: 10%;
    }
    
    .col-total {
        width: 15%;
    }
    
    /* Totals Section */
    .totals-section {
        padding: 15px;
    }
    
    .total-row {
        padding: 8px 0;
    }
    
    .total-label {
        font-size: 12px;
    }
    
    .total-value {
        font-size: 14px;
    }
    
    .grand-total .total-label {
        font-size: 14px;
    }
    
    .grand-total .total-value {
        font-size: 16px;
    }
    
    /* Invoice Footer */
    .invoice-footer {
        padding: 15px;
        margin-top: 20px;
    }
    
    .invoice-footer p {
        font-size: 14px;
    }
    
    /* Invoices Table */
    .invoices-table-container {
        overflow-x: auto;
    }
    
    .invoices-table {
        min-width: 600px;
        font-size: 12px;
    }
    
    .invoices-table th,
    .invoices-table td {
        padding: 8px 4px;
    }
    
    .btn-icon {
        padding: 4px 6px;
        font-size: 12px;
    }
    
    /* Search Box */
    .search-box {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }
    
    /* Toast Notifications */
    .toast-notification {
        min-width: 280px;
        max-width: 90%;
        right: -90%;
    }
    
    .toast-notification.show {
        right: 5%;
    }
    
    .toast-icon {
        width: 28px;
        height: 28px;
    }
    
    .toast-content {
        font-size: 13px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .main-content {
        padding: 10px;
    }
    
    .form-section {
        padding: 10px;
    }
    
    .invoice-page {
        padding: 10px;
    }
    
    .invoice-header {
        padding: 10px;
    }
    
    .logo-image {
        height: 25px;
    }
    
    .company-details {
        font-size: 10px;
    }
    
    .invoice-title h2 {
        font-size: 20px;
        padding: 10px;
    }
    
    .bill-to-section,
    .invoice-details {
        padding: 10px;
    }
    
    .bill-to-section h3,
    .invoice-details h3 {
        font-size: 14px;
    }
    
    .bill-to-section p,
    .invoice-details p {
        font-size: 11px;
    }
    
    .items-table {
        font-size: 11px;
    }
    
    .items-table th,
    .items-table td {
        padding: 6px 2px;
    }
    
    .items-table th {
        font-size: 10px;
    }
    
    .totals-section {
        padding: 10px;
    }
    
    .total-label {
        font-size: 11px;
    }
    
    .total-value {
        font-size: 13px;
    }
    
    .grand-total .total-label {
        font-size: 13px;
    }
    
    .grand-total .total-value {
        font-size: 15px;
    }
    
    .invoice-footer {
        padding: 10px;
    }
    
    .invoice-footer p {
        font-size: 12px;
    }
    
    .csv-import-card {
        padding: 15px;
    }
    
    .csv-import-header h3 {
        font-size: 16px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-icon {
        font-size: 20px;
        width: 35px;
        height: 35px;
    }
    
    .stat-info h3 {
        font-size: 18px;
    }
    
    .stat-info p {
        font-size: 11px;
    }
}

/* Print Styles for Mobile */
@media print and (max-width: 768px) {
    .invoice-page {
        width: 100%;
        padding: 10mm;
        margin: 0;
    }
    
    .invoice-header {
        flex-direction: row;
        gap: 15px;
    }
    
    .logo-image {
        height: 35px;
    }
    
    .company-details {
        font-size: 12px;
    }
    
    .invoice-title h2 {
        font-size: 22px;
        padding: 12px;
    }
    
    .items-table {
        font-size: 11px;
    }
    
    .items-table th,
    .items-table td {
        padding: 6px 3px;
    }
    
    .total-label {
        font-size: 12px;
    }
    
    .total-value {
        font-size: 13px;
    }
    
    .grand-total .total-label {
        font-size: 14px;
    }
    
    .grand-total .total-value {
        font-size: 15px;
    }
}

/* Print Styles */
@media print {
    @page {
        size: A4;
        margin: 0;
    }
    
    body {
        background: white;
        padding: 0;
        margin: 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    * {
        margin: 0;
        padding: 0;
    }
    
    /* Hide everything except invoice */
    .sidebar,
    .page-header,
    .form-section,
    .dashboard-stats,
    .quick-actions,
    .invoices-header,
    .invoices-table-container,
    .csv-import-section,
    .date-filter-section,
    .action-buttons,
    .no-print {
        display: none !important;
    }
    
    /* Hide status field on invoice print - only hide the status paragraph specifically */
    .invoice-details p:has(.status-badge),
    .invoice-details p:has(#displayInvoiceStatus),
    #displayInvoiceStatus,
    .status-badge {
        display: none !important;
    }
    
    /* Ensure payment method is visible */
    .invoice-details p:has(#displayPaymentMethod) {
        display: block !important;
    }
    
    /* Fix office address alignment */
    .company-info {
        text-align: left !important;
    }
    
    .company-info p {
        text-align: left !important;
    }
    
    /* Show only invoice section */
    .dashboard-container {
        display: block;
        margin: 0;
        padding: 0;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }
    
    .page-content {
        display: block !important;
        margin: 0;
        padding: 0;
    }
    
    .invoice-section {
        display: block !important;
        margin: 0;
        padding: 0;
        max-width: none;
    }
    
    .container {
        padding: 0;
        margin: 0;
        max-width: none;
    }
    
    .invoice-page {
        width: 210mm;
        height: auto;
        min-height: 0;
        padding: 8mm 12mm;
        box-shadow: none;
        page-break-inside: avoid;
        display: flex;
        flex-direction: column;
        margin: 0;
        background: white !important;
    }
    
    .invoice-header {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        border-radius: 8px;
        margin-bottom: 40px;
        font-family: 'quicksand';
    }
    
    .company-info {
        flex: 1;
        text-align: left !important;
    }
    
    .company-info p {
        text-align: left !important;
    }
    
    .logo {
        background: white !important;
        padding: 15px 25px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
        margin-bottom: 12px;
        display: inline-block;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .logo-image {
        height: 40px;
        width: auto;
        display: block;
        object-fit: contain;
    }
    
    .company-details {
        font-size: 12px;
        line-height: 1.5;
        color: #333;
        font-weight: 500;
    }
    
    .company-details p {
        margin-bottom: 0;
    }
    
    .invoice-title {
        text-align: center;
    }
    
    .invoice-title h1 {
        font-size: 48px;
        font-weight: 700;
        letter-spacing: 2px;
        color: #333;
        margin: 0;
    }
    
    .invoice-info-section {
        display: flex;
        justify-content: space-between;
        margin-bottom: 40px;
    }
    
    .bill-to,
    .invoice-details {
        flex: 1;
    }
    
    .bill-to h3,
    .invoice-details h3 {
        font-size: 16px;
        font-weight: 700;
        color: #333;
        margin-bottom: 10px;
        letter-spacing: 1px;
    }
    
    .bill-to p,
    .invoice-details p {
        font-size: 14px;
        color: #555;
        line-height: 1.6;
        margin-bottom: 0;
    }
    
    .customer-name {
        font-weight: 600;
        color: #333 !important;
    }
    
    .invoice-details {
        text-align: right;
    }
    
    .items-table {
        margin-bottom: 30px;
        width: 100%;
    }
    
    .items-table thead {
        background: #fafafa !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .items-table th {
        padding: 15px 10px;
        text-align: left;
        font-size: 12px;
        font-weight: 700;
        color: #333;
        letter-spacing: 1px;
        border-bottom: 2px solid #ddd;
    }
    
    .items-table tbody tr {
        background: #fcfcfc !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .items-table tbody tr:nth-child(even) {
        background: #f9f9f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .items-table td {
        padding: 15px 10px;
        font-size: 12px;
        color: #555;
        border-bottom: 1px solid #eee;
    }
    
    .item-details {
        font-size: 11px;
        color: #888;
        margin-top: 5px;
    }
    
    .totals-section {
        margin-bottom: 40px;
        width: 400px;
        margin-left: auto;
    }
    
    .total-row {
        background: #fafafa !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 15px 20px;
        display: flex;
        justify-content: space-between;
        margin-bottom: 2px;
    }
    
    .discount-row {
        background: #fff9f9 !important;
    }
    
    .grand-total {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 20px;
        margin-top: 10px;
    }
    
    .invoice-footer {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        page-break-inside: avoid;
        margin-top: 40px;
        margin-bottom: 0;
        padding: 15px;
        text-align: center;
        border-radius: 8px;
    }
    
    .invoice-footer p {
        font-size: 16px;
        font-weight: 600;
        color: #555;
        letter-spacing: 2px;
        margin: 0;
    }
}

