/* Manson Chua Motor Parts - Main Stylesheet */

:root {
    --primary-red: #dc2626;
    --primary-dark: #000000;
    --primary-white: #ffffff;
    --secondary-gray: #6b7280;
    --light-gray: #f3f4f6;
    --dark-gray: #1f2937;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--primary-dark);
}

body.dark-mode {
    background-color: var(--dark-gray);
    color: var(--primary-white);
}

html.dark body {
    background-color: var(--dark-gray);
    color: var(--primary-white);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: var(--dark-gray);
}

html.dark ::-webkit-scrollbar-track {
    background: var(--dark-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #991b1b;
}

/* Loading Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    background-color: #10b981;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

.toast.error {
    background-color: var(--primary-red);
}

.toast.warning {
    background-color: #f59e0b;
}

.toast.info {
    background-color: #3b82f6;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
    }
    to {
        transform: translateX(0);
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    width: 500px;
    animation: slideDown 0.3s ease-out;
}

body.dark-mode .modal-content {
    background-color: #1f2937;
    color: white;
}

html.dark .modal-content {
    background-color: #1f2937;
    color: white;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-white);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea,
body.dark-mode .form-group select {
    background-color: #374151;
    color: white;
    border-color: #4b5563;
}

html.dark .form-group input,
html.dark .form-group textarea,
html.dark .form-group select {
    background-color: #374151;
    color: white;
    border-color: #4b5563;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-red);
    color: white;
}

.btn-primary:hover {
    background-color: #991b1b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-secondary {
    background-color: var(--light-gray);
    color: var(--primary-dark);
    border: 2px solid #d1d5db;
}

.btn-secondary:hover {
    background-color: #f3f4f6;
    border-color: var(--primary-red);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-large {
    padding: 12px 24px;
    font-size: 18px;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.table thead {
    background-color: var(--light-gray);
    color: var(--primary-dark);
}

body.dark-mode .table thead {
    background-color: #374151;
    color: var(--primary-white);
}

html.dark .table thead {
    background-color: #374151;
    color: var(--primary-white);
}

.table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
}

body.dark-mode .table th {
    border-bottom-color: #4b5563;
}

html.dark .table th {
    border-bottom-color: #4b5563;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

body.dark-mode .table td {
    border-bottom-color: #4b5563;
}

html.dark .table td {
    border-bottom-color: #4b5563;
}

.table tbody tr:hover {
    background-color: var(--light-gray);
}

body.dark-mode .table tbody tr:hover {
    background-color: #374151;
}

html.dark .table tbody tr:hover {
    background-color: #374151;
}

/* Card Styles */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 16px;
}

body.dark-mode .card {
    background-color: #1f2937;
    color: white;
}

html.dark .card {
    background-color: #1f2937;
    color: white;
}

.card-header {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    font-size: 14px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-red) 0%, #991b1b 100%);
    color: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
}

.stat-card .change {
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.8;
}

/* ================================================================
   LEGACY .sidebar (kept for backward compat – pages still using it)
   ================================================================ */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 2px solid var(--primary-red);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo {
    width: 40px;
    height: 40px;
    background-color: var(--primary-red);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover {
    background-color: rgba(255,255,255,.06);
    color: var(--primary-red);
    border-left-color: var(--primary-red);
}

.sidebar-menu a.active {
    background-color: rgba(220,38,38,.15);
    color: var(--primary-red);
    border-left-color: var(--primary-red);
}

/* Main Content Area */
.main-content {
    margin-left: 260px;
    padding: 24px;
    min-height: 100vh;
}

/* ================================================================
   NEW  .admin-sidebar  –  the fully-fixed, persistent sidebar
   ================================================================ */

/* ── CSS custom properties ── */
:root {
    --sb-width:        260px;
    --sb-bg-top:       #0f172a;
    --sb-bg-mid:       #1e293b;
    --sb-accent:       #dc2626;
    --sb-accent-hover: #991b1b;
    --sb-text:         #94a3b8;
    --sb-text-active:  #ffffff;
    --sb-section:      #475569;
    --sb-active-bg:    rgba(220, 38, 38, 0.18);
    --sb-hover-bg:     rgba(255, 255, 255, 0.06);
    --sb-radius:       10px;
    --sb-transition:   0.25s cubic-bezier(.4,0,.2,1);
    --nav-height:      64px;
}

/* ── Top nav sits above everything ── */
nav.fixed {
    z-index: 300 !important;
}

/* ── The sidebar itself ── */
.admin-sidebar {
    position: fixed;
    top: var(--nav-height);   /* starts BELOW the fixed nav */
    left: 0;
    width: var(--sb-width);
    height: calc(100vh - var(--nav-height));
    background: linear-gradient(180deg, var(--sb-bg-top) 0%, var(--sb-bg-mid) 55%, var(--sb-bg-top) 100%);
    display: flex;
    flex-direction: column;
    z-index: 200;             /* below nav (300) */
    overflow: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45);
    transition: transform var(--sb-transition);
    will-change: transform;
}

/* ── Brand header inside sidebar ── */
.admin-sidebar-brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 16px;
    border-bottom: 2px solid var(--sb-accent);
    background: rgba(0,0,0,.25);
}

.admin-sidebar-logo {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: var(--sb-accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 2px 10px rgba(220,38,38,.45);
}

.admin-sidebar-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .3px;
    white-space: nowrap;
    flex: 1;
}

.admin-sidebar-close {
    background: transparent;
    border: none;
    color: var(--sb-text);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color var(--sb-transition), background var(--sb-transition);
    display: none;
}

.admin-sidebar-close:hover {
    color: var(--sb-accent);
    background: var(--sb-hover-bg);
}

/* ── Scrollable nav ── */
.admin-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(220,38,38,.4) transparent;
}

.admin-sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.admin-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(220,38,38,.4);
    border-radius: 4px;
}

/* ── Section label ── */
.admin-nav-section {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--sb-section);
    padding: 18px 8px 6px;
    margin: 0;
    user-select: none;
}

.admin-nav-section:first-child {
    padding-top: 4px;
}

/* ── Nav links ── */
.admin-nav-item,
.admin-nav-active {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--sb-radius);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition:
        background var(--sb-transition),
        color     var(--sb-transition),
        transform var(--sb-transition),
        box-shadow var(--sb-transition);
    position: relative;
    overflow: hidden;
    margin-bottom: 2px;
    border-left: 3px solid transparent;
}

.admin-nav-item {
    color: var(--sb-text);
    background: transparent;
}

.admin-nav-item:hover {
    color: var(--sb-text-active);
    background: var(--sb-hover-bg);
    border-left-color: rgba(220,38,38,.5);
    transform: translateX(3px);
}

.admin-nav-item:hover .admin-nav-icon {
    color: var(--sb-accent);
    transform: scale(1.15);
}

.admin-nav-active {
    color: var(--sb-text-active);
    background: var(--sb-active-bg);
    border-left-color: var(--sb-accent);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(220,38,38,.2);
}

.admin-nav-active .admin-nav-icon {
    color: var(--sb-accent);
}

/* Ripple-style hover highlight */
.admin-nav-item::before,
.admin-nav-active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--sb-radius);
    background: radial-gradient(circle at left center, rgba(220,38,38,.12) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--sb-transition);
    pointer-events: none;
}

.admin-nav-item:hover::before {
    opacity: 1;
}

/* ── Icon ── */
.admin-nav-icon {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
    color: var(--sb-text);
    transition: color var(--sb-transition), transform var(--sb-transition);
}

/* ── Footer ── */
.admin-sidebar-footer {
    flex-shrink: 0;
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,.07);
    background: rgba(0,0,0,.2);
}

.admin-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

/* ── Overlay (mobile) ── */
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 190;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity var(--sb-transition);
}

.admin-sidebar-overlay.is-visible {
    display: block;
    opacity: 1;
}

/* ── Mobile: sidebar hidden by default, slides in ── */
@media (max-width: 767px) {
    .admin-sidebar {
        transform: translateX(-100%);
        top: var(--nav-height);
        height: calc(100vh - var(--nav-height));
    }

    .admin-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0,0,0,.6);
    }

    .admin-sidebar-close {
        display: flex;
    }

    /* Main content takes full width on mobile */
    .admin-main-content {
        margin-left: 0 !important;
    }
}

/* ── Desktop: always visible ── */
@media (min-width: 768px) {
    .admin-sidebar {
        transform: translateX(0) !important;
    }

    .admin-sidebar-overlay {
        display: none !important;
    }
}

/* ── Main content offset: clears sidebar (left) and nav (top) ── */
.admin-main-content {
    margin-left: var(--sb-width);
    margin-top: var(--nav-height);  /* pushes content below fixed nav */
    min-height: calc(100vh - var(--nav-height));
    transition: margin-left var(--sb-transition);
}

body {
    padding-top: 0;
    overflow-x: hidden;
}

/* ================================================================
   Responsive (legacy)
   ================================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        width: 80%;
        max-width: 260px;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
    }
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #0c2d6b;
}

body.dark-mode .badge-success {
    background-color: #1a4d3e;
    color: #86efac;
}

html.dark .badge-success {
    background-color: #1a4d3e;
    color: #86efac;
}

body.dark-mode .badge-warning {
    background-color: #4d3a1a;
    color: #fbbf24;
}

html.dark .badge-warning {
    background-color: #4d3a1a;
    color: #fbbf24;
}

body.dark-mode .badge-danger {
    background-color: #4d1a1a;
    color: #fca5a5;
}

html.dark .badge-danger {
    background-color: #4d1a1a;
    color: #fca5a5;
}

body.dark-mode .badge-info {
    background-color: #1a3a4d;
    color: #93c5fd;
}

html.dark .badge-info {
    background-color: #1a3a4d;
    color: #93c5fd;
}

/* Alert Styles */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border-left: 4px solid #16a34a;
}

.alert-warning {
    background-color: #fef08a;
    color: #854d0e;
    border-left: 4px solid #eab308;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-info {
    background-color: #dbeafe;
    color: #0c2d6b;
    border-left: 4px solid #3b82f6;
}

body.dark-mode .alert {
    border-left-width: 4px;
}

html.dark .alert {
    border-left-width: 4px;
}

/* Search Input */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 36px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

/* Filter Tags */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background-color: #e5e7eb;
    color: #111827;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

body.dark-mode .filter-tag {
    background-color: #374151;
    color: #e5e7eb;
}

html.dark .filter-tag {
    background-color: #374151;
    color: #e5e7eb;
}

.filter-tag:hover {
    background-color: var(--primary-red);
    color: white;
}

.filter-tag .remove {
    cursor: pointer;
    font-size: 12px;
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination button,
.pagination a {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: var(--primary-dark);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

body.dark-mode .pagination button,
body.dark-mode .pagination a {
    background-color: #374151;
    border-color: #4b5563;
    color: white;
}

html.dark .pagination button,
html.dark .pagination a {
    background-color: #374151;
    border-color: #4b5563;
    color: white;
}

.pagination button.active,
.pagination a.active {
    background-color: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

.pagination button:hover,
.pagination a:hover {
    background-color: var(--light-gray);
    border-color: var(--primary-red);
}

body.dark-mode .pagination button:hover,
body.dark-mode .pagination a:hover {
    background-color: #4b5563;
    border-color: var(--primary-red);
}

html.dark .pagination button:hover,
html.dark .pagination a:hover {
    background-color: #4b5563;
    border-color: var(--primary-red);
}

.floating-back-btn {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 9999px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.floating-back-btn:hover {
    transform: translateY(-1px);
    background-color: #f9fafb;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

html.dark .floating-back-btn,
body.dark-mode .floating-back-btn {
    background-color: #111827;
    border-color: #374151;
    color: #f9fafb;
}

html.dark .floating-back-btn:hover,
body.dark-mode .floating-back-btn:hover {
    background-color: #1f2937;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 24px;
}

@media (max-width: 640px) {
    .chart-container {
        height: 200px;
    }
}

/* ============================================
   ENHANCED RESPONSIVE STYLES
   ============================================ */

/* Mobile-First Responsive Tables */
@media (max-width: 768px) {
    /* Stack tables on mobile */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 600px;
    }
    
    /* Card-style tables for mobile */
    .table-mobile-cards thead {
        display: none;
    }
    
    .table-mobile-cards tbody tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 12px;
        background: white;
    }
    
    .table-mobile-cards td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .table-mobile-cards td:last-child {
        border-bottom: none;
    }
    
    .table-mobile-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for mobile */
    .btn, .admin-nav-item, .admin-nav-active {
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .pagination button,
    .pagination a {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Remove hover effects on touch devices */
    .admin-nav-item:hover {
        transform: none;
    }
}

/* Small mobile screens */
@media (max-width: 480px) {
    .stat-card h3 {
        font-size: 12px;
    }
    
    .stat-card .text-3xl, .stat-card .text-4xl {
        font-size: 1.5rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .card {
        padding: 16px;
    }
    
    .card-header {
        font-size: 16px;
    }
    
    /* Smaller padding for mobile nav */
    .admin-sidebar-nav {
        padding: 12px 8px;
    }
    
    .admin-nav-item,
    .admin-nav-active {
        padding: 12px 10px;
        font-size: 13px;
    }
}

/* Landscape mobile optimization */
@media (max-width: 896px) and (orientation: landscape) {
    .admin-sidebar {
        width: 220px;
    }
    
    .admin-main-content {
        margin-left: 220px;
    }
}

/* Large tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .admin-sidebar {
        width: 240px;
    }
    
    .admin-main-content {
        margin-left: 240px;
    }
}

/* High DPI / Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .admin-sidebar-logo,
    .btn,
    .card {
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .admin-sidebar {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .admin-sidebar,
    .admin-sidebar-overlay,
    .no-print,
    .btn-print,
    .floating-back-btn {
        display: none !important;
    }

    .main-content,
    .admin-main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    body {
        background-color: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        break-inside: avoid;
    }
}
