/* =================================
   Variables & Reset
   ================================= */
:root {
    /* Palette principale simplifiée (3-5 couleurs) */
    --primary: #6366f1;          /* Violet - Action principale */
    --primary-hover: #4f46e5;    /* Violet foncé - Hover */
    --success: #22c55e;          /* Vert - Validation/Succès */
    --warning: #f97316;          /* Orange - Avertissement */
    --danger: #ef4444;           /* Rouge - Danger/Suppression */

    /* Gris simplifiés (réduit à l'essentiel) */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --white: #ffffff;

    /* Aliases sémantiques pour faciliter l'usage */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --border-color: var(--gray-200);
    --bg-base: var(--white);
    --bg-subtle: var(--gray-50);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.08);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =================================
   Typography
   ================================= */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.2;
    margin-bottom: 0.65rem;
}

h1 { font-size: 1.7rem; font-weight: 700; }   /* 27px (~30px -10%) */
h2 { font-size: 1.35rem; font-weight: 600; }  /* 21.6px (~24px -10%) */
h3 { font-size: 1.125rem; }                   /* 18px (~20px -10%) */
h4 { font-size: 1rem; }                       /* 16px (~18px -10%) */
h5 { font-size: 0.9rem; }                     /* 14.4px (~16px -10%) */

.lead {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--gray-600);
}

/* =================================
   Sidebar Navigation
   ================================= */
body.has-sidebar {
    margin: 0;
    padding: 0;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 220px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    overflow: visible;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    padding: 1.1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--gray-900);
    font-size: 1.25rem;
    font-weight: 700;
    transition: all 0.3s;
}

.sidebar-brand svg {
    min-width: 24px;
}

.sidebar-brand-text {
    white-space: nowrap;
    transition: opacity 0.3s;
}

.sidebar.collapsed .sidebar-brand-text {
    opacity: 0;
    width: 0;
}

.sidebar-toggle-btn {
    position: absolute;
    right: -13px;
    top: 27px;
    background: var(--white);
    border: 2px solid var(--gray-200);
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    box-shadow: var(--shadow);
    z-index: 1001;
}

.sidebar-toggle-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.sidebar-toggle-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.sidebar-toggle-btn svg {
    pointer-events: none;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    position: relative;
}

.sidebar-link:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.sidebar-link.active {
    background: var(--gray-50);
    color: var(--primary);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

.sidebar-link svg {
    min-width: 20px;
}

.sidebar-link span {
    white-space: nowrap;
    transition: opacity 0.3s;
}

.sidebar.collapsed .sidebar-link span {
    opacity: 0;
    width: 0;
}

/* Trial badge for modules in trial period */
.trial-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--warning);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-left: auto;
    white-space: nowrap;
    min-width: 28px;
}

.sidebar.collapsed .trial-badge {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-link.admin-link {
    background: var(--warning);
    color: var(--white);
    margin: 0.5rem 1rem;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
}

.sidebar-link.admin-link:hover {
    background: #ea580c;
}

.sidebar-footer {
    border-top: 1px solid var(--gray-200);
    padding: 1rem 0;
    overflow: hidden;
}

.sidebar-user {
    padding: 0.75rem 1.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-user-info {
    transition: opacity 0.3s;
}

.sidebar.collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-900);
    white-space: nowrap;
}

.sidebar-user-plan {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.main-content {
    margin-left: 220px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed + .main-content {
    margin-left: 60px;
}

.content-wrapper {
    flex: 1;
    padding: 1.125rem 1.35rem;
    max-width: 100%;
    width: 100%;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-220px);
    }

    .sidebar.collapsed {
        transform: translateX(-60px);
    }

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

/* =================================
   Container & Layout
   ================================= */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.35rem;
}

.container-wide {
    max-width: 1150px;
}

.container-narrow {
    max-width: 680px;
}

main {
    min-height: calc(100vh - 140px);
    padding: 1.75rem 0;
}

body:not(.has-sidebar) main {
    padding: 1.75rem 0;
}

/* =================================
   Buttons
   ================================= */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: 2px solid var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: var(--white);
    border: 2px solid var(--success);
}

.btn-success:hover:not(:disabled) {
    background: #059669;
    border-color: #059669;
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
    border: 2px solid var(--warning);
}

.btn-warning:hover:not(:disabled) {
    background: #ea580c;
    border-color: #ea580c;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border: 2px solid var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-sm {
    padding: 0.4rem 0.875rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* =================================
   Cards
   ================================= */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 1.125rem 1.35rem;
}

.card-clickable {
    transition: all 0.3s;
}

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

.card-header {
    padding: 1.125rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.card-body {
    padding: 1.125rem;
}

.card-footer {
    padding: 1.125rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* =================================
   Forms
   ================================= */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* =================================
   Alerts
   ================================= */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border-left: 4px solid;
    /*display: flex;*/
    align-items: start;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: #065f46;
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    color: #3730a3;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: #92400e;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: #991b1b;
}

/* =================================
   Tables
   ================================= */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

thead {
    background: var(--gray-50);
}

th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

tbody tr:hover {
    background: var(--gray-50);
}

/* =================================
   Badges
   ================================= */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary { background: var(--primary); color: var(--white); }
.badge-success { background: var(--success); color: var(--white); }
.badge-warning { background: var(--warning); color: var(--white); }
.badge-danger { background: var(--danger); color: var(--white); }
.badge-secondary { background: var(--gray-200); color: var(--gray-700); }

/* =================================
   Grid System
   ================================= */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -1rem;
}

[class*="col-"] {
    padding: 0 1rem;
    margin-bottom: 2rem;
}

.col-md-3 { width: 25%; }
.col-md-4 { width: 33.333%; }
.col-md-6 { width: 50%; }
.col-md-8 { width: 66.666%; }
.col-md-12 { width: 100%; }

@media (max-width: 768px) {
    [class*="col-"] { width: 100%; }
}

/* =================================
   Utilities
   ================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* =================================
   Footer
   ================================= */
footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-text {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* =================================
   Animations
   ================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* =================================
   Model Cards (Specific)
   ================================= */
.model-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--gray-200);
}

.model-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.model-preview {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.model-preview.facture {
    background: var(--primary);
}

.model-preview.devis {
    background: var(--warning);
}

.model-preview.contrat {
    background: var(--success);
}

.model-preview-icon {
    font-size: 4rem;
    z-index: 2;
}

.model-type-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--gray-700);
}

.premium-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 3;
}

/* =================================
   Stats Cards
   ================================= */
.stats-card {
    background: var(--white);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.stats-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.stats-card h5 {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-card .display-4 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

/* =================================
   RESPONSIVE DESIGN
   ================================= */

/* Desktop 24" et plus (> 1440px) - Tailles confortables */
@media (min-width: 1441px) {
    /* Augmentation pour grands écrans */
    body {
        font-size: 15px;
    }

    h1 { font-size: 2rem; }      /* 32px */
    h2 { font-size: 1.625rem; }  /* 26px */
    h3 { font-size: 1.375rem; }  /* 22px */
    h4 { font-size: 1.125rem; }  /* 18px */
    h5 { font-size: 1rem; }      /* 16px */

    .sidebar {
        width: 250px;
    }

    .sidebar.collapsed {
        width: 70px;
    }

    .main-content {
        margin-left: 250px;
    }

    .sidebar.collapsed + .main-content {
        margin-left: 70px;
    }

    .container {
        max-width: 1200px;
        padding: 2rem;
    }

    .container-wide {
        max-width: 1400px;
    }

    .content-wrapper {
        padding: 1.5rem 2rem;
    }

    main {
        padding: 2.5rem 0;
    }

    .card {
        padding: 1.5rem 2rem;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding: 1.5rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .form-control, .form-select {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
}

/* 13" Display Optimization (1280px - 1440px) - Compact */
@media (min-width: 1280px) and (max-width: 1440px) {
    /* Les valeurs par défaut sont déjà optimisées pour 13" */
    /* Aucun ajustement supplémentaire nécessaire */
}

/* Tablets and below (< 992px) */
@media (max-width: 991.98px) {
    /* Typography adjustments */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    
    .lead { font-size: 1rem; }
    
    /* Page header responsive */
    .page-header {
        padding: 1.5rem 1rem;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    /* Sidebar becomes overlay on mobile/tablet */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    /* Main content full width on mobile */
    .main-content {
        margin-left: 0 !important;
        padding: 1rem;
    }
    
    body.has-sidebar .main-content {
        margin-left: 0 !important;
    }
    
    /* Cards grid responsive */
    .card-grid,
    .stats-grid,
    .model-selection {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* Table responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 800px;
    }
    
    /* Button groups stack vertically */
    .btn-group {
        flex-direction: column !important;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* Form grids to single column */
    .form-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile only (< 768px) */
@media (max-width: 767.98px) {
    /* Even smaller typography */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.35rem; }
    
    /* Hide sidebar by default on mobile */
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    /* Mobile menu toggle button */
    .mobile-menu-toggle {
        display: block !important;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-md);
        padding: 0.75rem;
        cursor: pointer;
        box-shadow: var(--shadow-md);
    }
    
    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Main content padding */
    .main-content {
        padding: 0.75rem;
        padding-top: 4rem; /* Space for mobile menu toggle */
    }
    
    /* Cards full width */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Stats cards single column */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Page header actions stack */
    .page-header > div {
        flex-direction: column !important;
        gap: 1rem;
        align-items: flex-start !important;
    }
    
    .page-header .btn-group {
        width: 100%;
    }
    
    /* Table to cards on mobile */
    .table-mobile-cards {
        display: block;
    }
    
    .table-mobile-cards thead {
        display: none;
    }
    
    .table-mobile-cards tbody,
    .table-mobile-cards tr {
        display: block;
        width: 100%;
    }
    
    .table-mobile-cards tr {
        background: var(--white);
        border-radius: var(--radius-md);
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: var(--shadow);
    }
    
    .table-mobile-cards td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid var(--gray-100);
    }
    
    .table-mobile-cards td:last-child {
        border-bottom: none;
    }
    
    .table-mobile-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--gray-700);
        margin-right: 1rem;
    }
    
    /* Modal full screen on mobile */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }
    
    .modal-content {
        border-radius: 0;
        height: 100%;
    }
    
    /* Filters collapse on mobile */
    .filters-card .filters-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Small mobile (< 576px) */
@media (max-width: 575.98px) {
    /* Typography */
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 1.35rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
    
    /* Buttons smaller */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Form controls */
    .form-control {
        font-size: 14px;
        padding: 0.6rem 0.75rem;
    }
    
    /* Cards */
    .card {
        padding: 1rem;
    }
    
    /* Spacing adjustments */
    .mb-4 { margin-bottom: 1.5rem !important; }
    .mt-4 { margin-top: 1.5rem !important; }
    .p-4 { padding: 1rem !important; }
}

/* Landscape mobile */
@media (max-width: 767.98px) and (orientation: landscape) {
    .sidebar {
        width: 240px;
    }
}

/* Tablet specific (768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Sidebar can be visible but narrower */
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
        padding: 1.25rem;
    }

    /* Grid 2 columns */
    .card-grid,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Model selection 2 columns */
    .model-selection {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Desktop (> 1200px) */
@media (min-width: 1200px) {
    /* Wider content on large screens */
    .container-fluid {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    /* Model selection 4 columns */
    .model-selection {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Stats grid 4-5 columns */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* Print styles */
@media print {
    .sidebar,
    .mobile-menu-toggle,
    .btn,
    .sidebar-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .page-header {
        border-bottom: 2px solid #000;
        margin-bottom: 1rem;
    }
}

/* 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;
    }
}
