body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--iqra-bg);
    color: var(--iqra-text-primary);
    font-size: 16px;
    position: relative;
}

/* ======================================
   Z-Index Hierarchy (Stacking Order)
   ====================================== */
/*
   Base layers (0-100): Content, cards, shadows
   Sidebar layer (900-1100): Overlay, sidebar, toggle
   UI elements (1200-1299): Tooltips, dropdowns, popovers
   Notifications (1250): Toast messages
   Modals (1300+): Popup cards, dialogs, overlays
   
   Current z-index values:
   - 900: Sidebar overlay
   - 1000: Sidebar
   - 1100: Sidebar toggle button
   - 1199-1200: Tooltips (arrow + content)
   - 1250: Toast notifications
   - 1300: Popup card backdrop & modals
*/

/* Register local Uthmani/Hafs font files placed in assets/fonts/ */

@font-face {
    font-family: 'qpc-hafs';
    src: url('assets/fonts/UthmanicHafs1-Ver17.woff2') format('woff2'),
             url('assets/fonts/UthmanicHafs1-Ver17.ttf') format('truetype'),
             url('assets/fonts/UthmanicHafs1Ver18.woff2') format('woff2'),
             url('assets/fonts/UthmanicHafs1Ver18.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.quran-text {
    font-family: 'qpc-hafs', 'uthmani-hafs', serif;
    direction: rtl;
    text-align: right;
}


.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    min-width: var(--iqra-sidebar-width, 16.5rem);
    width: var(--iqra-sidebar-width, 16.5rem);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(249, 241, 206, 0.96) 0%, rgba(219, 205, 143, 0.98) 45%, var(--iqra-primary) 100%);
    color: var(--iqra-text-on-primary);
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: -0.125rem 0 0.75rem rgba(15, 23, 42, 0.08);
    z-index: 1000;
    backdrop-filter: blur(6px);
    overflow: hidden;
    transform: translateX(0);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
    will-change: transform;
}

body.sidebar-expanded .sidebar {
    transform: translateX(0);
}

body.sidebar-collapsed .sidebar {
    transform: translateX(calc(100% + 2.5rem));
    box-shadow: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.6rem 1.75rem 1.3rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.sidebar-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    background: var(--iqra-accent);
    color: var(--iqra-text-on-accent);
    font-size: 1.35rem;
    box-shadow: 0 12px 24px rgba(0, 64, 48, 0.18);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
}

.sidebar-brand-title {
    font-size: clamp(1.25rem, 1vw + 0.85rem, 1.6rem);
    font-weight: 800;
    color: var(--iqra-text-on-primary);
    line-height: 1.1;
}

.sidebar-brand-subtitle {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.35);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.25rem 1.5rem 1.5rem;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 0.35rem;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(0, 64, 48, 0.28);
    border-radius: 0.25rem;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 64, 48, 0.42);
}

.sidebar-link {
    border: none;
    background: transparent;
    color: var(--iqra-text-on-primary);
    font: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 0.75rem;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    width: 100%;
    text-align: right;
}

.sidebar-link:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--iqra-text-on-primary);
    transform: translateX(-0.2rem);
}

.sidebar-link:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.25);
    outline-offset: 3px;
}

.sidebar-link.active {
    background-color: var(--iqra-accent);
    color: var(--iqra-text-on-accent);
    box-shadow: 0 10px 22px rgba(0, 64, 48, 0.18);
}

.sidebar-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.65rem;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-link.active .sidebar-link-icon {
    background: rgba(255, 249, 229, 0.18);
    color: var(--iqra-text-on-accent);
}

.sidebar-link-label {
    flex: 1;
    font-weight: 600;
    font-size: clamp(0.92rem, 1vw + 0.5rem, 1.05rem);
}

.sidebar-link--home {
    background-color: transparent;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1.2rem 1.5rem 1.6rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-align: right;
}

.sidebar-user-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--iqra-text-on-primary);
}

.sidebar-user-role {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.55);
}

.sidebar-link--logout {
    background-color: rgba(0, 0, 0, 0.08);
}

.sidebar-link--logout:hover {
    background-color: rgba(0, 0, 0, 0.16);
}

/* Main content wrapper responds to sidebar state */
#main-view > .flex-1 {
    margin-right: clamp(1.25rem, 4vw, 2.5rem);
    transition: margin-right 0.35s ease;
}

body.sidebar-expanded #main-view > .flex-1 {
    margin-right: calc(var(--iqra-sidebar-width, 16.5rem) + 1.5rem);
}

body.sidebar-collapsed #main-view > .flex-1 {
    margin-right: clamp(2.75rem, 3.5vw, 4rem);
}

.btn-primary {
    background-color: var(--iqra-accent);
    color: var(--iqra-text-on-accent);
    border: 1px solid var(--iqra-accent);
    transition: background-color 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--iqra-accent-dark);
    border-color: var(--iqra-accent-dark);
}

.btn-primary:disabled {
    background-color: var(--iqra-border);
    color: var(--iqra-text-secondary);
    cursor: not-allowed;
    border-color: var(--iqra-border);
}

.btn-secondary {
    background-color: var(--iqra-primary-light);
    color: var(--iqra-text-primary); /* Use high-contrast text */
    border: 1px solid var(--iqra-primary-light);
    transition: background-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
    background-color: var(--iqra-primary);
    color: var(--iqra-text-primary); /* Keep text color consistent on hover */
}

.badge-green {
    background-color: var(--iqra-success-soft);
    color: var(--iqra-success);
}

.badge-red {
    background-color: var(--iqra-danger-soft);
    color: var(--iqra-danger);
}

.badge-yellow {
    background-color: var(--iqra-warning-soft);
    color: var(--iqra-warning);
}

.grade-card {
    background: var(--iqra-surface);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.grade-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

/* Grades Table */
.grades-table {
    width: 100%;
    border-collapse: collapse;
}

.grades-table thead tr {
    background: rgba(249, 250, 251, 0.8);
}

.grades-table th {
    padding: 1rem;
    text-align: right;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
    font-size: 0.9375rem;
}

.grades-table tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: background-color 0.15s ease;
}

.grades-table tbody tr:hover {
    background: rgba(249, 250, 251, 0.5);
}

.grades-table td {
    padding: 1rem;
    vertical-align: middle;
}

/* Type Chips */
.chip-teal, .chip-gold, .chip-slate {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1;
}

.chip-teal {
    background: rgba(20, 184, 166, 0.08);
    color: #0d9488;
}

.chip-gold {
    background: rgba(219, 205, 143, 0.15);
    color: #a07f3a;
}

.chip-slate {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
}

/* Grid Layouts - Proper CSS Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

/* Assignment card matches theme (teal accent) */
.assignment-card {
    background: var(--iqra-surface);
    border-right: 4px solid var(--iqra-primary-light); /* teal */
    border: 1px solid var(--iqra-border);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05), 0 1px 2px -1px rgb(0 0 0 / 0.05);
}

/* Themed progress bar (gold fill) */
.progress {
    background-color: var(--iqra-border);
    height: 8px;
    border-radius: 9999px;
    overflow: hidden;
}
.progress-bar {
    background-color: var(--iqra-accent); /* gold */
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.loader {
    border: 4px solid var(--iqra-border);
    border-top: 4px solid var(--iqra-text-secondary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.quran-text,
.quran-text *:lang(ar) {
    font-family: 'qpc-hafs', 'Amiri', serif !important;
    direction: rtl;
    unicode-bidi: plaintext;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
}

.quran-text:hover {
    transition: color 0.2s;
}

.ayah-line {
    display: block;
    text-align: justify;
    text-align-last: right;
    text-justify: inter-word;
    line-height: 2.1;
    font-size: 30px;
}

.ayah-line::after {
    content: "";
    display: inline-block;
    width: 0%;
}

.basmalah {
    text-align: center;
    font-size: 24px;
    margin-bottom: 0.5rem;
}

/* basmalah image — centered and constrained */
.basmalah-img {
    display: block;
    margin: 0 auto 0.25rem;
    max-height: 56px; /* adjust as needed */
    width: auto;
    max-width: 75%;
}

.surah-header {
    background: white;
    border: 2px solid var(--iqra-accent);
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--iqra-accent);
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    position: relative;
    letter-spacing: 0.01em;
}

#surah-container {
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

#surah-quote {
    transition: 0.4s;
}

#surah-quote:hover {
    background-color: var(--iqra-success-soft);
    transition: 0.3s;
}

#login-page {
    /* Subtle Islamic geometric pattern under a translucent green overlay */
    background-image:
        linear-gradient(rgba(0, 64, 48, 0.75), rgba(0, 64, 48, 0.75)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23cdbe78' stroke-opacity='0.25' stroke-width='1'%3E%3Cpath d='M0 32 L32 0 L64 32 L32 64 Z'/%3E%3Cpath d='M0 0 L64 64 M64 0 L0 64'/%3E%3Ccircle cx='32' cy='32' r='6' stroke='%23115e59' stroke-opacity='0.35'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat, repeat;
    background-size: cover, 64px 64px; /* Overlay covers viewport; pattern tiles */
    background-position: center, top left;
    background-attachment: fixed, fixed; /* subtle parallax effect */
}

#login-container {
    background-color: var(--iqra-bg);
}

#btn-login {
    color: var(--iqra-text-on-accent);
    background-color: var(--iqra-accent);
    transition: 0.2s;
}
#btn-login:hover {
    background-color: var(--iqra-accent-dark);
}

/* ========================
   THEME VARIABLES
   ======================== */
:root {
    /* Brand & Accent Colors (Swapped) */
    --iqra-primary: #cdbe78;       /* Gold (formerly accent) */
    --iqra-primary-light: #bcae6a; /* Darker Gold (formerly accent-dark) */
    --iqra-accent: #004030;        /* Deep Green (formerly primary) */
    --iqra-accent-dark: #115e59;   /* Lighter Teal (formerly primary-light) */

    /* Background & Surface Colors */
    --iqra-bg: #fff9e5; /* Warm, creamy off-white for the main page background */
    --iqra-surface: #ffffff; /* Pure white for cards, modals, and input fields */
    --iqra-surface-muted: #f8fafc; /* A very light gray for subtle backgrounds (e.g., disabled states) */

    /* Text Colors (Swapped) */
    --iqra-text-primary: #0f172a; /* Near-black for high-contrast body text */
    --iqra-text-secondary: #475569; /* Muted slate for subtitles, hints, and secondary information */
    --iqra-text-on-primary: #004030; /* Dark green for text on gold backgrounds (formerly on-accent) */
    --iqra-text-on-accent: #fff9e5;  /* Creamy white for text on dark green backgrounds (formerly on-primary) */
    --iqra-text-on-secondary: #0f172a; /* High-contrast near-black for secondary elements */

    /* Border & Divider Colors (Ring color updated) */
    --iqra-border: #e2e8f0; /* Soft, neutral gray for borders and dividers */
    --iqra-ring: rgba(205, 190, 120, 0.3); /* A subtle GOLD ring for focus states */

    /* Semantic Colors */
    --iqra-danger: #dc2626; /* Bright red for errors and destructive actions */
    --iqra-danger-soft: #fee2e2; /* A soft red for background highlights */
    --iqra-success: #16a34a; /* A clear green for success states */
    --iqra-success-soft: #dcfce7; /* A soft green for background highlights */
    --iqra-warning: #f59e0b; /* Amber for warnings */
    --iqra-warning-soft: #fef9c3; /* A soft yellow for background highlights */

    --iqra-danger-ring: rgba(220, 38, 38, 0.25);
    --iqra-success-ring: rgba(22, 163, 74, 0.25);
    --iqra-sidebar-width: 16.5rem;
    --sidebar-toggle-default-top: 50%;
}

/* ========================
   FORMS: Inputs, Selects, Textareas
   ======================== */

/* Base control (apply via class or inherit via element selectors below) */
.form-control {
    width: 100%;
    background-color: var(--iqra-surface);
    color: var(--iqra-text-primary);
    border: 1.5px solid var(--iqra-border);
    border-radius: 0.5rem; /* rounded */
    padding: 0.75rem 0.875rem; /* 12px 14px */
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-control::placeholder {
    color: var(--iqra-text-secondary);
}

.form-control:focus {
    border-color: var(--iqra-primary-light);
    box-shadow: 0 0 0 3px var(--iqra-ring);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--iqra-surface-muted);
    cursor: not-allowed;
    color: var(--iqra-text-secondary);
}

/* Error and success states (opt-in via class) */
.form-control.is-invalid {
    border-color: var(--iqra-danger);
    box-shadow: 0 0 0 3px var(--iqra-danger-ring);
}

.form-control.is-valid {
    border-color: var(--iqra-success);
    box-shadow: 0 0 0 3px var(--iqra-success-ring);
}

/* Apply improved defaults app-wide without adding classes everywhere */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    background-color: var(--iqra-surface);
    color: var(--iqra-text-primary);
    border: 1.5px solid var(--iqra-border);
    border-radius: 0.5rem;
    padding: 0.75rem 0.875rem;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    border-color: var(--iqra-primary-light);
    box-shadow: 0 0 0 3px var(--iqra-ring);
}

input::placeholder,
textarea::placeholder {
    color: var(--iqra-text-secondary);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.code-input {
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
}

.code-input[dir="ltr"] {
    text-align: left;
}

/* Label and helper text */
.form-label {
    display: inline-block;
    margin-bottom: 0.5rem;
    color: var(--iqra-text-primary);
    font-weight: 600;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.form-label-row .form-label {
    margin-bottom: 0;
}

.form-helper-text {
    color: var(--iqra-text-secondary);
    font-size: 0.85rem;
}

.form-help {
    display: block;
    margin-top: 0.375rem;
    color: var(--iqra-text-secondary);
    font-size: 0.875rem;
}

.tooltip-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--iqra-text-secondary);
    cursor: help;
    transition: color 0.2s ease, background 0.2s ease;
}

.tooltip-trigger i {
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
}

.tooltip-trigger:hover,
.tooltip-trigger:focus-visible {
    color: var(--iqra-primary);
    background: rgba(205, 190, 120, 0.12);
}

.tooltip-trigger:focus-visible {
    outline: 2px solid rgba(205, 190, 120, 0.45);
    outline-offset: 2px;
}

.tooltip-trigger::after,
.tooltip-trigger::before {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tooltip-trigger::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 0.75rem);
    inset-inline-end: 0;
    max-width: 18rem;
    min-width: 12rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: right;
    direction: rtl;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.25);
    transform: translateY(-6px);
    z-index: 1200;
    white-space: normal;
}

.tooltip-trigger::before {
    content: '';
    position: absolute;
    top: calc(100% + 0.35rem);
    inset-inline-end: 1.1rem;
    width: 0.65rem;
    height: 0.65rem;
    background: rgba(15, 23, 42, 0.95);
    transform: translateY(-8px) rotate(45deg);
    z-index: 1199;
}

.tooltip-trigger:hover::after,
.tooltip-trigger:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-trigger:hover::before,
.tooltip-trigger:focus-visible::before {
    opacity: 1;
    transform: translateY(0) rotate(45deg);
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.error-message {
    display: block;
    margin-top: 0.375rem;
    color: var(--iqra-danger);
    font-size: 0.875rem;
}

/* Checkbox/Radio - theme accent and spacing */
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--iqra-primary);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Input with icon helpers (optional, apply via wrapper class) */
.input-with-icon {
    position: relative;
}
.input-with-icon .form-control {
    padding-right: 2.5rem; /* RTL default: icon on the right */
}
.input-with-icon .input-icon {
    position: absolute;
    top: 50%;
    right: 0.75rem; /* RTL */
    transform: translateY(-50%);
    color: var(--iqra-text-secondary);
    pointer-events: none;
}
.input-with-icon.icon-left .form-control {
    padding-right: 0.75rem;
    padding-left: 2.5rem;
}
.input-with-icon.icon-left .input-icon {
    right: auto;
    left: 0.75rem;
}

.login-access-field {
    direction: rtl;
}

.login-access-field .form-control {
    padding-right: 0.875rem;
    padding-left: 2.5rem;
    text-align: right;
    direction: rtl;
    unicode-bidi: plaintext;
}

.login-access-field .input-icon {
    right: auto;
    left: 0.75rem;
}

.pin-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background-color: var(--iqra-surface);
    border: 1.5px solid var(--iqra-border);
    border-radius: 0.5rem;
    padding: 0.65rem 1rem 0.65rem 3rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.pin-input-wrapper:focus-within {
    border-color: var(--iqra-primary-light);
    box-shadow: 0 0 0 3px var(--iqra-ring);
}

.pin-input-wrapper .input-icon {
    position: absolute;
    top: 50%;
    right: auto;
    left: 0.85rem;
    transform: translateY(-50%);
    color: var(--iqra-text-secondary);
    pointer-events: none;
}

.pin-input-grid {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    direction: ltr;
}

.pin-digit {
    width: 2.75rem;
    height: 2.9rem;
    border: 1.5px solid var(--iqra-border-muted, rgba(148, 163, 184, 0.55));
    border-radius: 0.75rem;
    background-color: var(--iqra-surface-muted, #f8fafc);
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--iqra-text-primary);
    letter-spacing: 0.08em;
    caret-color: var(--iqra-primary-light);
    outline: none;
    line-height: 1;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.pin-digit:focus {
    border-color: var(--iqra-primary-light);
    background-color: #fff;
    box-shadow: 0 0 0 3px var(--iqra-ring);
}

.pin-digit::-webkit-outer-spin-button,
.pin-digit::-webkit-inner-spin-button {
    display: none;
}

.pin-digit::placeholder {
    color: transparent;
}

.pin-digit:disabled {
    background-color: var(--iqra-surface-muted);
    color: var(--iqra-text-secondary);
    cursor: not-allowed;
}

.numeral-switcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: rgba(15, 23, 42, 0.04);
    border-radius: 999px;
}

.numeral-switcher-btn {
    border: none;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    background: transparent;
    color: var(--iqra-text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.numeral-switcher-btn:hover,
.numeral-switcher-btn:focus-visible {
    color: var(--iqra-primary);
    background: rgba(205, 190, 120, 0.18);
    outline: none;
}

.numeral-switcher-btn.is-active {
    background: var(--iqra-primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(205, 190, 120, 0.25);
}

/* ========================
   RESPONSIVE DESIGN
   ======================== */

/* Sidebar toggle control */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: var(--sidebar-toggle-expanded-top, var(--sidebar-toggle-default-top, 50%));
    right: clamp(0.6rem, 1vw + 0.45rem, 1.5rem);
    transform: translateY(-50%);
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 1100;
    opacity: 1;
    transition: top 0.38s cubic-bezier(0.4, 0, 0.2, 1), transform 0.38s cubic-bezier(0.4, 0, 0.2, 1), right 0.38s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

body.app-auth .sidebar-toggle {
    display: block;
}

.sidebar-toggle::before,
.sidebar-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    pointer-events: none;
}

.sidebar-toggle::before {
    right: calc(100% + 0.35rem);
    width: 1.4rem;
    height: 0.14rem;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 64, 48, 0.12) 0%, rgba(205, 190, 120, 0.6) 100%);
    opacity: 0;
    transform: translateY(-50%) scaleX(0.6);
    transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1), transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle::after {
    right: 100%;
    width: 0.85rem;
    height: 68%;
    border-radius: 999px 0 0 999px;
    background: linear-gradient(90deg, rgba(0, 64, 48, 0.16) 0%, rgba(0, 64, 48, 0.04) 100%);
    opacity: 0;
    transform: translateY(-50%) translateX(0.4rem);
    transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1), transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle-surface {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 249, 229, 0.92), rgba(205, 190, 120, 0.78));
    border: 1px solid rgba(0, 64, 48, 0.18);
    box-shadow: 0 12px 28px rgba(0, 64, 48, 0.2);
    color: var(--iqra-accent);
    transition: transform 0.36s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.32s ease, background 0.32s ease, border-color 0.32s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.sidebar-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    background: var(--iqra-accent);
    color: var(--iqra-text-on-accent);
    box-shadow: 0 10px 20px rgba(0, 64, 48, 0.25);
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.sidebar-toggle-icon i {
    font-size: 1.1rem;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle-label {
    position: absolute;
    top: 50%;
    right: calc(100% + 0.95rem);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: rgba(17, 94, 89, 0.95);
    color: var(--iqra-text-on-accent);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.045em;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-50%) translateX(0.35rem);
    box-shadow: 0 10px 20px rgba(0, 64, 48, 0.18);
    transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.sidebar-toggle:hover::before,
.sidebar-toggle:focus-visible::before {
    opacity: 0.55;
    transform: translateY(-50%) scaleX(1);
}

.sidebar-toggle:hover .sidebar-toggle-surface,
.sidebar-toggle:focus-visible .sidebar-toggle-surface {
    transform: translateX(-0.3rem);
    box-shadow: 0 16px 32px rgba(0, 64, 48, 0.28);
    border-color: rgba(0, 64, 48, 0.28);
    background: radial-gradient(circle at 30% 30%, rgba(255, 249, 229, 0.96), rgba(205, 190, 120, 0.82));
}

.sidebar-toggle:hover .sidebar-toggle-label,
.sidebar-toggle:focus-visible .sidebar-toggle-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.sidebar-toggle:focus-visible {
    outline: none;
}

.sidebar-toggle:focus-visible .sidebar-toggle-icon {
    box-shadow: 0 0 0 0.22rem rgba(0, 64, 48, 0.24), 0 12px 24px rgba(0, 64, 48, 0.28);
}

body.sidebar-expanded .sidebar-toggle {
    top: var(--sidebar-toggle-expanded-top, var(--sidebar-toggle-default-top, 50%));
    right: calc(var(--iqra-sidebar-width, 16.5rem) - 1.55rem);
    transform: translateY(-50%);
}

body.sidebar-expanded .sidebar-toggle-surface {
    background: radial-gradient(circle at 30% 30%, rgba(0, 64, 48, 0.92), rgba(17, 94, 89, 0.85));
    color: var(--iqra-text-on-accent);
    border-color: rgba(0, 64, 48, 0.32);
}

body.sidebar-expanded .sidebar-toggle-icon {
    background: var(--iqra-primary);
    color: var(--iqra-text-on-primary);
    box-shadow: 0 10px 20px rgba(0, 64, 48, 0.26);
}

body.sidebar-expanded .sidebar-toggle-icon i {
    transform: rotate(180deg);
}

body.sidebar-expanded .sidebar-toggle:not(:hover):not(:focus-visible) .sidebar-toggle-label {
    opacity: 0;
}

body.sidebar-expanded .sidebar-toggle:not(:hover):not(:focus-visible) .sidebar-toggle-surface {
    transform: translateX(-0.12rem);
}

body.sidebar-collapsed .sidebar-toggle-label {
    opacity: 0;
    transform: translateY(-50%) translateX(0.35rem);
}

body.sidebar-collapsed .sidebar-toggle {
    opacity: 0.95;
}

body.sidebar-collapsed .sidebar-toggle .sidebar-toggle-surface {
    background: radial-gradient(circle at 30% 30%, rgba(255, 249, 229, 0.88), rgba(205, 190, 120, 0.72));
    box-shadow: 0 16px 32px rgba(0, 64, 48, 0.2);
}

body.sidebar-collapsed .sidebar-toggle:hover,
body.sidebar-collapsed .sidebar-toggle:focus-visible {
    opacity: 1;
}

body.sidebar-collapsed .sidebar-toggle::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

body.sidebar-expanded .sidebar-toggle::after {
    opacity: 0;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 900;
}

.sidebar-overlay.active {
    display: block;
}

/* Responsive table wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .sidebar-toggle {
        top: clamp(1.25rem, 10vw, 3rem);
    }

    body.sidebar-expanded .sidebar-toggle {
        opacity: 0;
        pointer-events: none;
    }

    body.sidebar-collapsed .sidebar-toggle {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-toggle::before {
        width: 1.1rem;
    }

    .sidebar-toggle-surface {
        width: 3rem;
        height: 3rem;
    }

    .sidebar-toggle-icon {
        width: 2.1rem;
        height: 2.1rem;
    }

    .sidebar-toggle-label {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    #sidebar {
        width: clamp(14rem, 75vw, 17.5rem);
    }

    body.sidebar-collapsed .sidebar {
        transform: translateX(calc(100% + 0.75rem));
    }

    /* Main content: full width on mobile */
    #main-view > .flex-1,
    #practice-page {
        margin-right: 0 !important;
    }

    #main-content {
        padding: 1rem;
        padding-top: 4.5rem; /* Space for toggle handle */
    }

    /* Login page adjustments */
    #login-page {
        padding: 1rem;
    }

    #login-container {
        width: 100%;
        max-width: 100%;
        padding: 1.5rem;
    }

    /* Cards and containers */
    .assignment-card,
    .grade-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Forms: stack vertically */
    .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    .grid.grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    /* Tables: better mobile display */
    table {
        font-size: 0.875rem;
    }

    table thead {
        display: none;
    }

    table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--iqra-border);
        border-radius: 0.5rem;
        background-color: var(--iqra-surface);
    }

    table td {
        display: flex;
        justify-content: space-between;
        padding: 0.75rem;
        border-bottom: 1px solid var(--iqra-border);
    }

    table td:last-child {
        border-bottom: none;
    }

    table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--iqra-primary);
    }

    /* Buttons: larger touch targets */
    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    /* Modals: full screen on mobile */
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        overflow-y: auto;
    }

    /* Form inputs: larger for touch */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }

    /* Checkboxes and radio buttons: larger */
    input[type="checkbox"],
    input[type="radio"] {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* Progress bars */
    .progress {
        height: 0.75rem;
    }

    /* Badges */
    .badge-green,
    .badge-yellow,
    .badge-red {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    /* Quran verses container */
    #surah-container {
        padding: 1rem;
    }

    .quran-verse {
        font-size: 1.25rem;
        line-height: 2;
    }

    /* Hide less important columns in tables */
    .hide-mobile {
        display: none;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    #sidebar {
        width: 12rem;
    }

    #main-view > .flex-1 {
        margin-right: 12rem;
    }

    .grid.grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.125rem;
    }

    .assignment-card,
    .grade-card {
        padding: 0.75rem;
    }

    /* Tighter spacing */
    .space-y-4 > * + * {
        margin-top: 0.75rem;
    }

    .space-y-6 > * + * {
        margin-top: 1rem;
    }
}

/* ========================
   Bootstrap overrides to match Iqra theme
   ======================== */
.btn.btn-primary {
    background-color: var(--iqra-accent);
    border-color: var(--iqra-accent);
    color: var(--iqra-text-on-accent);
}
.btn.btn-primary:hover,
.btn.btn-primary:focus {
    background-color: var(--iqra-accent-dark);
    border-color: var(--iqra-accent-dark);
}

.btn.btn-secondary {
    background-color: var(--iqra-primary-light);
    border-color: var(--iqra-primary-light);
    color: var(--iqra-text-primary);
}
.btn.btn-secondary:hover,
.btn.btn-secondary:focus {
    background-color: var(--iqra-primary);
    border-color: var(--iqra-primary);
    color: var(--iqra-text-primary);
}

.form-select {
    border: 1.5px solid var(--iqra-border);
    border-radius: 0.5rem;
    padding: 0.625rem 0.75rem;
}
.form-select:focus {
    border-color: var(--iqra-primary-light);
    box-shadow: 0 0 0 3px var(--iqra-ring);
}

.form-check-input {
    border-color: var(--iqra-border);
}
.form-check-input:checked {
    background-color: var(--iqra-primary);
    border-color: var(--iqra-primary);
}

/* Sidebar link states */
/* These styles are now defined at the top of the file with the main .sidebar rules.
   This block can be removed to avoid conflicts. */
/*
.sidebar-link.active {
    background-color: rgba(47, 138, 104, 0.15);
    color: #fff;
}
.sidebar-link:hover {
    background-color: rgba(47, 138, 104, 0.1);
}
*/

/* ========================
   Page & Section Headers
   ======================== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--iqra-text-primary);
    line-height: 1.2;
    margin: 0;
    position: relative;
}
.page-title::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    background-color: var(--iqra-accent);
    border-radius: 999px;
    margin-top: 0.5rem;
    margin-right: 0; /* RTL align */
}

.page-subtitle {
    margin-top: 0.25rem;
    color: var(--iqra-text-secondary);
    font-size: 0.95rem;
}

.header-actions {
    display: inline-flex;
    gap: 0.5rem;
}

.section-title {
    font-size: 1.125rem; /* text-lg */
    font-weight: 700;
    color: var(--iqra-text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 0.75rem 0;
    padding-right: 0.5rem; /* RTL */
    border-right: 4px solid var(--iqra-primary);
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ========================
   Modern choice controls (radios/checkboxes)
   ======================== */
.choice-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

/* Base styled label that pairs with .btn-check */
.iqra-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--iqra-border);
    border-radius: 0.75rem;
    background-color: #fff;
    color: var(--iqra-text-primary);
    box-shadow: inset 0 0 0 0 transparent;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s, color 0.2s, transform 0.1s ease-in-out;
    text-align: center;
    user-select: none;
}

.btn-check:focus + .iqra-choice,
.iqra-choice:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--iqra-ring);
    border-color: var(--iqra-accent);
}

.btn-check:hover + .iqra-choice,
.iqra-choice:hover {
    border-color: var(--iqra-accent);
    background-color: rgba(0, 64, 48, 0.05);
}

.btn-check:checked + .iqra-choice {
    background-color: var(--iqra-accent);
    border-color: var(--iqra-accent);
    color: var(--iqra-text-on-accent);
    box-shadow: 0 12px 24px rgba(0, 64, 48, 0.2);
    transform: translateY(-1px);
}

.btn-check:checked:focus + .iqra-choice {
    box-shadow: 0 0 0 3px rgba(0, 64, 48, 0.25), 0 12px 24px rgba(0, 64, 48, 0.2);
}

.true-false-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.assessment-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--iqra-accent);
    color: var(--iqra-text-on-accent);
    border: 1px solid var(--iqra-accent);
    border-radius: 0.75rem;
    padding: 0.85rem 2.2rem;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.assessment-submit:hover {
    background-color: var(--iqra-accent-dark);
    border-color: var(--iqra-accent-dark);
}

.assessment-submit:focus-visible {
    outline: 3px solid rgba(255, 249, 229, 0.45);
    outline-offset: 2px;
}

.assessment-submit:disabled {
    background-color: var(--iqra-border);
    border-color: var(--iqra-border);
    color: var(--iqra-text-secondary);
    cursor: not-allowed;
}

.question-helper {
    margin-top: 0.5rem;
    color: var(--iqra-muted);
    font-size: 0.875rem;
}

.assessment-question {
    background-color: #fff;
    border: 1.5px solid var(--iqra-border);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.assessment-question + .assessment-question {
    margin-top: 1.5rem;
}

.question-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.question-index {
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 0.85rem;
    background: linear-gradient(140deg, var(--iqra-accent) 0%, #0d5e4e 100%);
    color: var(--iqra-text-on-accent);
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 249, 229, 0.32);
    box-shadow: 0 10px 20px rgba(0, 64, 48, 0.22);
}

.question-header-text {
    flex: 1;
}

.question-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--iqra-text);
    margin: 0;
    line-height: 1.7;
}

.question-meta {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.question-body {
    margin-top: 1rem;
}

.assessment-timer {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: linear-gradient(135deg, var(--iqra-accent) 0%, #0a5c4f 100%);
    color: var(--iqra-text-on-accent);
    border: 1.5px solid transparent;
    border-radius: 0.95rem;
    padding: 0.9rem 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    box-shadow: 0 20px 45px rgba(0, 64, 48, 0.25);
    position: relative;
    overflow: hidden;
}

.assessment-timer::after {
    content: "";
    position: absolute;
    inset-inline-start: -30%;
    top: -40%;
    width: 65%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255, 249, 229, 0.18), transparent 60%);
    pointer-events: none;
    transform: rotate(18deg);
}

.assessment-timer .timer-icon {
    font-size: 1.2rem;
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 249, 229, 0.18);
    color: var(--iqra-text-on-accent);
    box-shadow: inset 0 0 0 1px rgba(255, 249, 229, 0.25);
}

.assessment-timer .timer-value {
    font-variant-numeric: tabular-nums;
    font-size: 1.15rem;
}

.timer-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    border-color: rgba(146, 64, 14, 0.4);
    color: #52250a;
    box-shadow: 0 20px 45px rgba(146, 64, 14, 0.28);
}

.timer-warning::after {
    opacity: 0;
}

.timer-warning .timer-icon {
    background: rgba(255, 255, 255, 0.35);
    color: #52250a;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.submission-tools {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.submission-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.submission-deck {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.submission-deck.gender-split {
    gap: 2rem;
}

.submission-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.submission-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.submission-group-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--iqra-text);
}

.submission-group-cards {
    margin-top: 0.5rem;
}

.item-card.submission-card {
    border-right-color: var(--iqra-primary-600);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.1);
    padding: 1.5rem;
    gap: 1.25rem;
}

.submission-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.submission-card-info {
    flex: 1;
}

.submission-student {
    margin: 0;
    font-weight: 700;
    color: var(--iqra-text);
    font-size: 1.125rem;
}

.submission-meta {
    margin: 0.35rem 0 0 0;
    color: var(--iqra-muted);
    font-size: 0.875rem;
}

.submission-card-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.submission-card-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.submission-card-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.submission-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.submission-card-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.submission-card-body {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
    padding-top: 1.25rem;
}

.submission-card.is-expanded .submission-card-body {
    display: flex;
}

.submission-answers {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.submission-answer {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.submission-answer.is-correct {
    border-color: rgba(22, 163, 74, 0.45);
    background-color: #ecfdf5;
}

.submission-answer.is-incorrect {
    border-color: rgba(239, 68, 68, 0.45);
    background-color: #fef2f2;
}

.submission-answer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.submission-question-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
}

.submission-question-index {
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    background-color: var(--iqra-primary);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.submission-question-text-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.submission-question-text {
    margin: 0;
    font-weight: 600;
    color: var(--iqra-text);
    line-height: 1.7;
    text-align: right;
}

.submission-question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.submission-answer-body {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answer-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}

.answer-label {
    font-weight: 600;
    color: var(--iqra-text);
    min-width: 120px;
}

.answer-value {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.answer-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background-color: #e2e8f0;
    color: #0f172a;
    font-weight: 600;
    font-size: 0.9rem;
}

.answer-empty {
    color: var(--iqra-muted);
    font-style: italic;
}

.answer-text-block {
    background-color: #f8fafc;
    border-radius: 0.75rem;
    padding: 0.75rem;
    line-height: 1.8;
    width: 100%;
    color: var(--iqra-text);
}

.answer-status {
    font-weight: 600;
}

.empty-submissions {
    background-color: #fff;
    border: 1.5px dashed var(--iqra-border);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    color: var(--iqra-muted);
    font-size: 1rem;
}


.submission-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
    margin-inline-start: auto;
    margin-inline-end: 0;
    width: max-content;
    max-width: 100%;
}

.submission-nav label {
    margin: 0;
    font-weight: 600;
    color: var(--iqra-text);
}

.submission-selector {
    min-width: 220px;
    flex: 0 1 340px;
    width: 100%;
    max-width: 340px;
    direction: rtl;
    text-align: right;
    text-align-last: right;
    padding-right: 2.5rem;
    padding-left: 0.75rem;
    background-position: right 0.85rem center;
}

.manual-grade-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.manual-grade-btn {
    border: 1.5px solid var(--iqra-border);
    background-color: #fff;
    color: var(--iqra-text);
    border-radius: 0.5rem;
    padding: 0.4rem 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.manual-grade-btn:hover {
    border-color: var(--iqra-primary-600);
    color: var(--iqra-primary-600);
}

.manual-grade-btn[data-grade="incorrect"]:hover {
    border-color: #fca5a5;
    color: #b91c1c;
    background-color: #fef2f2;
}

.manual-grade-btn.is-active[data-grade="correct"] {
    background-color: #ecfdf5;
    border-color: #34d399;
    color: #047857;
}

.manual-grade-btn.is-active[data-grade="incorrect"] {
    background-color: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.manual-grade-btn.is-active[data-grade="clear"] {
    background-color: #f8fafc;
    border-color: var(--iqra-border);
    color: var(--iqra-muted);
}

.manual-comment-block {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.manual-comment-label {
    font-weight: 600;
    color: var(--iqra-text);
    font-size: 0.95rem;
}

.manual-comment-input {
    width: 100%;
    min-height: 3.25rem;
    border: 1.5px solid var(--iqra-border);
    border-radius: 0.75rem;
    padding: 0.65rem 0.85rem;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.manual-comment-input:focus {
    outline: none;
    border-color: var(--iqra-primary-light);
    box-shadow: 0 0 0 0.2rem var(--iqra-ring);
}

.manual-comment-display {
    margin-top: 0.75rem;
    padding: 0.75rem 0.9rem;
    background-color: var(--iqra-surface-muted);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.85rem;
}

.manual-comment-display .answer-label {
    display: block;
    min-width: 0;
    margin-bottom: 0.35rem;
}

.submission-reviewer-note {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--iqra-border);
}

.reviewer-note-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--iqra-text);
}

.reviewer-note-input {
    width: 100%;
    min-height: 4rem;
    border: 1.5px solid var(--iqra-border);
    border-radius: 0.75rem;
    padding: 0.75rem 0.95rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.reviewer-note-input:focus {
    outline: none;
    border-color: var(--iqra-primary-light);
    box-shadow: 0 0 0 0.2rem var(--iqra-ring);
}

.submission-reviewer-note-display {
    margin-top: 1.5rem;
    padding: 1rem 1.15rem;
    border-radius: 0.85rem;
    background-color: var(--iqra-surface-muted);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.submission-detail {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.submission-detail-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.submission-detail-student {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--iqra-text);
}

.submission-detail-submitted {
    margin: 0.35rem 0 0 0;
    color: var(--iqra-muted);
    font-size: 0.9rem;
}

.submission-detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.submission-detail-answers {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.submission-detail-note {
    border-radius: 0.85rem;
    padding: 1rem 1.25rem;
    background: rgba(148, 163, 184, 0.12);
}

.submission-detail-note h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--iqra-text);
}

.submission-detail-note p {
    margin: 0;
    color: var(--iqra-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.submission-detail-note.is-empty {
    background: transparent;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    text-align: center;
}

.submission-detail-note.is-empty p {
    color: var(--iqra-muted);
}

@media (max-width: 768px) {
    .submission-detail-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .submission-detail-stats {
        justify-content: flex-start;
    }
}

.submission-reviewer-note-display .reviewer-note-label {
    display: block;
    margin-bottom: 0.5rem;
}

.reviewer-note-body {
    color: var(--iqra-text-secondary);
    line-height: 1.7;
    word-break: break-word;
}

.submission-card.is-highlight {
    border-color: var(--iqra-primary-600);
    box-shadow: 0 0 0 3px rgba(47, 138, 104, 0.2), 0 25px 50px -12px rgba(15, 23, 42, 0.25);
}

.passage-container {
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.passage-container.is-active {
    border-color: var(--iqra-primary-600);
    box-shadow: 0 0 0 2px rgba(47, 138, 104, 0.25);
}

.recording-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(249, 250, 251, 0.5);
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.recording-status i {
    font-size: 0.875rem;
}

.recording-status.is-recorded {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.15);
}

.recording-dock {
    position: fixed;
    inset-inline-end: 1.5rem;
    inset-inline-start: auto;
    bottom: 1.5rem;
    width: min(400px, calc(100% - 3rem));
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    z-index: 45;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.recording-dock.is-collapsed {
    padding-bottom: 1.5rem;
}

.recording-dock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.recording-dock-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.01em;
}

.recording-dock-subtitle {
    font-size: 0.875rem;
    color: #475569;
    margin: 0.375rem 0 0 0;
    line-height: 1.5;
}

.recording-dock-close {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.125rem;
    cursor: pointer;
    transition: color 0.2s ease;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.recording-dock-close:hover {
    color: #64748b;
}

.recording-dock-body {
    display: grid;
    gap: 1.25rem;
}

.recording-dock.is-collapsed .recording-dock-body,
.recording-dock.is-collapsed .recording-dock-footer {
    display: none;
}

.recording-dock-context {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.recording-dock-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(20, 184, 166, 0.08);
    color: #0d9488;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.recording-dock-passages {
    font-size: 0.8125rem;
    color: #475569;
    font-weight: 500;
}

.recording-timer {
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    color: #1e293b;
    letter-spacing: 0.025em;
    font-variant-numeric: tabular-nums;
}

.recording-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.75rem;
}

.recording-controls .btn,
.recording-controls .record-btn {
    justify-content: center;
    width: 100%;
}

.recording-controls .record-btn {
    grid-column: 2;
}

.record-btn {
    background: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.record-btn:hover:not(:disabled) {
    background: #dc2626;
}

.record-btn.is-recording {
    background: #f97316;
}

.record-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #94a3b8;
}

.recording-playback {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
}

.recording-audio {
    width: 100%;
    border-radius: 0.5rem;
}

.recording-playback-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.recording-dock-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.recording-dock-hint {
    font-size: 0.8125rem;
    color: #475569;
    text-align: center;
    line-height: 1.5;
}

.recording-dock-actions {
    display: flex;
    justify-content: center;
}

.recording-dock-actions .btn {
    min-width: 200px;
}

/* ======================================
   Practice Page Improvements
   ====================================== */

.passage-container {
    position: relative;
}

#surah-quote {
    position: relative;
}

#submission-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

#recitation-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(20, 184, 166, 0.3) transparent;
}

#recitation-content::-webkit-scrollbar {
    width: 8px;
}

#recitation-content::-webkit-scrollbar-track {
    background: transparent;
}

#recitation-content::-webkit-scrollbar-thumb {
    background: rgba(20, 184, 166, 0.3);
    border-radius: 4px;
}

#recitation-content::-webkit-scrollbar-thumb:hover {
    background: rgba(20, 184, 166, 0.5);
}

@media (max-width: 640px) {
    .recording-dock {
        inset-inline-end: 1rem;
        width: calc(100% - 2rem);
        bottom: 1rem;
        padding: 1.25rem;
    }

    .recording-controls {
        grid-template-columns: 1fr;
        gap: 0.625rem;
    }

    .recording-controls .record-btn {
        grid-column: auto;
    }

    .recording-dock-actions .btn {
        width: 100%;
        min-width: auto;
    }

    .passage-container {
        padding: 1.25rem !important;
    }

    .recording-timer {
        font-size: 2rem;
    }
}

.practice-review-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.practice-review-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.practice-review-learner {
    margin: 0;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--iqra-text);
}

.practice-review-gender {
    margin: 0.25rem 0 0 0;
    color: var(--iqra-muted);
    font-size: 0.95rem;
}

.practice-review-chip {
    background: rgba(47, 138, 104, 0.12);
    color: var(--iqra-primary-600);
    padding: 0.45rem 0.9rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.9rem;
}

.practice-review-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.practice-review-chip-memorization {
    background: rgba(93, 63, 211, 0.16);
    color: #4c1d95;
}

.practice-review-chip-score {
    background: rgba(250, 204, 21, 0.18);
    color: #b45309;
}

.practice-review-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    padding-inline-end: 0.35rem;
}

.practice-review-item {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1rem;
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.practice-review-item.is-correct {
    border-color: rgba(22, 163, 74, 0.45);
    background: #ecfdf5;
    box-shadow: 0 16px 35px rgba(22, 163, 74, 0.15);
}

.practice-review-item.is-incorrect {
    border-color: rgba(239, 68, 68, 0.35);
    background: #fef2f2;
}

.practice-review-footer {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.practice-eval-block {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.9rem;
    padding: 0.85rem 1rem;
}

.practice-eval-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.practice-eval-label {
    font-weight: 600;
    color: var(--iqra-text);
}

.practice-eval-status {
    font-size: 0.9rem;
    color: var(--iqra-muted);
}

.practice-eval-status.is-correct {
    color: #047857;
    font-weight: 600;
}

.practice-eval-status.is-incorrect {
    color: #b91c1c;
    font-weight: 600;
}

.practice-eval-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.practice-eval-actions .manual-grade-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding-inline: 0.9rem;
}

.practice-eval-note-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--iqra-text);
    margin: 0;
}

.practice-eval-note {
    min-height: 72px;
    resize: vertical;
    font-size: 0.95rem;
}

.practice-verse-actions {
    display: flex;
    justify-content: flex-end;
}

.practice-verse-toggle {
    white-space: nowrap;
}

.practice-review-verses {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.9rem;
    background: #ffffff;
    padding: 1rem;
}

.practice-verse-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    text-align: center;
}

.practice-verse-text-block {
    font-size: 1.4rem;
    line-height: 2.1;
    margin: 0;
    text-align: justify;
    text-align-last: right;
}

.practice-verse-loader {
    text-align: center;
    color: var(--iqra-muted);
    font-size: 0.95rem;
}

.practice-verse-error {
    text-align: center;
    color: #b91c1c;
    font-weight: 600;
}

.practice-review-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.practice-review-title {
    margin: 0;
    font-weight: 700;
    color: var(--iqra-text);
    font-size: 1rem;
}

.practice-review-subtitle {
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
    color: var(--iqra-muted);
}

.practice-review-duration {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #475569;
}

.practice-review-audio {
    width: 100%;
}

.practice-review-verses[hidden] {
    display: none;
}

.modal-backdrop {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}

.popup-card-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.15s ease-out;
    will-change: opacity;
    z-index: 1300;
}

.popup-card-backdrop.is-visible {
    opacity: 1;
}

.popup-card-backdrop.is-closing {
    opacity: 0;
}

.popup-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 1.25rem;
    padding: 2rem 1.75rem;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.18);
    border-top: 4px solid transparent;
    position: relative;
    text-align: center;
    transform: translate3d(0, 10px, 0) scale(0.985);
    opacity: 0;
    transition: transform 0.18s ease-out, opacity 0.18s ease-out;
    will-change: transform, opacity;
}

.popup-card-backdrop.is-visible .popup-card {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
}

.popup-card-backdrop.is-closing .popup-card {
    transform: translate3d(0, 10px, 0) scale(0.985);
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .popup-card-backdrop {
        transition: none;
    }

    .popup-card,
    .popup-card-backdrop.is-visible .popup-card,
    .popup-card-backdrop.is-closing .popup-card {
        transform: none;
        transition: none;
        opacity: 1;
    }
}

.popup-card-info { border-top-color: #38bdf8; }
.popup-card-success { border-top-color: #34d399; }
.popup-card-warning { border-top-color: #f59e0b; }
.popup-card-danger { border-top-color: #f87171; }

.popup-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--iqra-text);
    margin-bottom: 0.75rem;
}

.popup-card-message {
    color: var(--iqra-muted);
    line-height: 1.7;
    margin-bottom: 1.75rem;
}

.popup-card-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.popup-card-button {
    border: none;
    border-radius: 0.9rem;
    padding: 0.55rem 1.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.popup-card-primary {
    background: linear-gradient(135deg, var(--iqra-accent) 0%, #0b5747 100%);
    color: var(--iqra-text-on-accent);
    box-shadow: 0 16px 36px rgba(0, 64, 48, 0.22);
    min-width: 140px;
}

.popup-card-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(0, 64, 48, 0.26);
}

.popup-card-secondary {
    background-color: #f8fafc;
    color: var(--iqra-text);
    border: 1.5px solid var(--iqra-border);
}

.popup-card-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.popup-card-close {
    position: absolute;
    top: 1rem;
    inset-inline-end: 1rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.popup-card-close:hover {
    color: #0f172a;
}

@media (max-width: 768px) {
    .submission-tools {
        align-items: stretch;
        margin-bottom: 1rem;
        gap: 0.65rem;
    }

    .submission-summary {
        justify-content: flex-start;
    }

    .submission-card-header {
        flex-direction: column;
        align-items: stretch;
    }
    .submission-card-status {
        justify-content: flex-start;
    }
    .answer-row {
        flex-direction: column;
        gap: 0.35rem;
    }
    .answer-label {
        min-width: 0;
    }
    .submission-nav {
        flex-direction: column;
        align-items: stretch;
    }
    .submission-nav label {
        margin-bottom: 0.25rem;
    }
    .submission-selector {
        flex: 1 1 auto;
        max-width: 100%;
    }
    .practice-eval-block {
        padding: 0.75rem;
    }
    .practice-verse-actions {
        justify-content: stretch;
    }
    .practice-verse-toggle {
        width: 100%;
    }
}

.choice-note {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--iqra-muted);
}

/* Two-option segmented layout (e.g., True/False) */
.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* -------- Unified List Controls (RTL friendly) -------- */
.list-controls .form-control,
.list-controls .form-select {
    height: 46px;
    border-radius: 12px;
    border-color: #e2e8f0; /* slate-200 */
    padding: 0.6rem 1rem;
    font-size: 1rem;
    line-height: 1.4;
}
.list-controls .form-select {
    text-align: right;
    text-align-last: right;
    padding-left: 2.5rem; /* keep caret away from text */
    background-position: left 0.85rem center;
}
.list-controls .form-control:focus,
.list-controls .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(205, 190, 120, 0.25); /* gold glow */
    border-color: #cdbe78;
}
.rtl-input {
    direction: rtl;
    text-align: right;
    padding-right: 1rem;
}
.rtl-input::placeholder {
    text-align: right;
    color: #94a3b8;
}
.list-controls .input-group { flex-wrap: nowrap; }

/* -------- Modern Cards for Lists -------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.item-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.item-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(to bottom, rgba(249, 250, 251, 0.5), transparent);
}

.item-card-title {
    margin: 0 0 0.75rem 0;
    font-weight: 600;
    color: #1e293b;
    font-size: 1.125rem;
    line-height: 1.4;
}

.item-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.item-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
}

.item-card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.item-card-description {
    margin: 0;
    padding: 0.75rem 1rem;
    background: rgba(241, 245, 249, 0.5);
    border-right: 2px solid var(--iqra-accent);
    border-radius: 0.5rem;
    color: #475569;
    line-height: 1.6;
    font-size: 0.9375rem;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: rgba(249, 250, 251, 0.5);
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}

.item-info-row:hover {
    background: rgba(241, 245, 249, 0.7);
}

.item-info-row i {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(219, 205, 143, 0.15), rgba(219, 205, 143, 0.05));
    border: 1px solid rgba(219, 205, 143, 0.2);
    border-radius: 0.5rem;
    color: var(--iqra-accent);
    font-size: 0.875rem;
}

.item-info-row.is-important i {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(220, 38, 38, 0.05));
    border-color: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

.item-info-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.item-info-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #94a3b8;
    text-transform: uppercase;
}

.item-info-value {
    font-size: 0.9375rem;
    color: #1e293b;
    font-weight: 600;
}

.item-info-row.is-important .item-info-value {
    color: #dc2626;
}

.item-progress {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.item-progress .progress {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.item-progress .progress-bar {
    height: 100%;
    background: var(--iqra-accent);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.item-progress-label {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
}

.item-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(to top, rgba(249, 250, 251, 0.5), transparent);
    font-size: 0.875rem;
    color: #64748b;
}

.item-card-note {
    margin: 0;
    color: #64748b;
    font-size: 0.8125rem;
}

.item-info-empty {
    margin: 0;
    padding: 1.5rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
    font-style: italic;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .profile-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.item-card.profile-card {
    position: relative;
    padding: 0;
}

.item-card.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--iqra-accent);
    border-radius: 0 1rem 1rem 0;
}

.profile-card-learner::before {
    background: var(--iqra-accent);
}

.profile-card-team::before {
    background: var(--iqra-primary);
}

.profile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(to bottom, rgba(249, 250, 251, 0.5), transparent);
}

.profile-id-card-list-item + .profile-id-card-list-item {
    padding-top: 0.35rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.profile-card-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.profile-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.profile-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.profile-card-actions .btn {
    white-space: nowrap;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.profile-card-actions .btn[disabled] {
    cursor: not-allowed;
    opacity: 0.65;
}

.profile-card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: rgba(249, 250, 251, 0.5);
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}

.profile-info-row:hover {
    background: rgba(241, 245, 249, 0.7);
}

.profile-info-row i {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(219, 205, 143, 0.15), rgba(219, 205, 143, 0.05));
    border: 1px solid rgba(219, 205, 143, 0.2);
    border-radius: 0.5rem;
    color: var(--iqra-accent);
    font-size: 0.875rem;
}

.profile-info-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.profile-info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.profile-info-value {
    font-size: 0.9375rem;
    color: #1e293b;
    font-weight: 600;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.profile-stat {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem;
    background: #f8fafc;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.profile-stat-icon i {
    color: var(--iqra-primary-600);
    font-size: 1rem;
}

.profile-stat-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.profile-stat-label {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.profile-stat-value {
    font-size: 1.1rem;
    color: var(--iqra-text);
    font-weight: 700;
}

.profile-stat-hint {
    font-size: 0.75rem;
    color: #94a3b8;
}

.profile-note {
    font-size: 0.85rem;
    color: #b45309;
    background: #fef3c7;
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    text-align: right;
    margin-top: 0.5rem;
}

/* -------- Chips / Badges -------- */
.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.chip-teal {
    background: rgba(204, 251, 241, 0.8);
    color: #115e59;
    border-color: rgba(94, 234, 212, 0.3);
}

.chip-gold {
    background: rgba(254, 249, 195, 0.8);
    color: #854d0e;
    border-color: rgba(253, 224, 71, 0.3);
}

.chip-red {
    background: rgba(254, 226, 226, 0.8);
    color: #991b1b;
    border-color: rgba(252, 165, 165, 0.3);
}

.chip-slate {
    background: rgba(226, 232, 240, 0.8);
    color: #334155;
    border-color: rgba(148, 163, 184, 0.3);
}

.chip-outline {
    background: white;
    border-color: #e2e8f0;
    color: #64748b;
}

.chip-memorization {
    background: rgba(237, 233, 254, 0.8);
    color: #5b21b6;
    border-color: rgba(196, 181, 253, 0.3);
}

.meta-muted { color: #64748b; font-size: .85rem; }
.meta-danger { color: #dc2626; font-size: .85rem; }

/* -------- Profile Settings -------- */
.profile-settings-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.profile-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 1.5rem;
    align-items: start;
}

.profile-hero {
    display: grid;
    grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.profile-hero:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.profile-hero-avatar-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.profile-hero-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #f1f5f9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-hero-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.profile-avatar-controls .btn {
    justify-content: center;
    font-size: 0.875rem;
}

.profile-photo-note {
    margin: 0;
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
    line-height: 1.4;
}

.profile-hero-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-hero-name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.profile-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile-hero-list {
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.profile-hero-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(249, 250, 251, 0.5);
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.profile-hero-list-item:hover {
    background: rgba(241, 245, 249, 0.7);
}

.profile-hero-list-item dt {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
}

.profile-hero-list-item dd {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

.profile-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile-hero-actions .btn {
    font-size: 0.875rem;
}

.profile-id-card-actions .btn-icon:hover,
.profile-id-card-actions .btn-icon:focus {
    background: rgba(255, 255, 255, 0.18);
}

.profile-id-card .btn[data-tooltip] {
    position: relative;
}

.profile-id-card .btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, 6px) scale(0.95);
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    font-size: 0.72rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.6rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 2;
}

.profile-id-card .btn[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-top-color: rgba(15, 23, 42, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease;
    pointer-events: none;
    z-index: 2;
}

.profile-id-card .btn[data-tooltip]:hover::after,
.profile-id-card .btn[data-tooltip]:hover::before,
.profile-id-card .btn[data-tooltip]:focus-visible::after,
.profile-id-card .btn[data-tooltip]:focus-visible::before,
.profile-id-card .btn[data-tooltip].is-feedback::after,
.profile-id-card .btn[data-tooltip].is-feedback::before {
    opacity: 1;
    visibility: visible;
}

.profile-id-card .btn[data-tooltip]:hover::after,
.profile-id-card .btn[data-tooltip]:focus-visible::after,
.profile-id-card .btn[data-tooltip].is-feedback::after,
.profile-id-card .btn[data-tooltip][data-tooltip-state='visible']::after {
    transform: translate(-50%, -2px) scale(1);
}

.profile-id-card .btn[data-tooltip][data-tooltip-state='visible']::after,
.profile-id-card .btn[data-tooltip][data-tooltip-state='visible']::before {
    opacity: 1;
    visibility: visible;
}

.profile-id-card .btn[data-tooltip].is-feedback {
    background: rgba(59, 130, 246, 0.24);
    border-color: rgba(191, 219, 254, 0.8);
}

.profile-id-card {
    position: relative;
    background: white;
    color: #1e293b;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    width: min(100%, 420px);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow: hidden;
}

.profile-id-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--iqra-primary), var(--iqra-accent));
    border-radius: 1rem 1rem 0 0;
}

.profile-id-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(249, 250, 251, 0.5), transparent);
    pointer-events: none;
    border-radius: inherit;
}

.profile-id-card > * {
    position: relative;
    z-index: 1;
}

.profile-id-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-top: 0.5rem;
}

.profile-id-card-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #1e293b;
}

.profile-id-card-subtitle {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #64748b;
    max-width: 220px;
}

.profile-id-card-logo {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(219, 205, 143, 0.1));
    display: grid;
    place-items: center;
    color: var(--iqra-primary);
    font-size: 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.profile-id-card-body {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 1.25rem;
}

.profile-id-card-photo-wrapper {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    align-self: start;
}

.profile-id-card-photo-note {
    margin: 0;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 500;
}

.profile-id-card-name {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #1e293b;
}

.profile-id-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    min-width: 0;
}

.profile-id-card-name-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-id-card-id {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.profile-id-card-id.is-missing {
    color: #94a3b8;
    letter-spacing: 0.03em;
}

.profile-id-card-role {
    background: rgba(20, 184, 166, 0.1);
    color: var(--iqra-primary);
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.profile-id-card-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(148, 163, 184, 0.1);
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.profile-id-card-meta-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: #64748b;
}

.profile-id-card-meta-value {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.profile-id-card-meta-value strong {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 500;
}

.profile-id-card-meta-value span {
    font-weight: 600;
    color: #1e293b;
}

.profile-id-card-meta-separator {
    opacity: 0.3;
    font-size: 0.875rem;
    color: #cbd5e1;
}

.profile-id-card-meta-sub {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: #64748b;
}

.profile-id-card-meta-sub span {
    font-weight: 600;
    color: #1e293b;
}

.profile-id-card-list {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
}

.profile-id-card-list-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.875rem;
    padding: 0.625rem 0;
}

.profile-id-card-list-item + .profile-id-card-list-item {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}


.profile-id-card-list-item dt {
    margin: 0;
    min-width: 100px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #64748b;
}

.profile-id-card-list-item dd {
    margin: 0;
    font-weight: 600;
    color: #1e293b;
    word-break: break-word;
    flex: 1;
    text-align: right;
}

.profile-id-card-photo {
    width: 80px;
    height: 80px;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 3px solid rgba(20, 184, 166, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, rgba(249, 250, 251, 0.5), rgba(249, 250, 251, 0.8));
}

.profile-id-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.profile-id-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.profile-id-card-divider {
    height: 1px;
    border: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.06);
}

.profile-id-card-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.profile-id-card-actions .btn {
    justify-content: center;
    font-weight: 500;
    letter-spacing: 0;
}

.profile-id-card-actions .btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    padding: 0;
}

.profile-id-card-actions .btn-icon i {
    pointer-events: none;
}

.profile-id-card-pin {
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.05), rgba(219, 205, 143, 0.05));
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px solid rgba(20, 184, 166, 0.2);
    flex: 1 1 220px;
    min-width: 220px;
}

.profile-id-card-label {
    font-size: 0.75rem;
    letter-spacing: 0.01em;
    color: #64748b;
    font-weight: 500;
}

.profile-id-card-value {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #1e293b;
}

.profile-id-pin-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.625rem;
}

.profile-id-card-pin-note {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #64748b;
}

.profile-id-card .btn-outline-secondary,
.profile-id-card .btn-compact {
    border-color: rgba(0, 0, 0, 0.15);
    color: #1e293b;
    background: white;
}

.profile-id-card .btn-outline-secondary:hover,
.profile-id-card .btn-compact:hover {
    border-color: var(--iqra-primary);
    background: rgba(20, 184, 166, 0.05);
    color: var(--iqra-primary);
}

.profile-id-card-note {
    margin: 1rem 0 0;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    background: rgba(249, 250, 251, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
}

@media (max-width: 520px) {
    .profile-id-card {
        width: 100%;
        padding: 1.2rem;
    }

    .profile-id-card-body {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-id-card-subtitle {
        max-width: none;
    }

    .profile-id-card-photo-wrapper {
        justify-items: center;
    }

    .profile-id-pin-info {
        flex-direction: column;
    }
}

.profile-forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.75rem;
}

@media (max-width: 768px) {
    .profile-id-card {
        padding: 1.15rem;
        margin-inline: auto;
    }

    .profile-id-card-footer {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .profile-id-card-pin {
        flex-basis: 100%;
        width: 100%;
        max-width: none;
    }

    .profile-id-card-body {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-id-card-info {
        align-items: center;
    }

    .profile-id-card-name-row {
        justify-content: center;
    }

    .profile-id-card-list-item {
        justify-content: center;
    }

    .profile-id-card-actions .btn {
        justify-content: center;
    }
}

.profile-section-note {
    margin: 0.6rem 0 0 0;
    font-size: 0.82rem;
    color: #64748b;
}

.profile-form {
    display: grid;
    gap: 1.1rem;
}

.profile-section {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: box-shadow 0.2s ease;
}

.profile-section:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.profile-section.profile-section-pin {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.profile-section.profile-section-pin::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--iqra-primary), var(--iqra-accent));
    border-radius: 0 1rem 1rem 0;
}

.profile-section.profile-section-pin::after {
    display: none;
}

.profile-section-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.profile-section-header-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, rgba(219, 205, 143, 0.15), rgba(219, 205, 143, 0.05));
    border: 1px solid rgba(219, 205, 143, 0.2);
    color: var(--iqra-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.profile-section-header-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-section-header-text h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.profile-section-header-text .profile-section-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
}

.profile-pin-status {
    margin-inline-start: auto;
    background: rgba(249, 250, 251, 0.5);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-pin-status-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.profile-pin-status-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: 0.05em;
}

.profile-pin-status-note {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
}

.profile-pin-guidelines {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
}

.profile-pin-guidelines li {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    background: rgba(249, 250, 251, 0.5);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.5;
}

.profile-pin-guidelines i {
    flex-shrink: 0;
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.125rem;
}

.profile-pin-form {
    gap: 1rem;
}

.pin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.profile-pin-hint {
    margin: 0;
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.5;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.profile-section h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.profile-section-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
}

.profile-section .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-section .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
}

.profile-section .form-control {
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    background: white;
    font-size: 0.9375rem;
    padding: 0.625rem 0.875rem;
    transition: all 0.2s ease;
    color: #1e293b;
}

.profile-section .form-control:focus {
    outline: none;
    border-color: var(--iqra-accent);
    box-shadow: 0 0 0 3px rgba(219, 205, 143, 0.1);
}

.profile-section-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.profile-section-actions .btn-primary {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
}

@media (max-width: 992px) {
    .profile-overview-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-hero-avatar-block {
        align-items: center;
    }

    .profile-hero-details {
        align-items: center;
        text-align: center;
    }

    .profile-hero-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        text-align: right;
    }

    .profile-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-pin-status {
        margin-inline-start: 0;
    }

    .profile-hero-list-item {
        width: 100%;
    }

    .profile-hero-list-item dt,
    .profile-hero-list-item dd {
        font-size: 0.875rem;
    }

    .profile-id-card {
        max-width: none;
        margin-inline: auto;
    }
}

@media (max-width: 640px) {
    .profile-hero {
        padding: 1.5rem;
    }

    .profile-id-card {
        padding: 1.1rem;
    }

    .profile-id-card-body {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .profile-id-card-photo {
        width: 56px;
        height: 56px;
    }

    .profile-forms-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-section {
        padding: 1.35rem;
        border-radius: 1.1rem;
    }

    .profile-id-pin {
        align-items: flex-start;
    }
}

.profile-hero-pin {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
}

.profile-hero-pin .profile-section {
    margin: 0;
}
/* ======================================
   Unified Dashboard Design System
   ====================================== */

/* Dashboard Banner - Smart Reminder */
.dashboard-banner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    color: white;
}

.dashboard-banner-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    font-size: 1.5rem;
}

.dashboard-banner-content {
    flex: 1;
}

.dashboard-banner-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.dashboard-banner-message {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.dashboard-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dashboard-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(to bottom, rgba(249, 250, 251, 0.5), transparent);
}

.dashboard-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.dashboard-card-icon {
    color: var(--iqra-accent);
    font-size: 1rem;
}

.dashboard-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 1.75rem;
    padding: 0 0.625rem;
    background: var(--iqra-accent);
    color: white;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.dashboard-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--iqra-accent);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}

.dashboard-card-link:hover {
    background: rgba(219, 205, 143, 0.1);
}

.dashboard-card-body {
    padding: 0;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Dashboard Actions Grid */
.dashboard-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.dashboard-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    color: #475569;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dashboard-action-btn:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: var(--iqra-accent);
    color: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dashboard-action-btn i {
    font-size: 1.5rem;
    color: var(--iqra-accent);
}

/* Dashboard List */
.dashboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dashboard-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.dashboard-list-item:last-child {
    border-bottom: none;
}

.dashboard-list-item:hover {
    background-color: rgba(249, 250, 251, 0.8);
}

.dashboard-list-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.dashboard-list-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(219, 205, 143, 0.15), rgba(219, 205, 143, 0.05));
    border: 1px solid rgba(219, 205, 143, 0.2);
    border-radius: 0.625rem;
    color: var(--iqra-accent);
    font-size: 1rem;
}

.dashboard-list-icon-grade {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    border-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.dashboard-list-details {
    flex: 1;
    min-width: 0;
}

.dashboard-list-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.375rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-list-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #64748b;
    margin: 0;
}

.dashboard-list-meta i {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.dashboard-list-separator {
    color: #cbd5e1;
}

.dashboard-list-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background: rgba(219, 205, 143, 0.15);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--iqra-accent-dark);
}

.dashboard-list-note {
    margin: 0.5rem 0 0 0;
    padding: 0.5rem;
    background: rgba(59, 130, 246, 0.05);
    border-right: 2px solid #3b82f6;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: #475569;
    line-height: 1.5;
}

.dashboard-list-action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--iqra-accent);
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dashboard-list-action:hover {
    background: var(--iqra-accent-dark);
    transform: translateX(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-list-action i {
    font-size: 0.75rem;
}

.dashboard-list-date {
    flex-shrink: 0;
    font-size: 0.8125rem;
    color: #94a3b8;
    text-align: left;
}

.dashboard-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
}

.dashboard-list-empty i {
    font-size: 2.5rem;
    color: #cbd5e1;
}

.dashboard-list-empty p {
    margin: 0;
    font-size: 0.9375rem;
    color: #94a3b8;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .dashboard-banner {
        padding: 1.25rem;
    }
    
    .dashboard-banner-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }
    
    .dashboard-banner-message {
        font-size: 1rem;
    }
    
    .dashboard-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .dashboard-list-action {
        align-self: stretch;
        justify-content: center;
    }
    
    .dashboard-list-date {
        align-self: flex-start;
    }
}

/* ======================================
   Unified Button System
   ====================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--iqra-accent);
    color: white;
    border-color: var(--iqra-accent);
}

.btn-primary:hover:not(:disabled) {
    background: var(--iqra-accent-dark);
    border-color: var(--iqra-accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-outline {
    background: transparent;
    color: var(--iqra-accent);
    border-color: var(--iqra-accent);
}

.btn-outline:hover:not(:disabled) {
    background: var(--iqra-accent);
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-link {
    background: transparent;
    color: var(--iqra-accent);
    border: none;
    padding: 0.5rem 0.75rem;
}

.btn-link:hover:not(:disabled) {
    background: rgba(219, 205, 143, 0.1);
    text-decoration: none;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
}

/* Page Header Unified */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.page-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin: 0.5rem 0 0 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Content Card for Pages */
.content-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.content-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(to bottom, rgba(249, 250, 251, 0.5), transparent);
}

.content-card-body {
    padding: 1.5rem;
}

.content-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(249, 250, 251, 0.5);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state-icon {
    font-size: 4rem;
    color: #cbd5e1;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #475569;
    margin: 0;
}

.empty-state-description {
    font-size: 1rem;
    color: #94a3b8;
    margin: 0;
}

.empty-state-action {
    margin-top: 1rem;
}

/* ======================================
   Dashboard-Style Responsive Improvements
   ====================================== */

@media (max-width: 768px) {
    .item-card-header {
        flex-direction: column;
        gap: 1rem;
    }

    .item-card-actions {
        width: 100%;
    }

    .item-card-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .profile-card-header {
        flex-direction: column;
    }

    .profile-card-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .profile-card-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .item-card-header,
    .profile-card-header {
        padding: 1rem 1.25rem;
    }

    .item-card-body,
    .profile-card-body {
        padding: 1rem 1.25rem;
    }

    .item-card-footer {
        padding: 0.875rem 1.25rem;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .profile-card-actions {
        grid-template-columns: 1fr;
    }

    .profile-card-actions .btn {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }
}

/* ======================================
   Enhanced Profile Stats (Dashboard Style)
   ====================================== */

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(249, 250, 251, 0.5);
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.profile-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 0.5rem;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.profile-stat-item:hover {
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.profile-stat-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(219, 205, 143, 0.15), rgba(219, 205, 143, 0.05));
    border: 1px solid rgba(219, 205, 143, 0.2);
    border-radius: 0.5rem;
    color: var(--iqra-accent);
    font-size: 1rem;
}

.profile-stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    text-align: center;
}

.profile-stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.profile-stat-hint {
    font-size: 0.6875rem;
    color: #94a3b8;
    text-align: center;
}

/* ======================================
   Modal Overlay & Dialog Styles
   ====================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1300;
    padding: 1rem;
    overflow-y: auto;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-dialog {
    width: 100%;
    max-width: 600px;
    margin: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 2rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.btn-close {
    background: transparent;
    border: none;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background 0.2s;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    color: #64748b;
}

.btn-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn-close::before {
    content: '×';
    font-size: 1.5rem;
    font-weight: 300;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0.5rem;
        align-items: flex-start;
    }
    
    .modal-dialog {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1.25rem 1.5rem;
    }
}
