/**
 * AUTOCORE360 Admin Panel - Mobile & Responsive
 * Media queries, mobile menu, touch feedback, responsive adjustments
 */

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Extra large screens - more side padding for boxed look */
@media (min-width: 1600px) {
    :root {
        --content-padding-x: 4rem;
    }
}

@media (min-width: 1800px) {
    :root {
        --content-padding-x: 6rem;
    }
}

/* ============ RESPONSIVE - TABLET (1024px) ============ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    :root {
        --content-padding-x: 1.5rem;
    }
}

/* ============ RESPONSIVE - TABLET (768px) ============ */
@media (max-width: 768px) {
    :root {
        --content-padding-x: 1rem;
    }

    .main-content {
        padding: 1rem var(--content-padding-x);
    }

    .page-header {
        padding: 1.25rem;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .header-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .table-container {
        overflow-x: auto;
    }

    .card-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
}

/* ============ RESPONSIVE - MOBILE (480px) ============ */
@media (max-width: 480px) {
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .page-title i {
        font-size: 1.25rem;
    }

    .toast {
        min-width: 280px;
        margin: 0.5rem;
    }
}

/* ============ PRINT STYLES ============ */
@media print {
    .sidebar,
    .header-actions,
    .btn,
    .modal {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

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

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

/* ============ HIGH CONTRAST MODE ============ */
@media (prefers-contrast: high) {
    :root {
        --border: #000;
        --border-hover: #000;
    }

    [data-theme="dark"] {
        --border: #fff;
        --border-hover: #fff;
    }
}

/* ============================================
   TOPNAV RESPONSIVE STYLES
   ============================================ */

/* Hide logout link on mobile (shown in mobile menu footer) */
@media (max-width: 1024px) {
    .topnav-logout-desktop {
        display: none !important;
    }
}

/* Responsive - Tablet & Mobile (1200px) */
@media (max-width: 1200px) {
    .topnav-search {
        width: 180px;
    }

    .topnav-user-info {
        display: none;
    }

    .topnav-user-toggle {
        padding: 0.25rem;
        border-radius: 50%;
    }

    .topnav-item span {
        display: none;
    }

    .topnav-item {
        padding: 0.625rem;
    }

    .topnav-arrow {
        display: none;
    }

    .topnav-logo-badge {
        display: none;
    }

    .topnav-user-tooltip {
        display: none;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .topnav-mobile-overlay {
        display: block;
    }

    .topnav-mobile-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .topnav-item {
        width: 100%;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
    }

    .topnav-item span {
        display: inline;
    }

    .topnav-arrow {
        display: inline;
        margin-left: auto;
    }

    .topnav-dropdown {
        width: 100%;
    }

    .topnav-dropdown-toggle {
        width: 100%;
        justify-content: flex-start;
    }

    .topnav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: var(--background);
        padding: 0.5rem 0 0.5rem 1.5rem;
        margin-top: 0.25rem;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }

    .topnav-dropdown.open .topnav-dropdown-menu {
        display: block;
    }

    .topnav-search {
        display: none;
    }
}

@media (max-width: 640px) {
    .topnav-container {
        padding: 0 1rem;
    }

    .topnav-actions {
        gap: 0.5rem;
    }
}

/* ============================================
   PAGE HEADER RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .page-header-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .page-header-content {
        flex-direction: column;
    }

    .page-header-actions {
        margin-top: 0.5rem;
    }

    .page-header-actions .btn-lg {
        width: 100%;
    }
}

/* ============================================
   MODAL RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .modal-form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   TABS RESPONSIVE
   ============================================ */

/* Mobile responsive tabs */
@media (max-width: 640px) {
    .tabs {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .tab {
        padding: 0.75rem 1rem;
    }
}

/* ============================================
   ALGO DROPDOWN RESPONSIVE
   ============================================ */

@media (min-width: 600px) {
    .algo-dropdown__grid--wide {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   BREADCRUMB RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .breadcrumb-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .breadcrumb-header__actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ============================================
   NOTIFICATIONS RESPONSIVE
   ============================================ */

/* Mobile responsive */
@media (max-width: 480px) {
    .notifications-panel {
        max-width: 100%;
    }
}

/* ============================================
   SIDEBAR MOBILE
   ============================================ */

/* Improved Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open,
    .sidebar.mobile-open {
        transform: translateX(0);
    }

    body.sidebar-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }

    .main-content {
        margin-left: 0;
    }

    .page-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .header-right {
        justify-content: space-between;
    }

    .search-box {
        flex: 1;
    }

    .content-area {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        flex-direction: column;
    }

    .table-container {
        overflow-x: auto;
    }

    .table {
        min-width: 600px;
    }

    .modal {
        width: 95%;
        max-height: 90vh;
        margin: 5vh auto;
    }

    #toastContainer {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    .command-palette {
        width: 95%;
        margin-top: 2rem;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ============================================
   CATALOG RESPONSIVE
   ============================================ */

/* Responsive */
@media (max-width: 768px) {
    .catalog-stats-row {
        grid-template-columns: 1fr;
    }

    .catalog-tabs {
        flex-direction: column;
    }

    .catalog-card {
        flex-wrap: wrap;
    }

    .catalog-card__content {
        flex: 1 1 100%;
        order: 2;
        margin-top: 0.75rem;
    }

    .catalog-card__status {
        order: 3;
        margin-top: 0.5rem;
    }

    .catalog-card__actions {
        order: 1;
        margin-left: auto;
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .assignment-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .assignment-card__path {
        margin-bottom: 0.75rem;
    }

    .assignment-card__actions {
        align-self: flex-end;
    }
}

/* ============================================
   PHASE 6: PREMIUM MOBILE EXPERIENCE
   Mandiag-inspired mobile navigation
   ============================================ */

/* Mobile body scroll lock when menu is open */
body.mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ============ HAMBURGER ANIMATION ============ */
.topnav-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.topnav-toggle:hover {
    background: var(--hover);
}

/* Hamburger lines */
.topnav-toggle .hamburger-line {
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s var(--ease-out);
    position: absolute;
}

.topnav-toggle .hamburger-line:nth-child(1) {
    transform: translateY(-7px);
}

.topnav-toggle .hamburger-line:nth-child(2) {
    opacity: 1;
}

.topnav-toggle .hamburger-line:nth-child(3) {
    transform: translateY(7px);
}

/* Hamburger to X animation */
.topnav-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg);
}

.topnav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.topnav-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg);
}

/* ============ MOBILE OVERLAY ENHANCED ============ */
.topnav-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

.topnav-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============ MOBILE MENU (Mandiag Style - Clean & Modern) ============ */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: var(--surface);
    z-index: 1002;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    flex-direction: column;
}

.mobile-menu.open {
    transform: translateX(0);
}

/* Mobile menu header - Mandiag blue gradient */
.mobile-menu-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1.5rem 1.25rem;
    display: none;
}

.mobile-user-card {
    display: none;
    align-items: center;
    gap: 0.875rem;
}

.mobile-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.mobile-user-info {
    flex: 1;
    min-width: 0;
}

.mobile-user-name {
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 2px;
}

.mobile-role-badge {
    font-size: 0.6875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

/* Mobile search bar */
.mobile-search-bar {
    display: none;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.mobile-search-wrapper {
    position: relative;
}

.mobile-search-wrapper i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.mobile-search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text);
    transition: all 0.2s ease;
}

.mobile-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Mobile nav items - Clean flat design */
.mobile-nav-items {
    padding: 0.75rem 0;
    flex: 1;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s ease;
    font-size: 0.9375rem;
    font-weight: 500;
}

.mobile-nav-item:hover {
    background: var(--hover);
    color: var(--primary);
}

.mobile-nav-item.active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
}

.mobile-nav-item i {
    width: 24px;
    font-size: 1.125rem;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.mobile-nav-item:hover i,
.mobile-nav-item.active i {
    color: var(--primary);
}

.mobile-nav-item span {
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Mobile nav sections */
.mobile-nav-section {
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
}

.mobile-nav-section-title {
    padding: 0.5rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.mobile-nav-section .mobile-nav-item {
    padding-left: 1.25rem;
}

/* Mobile menu footer */
.mobile-menu-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.mobile-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: var(--danger);
    color: #fff;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-logout-btn:hover {
    background: var(--danger-dark);
}

/* ============ MOBILE MENU ENHANCED - MANDIAG STYLE ============ */
@media (max-width: 1024px) {
    /* Show mobile menu */
    .mobile-menu {
        display: flex;
    }

    /* Two-layer mobile adjustments */
    .topnav-two-layer {
        height: auto;
    }

    .topnav-two-layer .topnav-layer-top {
        height: 60px;
        background: var(--primary);
    }

    /* Hide desktop nav layer on mobile */
    .topnav-two-layer .topnav-layer-nav {
        display: none !important;
    }

    /* Hide all dropdown menus on mobile - use mobile menu instead */
    .topnav-dropdown-menu {
        display: none !important;
    }

    .topnav-dropdown.open .topnav-dropdown-menu {
        display: none !important;
    }

    :root {
        --topnav-height: 60px;
    }

    /* Mandiag-style mobile header layout - hamburger left, logo center, actions right */
    .topnav-layer-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 1rem;
        position: relative;
    }

    /* Hamburger on the left */
    .topnav-toggle {
        display: flex;
        order: 0;
        margin-right: 0;
        position: relative;
        z-index: 2;
        background: rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-sm);
        width: 40px;
        height: 40px;
    }

    .topnav-toggle .hamburger-line {
        background: #fff;
    }

    .topnav-toggle:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    /* Logo centered absolutely - no animation on mobile */
    .topnav-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1;
    }

    .topnav-logo:hover {
        transform: translateX(-50%) !important;
    }

    .topnav-logo .logo-text {
        display: flex !important;
        font-size: 1.35rem;
    }

    /* Disable logo animation on mobile - prevents positioning issues */
    .topnav-logo .logo-text .brand-auto,
    .topnav-logo .logo-text .brand-core,
    .topnav-logo .logo-text .brand-360 {
        color: #fff;
        -webkit-text-fill-color: #fff;
        background: none;
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .topnav-logo-badge {
        display: none !important;
    }

    /* Actions on the right - minimal */
    .topnav-actions {
        position: relative;
        z-index: 2;
        gap: 0.5rem;
    }

    /* Hide search on mobile header */
    .topnav-search {
        display: none;
    }

    /* Glass morphism buttons on mobile */
    .topnav-action-btn {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.12);
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 0.625rem;
    }

    .topnav-action-btn:hover {
        background: rgba(255, 255, 255, 0.18);
        border-color: rgba(255, 255, 255, 0.2);
    }

    /* Hide notifications on mobile */
    #notificationsBtn {
        display: none;
    }

    /* User dropdown simplified for mobile */
    .topnav-user-dropdown .topnav-user-toggle {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        padding: 0.3rem;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.12);
    }

    .topnav-user-avatar {
        width: 2rem;
        height: 2rem;
        font-size: 0.7rem;
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
        color: #fff;
        border: none;
    }

    .topnav-user-info {
        display: none;
    }

    .topnav-user-dropdown .topnav-arrow {
        display: none;
    }

    /* Enhanced mobile menu panel */
    .topnav-menu {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 300px;
        max-width: 85vw;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        background: linear-gradient(180deg, var(--surface) 0%, var(--background) 100%);
        padding: 0;
        gap: 0;
        overflow-y: auto;
        overflow-x: hidden;
        transform: translateX(-100%);
        transition: transform 0.35s var(--ease-out);
        z-index: 1002;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
        margin-left: 0;
    }

    .topnav-menu.open {
        transform: translateX(0) !important;
    }

    /* Show mobile-only elements */
    .mobile-search-bar,
    .mobile-menu-footer {
        display: block !important;
    }

    /* Hide mobile menu header */
    .mobile-menu-header {
        display: none !important;
    }

    .mobile-user-card {
        display: flex !important;
    }

    /* Mobile menu header with user card */
    .mobile-menu-header {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        padding: 1.5rem;
        margin-bottom: 0.5rem;
        position: relative;
        overflow: hidden;
    }

    .mobile-menu-header::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 100%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
        pointer-events: none;
    }

    .mobile-user-card {
        display: flex;
        align-items: center;
        gap: 1rem;
        position: relative;
        z-index: 1;
    }

    .mobile-user-avatar {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 1.125rem;
        color: #fff;
        border: 2px solid rgba(255, 255, 255, 0.3);
        flex-shrink: 0;
    }

    .mobile-user-info {
        flex: 1;
        min-width: 0;
    }

    .mobile-user-name {
        font-weight: 600;
        font-size: 1rem;
        color: #fff;
        margin-bottom: 0.125rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-user-role {
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.8);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .mobile-role-badge {
        background: rgba(255, 255, 255, 0.2);
        padding: 0.125rem 0.5rem;
        border-radius: 10px;
        font-size: 0.625rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Mobile menu section header */
    .mobile-menu-section {
        padding: 0.5rem 1rem;
        margin-top: 0.5rem;
    }

    .mobile-menu-section-title {
        font-size: 0.625rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--text-muted);
        padding: 0.5rem 0;
    }

    /* Mobile navigation items */
    .topnav-item {
        width: 100%;
        justify-content: flex-start;
        padding: 0.875rem 1.25rem;
        border-radius: 0;
        margin: 0;
        border-left: 3px solid transparent;
        transition: all 0.2s ease;
    }

    .topnav-item:hover {
        background: var(--hover);
        border-left-color: var(--primary);
    }

    .topnav-item.active {
        background: var(--primary-glow);
        border-left-color: var(--primary);
        color: var(--primary);
    }

    .topnav-item i {
        width: 24px;
        text-align: center;
        margin-right: 0.75rem;
        font-size: 1rem;
    }

    .topnav-item span {
        display: inline;
        font-size: 0.9375rem;
    }

    .topnav-arrow {
        display: inline;
        margin-left: auto;
        transition: transform 0.2s ease;
    }

    /* Mobile dropdown styles */
    .topnav-dropdown {
        width: 100%;
    }

    .topnav-dropdown.open .topnav-arrow {
        transform: rotate(180deg);
    }

    .topnav-dropdown-toggle {
        width: 100%;
        justify-content: flex-start;
    }

    .topnav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: var(--background);
        padding: 0;
        margin: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        border-left: 3px solid var(--border);
        margin-left: 1.25rem;
    }

    .topnav-dropdown.open .topnav-dropdown-menu {
        display: block;
        animation: slideDown 0.2s ease;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .topnav-dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        border-left: 2px solid transparent;
        transition: all 0.2s ease;
    }

    .topnav-dropdown-item:hover {
        background: var(--hover);
        border-left-color: var(--primary);
    }

    .topnav-dropdown-item i {
        width: 20px;
        margin-right: 0.625rem;
        font-size: 0.875rem;
    }

    /* Hide desktop elements on mobile */
    .topnav-search {
        display: none;
    }

    .topnav-user-tooltip {
        display: none !important;
    }

    /* Mobile menu footer */
    .mobile-menu-footer {
        margin-top: auto;
        padding: 1rem;
        border-top: 1px solid var(--border);
    }

    .mobile-logout-btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.875rem;
        background: linear-gradient(135deg, var(--danger) 0%, #c0392b 100%);
        color: #fff;
        border: none;
        border-radius: var(--radius-md);
        font-weight: 600;
        font-size: 0.9375rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-logout-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
    }

    .mobile-logout-btn:active {
        transform: translateY(0);
    }

    /* Mobile quick actions */
    .mobile-quick-actions {
        display: flex;
        gap: 0.5rem;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }

    .mobile-quick-action {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.375rem;
        padding: 0.75rem 0.5rem;
        background: var(--hover);
        border-radius: var(--radius-md);
        border: none;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-quick-action:hover {
        background: var(--primary-glow);
    }

    .mobile-quick-action i {
        font-size: 1.125rem;
        color: var(--primary);
    }

    .mobile-quick-action span {
        font-size: 0.6875rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Mobile search bar */
    .mobile-search-bar {
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }

    .mobile-search-input {
        width: 100%;
        padding: 0.75rem 1rem 0.75rem 2.5rem;
        background: var(--background);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        font-size: 0.9375rem;
        color: var(--text);
        transition: all 0.2s ease;
    }

    .mobile-search-input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px var(--primary-glow);
    }

    .mobile-search-wrapper {
        position: relative;
    }

    .mobile-search-wrapper i {
        position: absolute;
        left: 0.875rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-muted);
        font-size: 0.875rem;
    }

    /* Mobile scroll indicator */
    .mobile-scroll-indicator {
        position: absolute;
        bottom: 60px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        color: var(--text-muted);
        font-size: 0.625rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        opacity: 0.7;
        animation: fadeInOut 2s ease-in-out infinite;
    }

    .mobile-scroll-indicator i {
        font-size: 1rem;
        animation: scrollBounce 1.5s ease-in-out infinite;
    }

    @keyframes scrollBounce {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(4px); }
    }

    @keyframes fadeInOut {
        0%, 100% { opacity: 0.3; }
        50% { opacity: 0.8; }
    }

    /* Dashboard grid */
    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }

    /* Dashboard grid */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Tickets stats grid */
    .stats-grid-tickets {
        grid-template-columns: repeat(2, 1fr);
    }

    /* DataTables tablet breakpoint */
    table.dataTable td.dtr-control::before {
        display: inline-flex !important;
    }
}

/* ============ SMALLER MOBILE (640px) ============ */
@media (max-width: 640px) {
    .topnav-layer-container {
        padding: 0 0.75rem;
    }

    .topnav-container {
        padding: 0 0.75rem;
    }

    /* Smaller header height */
    .topnav-two-layer .topnav-layer-top {
        height: 56px;
    }

    :root {
        --topnav-height: 56px;
    }

    /* Smaller logo text */
    .topnav-logo .logo-text {
        font-size: 1.125rem;
    }

    .topnav-logo-badge {
        font-size: 0.45rem;
        padding: 1px 4px;
    }

    /* Smaller buttons */
    .topnav-toggle {
        width: 36px;
        height: 36px;
    }

    .topnav-action-btn {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.875rem;
        border-radius: 0.5rem;
    }

    .topnav-user-avatar {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.65rem;
    }

    .topnav-user-dropdown .topnav-user-toggle {
        padding: 0.25rem;
    }

    /* Mobile menu adjustments */
    .mobile-menu {
        width: 280px;
    }

    .mobile-user-avatar {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .mobile-user-name {
        font-size: 0.9375rem;
    }

    .mobile-nav-item {
        padding: 0.75rem 1rem;
    }

    .mobile-nav-item i {
        width: 22px;
        font-size: 0.9375rem;
    }

    .mobile-nav-item span {
        font-size: 0.875rem;
    }

    /* Floating action button for mobile */
    .mobile-fab {
        display: none;
        position: fixed;
        bottom: 1.5rem;
        right: 1.5rem;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        color: #fff;
        border: none;
        box-shadow: 0 4px 20px rgba(52, 152, 219, 0.4);
        cursor: pointer;
        z-index: 100;
        transition: all 0.3s var(--ease-out);
    }

    .mobile-fab:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 24px rgba(52, 152, 219, 0.5);
    }

    .mobile-fab:active {
        transform: scale(0.95);
    }

    .mobile-fab i {
        font-size: 1.25rem;
    }

    .mobile-fab.show {
        display: flex;
        align-items: center;
        justify-content: center;
        animation: fabPopIn 0.3s var(--ease-bounce);
    }

    @keyframes fabPopIn {
        from {
            opacity: 0;
            transform: scale(0.5) translateY(20px);
        }
        to {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }

    /* Touch-friendly table on mobile - card layout */
    .table-responsive {
        margin: 0;
        overflow-x: visible;
    }

    .data-table {
        border: none;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .data-table tr {
        display: flex;
        flex-direction: column;
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        padding: 1rem;
        gap: 0.5rem;
    }

    .data-table tr:hover {
        background: var(--card-bg);
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.375rem 0;
        border: none;
        white-space: normal;
        font-size: 0.875rem;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        flex-shrink: 0;
        margin-right: 1rem;
    }

    .data-table td:last-child {
        justify-content: flex-end;
        padding-top: 0.75rem;
        margin-top: 0.5rem;
        border-top: 1px solid var(--border-color);
    }

    .data-table td:last-child::before {
        display: none;
    }

    /* Make buttons in table cells full width on mobile */
    .data-table td .btn {
        padding: 0.5rem 0.75rem;
    }

    /* Mobile card improvements */
    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
    }

    /* Pull to refresh indicator */
    .pull-to-refresh {
        position: fixed;
        top: var(--topnav-height);
        left: 50%;
        transform: translateX(-50%) translateY(-100%);
        background: var(--surface);
        padding: 0.5rem 1rem;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        display: flex;
        align-items: center;
        gap: 0.5rem;
        transition: transform 0.3s ease;
        z-index: 90;
    }

    .pull-to-refresh.visible {
        transform: translateX(-50%) translateY(0);
    }

    .pull-to-refresh i {
        animation: spin 1s linear infinite;
    }

    .pull-to-refresh span {
        font-size: 0.75rem;
        color: var(--text-muted);
    }

    /* Dashboard welcome */
    .dashboard-welcome {
        padding: 1.25rem 1rem;
    }

    .dashboard-welcome__icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .dashboard-welcome__title {
        font-size: 1.125rem;
    }

    .dashboard-welcome__subtitle {
        font-size: 0.8125rem;
    }

    .btn-icon-light {
        width: 38px;
        height: 38px;
    }

    /* Dashboard stats */
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    /* Dashboard actions */
    .dashboard-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Tickets stats */
    .stats-grid-tickets {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card-ticket {
        padding: 1rem;
        gap: 0.75rem;
    }

    .stat-card-ticket__icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    .stat-card-ticket__value {
        font-size: 1.5rem;
    }

    .stat-card-ticket__label {
        font-size: 0.75rem;
    }

    .page-header-card {
        padding: 1rem 1.25rem;
    }

    .page-title {
        font-size: 1.125rem;
    }

    /* Page title header */
    .page-title-header {
        flex-direction: column;
    }

    .page-title-header__subtitle {
        padding-left: 0;
    }

    .page-title-header__actions {
        width: 100%;
    }

    .page-title-header__actions .btn {
        flex: 1;
    }

    /* Mini stats grid - 2x2 */
    .stats-grid-mini {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-mini {
        padding: 0.75rem 0.5rem;
    }

    .stat-mini__icon {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .stat-mini__value {
        font-size: 1.25rem;
    }
}

/* ============ EXTRA SMALL MOBILE (480px) ============ */
@media (max-width: 480px) {
    .topnav-container {
        padding: 0 0.5rem;
    }

    .topnav-toggle {
        width: 36px;
        height: 36px;
    }

    .topnav-toggle .hamburger-line {
        width: 18px;
    }

    .topnav-toggle .hamburger-line:nth-child(1) {
        transform: translateY(-5px);
    }

    .topnav-toggle .hamburger-line:nth-child(3) {
        transform: translateY(5px);
    }

    .topnav-menu {
        width: 100%;
        max-width: none;
        border-radius: 0;
    }

    /* Full-screen mobile menu on very small devices */
    .mobile-menu-header {
        padding: 1.25rem;
    }

    .mobile-user-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }

    .mobile-user-name {
        font-size: 0.875rem;
    }

    .mobile-user-role {
        font-size: 0.6875rem;
    }

    .topnav-item {
        padding: 0.6875rem 1rem;
    }

    .topnav-dropdown-item {
        padding: 0.625rem 0.875rem;
    }

    /* Bottom sheet style modal on mobile */
    .modal.mobile-bottom-sheet .modal-content {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        max-height: 90vh;
        margin: 0;
        animation: slideUpModal 0.3s var(--ease-out);
    }

    @keyframes slideUpModal {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    /* Mobile bottom sheet handle */
    .modal.mobile-bottom-sheet .modal-content::before {
        content: '';
        position: absolute;
        top: 0.5rem;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: var(--border);
        border-radius: 2px;
    }

    .modal.mobile-bottom-sheet .modal-header {
        padding-top: 1.5rem;
    }

    /* Swipe indicator */
    .swipe-indicator {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.25rem;
        padding: 0.5rem;
        color: var(--text-muted);
        font-size: 0.625rem;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .swipe-indicator i {
        font-size: 1rem;
        opacity: 0.5;
    }

    /* Filters bar */
    .filters-bar {
        flex-direction: column;
    }

    .filters-bar select.form-control {
        width: 100%;
    }

    .filters-bar .search-input-wrapper {
        width: 100%;
    }
}

/* ============ MOBILE DARK MODE ADJUSTMENTS ============ */
[data-theme="dark"] {
    .topnav-mobile-overlay {
        background: rgba(0, 0, 0, 0.75);
    }

    .topnav-menu {
        background: linear-gradient(180deg, var(--surface) 0%, var(--crust) 100%);
        box-shadow: 4px 0 40px rgba(0, 0, 0, 0.5);
    }

    .mobile-menu-header {
        background: linear-gradient(135deg, var(--primary) 0%, var(--mantle) 100%);
    }

    .mobile-search-input {
        background: var(--mantle);
    }

    .mobile-quick-action {
        background: var(--mantle);
    }

    .mobile-quick-action:hover {
        background: var(--surface-hover);
    }
}

/* ============ TOUCH FEEDBACK ============ */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .topnav-item:hover {
        background: transparent;
        border-left-color: transparent;
    }

    .topnav-item:active {
        background: var(--hover);
        border-left-color: var(--primary);
    }

    .topnav-dropdown-item:hover {
        background: transparent;
    }

    .topnav-dropdown-item:active {
        background: var(--hover);
    }

    /* Active state for touch */
    .mobile-quick-action:active {
        transform: scale(0.95);
        background: var(--primary-glow);
    }

    .mobile-logout-btn:active {
        transform: scale(0.98);
    }

    /* Larger touch targets */
    .topnav-item {
        min-height: 48px;
    }

    .topnav-dropdown-item {
        min-height: 44px;
    }

    button,
    .btn,
    a {
        -webkit-tap-highlight-color: transparent;
    }
}

/* ============ SAFE AREA (NOTCH SUPPORT) ============ */
@supports (padding: env(safe-area-inset-bottom)) {
    .topnav {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .topnav-menu {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-menu-footer {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .mobile-fab {
        bottom: calc(1.5rem + env(safe-area-inset-bottom));
        right: calc(1.5rem + env(safe-area-inset-right));
    }
}

/* ============ LANDSCAPE MOBILE ============ */
@media (max-width: 1024px) and (orientation: landscape) {
    .topnav-menu {
        width: 280px;
    }

    .mobile-menu-header {
        padding: 1rem;
    }

    .mobile-user-avatar {
        width: 40px;
        height: 40px;
    }

    .topnav-item {
        padding: 0.625rem 1rem;
    }

    .topnav-dropdown-item {
        padding: 0.5rem 0.875rem;
    }
}

/* ============ MOBILE SWIPE GESTURES HINTS ============ */
.mobile-swipe-hint {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 60px;
    background: linear-gradient(90deg, var(--primary) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 100;
    border-radius: 0 10px 10px 0;
}

.mobile-swipe-hint.visible {
    opacity: 0.5;
    animation: swipeHintPulse 2s ease-in-out infinite;
}

@keyframes swipeHintPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* ============================================
   TABLE & FORM RESPONSIVE
   ============================================ */

/* Form grid responsive */
@media (max-width: 768px) {
    .form-grid-2,
    .form-grid-3,
    .form-grid-4 {
        grid-template-columns: 1fr;
    }

    .search-input-wrapper input {
        width: 160px;
    }
}

/* Table responsive */
@media (max-width: 768px) {
    .table-premium-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-premium th,
    .table-premium td {
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
    }

    .table-premium th:first-child,
    .table-premium td:first-child {
        padding-left: 1rem;
    }

    .table-premium th:last-child,
    .table-premium td:last-child {
        padding-right: 1rem;
    }
}

/* ============================================
   DASHBOARD RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-actions {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   DATATABLES MOBILE RESPONSIVE
   ============================================ */

/* Mobile responsive DataTables */
@media (max-width: 768px) {
    .dt-layout-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.875rem 1rem;
    }

    .dt-layout-row .dt-search {
        max-width: none;
        order: -1;
    }

    .dt-layout-row .dt-length {
        justify-content: flex-end;
    }

    .dt-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dt-search {
        max-width: none;
        order: -1;
    }

    .dt-length {
        justify-content: flex-end;
    }

    .dt-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    table.dataTable thead th,
    table.dataTable tbody td {
        padding: 0.625rem 0.75rem;
    }

    .dt-pagination .paginate_button {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Make +/- button more prominent on mobile */
    table.dataTable td.dtr-control::before {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
        left: 0.5rem;
    }

    table.dataTable td.dtr-control {
        padding-left: 2.75rem !important;
    }

    /* Expanded details styling for mobile */
    table.dataTable > tbody > tr.child td > ul.dtr-details {
        padding: 0.875rem 1rem;
    }

    table.dataTable > tbody > tr.child ul.dtr-details > li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    table.dataTable > tbody > tr.child ul.dtr-details > li .dtr-title {
        min-width: auto;
    }

    table.dataTable > tbody > tr.child ul.dtr-details > li .dtr-data {
        text-align: left;
        width: 100%;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    table.dataTable thead th,
    table.dataTable tbody td {
        padding: 0.5rem 0.5rem;
        font-size: 0.8125rem;
    }

    table.dataTable thead th:first-child,
    table.dataTable tbody td:first-child {
        padding-left: 0.375rem;
    }

    table.dataTable td.dtr-control {
        padding-left: 2.25rem !important;
    }

    table.dataTable td.dtr-control::before {
        width: 24px;
        height: 24px;
        font-size: 0.6875rem;
        left: 0.375rem;
    }

    .dt-header {
        gap: 0.75rem;
        padding: 0.75rem 0;
    }
}

/* ============================================
   UI/UX AUDIT FIXES - January 2026
   ============================================ */

/* Issue #2: Products Table - Action Buttons Inaccessible on Mobile */
@media (max-width: 768px) {
    #productsTable.table-responsive-cards,
    .products-table-mobile {
        display: block;
    }

    #productsTable.table-responsive-cards thead,
    .products-table-mobile thead {
        display: none;
    }

    #productsTable.table-responsive-cards tbody,
    .products-table-mobile tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    #productsTable.table-responsive-cards tr,
    .products-table-mobile tr {
        display: flex;
        flex-wrap: wrap;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 1rem;
        align-items: center;
    }

    #productsTable.table-responsive-cards td,
    .products-table-mobile td {
        padding: 0.25rem 0;
        border: none;
    }

    /* Product ID */
    #productsTable.table-responsive-cards td:nth-child(1),
    .products-table-mobile td:nth-child(1) {
        order: 1;
        font-size: 0.75rem;
        color: var(--text-muted);
        width: auto;
    }

    /* Product Name */
    #productsTable.table-responsive-cards td:nth-child(2),
    .products-table-mobile td:nth-child(2) {
        order: 2;
        width: calc(100% - 60px);
        font-weight: 600;
        padding-left: 0.5rem;
    }

    /* Category */
    #productsTable.table-responsive-cards td:nth-child(3),
    .products-table-mobile td:nth-child(3) {
        order: 3;
        width: 50%;
        font-size: 0.8125rem;
        color: var(--text-secondary);
    }

    /* Brand */
    #productsTable.table-responsive-cards td:nth-child(4),
    .products-table-mobile td:nth-child(4) {
        order: 4;
        width: 50%;
        font-size: 0.8125rem;
        color: var(--text-secondary);
        text-align: right;
    }

    /* Status */
    #productsTable.table-responsive-cards td:nth-child(5),
    .products-table-mobile td:nth-child(5) {
        order: 5;
        width: 100%;
        margin-top: 0.5rem;
    }

    /* Actions */
    #productsTable.table-responsive-cards td.table-actions,
    .products-table-mobile td.table-actions,
    #productsTable.table-responsive-cards td:last-child,
    .products-table-mobile td:last-child {
        order: 10;
        width: 100%;
        display: flex;
        justify-content: flex-end;
        gap: 0.5rem;
        padding-top: 0.75rem;
        margin-top: 0.5rem;
        border-top: 1px solid var(--border);
    }
}

/* Issue #6: Mobile View - Statistics Cards Missing Labels */
@media (max-width: 640px) {
    .stat-card-ticket__label,
    .stat-card__label,
    .stat-mini__label,
    .stat-card .stat-label,
    .stat-tile .stat-label {
        display: block !important;
        font-size: 0.6875rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Ensure icon + value + label all visible */
    .stat-card-ticket {
        flex-direction: row;
        align-items: center;
    }

    .stat-card-ticket__content {
        display: flex;
        flex-direction: column;
    }

    /* Stat cards in 2-column grid on small mobile */
    .stats-grid-tickets,
    .stats-grid-mini {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-card-ticket,
    .stat-mini {
        padding: 0.75rem;
    }

    .stat-card-ticket__icon,
    .stat-mini__icon {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }

    .stat-card-ticket__value,
    .stat-mini__value {
        font-size: 1.25rem;
    }
}

/* Issue #7: Settings Page - Tabs Cut Off on Mobile */
@media (max-width: 768px) {
    .config-editor-tabs,
    .config-tabs,
    .product-config-tabs {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 0.25rem;
        padding-bottom: 0.5rem;
        flex-wrap: nowrap;
    }

    .config-editor-tabs::-webkit-scrollbar,
    .config-tabs::-webkit-scrollbar,
    .product-config-tabs::-webkit-scrollbar {
        display: none;
    }

    .config-tab,
    .config-editor-tabs .tab,
    .product-config-tabs .tab {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    /* Hide tab text on very small screens, show icon only */
    @media (max-width: 480px) {
        .config-tab span,
        .config-editor-tabs .tab span:not(.tab-badge) {
            display: none;
        }

        .config-tab i,
        .config-editor-tabs .tab i {
            margin-right: 0;
        }
    }
}

/* Issue #8: Mobile View - Form Fields Side-by-Side Layout */
@media (max-width: 640px) {
    .form-row,
    .form-grid,
    .form-grid-2,
    .form-grid-3,
    .form-grid-4,
    .modal-form-row,
    .browser-section .form-row {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .form-group {
        width: 100% !important;
    }
}

/* Issue #9: Customers Page - Header Card Layout Broken on Mobile */
@media (max-width: 768px) {
    .page-header-banner,
    .page-header-card {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .page-header-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .page-header-icon {
        margin: 0 auto;
    }

    .page-header-actions,
    .page-title-header__actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .page-header-actions .btn,
    .page-title-header__actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Fix breadcrumb header on mobile */
    .breadcrumb-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .breadcrumb-header__actions {
        width: 100%;
    }

    .breadcrumb-header__actions .btn {
        width: 100%;
    }
}

/* Issue #10: Mobile Dashboard - "System Status" Badge Cut Off */
@media (max-width: 640px) {
    .badge,
    .status-badge {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card-header .badge,
    .card-header .status-badge {
        flex-shrink: 1;
        min-width: 0;
    }

    /* Dashboard welcome card */
    .dashboard-welcome {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .dashboard-welcome__icon {
        margin: 0 auto;
    }

    .dashboard-welcome__actions {
        width: 100%;
        justify-content: center;
    }
}
