/* ============================================================
   NKR ROADLINES - Comprehensive Responsive & Device Compatibility
   Covers: Mobile (320px+), Tablet (768px+), Desktop (1024px+), 
           Large (1440px+), Print, Touch, Landscape/Portrait
   ============================================================ */

/* ============ BASE RESPONSIVE RESET ============ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
}

video, svg, canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Logos & Brand Elements */
.navbar-brand {
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

.navbar-brand img {
    height: 52px !important;
    max-height: 52px !important;
    width: auto !important;
    max-width: 65px !important;
    object-fit: contain !important;
    display: inline-block !important;
}

footer .d-flex img,
.footer-logo {
    height: 44px !important;
    max-height: 44px !important;
    width: auto !important;
    object-fit: contain !important;
    display: inline-block !important;
}

table {
    width: 100%;
}

input, select, textarea, button {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
}

/* Touch-friendly minimum tap targets */
a, button, .btn, .nav-link, .form-check-input, .form-select, 
input[type="checkbox"], input[type="radio"] {
    min-height: 44px;
    min-width: 44px;
}

.btn-sm {
    min-height: 36px;
    min-width: 36px;
}

/* ============ RESPONSIVE TABLES ============ */
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: -ms-autohiding-scrollbar;
}

/* Make all tables responsive by default */
.table {
    min-width: 600px;
}

@media (max-width: 991.98px) {
    .table-responsive, .card-body > .table, .card > .table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Card-style tables on mobile */
@media (max-width: 575.98px) {
    .table-mobile-cards thead {
        display: none;
    }
    .table-mobile-cards tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color, #D5DBEA);
        border-radius: 0.5rem;
        padding: 0.75rem;
        background: var(--bg-card, #fff);
        box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,0.06));
    }
    .table-mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }
    .table-mobile-cards tbody td:last-child {
        border-bottom: none;
    }
    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary, #5D6D7E);
        margin-right: 1rem;
        flex-shrink: 0;
        font-size: 0.85rem;
    }
}

/* ============ RESPONSIVE TYPOGRAPHY ============ */
html { font-size: 16px; }

h1, .h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h2, .h2 { font-size: clamp(1.3rem, 3.5vw, 2rem); }
h3, .h3 { font-size: clamp(1.15rem, 3vw, 1.75rem); }
h4, .h4 { font-size: clamp(1.05rem, 2.5vw, 1.5rem); }
h5, .h5 { font-size: clamp(1rem, 2vw, 1.25rem); }
h6, .h6 { font-size: clamp(0.9rem, 1.5vw, 1rem); }

p, li, td, th, label, span, a {
    line-height: 1.6;
}

@media (max-width: 575.98px) {
    body { font-size: 14px; }
    .display-1 { font-size: 2rem !important; }
    .display-2 { font-size: 1.8rem !important; }
    .display-3 { font-size: 1.6rem !important; }
    .display-4 { font-size: 1.4rem !important; }
    .lead { font-size: 1rem !important; }
}

/* ============ RESPONSIVE NAVIGATION (Public) ============ */
@media (max-width: 991.98px) {
    .navbar .container,
    .navbar .container-fluid {
        padding: 0 1rem;
    }
    .navbar-brand img {
        height: 35px !important;
    }
    .navbar-brand span,
    .navbar-brand .brand-text {
        font-size: 1rem !important;
    }
    .navbar-collapse {
        background: var(--bg-card, #fff);
        border-radius: 0.5rem;
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        max-height: 80vh;
        overflow-y: auto;
    }
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid #f0f0f0;
        font-size: 1rem;
    }
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    .navbar .btn, .navbar .nav-item .btn {
        width: 100%;
        margin-top: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand img {
        height: 30px !important;
    }
    .navbar {
        padding: 0.5rem 0 !important;
    }
}

/* ============ HERO SECTION RESPONSIVE ============ */
.hero-section, .hero, [class*="hero"] {
    min-height: 60vh;
}

@media (max-width: 767.98px) {
    .hero-section, .hero, [class*="hero"] {
        min-height: 50vh;
        padding: 2rem 1rem !important;
        text-align: center;
    }
    .hero-section h1, .hero h1 {
        font-size: 1.75rem !important;
    }
    .hero-section p, .hero p {
        font-size: 0.95rem !important;
    }
    .hero-section .btn, .hero .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    .hero-stats, .hero .stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 575.98px) {
    .hero-section, .hero, [class*="hero"] {
        min-height: 45vh;
        padding: 1.5rem 0.75rem !important;
    }
}

/* ============ RESPONSIVE SECTIONS ============ */
section, .section {
    padding: 3rem 0;
}

@media (max-width: 767.98px) {
    section, .section {
        padding: 2rem 0;
    }
}

@media (max-width: 575.98px) {
    section, .section {
        padding: 1.5rem 0;
    }
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ============ RESPONSIVE CARDS ============ */
.card {
    margin-bottom: 1rem;
    border-radius: 0.75rem;
}

@media (max-width: 767.98px) {
    .card-body {
        padding: 1rem !important;
    }
    .card-header {
        padding: 0.75rem 1rem !important;
    }
    /* Stack card columns on mobile */
    .row .col-lg-3, .row .col-lg-4, .row .col-lg-6,
    .row .col-md-3, .row .col-md-4, .row .col-md-6 {
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .card {
        border-radius: 0.5rem;
    }
    .card-body {
        padding: 0.75rem !important;
    }
}

/* ============ STAT CARDS / KPI CARDS ============ */
.stat-card, .kpi-card, [class*="stat-card"], [class*="dashboard-card"] {
    min-height: auto;
}

@media (max-width: 767.98px) {
    .stat-card h3, .kpi-card h3, .stat-card .stat-value {
        font-size: 1.5rem !important;
    }
    .stat-card p, .kpi-card p {
        font-size: 0.8rem !important;
    }
    .stat-card .stat-icon, .kpi-card .stat-icon {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 575.98px) {
    /* 2 stat cards per row on small mobile */
    .stats-row .col-lg-3,
    .stats-row .col-md-3,
    .stats-row .col-xl-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 374.98px) {
    /* Full width stat cards on very small screens */
    .stats-row .col-lg-3,
    .stats-row .col-md-3,
    .stats-row .col-xl-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ============ ADMIN SIDEBAR RESPONSIVE ============ */
@media (max-width: 991.98px) {
    .sidebar-wrapper, .admin-sidebar, #sidebar, [class*="sidebar"] {
        position: fixed !important;
        left: -280px;
        top: 0;
        width: 280px !important;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    .sidebar-wrapper.show, .admin-sidebar.show, #sidebar.show,
    .sidebar-wrapper.active, .admin-sidebar.active, #sidebar.active {
        left: 0;
    }
    /* Overlay behind sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }
    .sidebar-overlay.show, .sidebar-overlay.active {
        display: block;
    }
    /* Main content full width on mobile */
    .main-content, .content-wrapper, [class*="main-content"],
    .admin-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 1rem !important;
    }
    /* Admin header full width */
    .admin-header, .top-header, [class*="admin-header"] {
        left: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 575.98px) {
    .main-content, .content-wrapper, .admin-content {
        padding: 0.75rem !important;
    }
    .sidebar-wrapper .nav-link {
        padding: 0.6rem 1rem !important;
        font-size: 0.9rem;
    }
}

/* Mobile hamburger toggle */
.sidebar-toggle, .menu-toggle, #sidebarToggle {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar-toggle, .menu-toggle, #sidebarToggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: none;
        background: none;
        font-size: 1.25rem;
        cursor: pointer;
        color: var(--text-primary);
    }
}

/* ============ ADMIN HEADER RESPONSIVE ============ */
@media (max-width: 767.98px) {
    .admin-header .search-bar, 
    .top-header .search-bar,
    .header-search {
        display: none !important;
    }
    .admin-header, .top-header {
        padding: 0.5rem 1rem !important;
    }
    .header-actions .btn-text,
    .header-user-name {
        display: none;
    }
}

/* ============ RESPONSIVE FORMS ============ */
@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    .modal-dialog-lg, .modal-lg {
        max-width: calc(100% - 1rem) !important;
    }
    .modal-body {
        padding: 1rem !important;
        max-height: 70vh;
        overflow-y: auto;
    }
    .modal-header, .modal-footer {
        padding: 0.75rem 1rem !important;
    }
    /* Stack form columns */
    .row .col-md-6:not(.no-stack),
    .row .col-md-4:not(.no-stack),
    .row .col-lg-6:not(.no-stack),
    .row .col-lg-4:not(.no-stack) {
        margin-bottom: 0.5rem;
    }
    .form-group, .mb-3 {
        margin-bottom: 0.75rem !important;
    }
    .form-control, .form-select {
        padding: 0.6rem 0.75rem;
        font-size: 16px !important;
        border-radius: 0.5rem;
    }
    textarea.form-control {
        min-height: 80px;
    }
}

@media (max-width: 575.98px) {
    .input-group {
        flex-wrap: nowrap;
    }
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    /* Full-width buttons on mobile */
    .btn-group-mobile .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    .modal-footer {
        flex-direction: column;
    }
    .modal-footer .btn {
        width: 100%;
        margin: 0.25rem 0 !important;
    }
}

/* ============ RESPONSIVE FILTER BARS ============ */
@media (max-width: 767.98px) {
    .filter-bar, .filter-panel, [class*="filter"] .row {
        flex-direction: column;
    }
    .filter-bar .col, .filter-bar [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 0.5rem;
    }
    .filter-bar .btn-group {
        display: flex;
        width: 100%;
    }
    .filter-bar .btn-group .btn {
        flex: 1;
    }
}

/* ============ RESPONSIVE CHARTS ============ */
.chart-container, [class*="chart"] canvas {
    width: 100% !important;
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .chart-container {
        height: 250px !important;
        min-height: 200px;
    }
    canvas {
        max-height: 250px;
    }
}

@media (max-width: 575.98px) {
    .chart-container {
        height: 200px !important;
    }
}

/* ============ RESPONSIVE FOOTER ============ */
@media (max-width: 767.98px) {
    footer .row > [class*="col-"] {
        text-align: center;
        margin-bottom: 1.5rem;
    }
    footer .social-icons {
        justify-content: center;
    }
    footer h5, footer h6 {
        margin-bottom: 0.75rem;
    }
    footer ul {
        padding-left: 0;
    }
}

@media (max-width: 575.98px) {
    footer {
        padding: 2rem 1rem !important;
    }
    footer .row > [class*="col-"] {
        margin-bottom: 1rem;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

/* ============ RESPONSIVE BOOKING FORMS ============ */
@media (max-width: 767.98px) {
    .booking-form .tab-content {
        padding: 1rem !important;
    }
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    .booking-sidebar {
        margin-top: 1.5rem;
    }
}

/* ============ RESPONSIVE TRACKING TIMELINE ============ */
@media (max-width: 575.98px) {
    .tracking-timeline {
        padding-left: 1.5rem;
    }
    .tracking-timeline::before {
        left: 0.75rem;
    }
    .tracking-timeline .timeline-item {
        padding-left: 1.5rem;
    }
    .timeline-badge {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
}

/* ============ RESPONSIVE PAGE HEADERS ============ */
@media (max-width: 767.98px) {
    .page-header, .breadcrumb-section, [class*="page-header"] {
        padding: 1.5rem 1rem !important;
        min-height: auto !important;
    }
    .page-header h1, .page-header h2 {
        font-size: 1.5rem !important;
    }
    .breadcrumb {
        font-size: 0.8rem;
    }
}

/* ============ RESPONSIVE LOGIN/REGISTER ============ */
@media (max-width: 575.98px) {
    .login-card, .register-card, .auth-card {
        margin: 0.5rem;
        border-radius: 1rem;
    }
    .login-card .card-body, .auth-card .card-body {
        padding: 1.5rem !important;
    }
}

/* ============ SERVICE CARDS RESPONSIVE ============ */
@media (max-width: 767.98px) {
    .service-card, .feature-card {
        margin-bottom: 1rem;
    }
    .service-card .card-body {
        padding: 1.25rem;
    }
    .service-card i, .feature-card i {
        font-size: 2rem !important;
    }
}

/* ============ FLEET GALLERY RESPONSIVE ============ */
@media (max-width: 575.98px) {
    .fleet-card, .vehicle-card {
        margin-bottom: 0.75rem;
    }
    .fleet-filters .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }
}

/* ============ TESTIMONIAL CAROUSEL RESPONSIVE ============ */
@media (max-width: 575.98px) {
    .testimonial-card {
        padding: 1.25rem !important;
    }
    .testimonial-card .testimonial-text {
        font-size: 0.9rem;
    }
}

/* ============ STATS COUNTER RESPONSIVE ============ */
@media (max-width: 575.98px) {
    .counter-value, .stat-number {
        font-size: 2rem !important;
    }
    .counter-label, .stat-label {
        font-size: 0.8rem !important;
    }
}

/* ============ FLOATING BUTTONS RESPONSIVE ============ */
.whatsapp-float, .back-to-top, [class*="floating-btn"] {
    width: 50px;
    height: 50px;
    z-index: 999;
}

@media (max-width: 575.98px) {
    .whatsapp-float, .back-to-top {
        width: 44px;
        height: 44px;
        bottom: 15px;
    }
    .whatsapp-float {
        right: 15px;
    }
    .back-to-top {
        right: 15px;
        bottom: 70px;
    }
}

/* ============ CUSTOMER PORTAL RESPONSIVE ============ */
@media (max-width: 767.98px) {
    .customer-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
    }
    .customer-sidebar.show {
        left: 0;
    }
    .customer-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* ============ DRIVER MOBILE APP ============ */
@media (max-width: 575.98px) {
    .driver-dashboard .quick-action-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .driver-dashboard .trip-card {
        padding: 0.75rem;
    }
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
}

/* ============ MAPS RESPONSIVE ============ */
@media (max-width: 767.98px) {
    #trackingMap, .map-container, [id*="map"] {
        height: 300px !important;
        min-height: 250px;
    }
    .vehicle-list-panel {
        max-height: 300px;
        overflow-y: auto;
    }
}

@media (max-width: 575.98px) {
    #trackingMap, .map-container, [id*="map"] {
        height: 250px !important;
    }
}

/* ============ INVOICE / RECEIPT PRINT RESPONSIVE ============ */
@media (max-width: 767.98px) {
    .invoice-preview, .receipt-preview {
        padding: 1rem !important;
        font-size: 0.85rem;
    }
    .invoice-preview table th,
    .invoice-preview table td {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
}

/* ============ BADGES & PILLS RESPONSIVE ============ */
@media (max-width: 575.98px) {
    .badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
}

/* ============ ACTION BUTTONS RESPONSIVE ============ */
@media (max-width: 767.98px) {
    .action-buttons .btn, .btn-group-actions .btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
    }
    /* Stack action buttons vertically in table cells */
    td .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ============ PAGINATION RESPONSIVE ============ */
@media (max-width: 575.98px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }
    .pagination .page-link {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
        min-width: 36px;
        text-align: center;
    }
    .pagination .page-item:not(.active):not(:first-child):not(:last-child) {
        display: none;
    }
    .pagination .page-item:first-child,
    .pagination .page-item:last-child,
    .pagination .page-item.active,
    .pagination .page-item.active + .page-item,
    .pagination .page-item:nth-last-child(2) {
        display: block;
    }
}

/* ============ NOTIFICATION DROPDOWN RESPONSIVE ============ */
@media (max-width: 575.98px) {
    .notification-dropdown, .dropdown-menu-notifications {
        width: calc(100vw - 2rem) !important;
        max-width: 100% !important;
        right: -1rem !important;
        left: auto !important;
    }
}

/* ============ TAB NAVIGATION RESPONSIVE ============ */
@media (max-width: 575.98px) {
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    .nav-tabs .nav-item {
        flex-shrink: 0;
    }
    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* ============ ACCORDION / FAQ RESPONSIVE ============ */
@media (max-width: 575.98px) {
    .accordion-button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    .accordion-body {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}

/* ============ ALERTS & TOASTS RESPONSIVE ============ */
@media (max-width: 575.98px) {
    .toast-container {
        bottom: 70px !important;
        left: 0.5rem !important;
        right: 0.5rem !important;
    }
    .toast {
        width: 100% !important;
        max-width: 100% !important;
    }
    .alert {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}

/* ============ UTILITY RESPONSIVE HELPERS ============ */
/* Hide/Show based on device */
@media (max-width: 575.98px) {
    .hide-mobile, .d-mobile-none { display: none !important; }
}
@media (min-width: 576px) and (max-width: 767.98px) {
    .hide-tablet-sm { display: none !important; }
}
@media (min-width: 768px) and (max-width: 991.98px) {
    .hide-tablet { display: none !important; }
}
@media (min-width: 992px) {
    .hide-desktop { display: none !important; }
    .show-mobile-only { display: none !important; }
}
@media (max-width: 991.98px) {
    .show-mobile-only { display: block !important; }
}

/* Responsive spacing */
@media (max-width: 575.98px) {
    .py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    .py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .px-5 { padding-left: 1rem !important; padding-right: 1rem !important; }
    .px-4 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
    .my-5 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
    .gap-4 { gap: 1rem !important; }
    .gap-3 { gap: 0.75rem !important; }
}

/* Responsive text alignment */
@media (max-width: 767.98px) {
    .text-md-start-mobile { text-align: start !important; }
    .text-center-mobile { text-align: center !important; }
}

/* ============ LANDSCAPE ORIENTATION ============ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section, .hero {
        min-height: 100vh;
        padding: 1rem !important;
    }
    .hero-section h1 {
        font-size: 1.5rem !important;
    }
    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }
    .sidebar-wrapper, #sidebar {
        overflow-y: auto;
    }
}

/* ============ SAFE AREA (Notched phones) ============ */
@supports (padding: env(safe-area-inset-bottom)) {
    .bottom-nav, .fixed-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .navbar.fixed-top {
        padding-top: env(safe-area-inset-top);
    }
}

/* ============ HIGH DPI / RETINA ============ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ============ PRINT STYLES ============ */
@media print {
    /* Hide non-printable elements */
    .sidebar-wrapper, #sidebar, .admin-sidebar,
    .navbar, .top-header, .admin-header,
    .bottom-nav, .whatsapp-float, .back-to-top,
    .btn, button, .modal, .toast-container,
    .no-print, .filter-bar, .filter-panel,
    .action-buttons, .btn-group-actions,
    .pagination, footer, .sidebar-overlay {
        display: none !important;
    }

    /* Full width content */
    .main-content, .content-wrapper, .admin-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
        break-inside: avoid;
    }

    table {
        border-collapse: collapse;
    }
    th, td {
        border: 1px solid #ccc;
        padding: 4px 8px;
        font-size: 10pt;
    }

    a[href]:after {
        content: none;
    }

    .chart-container, canvas {
        max-height: 300px;
    }

    /* Invoice print styles */
    .invoice-preview {
        border: none;
        box-shadow: none;
    }

    @page {
        margin: 1.5cm;
        size: A4;
    }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============ DARK MODE RESPONSIVE TWEAKS ============ */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --bg-body: #121212;
        --bg-card: #1e1e1e;
        --text-primary: #e0e0e0;
        --text-secondary: #b0b0b0;
        --border-color: #333;
    }
}
