/* =============================================================
   VISUAL OVERHAUL â€” Soft Shadows Â· Micro-interactions Â· Icons
   v2.0 â€” Premium Aesthetic Enhancement Layer
   ============================================================= */

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 1 â€” CSS TOKENS (Colored Shadow System)
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
:root {
    /* Colored soft shadows derived from brand colors */
    --shadow-blue-sm: 0 2px 8px -1px rgba(37, 99, 235, 0.10), 0 1px 4px -1px rgba(37, 99, 235, 0.06);
    --shadow-blue-md: 0 6px 16px -2px rgba(37, 99, 235, 0.15), 0 2px 6px -1px rgba(37, 99, 235, 0.08);
    --shadow-blue-lg: 0 10px 28px -4px rgba(37, 99, 235, 0.20), 0 4px 10px -2px rgba(37, 99, 235, 0.10);
    --shadow-blue-hover: 0 14px 36px -4px rgba(37, 99, 235, 0.28), 0 4px 12px -2px rgba(37, 99, 235, 0.14);

    --shadow-green-md: 0 6px 16px -2px rgba(16, 185, 129, 0.14), 0 2px 6px -1px rgba(16, 185, 129, 0.07);
    --shadow-green-hover: 0 12px 28px -4px rgba(16, 185, 129, 0.25), 0 4px 10px -2px rgba(16, 185, 129, 0.12);

    --shadow-red-md: 0 6px 16px -2px rgba(239, 68, 68, 0.14), 0 2px 6px -1px rgba(239, 68, 68, 0.07);
    --shadow-red-hover: 0 12px 28px -4px rgba(239, 68, 68, 0.22), 0 4px 10px -2px rgba(239, 68, 68, 0.11);

    --shadow-amber-md: 0 6px 16px -2px rgba(217, 119, 6, 0.13), 0 2px 6px -1px rgba(217, 119, 6, 0.07);
    --shadow-amber-hover: 0 12px 28px -4px rgba(217, 119, 6, 0.22), 0 4px 10px -2px rgba(217, 119, 6, 0.11);

    /* Neutral soft shadow for white/light cards */
    --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
    --shadow-card-hover: 0 2px 6px rgba(15, 23, 42, 0.05), 0 8px 20px -4px rgba(15, 23, 42, 0.09);

    /* Micro-interaction timings */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
    --dur-fast: 160ms;
    --dur-normal: 250ms;
    --dur-slow: 380ms;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 2 â€” ICON SPACING (12px rule, RTL-safe)
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* Universal: any icon that is a direct sibling of text inside a button/item */
button>i:first-child,
a>i:first-child,
.btn-primary>i,
.btn-secondary>i,
.btn-danger>i,
.btn-matrix>i,
.royal-action-btn>i,
.danger-outline-btn>i,
.btn-add-modern>i,
.btn-setup-action>i,
.nav-item>i,
.modern-badge>i,
.stat-card>i,
.report-card-modern h4>i {
    margin-left: 12px;
    /* RTL: icon is on the right, space goes left */
    margin-right: 0;
    flex-shrink: 0;
    opacity: 0.85;
    transition: opacity var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out);
}

/* Buttons that already handle gap via flex â€” still maintain min margin */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-matrix,
.royal-action-btn,
.danger-outline-btn {
    gap: 10px;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 3 â€” GLOBAL SHADOW OVERHAUL
   Replace harsh black shadows with soft colored ones
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* --- Cards & Containers --- */
.settings-premium-box {
    box-shadow: var(--shadow-card) !important;
    transition: box-shadow var(--dur-normal) var(--ease-out),
        transform var(--dur-normal) var(--ease-out);
}

.settings-premium-box:hover {
    box-shadow: var(--shadow-card-hover) !important;
    transform: translateY(-1px);
}

/* stat-card on Dashboard */
.stat-card {
    box-shadow: var(--shadow-card) !important;
    transition: box-shadow var(--dur-normal) var(--ease-out),
        transform var(--dur-normal) var(--ease-out);
}

.stat-card:hover {
    box-shadow: var(--shadow-blue-md) !important;
    transform: translateY(-2px);
}

/* Generic white cards throughout the app */
.card,
.modern-card,
.report-card-modern,
.modal-content,
.draggable-card {
    box-shadow: var(--shadow-card) !important;
    transition: box-shadow var(--dur-normal) var(--ease-out),
        transform var(--dur-normal) var(--ease-out);
}

.draggable-card:hover {
    box-shadow: var(--shadow-blue-md) !important;
    transform: translateY(-2px);
}

/* Sidebar â€” barely-there shadow */
.sidebar {
    box-shadow: -2px 0 20px rgba(37, 99, 235, 0.06) !important;
}

/* Top bar */
.top-bar {
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04) !important;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 4 â€” PRIMARY BUTTON OVERHAUL
   Soft blue glow, lift on hover, press on active
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.btn-primary {
    box-shadow: var(--shadow-blue-sm) !important;
    transition: all var(--dur-normal) var(--ease-out) !important;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background var(--dur-fast) ease;
    border-radius: inherit;
    pointer-events: none;
}

.btn-primary:hover {
    transform: translateY(-3px) !important;
    box-shadow: var(--shadow-blue-hover) !important;
}

.btn-primary:hover::after {
    background: rgba(255, 255, 255, 0.07);
}

.btn-primary:active {
    transform: scale(0.97) translateY(0) !important;
    box-shadow: var(--shadow-blue-sm) !important;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 5 â€” SECONDARY BUTTON
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.btn-secondary {
    box-shadow: none !important;
    border: 1px solid #cbd5e1;
    transition: all var(--dur-normal) var(--ease-out) !important;
}

.btn-secondary:hover {
    background: #f1f5f9 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

.btn-secondary:active {
    transform: scale(0.97) translateY(0) !important;
    box-shadow: none !important;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 6 â€” DANGER BUTTON
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.btn-danger {
    box-shadow: var(--shadow-red-md) !important;
    transition: all var(--dur-normal) var(--ease-out) !important;
}

.btn-danger:hover {
    transform: translateY(-3px) !important;
    box-shadow: var(--shadow-red-hover) !important;
    opacity: 1 !important;
}

.btn-danger:active {
    transform: scale(0.97) translateY(0) !important;
    box-shadow: var(--shadow-red-md) !important;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 7 â€” MATRIX CONTROL BUTTONS
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.btn-matrix {
    transition: all var(--dur-normal) var(--ease-out) !important;
    box-shadow: none !important;
}

.btn-matrix:hover {
    transform: translateY(-2px) !important;
    filter: brightness(1.06) !important;
}

.btn-matrix.save:hover {
    box-shadow: var(--shadow-green-hover) !important;
}

.btn-matrix.additions:hover,
.btn-matrix.print:hover,
.btn-matrix.refresh:hover {
    box-shadow: var(--shadow-blue-md) !important;
}

.btn-matrix:active {
    transform: scale(0.96) translateY(0) !important;
    filter: brightness(0.96) !important;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 8 â€” ROYAL ACTION BUTTON
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.royal-action-btn {
    box-shadow: var(--shadow-blue-md) !important;
    transition: all var(--dur-normal) var(--ease-out) !important;
}

.royal-action-btn:hover {
    transform: translateY(-3px) !important;
    box-shadow: var(--shadow-blue-hover) !important;
    filter: brightness(1.08) !important;
}

.royal-action-btn:active {
    transform: scale(0.97) translateY(0) !important;
    box-shadow: var(--shadow-blue-sm) !important;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 9 â€” DANGER OUTLINE BUTTON
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.danger-outline-btn {
    transition: all var(--dur-normal) var(--ease-out) !important;
}

.danger-outline-btn:hover {
    box-shadow: var(--shadow-red-md) !important;
    transform: translateY(-2px) !important;
    background: rgba(239, 68, 68, 0.04) !important;
}

.danger-outline-btn:active {
    transform: scale(0.97) translateY(0) !important;
    box-shadow: none !important;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 10 â€” NAV ITEM MICRO-INTERACTIONS
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.nav-item {
    transition: all var(--dur-fast) var(--ease-out) !important;
}

.nav-item:hover {
    background: rgba(37, 99, 235, 0.05) !important;
    color: #1e40af !important;
    transform: translateX(-2px);
    /* subtle RTL nudge */
}

.nav-item:hover i {
    opacity: 1 !important;
    color: var(--primary-color) !important;
}

.nav-item:active {
    transform: scale(0.98) translateX(0) !important;
}

.nav-item.active {
    box-shadow: inset -3px 0 0 var(--primary-color),
        0 2px 8px rgba(37, 99, 235, 0.08);
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 11 â€” GENERIC CLICKABLE ELEMENTS
   (Any button not covered above)
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

button:not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.btn-matrix):not(.royal-action-btn):not(.danger-outline-btn):not(.sidebar-toggle):not(.nav-item):not([disabled]) {
    transition: all var(--dur-fast) var(--ease-out);
}

button:not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.btn-matrix):not(.royal-action-btn):not(.danger-outline-btn):not(.sidebar-toggle):not(.nav-item):not([disabled]):hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

button:not([disabled]):active {
    transform: scale(0.97) !important;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 12 â€” HOVER ICON ANIMATION
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* Icon inside buttons â€” subtle pop on parent hover */
.btn-primary:hover>i,
.btn-danger:hover>i,
.royal-action-btn:hover>i {
    transform: scale(1.15) rotate(-3deg);
    opacity: 1;
}

.btn-matrix:hover i {
    transform: scale(1.1);
    opacity: 1;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 13 â€” FORM INPUTS â€” Soft focus glow
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10) !important;
    border-color: var(--primary-color) !important;
    outline: none;
}

/* Inputs in prayer break module */
#prayer-break-module input:focus {
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12) !important;
    border-color: #d97706 !important;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 14 â€” TIMETABLE GRID CELLS
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.grid-cell.drop-zone {
    transition: background var(--dur-fast) ease,
        box-shadow var(--dur-fast) ease,
        transform var(--dur-fast) ease !important;
}

.grid-cell.drop-zone:hover {
    background: rgba(37, 99, 235, 0.04) !important;
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Filled cells */
.cell-subject-name {
    transition: transform var(--dur-fast) ease;
}

.grid-cell:hover .cell-subject-name {
    transform: scale(1.02);
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 15 â€” SCHEDULE END BANNER (Refined)
   Compact, centered, elegant with colored shadow
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.schedule-end-preview {
    margin-top: 20px !important;
    padding: 16px 24px !important;
    border-radius: 16px !important;

    /* Deeper, more refined dark gradient */
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%) !important;
    color: white;
    text-align: center;

    /* Soft blue-tinted shadow instead of hard black */
    box-shadow:
        0 6px 20px -4px rgba(37, 99, 235, 0.25),
        0 2px 8px -2px rgba(15, 23, 42, 0.15) !important;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;

    position: relative;
    overflow: hidden;
}

/* Decorative shimmer layer */
.schedule-end-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.03) 0%,
            rgba(255, 255, 255, 0.00) 50%,
            rgba(255, 255, 255, 0.03) 100%);
    pointer-events: none;
}

/* Label row â€” smaller, refined */
.schedule-end-preview>div:first-of-type {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    opacity: 0.6 !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 2px !important;
}

/* The time itself â€” still prominent but tighter */
#calculated-end-time {
    font-size: 2rem !important;
    font-weight: 900 !important;
    letter-spacing: 3px !important;
    text-shadow:
        0 0 24px rgba(96, 165, 250, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.3) !important;
    line-height: 1.1;
}

/* Friday note â€” slim divider row */
#calculated-friday-end-note {
    margin-top: 6px !important;
    padding-top: 8px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 16 â€” DAY CHECKBOX OVERHAUL
   Soft dark shadow on selected, smooth transitions
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.day-checkbox {
    transition: all var(--dur-normal) var(--ease-spring) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

.day-checkbox:hover {
    border-color: #94a3b8;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08) !important;
    transform: translateY(-1px);
}

.day-checkbox:has(input:checked) {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18) !important;
    transform: translateY(-1px);
}

.day-checkbox:active {
    transform: scale(0.96) translateY(0) !important;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 17 â€” PREMIUM BREAK MODULE CARDS
   Prayer break & Friday boxes
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

#prayer-break-module {
    box-shadow: 0 4px 14px -3px rgba(217, 119, 6, 0.12),
        0 2px 6px -2px rgba(217, 119, 6, 0.07) !important;
    transition: box-shadow var(--dur-normal) ease,
        transform var(--dur-normal) ease !important;
}

#prayer-break-module:hover {
    box-shadow: 0 8px 24px -4px rgba(217, 119, 6, 0.18),
        0 3px 8px -2px rgba(217, 119, 6, 0.09) !important;
    transform: translateY(-1px);
}

/* Friday box (any box with the blue gradient header) */
.friday-module-box {
    box-shadow: 0 4px 14px -3px rgba(37, 99, 235, 0.10),
        0 2px 4px -1px rgba(15, 23, 42, 0.04) !important;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 18 â€” STAT CARDS â€” Contextual shadows
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* Attempt to color-match stat cards using attribute or class variants
   Most stat cards share .stat-card, so we use hover-based variation */
.stat-card:nth-child(1):hover {
    box-shadow: var(--shadow-blue-md) !important;
}

.stat-card:nth-child(2):hover {
    box-shadow: var(--shadow-green-hover) !important;
}

.stat-card:nth-child(3):hover {
    box-shadow: var(--shadow-amber-md) !important;
}

.stat-card:nth-child(4):hover {
    box-shadow: var(--shadow-red-md) !important;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 19 â€” MODAL DIALOGS
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.modal-overlay {
    backdrop-filter: blur(4px) !important;
}

.modal-content {
    box-shadow:
        0 20px 60px -10px rgba(37, 99, 235, 0.15),
        0 8px 24px -6px rgba(15, 23, 42, 0.10) !important;
    transform: scale(1);
    transition: transform var(--dur-normal) var(--ease-spring),
        opacity var(--dur-normal) ease !important;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 20 â€” TOAST NOTIFICATIONS
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.toast-notification,
#toast-notification {
    box-shadow:
        0 8px 24px -4px rgba(15, 23, 42, 0.15),
        0 2px 8px -2px rgba(15, 23, 42, 0.08) !important;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 21 â€” ICON STYLE VARIANTS
   Maintain line-icon feel by reducing fill opacity
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* Optional: make solid icons feel lighter with subtle opacity */
.nav-item i,
.stat-card .stat-icon i,
.card-header-iconic .icon-wrap i {
    opacity: 0.88;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 22 â€” SCROLLBAR â€” Subtle blue accent
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #94a3b8 0%, #cbd5e1 100%);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #3b82f6 0%, #60a5fa 100%);
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 23 â€” SETTINGS TABS 
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.settings-tab-btn {
    transition: all var(--dur-fast) var(--ease-out) !important;
}

.settings-tab-btn:hover {
    transform: translateY(-1px) !important;
}

.settings-tab-btn.active {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 24 â€” Grid Header (Period headers)
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.grid-header {
    transition: background var(--dur-fast) ease,
        box-shadow var(--dur-fast) ease;
}

.grid-header:hover {
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08) inset;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   SECTION 25 â€” ANTI-FLASH: Smooth Rendering
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

*,
*::before,
*::after {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Ù…Ù†ØµØ© Ø§Ù„Ø§Ø³ØªÙŠØ±Ø§Ø¯ Ø§Ù„Ø°ÙƒÙŠ (Smart Parser Update) === */
.btn-import-royal {
    box-shadow: var(--shadow-blue-soft) !important;
    transition: all var(--dur-normal) var(--ease-spring) !important;
}

.btn-import-royal:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4) !important;
}

.btn-import-royal[style*="background: #10b981"] {
    box-shadow: var(--shadow-green-soft) !important;
}

.btn-import-royal[style*="background: #10b981"]:hover {
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4) !important;
}

.btn-import-royal[style*="background: #6366f1"] {
    box-shadow: var(--shadow-blue-soft) !important;
}

.btn-import-royal[style*="background: #6366f1"]:hover {
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4) !important;
}

.btn-template-white {
    box-shadow: var(--shadow-card) !important;
    transition: all var(--dur-normal) var(--ease-spring) !important;
}

.btn-template-white:hover {
    transform: translateY(-3px) !important;
    box-shadow: var(--shadow-card-hover) !important;
}

.btn-template-white:active,
.btn-import-royal:active {
    transform: scale(0.97) !important;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   SECTION 26 â€” RESULTS ANALYTICS PAGE (ra-*)
   AI Analytics Â· Charts Â· KPIs Â· Matrix Â· Summary
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ Hero Upload Block â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ra-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    padding: 16px 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    color: white;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px -8px rgba(37, 99, 235, 0.25), 0 4px 12px -4px rgba(15, 23, 42, 0.15);
}

.ra-hero-glow {
    position: absolute;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    top: -60px;
    left: -40px;
    pointer-events: none;
}

.ra-hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

/* حاوية جديدة لتجميع الأيقونة والعنوان بجانب بعضهما */
.ra-hero-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ra-hero-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #ffffff;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
    flex-shrink: 0;
}

.ra-hero-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 12px rgba(147, 197, 253, 0.2);
    border-color: rgba(147, 197, 253, 0.4);
}

.ra-hero-text h2 {
    font-size: 1.3rem;
    font-weight: 900;
    margin: 0 0 3px;
    background: linear-gradient(90deg, #fff 0%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ra-hero-text p {
    font-size: 0.85rem;
    opacity: 0.75;
    margin: 0;
    max-width: 580px;
    line-height: 1.5;
}

.ra-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 2px;
}

/* Upload, Sample, Clear Buttons */
.ra-btn-upload,
.ra-btn-sample,
.ra-btn-clear {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ra-btn-upload {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 6px 20px -4px rgba(99, 102, 241, 0.50);
}

.ra-btn-upload:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px -4px rgba(99, 102, 241, 0.60);
}

.ra-btn-sample {
    background: rgba(255, 255, 255, 0.10);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.20);
    backdrop-filter: blur(8px);
}

.ra-btn-sample:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.ra-btn-clear {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.20);
}

.ra-btn-clear:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: translateY(-2px);
}

/* ── Drop Zone ── */
.ra-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 250px;
    padding: 14px 20px;
    border-radius: 14px;
    border: 1.5px dashed rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.06);
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: all 250ms ease;
    text-align: center;
}

.ra-drop-zone.ra-dz-over {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.15);
    transform: scale(1.02);
}

.ra-drop-icon {
    font-size: 1.8rem;
    color: #a5b4fc;
    margin-bottom: 2px;
}

.ra-drop-zone p {
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0;
}

.ra-drop-zone span {
    font-size: 0.72rem;
    opacity: 0.55;
}

.ra-drop-columns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.ra-drop-columns span {
    font-size: 0.65rem;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    opacity: 1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ra-drop-columns span i {
    font-size: 0.55rem;
    color: #6366f1;
}

/* â”€â”€ Status Bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ra-status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.ra-status-bar i {
    color: #22c55e;
}

.ra-status-sep {
    opacity: 0.4;
}

/* â”€â”€ KPI Grid â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ra-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.ra-kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 16px;
    background: white;
    box-shadow: var(--shadow-card);
    transition: all 220ms ease;
}

.ra-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
}

.ra-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.ra-kpi-data {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ra-kpi-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
}

.ra-kpi-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.1;
}

/* â”€â”€ Alerts Grid â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ra-alerts-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.ra-alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    animation: raSlideIn 0.35s ease both;
}

@keyframes raSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ra-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.ra-alert-danger {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #b91c1c;
}

.ra-alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.ra-alert-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.ra-alert-success .ra-alert-icon {
    background: #dcfce7;
}

.ra-alert-danger .ra-alert-icon {
    background: #fee2e2;
}

.ra-alert-warning .ra-alert-icon {
    background: #fef3c7;
}

.ra-alert-body strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.ra-alert-body p {
    font-size: 0.8rem;
    margin: 0;
    opacity: 0.85;
}

/* â”€â”€ Charts Layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ra-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .ra-charts-row {
        grid-template-columns: 1fr;
    }

    .ra-hero {
        grid-template-columns: 1fr;
    }
}

.ra-chart-card {
    background: white;
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: box-shadow 220ms ease;
}

.ra-chart-card:hover {
    box-shadow: var(--shadow-card-hover);
}

.ra-chart-wide {
    grid-column: 1 / -1;
}

.ra-chart-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ra-chart-header i {
    font-size: 1rem;
    color: #6366f1;
    flex-shrink: 0;
}

.ra-chart-header h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    flex: 1;
}

/* ── Inline Legend (interactive, in header) ── */
.ra-inline-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ra-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 160ms ease;
    white-space: nowrap;
}

.ra-legend-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.ra-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.ra-legend-text {
    line-height: 1;
}

.ra-legend-hidden {
    opacity: 0.4;
    text-decoration: line-through;
}

.ra-chart-filter select {
    padding: 5px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.8rem;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
}

.ra-chart-body {
    position: relative;
    height: 250px;
}

.ra-chart-tall {
    height: 320px;
}

/* â”€â”€ Section Wrapper â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ra-section {
    margin-bottom: 20px;
}

.ra-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.ra-section-header i {
    font-size: 1.1rem;
    color: #6366f1;
}

.ra-section-header h3 {
    font-size: 1rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    flex: 1;
}

.ra-btn-export {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 180ms ease;
}

.ra-btn-export:hover {
    background: #dcfce7;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.20);
}

/* â”€â”€ Performance Matrix â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ra-perf-matrix-card {
    background: white;
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    border-right: 4px solid #0d9488;
}

.ra-perf-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ra-matrix-quadrant {
    border-radius: 14px;
    padding: 20px;
    min-height: 120px;
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.ra-matrix-quadrant:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.ra-q-strong {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
}

.ra-q-stable {
    background: #f0f9ff;
    border: 1.5px solid #bae6fd;
}

.ra-q-support {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
}

.ra-q-critical {
    background: #fff1f2;
    border: 1.5px solid #fecdd3;
}

.ra-q-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.ra-q-label i {
    font-size: 1.1rem;
}

.ra-q-strong .ra-q-label {
    color: #15803d;
}

.ra-q-stable .ra-q-label {
    color: #0369a1;
}

.ra-q-support .ra-q-label {
    color: #92400e;
}

.ra-q-critical .ra-q-label {
    color: #b91c1c;
}

.ra-q-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ra-q-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    color: #334155;
}

.ra-q-tag span {
    font-size: 0.7rem;
    color: #0d9488;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 800;
}

.ra-class-perf-card {
    background: white;
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    border-right: 4px solid #8b5cf6; /* Premium Purple */
}

.ra-class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.ra-class-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px; /* Reduced padding */
    background: #ffffff;
    border-radius: 12px; /* Slightly smaller radius */
    border: 1px solid #e2e8f0;
    border-bottom: 4px solid #cbd5e1; /* Slightly thinner depth */
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.ra-class-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -5px rgba(0,0,0,0.1);
    border-color: #cbd5e1;
    filter: brightness(1.02);
}

.ra-class-card:active {
    transform: translateY(0);
    border-bottom-width: 2px;
    margin-bottom: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ra-class-rank {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    font-weight: 800;
}

.ra-class-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ra-class-info strong .ra-t-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid transparent; /* Override by JS */
    transition: all 250ms ease;
}

.ra-class-info strong {
    font-size: 0.9rem;
    font-weight: 800;
    color: #1e293b;
}

.ra-class-info span {
    font-size: 0.7rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ra-class-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.ra-class-stat-main {
    font-size: 0.95rem;
    font-weight: 900;
}

.ra-class-stat-sub {
    font-size: 0.72rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
}

/* â”€â”€ AI Summary Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ra-summary-card {
    background: white;
    border-radius: 18px;
    padding: 24px 28px;
    box-shadow: var(--shadow-card);
    border-right: 4px solid #6366f1;
    line-height: 1.7;
}

.ra-summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.ra-summary-header i {
    font-size: 1.3rem;
    color: #6366f1;
}

.ra-summary-header h4 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.ra-summary-body {
    font-size: 0.9rem;
    color: #334155;
    margin: 0 0 10px;
}

.ra-summary-recommendations {
    margin-top: 16px;
    padding: 14px 18px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.ra-summary-recommendations strong {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #1e293b;
    margin-bottom: 8px;
}

.ra-summary-recommendations ul {
    margin: 0;
    padding-right: 18px;
    font-size: 0.82rem;
    color: #475569;
}

.ra-summary-recommendations li {
    margin-bottom: 5px;
}

/* â”€â”€ Detail Table Badges â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ra-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
}

.ra-badge-quality {
    background: #dcfce7;
    color: #15803d;
}

.ra-badge-pass {
    background: #dbeafe;
    color: #1d4ed8;
}

.ra-badge-fail {
    background: #fee2e2;
    color: #b91c1c;
}

/* Responsive: smaller screens */
@media (max-width: 640px) {
    .ra-hero {
        padding: 20px 16px;
    }

    .ra-hero-text h2 {
        font-size: 1.2rem;
    }

    .ra-perf-matrix {
        grid-template-columns: 1fr;
    }

    .ra-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* â”€â”€ Analytics Page Layout Fix (zero top gap) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#page-results-analytics {
    padding: 24px 28px;
    box-sizing: border-box;
    min-height: 0;
    background: #f8fafc;
    width: 100%;
}

/* When Analytics Page is active, remove padding/max-width from dashboard-content to allow full height/width */
.dashboard-content:has(#page-results-analytics:not(.hidden)) {
    padding: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* Safe Fallback for browsers that don't support :has */
.dashboard-content.full-bleed {
    padding: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* ═══════════════════════════════════════════════════════
   RA Settings Gear Button
   ═══════════════════════════════════════════════════════ */
.ra-settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: transparent;
    border: none;
    color: #a5b4fc;
    font-size: 1.15rem;
    cursor: pointer;
    margin-right: 12px;
    vertical-align: middle;
    transition: all 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
    box-shadow: none;
    -webkit-text-fill-color: initial;
    position: relative;
    overflow: hidden;
}

.ra-settings-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-20deg);
    transition: all 0.6s ease;
}

.ra-settings-btn:hover {
    background: transparent;
    color: #fff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: none;
}

.ra-settings-btn:hover i {
    animation: ra-spin-gear 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.ra-settings-btn:hover::before {
    left: 200%;
}

@keyframes ra-spin-gear {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.ra-settings-btn i {
    -webkit-text-fill-color: initial;
}

/* ═══════════════════════════════════════════════════════
   RA Settings Overlay + Modal
   ═══════════════════════════════════════════════════════ */
.ra-settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.70);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: raOverlayIn 200ms ease forwards;
}

.ra-settings-overlay.hidden {
    display: none !important;
}

@keyframes raOverlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.ra-settings-modal {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 540px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(99, 102, 241, 0.12);
    direction: rtl;
    animation: raModalIn 260ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes raModalIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ra-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8f9ff 0%, #eff6ff 100%);
    border-radius: 20px 20px 0 0;
}

.ra-settings-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ra-settings-title i {
    font-size: 1.2rem;
    color: #6366f1;
    filter: drop-shadow(0 2px 6px rgba(99, 102, 241, 0.4));
}

.ra-settings-title h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
}

.ra-settings-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 180ms ease;
}

.ra-settings-close:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: scale(1.1);
}

.ra-settings-section {
    padding: 18px 22px;
    border-bottom: 1px solid #f1f5f9;
}

.ra-settings-section:last-child {
    border-bottom: none;
}

.ra-settings-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #334155;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ra-settings-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px 14px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
}

.ra-settings-row label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    grid-column: 1;
}

.ra-settings-row small {
    font-size: 0.78rem;
    color: #94a3b8;
    grid-column: 1 / -1;
}

.ra-settings-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1.5px solid #c7d2fe;
    border-radius: 9px;
    padding: 4px 10px;
    grid-column: 2;
    min-width: 90px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.ra-settings-input-wrap input[type="number"] {
    width: 52px;
    border: none;
    outline: none;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Tajawal', sans-serif;
    text-align: center;
    background: transparent;
}

.ra-settings-input-wrap span {
    font-size: 0.88rem;
    font-weight: 700;
    color: #6366f1;
}

.ra-settings-class-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #64748b;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 9px 12px;
    margin-bottom: 12px;
}

.ra-settings-class-hint i {
    color: #0284c7;
}

.ra-class-thresholds-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.ra-class-threshold-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    transition: border-color 180ms;
}

.ra-class-threshold-row:hover {
    border-color: #a5b4fc;
}

.ra-class-threshold-row .cls-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
    flex: 1;
}

.ra-class-threshold-row .cls-count {
    font-size: 0.78rem;
    color: #94a3b8;
}

.ra-class-threshold-row .ra-settings-input-wrap {
    grid-column: unset;
    min-width: 80px;
}

.ra-no-classes {
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
    padding: 16px;
}

.ra-settings-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    padding: 16px 22px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 20px 20px;
}

.ra-set-btn-cancel,
.ra-set-btn-apply {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    border-radius: 11px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ra-set-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.ra-set-btn-cancel:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.ra-set-btn-apply {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    box-shadow: 0 6px 18px -4px rgba(99, 102, 241, 0.5);
}

.ra-set-btn-apply:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px -4px rgba(99, 102, 241, 0.65);
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR REBRAND — "المدير" Premium Theme
   ═══════════════════════════════════════════════════════ */

/* New brand icon: shield color */
.sidebar-header .fa-shield-halved.logo-icon {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

/* ─── Teacher Performance Analysis ────────────────────────── */
.ra-teacher-perf-card {
    background: white;
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    border-right: 4px solid #10b981; /* Emerald Green */
}

.ra-teacher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.ra-teacher-card {
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    background: #ffffff; /* خلفية بيضاء نقية للبطاقة */
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    border-bottom: 5px solid #cbd5e1; /* حافة سفلية سميكة للبعد الثالث */
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    gap: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04), inset 0 2px 0 rgba(255, 255, 255, 1);
}

.ra-teacher-card:hover {
    transform: translateY(-5px); /* ارتفاع عند تمرير الماوس */
    box-shadow: 0 15px 30px -5px rgba(0,0,0,0.1), inset 0 2px 0 rgba(255, 255, 255, 1);
    border-color: #10b98166; /* لون أخضر خفيف للحدود */
    border-bottom-color: #10b981; /* تلوين الحافة السفلية للفت الانتباه */
}

.ra-teacher-card:active {
    transform: translateY(0); /* ضغط البطاقة لأسفل */
    border-bottom-width: 2px;
    margin-bottom: 3px; /* التعويض عن تقليل حجم الحد السفلي لمنع اهتزاز التصميم */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.ra-t-rank {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #94a3b8;
    background: white;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.ra-t-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ra-t-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.ra-t-info {
    display: flex;
    flex-direction: column;
}

.ra-t-info strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.ra-t-info span {
    font-size: 0.72rem;
    color: #64748b;
}

.ra-t-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid transparent; /* Override by JS */
    transition: all 250ms ease;
}

.ra-t-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ra-t-metric label {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
}

.ra-t-value {
    font-size: 1rem;
    font-weight: 800;
    color: #334155;
}

.ra-t-footer {
    font-size: 0.65rem;
    color: #94a3b8;
    text-align: center;
    border-top: 1px dashed #e2e8f0;
    padding-top: 8px;
}
/* ── LIVE nav item ─────────────────────────────────────── */
.nav-item-live {
    position: relative;
}

.nav-item-live:hover {
    background: rgba(239, 68, 68, 0.07) !important;
    color: #ef4444 !important;
}

.nav-item-live .nav-live-pulse {
    color: #ef4444;
    font-size: 0.85rem !important;
    animation: live-pulse-glow 1.6s ease-in-out infinite;
    filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.6));
}

@keyframes live-pulse-glow {

    0%,
    100% {
        opacity: 1;
        filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.7));
    }

    50% {
        opacity: 0.5;
        filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.3));
    }
}

.nav-item-live strong {
    color: #ef4444;
    letter-spacing: 1px;
    font-size: 0.92rem;
}

.nav-item-live.active {
    background: rgba(239, 68, 68, 0.10) !important;
    color: #ef4444 !important;
    border-right-color: #ef4444 !important;
}

/* ── Substitution / مناوبة item hover ──────────────────── */
.nav-item-substitution:hover {
    background: rgba(245, 158, 11, 0.08) !important;
    color: #d97706 !important;
    transform: translateX(-3px);
    box-shadow: inset 4px 0 0 #f59e0b;
}

.nav-item-substitution:hover i {
    color: #f59e0b;
}

/* Smooth transition for all nav-items */
.nav-item {
    transition: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1) !important;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR PREMIUM — Dark Glassmorphism Theme
   Full override: background, items, hover, active, footer
   ═══════════════════════════════════════════════════════════════ */

/* Dark glassmorphism base */
.sidebar {
    background: linear-gradient(160deg, #0d1b2e 0%, #0f2340 50%, #0a1628 100%) !important;
    border-left: 1px solid rgba(99, 102, 241, 0.15) !important;
    box-shadow:
        -8px 0 32px rgba(0, 0, 0, 0.35),
        inset 1px 0 0 rgba(255, 255, 255, 0.04) !important;
}

/* Subtle drift glow inside sidebar */
.sidebar::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -30%;
    width: 200%;
    height: 60%;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: sidebar-glow-drift 8s ease-in-out infinite alternate;
}

@keyframes sidebar-glow-drift {
    from {
        transform: translateY(0) scale(1);
    }

    to {
        transform: translateY(40px) scale(1.05);
    }
}

/* Header */
.sidebar-header {
    background: rgba(255, 255, 255, 0.04) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    position: relative;
    z-index: 1;
}

.sidebar-header h2 {
    color: #e2e8f0 !important;
    font-weight: 900 !important;
    background: linear-gradient(90deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header .logo-icon,
.sidebar-header .fa-shield-halved.logo-icon {
    color: #818cf8 !important;
    background: rgba(99, 102, 241, 0.15) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.25) !important;
}

/* Nav group base */
.sidebar-nav {
    position: relative;
    z-index: 1;
}

/* Nav items default */
.nav-item {
    color: rgba(148, 163, 184, 0.85) !important;
    border-radius: 12px !important;
    position: relative;
    overflow: hidden;
}

.nav-item i {
    color: rgba(148, 163, 184, 0.65) !important;
    transition: all 0.3s ease !important;
    position: relative;
    z-index: 2;
}

.nav-item span {
    position: relative;
    z-index: 2;
}

/* Sheen pseudo element */
.nav-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(139, 92, 246, 0.12) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Hover — electric neon */
.nav-item:hover {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #c7d2fe !important;
    transform: translateX(-4px) !important;
    box-shadow: inset -3px 0 0 #6366f1, 0 4px 16px rgba(99, 102, 241, 0.15) !important;
}

.nav-item:hover::after {
    opacity: 1;
}

.nav-item:hover i {
    color: #a5b4fc !important;
    transform: scale(1.15) !important;
    filter: drop-shadow(0 0 6px rgba(165, 180, 252, 0.6)) !important;
}

/* Active */
.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(79, 70, 229, 0.15) 100%) !important;
    color: #e0e7ff !important;
    border-right: none !important;
    border-left: none !important;
    box-shadow:
        inset -3px 0 0 #818cf8,
        0 4px 20px rgba(99, 102, 241, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.nav-item.active i {
    color: #a5b4fc !important;
    filter: drop-shadow(0 0 8px rgba(165, 180, 252, 0.7)) !important;
}

.nav-item.active::after {
    opacity: 0.5;
}

/* Footer */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
    background: rgba(0, 0, 0, 0.15) !important;
    position: relative;
    z-index: 1;
}

.nav-item.help-btn i {
    color: #60a5fa !important;
}

.nav-item.help-btn:hover {
    background: rgba(96, 165, 250, 0.12) !important;
    color: #93c5fd !important;
    box-shadow: inset -3px 0 0 #60a5fa, 0 4px 16px rgba(96, 165, 250, 0.15) !important;
}

.nav-item.help-btn:hover i {
    color: #93c5fd !important;
    filter: drop-shadow(0 0 6px rgba(147, 197, 253, 0.6)) !important;
}

/* LIVE item override */
.nav-item-live:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #fca5a5 !important;
    box-shadow: inset -3px 0 0 #ef4444, 0 4px 16px rgba(239, 68, 68, 0.2) !important;
}

.nav-item-live:hover::after {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.1) 100%) !important;
    opacity: 1;
}

.nav-item-live strong {
    color: #f87171 !important;
    letter-spacing: 2px;
    font-size: 0.9rem;
}

.nav-item-live.active {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0%, rgba(220, 38, 38, 0.12) 100%) !important;
    color: #fca5a5 !important;
    box-shadow: inset -3px 0 0 #ef4444, 0 4px 20px rgba(239, 68, 68, 0.2) !important;
}

/* Substitution item override */
.nav-item-substitution:hover {
    background: rgba(245, 158, 11, 0.10) !important;
    color: #fde68a !important;
    box-shadow: inset -3px 0 0 #f59e0b, 0 4px 16px rgba(245, 158, 11, 0.15) !important;
}

.nav-item-substitution:hover::after {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.1) 100%) !important;
    opacity: 1;
}

.nav-item-substitution:hover i {
    color: #fbbf24 !important;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6)) !important;
}

/* ── Custom Colors for Sidebar Items ── */

/* Excel (Emerald Green) */
.nav-item-excel:hover,
.nav-item-excel.active {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #6ee7b7 !important;
    box-shadow: inset -3px 0 0 #10b981, 0 4px 16px rgba(16, 185, 129, 0.15) !important;
}

.nav-item-excel:hover::after,
.nav-item-excel.active::after {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.1) 100%) !important;
    opacity: 1;
}

.nav-item-excel:hover i,
.nav-item-excel.active i {
    color: #34d399 !important;
    filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.6)) !important;
}

/* Data (Sky Blue) */
.nav-item-data:hover,
.nav-item-data.active {
    background: rgba(14, 165, 233, 0.12) !important;
    color: #7dd3fc !important;
    box-shadow: inset -3px 0 0 #0ea5e9, 0 4px 16px rgba(14, 165, 233, 0.15) !important;
}

.nav-item-data:hover::after,
.nav-item-data.active::after {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(2, 132, 199, 0.1) 100%) !important;
    opacity: 1;
}

.nav-item-data:hover i,
.nav-item-data.active i {
    color: #38bdf8 !important;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.6)) !important;
}

/* Timetable Smart Assistant (Purple/Fuchsia) */
.nav-item-timetable:hover,
.nav-item-timetable.active {
    background: rgba(192, 38, 211, 0.12) !important;
    color: #f0abfc !important;
    box-shadow: inset -3px 0 0 #c026d3, 0 4px 16px rgba(192, 38, 211, 0.15) !important;
}

.nav-item-timetable:hover::after,
.nav-item-timetable.active::after {
    background: linear-gradient(135deg, rgba(192, 38, 211, 0.2) 0%, rgba(162, 28, 175, 0.1) 100%) !important;
    opacity: 1;
}

.nav-item-timetable:hover i,
.nav-item-timetable.active i {
    color: #e879f9 !important;
    filter: drop-shadow(0 0 6px rgba(232, 121, 249, 0.6)) !important;
}

/* Master Matrix (Rose/Pink) */
.nav-item-matrix:hover,
.nav-item-matrix.active {
    background: rgba(225, 29, 72, 0.12) !important;
    color: #fda4af !important;
    box-shadow: inset -3px 0 0 #e11d48, 0 4px 16px rgba(225, 29, 72, 0.15) !important;
}

.nav-item-matrix:hover::after,
.nav-item-matrix.active::after {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.2) 0%, rgba(190, 18, 60, 0.1) 100%) !important;
    opacity: 1;
}

.nav-item-matrix:hover i,
.nav-item-matrix.active i {
    color: #fb7185 !important;
    filter: drop-shadow(0 0 6px rgba(251, 113, 133, 0.6)) !important;
}

/* Constraints (Slate/Silver) */
.nav-item-constraints:hover,
.nav-item-constraints.active {
    background: rgba(148, 163, 184, 0.15) !important;
    color: #e2e8f0 !important;
    box-shadow: inset -3px 0 0 #94a3b8, 0 4px 16px rgba(148, 163, 184, 0.15) !important;
}

.nav-item-constraints:hover::after,
.nav-item-constraints.active::after {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.25) 0%, rgba(100, 116, 139, 0.15) 100%) !important;
    opacity: 1;
}

.nav-item-constraints:hover i,
.nav-item-constraints.active i {
    color: #cbd5e1 !important;
    filter: drop-shadow(0 0 6px rgba(203, 213, 225, 0.6)) !important;
}

/* Analytics (Cyan) */
.nav-item-analytics:hover,
.nav-item-analytics.active {
    background: rgba(6, 182, 212, 0.12) !important;
    color: #67e8f9 !important;
    box-shadow: inset -3px 0 0 #06b6d4, 0 4px 16px rgba(6, 182, 212, 0.15) !important;
}

.nav-item-analytics:hover::after,
.nav-item-analytics.active::after {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(8, 145, 178, 0.1) 100%) !important;
    opacity: 1;
}

.nav-item-analytics:hover i,
.nav-item-analytics.active i {
    color: #22d3ee !important;
    filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.6)) !important;
}

/* Reports (Classic Blue) */
.nav-item-reports:hover,
.nav-item-reports.active {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #93c5fd !important;
    box-shadow: inset -3px 0 0 #3b82f6, 0 4px 16px rgba(59, 130, 246, 0.15) !important;
}

.nav-item-reports:hover::after,
.nav-item-reports.active::after {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%) !important;
    opacity: 1;
}

.nav-item-reports:hover i,
.nav-item-reports.active i {
    color: #60a5fa !important;
    filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.6)) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   GLOBAL NAVY GRADIENT THEME
   Unifying ALL dark/black backgrounds with the sidebar's navy palette
   Gradient direction: dark (#0a1628) → lighter navy (#1a3a6e / #1e3a5f)
   ═══════════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ─────────────────────────────────────── */
:root {
    --navy-gradient-primary: linear-gradient(135deg, #0a1628 0%, #0f2340 50%, #1a3a6e 100%);
    --navy-gradient-card: linear-gradient(135deg, #0d1b2e 0%, #1a3a6e 100%);
    --navy-gradient-pill: linear-gradient(135deg, #0f2340 0%, #1e3a5f 100%);
    --navy-border: rgba(99, 102, 241, 0.18);
    --navy-glow: rgba(99, 102, 241, 0.20);
}

/* ── Dashboard / Main Header ─────────────────────────────────────── */
.top-bar.main-page-header {
    background: var(--navy-gradient-primary) !important;
}

/* ── Analytics Hero (ra-hero) ────────────────────────────────────── */
.ra-hero {
    background: var(--navy-gradient-card) !important;
    border: 1px solid var(--navy-border) !important;
    box-shadow: 0 12px 40px -8px rgba(10, 22, 40, 0.45), 0 4px 16px -4px rgba(15, 23, 42, 0.25) !important;
}

/* ── Reports Gallery Header ──────────────────────────────────────── */
.reports-gallery-header {
    background: var(--navy-gradient-card) !important;
    border: 1px solid var(--navy-border) !important;
    box-shadow: 0 10px 30px rgba(10, 22, 40, 0.35) !important;
}

/* ── Reports Footer Tip Pill ─────────────────────────────────────── */
.reports-footer-tip {
    background: var(--navy-gradient-pill) !important;
    border: 1px solid var(--navy-border) !important;
    box-shadow: 0 4px 16px rgba(10, 22, 40, 0.30) !important;
}

/* ── Print Button (dark) ─────────────────────────────────────────── */
.btn-print-glass {
    background: linear-gradient(135deg, #0f2340, #1a3a6e) !important;
    border-color: var(--navy-border) !important;
}

/* ── Live Dashboard Header ───────────────────────────────────────── */
.live-header-premium,
.live-header {
    background: linear-gradient(135deg, #0a1628 0%, #0f2340 60%, #1a3a6e 100%) !important;
    border-bottom: 1px solid var(--navy-border) !important;
}

/* ── Allocation Modal Header ─────────────────────────────────────── */
.alloc-modal-header {
    background: var(--navy-gradient-card) !important;
    border-bottom: 1px solid var(--navy-border) !important;
}

/* ── Schedule End Preview Strip ──────────────────────────────────── */
.schedule-end-preview {
    background: var(--navy-gradient-card) !important;
    border: 1px solid var(--navy-border) !important;
    box-shadow: 0 6px 20px -4px rgba(99, 102, 241, 0.2),
        0 2px 8px -2px rgba(10, 22, 40, 0.2) !important;
}

/* ── Page-level hero/sub-headers from style.css (lines 4875, 5826, 6472, 7186, 7228, 7337, 7358, 7597) ── */
.constraints-hero,
.data-hero,
.timetable-hero,
.matrix-hero,
.excel-hero,
.substitution-hero,
.page-section-hero {
    background: var(--navy-gradient-card) !important;
    border: 1px solid var(--navy-border) !important;
    color: #e2e8f0 !important;
}

/* Specific dark elements from style.css grep results */
/* Live header bg #1e293b → navy */
.live-header {
    background: linear-gradient(135deg, #0a1628 0%, #0f2340 100%) !important;
}

/* Alloc modal header #0f172a → navy */
.alloc-modal-header {
    background: linear-gradient(135deg, #0a1628 0%, #1a3a6e 100%) !important;
}

/* Substitution engine card backgrounds */
.sub-engine-header,
.sub-smart-header,
.sub-candidate-header {
    background: var(--navy-gradient-card) !important;
    border: 1px solid var(--navy-border) !important;
}

/* Any section/card with hard-coded dark navy bg: override globally */
.page-section [style*="background: #0f172a"],
.page-section [style*="background: #1e293b"],
.page-section [style*="background: #020617"] {
    background: var(--navy-gradient-card) !important;
}

/* Royal action buttons — keep navy tint, not black */
.royal-action-btn {
    background: linear-gradient(135deg, #0f2340 0%, #2563eb 100%) !important;
}

/* ── Live header premium glow line ────────────────────────────────── */
.live-header-premium::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), rgba(56, 189, 248, 0.4), transparent);
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════
   SUB-PAGE BANNERS — Unified Navy-to-Blue Gradient
   Applies to ALL top-bar headers EXCEPT the main dashboard page
   ═══════════════════════════════════════════════════════════════════ */

.top-bar:not(.main-page-header) {
    background: linear-gradient(135deg, #0f2240 0%, #1a3a6c 40%, #2563eb 100%) !important;
    border-bottom: 1px solid rgba(99, 162, 241, 0.20) !important;
    box-shadow: 0 4px 20px rgba(10, 22, 40, 0.30), inset 0 -1px 0 rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
    position: relative;
    overflow: hidden;
}

/* Subtle shimmer overlay on sub-page banners */
.top-bar:not(.main-page-header)::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.00) 0%,
            rgba(255, 255, 255, 0.04) 50%,
            rgba(255, 255, 255, 0.00) 100%);
    pointer-events: none;
    z-index: 0;
}

/* Bottom glow line */
.top-bar:not(.main-page-header)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            rgba(96, 165, 250, 0.6),
            rgba(147, 197, 253, 0.8),
            rgba(96, 165, 250, 0.6),
            transparent);
    pointer-events: none;
}

/* All child text elements → white */
.top-bar:not(.main-page-header) .page-main-title,
.top-bar:not(.main-page-header) .top-bar-center,
.top-bar:not(.main-page-header) .top-bar-title,
.top-bar:not(.main-page-header) h1,
.top-bar:not(.main-page-header) h2,
.top-bar:not(.main-page-header) h3,
.top-bar:not(.main-page-header) p,
.top-bar:not(.main-page-header) span:not(.badge),
.top-bar:not(.main-page-header) strong,
.top-bar:not(.main-page-header) .hero-principal-card {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.top-bar:not(.main-page-header) .hero-principal-card {
    background: transparent !important;
    border: none !important;
}

/* Icons → white/light */
.top-bar:not(.main-page-header) i {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Sidebar toggle → white */
.top-bar:not(.main-page-header) .sidebar-toggle {
    color: #ffffff !important;
}

/* Keep inner elements above the pseudo-element overlays */
.top-bar:not(.main-page-header)>* {
    position: relative;
    z-index: 1;
}

/* Fix Header Alignment & Overlap on Sub-Pages */
.top-bar:not(.main-page-header) .top-bar-center {
    position: static !important;
    /* Reset absolute positioning */
    transform: none !important;
    /* Remove -50% translation */
    flex: 2 !important;
    /* Takes center 50% of flex container */
    max-width: 50%;
    /* Prevent pushing side icons out of bounds */
}

.top-bar:not(.main-page-header) .top-bar-right,
.top-bar:not(.main-page-header) .top-bar-left {
    flex: 1 !important;
    /* Equal remaining space to keep center perfectly aligned */
    min-width: 0 !important;
}

/* ═══════════════════════════════════════════════════════════
   TREND ANALYSIS ENGINE STYLES — تحليل الاتجاهات التراكمي
   ═══════════════════════════════════════════════════════════ */

/* ── Trend Section Container ── */
#ra-trend-section {
    margin-bottom: 24px;
}

/* ── Upload Row ── */
.trend-upload-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-top: 20px;
}

.trend-arrow-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    color: #94a3b8;
    font-size: 1.4rem;
}

/* ── Individual Slot ── */
.trend-slot {
    flex: 1;
    border-radius: 18px;
    border: 2px dashed #c7d2fe;
    background: #f8f9ff;
    transition: all 250ms cubic-bezier(0.22, 0.61, 0.36, 1);
    cursor: default;
    position: relative;
    min-height: 210px;
    overflow: hidden;
}

.trend-slot-optional {
    border-color: #e2e8f0;
    background: #fafafa;
    opacity: 0.92;
}

.trend-slot-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    gap: 8px;
    height: 100%;
    text-align: center;
}

.trend-slot-active {
    border-color: #6366f1 !important;
    background: #eef2ff !important;
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
}

.trend-slot-loaded-state {
    border-color: #22c55e;
    background: #f0fdf4;
    border-style: solid;
}

/* ── Year Badge ── */
.trend-slot-year-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: #6366f1;
    color: white;
    border-radius: 8px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 700;
}

.trend-badge-b .trend-slot-year-badge,
.trend-slot-year-badge.trend-badge-b { background: #0ea5e9; }
.trend-badge-c .trend-slot-year-badge,
.trend-slot-year-badge.trend-badge-c { background: #22c55e; }

#trend-badge-b { background: #0ea5e9; }
#trend-badge-c { background: #22c55e; }

.trend-year-input {
    background: transparent;
    border: none;
    color: white;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    outline: none;
    width: 110px;
    text-align: center;
    cursor: pointer;
}

.trend-year-input::placeholder { color: rgba(255,255,255,0.7); }

/* ── Optional Tag ── */
.trend-optional-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

/* ── Slot Icon ── */
.trend-slot-icon {
    font-size: 2.2rem;
    color: #a5b4fc;
    margin-bottom: 4px;
}

.trend-slot-optional .trend-slot-icon { color: #cbd5e1; }

.trend-slot-hint {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
    font-weight: 600;
}

.trend-slot-hint small { font-size: 0.72rem; color: #94a3b8; font-weight: 400; }

/* ── Loaded State ── */
.trend-slot-loaded {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.trend-loaded-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #166534;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trend-loaded-count {
    font-size: 0.72rem;
    color: #15803d;
    background: #dcfce7;
    padding: 2px 10px;
    border-radius: 8px;
    font-weight: 700;
}

/* ── Upload Button ── */
.trend-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: white;
    color: #6366f1;
    border: 1.5px solid #c7d2fe;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 200ms ease;
    margin-top: 4px;
}

.trend-upload-btn:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99,102,241,0.25);
}

/* ── Analyse Button ── */
.trend-analyze-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 36px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 250ms cubic-bezier(0.22, 0.61, 0.36, 1);
    box-shadow: 0 8px 24px -4px rgba(99,102,241,0.40);
    letter-spacing: 0.02em;
}

.trend-analyze-btn:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.trend-analyze-btn:not(:disabled):hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px -4px rgba(99,102,241,0.55);
}

/* ── KPI Strip ── */
.trend-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin: 24px 0 20px;
}

.trend-kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.trend-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.trend-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.trend-kpi-label {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 2px;
}

.trend-kpi-val {
    font-size: 1.5rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.1;
}

.trend-kpi-sub {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 3px;
}

/* ── Charts Row ── */
.trend-charts-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width:900px) {
    .trend-charts-row { grid-template-columns: 1fr; }
    .trend-upload-row { flex-direction: column; }
    .trend-arrow-divider { transform: rotate(90deg); padding: 6px 0; }
}

.trend-chart-card {
    background: white;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

/* ── Bundle Section ── */
.trend-bundle-section {
    margin-top: 20px;
}

.trend-bundle-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.trend-bundle-tbl {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
}

.trend-bundle-tbl thead tr {
    background: #1e293b;
    color: white;
}

.trend-bundle-tbl thead th {
    padding: 12px 18px;
    text-align: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.trend-bundle-tbl thead th:first-child {
    text-align: right;
}

.trend-bundle-tbl tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: filter 200ms;
}

.trend-bundle-tbl tbody tr:hover { filter: brightness(0.97); }

.trend-bundle-tbl td {
    padding: 12px 18px;
    font-size: 0.88rem;
}

.trend-bundle-tbl td:first-child { text-align: right; }

/* ── AI Trend Summary ── */
.trend-ai-summary {
    margin-top: 20px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e3a5f 100%);
    border-radius: 18px;
    padding: 24px 28px;
    color: white;
    box-shadow: 0 8px 28px rgba(99,102,241,0.22);
}

.trend-ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.trend-ai-header i {
    font-size: 1.4rem;
    color: #a5b4fc;
}

.trend-ai-header h4 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
    color: white;
}

.trend-ai-headline {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 14px;
    line-height: 1.6;
    background: rgba(255,255,255,0.06);
    padding: 10px 14px;
    border-radius: 10px;
    border-right: 3px solid #a5b4fc;
}

.trend-ai-list {
    margin: 0 0 14px;
    padding-right: 20px;
}

.trend-ai-list li {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.82);
    margin-bottom: 7px;
    line-height: 1.55;
}

.trend-ai-footer {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* ── Results Panel animation ── */
#trend-results-panel {
    animation: trendFadeIn 0.4s ease both;
}

@keyframes trendFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════
   Collapsible Detail Table — درجات الطلاب التفصيل
   ═══════════════════════════════════════════════════════════ */

/* Hoverable header row */
.ra-table-toggle {
    transition: filter 200ms ease, transform 200ms ease;
    border-radius: 14px;
}

.ra-table-toggle:hover {
    filter: brightness(1.05);
}

/* ── 3D Header Buttons ── */
.ra-header-btn-3d {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-bottom: 3px solid rgba(255, 255, 255, 0.55) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    flex-shrink: 0;
}

.ra-table-toggle-btn.ra-header-btn-3d {
    width: 36px;
    padding: 0 !important;
}

/* Optical centering for the chevron icon inside the square button */
.ra-table-toggle-btn.ra-header-btn-3d i {
    font-size: 1.15rem; /* حجم احترافي أكبر قليلاً وواضح */
    margin: 0;
    padding: 0;
    position: relative;
    top: 1.5px; /* يوازن الفراغ البصري وسمك البوردر السفلي للزر */
}

.ra-header-btn-3d:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-bottom: 3px solid rgba(255, 255, 255, 0.75) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.ra-header-btn-3d:active {
    background: rgba(255, 255, 255, 0.2) !important;
    border-bottom-width: 1px !important;
    transform: translateY(2px) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    margin-bottom: 2px !important; /* compensate for 2px reduced border to avoid layout shift */
}

/* Chevron rotation */
#ra-table-chevron,
#ra-teacher-chevron,
#ra-class-chevron,
#ra-trend-chevron {
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

#ra-table-chevron.ra-chevron-open,
#ra-teacher-chevron.ra-chevron-open,
#ra-class-chevron.ra-chevron-open,

#ra-trend-chevron.ra-chevron-open {
    transform: rotate(180deg);
}

/* =========================================
   Smart Constraints Visual Feedback
   ========================================= */
@keyframes conflictPulse {
    0% { background-color: rgba(220, 38, 38, 0); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); border-color: transparent; }
    50% { background-color: rgba(220, 38, 38, 0.2); box-shadow: 0 0 25px 10px rgba(220, 38, 38, 0.25); border-color: #dc2626; }
    100% { background-color: rgba(220, 38, 38, 0); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); border-color: transparent; }
}

.conflict-flash {
    animation: conflictPulse 0.5s ease-in-out 3;
    border: 3px solid #dc2626 !important;
    border-radius: 12px !important;
    position: relative;
    z-index: 50;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   DASHBOARD INTERACTIVITY - TIMETABLE DEFICIT NAVIGATION
   ═══════════════════════════════════════════════════════ */

/* UnscheduledLessons (Missing) Card Interactive States */
.analytics-box.box-unscheduled {
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) !important;
    position: relative;
    overflow: hidden !important;
    user-select: none;
}

.analytics-box.box-unscheduled:hover {
    transform: translateY(-6px) scale(1.02) !important;
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.18) !important;
    background: linear-gradient(135deg, #ffffff 0%, rgba(239, 68, 68, 0.12) 100%) !important;
}

.analytics-box.box-unscheduled:active {
    transform: translateY(-2px) scale(0.98) !important;
}

/* Go Arrow animation to guide the user */
.analytics-box.box-unscheduled .go-arrow {
    position: absolute;
    bottom: 8px;
    left: 10px;
    opacity: 0.3;
    font-size: 0.72rem;
    color: #ef4444;
    transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.analytics-box.box-unscheduled:hover .go-arrow {
    opacity: 1;
    transform: translateX(-4px) scale(1.2);
}

/* Tooltip hint for better UX (shown on hover) */
.analytics-box.box-unscheduled::after {
    content: 'انتقل للتوزيع يدوياً';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.analytics-box.box-unscheduled:hover::after {
    top: 6px;
    opacity: 1;
}

/* Custom Analytics Chart Legend */
.ra-chart-legend {
    display: flex;
    gap: 15px;
    margin: 0 20px;
    align-items: center;
    flex: 1;
    justify-content: center;
}
.ra-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.1);
}
.ra-legend-item:hover {
    background: rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.ra-legend-item.hidden {
    opacity: 0.4;
    text-decoration: line-through;
}
.ra-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}
