/* ====================================
   Extra Eye - Partner Panel
   Dark Navy Theme with Vazirmatn Font
   ==================================== */

/* CSS Variables - HomayTech Color Palette */
:root {
    /* HomayTech Primary Colors */
    --primary-900: #1A2530;
    /* Dark Background */
    --primary-800: #2A3540;
    /* Slightly lighter */
    --primary-700: #3E4A54;
    /* Primary Dark */
    --primary-600: #596773;
    /* Primary */
    --primary-500: #6A7580;
    --primary-400: #7B858F;
    --primary-300: #8C959E;
    --primary-200: #9DA5AD;
    --primary-100: #AEB5BC;

    /* HomayTech Accent Colors - Blue */
    --accent-gradient: linear-gradient(135deg, #8FBFF0 0%, #6EA6E8 50%, #5890D0 100%);
    --accent-primary: #6EA6E8;
    /* Accent */
    --accent-secondary: #5890D0;
    /* Accent Dark */
    --accent-light: #8FBFF0;
    /* Accent Light */
    --accent-cyan: #6EA6E8;
    --accent-emerald: #22C55E;
    /* Success */
    --accent-amber: #F59E0B;
    /* Warning */
    --accent-rose: #EF4444;
    /* Error */

    /* HomayTech Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);

    /* Light mode text (for reference) */
    --text-light-primary: #1A2530;
    --text-light-secondary: rgba(26, 37, 48, 0.7);

    /* HomayTech Background Colors */
    --bg-body: var(--primary-900);
    --bg-card: rgba(62, 74, 84, 0.4);
    /* Dark Mode Card */
    --bg-card-hover: rgba(62, 74, 84, 0.6);
    --bg-input: rgba(62, 74, 84, 0.5);
    --bg-input-focus: rgba(62, 74, 84, 0.7);

    /* HomayTech Border Colors */
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-medium: rgba(255, 255, 255, 0.15);
    --border-strong: rgba(255, 255, 255, 0.2);

    /* HomayTech Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 4px 15px rgba(0, 0, 0, 0.3);
    /* Card Shadow Dark */
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 4px 12px rgba(110, 166, 232, 0.3);
    /* Accent Shadow */
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.08);
    /* Card Shadow Light */

    /* HomayTech Gradients */
    --primary-gradient: linear-gradient(135deg, #596773 0%, #3E4A54 100%);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Persian digits with Vazirmatn font - ensure all numbers use Vazirmatn */
* {
    font-variant-numeric: normal;
}

/* Force Vazirmatn for all text including numbers */
body,
.card,
.stat-card,
.table,
.modal-content,
.stat-value,
.count,
.amount,
.price,
.balance,
[class*="value"],
[class*="count"],
[class*="amount"],
[class*="price"],
[class*="balance"],
[class*="number"],
td,
th,
span,
p,
div,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif !important;
}

/* Ensure all elements use Vazirmatn including numbers */
*,
*::before,
*::after {
    font-family: inherit;
}

code,
pre,
.monospace {
    font-family: 'Vazirmatn', monospace;
}

/* Force Vazirmatn for numeric displays */
.stat-value,
.price,
.amount,
.date,
.purchase-date,
[dir="ltr"],
input,
select,
textarea,
button {
    font-family: 'Vazirmatn', system-ui, sans-serif !important;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
}

p {
    color: var(--text-secondary);
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary);
}

/* ====================================
   Buttons
   ==================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-md), 0 0 20px rgba(110, 166, 232, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(110, 166, 232, 0.4);
}

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
}

.btn-lg {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ====================================
   Form Controls
   ==================================== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: var(--spacing-md);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    background: var(--bg-input-focus);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(110, 166, 232, 0.2);
}

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

.form-control.is-invalid {
    border-color: var(--accent-rose);
}

/* Search Input - Limited Width */
.form-group input[type="text"][name="search"],
.form-group input[type="search"],
input[type="text"].form-control[name="search"],
input[type="search"].form-control {
    max-width: 350px;
}

/* Search form groups - don't expand too much */
form .form-group:has(input[name="search"]),
form .form-group:has(input[type="search"]),
.filter-group:has(input[name="search"]) {
    flex: 0 1 auto !important;
    max-width: 350px;
    min-width: 200px;
}

/* Filter groups in filters-form */
.filters-form .filter-group:first-child {
    max-width: 350px;
    min-width: 200px;
}

/* Filters grid - limit search column */
.filters-grid>.form-group:first-child,
.filters-grid>div:first-child {
    max-width: 350px;
}

/* Hide native select - we'll replace with custom dropdown */
select.form-control,
select,
.form-control select,
form select,
.filters-form select,
.filters-grid select,
.card select,
.form-group select {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Custom Select Dropdown - Modern and Beautiful */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--spacing-md);
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 42px;
}

.custom-select-trigger:hover {
    border-color: var(--accent-primary);
    background-color: var(--bg-input-focus);
    box-shadow: 0 2px 8px rgba(110, 166, 232, 0.2);
    transform: translateY(-1px);
}

.custom-select-trigger.active {
    border-color: var(--accent-primary);
    background-color: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(110, 166, 232, 0.2), 0 4px 12px rgba(110, 166, 232, 0.15);
}

.custom-select-value {
    flex: 1;
    text-align: right;
    color: var(--text-primary);
}

.custom-select-value.placeholder {
    color: var(--text-muted);
}

.custom-select-arrow {
    width: 14px;
    height: 14px;
    stroke: var(--accent-primary);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
    margin-left: 8px;
}

.custom-select-trigger.active .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    z-index: 1000;
    background: rgba(26, 37, 48, 0.98);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    margin-top: 4px;
    backdrop-filter: blur(10px);
}

.custom-select-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px var(--spacing-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.95rem;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background: rgba(110, 166, 232, 0.15);
    color: var(--text-primary);
}

.custom-select-option.selected {
    background: linear-gradient(135deg, rgba(110, 166, 232, 0.2) 0%, rgba(88, 144, 208, 0.2) 100%);
    color: var(--accent-light);
    font-weight: 600;
    border-right: 3px solid var(--accent-primary);
}

.custom-select-option .check-icon {
    width: 16px;
    height: 16px;
    stroke: var(--accent-primary);
    flex-shrink: 0;
}

.custom-select-option span {
    flex: 1;
}

/* Scrollbar for dropdown */
.custom-select-dropdown::-webkit-scrollbar {
    width: 6px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}


.invalid-feedback {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: 0.85rem;
    color: var(--accent-rose);
}

/* OTP Input Boxes */
.otp-container {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    direction: ltr;
}

.otp-input {
    width: 55px;
    height: 65px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Vazirmatn', monospace;
    background: var(--bg-input);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.otp-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(110, 166, 232, 0.2), 0 0 20px rgba(110, 166, 232, 0.1);
    transform: scale(1.05);
}

.otp-input.filled {
    border-color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.1);
}

/* ====================================
   Cards
   ==================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
}

.card-glass {
    background: rgba(15, 22, 41, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.card-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

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

/* ====================================
   Landing Page
   ==================================== */
/* ====================================
   Landing Page Styles (Removed)
   ==================================== */

/* Animated Background (Used in Auth Pages) */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(110, 166, 232, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(88, 144, 208, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(110, 166, 232, 0.08) 0%, transparent 40%);
    animation: bgPulse 20s ease-in-out infinite;
}

@keyframes bgPulse {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(-5%, 5%) rotate(2deg);
    }

    50% {
        transform: translate(5%, -5%) rotate(-2deg);
    }

    75% {
        transform: translate(-3%, -3%) rotate(1deg);
    }
}

/* Floating Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-secondary);
    bottom: -100px;
    left: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: var(--accent-cyan);
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes float {

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

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

    50% {
        transform: translate(-20px, 20px);
    }

    75% {
        transform: translate(-30px, -20px);
    }
}

/* Grid Pattern Overlay */
.grid-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.5;
}

/* Mesh Background - آرام و زیبا */
.mesh-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.4;
    background:
        radial-gradient(circle at 20% 30%, rgba(110, 166, 232, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(88, 144, 208, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(110, 166, 232, 0.05) 0%, transparent 60%),
        radial-gradient(circle at 10% 80%, rgba(143, 191, 240, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 90% 20%, rgba(88, 144, 208, 0.07) 0%, transparent 45%),
        linear-gradient(135deg, rgba(110, 166, 232, 0.03) 0%, transparent 50%),
        linear-gradient(45deg, rgba(88, 144, 208, 0.03) 0%, transparent 50%);
    background-size:
        400px 400px,
        350px 350px,
        500px 500px,
        300px 300px,
        380px 380px,
        100% 100%,
        100% 100%;
    animation: meshMove 30s ease-in-out infinite;
    filter: blur(1px);
}

@keyframes meshMove {

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

    25% {
        transform: translate(-2%, 2%) scale(1.02);
        opacity: 0.45;
    }

    50% {
        transform: translate(2%, -2%) scale(0.98);
        opacity: 0.35;
    }

    75% {
        transform: translate(-1%, -1%) scale(1.01);
        opacity: 0.42;
    }
}

/* ====================================
   Auth Pages
   ==================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background: rgba(15, 22, 41, 0.85);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    z-index: 1;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.auth-logo {
    width: 80px;
    height: 80px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
    box-shadow: 0 0 40px rgba(110, 166, 232, 0.4);
}

.auth-logo svg {
    width: 45px;
    height: 45px;
    fill: white;
}

.auth-title {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-sm);
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Mobile Number Display */
.mobile-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    direction: ltr;
}

.mobile-display .number {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.mobile-display .change-btn {
    font-size: 0.85rem;
    color: var(--accent-light);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.mobile-display .change-btn:hover {
    color: var(--accent-primary);
}

/* Timer */
.otp-timer {
    text-align: center;
    margin-top: var(--spacing-lg);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.otp-timer .time {
    font-weight: 700;
    color: var(--accent-light);
    font-size: 1.1rem;
}

.otp-timer.expired .time {
    color: var(--accent-rose);
}

.resend-btn {
    margin-top: var(--spacing-md);
    color: var(--accent-primary);
    cursor: pointer;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.resend-btn:hover {
    color: var(--accent-light);
}

.resend-btn:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ====================================
   Dashboard Layout
   ==================================== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-card);
    border-left: 1px solid var(--border-subtle);
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--spacing-xl);
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(110, 166, 232, 0.3);
}

.sidebar-logo svg {
    width: 25px;
    height: 25px;
    fill: white;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: var(--spacing-md);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 2px;
}

/* Navigation Sections */
.nav-section {
    margin-bottom: var(--spacing-xs);
}

.nav-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.nav-section-title:hover {
    color: rgba(255, 255, 255, 0.8);
}

.nav-section-title .section-arrow {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    transition: transform var(--transition-fast);
}

.nav-section-title.collapsed .section-arrow {
    transform: rotate(-90deg);
}

.nav-section-items {
    overflow: hidden;
    transition: max-height var(--transition-normal);
    max-height: 500px;
}

.nav-section-items.collapsed {
    max-height: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xs);
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-gradient);
    transform: scaleY(0);
    transition: transform var(--transition-fast);
    border-radius: 0 4px 4px 0;
}

.nav-item:hover {
    background: rgba(110, 166, 232, 0.12);
    color: var(--text-primary);
    transform: translateX(-3px);
    padding-right: 20px;
}

.nav-item:hover::before {
    transform: scaleY(1);
}

.nav-item:hover svg {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(110, 166, 232, 0.3));
}

.nav-item.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 16px rgba(110, 166, 232, 0.4);
    transform: translateX(-3px);
    padding-right: 20px;
    font-weight: 600;
}

.nav-item.active::before {
    transform: scaleY(1);
    background: rgba(255, 255, 255, 0.3);
    width: 4px;
}

.nav-item.active svg {
    transform: scale(1.15);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
    stroke-width: 2.5;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

/* Locked Nav Items (for non-verified partners) */
.nav-item.nav-locked {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.nav-item.nav-locked:hover {
    background: transparent;
    color: var(--text-muted);
}

.nav-item.nav-locked:hover::before {
    width: 0;
}

.nav-item .lock-icon {
    margin-right: auto;
    font-size: 0.75rem;
    opacity: 0.7;
}

.sidebar-footer {
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-subtle);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: var(--primary-600);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent-light);
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

.user-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 280px;
    padding: var(--spacing-md);
    height: 100vh;
    overflow-y: auto;
}

.page-header {
    margin-bottom: var(--spacing-lg);
}

.page-title {
    font-size: 1.4rem;
    margin-bottom: var(--spacing-xs);
}

.page-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
    stroke: white;
    fill: none;
}

.stat-icon.purple {
    background: linear-gradient(135deg, #6EA6E8 0%, #5890D0 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-icon.blue {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.stat-icon.amber {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Tables */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar for table-wrapper */
.table-wrapper::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(110, 166, 232, 0.2);
    border-radius: var(--radius-full);
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(110, 166, 232, 0.4);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.table-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.table-wrapper table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: right;
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
}

td {
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

td>div {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(110, 166, 232, 0.05);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
}

.badge-danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--spacing-md);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.pagination a:hover {
    background: var(--bg-input-focus);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.pagination .active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

/* Alerts */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald);
}

.alert-error {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--accent-rose);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--accent-amber);
}

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-medium);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn .spinner {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-sm {
    margin-top: var(--spacing-sm);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mt-xl {
    margin-top: var(--spacing-xl);
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.mb-xl {
    margin-bottom: var(--spacing-xl);
}

.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-right: 240px;
    }

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

@media (max-width: 768px) {
    html {
        font-size: 13px;
    }

    .sidebar {
        transform: translateX(100%);
        transition: transform var(--transition-normal);
        width: 280px;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
    }

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

    .main-content {
        margin-right: 0;
        padding: var(--spacing-sm);
        padding-top: 60px;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .page-header {
        margin-bottom: var(--spacing-md);
    }

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

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

    .landing-header {
        padding: var(--spacing-sm);
    }

    .hero {
        padding-top: calc(60px + var(--spacing-lg));
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 0.9rem;
    }

    .features {
        grid-template-columns: 1fr;
        padding: var(--spacing-md) var(--spacing-sm);
        gap: var(--spacing-md);
    }

    .feature-card {
        padding: var(--spacing-md);
    }

    .otp-input {
        width: 40px;
        height: 48px;
        font-size: 1.1rem;
    }

    .otp-container {
        gap: 6px;
    }

    .auth-card {
        padding: var(--spacing-md);
        margin: var(--spacing-xs);
        max-width: 100%;
    }

    .auth-logo {
        width: 55px;
        height: 55px;
    }

    .auth-logo svg {
        width: 30px;
        height: 30px;
    }

    .auth-title {
        font-size: 1.3rem;
    }

    .auth-subtitle {
        font-size: 0.85rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }

    .stat-card {
        padding: var(--spacing-sm);
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-xs);
    }

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

    .stat-icon svg {
        width: 20px;
        height: 20px;
    }

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

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

    .table-wrapper {
        overflow-x: auto;
        max-width: 100%;
    }

    table {
        min-width: 500px;
    }

    th,
    td {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8rem;
    }

    .btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.85rem;
    }

    .btn-lg {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.95rem;
    }

    .btn-sm {
        padding: 4px 10px;
        font-size: 0.8rem;
    }

    .card {
        padding: var(--spacing-md);
    }

    .card-header {
        padding-bottom: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }

    .card-title {
        font-size: 1rem;
    }

    .form-group {
        margin-bottom: var(--spacing-sm);
    }

    .form-label {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }

    .form-control {
        padding: var(--spacing-sm);
        font-size: 0.9rem;
    }

    .profile-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-md);
    }

    .alert {
        padding: var(--spacing-sm);
        font-size: 0.85rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 2px 8px;
    }

    .table-header {
        padding: var(--spacing-sm);
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: stretch;
    }

    .table-title {
        font-size: 0.95rem;
    }

    .pagination {
        padding: var(--spacing-sm);
        gap: 4px;
    }

    .pagination a,
    .pagination span {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    /* Modal Mobile Optimization */
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: var(--spacing-md);
        max-height: 85vh;
        margin: var(--spacing-sm);
    }

    .modal-title {
        font-size: 1.1rem;
        margin-bottom: var(--spacing-sm);
    }

    .modal-close {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        left: auto;
        width: 36px;
        height: 36px;
    }

    .modal-close svg {
        width: 20px;
        height: 20px;
    }

    /* Filters Mobile */
    .filters-form {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .filters-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-sm);
    }

    .filter-group {
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .filter-actions {
        width: 100%;
        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;
    }

    /* Search Forms Mobile */
    form[style*="flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    form[style*="flex"] .form-group {
        max-width: 100% !important;
        min-width: 100% !important;
        flex: 1 1 100% !important;
    }

    form[style*="flex"] .btn {
        width: 100%;
        margin-top: var(--spacing-xs);
    }

    /* Cards Mobile */
    .card {
        margin-bottom: var(--spacing-sm);
    }

    /* Stats Grid Mobile */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    /* Table Mobile - Better Scroll */
    .table-wrapper {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        position: relative;
    }

    .table-wrapper::after {
        content: '';
        position: sticky;
        right: 0;
        top: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to left, var(--bg-body), transparent);
        pointer-events: none;
    }

    /* Button Groups Mobile */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
        margin-bottom: var(--spacing-xs);
    }

    /* Form Grid Mobile */
    .form-grid {
        grid-template-columns: 1fr !important;
    }

    /* Package Cards Mobile */
    .packages-grid {
        flex-direction: column;
        align-items: stretch;
    }

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

    /* Custom Select Mobile */
    .custom-select-wrapper {
        width: 100%;
    }

    .custom-select-dropdown {
        max-height: 50vh;
    }

    /* OTP Input Mobile */
    .otp-container {
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Sidebar Mobile Improvements */
    .sidebar {
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    }

    .sidebar-nav {
        padding-bottom: var(--spacing-md);
    }

    /* Main Content Mobile */
    .main-content {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
    }

    /* Alert Mobile */
    .alert {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    /* Badge Mobile */
    .badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: calc(var(--spacing-sm) + env(safe-area-inset-top, 0px));
    left: var(--spacing-sm);
    /* Moved to left to avoid overlapping title in RTL */
    z-index: 10000;
    /* Extremely high to stay above everything */
    width: 44px;
    height: 44px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    padding: 0;
    margin: 0;
}

.mobile-menu-toggle svg {
    stroke: white;
    width: 22px;
    height: 22px;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 45;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.show {
    display: block;
}

/* Safe Area for Mobile */
@supports (padding: env(safe-area-inset-bottom)) {
    .sidebar-footer {
        padding-bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom));
    }

    .auth-page {
        padding-bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom));
    }

    .main-content {
        padding-bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom));
    }
}

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
    }

    .nav-item {
        min-height: 44px;
    }

    .form-control {
        min-height: 44px;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .otp-input {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }
}

/* Jalali Date Component */
.jalali-date {
    font-family: 'Vazirmatn', monospace;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Extra Small Devices */
@media (max-width: 420px) {
    html {
        font-size: 12px;
    }

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

    .otp-input {
        width: 36px;
        height: 44px;
        font-size: 1rem;
    }

    .otp-container {
        gap: 4px;
    }

    .hero-title {
        font-size: 1.3rem;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .btn-lg {
        padding: var(--spacing-xs) var(--spacing-md);
    }

    .auth-card {
        padding: var(--spacing-sm);
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
    }

    .mobile-menu-toggle svg {
        width: 20px;
        height: 20px;
    }

    /* Extra Small Modal */
    .modal-content {
        width: 98%;
        max-width: 98%;
        padding: var(--spacing-sm);
    }

    .modal-title {
        font-size: 1rem;
    }

    /* Extra Small Table */
    table {
        min-width: 400px;
        font-size: 0.75rem;
    }

    th,
    td {
        padding: 6px 8px;
    }

    /* Extra Small Buttons */
    .btn {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* Extra Small Cards */
    .card {
        padding: var(--spacing-sm);
    }

    .card-title {
        font-size: 0.9rem;
    }

    /* Extra Small Forms */
    .form-control {
        font-size: 14px;
        /* Prevent zoom on iOS */
        padding: 10px;
    }

    .form-label {
        font-size: 0.8rem;
    }
}

/* Wallet Section in Sidebar */
.wallet-section {
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    background: rgba(110, 166, 232, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(110, 166, 232, 0.2);
    text-align: center;
}

.wallet-balance {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-light);
    margin-bottom: var(--spacing-xs);
}

.wallet-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.btn-increase-wallet {
    width: 100%;
    font-size: 0.8rem;
    padding: var(--spacing-xs);
}

/* Disabled Link Style */
.nav-item.disabled-link {
    cursor: default;
    opacity: 0.7;
}

.nav-item.disabled-link:hover {
    background: transparent;
    color: var(--text-secondary);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: var(--primary-800);
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-medium);
    padding: var(--spacing-xl);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    left: auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 10;
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    text-align: center;
    color: var(--accent-light);
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload-wrapper:hover {
    border-color: var(--accent-primary);
    background: rgba(110, 166, 232, 0.05);
}

.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.badge-secondary {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

/* Chic Modal & Restriction Styles */
.modal-content.chic-mode {
    max-width: 800px;
    padding: var(--spacing-xl);
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: visible;
}

@media (max-width: 768px) {
    .modal-content.chic-mode {
        overflow-y: auto;
        max-height: 85vh;
        scrollbar-width: thin;
        scrollbar-color: rgba(110, 166, 232, 0.2) transparent;
    }

    .modal-content.chic-mode::-webkit-scrollbar {
        width: 4px;
    }

    .modal-content.chic-mode::-webkit-scrollbar-thumb {
        background: rgba(110, 166, 232, 0.2);
        border-radius: var(--radius-full);
    }
}

.chic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

@media (max-width: 600px) {
    .chic-grid {
        grid-template-columns: 1fr;
    }

    .chic-grid .full-width {
        grid-column: span 1;
    }
}

.chic-grid .full-width {
    grid-column: span 2;
}

.modal-title.chic-title {
    font-size: 1.8rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--spacing-lg);
    font-weight: 800;
}

/* Restriction Popup */
.restriction-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(15, 23, 42, 0.9);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 320px;
}

.restriction-popup.show {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

.restriction-icon {
    width: 60px;
    height: 60px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: var(--accent-rose);
}

.restriction-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.restriction-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.restriction-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 299;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
}

.restriction-overlay.show {
    opacity: 1;
    pointer-events: all;
}

/* Compact form styles for modal */
.compact-form-group {
    margin-bottom: var(--spacing-sm);
}

.compact-form-group .form-label {
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.compact-form-group .form-control {
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* Address textarea adjustment */
.compact-form-group textarea.form-control {
    height: 60px;
    resize: none;
}

/* Success Modal Styles */
.success-modal-icon {
    width: 80px;
    height: 80px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--accent-emerald);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
    animation: successPulse 2s infinite;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.success-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-emerald);
    margin-bottom: 10px;
    text-align: center;
}

.success-modal-message {
    text-align: center;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 1rem;
}

/* Top Header & Notifications */
.app-header {
    display: flex;
    justify-content: flex-end;
    /* Right aligned */
    align-items: center;
    padding: var(--spacing-md) var(--spacing-xl);
    background: transparent;
    /* or var(--bg-card) if sticky */
    margin-bottom: var(--spacing-md);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.notification-wrapper {
    position: relative;
}

.notification-btn {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.notification-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-rose);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-body);
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.notification-menu {
    position: absolute;
    top: 100%;
    left: 0;
    /* Changed from right:0 because of RTL, check direction */
    width: 300px;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-sm);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

/* RTL adjustment: In RTL, left:0 aligns to the left edge (which is 'far side' usually). 
   But usually we want it aligned with the bell. 
   If dir=rtl, 'left: 0' puts it on the left side of the relative parent. 
   Let's use specific positioning based on LTR/RTL or just center it.
*/
html[dir="rtl"] .notification-menu {
    left: 0;
    right: auto;
}

.notification-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(10px);
    /* Keep translation or reset? usually translateY(0) if starting from 10 */
    transform: translateY(5px);
}

.notification-header {
    padding: var(--spacing-sm) var(--spacing-md);
    font-weight: 700;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--spacing-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.2s;
    border-radius: var(--radius-sm);
}

.notification-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-amber);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.empty-notifications {
    padding: var(--spacing-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Admin Sidebar Menu/Submenu Better Separation */
.nav-section {
    margin-bottom: var(--spacing-sm);
}

.nav-section-title {
    display: flex;
    align-items: center;
    padding: 10px var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    margin-bottom: 2px;
}

.nav-section-title:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-section-title svg:first-child {
    width: 18px;
    height: 18px;
    margin-left: 8px;
    stroke: currentColor;
    fill: none;
}

.nav-section-items {
    padding-right: var(--spacing-md);
    border-right: 2px solid var(--border-subtle);
    margin-right: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.nav-section-items .nav-item {
    font-size: 0.85rem;
    padding: 10px var(--spacing-md);
    color: var(--text-muted);
}

.nav-section-items .nav-item:hover {
    color: var(--text-primary);
    background: rgba(110, 166, 232, 0.1);
    transform: translateX(-2px);
}

.nav-section-items .nav-item:hover svg {
    transform: scale(1.08);
}

.nav-section-items .nav-item.active {
    color: var(--accent-primary);
    background: rgba(110, 166, 232, 0.15);
    font-weight: 600;
}

.nav-section-items .nav-item.active svg {
    stroke-width: 2.5;
    filter: drop-shadow(0 2px 4px rgba(110, 166, 232, 0.3));
}

.nav-section-items.collapsed {
    display: none;
}

.nav-section-title.collapsed .section-arrow {
    transform: rotate(-90deg);
}

.section-arrow {
    width: 16px;
    height: 16px;
    margin-right: auto;
    stroke: currentColor;
    fill: none;
    transition: transform 0.2s ease;
}

/* ====================================
   PWA Enhanced Responsive Styles
   For iPhone 16 Pro Max and Large Phones
   ==================================== */

/* PWA Standalone Mode Detection */
@media all and (display-mode: standalone) {
    body {
        /* Prevent overscroll bounce */
        overscroll-behavior: none;
    }

    .main-content {
        /* Even more padding to clear everything comfortably */
        padding-top: calc(env(safe-area-inset-top, 20px) + 70px);
    }

    .mobile-menu-toggle {
        top: calc(env(safe-area-inset-top, 20px) + 15px) !important;
        left: 15px !important;
        right: auto !important;
    }

    .sidebar {
        padding-top: calc(env(safe-area-inset-top, 20px) + 10px);
    }
}

/* Large Phones (iPhone Pro Max, Galaxy Ultra, etc.) - 430px and up */
@media (min-width: 390px) and (max-width: 500px) {
    html {
        font-size: 14px;
    }

    .main-content {
        padding: var(--spacing-md);
        padding-top: 65px;
    }

    .sidebar {
        width: 300px;
    }

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

    .page-description {
        font-size: 0.9rem;
    }

    /* Better stat cards for large phones */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-md);
    }

    .stat-card {
        padding: var(--spacing-md);
        flex-direction: row;
        text-align: right;
    }

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

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

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

    /* Larger buttons for touch */
    .btn {
        min-height: 48px;
        font-size: 0.95rem;
    }

    .btn-sm {
        min-height: 40px;
        font-size: 0.85rem;
    }

    /* Better form inputs */
    .form-control {
        font-size: 16px;
        /* Prevent iOS zoom */
        padding: 14px;
        min-height: 50px;
    }

    /* Better OTP inputs for large screens */
    .otp-input {
        width: 48px;
        height: 56px;
        font-size: 1.3rem;
    }

    .otp-container {
        gap: 10px;
    }

    /* Modal improvements */
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: var(--spacing-md);
        max-height: 85dvh;
        /* Use dynamic viewport height */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* Smooth scrolling on iOS */
    }

    .modal-title {
        font-size: 1.2rem;
    }

    /* Better sidebar header */
    .sidebar-header {
        padding: var(--spacing-md);
    }

    .sidebar-logo {
        width: 45px;
        height: 45px;
    }

    /* Navigation items */
    .nav-item {
        min-height: 48px;
        padding: 12px var(--spacing-md);
        font-size: 0.95rem;
    }

    /* User info in sidebar */
    .user-info {
        padding: var(--spacing-sm);
    }

    .user-avatar {
        width: 42px;
        height: 42px;
    }

    /* Footer buttons */
    .footer-btn {
        padding: 12px;
        min-height: 46px;
    }

    /* Cards */
    .card {
        padding: var(--spacing-lg);
    }

    /* Tables */
    table {
        min-width: 100%;
    }

    th,
    td {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.85rem;
    }

    /* Restriction popup */
    .restriction-popup {
        width: 90%;
        max-width: 360px;
        padding: var(--spacing-xl);
    }
}

/* Medium Phones (iPhone 14/15/16 standard) - 375px-389px */
@media (min-width: 375px) and (max-width: 389px) {
    html {
        font-size: 13.5px;
    }

    .main-content {
        padding: var(--spacing-sm);
        padding-top: 60px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }

    .stat-card {
        padding: var(--spacing-sm);
    }

    .otp-input {
        width: 44px;
        height: 52px;
        font-size: 1.2rem;
    }

    .otp-container {
        gap: 8px;
    }

    .btn {
        min-height: 46px;
    }

    .form-control {
        font-size: 16px;
        padding: 12px;
        min-height: 48px;
    }

    .nav-item {
        min-height: 46px;
        font-size: 0.9rem;
    }
}

/* iPhone SE and smaller phones (< 375px) */
@media (max-width: 374px) {
    html {
        font-size: 12px;
    }

    .main-content {
        padding: var(--spacing-xs);
        padding-top: 55px;
    }

    .sidebar {
        width: 260px;
    }

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

    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .stat-card {
        flex-direction: row;
        padding: var(--spacing-sm);
    }

    .otp-input {
        width: 34px;
        height: 42px;
        font-size: 1rem;
    }

    .otp-container {
        gap: 4px;
    }

    .btn {
        min-height: 44px;
        font-size: 0.8rem;
    }

    .form-control {
        font-size: 16px;
        padding: 10px;
        min-height: 44px;
    }

    .modal-content {
        width: 98%;
        padding: var(--spacing-sm);
    }

    .nav-item {
        min-height: 44px;
        font-size: 0.85rem;
        padding: 10px var(--spacing-sm);
    }

    .sidebar-header {
        padding: var(--spacing-sm);
    }

    .sidebar-logo {
        width: 36px;
        height: 36px;
    }

    .sidebar-title {
        font-size: 0.9rem;
    }
}

/* Landscape orientation for phones */
@media (max-height: 500px) and (orientation: landscape) {
    .main-content {
        padding-top: 50px;
    }

    .mobile-menu-toggle {
        top: 8px;
        width: 36px;
        height: 36px;
    }

    .sidebar {
        padding-top: 10px;
    }

    .sidebar-header {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .nav-item {
        min-height: 38px;
        padding: 8px var(--spacing-sm);
    }

    .modal-content {
        max-height: 95vh;
    }

    .auth-card {
        padding: var(--spacing-md);
        max-height: 95vh;
        overflow-y: auto;
    }
}

/* High DPI screens optimization */
@media (-webkit-min-device-pixel-ratio: 3),
(min-resolution: 288dpi) {

    .sidebar-logo svg,
    .nav-item svg,
    .btn svg,
    .stat-icon svg {
        image-rendering: crisp-edges;
    }
}

/* Dark mode system preference (if not already dark) */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .network-animation-container {
        display: none;
    }

    .toggle-pulse {
        display: none;
    }
}

/* Better touch scrolling */
.main-content,
.sidebar,
.modal-content,
.table-wrapper {
    -webkit-overflow-scrolling: touch;
}

/* Fix for iOS bottom bar when in standalone mode */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .dashboard-layout {
        min-height: calc(100vh - env(safe-area-inset-bottom));
    }

    .modal-overlay {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .restriction-popup {
        margin-bottom: calc(env(safe-area-inset-bottom) + 20px);
    }

    .sidebar-footer {
        padding-bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom));
    }
}

/* Better input focus states for mobile */
.form-control:focus,
.otp-input:focus {
    -webkit-tap-highlight-color: transparent;
}

/* Prevent text selection on buttons */
.btn,
.nav-item,
.footer-btn {
    -webkit-user-select: none;
    user-select: none;
}

/* Better ripple effect on touch */
.btn:active,
.nav-item:active,
.footer-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Card hover effects disabled on touch devices */
@media (hover: none) {

    .card:hover,
    .stat-card:hover,
    .batch-card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }
}

/* ========================================
   COMPREHENSIVE MOBILE & PWA RESPONSIVE
   ======================================== */

/* Mobile Base - 480px and below */
@media (max-width: 480px) {
    :root {
        --spacing-xs: 3px;
        --spacing-sm: 6px;
        --spacing-md: 12px;
        --spacing-lg: 16px;
        --spacing-xl: 20px;
    }

    html {
        font-size: 13px;
    }

    body {
        -webkit-overflow-scrolling: touch;
    }

    /* Main Content Mobile */
    .main-content {
        padding: 12px !important;
        padding-top: 56px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Header Mobile */
    .page-header {
        margin-bottom: 12px;
        padding: 0;
    }

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

    .page-description {
        font-size: 0.75rem;
    }

    /* Cards Mobile */
    .card {
        border-radius: var(--radius-md);
        padding: 12px;
    }

    .card-header {
        padding: 12px;
    }

    .card-body {
        padding: 12px;
    }

    /* Buttons Mobile */
    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        border-radius: var(--radius-sm);
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .btn-lg {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    /* Form Elements Mobile */
    .form-control {
        height: 42px;
        padding: 10px 12px;
        font-size: 16px;
        /* Prevents iOS zoom */
        border-radius: var(--radius-sm);
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-label {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    /* Tables Mobile */
    .table-responsive {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 0.75rem;
    }

    /* Modal Mobile */
    .modal-content {
        margin: 10px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        border-radius: var(--radius-lg);
    }

    .modal-title {
        font-size: 1rem;
    }

    /* Stats Grid Mobile */
    .stats-row,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .stat-box,
    .stat-card {
        padding: 10px !important;
    }

    .stat-num,
    .stat-value {
        font-size: 1.1rem !important;
    }

    .stat-label {
        font-size: 0.7rem !important;
    }

    /* Filters Mobile */
    .filters-card {
        padding: 10px;
    }

    .filters-grid {
        flex-direction: column;
        gap: 8px;
    }

    .filter-item {
        width: 100%;
        min-width: unset;
    }

    /* Actions Grid Mobile */
    .actions-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }

    .action-btn {
        padding: 8px 4px !important;
    }

    .action-icon {
        width: 32px !important;
        height: 32px !important;
    }

    .action-label {
        font-size: 0.65rem !important;
    }

    /* Chart Section Mobile */
    .chart-section {
        padding: 10px !important;
    }

    .chart-wrapper {
        min-height: 140px !important;
    }

    /* Welcome Header Mobile */
    .welcome-header {
        padding: 8px 0 !important;
        margin-bottom: 8px !important;
    }

    .welcome-icon {
        width: 36px !important;
        height: 36px !important;
    }

    .wave-emoji {
        font-size: 18px !important;
    }

    .welcome-title {
        font-size: 1rem !important;
    }

    .welcome-subtitle {
        font-size: 0.7rem !important;
    }

    /* Banner Mobile */
    .top-banner-section {
        margin-bottom: 8px !important;
    }

    .banner-image {
        max-height: 80px !important;
        min-height: 50px !important;
    }

    .banner-title {
        font-size: 0.85rem !important;
    }

    .banner-desc {
        font-size: 0.65rem !important;
        display: none;
    }

    /* Quick Actions Card Mobile */
    .quick-actions-card {
        padding: 10px !important;
    }

    .section-icon {
        width: 28px !important;
        height: 28px !important;
    }

    .section-title span {
        font-size: 0.85rem !important;
    }

    /* Sidebar Mobile Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 40;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

/* Small Mobile - 375px and below */
@media (max-width: 375px) {
    html {
        font-size: 12px;
    }

    .main-content {
        padding: 8px !important;
        padding-top: 52px !important;
    }

    .stats-row,
    .stats-grid {
        gap: 6px !important;
    }

    .stat-box,
    .stat-card {
        padding: 8px !important;
    }

    .stat-num,
    .stat-value {
        font-size: 1rem !important;
    }

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

    .modal-content {
        padding: 16px;
    }

    .form-control {
        height: 40px;
    }

    .btn {
        padding: 8px 12px;
    }
}

/* Extra Small Mobile - 320px and below */
@media (max-width: 320px) {
    html {
        font-size: 11px;
    }

    .welcome-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .stats-row,
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }

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

    .chart-wrapper {
        min-height: 120px !important;
    }
}

/* PWA Standalone Mode */
@media all and (display-mode: standalone) {
    body {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }

    /* Safe area padding for notched devices */
    .main-content {
        padding-top: max(env(safe-area-inset-top), 56px) !important;
        padding-bottom: env(safe-area-inset-bottom) !important;
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* Hide scrollbars in PWA */
    ::-webkit-scrollbar {
        display: none;
    }

    * {
        scrollbar-width: none;
    }

    /* Smoother animations in PWA */
    .card,
    .btn,
    .nav-item {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    /* Mobile header for PWA */
    .mobile-header {
        padding-top: env(safe-area-inset-top);
        position: sticky;
        top: 0;
    }
}

/* iPhone SE / iPhone 8 size */
@media (min-width: 375px) and (max-width: 414px) and (-webkit-device-pixel-ratio: 2) {
    .main-content {
        padding: 12px !important;
    }

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

    .chart-wrapper {
        min-height: 150px !important;
    }
}

/* iPhone X / 11 / 12 / 13 size */
@media (min-width: 375px) and (max-width: 428px) and (-webkit-device-pixel-ratio: 3) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .main-content {
        padding: 14px !important;
        padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
    }
}

/* iPhone 14 Pro Max / Large phones */
@media (min-width: 428px) and (max-width: 500px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .main-content {
        padding: 16px !important;
    }

    .chart-wrapper {
        min-height: 180px !important;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .main-content {
        padding: 8px !important;
        padding-top: 48px !important;
    }

    .welcome-header {
        display: none !important;
    }

    .top-banner-section {
        display: none !important;
    }

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

    .stat-card {
        padding: 6px !important;
    }

    .main-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .chart-wrapper {
        min-height: 100px !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets */
    .btn,
    .nav-item,
    .action-btn {
        min-height: 44px;
    }

    /* Disable hover effects */
    .card:hover,
    .btn:hover,
    .nav-item:hover {
        transform: none !important;
    }

    /* Better tap feedback */
    .btn:active {
        transform: scale(0.97);
        opacity: 0.9;
    }

    /* Input adjustments */
    .form-control,
    select {
        font-size: 16px !important;
        /* Prevents zoom on iOS */
    }

    /* Checkbox/Radio larger */
    input[type="checkbox"],
    input[type="radio"] {
        min-width: 20px;
        min-height: 20px;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .card,
    .btn,
    .modal-content {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}

/* Print styles */
@media print {

    .sidebar,
    .mobile-header,
    .navbar-mobile,
    .btn,
    .modal-overlay {
        display: none !important;
    }

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

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}