/* ============================================================================
   Income & Invoice Management Module - CSS Styles
   ============================================================================ */

/* CSS Variables - Theme Colors */
:root {
    --primary-color: #0d47a1;
    --primary-dark: #0a3d91;
    --primary-light: #1565c0;
    --secondary-color: #00897b;
    --secondary-light: #26a69a;
    --success-color: #4caf50;
    --warning-color: #ffc107;
    --danger-color: #f44336;
    --info-color: #2196f3;
    
    --bg-light: #f5f6fa;
    --bg-white: #ffffff;
    --bg-dark: #1a1a2e;
    
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-light: #9e9e9e;
    --text-white: #ffffff;
    
    --border-color: #e0e0e0;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   Reset & Base Styles
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 
                 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

button {
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

/* ============================================================================
   Navigation Tabs
   ============================================================================ */

.nav-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-white);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--card-shadow);
}

.back-to-dashboard {
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
}

.back-to-dashboard:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateX(-2px);
    box-shadow: 0 2px 8px rgba(13, 71, 161, 0.3);
}

.back-to-dashboard i {
    font-size: 14px;
}

.tab-btn {
    padding: 16px 24px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn i {
    font-size: 16px;
}

/* ============================================================================
   Tab Content
   ============================================================================ */

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   Forms & Inputs
   ============================================================================ */

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.required {
    color: var(--danger-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
}

.form-group input[readonly] {
    background: var(--bg-light);
    cursor: not-allowed;
}

.form-group small {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
}

/* Button Group in Form */
.form-group {
    position: relative;
}

.add-btn {
    position: absolute;
    right: 2px;
    bottom: 2px;
    padding: 10px 12px;
    background: var(--secondary-color);
    color: var(--text-white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.add-btn:hover {
    background: var(--secondary-light);
}

/* Select with add button position fix */
.form-group {
    position: relative;
}

.form-group select {
    padding-right: 50px;
}

.form-group.has-add-btn select {
    padding-right: 50px;
}

/* ============================================================================
   Line Items Table
   ============================================================================ */

.line-items-section {
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 8px;
}

.line-items-section h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
    font-size: 16px;
}

.line-items-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.line-items-table thead {
    background: var(--primary-color);
    color: var(--text-white);
}

.line-items-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.line-items-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.line-items-table input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
}

.line-items-table input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(13, 71, 161, 0.02);
}

.line-items-table select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.line-items-table select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(13, 71, 161, 0.02);
}

.line-items-table .vat-checkbox {
    width: auto;
    cursor: pointer;
    accent-color: var(--primary-color);
    transform: scale(1.3);
}

.line-items-table .amount {
    font-weight: 600;
    color: var(--primary-color);
}

.remove-btn {
    background: var(--danger-color);
    color: var(--text-white);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    transition: var(--transition);
}

.remove-btn:hover {
    background: #d32f2f;
    transform: scale(1.05);
}

/* ============================================================================
   Totals Section
   ============================================================================ */

.totals-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.total-row span,
.total-row label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 100px;
}

.total-row input {
    width: 120px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: right;
    font-weight: 600;
}

.total-row input[readonly] {
    background: var(--bg-white);
    border: none;
    font-weight: 700;
    color: var(--primary-color);
}

.total-row.grand-total {
    border-top: 2px solid var(--border-color);
    padding-top: 12px;
    font-size: 16px;
}

.total-row.grand-total strong {
    color: var(--primary-color);
    font-size: 18px;
}

#taxAmount {
    font-weight: 600;
    color: var(--success-color);
}

/* ============================================================================
   Invoice Preview
   ============================================================================ */

.invoice-preview-section {
    margin-top: 20px;
}

.invoice-preview {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    max-width: 800px;
    margin: 20px auto;
    font-size: 14px;
    position: relative;
}

.invoice-preview.hidden {
    display: none;
}

.invoice-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 20px;
}

.company-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 8px;
}

.company-logo img {
    max-width: 100%;
    max-height: 100%;
}

.company-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.company-details {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.invoice-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 30px 0;
}

.invoice-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 6px;
}

.meta-item {
    display: flex;
    justify-content: space-between;
}

.meta-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.meta-value {
    font-weight: 500;
    color: var(--text-primary);
}

.invoice-body {
    margin: 30px 0;
}

.invoice-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.invoice-body thead {
    background: var(--primary-color);
    color: var(--text-white);
}

.invoice-body th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.invoice-body td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.invoice-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Invoice Stamp - Custom Image-Based Design */
.invoice-stamp {
    position: absolute;
    bottom: 40px;
    right: 30px;
    width: 200px;
    height: 200px;
    z-index: 1000;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stamp-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: rotate(-15deg);
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

/* Paid Stamp */
.stamp-paid .stamp-image {
    filter: drop-shadow(2px 2px 4px rgba(220, 20, 60, 0.2));
}

/* Pending Stamp */
.stamp-pending .stamp-image {
    filter: drop-shadow(2px 2px 4px rgba(220, 20, 60, 0.2));
}

/* Partially Paid Stamp */
.stamp-partial .stamp-image {
    filter: drop-shadow(2px 2px 4px rgba(255, 140, 0, 0.2));
}

@media print {
    .invoice-stamp {
        opacity: 0.8;
    }
    
    .stamp-image {
        filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.15)) !important;
    }
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: var(--secondary-light);
}

.btn-light {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-light:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--text-white);
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-success {
    background: var(--success-color);
    color: var(--text-white);
}

.btn-success:hover {
    background: #45a049;
}

/* Form Action Buttons */
.form-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ============================================================================
   Tables
   ============================================================================ */

.invoices-table,
.income-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    margin-top: 20px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.invoices-table thead,
.income-table thead {
    background: var(--primary-color);
    color: var(--text-white);
}

.invoices-table th,
.income-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoices-table td,
.income-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-color);
}

.invoices-table tbody tr,
.income-table tbody tr {
    transition: var(--transition);
}

.invoices-table tbody tr:hover,
.income-table tbody tr:hover {
    background: var(--bg-light);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-draft {
    background: #e8eaf6;
    color: #3949ab;
}

.status-issued {
    background: #e3f2fd;
    color: #1976d2;
}

.status-paid {
    background: #e8f5e9;
    color: #388e3c;
}

.status-pending {
    background: #fff3e0;
    color: #e65100;
}

.status-partially-paid {
    background: #f3e5f5;
    color: #6a1b9a;
}

/* Status Dropdown */
.status-dropdown {
    position: relative;
    display: inline-block;
}

.status-dropdown-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.status-dropdown-btn:hover {
    background: rgba(13, 71, 161, 0.1);
}

.status-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.status-dropdown-menu.active {
    display: block;
}

.status-option {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    padding: 10px 16px;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-color);
    transition: background 0.2s ease;
}

.status-option:first-child {
    border-radius: 6px 6px 0 0;
}

.status-option:last-child {
    border-radius: 0 0 6px 6px;
}

.status-option:hover {
    background: rgba(13, 71, 161, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

/* Services Management */
.services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.service-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-light);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid var(--border-color);
}

.service-item button {
    background: transparent;
    border: none;
    color: #f44336;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 14px;
    transition: color 0.2s ease;
}

.service-item button:hover {
    color: #d32f2f;
}

/* Travel Date Alert Notification */
.travel-alert-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #e65100 0%, #d84315 100%);
    color: white;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    max-width: 320px;
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 16px;
    position: relative;
}

.alert-content i {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
    animation: bounce 0.6s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.alert-message {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
}

.alert-close {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.alert-close:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

/* Invoice Actions */
.invoice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.invoice-actions .status-select {
    background: #f8fafc;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    min-width: 32px;
    height: 32px;
}

.action-btn i {
    font-size: 13px;
}

.action-btn.preview:hover {
    background: #e8f0fe;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.action-btn.edit:hover {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fdba74;
}

.action-btn.print:hover {
    background: #ecfdf5;
    color: #047857;
    border-color: #6ee7b7;
}

.action-btn.delete:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* Action cell container */
.action-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Status select styling */
.status-select {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    background: #f8fafc;
    transition: var(--transition);
}

.status-select:hover {
    border-color: #cbd5e1;
}

/* ============================================================================
   Section Containers
   ============================================================================ */

.invoice-container,
.invoices-container,
.income-container,
.settings-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.invoice-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Split View for Live Preview */
.invoice-container.split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: none;
    padding: 20px;
}

.invoice-form-section {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

/* Live Preview Section */
.invoice-preview-section.live-preview {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 180px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.preview-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-header .btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.preview-header .btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.invoice-preview-live {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    text-align: center;
    padding: 40px;
}

.preview-placeholder p {
    margin-top: 16px;
    font-size: 14px;
}

/* Preview Invoice Styles */
.invoice-preview-live .invoice-document {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-height: 600px;
}

.invoice-preview-live .invoice-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary-color);
}

.invoice-preview-live .company-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 10px 0;
}

.invoice-preview-live .company-details {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.invoice-preview-live .invoice-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 20px 0;
}

.invoice-preview-live .invoice-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.invoice-preview-live .meta-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.invoice-preview-live .meta-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
}

.invoice-preview-live .meta-value {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 12px;
}

.invoice-preview-live .services-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}

.invoice-preview-live .services-table th {
    background: var(--primary-color);
    color: white;
    padding: 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
}

.invoice-preview-live .services-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 11px;
}

.invoice-preview-live .totals-table {
    margin-left: auto;
    width: 350px;
    margin-top: 20px;
}

.invoice-preview-live .totals-table td {
    padding: 8px 12px;
    font-size: 12px;
}

.invoice-preview-live .totals-table .grand-total-row {
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.invoice-preview-live .invoice-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--primary-color);
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
}

/* Fullscreen Preview Mode */
.invoice-container.split-view.preview-fullscreen {
    grid-template-columns: 0fr 1fr;
}

.invoice-container.split-view.preview-fullscreen .invoice-form-section {
    display: none;
}

.invoice-preview-section.live-preview.fullscreen {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    max-height: none;
    border-radius: 0;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .invoice-container.split-view {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1024px) {
    .invoice-container.split-view {
        grid-template-columns: 1fr;
    }
    
    .invoice-preview-section.live-preview {
        position: relative;
        top: 0;
        max-height: 600px;
    }
}

.invoice-form-section h2 {
    margin-bottom: 20px;
    font-size: 20px;
    color: var(--primary-color);
}

/* ============================================================================
   Search & Filter
   ============================================================================ */

.search-filter,
.report-filters {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.search-filter input,
.report-filters input,
.search-filter select {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.search-filter input:focus,
.report-filters input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ============================================================================
   Income Report
   ============================================================================ */

.income-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.summary-card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    border-top: 4px solid var(--primary-color);
}

.summary-card h3 {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ============================================================================
   Settings
   ============================================================================ */

.settings-section {
    background: var(--bg-white);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: var(--card-shadow);
}

.settings-section h3 {
    margin-bottom: 20px;
    font-size: 16px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Logo Preview */
.logo-preview {
    margin-top: 12px;
    width: 100%;
    height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    transition: var(--transition);
}

.logo-preview:hover {
    border-color: var(--primary-color);
    background: rgba(13, 71, 161, 0.02);
}

.logo-preview img {
    max-width: 90%;
    max-height: 90%;
}

/* ============================================================================
   Modal Dialogs
   ============================================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal:not(.hidden) {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.modal-content.large {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-body input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
    body {
        background: white;
    }

    .nav-tabs,
    .invoice-form-section,
    .form-actions,
    .modal {
        display: none !important;
    }

    .invoice-preview {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 1024px) {
    .invoice-container {
        grid-template-columns: 1fr;
    }

    .invoice-preview-section {
        margin-top: 40px;
    }
}

@media (max-width: 768px) {
    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        white-space: nowrap;
        padding: 12px 16px;
    }

    .tab-btn i {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-actions {
        grid-template-columns: 1fr;
    }

    .invoice-meta {
        grid-template-columns: 1fr;
    }

    .invoice-container,
    .invoices-container,
    .income-container,
    .settings-container {
        padding: 12px;
    }

    .invoice-form-section {
        padding: 16px;
    }

    .line-items-table {
        font-size: 12px;
    }

    .line-items-table th,
    .line-items-table td {
        padding: 8px;
    }

    .invoices-table,
    .income-table {
        font-size: 12px;
    }

    .invoices-table th,
    .invoices-table td,
    .income-table th,
    .income-table td {
        padding: 8px;
    }

    .search-filter {
        flex-direction: column;
    }

    .search-filter input,
    .search-filter select {
        width: 100%;
    }

    .invoice-preview {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .invoice-container {
        padding: 8px;
    }

    .invoice-form-section {
        padding: 12px;
    }

    .form-group label {
        font-size: 12px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 12px;
        padding: 10px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 12px;
    }

    .totals-section {
        max-width: 100%;
    }

    .modal-content {
        width: 95%;
        max-width: 100%;
    }
}

/* ============================================================================
   Loading & Animation States
   ============================================================================ */

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}
/* ============================================================================
   Travel Date Alert Banner
   ============================================================================ */

.travel-alert-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
    color: white;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.travel-alert-banner strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.travel-alert-banner p {
    font-size: 13px;
    opacity: 0.95;
}

.travel-alert-banner button {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.travel-alert-banner button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* ============================================================================
   RECEIPT VOUCHERS
   ============================================================================ */

.receipts-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

.receipt-form-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.receipt-form-section h2 {
    color: var(--primary);
    margin-bottom: 25px;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.receipt-form-section h2::before {
    content: '📝';
    font-size: 28px;
}

.receipts-list-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.receipts-list-section h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.receipts-list-section h2::before {
    content: '📋';
    font-size: 26px;
}

.receipts-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.receipts-table thead {
    background: linear-gradient(135deg, var(--primary), #1565c0);
    color: white;
}

.receipts-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.receipts-table tbody tr {
    border-bottom: 1px solid #e8eef3;
    transition: background-color 0.2s ease;
}

.receipts-table tbody tr:hover {
    background: #f8fafc;
}

.receipts-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text-primary);
}

.status-badge.status-paid {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.status-due {
    background: #fff3e0;
    color: #ef6c00;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Receipt Form Specific Styles */
#receiptAmountWords {
    background: #f8fafc;
    font-style: italic;
    color: #555;
}

.receipt-form-section .form-actions {
    border-top: 1px solid #e8eef3;
    padding-top: 20px;
}

/* Print Receipt Styles */
@media print {
    .receipts-table,
    .receipt-form-section,
    .nav-tabs {
        display: none;
    }
}