/* =================================================================
   DRIVE365 — DASHBOARD MOBILE RESPONSIVE
   Separate file — ONLY media queries, does NOT touch desktop styles
   ================================================================= */

/* ============================================
   TABLET — max-width: 1024px
   ============================================ */
@media (max-width: 1024px) {
    /* Layout: reduce sidebar width */
    .dash-layout {
        grid-template-columns: 220px 1fr;
        gap: 20px;
    }

    /* Stats: 2 columns */
    .dash-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Welcome card */
    .dash-welcome {
        padding: 22px 24px;
    }
    .dash-welcome h2 {
        font-size: 1.15rem;
    }

    /* Tables: smaller padding */
    .dash-table th,
    .dash-table td {
        padding: 10px 14px;
        font-size: 0.82rem;
    }

    /* Timeline lines shorter */
    .dash-timeline-line,
    .live-timeline-line {
        width: 40px;
    }

    /* Activity grid */
    .activity-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Invoice totals */
    .invoice-totals-row {
        width: 220px;
    }

    /* Profile overview */
    .profile-stats-mini {
        gap: 12px;
    }
    .profile-stat-mini {
        padding: 10px 12px;
        min-width: 70px;
    }
}

/* ============================================
   MOBILE — max-width: 768px
   ============================================ */
@media (max-width: 768px) {
    /* ── Dashboard Section ── */
    .dash-section {
        padding: 80px 0 40px;
    }
    .dash-section > .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* ── Layout: stack sidebar + main ── */
    .dash-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* ── Sidebar ── */
    .dash-sidebar {
        position: static;
        border-radius: 14px;
    }
    .dash-sidebar-header {
        padding: 20px 16px;
    }
    .dash-avatar {
        width: 48px;
        height: 48px;
        font-size: 1rem;
        margin-bottom: 8px;
    }
    .dash-sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 8px;
        gap: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .dash-sidebar-nav::-webkit-scrollbar {
        display: none;
    }
    .dash-nav-item {
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 0.82rem;
        flex-shrink: 0;
        border-radius: 8px;
        gap: 8px;
        margin-bottom: 0;
    }
    .dash-nav-item.active {
        border-left: none;
        border-bottom: 2px solid var(--gold-500);
    }
    .dash-sidebar-footer {
        display: none;
    }

    /* ── Welcome Card ── */
    .dash-welcome {
        padding: 18px 16px;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    .dash-welcome h2 {
        font-size: 1.05rem;
    }
    .dash-welcome p {
        font-size: 0.82rem;
    }
    .dash-welcome-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    /* ── Stats Grid ── */
    .dash-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .dash-stat-card {
        padding: 14px;
        gap: 10px;
        border-radius: 12px;
    }
    .dash-stat-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    .dash-stat-num {
        font-size: 1.1rem;
    }
    .dash-stat-label {
        font-size: 0.68rem;
    }

    /* ── Cards ── */
    .dash-card {
        border-radius: 14px;
        margin-bottom: 16px;
    }
    .dash-card-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .dash-card-header h3 {
        font-size: 0.92rem;
    }

    /* ── Tables ── */
    .dash-table-wrap {
        margin: 0 -2px;
    }
    .dash-table th {
        padding: 8px 10px;
        font-size: 0.7rem;
    }
    .dash-table td {
        padding: 10px;
        font-size: 0.8rem;
    }
    .dash-vehicle-cell img {
        width: 36px;
        height: 24px;
    }

    /* ── Booking Cards ── */
    .dash-booking-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 16px;
    }
    .dash-booking-vehicle img {
        width: 56px;
        height: 38px;
    }
    .dash-booking-vehicle h4 {
        font-size: 0.92rem;
    }
    .dash-booking-details {
        flex-direction: column;
        gap: 6px;
        padding: 12px 16px;
    }
    .dash-booking-detail {
        font-size: 0.8rem;
    }
    .dash-booking-bottom {
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
        align-items: stretch;
    }
    .dash-booking-bottom .dash-btn {
        justify-content: center;
        width: 100%;
        text-align: center;
    }
    .dash-booking-price {
        text-align: center;
        font-size: 1.1rem;
    }

    /* ── Timeline ── */
    .dash-timeline,
    .live-timeline {
        flex-wrap: wrap;
        gap: 4px;
        padding: 16px 12px;
        justify-content: center;
    }
    .dash-timeline-line,
    .live-timeline-line {
        width: 20px;
    }
    .dash-timeline-dot,
    .live-timeline-dot {
        width: 32px;
        height: 32px;
        font-size: 0.7rem;
    }
    .dash-timeline-step span,
    .live-timeline-label {
        font-size: 0.58rem;
    }

    /* ── Detail Grid ── */
    .dash-detail-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .dash-detail-vehicle img {
        max-width: 180px;
    }

    /* ── Info Rows ── */
    .dash-info-row {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 4px;
    }
    .dash-info-label,
    .dash-info-value {
        font-size: 0.82rem;
    }

    /* ── Pricing ── */
    .dash-price-row {
        padding: 8px 16px;
        font-size: 0.82rem;
    }

    /* ── Forms ── */
    .dash-form-grid {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 14px;
    }
    .dash-form-actions {
        flex-direction: column;
    }
    .dash-form-actions .dash-btn {
        width: 100%;
        justify-content: center;
    }

    /* ── Page Header ── */
    .dash-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .dash-page-header h2 {
        font-size: 1.1rem;
    }

    /* ── Buttons ── */
    .dash-btn {
        padding: 8px 16px;
        font-size: 0.82rem;
    }
    .dash-btn-sm {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    /* ── Active Bookings ── */
    .active-booking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 16px;
    }
    .active-booking-img,
    .active-booking-img-placeholder {
        width: 60px;
        height: 40px;
    }
    .active-booking-vehicle h3 {
        font-size: 0.92rem;
    }
    .active-booking-details {
        flex-direction: column;
        gap: 8px;
        padding: 14px 16px;
    }
    .active-booking-countdown {
        padding: 10px 16px;
        font-size: 0.78rem;
    }

    /* ── Invoice ── */
    .invoice-detail-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 14px;
    }
    .invoice-totals-row {
        width: 100%;
    }
    .invoice-status-banner {
        padding: 10px 14px;
        font-size: 0.82rem;
    }

    /* ── Profile ── */
    .profile-overview {
        flex-direction: column;
        text-align: center;
        gap: 14px;
        padding: 20px 16px;
    }
    .profile-avatar-lg {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    .profile-info h2 {
        font-size: 1.1rem;
    }
    .profile-stats-mini {
        margin-left: 0;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    .profile-stat-mini {
        padding: 8px 12px;
        min-width: 65px;
    }
    .profile-stat-mini-num {
        font-size: 1rem;
    }

    /* ── Activity Grid ── */
    .activity-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* ── Notifications ── */
    .notification-card {
        padding: 12px 14px;
        gap: 10px;
    }
    .notification-icon {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    .notification-title {
        font-size: 0.85rem;
    }
    .notification-message {
        font-size: 0.78rem;
    }

    /* ── Contracts ── */
    .contract-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 16px;
    }
    .contract-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .contract-signature {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 16px;
    }
    .contract-signature img {
        max-width: 160px;
    }

    /* ── Pagination ── */
    .dash-pagination-nav {
        gap: 3px;
    }
    .dash-page-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 0.78rem;
    }

    /* ── Auth ── */
    .auth-section {
        padding: 80px 0 40px;
    }
    .auth-card {
        padding: 28px 20px;
        border-radius: 16px;
    }
    .auth-row {
        grid-template-columns: 1fr;
    }
    .auth-logo {
        font-size: 1.6rem;
    }
    .auth-header h2 {
        font-size: 1.2rem;
    }
    .auth-modal {
        margin: 12px;
        max-height: calc(100vh - 24px);
    }
    .auth-modal-panel {
        padding: 20px 16px 24px;
    }

    /* ── Navbar Dropdown ── */
    .navbar-dropdown-menu {
        width: 200px;
    }
    .navbar-user-name {
        display: none;
    }

    /* ── Signature Pad ── */
    .signature-pad-container {
        padding: 16px;
    }
    .signature-canvas-wrap canvas {
        height: 160px;
    }
    .signature-actions {
        flex-direction: column;
    }
    .signature-actions .dash-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   SMALL MOBILE — max-width: 480px
   ============================================ */
@media (max-width: 480px) {
    .dash-section {
        padding: 70px 0 30px;
    }

    /* Stats: single column */
    .dash-stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .dash-stat-card {
        padding: 12px;
    }

    /* Welcome */
    .dash-welcome {
        padding: 14px 12px;
    }
    .dash-welcome h2 {
        font-size: 0.95rem;
    }

    /* Sidebar nav: only icons */
    .dash-sidebar-header h4 {
        font-size: 0.88rem;
    }

    /* Card headers */
    .dash-card-header {
        padding: 12px 14px;
    }
    .dash-card-header h3 {
        font-size: 0.85rem;
    }

    /* Tables: hide less important columns */
    .dash-table .hide-mobile {
        display: none;
    }
    .dash-table th,
    .dash-table td {
        padding: 8px;
        font-size: 0.75rem;
    }

    /* Booking card */
    .dash-booking-vehicle {
        gap: 10px;
    }
    .dash-booking-vehicle img {
        width: 48px;
        height: 32px;
    }
    .dash-booking-vehicle h4 {
        font-size: 0.85rem;
    }
    .dash-booking-num-label {
        font-size: 0.7rem;
    }

    /* Timeline: very compact */
    .dash-timeline,
    .live-timeline {
        padding: 12px 8px;
    }
    .dash-timeline-line,
    .live-timeline-line {
        width: 14px;
    }
    .dash-timeline-dot,
    .live-timeline-dot {
        width: 28px;
        height: 28px;
        font-size: 0.6rem;
    }
    .dash-timeline-step span,
    .live-timeline-label {
        font-size: 0.52rem;
    }

    /* Page header */
    .dash-page-header h2 {
        font-size: 1rem;
    }

    /* Buttons: full width */
    .dash-btn {
        width: 100%;
        justify-content: center;
    }

    /* Empty states */
    .dash-empty {
        padding: 32px 16px;
    }
    .dash-empty i {
        font-size: 2rem;
    }
    .dash-empty h4 {
        font-size: 0.95rem;
    }

    /* QR Modal */
    .qr-modal-content {
        width: 95%;
        padding: 20px 16px;
    }
}

/* ============================================
   EXTRA SMALL — max-width: 360px
   ============================================ */
@media (max-width: 360px) {
    .dash-section {
        padding: 60px 0 24px;
    }
    .dash-section > .container {
        padding-left: 8px;
        padding-right: 8px;
    }

    .dash-welcome h2 {
        font-size: 0.88rem;
    }

    .dash-sidebar-nav {
        padding: 6px;
    }
    .dash-nav-item {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .dash-stat-card {
        flex-direction: column;
        text-align: center;
        gap: 6px;
    }

    .dash-timeline,
    .live-timeline {
        flex-direction: column;
        gap: 6px;
    }
    .dash-timeline-line,
    .live-timeline-line {
        width: 2px;
        height: 16px;
        margin: 0;
        margin-left: 0;
    }

    .notification-card {
        flex-direction: column;
        gap: 8px;
    }
}
