/* =====================================================
   Rayane Services - Main Stylesheet
   ألوان: أخضر + رمادي + أبيض
   ===================================================== */

:root {
    --primary-green: #2E7D32;
    --primary-green-light: #4CAF50;
    --primary-green-dark: #1B5E20;
    --accent-green: #66BB6A;
    --gray-dark: #333333;
    --gray-medium: #666666;
    --gray-light: #E0E0E0;
    --gray-lighter: #F5F5F5;
    --white: #FFFFFF;
    --red: #D32F2F;
    --orange: #F57C00;
    --blue: #1976D2;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --radius-sm: 4px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Cairo', 'Tahoma', sans-serif;
    background: var(--gray-lighter);
    color: var(--gray-dark);
    line-height: 1.6;
    min-height: 100vh;
}

body[dir="ltr"] {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

/* =====================================================
   Login Page — Glassmorphism
   ===================================================== */

/* ---- background ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: safe center;
    justify-content: center;
    position: relative;
    overflow-y: auto;
    overflow: hidden;
    /* Sky gradient */
    background: linear-gradient(180deg,
        #87CEEB 0%,
        #a8d8a0 35%,
        #4CAF50 60%,
        #2E7D32 100%
    );
    padding: 20px;
}

/* Hill layers */
.login-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

.hill {
    position: absolute;
    border-radius: 50%;
}

.hill-1 {
    width: 160%;
    height: 55%;
    bottom: -18%;
    left: -30%;
    background: radial-gradient(ellipse at 50% 100%, #1B5E20 60%, #2E7D32 100%);
}

.hill-2 {
    width: 120%;
    height: 45%;
    bottom: -12%;
    left: -10%;
    background: radial-gradient(ellipse at 50% 100%, #256427 60%, #388E3C 100%);
}

.hill-3 {
    width: 100%;
    height: 38%;
    bottom: -8%;
    right: -15%;
    background: radial-gradient(ellipse at 50% 100%, #33691E 60%, #558B2F 100%);
}

/* subtle light blob top-left */
.login-page::after {
    content: '';
    position: absolute;
    top: -15%;
    left: -10%;
    width: 55%;
    height: 55%;
    background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ---- watermelon decoration ---- */
.wm-decor {
    position: absolute;
    right: 7%;
    bottom: 20%;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    /* Green striped rind with 3-D highlight */
    background:
        radial-gradient(circle at 32% 28%, rgba(165,214,167,.55) 0%, transparent 38%),
        repeating-linear-gradient(
            -32deg,
            transparent 0px, transparent 13px,
            rgba(27,94,32,.38) 13px, rgba(27,94,32,.38) 26px
        ),
        linear-gradient(145deg, #56A35A 0%, #2E7D32 55%, #1B5E20 100%);
    box-shadow:
        0 24px 60px rgba(0,0,0,.5),
        0  0  0  4px rgba(255,255,255,.12),
        inset 0 -8px 20px rgba(0,0,0,.2);
    transform: rotate(-14deg);
    animation: wmFloat 5s ease-in-out infinite;
    z-index: 1;
}

/* white inner rind */
.wm-decor::before {
    content: '';
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    background: #e8f5e2;
    box-shadow: inset 0 3px 10px rgba(0,0,0,.08);
}

/* red flesh + seeds */
.wm-decor::after {
    content: '';
    position: absolute;
    inset: 32px;
    border-radius: 50%;
    background:
        /* seeds */
        radial-gradient(ellipse 5px 9px at 37% 31%, #111 98%, transparent),
        radial-gradient(ellipse 5px 9px at 57% 27%, #111 98%, transparent),
        radial-gradient(ellipse 5px 9px at 47% 21%, #111 98%, transparent),
        radial-gradient(ellipse 5px 9px at 27% 47%, #111 98%, transparent),
        radial-gradient(ellipse 5px 9px at 65% 50%, #111 98%, transparent),
        radial-gradient(ellipse 5px 9px at 43% 63%, #111 98%, transparent),
        radial-gradient(ellipse 5px 9px at 58% 68%, #111 98%, transparent),
        radial-gradient(ellipse 5px 9px at 31% 67%, #111 98%, transparent),
        radial-gradient(ellipse 5px 9px at 71% 37%, #111 98%, transparent),
        radial-gradient(ellipse 5px 9px at 21% 29%, #111 98%, transparent),
        radial-gradient(ellipse 5px 9px at 52% 44%, #111 98%, transparent),
        /* shine on flesh */
        radial-gradient(circle at 28% 28%, rgba(255,255,255,.28) 0%, transparent 32%),
        /* flesh gradient */
        radial-gradient(circle at 40% 40%, #ff8a80 0%, #f44336 38%, #d32f2f 68%, #b71c1c 100%);
    box-shadow: inset 0 4px 18px rgba(0,0,0,.15);
}

@keyframes wmFloat {
    0%, 100% { transform: rotate(-14deg) translateY(0);     }
    50%       { transform: rotate(-14deg) translateY(-18px); }
}

/* hide watermelon & trucks on small screens */
@media (max-width: 960px) {
    .wm-decor    { display: none; }
    .truck-scene { display: none; }
}

/* ===================================================
   Truck scene — left side
   =================================================== */
.truck-scene {
    position: absolute;
    left: 3%;
    bottom: 19%;
    z-index: 1;
}

/* ---- shared truck styles ---- */
.truck {
    position: relative;
    margin-bottom: 14px; /* room for wheels */
}

.truck-1 {
    filter: drop-shadow(0 12px 28px rgba(0,0,0,.55));
    animation: truck1Float 5s ease-in-out infinite;
}

@keyframes truck1Float {
    0%, 100% { transform: translateY(0);     }
    50%       { transform: translateY(-12px); }
}

/* ---- truck body (trailer + cab side by side) ---- */
.t-body {
    display: flex;
    align-items: flex-end;
}

/* ---- cargo container (trailer) ---- */
.t-cargo {
    width: 200px;
    height: 88px;
    background: linear-gradient(180deg, #FAFAFA 0%, #CFD8DC 100%);
    border: 2px solid #90A4AE;
    border-radius: 4px 4px 0 0;
    position: relative;
    overflow: hidden;
}

/* green branded stripe with company name */
.t-cargo::before {
    content: 'RAYANE';
    position: absolute;
    top: 25px;
    left: 0; right: 0;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background: #2E7D32;
    color: rgba(255,255,255,.95);
    font-size: 10px;
    font-weight: 900;
    font-family: 'Cairo', sans-serif;
    letter-spacing: 3px;
    z-index: 2;
}

/* vertical panel rivet lines */
.t-cargo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent      0px,
        transparent      40px,
        rgba(0,0,0,.12)  40px,
        rgba(0,0,0,.12)  42px
    );
    z-index: 1;
}

/* ---- cab (driver cabin) ---- */
.t-cab {
    width: 64px;
    height: 82px;
    background: linear-gradient(155deg, #43A047 0%, #1B5E20 100%);
    border: 2px solid #1B5E20;
    border-radius: 3px 11px 0 0;
    position: relative;
    margin-left: 3px;
    overflow: visible;
    z-index: 3;
    /* roof spoiler */
    box-shadow: inset -3px 0 0 rgba(0,0,0,.2);
}

/* roof air-deflector */
.t-cab::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0; right: 6px;
    height: 12px;
    background: linear-gradient(180deg, #33691E 0%, #2E7D32 100%);
    border-radius: 4px 8px 0 0;
}

/* bottom step / bumper */
.t-cab::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 2px; right: 2px;
    height: 6px;
    background: #37474F;
    border-radius: 2px;
}

/* windshield */
.t-win {
    position: absolute;
    top: 12px;
    left: 7px; right: 9px;
    height: 30px;
    background: linear-gradient(135deg,
        rgba(144,202,249,.9) 0%,
        rgba(30,136,229,.65) 100%
    );
    border-radius: 2px 7px 2px 2px;
    border: 1.5px solid rgba(255,255,255,.4);
    box-shadow: inset 0 1px 3px rgba(255,255,255,.5);
}

/* headlight */
.t-light {
    position: absolute;
    bottom: 12px;
    right: 5px;
    width: 14px;
    height: 9px;
    background: #FFF9C4;
    border-radius: 2px;
    box-shadow: 0 0 8px 3px rgba(255,236,64,.65);
}

/* ---- wheels ---- */
.t-wheels {
    position: absolute;
    bottom: -14px;
    left: 10px;
    right: 2px;
    display: flex;
    justify-content: space-between;
    z-index: 5;
}

.t-wheels span {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    /* tire + rim using radial-gradient */
    background: radial-gradient(circle,
        #9E9E9E 0%,
        #9E9E9E 28%,
        #212121 28%,
        #212121 62%,
        #616161 62%,
        #616161 73%,
        #212121 73%
    );
    box-shadow: 0 3px 6px rgba(0,0,0,.6);
}

/* ---- glassmorphism card ---- */
.login-glass-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 24px;
    padding: 20px 36px 20px;
    margin: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.5);
    animation: glassCardIn .55s cubic-bezier(.22,.68,0,1.2) both;
}

@keyframes glassCardIn {
    from { opacity: 0; transform: translateY(32px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ---- logo & header ---- */
.login-glass-logo {
    text-align: center;
    margin-bottom: 8px;
}

.login-glass-logo img {
    width: clamp(110px, 22vh, 200px);
    height: clamp(110px, 22vh, 200px);
    object-fit: contain;
    margin-bottom: 4px;
    filter: drop-shadow(0 4px 18px rgba(0,0,0,.55)) drop-shadow(0 0 32px rgba(255,255,255,.25));
    transition: transform .3s ease;
}

.login-glass-logo img:hover {
    transform: scale(1.06);
}

.login-glass-logo h1 {
    color: #fff;
    font-size: clamp(18px, 2.5vh, 24px);
    font-weight: 700;
    margin: 0 0 2px;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.login-glass-logo p {
    color: rgba(255,255,255,.80);
    font-size: clamp(11px, 1.5vh, 13px);
    margin: 0;
}

/* ---- error ---- */
.login-error {
    background: rgba(211,47,47,.35);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    border-radius: 10px;
    padding: 8px 14px;
    margin-bottom: 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- input fields ---- */
.login-field {
    position: relative;
    margin-bottom: 10px;
}

.login-field-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #69F0AE;
    text-shadow: 0 0 8px rgba(105,240,174,.6);
    font-size: 15px;
    pointer-events: none;
    z-index: 1;
}

[dir="ltr"] .login-field-icon { left: 14px; }
[dir="rtl"] .login-field-icon { right: 14px; }

.login-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-family: 'Cairo', sans-serif;
    padding: 10px 16px;
    outline: none;
    transition: border-color .2s, background .2s;
}

[dir="ltr"] .login-input { padding-left: 42px; }
[dir="rtl"] .login-input { padding-right: 42px; }

/* eye button — add right padding so text doesn't overlap */
.login-field:has(.login-eye-btn) .login-input {
    padding-right: 42px;
}
[dir="rtl"] .login-field:has(.login-eye-btn) .login-input {
    padding-right: 42px;
    padding-left: 42px;
}

.login-input::placeholder { color: rgba(255,255,255,.6); }

.login-input:focus {
    border-color: rgba(255,255,255,.7);
    background: rgba(255,255,255,.25);
}

.login-eye-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #69F0AE;
    text-shadow: 0 0 8px rgba(105,240,174,.6);
    cursor: pointer;
    font-size: 15px;
    padding: 4px 6px;
    z-index: 1;
    line-height: 1;
    transition: color .2s;
}

.login-eye-btn:hover {
    color: #B9F6CA;
}

[dir="ltr"] .login-eye-btn { right: 12px; }
[dir="rtl"] .login-eye-btn { left: 12px; }

/* ---- submit button ---- */
.login-submit-btn {
    width: 100%;
    padding: 11px;
    margin-top: 6px;
    background: linear-gradient(135deg, #43A047 0%, #1B5E20 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 18px rgba(27,94,32,.5);
    transition: transform .15s, box-shadow .15s, filter .15s;
}

.login-submit-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(27,94,32,.6);
}

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

/* ---- remember me ---- */
.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.85);
    font-size: 14px;
    cursor: pointer;
    margin: 4px 0 8px;
    user-select: none;
}
.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #69F0AE;
    cursor: pointer;
    flex-shrink: 0;
}

/* ---- footer text ---- */
.login-glass-footer {
    text-align: center;
    margin-top: 10px;
    color: rgba(255,255,255,.6);
    font-size: 12px;
}

.login-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 16px;
    background: rgba(37, 211, 102, 0.18);
    border: 1px solid rgba(37, 211, 102, 0.45);
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background .2s, border-color .2s;
}
.login-whatsapp-btn:hover {
    background: rgba(37, 211, 102, 0.35);
    border-color: rgba(37, 211, 102, 0.8);
    color: #fff;
    text-decoration: none;
}
.login-whatsapp-btn .fab {
    font-size: 20px;
    color: #25d366;
    flex-shrink: 0;
}

/* ---- language switcher (top corner) ---- */
.login-lang-switcher {
    position: fixed;
    top: 18px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

[dir="ltr"] .login-lang-switcher { right: 18px; }
[dir="rtl"] .login-lang-switcher { left: 18px; }

.login-lang-btn {
    padding: 5px 14px;
    background: rgba(255,255,255,.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.4);
    color: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, border-color .2s;
}

.login-lang-btn:hover,
.login-lang-btn.active {
    background: rgba(255,255,255,.4);
    border-color: rgba(255,255,255,.7);
}

/* keep old .lang-btn for any other reference */
.lang-btn {
    padding: 6px 14px;
    background: var(--white);
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
}

.lang-btn:hover, .lang-btn.active {
    background: var(--primary-green);
    color: var(--white);
}

/* ---- login responsive ---- */
@media (max-width: 480px) {
    .login-glass-card  { padding: 16px 20px 16px; }
    .login-glass-logo  { margin-bottom: 6px; }
}

@media (max-width: 360px) {
    .login-glass-card  { padding: 12px 16px 14px; margin: 10px; }
}

/* screens shorter than 680px — shrink spacing further */
@media (max-height: 680px) {
    .login-glass-logo  { margin-bottom: 4px; }
    .login-glass-card  { padding: 14px 32px 14px; }
    .login-field       { margin-bottom: 8px; }
    .login-glass-footer{ margin-top: 6px; }
    .login-submit-btn  { padding: 9px; }
}

/* =====================================================
   Forms
   ===================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--gray-dark);
    font-weight: 600;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-green);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-green-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--gray-medium);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--gray-dark);
}

.btn-danger {
    background: var(--red);
    color: var(--white);
}

.btn-danger:hover {
    background: #B71C1C;
}

.btn-warning {
    background: var(--orange);
    color: var(--white);
}

.btn-info {
    background: var(--blue);
    color: var(--white);
}

.btn-success {
    background: var(--accent-green);
    color: var(--white);
}

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

.btn-lg {
    padding: 14px 32px;
    font-size: 17px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

/* =====================================================
   Alerts
   ===================================================== */
.alert {
    padding: 12px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}

[dir="rtl"] .alert {
    border-left: none;
    border-right: 4px solid;
}

.alert-success {
    background: #E8F5E9;
    color: var(--primary-green-dark);
    border-color: var(--primary-green);
}

.alert-danger {
    background: #FFEBEE;
    color: var(--red);
    border-color: var(--red);
}

.alert-warning {
    background: #FFF3E0;
    color: var(--orange);
    border-color: var(--orange);
}

.alert-info {
    background: #E3F2FD;
    color: var(--blue);
    border-color: var(--blue);
}

/* =====================================================
   RTL scrollbar roles swap — desktop only (sidebar visible)
   ===================================================== */
@media (min-width: 993px) {
    /* main-content becomes its own scroll container */
    [dir="rtl"] .main-content {
        height: 100vh;
        overflow-y: auto;
        direction: ltr;
    }
    /* restore RTL for everything inside main-content */
    [dir="rtl"] .main-content .topbar,
    [dir="rtl"] .main-content .content-wrapper {
        direction: rtl;
    }
    /* sidebar scrollbar → far right edge of screen */
    [dir="rtl"] .sidebar {
        direction: ltr;
    }
    [dir="rtl"] .sidebar > * {
        direction: rtl;
    }
}

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

.sidebar {
    width: 260px;
    background: var(--white);
    box-shadow: var(--shadow);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition);
}

[dir="rtl"] .sidebar {
    right: 0;
}

[dir="ltr"] .sidebar {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-light);
    text-align: center;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
    color: var(--white);
}

.sidebar-header img {
    max-width: 80px;
    height: auto;
    margin-bottom: 10px;
    border-radius: 50%;
    background: var(--white);
    padding: 8px;
}

.sidebar-header h3 {
    font-size: 16px;
    margin: 0;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 0;
}

.sidebar-menu li {
    margin-bottom: 2px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--gray-dark);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
}

.sidebar-menu a:hover {
    background: var(--gray-lighter);
    color: var(--primary-green);
}

.sidebar-menu a.active {
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    color: var(--white);
}

[dir="rtl"] .sidebar-menu a.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-green-dark);
}

[dir="ltr"] .sidebar-menu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-green-dark);
}

.sidebar-menu i {
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-right: 260px;
    padding: 0;
}

[dir="ltr"] .main-content {
    margin-right: 0;
    margin-left: 260px;
}

.topbar {
    background: var(--white);
    padding: 15px 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--gray-dark);
    cursor: pointer;
}

/* Mobile nav — hidden by default on desktop */
.mobile-nav-backdrop,
.mobile-nav-menu { display: none; }

.page-title {
    font-size: 20px;
    color: var(--primary-green-dark);
    font-weight: 700;
}

/* Notifications */
.notif-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--gray-dark);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.notif-btn:hover {
    background: var(--gray-lighter);
    color: var(--primary-green);
}

.notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--red);
    color: var(--white);
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

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

.notif-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    box-shadow: var(--shadow-hover);
    border-radius: var(--radius);
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    margin-top: 10px;
    z-index: 1000;
}

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

.notif-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

.notif-dropdown-header {
    padding: 15px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-lighter);
    cursor: pointer;
    transition: var(--transition);
}

.notif-item:hover {
    background: var(--gray-lighter);
}

.notif-item.unread {
    background: #E8F5E9;
}

.notif-item .notif-title {
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 4px;
}

.notif-item .notif-message {
    color: var(--gray-medium);
    font-size: 13px;
    margin-bottom: 4px;
}

.notif-item .notif-time {
    color: var(--gray-medium);
    font-size: 11px;
}

/* User dropdown */
.user-info {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.user-info:hover {
    background: var(--gray-lighter);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-green);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    color: var(--gray-medium);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    box-shadow: var(--shadow-hover);
    border-radius: var(--radius);
    min-width: 200px;
    display: none;
    margin-top: 10px;
    z-index: 1000;
}

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

.user-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: var(--gray-dark);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.user-dropdown a:hover {
    background: var(--gray-lighter);
    color: var(--primary-green);
}

.content-wrapper {
    padding: 30px;
}

/* =====================================================
   Cards & Stats
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    border-left: 4px solid var(--primary-green);
}

[dir="rtl"] .stat-card {
    border-left: none;
    border-right: 4px solid var(--primary-green);
}

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

.stat-card.success { border-color: var(--accent-green); }
.stat-card.warning { border-color: var(--orange); }
.stat-card.info { border-color: var(--blue); }
.stat-card.danger { border-color: var(--red); }

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-card.success .stat-icon { background: linear-gradient(135deg, var(--accent-green) 0%, #81C784 100%); }
.stat-card.warning .stat-icon { background: linear-gradient(135deg, var(--orange) 0%, #FFB74D 100%); }
.stat-card.info .stat-icon { background: linear-gradient(135deg, var(--blue) 0%, #64B5F6 100%); }
.stat-card.danger .stat-icon { background: linear-gradient(135deg, var(--red) 0%, #EF5350 100%); }

.stat-info h3 {
    font-size: 28px;
    color: var(--gray-dark);
    margin-bottom: 4px;
    font-weight: 700;
}

.stat-info p {
    color: var(--gray-medium);
    font-size: 14px;
    margin: 0;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 18px 25px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-lighter);
}

.card-header h3 {
    margin: 0;
    color: var(--primary-green-dark);
    font-size: 18px;
    font-weight: 700;
}

.card-body {
    padding: 25px;
}

/* =====================================================
   Tables
   ===================================================== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    background: var(--white);
}

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

.data-table thead {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
    color: var(--white);
}

.data-table th {
    padding: 14px 12px;
    text-align: inherit;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #c8d8c8;
    font-size: 14px;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:nth-child(even) {
    background: #f7fbf7;
}

.data-table tbody tr:hover {
    background: #eaf4ea;
}

.data-table tbody tr:nth-child(even):hover {
    background: #eaf4ea;
}

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

/* ── فواصل عمودية بين الأعمدة ── */
[dir="rtl"] .data-table th + th,
[dir="rtl"] .data-table td + td {
    border-right: 1px solid rgba(0, 0, 0, 0.07);
}
[dir="ltr"] .data-table th + th,
[dir="ltr"] .data-table td + td {
    border-left: 1px solid rgba(0, 0, 0, 0.07);
}
[dir="rtl"] .data-table thead th + th {
    border-right-color: rgba(255, 255, 255, 0.2);
}
[dir="ltr"] .data-table thead th + th {
    border-left-color: rgba(255, 255, 255, 0.2);
}
.data-table {
    border: 1px solid var(--gray-light);
}

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #C8E6C9; color: var(--primary-green-dark); }
.badge-danger { background: #FFCDD2; color: var(--red); }
.badge-warning { background: #FFE0B2; color: var(--orange); }
.badge-info { background: #BBDEFB; color: var(--blue); }

/* =====================================================
   Forms
   ===================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-light);
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-group .form-control {
    flex: 1;
}

/* =====================================================
   Search Bar
   ===================================================== */
.search-bar {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.search-bar .form-grid {
    align-items: end;
}

/* =====================================================
   Charts
   ===================================================== */
.chart-container {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.chart-container h3 {
    margin-bottom: 20px;
    color: var(--primary-green-dark);
    font-size: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-lighter);
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

/* =====================================================
   Pagination
   ===================================================== */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--gray-light);
    color: var(--gray-dark);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary-green);
    color: var(--white);
    border-color: var(--primary-green);
}

.pagination .active {
    background: var(--primary-green);
    color: var(--white);
    border-color: var(--primary-green);
}

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

/* =====================================================
   Modal
   ===================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto; /* يسمح بالتمرير إذا كانت الشاشة صغيرة جداً */
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    max-width: 600px;
    width: 100%;
    /* هيكل flex رأسي: header ثابت + body قابل للتمرير + footer ثابت */
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px); /* 2 × padding الـ overlay */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin: auto; /* يضمن التوسيط داخل overlay القابل للتمرير */
}

.modal-header {
    padding: 18px 25px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-lighter);
    flex-shrink: 0; /* لا يتقلص — يبقى ظاهراً دائماً */
    border-radius: var(--radius) var(--radius) 0 0;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-green-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-medium);
    line-height: 1;
    padding: 0 4px;
}

.modal-body {
    padding: 25px;
    overflow-y: auto; /* التمرير هنا فقط — الهيدر والفوتر يبقيان ثابتَين */
    flex: 1;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--gray-light);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0; /* لا يتقلص — يبقى ظاهراً دائماً */
    border-radius: 0 0 var(--radius) var(--radius);
}

/* نافذة أعرض (للمستخدمين وغيرها) */
.modal.modal-lg { max-width: 750px; }

/* ── Modal على الهاتف ─────────────────────────── */
@media (max-width: 600px) {
    .modal-overlay {
        padding: 8px;
        align-items: flex-start;
    }
    .modal {
        max-width: 100%;
        max-height: calc(100vh - 16px);
        margin: 8px auto;
    }
    .modal-header {
        padding: 13px 16px;
    }
    .modal-body {
        padding: 16px;
    }
    .modal-footer {
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    .modal-footer .btn {
        flex: 1;
        justify-content: center;
    }
}

/* =====================================================
   Logo in login
   ===================================================== */
.rayane-logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
}

.rayane-logo-svg {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--white);
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

/* =====================================================
   Responsive — Full System
   ===================================================== */

/* ── Sidebar overlay (mobile backdrop) ─────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ── Tablet  ≤ 992px ────────────────────────────────── */
@media (max-width: 992px) {
    /* Hide sidebar — replaced by mobile nav dropdown */
    .sidebar        { display: none !important; }
    .sidebar-overlay{ display: none !important; }

    /* Main content fills full width */
    .main-content  { margin-right: 0; margin-left: 0; }
    .content-wrapper { padding: 15px; }

    /* ── Three-dots toggle button ── */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        background: none;
        border: none;
        cursor: pointer;
        border-radius: 8px;
        transition: background .2s;
        padding: 0;
    }
    .menu-toggle:hover,
    .menu-toggle.open { background: rgba(0,0,0,.07); }
    .three-dots { display: flex; flex-direction: column; align-items: center; gap: 4px; }
    .three-dots b {
        display: block;
        width: 5px; height: 5px;
        border-radius: 50%;
        background: var(--gray-dark);
        transition: background .2s, transform .2s;
    }
    .menu-toggle.open .three-dots b { background: var(--primary-green); }

    /* ── Mobile nav backdrop ── */
    .mobile-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 300;
        opacity: 0;
        pointer-events: none;
        transition: opacity .3s;
    }
    .mobile-nav-backdrop.show { opacity: 1; pointer-events: all; }

    /* ── Mobile nav menu panel ── */
    .mobile-nav-menu {
        display: block;
        position: fixed;
        top: 0; left: 0; right: 0;
        z-index: 301;
        background: #fff;
        box-shadow: 0 8px 32px rgba(0,0,0,.2);
        border-radius: 0 0 18px 18px;
        transform: translateY(-110%);
        transition: transform .35s cubic-bezier(.4,0,.2,1);
        max-height: 88vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .mobile-nav-menu.show { transform: translateY(0); }

    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 20px;
        background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
        color: #fff;
    }
    .mobile-nav-user { display: flex; align-items: center; gap: 12px; }
    .mobile-nav-avatar {
        width: 42px; height: 42px;
        border-radius: 50%;
        background: rgba(255,255,255,.25);
        display: flex; align-items: center; justify-content: center;
        font-size: 18px; font-weight: 700;
        border: 2px solid rgba(255,255,255,.5);
    }
    .mobile-nav-close {
        background: rgba(255,255,255,.2);
        border: none;
        color: #fff;
        width: 34px; height: 34px;
        border-radius: 50%;
        font-size: 16px;
        cursor: pointer;
        display: flex; align-items: center; justify-content: center;
        transition: background .2s;
    }
    .mobile-nav-close:hover { background: rgba(255,255,255,.35); }

    .mobile-nav-link {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 15px 22px;
        color: var(--gray-dark);
        text-decoration: none;
        font-size: 15px;
        font-weight: 500;
        border-bottom: 1px solid #f3f3f3;
        transition: background .15s, color .15s;
    }
    .mobile-nav-link:last-child { border-bottom: none; }
    .mobile-nav-link i { width: 22px; text-align: center; font-size: 16px; color: var(--gray-medium); transition: color .15s; }
    .mobile-nav-link:active { background: #f5f5f5; }
    .mobile-nav-link.active {
        background: linear-gradient(90deg, #e8f5e9, #f1f8f1);
        color: var(--primary-green);
        font-weight: 700;
    }
    .mobile-nav-link.active i { color: var(--primary-green); }
    .mobile-nav-logout { color: #c62828; margin-top: 4px; border-top: 2px solid #fce4e4; }
    .mobile-nav-logout i { color: #c62828; }

    /* Grids collapse to single column */
    .stats-grid,
    .chart-grid,
    .form-grid     { grid-template-columns: 1fr !important; }

    /* Reports inline grids */
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Season picker — smaller text */
    .season-picker-btn span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* Card headers wrap gracefully */
    .card-header { flex-wrap: wrap; gap: 10px; }
    .card-header > div,
    .card-header > a { flex-shrink: 0; }

    /* Modal full-width — تم نقله إلى قسم Modal الخاص به أعلاه */

    /* Topbar gap shrink */
    .topbar-right { gap: 10px; }
    .topbar { padding: 10px 15px; }
}

/* ── Mobile  ≤ 600px ────────────────────────────────── */
@media (max-width: 600px) {
    /* Login */
    .login-glass-card { padding: 14px 18px 16px; }

    /* Topbar — icon-only mode */
    .topbar { padding: 10px 12px; }
    .topbar-right { gap: 6px; }
    .page-title { font-size: 16px; max-width: 130px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .user-name, .user-role { display: none; }

    /* Season picker — icon only on very small */
    .season-picker-btn span { display: none; }
    .season-picker-btn { padding: 6px 10px; gap: 4px; }
    .season-picker-dropdown { min-width: 220px; }
    [dir="rtl"] .season-picker-dropdown { right: auto; left: 0; }
    [dir="ltr"] .season-picker-dropdown { left: auto; right: 0; }

    /* Lang button — compact */
    .lang-btn { padding: 5px 10px; font-size: 12px; }

    /* Stat cards */
    .stat-card { padding: 15px; gap: 12px; }
    .stat-icon { width: 48px; height: 48px; font-size: 18px; }
    .stat-info h3 { font-size: 22px; }

    /* Tables */
    .data-table { font-size: 12px; }
    .data-table th,
    .data-table td { padding: 8px 6px; white-space: nowrap; }

    /* Action buttons — tighter */
    .table-actions { gap: 3px; }
    .btn-sm { padding: 5px 8px; font-size: 12px; }

    /* Cards */
    .card-header h3 { font-size: 15px; }
    .card-header { padding: 12px 15px; }
    .card-body { padding: 12px 15px; }

    /* Buttons in card header — wrap & shrink */
    .card-header .btn { padding: 7px 12px; font-size: 13px; }

    /* Notifications dropdown */
    .notif-dropdown { min-width: 280px; }
    [dir="rtl"] .notif-dropdown { right: -60px; }
    [dir="ltr"] .notif-dropdown { left: -60px; }

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

    /* Forms */
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; justify-content: center; }

    /* Pagination */
    .pagination { justify-content: center; flex-wrap: wrap; }

    /* Content padding */
    .content-wrapper { padding: 10px; }

    /* Inline flex filters wrap */
    [style*="display:flex"][style*="gap"] { flex-wrap: wrap !important; }
}

/* =====================================================
   Print Styles
   ===================================================== */
@media print {
    .sidebar, .topbar, .no-print {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
    }
    
    .content-wrapper {
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc;
    }
    
    body {
        background: white !important;
    }
}

/* =====================================================
   Utilities
   ===================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.hidden { display: none; }

/* Loader */
.loader {
    border: 4px solid var(--gray-light);
    border-top: 4px solid var(--primary-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* File upload */
.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 25px;
    background: var(--gray-lighter);
    border: 2px dashed var(--gray-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray-medium);
}

.file-upload-label:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    background: #F1F8E9;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: var(--gray-lighter);
    border-radius: var(--radius);
    margin-top: 10px;
}

.file-preview img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.file-preview-info {
    flex: 1;
}

.file-preview-name {
    font-weight: 600;
    font-size: 14px;
}

.file-preview-size {
    font-size: 12px;
    color: var(--gray-medium);
}

/* =====================================================
   Season Picker (Topbar)
   ===================================================== */
.season-picker-wrapper {
    position: relative;
}

.season-picker-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-green);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .2s;
}

.season-picker-btn:hover {
    background: #1B5E20;
}

.season-picker-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,.15);
    min-width: 210px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 1100;
}

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

.season-picker-dropdown.show {
    display: block;
    animation: fadeIn .2s ease;
}

.season-picker-header {
    padding: 10px 15px;
    font-size: 11px;
    color: var(--gray-medium);
    border-bottom: 1px solid var(--gray-light);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.season-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    transition: background .15s;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
}

.season-option:hover {
    background: var(--gray-lighter);
    color: var(--primary-green);
}

.season-option.active {
    background: #e8f5e9;
    color: var(--primary-green);
    font-weight: 600;
}

.season-active-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-green);
    margin-inline-start: auto;
    flex-shrink: 0;
}

.season-picker-footer {
    border-top: 1px solid var(--gray-light);
    padding: 8px;
}

.season-manage-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f5f5f5;
    color: var(--primary-green);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s;
    white-space: nowrap;
}

.season-manage-btn:hover { background: #e8f5e9; }

/* =====================================================
   Dynamic Animations — Round 10
   ===================================================== */

/* ── Keyframes ───────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0);    }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.88); }
    to   { opacity: 1; transform: scale(1);    }
}

@keyframes rippleEffect {
    from { transform: scale(0);   opacity: .45; }
    to   { transform: scale(2.8); opacity: 0;   }
}

@keyframes pulseRing {
    0%   { box-shadow: 0 0 0 0   rgba(46,125,50,.55); }
    70%  { box-shadow: 0 0 0 7px rgba(46,125,50,0);   }
    100% { box-shadow: 0 0 0 0   rgba(46,125,50,0);   }
}

@keyframes slideInAlert {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0);    }
}

/* ── Page wrapper entrance ───────────────────────────── */
.content-wrapper {
    animation: fadeInUp .45s ease both;
}

/* ── Stat cards ──────────────────────────────────────── */
.stat-card {
    animation: scaleIn .5s ease both;
    transition: transform .25s ease, box-shadow .25s ease;
}
.stats-grid .stat-card:nth-child(1) { animation-delay: .05s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: .12s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: .19s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: .26s; }
.stats-grid .stat-card:nth-child(5) { animation-delay: .33s; }
.stats-grid .stat-card:nth-child(6) { animation-delay: .40s; }

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 28px rgba(0,0,0,.13);
}

.stat-card .stat-icon {
    transition: transform .3s ease;
}
.stat-card:hover .stat-icon {
    transform: rotate(-8deg) scale(1.15);
}

/* ── Card reveal (IntersectionObserver) ──────────────── */
.card {
    transition: box-shadow .25s ease;
}
.card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.1);
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .5s ease, transform .5s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Table row hover nudge ───────────────────────────── */
.data-table tbody tr {
    transition: background .18s, transform .18s;
}
.data-table tbody tr:hover {
    transform: translateX(-3px);
}
[dir="ltr"] .data-table tbody tr:hover {
    transform: translateX(3px);
}

/* ── Button ripple ───────────────────────────────────── */
.btn {
    position: relative;
    overflow: hidden;
}
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    margin-top: -30px;
    margin-inline-start: -30px;
    background: rgba(255,255,255,.35);
    pointer-events: none;
    animation: rippleEffect .55s ease-out forwards;
}

/* ── Alert slide-in ──────────────────────────────────── */
.alert, .message-box {
    animation: slideInAlert .35s ease both;
}

/* ── Topbar scroll shadow ────────────────────────────── */
.topbar {
    transition: box-shadow .3s ease;
}
.topbar.scrolled {
    box-shadow: 0 3px 16px rgba(0,0,0,.12);
}

/* ── Sidebar logo hover ──────────────────────────────── */
.sidebar-logo img,
.sidebar-logo svg {
    transition: transform .35s ease;
}
.sidebar-logo:hover img,
.sidebar-logo:hover svg {
    transform: scale(1.07) rotate(-3deg);
}

/* ── Sidebar nav link active bar ─────────────────────── */
.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 15%;
    height: 70%;
    width: 4px;
    background: var(--white);
    border-radius: 0 3px 3px 0;
    opacity: .85;
    animation: scaleIn .25s ease;
}
.sidebar-nav .nav-link {
    position: relative;
}

/* ── Notification badge pulse ────────────────────────── */
.notif-badge {
    animation: pulseRing 2s ease infinite;
}

/* ── Chart containers fade in ────────────────────────── */
.chart-container {
    animation: fadeInUp .55s ease both;
}

/* ── Reduced motion kill-switch ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* =====================================================
   Round 37 — Full Responsive Improvements
   ===================================================== */

/* ── Tables: global nowrap + min-widths ─────────────── */
.data-table th,
.data-table td {
    white-space: nowrap;
    vertical-align: middle;
}

/* Minimum width so tables scroll horizontally instead of squishing */
.data-table {
    min-width: 600px;
}

/* Scroll shadow indicator — visual hint on mobile */
.table-responsive {
    position: relative;
    -webkit-overflow-scrolling: touch;
}

.table-responsive::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(to left, rgba(255,255,255,.9) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 0 var(--radius) var(--radius) 0;
}

[dir="ltr"] .table-responsive::after {
    left: auto;
    right: 0;
}

[dir="rtl"] .table-responsive::after {
    right: auto;
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,.9) 0%, transparent 100%);
}

/* Hide shadow when not scrollable or on large screens */
@media (min-width: 1200px) {
    .table-responsive::after { display: none; }
}

/* ── EMBLAGE checkboxes — wrap on small screens ─────── */
#bagTypesContainer {
    flex-wrap: wrap;
    gap: 12px;
}

/* ── Cards full-width on mobile ─────────────────────── */
@media (max-width: 992px) {
    /* Fix modal max-width on tablet */
    .modal { width: 95%; max-width: 95%; }
    .modal.modal-lg { max-width: 95%; }

    /* Topbar — reduce padding */
    .topbar { padding: 10px 16px; }
    .topbar-left { gap: 10px; }
    .topbar-right { gap: 8px; }
}

@media (max-width: 600px) {
    /* Modal — almost full screen on phone */
    .modal { width: 98%; max-width: 98%; margin: 0 4px; }
    .modal-body { padding: 14px 16px; }
    .modal-header,
    .modal-footer { padding: 12px 16px; }

    /* Tables — even smaller font */
    .data-table { font-size: 11px; min-width: 500px; }
    .data-table th,
    .data-table td { padding: 7px 5px; }

    /* EMBLAGE section responsive */
    #bagTypesContainer { gap: 8px; }
    .bag-type-item { flex-wrap: wrap; }

    /* Buttons in table actions — icon only on small */
    .table-actions .btn-sm { padding: 5px 7px; font-size: 11px; }

    /* Form grid — single column (already forced in earlier breakpoint) */
    .form-group { margin-bottom: 14px; }
    .form-control { padding: 10px 12px; font-size: 14px; }

    /* Card body padding */
    .card-body { padding: 12px; }

    /* Stat cards — 2 per row on phone */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
    }
    .stat-card { padding: 14px 10px; gap: 10px; }
    .stat-icon { width: 40px; height: 40px; font-size: 16px; }
    .stat-info h3 { font-size: 20px; }
    .stat-info p  { font-size: 11px; }

    /* Season picker dropdown — full width on phone */
    .season-picker-dropdown {
        position: fixed;
        top: 60px;
        left: 8px !important;
        right: 8px !important;
        min-width: unset;
        width: calc(100vw - 16px);
    }

    /* Notifications dropdown — fix overflow */
    .notif-dropdown {
        position: fixed;
        top: 60px;
        min-width: unset;
        width: calc(100vw - 16px);
    }
    [dir="rtl"] .notif-dropdown { right: 8px !important; left: 8px !important; }
    [dir="ltr"] .notif-dropdown { left: 8px !important; right: 8px !important; }

    /* Page title — shorter */
    .page-title { max-width: 100px; font-size: 14px; }

    /* Backup log pre — smaller */
    pre { font-size: 11px !important; }
}

@media (max-width: 400px) {
    /* Very small phones (Galaxy A series, etc.) */
    .stats-grid { grid-template-columns: 1fr !important; }

    .card-header h3 { font-size: 14px; }
    .card-header .btn { padding: 6px 10px; font-size: 12px; }

    .topbar { padding: 8px 10px; }

    /* Login card — full width */
    .login-glass-card { padding: 12px 14px; margin: 8px; }

    /* Buttons full width in forms */
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }
}

/* ── Fix: multi-company filter on mobile ────────────── */
.mcf-dropdown {
    max-height: 280px;
    overflow-y: auto;
}

@media (max-width: 600px) {
    .mcf-wrapper { width: 100% !important; }
    .mcf-btn { width: 100%; justify-content: space-between; }
    .mcf-dropdown { width: 100%; left: 0 !important; right: 0 !important; }
}

/* ── Fix: content padding for all screens ───────────── */
.content-wrapper {
    padding: 20px;
}

@media (max-width: 768px)  { .content-wrapper { padding: 14px; } }
@media (max-width: 480px)  { .content-wrapper { padding: 10px; } }

/* ── Fix: user-dropdown position on mobile ──────────── */
@media (max-width: 600px) {
    .user-info { cursor: pointer; }
    .user-dropdown {
        position: fixed;
        top: 60px;
        right: 8px;
        left: auto;
        min-width: 200px;
        z-index: 2000;
    }
    [dir="rtl"] .user-dropdown { right: 8px; left: auto; }
}

/* ── Fix: badge text wrap ────────────────────────────── */
.badge {
    white-space: nowrap;
    display: inline-block;
}

/* ── Fix: long words break in cells (for Arabic) ─────── */
.data-table td {
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Allow some cells to show full content */
.data-table td:first-child,
.data-table td.no-truncate { max-width: none; }

/* ── Fix: chart containers on mobile ─────────────────── */
@media (max-width: 600px) {
    .chart-container canvas { max-height: 200px !important; }
}

/* ── Fix: page title bar (topbar) height consistency ─── */
.topbar { min-height: 60px; }
