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

:root {
    --container-max-width: 95%;
    --container-padding: 2%;
    --nav-height: 70px;
    --border-radius: 12px;
    --primary-color: #2563eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --background-primary: #ffffff;
    --background-secondary: #f8f9fa;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
}

/* Device Detection Classes */
.desktop-only { display: block; }
.tablet-only, .mobile-only { display: none; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-secondary);
    font-size: 32px;
}

/* Improved scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
}

/* Desktop-specific container adjustments */
@media (min-width: 1024px) {
    .container {
        max-width: 95%;
        padding: 0 2.5%;
    }
    
    .nav-container {
        max-width: 95%;
        padding: 0 2.5%;
    }
    
    /* Force full width utilization on desktop */
    .invoices-page .container,
    .customers-suppliers-page .container,
    .financial-page .container {
        max-width: 96%;
        padding: 0 2%;
    }
    
    .table-container {
        width: 100%;
        margin: 30px 0;
    }
    
    .page-header,
    .page-actions {
        width: 100%;
    }
}

/* Responsive container variations */
.container-fluid {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--nav-height);
}

.nav-brand h2 {
    color: #2563eb;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 8px 16px;
    border-radius: 6px;
}

.nav-link:hover,
.nav-link.active {
    color: #2563eb;
    background-color: #eff6ff;
}

.main-content {
    min-height: calc(100vh - 140px);
}

.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 40px;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: white;
    color: #2563eb;
}

.features-section {
    padding: 80px 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: #1f2937;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.feature-card {
    text-align: center;
    padding: 40px 20px;
    border-radius: 12px;
    background: #f8f9fa;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #1f2937;
}

.feature-card p {
    color: #6b7280;
    line-height: 1.6;
}

.cta-section {
    background: #1f2937;
    color: white;
    padding: 80px 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta-section p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.footer {
    background: #111827;
    color: white;
    text-align: center;
    padding: 30px 0;
}

.footer p {
    opacity: 0.8;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: 0;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}


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

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

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn-close {
    background-color: #6b7280;
    color: white;
}

.btn-close:hover {
    background-color: #4b5563;
}

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

.btn-save:hover {
    background-color: #059669;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-top: 30px;
}

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

.table th {
    background-color: #f3f4f6;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.table td {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
}

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

.customers-suppliers-page {
    padding: 40px 0;
    min-height: calc(100vh - 140px);
}

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

.page-header h1 {
    color: #1f2937;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.page-header p {
    color: #6b7280;
    font-size: 1.1rem;
}

/* Financial Page Styles */
.financial-page {
    padding: 40px 0;
    min-height: calc(100vh - 140px);
}

.financial-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.financial-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.financial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.financial-card.coming-soon {
    opacity: 0.7;
}

.financial-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.financial-card h3 {
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.financial-card p {
    color: #6b7280;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Invoice Page Styles */
.invoices-page {
    padding: 60px 0;
    min-height: calc(100vh - var(--nav-height) - 70px);
}

.page-actions {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 28px;
    width: 300px;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Fleet Styles */
.fleet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.truck-card {
    background: var(--background-primary);
    border-radius: var(--border-radius);
    padding: 30px 20px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.truck-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.truck-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.truck-card h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.truck-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 60px 20px;
    font-size: 1.1rem;
}

/* Truck Detail Styles */
.truck-detail-page {
    display: flex;
    gap: 0;
    min-height: calc(100vh - var(--nav-height) - 70px);
}

.truck-sidebar {
    width: 250px;
    background: var(--background-primary);
    box-shadow: var(--shadow-sm);
    padding: 20px 0;
}

.truck-content {
    flex: 1;
    padding: 20px;
    background: var(--background-secondary);
}

.truck-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.truck-nav li {
    margin: 0;
}

.truck-nav a {
    display: block;
    padding: 15px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.truck-nav a:hover,
.truck-nav a.active {
    background: var(--primary-color);
    color: white;
}

.truck-header {
    background: var(--background-primary);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.truck-info-section {
    background: var(--background-primary);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

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

.info-item {
    padding: 15px;
    background: var(--background-secondary);
    border-radius: 8px;
}

.info-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.info-value {
    color: var(--text-secondary);
}

.edit-mode {
    display: none;
}

.edit-mode.active {
    display: block;
}

.view-mode.editing {
    display: none;
}

/* Analytics Styles */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.analytics-card {
    background: var(--background-primary);
    border-radius: var(--border-radius);
    padding: 40px 30px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.analytics-card:hover:not(.coming-soon) {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.analytics-card.coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
}

.analytics-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.analytics-card h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.analytics-card p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Variable Cost Styles */
.variable-cost-page {
    display: flex;
    gap: 0;
    min-height: calc(100vh - var(--nav-height) - 70px);
}

.variable-cost-sidebar {
    width: 280px;
    background: var(--background-primary);
    box-shadow: var(--shadow-sm);
    padding: 20px 0;
}

.variable-cost-content {
    flex: 1;
    padding: 20px;
    background: var(--background-secondary);
}

.variable-cost-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.variable-cost-nav li {
    margin: 0;
}

.variable-cost-nav a {
    display: block;
    padding: 15px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.variable-cost-nav a:hover,
.variable-cost-nav a.active {
    background: var(--primary-color);
    color: white;
    border-left-color: rgba(255, 255, 255, 0.5);
}

.data-log-header {
    background: var(--background-primary);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.data-entry-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.data-log-table-container {
    background: var(--background-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* Variable Cost Modal Specific Styles */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    background: none;
    border: none;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

.form-grid {
    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 label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-help {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-warning {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.alert h4 {
    margin: 0 0 10px 0;
    font-weight: 600;
}

.alert ul {
    margin: 10px 0;
    padding-left: 20px;
}

.actions {
    white-space: nowrap;
}

.actions .btn {
    margin-right: 8px;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.875rem;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

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

/* Coming Soon Styles */
.coming-soon-container {
    text-align: center;
    padding: 60px 20px;
    background: var(--background-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    max-width: 600px;
    margin: 0 auto;
}

.coming-soon-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.coming-soon-container h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.75rem;
}

.coming-soon-container p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.6;
}

.feature-list {
    text-align: left;
    max-width: 400px;
    margin: 30px auto;
    padding: 0;
    list-style: none;
}

.feature-list li {
    color: var(--text-secondary);
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    line-height: 1.5;
}

.feature-list li:before {
    content: "•";
    color: var(--primary-color);
    font-size: 1.2rem;
    position: absolute;
    left: 0;
    top: 8px;
}

.modal-large {
    max-width: 1000px;
    width: 95%;
    margin: 2% auto;
}

/* Enhanced Table Styles */
.table-container {
    background: var(--background-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin: 30px 0;
    border: 1px solid #e5e7eb;
    width: 100%;
}

.table-header {
    background: var(--background-primary);
    padding: 20px 25px;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.table-scroll {
    overflow-x: auto;
    max-height: 70vh;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    background-color: #f8fafc;
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.table td {
    padding: 16px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

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

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

.table tbody tr:nth-child(even):hover {
    background-color: #f1f5f9;
}

/* Totals footer row styling */
.table tfoot .totals-row {
    background-color: #f3f4f6;
    border-top: 2px solid #d1d5db;
}

.table tfoot .totals-row td {
    padding: 12px 15px;
    font-weight: bold;
    border-bottom: none;
}

.table tfoot .totals-row td:nth-child(1) {
    background-color: #e5e7eb;
}

/* File Structure Manual styling */
.file-structure-manual {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.file-structure-manual h3 {
    color: #1e40af;
    margin: 0 0 15px 0;
    font-size: 1.1em;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 5px;
}

.manual-content p {
    margin: 10px 0;
    line-height: 1.5;
    color: #374151;
}

.manual-content .important-warning {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    border-left: 4px solid #ef4444;
    padding: 10px;
    border-radius: 4px;
    color: #dc2626;
    font-weight: 500;
}

/* Dashboard Specific Styles */
.data-range-filter {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.data-range-filter label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1em;
}

.filter-dropdown {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 1em;
    color: var(--text-primary);
    min-width: 200px;
    cursor: pointer;
}

.filter-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dashboard-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-button {
    background: none;
    border: none;
    padding: 15px 25px;
    font-size: 1em;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    color: var(--primary-color);
    background-color: #f8fafc;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: #f0f9ff;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-card h3 {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .value {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0;
}

.summary-card .value.currency {
    color: var(--success-color);
}

.summary-card .value.ratio {
    color: var(--primary-color);
}

.search-filter {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.data-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.dashboard-table {
    margin: 0;
    border-radius: 0;
    font-size: 32px !important;
    border-collapse: collapse;
}

.dashboard-table th {
    background-color: #f8fafc;
    font-weight: 600;
    text-align: center;
    padding: 15px 20px;
    border: 2px solid #374151;
    font-size: 32px !important;
}

.dashboard-table td {
    padding: 15px 20px;
    border: 2px solid #374151;
    text-align: center;
    vertical-align: middle;
    font-size: 32px !important;
}

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

.dashboard-table .numeric {
    text-align: center;
    font-family: 'Segoe UI', monospace;
    font-weight: 500;
}

.loading-state, .no-data-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Responsive Design for Dashboard */
@media (max-width: 768px) {
    .dashboard-tabs {
        flex-wrap: wrap;
    }
    
    .tab-button {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .data-range-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .filter-dropdown {
        min-width: auto;
    }
}

/* Expandable rows styling for tolls tab */
.expandable-row {
    cursor: pointer;
}

.expandable-row:hover {
    background-color: #e0f2fe !important;
}

.expand-icon {
    float: right;
    font-weight: bold;
    color: var(--primary-color);
}

.truck-details {
    background-color: #f8fafc !important;
}

.truck-details-container {
    padding: 15px;
    background-color: #ffffff;
    border-radius: 8px;
    margin: 10px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.truck-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 24px !important;
}

.truck-details-table th {
    background-color: #e5e7eb;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    font-size: 24px !important;
    text-align: center;
}

.truck-details-table td {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    font-size: 24px !important;
    text-align: center;
}

/* Invoice Statement Page Styles */
.invoice-filter-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
}

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

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

.filter-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1em;
}

.date-input {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    min-width: 150px;
    cursor: pointer;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-actions {
    display: flex;
    gap: 15px;
    margin-left: auto;
}

.results-summary {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f9ff;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    font-weight: 500;
    color: var(--text-primary);
}

.invoice-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 30px;
}

.invoice-statement-table {
    margin: 0;
    border-radius: 0;
    font-size: 16px;
}

.invoice-statement-table th {
    background-color: #f8fafc;
    font-weight: 600;
    text-align: left;
    padding: 15px 20px;
    border-bottom: 2px solid #e2e8f0;
    font-size: 16px;
}

.invoice-statement-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 16px;
    vertical-align: middle;
}

.invoice-statement-table tbody tr:hover {
    background-color: #f8fafc;
}

.invoice-statement-table .numeric {
    text-align: right;
    font-family: 'Segoe UI', monospace;
    font-weight: 500;
}

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

.pdf-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.pdf-link:hover {
    background-color: #f0f9ff;
    text-decoration: underline;
}

.no-pdf {
    color: var(--text-secondary);
    font-style: italic;
}

.download-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.progress-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.progress-container h3 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-container p {
    margin: 20px 0 0 0;
    color: var(--text-secondary);
}

/* Responsive Design for Invoice Statement */
@media (max-width: 768px) {
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-actions {
        margin-left: 0;
        justify-content: stretch;
    }
    
    .filter-actions .btn {
        flex: 1;
    }
    
    .invoice-statement-table {
        font-size: 14px;
    }
    
    .invoice-statement-table th,
    .invoice-statement-table td {
        padding: 10px 8px;
        font-size: 14px;
    }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-help {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 5px;
    display: block;
}

.current-pdf-info {
    margin-top: 10px;
    padding: 10px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #374151;
}

.table th:last-child,
.table td:last-child {
    width: 120px;
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.btn-edit {
    background-color: #3b82f6;
    color: white;
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-edit:hover {
    background-color: #2563eb;
}

.btn-delete {
    background-color: #ef4444;
    color: white;
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-delete:hover {
    background-color: #dc2626;
}

.btn-pdf {
    background-color: #10b981;
    color: white;
    padding: 6px 12px;
    font-size: 0.875rem;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.btn-pdf:hover {
    background-color: #059669;
    color: white;
}

.category-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.category-revenue { background-color: #dcfce7; color: #166534; }
.category-variable-cost { background-color: #fef3c7; color: #d97706; }
.category-trailer-rent { background-color: #dbeafe; color: #1e40af; }
.category-truck-lease { background-color: #e0e7ff; color: #4338ca; }
.category-maintenance { background-color: #fef2f2; color: #dc2626; }
.category-insurance { background-color: #f3e8ff; color: #7c3aed; }
.category-comms { background-color: #ecfdf5; color: #059669; }
.category-overhead { background-color: #fef7ed; color: #ea580c; }
.category-contingency { background-color: #f0f9ff; color: #0284c7; }
.category-finansavimas { background-color: #fdf4ff; color: #a21caf; }
.category-vienkartiniai { background-color: #f1f5f9; color: #475569; }
.category-lengvosios { background-color: #f0fdf4; color: #15803d; }

/* Large Desktop Styles (1440px+) */
@media (min-width: 1440px) {
    :root {
        --container-max-width: 96%;
        --container-padding: 2%;
    }
    
    .container {
        max-width: 96%;
        padding: 0 2%;
    }
    
    .nav-container {
        max-width: 96%;
        padding: 0 2%;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .hero-subtitle {
        font-size: 1.375rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 50px;
    }
    
    .financial-sections {
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
    
    .table th, .table td {
        padding: 20px 16px;
    }
    
    .modal-large {
        max-width: 1200px;
    }
}

/* Desktop Styles (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .desktop-only { display: block; }
    .tablet-only, .mobile-only { display: none; }
    
    .container {
        max-width: 94%;
        padding: 0 3%;
    }
    
    .nav-container {
        max-width: 94%;
        padding: 0 3%;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    .financial-sections {
        grid-template-columns: repeat(2, 1fr);
        gap: 35px;
    }
}

/* Tablet Styles (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .desktop-only { display: none; }
    .tablet-only { display: block; }
    .mobile-only { display: none; }
    
    :root {
        --container-max-width: 100%;
        --container-padding: 30px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .financial-sections {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .modal-large {
        width: 90%;
        max-width: 800px;
    }
    
    .table-scroll {
        max-height: 60vh;
    }
    
    .nav-menu {
        gap: 20px;
    }
}

/* Mobile Styles (max 767px) */
@media (max-width: 767px) {
    .desktop-only, .tablet-only { display: none; }
    .mobile-only { display: block; }
    
    :root {
        --container-padding: 16px;
        --nav-height: 60px;
    }
    
    body {
        font-size: 28px;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .financial-sections {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .nav-menu {
        gap: 10px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
    
    .modal-large {
        width: 98%;
        margin: 2% auto;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .table-container {
        margin: 20px -16px 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .table-scroll {
        overflow-x: auto;
        max-height: 50vh;
    }
    
    .table {
        min-width: 800px;
        font-size: 0.8rem;
    }
    
    .table th, .table td {
        padding: 12px 8px;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .invoices-page {
        padding: 30px 0;
    }
    
    .financial-page {
        padding: 30px 0;
    }
    
    .customers-suppliers-page {
        padding: 30px 0;
    }
}

/* High DPI Display Adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .table {
        border-collapse: separate;
        border-spacing: 0;
    }
    
    .btn {
        border: 1px solid transparent;
    }
}