/* ==========================================================================
   ROYAUME DU MAROC — منصة الشكاوى
   Moroccan Government Complaints Platform · Theme v2.0 · 2026
   ==========================================================================
   A premium, Awwwards-caliber design system inspired by Moroccan royal
   architecture — clean whitespace, subtle depth, micro-animations, and
   full RTL Arabic support built mobile-first from 320px upward.
   ========================================================================== */

/* ==========================================================================
   § 1. DESIGN TOKENS (CSS Custom Properties)
   ========================================================================== */

:root {
    /* ── Core Palette (fixed) ── */
    --morocco-red: #C1272D;
    --morocco-green: #006233;
    --morocco-gold: #C8A951;
    --morocco-charcoal: #1A1A2E;
    --morocco-cream: #FDF8F0;

    /* ── Extended Palette ── */
    --morocco-red-dark: #9B1B20;
    --morocco-red-light: #E8505B;
    --morocco-green-dark: #004D28;
    --morocco-green-light: #00A058;
    --morocco-gold-dark: #A68B3A;
    --morocco-gold-light: #DFC478;

    /* ── Neutrals ── */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* ── Gradients ── */
    --gradient-royal: linear-gradient(135deg, #C1272D 0%, #006233 100%);
    --gradient-imperial: linear-gradient(135deg, #1A1A2E 0%, #C1272D 50%, #006233 100%);
    --gradient-emerald: linear-gradient(135deg, #006233 0%, #004D28 100%);
    --gradient-gold: linear-gradient(135deg, #C8A951 0%, #A68B3A 100%);
    --gradient-text: linear-gradient(135deg, #C1272D 0%, #006233 100%);
    --gradient-overlay: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.5) 100%);

    /* ── Shadows ── */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.10), 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-glow-gold: 0 0 30px rgba(200, 169, 81, 0.2);

    /* ── Typography ── */
    --font-ar: 'Cairo', 'Amiri', 'Tajawal', sans-serif;
    --font-display: 'Amiri', 'Cairo', serif;
    --font-en: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* ── Zellige SVG Data URIs (subtle patterns) ── */
    --zellige-simple: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Crect x='20' y='20' width='40' height='40' fill='none' stroke='white' stroke-width='0.75' opacity='0.12'/%3E%3Crect x='20' y='20' width='40' height='40' fill='none' stroke='white' stroke-width='0.75' opacity='0.12' transform='rotate(45 40 40)'/%3E%3Crect x='32' y='32' width='16' height='16' fill='none' stroke='white' stroke-width='0.5' opacity='0.06' transform='rotate(22.5 40 40)'/%3E%3C/svg%3E");
    --zellige-ornate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Crect x='30' y='30' width='60' height='60' fill='none' stroke='white' stroke-width='1' opacity='0.12'/%3E%3Crect x='30' y='30' width='60' height='60' fill='none' stroke='white' stroke-width='1' opacity='0.12' transform='rotate(45 60 60)'/%3E%3Crect x='45' y='45' width='30' height='30' fill='none' stroke='white' stroke-width='0.5' opacity='0.06' transform='rotate(22.5 60 60)'/%3E%3Crect x='0' y='0' width='24' height='24' fill='none' stroke='white' stroke-width='0.5' opacity='0.08' transform='rotate(45 12 12)'/%3E%3Crect x='96' y='0' width='24' height='24' fill='none' stroke='white' stroke-width='0.5' opacity='0.08' transform='rotate(45 108 12)'/%3E%3Crect x='0' y='96' width='24' height='24' fill='none' stroke='white' stroke-width='0.5' opacity='0.08' transform='rotate(45 12 108)'/%3E%3Crect x='96' y='96' width='24' height='24' fill='none' stroke='white' stroke-width='0.5' opacity='0.08' transform='rotate(45 108 108)'/%3E%3C/svg%3E");
    --zellige-green: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Crect x='20' y='20' width='40' height='40' fill='none' stroke='rgba(0,98,51,0.08)' stroke-width='0.75'/%3E%3Crect x='20' y='20' width='40' height='40' fill='none' stroke='rgba(0,98,51,0.08)' stroke-width='0.75' transform='rotate(45 40 40)'/%3E%3C/svg%3E");
    --zellige-cream: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Crect x='20' y='20' width='40' height='40' fill='none' stroke='rgba(200,169,81,0.06)' stroke-width='0.75'/%3E%3Crect x='20' y='20' width='40' height='40' fill='none' stroke='rgba(200,169,81,0.06)' stroke-width='0.75' transform='rotate(45 40 40)'/%3E%3C/svg%3E");
}


/* ==========================================================================
   § 2. RESET & BASE STYLES
   ========================================================================== */

html {
    box-sizing: border-box;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-en);
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--morocco-charcoal);
    background-color: var(--morocco-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* RTL default body */
[dir="rtl"] body,
body[dir="rtl"] {
    font-family: var(--font-ar);
    direction: rtl;
    text-align: right;
}

img,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--morocco-green);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--morocco-green-dark);
}

::selection {
    background-color: var(--morocco-red);
    color: var(--white);
}

:focus-visible {
    outline: 2px solid var(--morocco-green);
    outline-offset: 2px;
}


/* ==========================================================================
   § 3. KEYFRAME ANIMATIONS
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes moroccanSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

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

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

@keyframes shake {

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

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

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

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(200, 169, 81, 0.35);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(200, 169, 81, 0);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


/* ==========================================================================
   § 4. ANIMATION UTILITY CLASSES
   ========================================================================== */

.animate-fadeIn {
    animation: fadeIn 0.5s ease both;
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease both;
}

.animate-slideUp {
    animation: fadeInUp 0.5s ease both;
}

.animate-slideDown {
    animation: slideDown 0.3s ease both;
}

.animate-scaleIn {
    animation: scaleIn 0.4s ease both;
}

.animate-shake {
    animation: shake 0.4s ease;
}

/* Stagger delays */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

.delay-6 {
    animation-delay: 0.6s;
}


/* ==========================================================================
   § 5. GLASSMORPHISM UTILITY
   ========================================================================== */

.glass {
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}


/* ==========================================================================
   § 6. AUTH PAGE — Split Layout
   ========================================================================== */

.auth-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    background: var(--morocco-cream);
    position: relative;
    overflow: hidden;
}


/* ── 6a. Left Decorative Panel ── */

.auth-panel-left {
    position: relative;
    width: 100%;
    height: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gradient-royal);
    overflow: hidden;
    z-index: 1;
}

/* Zellige pattern overlay */
.auth-panel-zellige {
    position: absolute;
    inset: 0;
    background-image: var(--zellige-ornate);
    background-repeat: repeat;
    background-size: 120px 120px;
    opacity: 0.15;
    z-index: 1;
}

/* Dark gradient overlay for depth */
.auth-panel-overlay {
    position: absolute;
    inset: 0;
    background: var(--gradient-overlay);
    z-index: 2;
}

/* Thin gold vertical line on inner edge */
.auth-panel-gold-edge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--morocco-gold) 20%,
            var(--morocco-gold-light) 50%,
            var(--morocco-gold) 80%,
            transparent 100%);
    z-index: 4;
    box-shadow: 0 0 16px rgba(200, 169, 81, 0.3);
}

/* Content wrapper inside left panel */
.auth-panel-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
}

/* Emblem / coat of arms circle */
.auth-emblem {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(200, 169, 81, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow:
        0 0 30px rgba(200, 169, 81, 0.2),
        inset 0 0 20px rgba(200, 169, 81, 0.1);
    animation: pulseGlow 3s ease-in-out infinite;
}

.auth-emblem svg {
    width: 64px;
    height: 64px;
    fill: var(--morocco-gold);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Titles inside left panel */
.auth-panel-titles {
    text-align: center;
}

.auth-panel-main-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.auth-panel-sub-title {
    font-family: var(--font-ar);
    font-size: 1.15rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
}

.auth-panel-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    max-width: 280px;
    line-height: 1.6;
    margin-top: 0.75rem;
}

/* Moroccan ornamental divider */
.moroccan-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1.25rem 0;
    width: 200px;
}

.moroccan-divider::before,
.moroccan-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--morocco-gold), transparent);
    opacity: 0.6;
}

.moroccan-divider::after {
    content: '';
}

/* Diamond shape in center */
.moroccan-divider>* {
    width: 10px;
    height: 10px;
    background: var(--morocco-gold);
    transform: rotate(45deg);
    flex-shrink: 0;
    opacity: 0.8;
}

/* If no child element, use a pseudo center dot */
.moroccan-divider:empty::before {
    content: '';
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    background: var(--morocco-gold);
    transform: rotate(45deg);
    margin: 0 12px;
    opacity: 0.8;
}

/* Motto badge pill */
.auth-motto-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 24px;
    background: rgba(200, 169, 81, 0.15);
    border: 1px solid rgba(200, 169, 81, 0.35);
    border-radius: 9999px;
    margin-top: 1rem;
}

.motto-text {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--morocco-gold);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Corner ornaments — CSS-only L-shaped gold borders */
.auth-corner-ornament {
    position: absolute;
    width: 50px;
    height: 50px;
    z-index: 4;
    opacity: 0.35;
}

.auth-corner-ornament.top-start {
    top: 1rem;
    left: 1rem;
    border-top: 2px solid var(--morocco-gold);
    border-left: 2px solid var(--morocco-gold);
}

.auth-corner-ornament.top-end {
    top: 1rem;
    right: 1rem;
    border-top: 2px solid var(--morocco-gold);
    border-right: 2px solid var(--morocco-gold);
}

.auth-corner-ornament.bottom-start {
    bottom: 1rem;
    left: 1rem;
    border-bottom: 2px solid var(--morocco-gold);
    border-left: 2px solid var(--morocco-gold);
}

.auth-corner-ornament.bottom-end {
    bottom: 1rem;
    right: 1rem;
    border-bottom: 2px solid var(--morocco-gold);
    border-right: 2px solid var(--morocco-gold);
}


/* ── 6b. Right Form Panel ── */

.auth-panel-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    position: relative;
    z-index: 1;
    background-image: var(--zellige-cream);
    background-repeat: repeat;
    background-size: 80px 80px;
    overflow-y: auto;
}

/* Language switcher positioned at top of right panel */
.auth-lang-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

[dir="rtl"] .auth-lang-switcher {
    right: auto;
    left: 1rem;
}


/* ==========================================================================
   § 7. LOGIN CARD
   ========================================================================== */

.login-card {
    width: 100%;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 1.75rem 1.25rem;
    box-shadow:
        var(--shadow-xl),
        0 0 0 1px rgba(200, 169, 81, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

/* ── Moroccan Header inside Card ── */

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

.moroccan-header-emblem {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.moroccan-header-emblem svg {
    width: 24px;
    height: 24px;
    fill: var(--white);
}

.moroccan-header-title {
    font-family: var(--font-en);
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

[dir="rtl"] .moroccan-header-title {
    font-family: var(--font-ar);
}

.moroccan-header-subtitle {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin: 0;
}


/* ==========================================================================
   § 8. FORM ELEMENTS
   ========================================================================== */

.form-group {
    margin-bottom: 1.25rem;
}

/* Label displayed above input (not floating) */
.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--morocco-charcoal);
    margin-bottom: 0.5rem;
}

.form-label i {
    font-size: 0.8rem;
    color: var(--gray-400);
}

/* Input wrapper with icon */
.input-group {
    position: relative;
}

.input-group-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s ease;
}

[dir="rtl"] .input-group-icon {
    left: auto;
    right: 16px;
}

/* Form input */
.form-input {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--morocco-charcoal);
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

/* When input has an icon sibling, add left padding */
.input-group .form-input {
    padding-left: 48px;
}

[dir="rtl"] .input-group .form-input {
    padding-left: 14px;
    padding-right: 48px;
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input:hover {
    border-color: var(--gray-300);
}

.form-input:focus {
    background: var(--white);
    border-color: var(--morocco-green);
    box-shadow: 0 0 0 3px rgba(0, 98, 51, 0.1);
}

.form-input:focus~.input-group-icon,
.input-group .form-input:focus+.input-group-icon {
    color: var(--morocco-green);
}

.form-input.error,
.form-input.is-invalid {
    border-color: var(--morocco-red);
    box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.08);
}

/* Password toggle at end of input */
.input-group-append,
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    z-index: 2;
}

[dir="rtl"] .input-group-append,
[dir="rtl"] .password-toggle {
    right: auto;
    left: 14px;
}

.input-group-append:hover,
.password-toggle:hover {
    color: var(--gray-600);
}

/* When input has both icon + password toggle */
.input-group .form-input.has-toggle {
    padding-right: 48px;
}

[dir="rtl"] .input-group .form-input.has-toggle {
    padding-right: 48px;
    padding-left: 48px;
}

/* Error text under input */
.form-error {
    display: block;
    font-size: 0.8rem;
    color: var(--morocco-red);
    margin-top: 0.375rem;
    padding-left: 2px;
}

/* Select styling */
select.form-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

[dir="rtl"] select.form-input {
    background-position: left 16px center;
    padding-right: 14px;
    padding-left: 40px;
}

/* Textarea */
textarea.form-input {
    min-height: 120px;
    padding: 14px 16px;
    resize: vertical;
    line-height: 1.6;
}


/* ── 8a. Custom Checkbox ── */

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.form-check-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.form-check-mark {
    position: relative;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background: var(--gray-100);
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-check-mark::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 10px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    top: 1px;
}

.form-check-input:checked+.form-check-mark {
    background: var(--morocco-green);
    border-color: var(--morocco-green);
    box-shadow: 0 0 0 3px rgba(0, 98, 51, 0.12);
}

.form-check-input:checked+.form-check-mark::after {
    transform: rotate(45deg) scale(1);
}

.form-check-input:focus-visible+.form-check-mark {
    box-shadow: 0 0 0 3px rgba(0, 98, 51, 0.25);
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.form-check:hover .form-check-mark {
    border-color: var(--morocco-green);
}


/* ── 8b. Form Row ── */

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.form-link {
    font-size: 0.85rem;
    color: var(--morocco-green);
    transition: color 0.2s ease;
}

.form-link:hover {
    color: var(--morocco-green-dark);
    text-decoration: underline;
}


/* ── 8c. Card Bottom Ornament ── */

.card-bottom-ornament {
    text-align: center;
    margin-top: 1.5rem;
}

.moroccan-divider-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.moroccan-divider-sm::before,
.moroccan-divider-sm::after {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--morocco-gold);
    opacity: 0.4;
}

/* Center dot for small divider */
.moroccan-divider-sm:empty::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--morocco-gold);
    opacity: 0.5;
}

.secure-text {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin: 0;
}

.secure-text i {
    margin-right: 4px;
}

/* Copyright */
.auth-copyright {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 0;
}


/* ==========================================================================
   § 9. BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn:focus-visible {
    outline: 2px solid var(--morocco-green);
    outline-offset: 2px;
}

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

/* Primary */
.btn-primary {
    background: var(--gradient-emerald);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0, 98, 51, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #008040 0%, #006233 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 98, 51, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 98, 51, 0.25);
}

/* Secondary */
.btn-secondary {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    color: var(--morocco-charcoal);
}

.btn-secondary:hover {
    border-color: var(--morocco-green);
    color: var(--morocco-green);
}

/* Danger */
.btn-danger {
    background: var(--morocco-red);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(193, 39, 45, 0.25);
}

.btn-danger:hover {
    background: var(--morocco-red-dark);
    transform: translateY(-1px);
}

/* Block */
.btn-block {
    width: 100%;
}

/* Small */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Large */
.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* Login-specific button */
.btn-login {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

/* Loading state */
.btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

.loading-spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}


/* ==========================================================================
   § 10. ALERT NOTIFICATIONS
   ========================================================================== */

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #F0FDF4;
    border-left: 3px solid var(--morocco-green);
    color: #065F46;
}

[dir="rtl"] .alert-success {
    border-left: none;
    border-right: 3px solid var(--morocco-green);
}

.alert-error {
    background: #FEF2F2;
    border-left: 3px solid var(--morocco-red);
    color: #991B1B;
}

[dir="rtl"] .alert-error {
    border-left: none;
    border-right: 3px solid var(--morocco-red);
}

.alert-warning {
    background: #FFFBEB;
    border-left: 3px solid var(--morocco-gold);
    color: #92400E;
}

[dir="rtl"] .alert-warning {
    border-left: none;
    border-right: 3px solid var(--morocco-gold);
}

.alert-info {
    background: #EFF6FF;
    border-left: 3px solid #2C3E6B;
    color: #1E3A5F;
}

[dir="rtl"] .alert-info {
    border-left: none;
    border-right: 3px solid #2C3E6B;
}


/* ==========================================================================
   § 11. LANGUAGE SWITCHER (shared component)
   ========================================================================== */

.lang-switcher {
    position: relative;
}

.lang-switcher-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--gray-700);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lang-switcher-btn:hover {
    border-color: var(--morocco-gold);
    box-shadow: 0 2px 8px rgba(200, 169, 81, 0.1);
}

.lang-flag {
    font-size: 1.1rem;
    line-height: 1;
}

.lang-code {
    font-weight: 600;
    font-size: 0.8rem;
}

.lang-arrow {
    font-size: 0.6rem;
    color: var(--gray-400);
    transition: transform 0.2s ease;
}

.lang-switcher:hover .lang-arrow,
.lang-switcher[aria-expanded="true"] .lang-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--gray-100);
    padding: 6px;
    z-index: 100;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lang-switcher:hover .lang-dropdown,
.lang-switcher[aria-expanded="true"] .lang-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
}


.lang-option.active {
    color: var(--morocco-green);
    font-weight: 600;
}

.lang-check {
    margin-left: auto;
    color: var(--morocco-green);
    font-size: 0.75rem;
}

[dir="rtl"] .lang-check {
    margin-left: 0;
    margin-right: auto;
}

/* Auth page language button variant */
.auth-lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    color: var(--white);
    transition: background 0.2s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.auth-lang-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.auth-lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--gray-100);
    padding: 6px;
    z-index: 100;
}

[dir="rtl"] .auth-lang-dropdown {
    right: auto;
    left: 0;
}


/* ==========================================================================
   § 12. APP NAVBAR
   ========================================================================== */

.navbar-morocco {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 60px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.navbar-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.navbar-emblem {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--gradient-text);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.navbar-emblem svg {
    width: 24px;
    height: 24px;
    fill: var(--white);
}

.navbar-title {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.navbar-title-arabic {
    font-family: var(--font-ar);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--morocco-green);
}

.navbar-title-french {
    font-family: var(--font-en);
    font-size: 0.7rem;
    color: var(--morocco-red);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* ==========================================================================
   § 13. USER MENU
   ========================================================================== */

.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1.5px solid rgba(200, 169, 81, 0.3);
    border-radius: 50px;
    padding: 4px 12px 4px 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--gray-700);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.user-menu-btn:hover {
    border-color: var(--morocco-gold);
    box-shadow: 0 2px 12px rgba(200, 169, 81, 0.15);
}

[dir="rtl"] .user-menu-btn {
    padding: 4px 4px 4px 12px;
}

.user-menu-btn i {
    font-size: 0.6rem;
    color: var(--gray-400);
    transition: transform 0.2s ease;
}

.user-menu:hover .user-menu-btn i,
.user-menu[aria-expanded="true"] .user-menu-btn i {
    transform: rotate(180deg);
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--gray-100);
    padding: 6px;
    z-index: 100;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.user-menu:hover .user-dropdown,
.user-menu[aria-expanded="true"] .user-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

[dir="rtl"] .user-dropdown {
    right: auto;
    left: 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--gray-700);
    font-size: 0.875rem;
    border-radius: 8px;
    transition: background 0.15s ease;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    text-align: inherit;
}


.user-dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--gray-400);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 4px 6px;
}

.user-dropdown-item.danger {
    color: var(--morocco-red);
}

.user-dropdown-item.danger i {
    color: var(--morocco-red);
}


/* ==========================================================================
   § 14. AVATAR
   ========================================================================== */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--gradient-emerald);
    color: var(--white);
    flex-shrink: 0;
    font-family: var(--font-en);
}

.avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 0.7rem;
}

.avatar-bordered {
    border: 2px solid var(--morocco-gold);
}

.avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 0.9rem;
}

.avatar-xl {
    width: 64px;
    height: 64px;
    font-size: 1.1rem;
}


/* ==========================================================================
   § 15. FOOTER
   ========================================================================== */

.footer-morocco {
    background: var(--morocco-charcoal);
    color: var(--white);
    padding: 3rem 1.5rem 1.5rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.footer-section {
    padding-bottom: 1.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
}

.footer-brand svg {
    width: 32px;
    height: 32px;
    fill: var(--morocco-gold);
}

.footer-motto {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.75rem;
    font-style: italic;
    line-height: 1.6;
}

.footer-section h4 {
    color: var(--morocco-gold);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links li,
.footer-links a {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    margin-top: 1rem;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin: 0;
}


/* ==========================================================================
   § 16. DASHBOARD
   ========================================================================== */

.dashboard-container {
    animation: fadeIn 0.4s ease both;
}


/* ── 16a. Welcome Banner ── */

.dashboard-welcome-banner {
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    color: var(--white);
}

.welcome-banner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 2;
    text-align: center;
}

.welcome-text h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.welcome-text p {
    font-size: 1rem;
    opacity: 0.9;
    color: var(--white);
    margin: 0;
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(200, 169, 81, 0.2);
    border: 1px solid rgba(200, 169, 81, 0.4);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--morocco-gold);
    margin-bottom: 1rem;
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 12px;
}

.welcome-actions .btn {
    justify-content: center;
}

/* Decorative star */
.welcome-banner-decoration {
    position: absolute;
    right: -40px;
    top: -40px;
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
}

.welcome-star {
    width: 200px;
    height: 200px;
    fill: var(--white);
    animation: moroccanSpin 30s linear infinite;
}

/* ── 16c. Dashboard Section (card wrapper) ── */

.dashboard-section {
    background: var(--white);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--gray-100);
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.section-header h2 i {
    color: var(--morocco-green);
    font-size: 1rem;
}

.dashboard-charts-row {
    margin-bottom: 2rem;
}

/* Charts grid responsive override */
.dashboard-charts-row[style*="grid-template-columns"] {
    grid-template-columns: 1fr;
}


/* ── 16d. Complaints Table ── */

.complaints-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--gray-100);
    -webkit-overflow-scrolling: touch;
}

.complaints-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.complaints-table thead {
    background: var(--morocco-green);
    color: var(--white);
}

.complaints-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

[dir="rtl"] .complaints-table th {
    text-align: right;
}

.complaints-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

[dir="rtl"] .complaints-table td {
    text-align: right;
}

.complaints-table tbody tr {
    transition: background 0.15s ease;
}

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

.complaints-table tbody tr:last-child td {
    border-bottom: none;
}

/* Reference badge */
.ref-badge {
    display: inline-flex;
    padding: 3px 10px;
    background: #FEF3C7;
    color: #92400E;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}


/* ── 16e. Status & Priority Badges ── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-pending {
    background: #FEF3C7;
    color: #92400E;
}

.badge-in_progress {
    background: #DBEAFE;
    color: #1D4ED8;
}

.badge-assigned {
    background: #EDE9FE;
    color: #6D28D9;
}

.badge-resolved {
    background: #D1FAE5;
    color: #047857;
}

.badge-rejected {
    background: #FEE2E2;
    color: #B91C1C;
}

.badge-closed {
    background: #F3F4F6;
    color: #4B5563;
}

.badge-low {
    background: #FEF3C7;
    color: #92400E;
}

.badge-medium {
    background: #DBEAFE;
    color: #1D4ED8;
}

.badge-urgent {
    background: #FFEDD5;
    color: #C2410C;
}

.badge-critical {
    background: #FEE2E2;
    color: #B91C1C;
}

.badge-high {
    background: #FECACA;
    color: #991B1B;
}


/* ── 16f. Quick Action Cards ── */

.quick-action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1.2rem;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid var(--gray-100);
    background: var(--white);
}

.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    color: inherit;
    text-decoration: none;
}

.quick-action-card .action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.quick-action-card .action-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.quick-action-card .action-desc {
    font-size: 0.8rem;
    color: var(--gray-500);
    line-height: 1.4;
}


/* ── 16g. Empty State ── */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--gray-300);
    display: block;
}

.empty-state p {
    font-size: 0.95rem;
    color: var(--gray-400);
    margin: 0;
}


/* ==========================================================================
   § 17. RESPONSIVE — Mobile First
   ========================================================================== */

/*
   Base: 320px+ (mobile portrait)
   All styles above serve as the mobile baseline.
*/

/* ── 480px: Mobile landscape / larger phones ── */

@media (min-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .auth-panel-left {
        height: 320px;
    }

    .auth-panel-main-title {
        font-size: 2rem;
    }

    .dashboard-section {
        padding: 1.5rem;
    }
}


/* ── 768px: Tablet ── */

@media (min-width: 768px) {

    /* Auth: side by side layout */
    .auth-container {
        flex-direction: row;
    }

    .auth-panel-left {
        flex: 0 0 40%;
        max-width: 40%;
        width: 40%;
        height: auto;
        min-height: 100vh;
    }

    /* Gold edge becomes vertical line */
    .auth-panel-gold-edge {
        bottom: 0;
        left: auto;
        right: 0;
        top: 0;
        width: 3px;
        height: 100%;
        background: linear-gradient(180deg,
                transparent 0%,
                var(--morocco-gold) 15%,
                var(--morocco-gold-light) 50%,
                var(--morocco-gold) 85%,
                transparent 100%);
        box-shadow: 0 0 12px rgba(200, 169, 81, 0.4);
    }

    .auth-panel-right {
        padding: 2.5rem 2rem;
    }

    .login-card {
        max-width: 440px;
        padding: 2.5rem;
        border-radius: 20px;
    }

    .moroccan-header-title {
        font-size: 1.5rem;
    }

    /* Navbar */
    .navbar-morocco {
        height: 68px;
    }

    .navbar-container {
        padding: 0 1.5rem;
    }

    .navbar-title-french {
        display: inline;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Dashboard */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard-welcome-banner {
        padding: 2rem;
        border-radius: 20px;
    }

    .dashboard-section {
        padding: 1.5rem;
    }

    .section-header h2 {
        font-size: 1.15rem;
    }
}


/* ── 1024px: Desktop ── */

@media (min-width: 1024px) {

    /* Auth panel full proportions */
    .auth-panel-left {
        flex: 0 0 45%;
        max-width: 45%;
        width: 45%;
    }

    .auth-panel-right {
        padding: 2.5rem 3rem;
    }

    .auth-panel-main-title {
        font-size: 2.25rem;
    }

    .auth-panel-sub-title {
        font-size: 1.25rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }

    /* Dashboard */
    .dashboard-welcome-banner {
        padding: 2.5rem;
    }

    .welcome-banner-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    [dir="rtl"] .welcome-banner-content {
        text-align: right;
    }

    .welcome-text h1 {
        font-size: 1.75rem;
    }

    .welcome-actions {
        flex-direction: row;
        width: auto;
    }

    .dashboard-charts-row[style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 2fr 1fr;
    }

    .dashboard-charts-row[style*="grid-template-columns: 2fr"] {
        grid-template-columns: 2fr 1fr;
    }
}


/* ── 1280px: Desktop Full HD ── */

@media (min-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.25rem;
    }

    .navbar-container {
        padding: 0 2rem;
    }

    .footer-morocco {
        padding: 4rem 2rem 1.5rem;
    }

    .auth-panel-right {
        padding: 3rem 4rem;
    }

    .login-card {
        padding: 2.5rem;
    }
}


/* ==========================================================================
   § 18. RTL-SPECIFIC ADJUSTMENTS
   ========================================================================== */

[dir="rtl"] .complaints-table th,
[dir="rtl"] .complaints-table td {
    text-align: right;
}

[dir="rtl"] .section-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .quick-action-card {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .moroccan-divider {
    direction: rtl;
}

[dir="rtl"] .card-stat-header {
    flex-direction: row-reverse;
}

/* Flip margins/paddings that have directional values */
[dir="rtl"] .form-link {
    margin-right: 0;
    margin-left: 0;
}

/* Ensure FontAwesome icons work in RTL */
[dir="rtl"] .btn i,
[dir="rtl"] .alert i {
    margin-left: 0;
    margin-right: 0;
}

/* RTL table alignment */
[dir="rtl"] .complaints-table {
    direction: rtl;
}

/* RTL navbar brand order */
[dir="rtl"] .navbar-brand {
    flex-direction: row-reverse;
}

/* RTL footer grid sections */
[dir="rtl"] .footer-links {
    align-items: flex-start;
}


/* ==========================================================================
   § 19. UTILITY CLASSES
   ========================================================================== */

/* Display */
.d-none {
    display: none;
}

.d-inline {
    display: inline;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.d-block {
    display: block;
}

@media (min-width: 768px) {
    .d-md-inline {
        display: inline;
    }

    .d-md-flex {
        display: flex;
    }

    .d-md-block {
        display: block;
    }

    .d-md-none {
        display: none;
    }
}

/* Text */
.text-center {
    text-align: center;
}

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

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

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-lg {
    font-size: 1.125rem;
}

[dir="rtl"] .text-left {
    text-align: right;
}

[dir="rtl"] .text-right {
    text-align: left;
}

/* Colors */
.text-muted {
    color: var(--gray-500);
}

.text-success {
    color: var(--morocco-green);
}

.text-danger {
    color: var(--morocco-red);
}

.text-warning {
    color: var(--morocco-gold);
}

/* Spacing */
.mt-0 {
    margin-top: 0;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

/* Gaps */
.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

/* Border radius */
.rounded {
    border-radius: 8px;
}

.rounded-lg {
    border-radius: 12px;
}

.rounded-full {
    border-radius: 9999px;
}

/* Shadow */
.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

/* Width */
.w-100 {
    width: 100%;
}

.max-w-sm {
    max-width: 640px;
}

.max-w-md {
    max-width: 768px;
}

.max-w-lg {
    max-width: 1024px;
}

.max-w-xl {
    max-width: 1280px;
}

/* Overflow */
.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

/* Visibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ==========================================================================
   § 20. PRINT STYLES
   ========================================================================== */

@media print {

    .navbar-morocco,
    .footer-morocco,
    .auth-panel-left,
    .btn,
    .lang-switcher,
    .user-menu {
        display: none;
    }

    body {
        color: #000;
        font-size: 12pt;
    }

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

    .complaints-table thead {
        background: #f5f5f5;
        color: #000;
    }

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