/**
 * QR Menu Admin Panel - Custom Styles
 * 
 * Modern dark theme with glassmorphism effects
 */

/* ================================================
   CSS CUSTOM PROPERTIES (Variables)
================================================ */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --border-color: #334155;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --sidebar-width: 260px;
    --header-height: 60px;

    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --transition: all 0.3s ease;
}

/* ================================================
   BASE & RESET
================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ================================================
   SCROLLBAR
================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ================================================
   LOGIN PAGE
================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.login-bg .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 15s ease-in-out infinite;
}

.login-bg .shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -10%;
    right: -10%;
}

.login-bg .shape-2 {
    width: 350px;
    height: 350px;
    background: var(--secondary);
    bottom: -15%;
    left: -10%;
    animation-delay: -5s;
}

.login-bg .shape-3 {
    width: 300px;
    height: 300px;
    background: var(--info);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.1);
    }

    50% {
        transform: translate(0, 20px) scale(0.9);
    }

    75% {
        transform: translate(-30px, -10px) scale(1.05);
    }
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2.5rem;
    color: white;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-header p {
    font-size: 0.875rem;
}

.login-form .form-floating>label {
    color: var(--text-muted);
}

.login-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.login-form .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    transition: var(--transition);
}

.login-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ================================================
   APP WRAPPER & LAYOUT
================================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ================================================
   SIDEBAR
================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    margin: 0.25rem 0.75rem;
    border-radius: 10px;
}

.sidebar-nav .nav-link i {
    font-size: 1.25rem;
}

.sidebar-nav .nav-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    font-size: 2rem;
    color: var(--text-muted);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* ================================================
   MOBILE HEADER
================================================ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: 999;
    padding: 0 1rem;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-toggle {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.mobile-brand {
    font-weight: 600;
}

/* ================================================
   MAIN CONTENT
================================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

.content-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ================================================
   STAT CARDS
================================================ */
.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.gradient-purple .stat-icon {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.gradient-blue .stat-icon {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.gradient-green .stat-icon {
    background: linear-gradient(135deg, #10b981, #14b8a6);
}

.gradient-teal .stat-icon {
    background: linear-gradient(135deg, #14b8a6, #06b6d4);
}

.gradient-warning .stat-icon {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

.gradient-danger .stat-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* ================================================
   CARDS
================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.card-title {
    color: var(--text-primary);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* ================================================
   TABLES
================================================ */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-color);
}

.table thead th {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: none;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* DataTables Overrides */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding-top: 1rem;
    color: var(--text-muted);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-secondary) !important;
    border: 1px solid transparent;
    border-radius: 6px;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    color: var(--primary) !important;
    border-color: transparent;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    color: white !important;
    border-color: transparent;
}

/* ================================================
   PRODUCT THUMBNAILS
================================================ */
.product-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.product-thumbnail-placeholder {
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* ================================================
   MODALS
================================================ */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* ================================================
   FORMS
================================================ */
.form-control,
.form-select {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-dark);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-text {
    color: var(--text-muted);
}

.form-control-color {
    width: 50px;
    padding: 0.25rem;
}

.color-text {
    max-width: 100px;
}

/* ================================================
   BUTTONS
================================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    border-radius: 10px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #db2777);
    transform: translateY(-1px);
}

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

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

.btn-outline-danger {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-group-sm .btn {
    padding: 0.375rem 0.625rem;
}

/* ================================================
   BADGES
================================================ */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* ================================================
   ALERTS
================================================ */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

/* ================================================
   SETTINGS PAGE
================================================ */
.theme-preview {
    margin-top: 1rem;
}

.preview-card {
    background: var(--bg-dark);
    border-radius: 12px;
    overflow: hidden;
    max-width: 250px;
}

.preview-header {
    padding: 1rem;
    color: white;
    font-weight: 600;
    text-align: center;
}

.preview-body {
    padding: 1rem;
}

.preview-item {
    background: var(--bg-card);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.preview-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: white;
    font-size: 0.875rem;
    text-align: center;
}

/* ================================================
   ERROR PAGE
================================================ */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.error-code {
    font-size: 8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.error-message {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.error-description {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

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

    .main-content {
        margin-left: 0;
        padding-top: calc(var(--header-height) + 1.5rem);
    }

    .mobile-header {
        display: flex;
    }
}

@media (max-width: 575.98px) {
    .main-content {
        padding: 1rem;
        padding-top: calc(var(--header-height) + 1rem);
    }

    .login-card {
        padding: 2rem 1.5rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

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

/* ================================================
   OFFCANVAS
================================================ */
.offcanvas {
    background: var(--bg-card);
}

.offcanvas-header {
    border-bottom: 1px solid var(--border-color);
}

.offcanvas .nav-link {
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
}

.offcanvas .nav-link:hover,
.offcanvas .nav-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.offcanvas .nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.stat-card {
    animation: fadeIn 0.4s ease-out;
}

/* ================================================
   MOBILE-FIRST RESPONSIVE OVERHAUL
   ULTRATHINK: Complete mobile experience redesign
================================================ */

/* Tablet Breakpoint */
@media (max-width: 768px) {

    /* Page Headers */
    .page-title {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.8rem;
    }

    /* Content Header with Action Button */
    .content-header {
        margin-bottom: 1.5rem;
    }

    .content-header .d-flex {
        flex-direction: column;
        gap: 1rem;
    }

    .content-header .btn {
        width: 100%;
    }

    /* Cards */
    .card {
        border-radius: 12px;
    }

    .card-header {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Chart Container - Make more readable */
    .card canvas {
        max-height: 250px !important;
    }

    /* Quick Actions - Stack buttons */
    .card-body .d-flex.flex-wrap {
        flex-direction: column;
    }

    .card-body .d-flex.flex-wrap .btn {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
}

/* Mobile Breakpoint - Full Optimization */
@media (max-width: 576px) {

    /* Root Overrides */
    :root {
        --header-height: 56px;
    }

    /* Mobile Header Enhancement */
    .mobile-header {
        padding: 0 0.75rem;
        justify-content: space-between;
    }

    .mobile-brand {
        font-size: 1rem;
    }

    .sidebar-toggle {
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Offcanvas Improvements */
    .offcanvas {
        width: 280px !important;
    }

    .offcanvas-header {
        padding: 1rem;
    }

    .offcanvas .btn-close {
        width: 44px;
        height: 44px;
        padding: 0;
    }

    .offcanvas .nav-link {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    /* Main Content */
    .main-content {
        padding: 0.75rem;
        padding-top: calc(var(--header-height) + 0.75rem);
    }

    /* Stat Cards - More compact */
    .stat-card {
        padding: 0.875rem;
        border-radius: 12px;
        gap: 0.75rem;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        border-radius: 10px;
        font-size: 1.1rem;
    }

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

    .stat-label {
        font-size: 0.75rem;
    }

    /* ================================================
       MOBILE TABLE -> CARD TRANSFORMATION
       Critical for usability on small screens
    ================================================ */

    /* Hide traditional table structure on mobile */
    .table-responsive {
        border: none;
        overflow: visible;
    }

    .table thead {
        display: none;
    }

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

    .table tbody tr {
        display: flex;
        flex-wrap: wrap;
        background: var(--bg-dark);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 1rem;
        gap: 0.5rem;
    }

    .table tbody tr:hover {
        background: rgba(99, 102, 241, 0.08);
    }

    .table tbody td {
        display: flex;
        align-items: center;
        padding: 0.25rem 0;
        border: none;
        flex-basis: 100%;
    }

    /* Label for each cell - show column name */
    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        min-width: 80px;
        margin-right: 0.5rem;
    }

    /* Specific column styling */
    .table tbody td:first-child {
        font-weight: 600;
        color: var(--text-primary);
        font-size: 1rem;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .table tbody td:first-child::before {
        display: none;
    }

    /* Actions column - Full width buttons */
    .table tbody td:last-child {
        justify-content: flex-end;
        gap: 0.5rem;
        padding-top: 0.75rem;
        margin-top: 0.5rem;
        border-top: 1px solid var(--border-color);
    }

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

    /* Action Buttons - Larger touch targets */
    .btn-group-sm .btn,
    .table .btn-sm {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        min-width: 44px;
        min-height: 44px;
    }

    /* Product thumbnail in card layout */
    .product-thumbnail,
    .product-thumbnail-placeholder {
        width: 60px;
        height: 60px;
        border-radius: 10px;
    }

    /* ================================================
       DATATABLES MOBILE OVERRIDES
    ================================================ */

    .dataTables_wrapper {
        padding: 0;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: left;
        margin-bottom: 1rem;
    }

    .dataTables_wrapper .dataTables_length label,
    .dataTables_wrapper .dataTables_filter label {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .dataTables_wrapper .dataTables_length select,
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin: 0;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-height: 48px;
    }

    .dataTables_wrapper .dataTables_info {
        float: none;
        text-align: center;
        padding: 1rem 0;
        font-size: 0.8rem;
    }

    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: center;
        padding: 0.5rem 0;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.625rem 0.875rem;
        min-width: 44px;
        min-height: 44px;
        margin: 0.125rem;
    }

    /* ================================================
       FORMS - MOBILE OPTIMIZATION
    ================================================ */

    .form-control,
    .form-select {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        min-height: 48px;
        border-radius: 10px;
    }

    .form-label {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }

    .form-floating>label {
        padding: 1rem;
    }

    /* Color inputs */
    .form-control-color {
        width: 48px;
        height: 48px;
        padding: 0.25rem;
    }

    /* ================================================
       BUTTONS - TOUCH FRIENDLY
    ================================================ */

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        min-height: 48px;
        border-radius: 10px;
    }

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

    .btn-sm {
        padding: 0.5rem 0.875rem;
        min-height: 40px;
    }

    /* ================================================
       MODALS - MOBILE FULLSCREEN
    ================================================ */

    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-content {
        border-radius: 16px;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
        max-height: 60vh;
        overflow-y: auto;
    }

    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }

    /* ================================================
       SETTINGS PAGE - MOBILE
    ================================================ */

    .preview-card {
        max-width: 100%;
    }

    .theme-preview {
        margin-top: 1.5rem;
    }

    /* QR Code section */
    .settings-qr img {
        max-width: 150px;
        margin: 0 auto;
        display: block;
    }

    /* ================================================
       BADGES - LARGER ON MOBILE
    ================================================ */

    .badge {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    /* ================================================
       ALERTS
    ================================================ */

    .alert {
        padding: 1rem;
        font-size: 0.875rem;
        border-radius: 10px;
    }

    /* ================================================
       LOGIN PAGE - MOBILE
    ================================================ */

    .login-container {
        padding: 0.75rem;
    }

    .login-card {
        padding: 1.5rem 1.25rem;
        border-radius: 20px;
    }

    .login-logo {
        width: 64px;
        height: 64px;
        font-size: 2rem;
        border-radius: 16px;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .login-bg .shape-1 {
        width: 250px;
        height: 250px;
    }

    .login-bg .shape-2 {
        width: 200px;
        height: 200px;
    }

    .login-bg .shape-3 {
        width: 180px;
        height: 180px;
    }
}

/* Extra Small Devices */
@media (max-width: 375px) {
    .main-content {
        padding: 0.5rem;
        padding-top: calc(var(--header-height) + 0.5rem);
    }

    .stat-card {
        padding: 0.75rem;
    }

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

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

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

    .card-header {
        padding: 0.75rem;
    }

    .card-body {
        padding: 0.75rem;
    }
}

/* ================================================
   LANDSCAPE MOBILE ADJUSTMENTS
================================================ */
@media (max-width: 768px) and (orientation: landscape) {
    .login-card {
        max-width: 400px;
        padding: 1.5rem;
    }

    .login-logo {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .login-header {
        margin-bottom: 1rem;
    }

    .login-header h1 {
        font-size: 1.25rem;
    }
}