/* =========================================================
   منظم المحفظ الذكي
   Global Stylesheet
   Version: 1.0.0
========================================================= */

/* =========================================================
   1. ROOT
========================================================= */

:root {
    --primary: #0b5ed7;
    --primary-dark: #084298;
    --primary-light: #e8f1ff;

    --secondary: #0f766e;
    --secondary-light: #e7f7f4;

    --success: #198754;
    --success-light: #e8f7ee;

    --warning: #f59f00;
    --warning-light: #fff4d6;

    --danger: #dc3545;
    --danger-light: #fdecef;

    --purple: #6f42c1;
    --purple-light: #f0eafa;

    --info: #0dcaf0;
    --info-light: #e8faff;

    --text: #182230;
    --text-soft: #5f6b7a;
    --text-muted: #8993a1;

    --bg: #f5f8fc;
    --surface: #ffffff;
    --surface-soft: #f8fafc;

    --border: #e1e7ef;
    --border-dark: #ccd5e1;

    --shadow-sm: 0 2px 8px rgba(15, 35, 60, 0.06);
    --shadow: 0 8px 25px rgba(15, 35, 60, 0.08);
    --shadow-lg: 0 18px 50px rgba(15, 35, 60, 0.13);

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --header-height: 74px;
    --sidebar-width: 260px;

    --transition: 0.2s ease;
}


/* =========================================================
   2. RESET
========================================================= */

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

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family:
        Tahoma,
        Arial,
        "Segoe UI",
        sans-serif;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

input,
select,
textarea {
    width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

ul,
ol {
    list-style: none;
}

table {
    border-collapse: collapse;
}


/* =========================================================
   3. SCROLLBAR
========================================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c7d0dc;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aeb9c7;
}


/* =========================================================
   4. HEADER
========================================================= */

.app-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: var(--header-height);
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 22px;

    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);

    backdrop-filter: blur(12px);
}

.header-right,
.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-icon {
    width: 43px;
    height: 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background: linear-gradient(
        135deg,
        var(--primary),
        var(--primary-dark)
    );

    color: white;
    font-size: 21px;

    box-shadow: 0 6px 15px rgba(11, 94, 215, 0.22);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.brand-text strong {
    font-size: 15px;
    color: var(--text);
}

.brand-text span {
    font-size: 11px;
    color: var(--text-soft);
}

.current-date {
    color: var(--text-soft);
    font-size: 13px;
}

.header-btn {
    border: 0;
    border-radius: 10px;
    padding: 9px 15px;

    background: var(--surface-soft);
    color: var(--text);

    transition: var(--transition);
}

.header-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.logout-btn:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.mobile-menu-btn {
    display: none;

    width: 42px;
    height: 42px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: var(--surface);
    color: var(--text);

    font-size: 20px;
}


/* =========================================================
   5. SIDE MENU
========================================================= */

.side-menu {
    position: fixed;

    top: var(--header-height);
    right: 0;
    bottom: 0;

    width: var(--sidebar-width);

    z-index: 900;

    display: flex;
    flex-direction: column;

    background: var(--surface);
    border-left: 1px solid var(--border);

    overflow-y: auto;
}

.side-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 22px 18px;

    border-bottom: 1px solid var(--border);
}

.side-menu-header > div:last-child {
    display: flex;
    flex-direction: column;
}

.side-menu-header strong {
    font-size: 14px;
}

.side-menu-header span {
    font-size: 11px;
    color: var(--text-soft);
}

.admin-avatar,
.parent-avatar {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 14px;
    background: var(--primary-light);

    font-size: 22px;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;

    padding: 14px 10px;
}

.nav-item {
    position: relative;

    width: 100%;

    display: flex;
    align-items: center;
    gap: 12px;

    min-height: 46px;

    padding: 9px 12px;

    border: 0;
    border-radius: 11px;

    background: transparent;
    color: var(--text-soft);

    text-align: right;

    transition: var(--transition);
}

.nav-item:hover {
    background: var(--surface-soft);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

.nav-icon {
    width: 25px;
    text-align: center;
    font-size: 17px;
}

.nav-count {
    min-width: 22px;
    height: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-right: auto;

    border-radius: 50%;

    background: var(--danger);
    color: white;

    font-size: 10px;
}

.side-menu-footer {
    margin-top: auto;
    padding: 15px;
    border-top: 1px solid var(--border);
}

.offline-status {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 9px 11px;

    border-radius: 10px;

    background: var(--surface-soft);

    color: var(--text-soft);
    font-size: 12px;
}

.status-dot {
    width: 9px;
    height: 9px;

    display: inline-block;

    border-radius: 50%;

    background: var(--success);
    box-shadow: 0 0 0 4px var(--success-light);
}


/* =========================================================
   6. MOBILE OVERLAY
========================================================= */

.side-menu-overlay {
    display: none;

    position: fixed;
    inset: 0;

    z-index: 850;

    background: rgba(0, 0, 0, 0.45);
}


/* =========================================================
   7. MAIN CONTAINER
========================================================= */

.page-container {
    min-height: 100vh;

    margin-right: var(--sidebar-width);

    padding:
        calc(var(--header-height) + 28px)
        28px
        40px;
}

.page-section {
    display: none;

    width: 100%;
    max-width: 1450px;

    margin: 0 auto;
}

.page-section.active {
    display: block;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}

.section-heading h1 {
    margin-bottom: 4px;

    font-size: 25px;
    line-height: 1.35;
}

.section-heading p {
    color: var(--text-soft);
    font-size: 13px;
}


/* =========================================================
   8. CARDS
========================================================= */

.content-card {
    margin-bottom: 20px;
    padding: 21px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 18px;
}

.card-header h2 {
    font-size: 18px;
    line-height: 1.35;
}

.card-kicker {
    display: block;

    margin-bottom: 3px;

    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
}

.card-header > strong {
    color: var(--primary);
    font-size: 15px;
}


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

.primary-btn,
.secondary-btn,
.danger-btn {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 9px 17px;

    border-radius: 10px;

    font-weight: 700;

    transition: var(--transition);
}

.primary-btn {
    border: 1px solid var(--primary);

    background: var(--primary);
    color: white;

    box-shadow: 0 5px 14px rgba(11, 94, 215, 0.18);
}

.primary-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

.secondary-btn {
    border: 1px solid var(--border-dark);

    background: var(--surface);
    color: var(--text);
}

.secondary-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.danger-btn {
    border: 1px solid var(--danger);

    background: var(--danger);
    color: white;
}

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

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    gap: 10px;

    margin-top: 20px;
}


/* =========================================================
   10. STATS
========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 20px;
}

.stat-card {
    min-height: 105px;

    display: flex;
    align-items: center;

    gap: 14px;

    padding: 17px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);

    transition: var(--transition);
}

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

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

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 14px;

    background: var(--primary-light);

    font-size: 21px;
}

.stat-card > div:last-child {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.stat-card span {
    color: var(--text-soft);
    font-size: 11px;
}

.stat-card strong {
    margin-top: 2px;

    color: var(--text);
    font-size: 21px;
}


/* =========================================================
   11. HERO
========================================================= */

.parent-student-hero {
    display: grid;

    grid-template-columns: auto 1fr auto;

    align-items: center;

    gap: 18px;

    margin-bottom: 20px;
    padding: 22px;

    border-radius: var(--radius-lg);

    background:
        linear-gradient(
            135deg,
            #eaf3ff,
            #f8fbff
        );

    border: 1px solid #dce9fa;
}

.student-avatar-large {
    width: 75px;
    height: 75px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 22px;

    background: white;

    box-shadow: var(--shadow-sm);

    font-size: 35px;
}

.student-hero-info h2 {
    font-size: 22px;
}

.student-hero-info p {
    color: var(--text-soft);
    font-size: 12px;
}

.small-label {
    display: block;

    color: var(--text-soft);
    font-size: 10px;
}

.student-hero-status {
    min-width: 160px;

    display: flex;
    flex-direction: column;

    align-items: flex-start;

    padding: 12px 15px;

    border-radius: 13px;

    background: rgba(255, 255, 255, 0.8);
}

.student-hero-status strong {
    color: var(--primary);
    font-size: 14px;
}

.student-hero-status span:last-child {
    color: var(--text-soft);
    font-size: 11px;
}


/* =========================================================
   12. TODAY CLASS
========================================================= */

.today-class-details {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;
}

.detail-item {
    display: flex;
    align-items: center;

    gap: 11px;

    padding: 13px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-soft);
}

.detail-icon {
    width: 37px;
    height: 37px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 10px;

    background: var(--primary-light);

    font-size: 17px;
}

.detail-item div {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.detail-item span:not(.detail-icon) {
    color: var(--text-soft);
    font-size: 10px;
}

.detail-item strong {
    font-size: 13px;
}

.today-class-note {
    margin-top: 14px;

    padding: 12px 14px;

    border-radius: 10px;

    background: var(--warning-light);

    color: #795500;

    font-size: 12px;
}


/* =========================================================
   13. BADGES
========================================================= */

.status-badge,
.stability-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 29px;

    padding: 5px 10px;

    border-radius: 999px;

    background: var(--primary-light);
    color: var(--primary);

    font-size: 11px;
    font-weight: 700;
}

.status-badge.success {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.warning {
    background: var(--warning-light);
    color: #946200;
}

.status-badge.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.status-badge.purple {
    background: var(--purple-light);
    color: var(--purple);
}

.stability-badge {
    background: var(--success-light);
    color: var(--success);
}


/* =========================================================
   14. PROGRESS
========================================================= */

.progress-track {
    width: 100%;
    height: 10px;

    overflow: hidden;

    border-radius: 999px;

    background: #e9eef5;
}

.progress-track.large {
    height: 13px;
}

.progress-track.extra-large {
    height: 17px;
}

.progress-fill {
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--primary),
            #4c9aff
        );

    transition: width 0.5s ease;
}

.progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-top: 10px;

    color: var(--text-soft);

    font-size: 11px;
}

.progress-meta strong {
    color: var(--text);
}


/* =========================================================
   15. REVIEW
========================================================= */

.next-review-box {
    padding: 16px;

    border-radius: 13px;

    background: var(--secondary-light);
    border: 1px solid #d2eee9;

    color: #17645f;

    font-size: 13px;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 14px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-soft);
}

.review-item-main {
    display: flex;
    align-items: center;
    gap: 11px;
}

.review-item-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: var(--purple-light);

    font-size: 17px;
}

.review-item-main div {
    display: flex;
    flex-direction: column;
}

.review-item-main strong {
    font-size: 13px;
}

.review-item-main span {
    color: var(--text-soft);
    font-size: 10px;
}


/* =========================================================
   16. NOTES
========================================================= */

.teacher-note-box {
    padding: 16px;

    border-right: 4px solid var(--primary);

    border-radius: 10px;

    background: var(--surface-soft);

    color: var(--text-soft);

    font-size: 13px;
}

.teacher-notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.teacher-note-item {
    padding: 14px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: var(--surface-soft);
}

.teacher-note-item strong {
    display: block;

    margin-bottom: 4px;

    font-size: 12px;
}

.teacher-note-item span {
    color: var(--text-soft);
    font-size: 11px;
}


/* =========================================================
   17. TIMELINE
========================================================= */

.timeline {
    position: relative;

    display: flex;
    flex-direction: column;

    gap: 10px;
}

.timeline-item {
    position: relative;

    display: grid;

    grid-template-columns: 80px 1fr;

    gap: 13px;

    padding: 13px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface);
}

.timeline-time {
    color: var(--primary);

    font-size: 12px;
    font-weight: 700;
}

.timeline-content {
    display: flex;
    flex-direction: column;
}

.timeline-content strong {
    font-size: 13px;
}

.timeline-content span {
    color: var(--text-soft);
    font-size: 11px;
}


/* =========================================================
   18. WEEKLY SCHEDULE
========================================================= */

.weekly-schedule {
    display: grid;

    grid-template-columns:
        repeat(7, minmax(120px, 1fr));

    gap: 9px;

    overflow-x: auto;
}

.week-day {
    min-height: 130px;

    padding: 11px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-soft);
}

.week-day-name {
    margin-bottom: 9px;

    color: var(--primary);

    font-size: 12px;
    font-weight: 700;
}

.week-day-empty {
    color: var(--text-muted);
    font-size: 10px;
}

.week-lesson {
    padding: 8px;

    margin-bottom: 6px;

    border-radius: 8px;

    background: var(--primary-light);

    color: var(--primary);

    font-size: 10px;
}


/* =========================================================
   19. LESSONS
========================================================= */

.lessons-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.lesson-item {
    display: grid;

    grid-template-columns: auto 1fr auto;

    align-items: center;

    gap: 13px;

    padding: 13px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface);
}

.lesson-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: var(--primary-light);

    font-size: 18px;
}

.lesson-info {
    display: flex;
    flex-direction: column;
}

.lesson-info strong {
    font-size: 13px;
}

.lesson-info span {
    color: var(--text-soft);
    font-size: 10px;
}

.lesson-rating {
    color: var(--warning);
    font-size: 12px;
}


/* =========================================================
   20. FILTERS / SEARCH
========================================================= */

.filter-toolbar {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-bottom: 17px;
}

.search-box {
    min-width: 250px;
    flex: 1;

    display: flex;
    align-items: center;

    gap: 8px;

    height: 43px;

    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface);
}

.search-box span {
    color: var(--text-muted);
}

.search-box input {
    height: 100%;

    border: 0;
    outline: 0;

    background: transparent;

    color: var(--text);

    font-size: 12px;
}

.filter-select,
.settings-form select,
.dialog-form select {
    min-height: 43px;

    padding: 8px 11px;

    border: 1px solid var(--border);
    border-radius: 10px;

    outline: 0;

    background: var(--surface);
    color: var(--text);

    font-size: 12px;
}

.filter-select:focus,
.search-box:focus-within,
input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 94, 215, 0.08);
}


/* =========================================================
   21. TABLES
========================================================= */

.records-table-wrapper {
    width: 100%;

    overflow-x: auto;

    border: 1px solid var(--border);
    border-radius: 12px;
}

.records-table {
    width: 100%;

    min-width: 700px;
}

.records-table th,
.records-table td {
    padding: 13px 12px;

    border-bottom: 1px solid var(--border);

    text-align: right;

    font-size: 11px;
}

.records-table th {
    background: var(--surface-soft);

    color: var(--text-soft);

    font-size: 10px;
}

.records-table tbody tr:last-child td {
    border-bottom: 0;
}

.records-table tbody tr:hover {
    background: #fafcff;
}

.table-empty {
    padding: 30px !important;

    text-align: center !important;

    color: var(--text-muted);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.table-action-btn {
    width: 31px;
    height: 31px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface);

    font-size: 13px;
}

.table-action-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}


/* =========================================================
   22. REQUESTS
========================================================= */

.requests-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.request-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 15px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: var(--surface);
}

.request-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.request-avatar {
    width: 45px;
    height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background: var(--primary-light);

    font-size: 20px;
}

.request-main-info {
    display: flex;
    flex-direction: column;
}

.request-main-info strong {
    font-size: 13px;
}

.request-main-info span {
    color: var(--text-soft);
    font-size: 10px;
}

.request-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}


/* =========================================================
   23. SHEIKHS
========================================================= */

.sheikhs-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;
}

.sheikh-card {
    padding: 17px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface);

    transition: var(--transition);
}

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

.sheikh-card-header {
    display: flex;
    align-items: center;

    gap: 11px;

    margin-bottom: 15px;
}

.sheikh-avatar {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background: var(--primary-light);

    font-size: 22px;
}

.sheikh-card-header div {
    display: flex;
    flex-direction: column;
}

.sheikh-card-header strong {
    font-size: 13px;
}

.sheikh-card-header span {
    color: var(--text-soft);
    font-size: 10px;
}

.sheikh-card-stats {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 7px;

    margin-bottom: 13px;
}

.sheikh-mini-stat {
    padding: 9px;

    border-radius: 9px;

    background: var(--surface-soft);

    text-align: center;
}

.sheikh-mini-stat span {
    display: block;

    color: var(--text-soft);

    font-size: 9px;
}

.sheikh-mini-stat strong {
    font-size: 15px;
}

.sheikh-card-actions {
    display: flex;
    gap: 7px;
}


/* =========================================================
   24. ADMIN DASHBOARD
========================================================= */

.admin-dashboard-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 10px;
}

.dashboard-info-item {
    display: flex;
    align-items: center;

    gap: 9px;

    padding: 12px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: var(--surface-soft);
}

.dashboard-info-item > div {
    display: flex;
    flex-direction: column;
}

.dashboard-info-item span:not(.detail-icon) {
    color: var(--text-soft);
    font-size: 10px;
}

.dashboard-info-item strong {
    font-size: 13px;
}

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    padding: 12px 0;

    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-icon {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: var(--primary-light);

    font-size: 15px;
}

.activity-info {
    display: flex;
    flex-direction: column;
}

.activity-info strong {
    font-size: 12px;
}

.activity-info span {
    color: var(--text-soft);
    font-size: 10px;
}

.quick-actions-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 11px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    min-height: 125px;

    padding: 15px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: var(--surface);

    color: var(--text);

    text-align: right;

    transition: var(--transition);
}

.quick-action:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.quick-action > span {
    margin-bottom: 8px;
    font-size: 23px;
}

.quick-action strong {
    margin-bottom: 2px;
    font-size: 13px;
}

.quick-action small {
    color: var(--text-soft);
    font-size: 10px;
}


/* =========================================================
   25. SCHEDULE SUMMARY
========================================================= */

.schedule-summary-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 10px;
}

.schedule-summary-item {
    padding: 14px;

    border-radius: 11px;

    background: var(--surface-soft);

    border: 1px solid var(--border);

    text-align: center;
}

.schedule-summary-item strong {
    display: block;

    color: var(--primary);

    font-size: 20px;
}

.schedule-summary-item span {
    color: var(--text-soft);
    font-size: 10px;
}


/* =========================================================
   26. REPORTS
========================================================= */

.weekly-report {
    min-height: 80px;

    padding: 15px;

    border-radius: 12px;

    background: var(--surface-soft);

    color: var(--text-soft);

    font-size: 13px;

    line-height: 1.9;
}

.admin-report-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 10px;
}

.report-detail-card {
    padding: 15px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-soft);
}

.report-detail-card span {
    display: block;

    color: var(--text-soft);

    font-size: 10px;
}

.report-detail-card strong {
    display: block;

    margin-top: 3px;

    font-size: 19px;
}


/* =========================================================
   27. SETTINGS
========================================================= */

.settings-form {
    width: 100%;
}

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;

    gap: 6px;
}

.form-group label {
    color: var(--text);

    font-size: 11px;
    font-weight: 700;
}

.form-group input,
.form-group textarea,
.form-group select {
    min-height: 43px;

    padding: 9px 11px;

    border: 1px solid var(--border);
    border-radius: 10px;

    outline: 0;

    background: var(--surface);
    color: var(--text);

    font-size: 12px;
}

.form-group textarea {
    min-height: 95px;
    resize: vertical;
}

.system-info-list {
    display: flex;
    flex-direction: column;
}

.account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    min-height: 47px;

    padding: 9px 0;

    border-bottom: 1px solid var(--border);
}

.account-row:last-child {
    border-bottom: 0;
}

.account-row span {
    color: var(--text-soft);
    font-size: 11px;
}

.account-row strong {
    font-size: 12px;
}

.danger-zone {
    border-color: #f1ccd1;
}

.danger-actions {
    display: flex;
    gap: 10px;
}


/* =========================================================
   28. CHECKBOXES
========================================================= */

.checkbox-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 8px;
}

.checkbox-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;

    gap: 7px;

    padding: 9px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--surface-soft);

    cursor: pointer;
}

.checkbox-item input {
    width: auto;
}

.checkbox-item span {
    font-size: 11px;
}


/* =========================================================
   29. DIALOG
========================================================= */

.app-dialog {
    width: min(720px, calc(100% - 30px));

    max-height: calc(100vh - 30px);

    padding: 0;

    border: 0;
    border-radius: var(--radius-lg);

    background: var(--surface);
    color: var(--text);

    box-shadow: var(--shadow-lg);

    overflow: hidden;
}

.app-dialog::backdrop {
    background: rgba(7, 20, 35, 0.55);
    backdrop-filter: blur(3px);
}

.small-dialog {
    width: min(450px, calc(100% - 30px));
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 18px 20px;

    border-bottom: 1px solid var(--border);
}

.dialog-header h2 {
    font-size: 18px;
}

.dialog-close {
    width: 35px;
    height: 35px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 9px;

    background: var(--surface-soft);

    color: var(--text-soft);

    font-size: 22px;
}

.dialog-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.dialog-form,
.request-details,
.confirm-message {
    padding: 20px;
}

.dialog-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.request-details {
    max-height: 300px;
    overflow-y: auto;
}

.confirm-message {
    color: var(--text-soft);
    font-size: 13px;
}


/* =========================================================
   30. REGISTRATION REQUEST
========================================================= */

.request-details-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 8px;
}

.request-detail {
    padding: 10px;

    border-radius: 9px;

    background: var(--surface-soft);
}

.request-detail span {
    display: block;

    color: var(--text-soft);

    font-size: 9px;
}

.request-detail strong {
    font-size: 12px;
}


/* =========================================================
   31. EMPTY STATES
========================================================= */

.empty-state {
    min-height: 90px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    color: var(--text-muted);

    text-align: center;

    font-size: 12px;
}

.record-count {
    color: var(--text-soft);
    font-size: 11px;
}


/* =========================================================
   32. CONNECTION
========================================================= */

.connection-card {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    padding: 14px;

    border-radius: 12px;

    background: var(--success-light);
}

.connection-card strong {
    display: block;

    color: var(--success);

    font-size: 12px;
}

.connection-card p {
    margin-top: 2px;

    color: var(--text-soft);

    font-size: 10px;
}


/* =========================================================
   33. MOBILE BOTTOM NAV
========================================================= */

.mobile-bottom-nav {
    display: none;
}


/* =========================================================
   34. LOGIN PAGE
========================================================= */

body[data-page="login"] {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        radial-gradient(
            circle at top right,
            #dcecff 0,
            transparent 38%
        ),
        radial-gradient(
            circle at bottom left,
            #e6f8f5 0,
            transparent 35%
        ),
        var(--bg);
}

.login-page {
    width: 100%;
}

.login-wrapper {
    width: min(430px, 100%);

    margin: auto;

    padding: 28px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-xl);

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

.login-brand {
    text-align: center;

    margin-bottom: 25px;
}

.login-brand .brand-icon {
    margin: 0 auto 12px;
}

.login-brand h1 {
    font-size: 22px;
}

.login-brand p {
    margin-top: 4px;

    color: var(--text-soft);

    font-size: 12px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-submit {
    width: 100%;
    margin-top: 5px;
}

.login-register-link {
    display: block;

    margin-top: 16px;

    color: var(--primary);

    text-align: center;

    font-size: 12px;
}

.login-register-link:hover {
    text-decoration: underline;
}

.login-message {
    min-height: 20px;

    margin-top: 10px;

    text-align: center;

    font-size: 11px;
}

.login-message.error {
    color: var(--danger);
}

.login-message.success {
    color: var(--success);
}


/* =========================================================
   35. REGISTER PAGE
========================================================= */

.register-page {
    min-height: 100vh;

    padding: 30px 18px;
}

.register-wrapper {
    width: min(850px, 100%);

    margin: 0 auto;

    padding: 25px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow);
}

.register-header {
    margin-bottom: 25px;

    text-align: center;
}

.register-header h1 {
    font-size: 24px;
}

.register-header p {
    margin-top: 5px;

    color: var(--text-soft);

    font-size: 12px;
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.register-section {
    padding: 17px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: var(--surface-soft);
}

.register-section h2 {
    margin-bottom: 13px;

    font-size: 15px;
}

.register-submit {
    width: 100%;
}

.register-message {
    min-height: 25px;

    text-align: center;

    font-size: 12px;
}


/* =========================================================
   36. STUDENT PAGE
========================================================= */

.student-page .parent-student-hero {
    grid-template-columns: auto 1fr auto;
}

.student-today-card {
    margin-bottom: 20px;
}

.student-today-details {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 10px;
}


/* =========================================================
   37. SHEIKH PAGE
========================================================= */

.sheikh-today-hero {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;

    margin-bottom: 20px;
}

.sheikh-today-card {
    padding: 15px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: var(--surface);
}

.sheikh-today-card span {
    display: block;

    color: var(--text-soft);

    font-size: 10px;
}

.sheikh-today-card strong {
    display: block;

    margin-top: 4px;

    font-size: 20px;
}

.assistant-box {
    padding: 15px;

    border-radius: 13px;

    background: var(--primary-light);

    border: 1px solid #d7e6ff;
}

.assistant-message {
    padding: 9px 0;

    color: var(--text);

    font-size: 12px;

    border-bottom: 1px solid rgba(11, 94, 215, 0.1);
}

.assistant-message:last-child {
    border-bottom: 0;
}

.delay-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.delay-btn {
    min-height: 36px;

    padding: 7px 12px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: var(--surface);

    color: var(--text);

    font-size: 11px;
}

.delay-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}


/* =========================================================
   38. TOAST
========================================================= */

.toast-container {
    position: fixed;

    left: 20px;
    bottom: 20px;

    z-index: 5000;

    display: flex;
    flex-direction: column;
    gap: 8px;

    width: min(350px, calc(100% - 40px));

    pointer-events: none;
}

.toast {
    padding: 12px 14px;

    border-radius: 11px;

    background: #172333;
    color: white;

    box-shadow: var(--shadow-lg);

    font-size: 11px;

    animation:
        toastIn 0.25s ease both;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: #a96d00;
}

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

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


/* =========================================================
   39. RESPONSIVE - TABLET
========================================================= */

@media (max-width: 1100px) {

    :root {
        --sidebar-width: 225px;
    }

    .page-container {
        padding-left: 20px;
        padding-right: 20px;
    }

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

    .today-class-details {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .admin-dashboard-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .quick-actions-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .sheikhs-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .schedule-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .admin-report-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .sheikh-today-hero {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* =========================================================
   40. RESPONSIVE - MOBILE
========================================================= */

@media (max-width: 760px) {

    :root {
        --header-height: 62px;
    }

    body {
        padding-bottom: 66px;
    }

    .app-header {
        height: var(--header-height);

        padding: 0 11px;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .brand {
        gap: 7px;
    }

    .brand-icon {
        width: 37px;
        height: 37px;

        border-radius: 10px;

        font-size: 18px;
    }

    .brand-text strong {
        font-size: 12px;
    }

    .brand-text span {
        display: none;
    }

    .current-date {
        display: none;
    }

    .header-left {
        gap: 5px;
    }

    .header-btn {
        min-height: 37px;

        padding: 7px 10px;

        font-size: 11px;
    }


    /* Sidebar */

    .side-menu {
        top: 0;
        bottom: 0;

        right: -285px;

        width: 275px;

        z-index: 3000;

        box-shadow: var(--shadow-lg);

        transition:
            right 0.25s ease;
    }

    body.menu-open .side-menu {
        right: 0;
    }

    body.menu-open .side-menu-overlay {
        display: block;
    }


    /* Main */

    .page-container {
        margin-right: 0;

        padding:
            calc(var(--header-height) + 17px)
            12px
            85px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;

        margin-bottom: 17px;
    }

    .section-heading h1 {
        font-size: 21px;
    }

    .section-heading p {
        font-size: 11px;
    }


    /* Cards */

    .content-card {
        padding: 15px;

        margin-bottom: 13px;

        border-radius: 13px;
    }

    .card-header {
        margin-bottom: 14px;
    }

    .card-header h2 {
        font-size: 15px;
    }


    /* Stats */

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 8px;
    }

    .stat-card {
        min-height: 90px;

        padding: 12px;

        gap: 9px;

        border-radius: 12px;
    }

    .stat-icon {
        width: 38px;
        height: 38px;

        border-radius: 10px;

        font-size: 17px;
    }

    .stat-card span {
        font-size: 9px;
    }

    .stat-card strong {
        font-size: 17px;
    }


    /* Parent Hero */

    .parent-student-hero {
        grid-template-columns: auto 1fr;

        padding: 15px;

        gap: 12px;
    }

    .student-avatar-large {
        width: 58px;
        height: 58px;

        border-radius: 16px;

        font-size: 27px;
    }

    .student-hero-info h2 {
        font-size: 18px;
    }

    .student-hero-status {
        grid-column: 1 / -1;

        width: 100%;

        min-width: 0;

        padding: 10px 12px;
    }


    /* Details */

    .today-class-details {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 7px;
    }

    .detail-item {
        padding: 10px;

        gap: 7px;
    }

    .detail-icon {
        width: 32px;
        height: 32px;

        font-size: 14px;
    }

    .detail-item strong {
        font-size: 11px;
    }


    /* Tables */

    .filter-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box {
        min-width: 0;
    }


    /* Form */

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

    .checkbox-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }


    /* Dashboard */

    .admin-dashboard-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .quick-actions-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 8px;
    }

    .quick-action {
        min-height: 110px;

        padding: 12px;
    }


    /* Sheikh */

    .sheikh-today-hero {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 8px;
    }

    .sheikh-today-card {
        padding: 12px;
    }


    /* Dialog */

    .app-dialog {
        width: calc(100% - 18px);

        max-height: calc(100vh - 18px);

        border-radius: 17px;
    }

    .dialog-header {
        padding: 14px 15px;
    }

    .dialog-form {
        padding: 15px;
    }

    .request-details {
        padding: 15px;
    }

    .request-details-grid {
        grid-template-columns: 1fr;
    }


    /* Mobile Bottom */

    .mobile-bottom-nav {
        position: fixed;

        right: 0;
        left: 0;
        bottom: 0;

        z-index: 2000;

        height: 62px;

        display: grid;

        grid-template-columns:
            repeat(5, 1fr);

        background: rgba(255, 255, 255, 0.97);

        border-top: 1px solid var(--border);

        box-shadow:
            0 -5px 20px rgba(15, 35, 60, 0.08);

        backdrop-filter: blur(10px);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        gap: 1px;

        border: 0;

        background: transparent;

        color: var(--text-muted);

        font-size: 17px;
    }

    .mobile-nav-item small {
        font-size: 8px;
    }

    .mobile-nav-item.active {
        color: var(--primary);
        font-weight: 700;
    }


    /* Weekly */

    .weekly-schedule {
        grid-template-columns:
            repeat(7, 125px);

        padding-bottom: 5px;
    }


    /* Timeline */

    .timeline-item {
        grid-template-columns: 65px 1fr;

        gap: 8px;

        padding: 10px;
    }


    /* Reports */

    .admin-report-grid {
        grid-template-columns: 1fr;
    }

    .schedule-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

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


    /* Account */

    .account-row {
        align-items: flex-start;
        flex-direction: column;

        gap: 2px;
    }


    /* Buttons */

    .section-heading > .primary-btn {
        width: 100%;
    }

    .form-actions {
        flex-wrap: wrap;
    }

    .form-actions > button {
        flex: 1;
    }

}


/* =========================================================
   41. VERY SMALL MOBILE
========================================================= */

@media (max-width: 400px) {

    .brand-text strong {
        font-size: 11px;
    }

    .stats-grid {
        gap: 6px;
    }

    .stat-card {
        padding: 10px;
    }

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

    .stat-card strong {
        font-size: 15px;
    }

    .today-class-details {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .sheikh-today-hero {
        grid-template-columns: 1fr;
    }

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

    .schedule-summary-grid {
        grid-template-columns: 1fr;
    }

}


/* =========================================================
   42. DARK MODE
========================================================= */

@media (prefers-color-scheme: dark) {

    :root {
        --text: #edf3fa;
        --text-soft: #aeb9c7;
        --text-muted: #7e8a99;

        --bg: #0d1520;
        --surface: #131e2b;
        --surface-soft: #182534;

        --border: #263545;
        --border-dark: #34475a;

        --primary-light: #102f58;
        --success-light: #12372b;
        --warning-light: #3c3016;
        --danger-light: #3d1820;
        --purple-light: #291b45;
        --secondary-light: #123b38;

        --shadow-sm:
            0 2px 8px rgba(0, 0, 0, 0.18);

        --shadow:
            0 8px 25px rgba(0, 0, 0, 0.22);

        --shadow-lg:
            0 18px 50px rgba(0, 0, 0, 0.35);
    }

    .app-header {
        background: rgba(19, 30, 43, 0.96);
    }

    .side-menu {
        background: var(--surface);
    }

    .brand-text strong {
        color: var(--text);
    }

    .student-avatar-large {
        background: var(--surface);
    }

    .parent-student-hero {
        background:
            linear-gradient(
                135deg,
                #10243c,
                #152534
            );

        border-color: #27405a;
    }

    .student-hero-status {
        background: rgba(19, 30, 43, 0.85);
    }

    .records-table tbody tr:hover {
        background: #182534;
    }

    .next-review-box {
        color: #91ddd5;
    }

    .today-class-note {
        color: #dcb65e;
    }

    .progress-track {
        background: #263544;
    }

    .mobile-bottom-nav {
        background: rgba(19, 30, 43, 0.97);
    }

    .weekly-schedule {
        scrollbar-color: #46586b transparent;
    }

    body[data-page="login"] {
        background:
            radial-gradient(
                circle at top right,
                #102b48 0,
                transparent 38%
            ),
            radial-gradient(
                circle at bottom left,
                #103630 0,
                transparent 35%
            ),
            var(--bg);
    }
}


/* =========================================================
   43. PRINT
========================================================= */

@media print {

    .app-header,
    .side-menu,
    .mobile-bottom-nav,
    .side-menu-overlay,
    .primary-btn,
    .secondary-btn,
    .danger-btn,
    .mobile-menu-btn {
        display: none !important;
    }

    .page-container {
        margin: 0;
        padding: 0;
    }

    .page-section {
        display: block !important;
    }

    .content-card,
    .stat-card {
        box-shadow: none;
    }

}


/* =========================================================
   44. ACCESSIBILITY
========================================================= */

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(11, 94, 215, 0.25);
    outline-offset: 2px;
}


/* =========================================================
   45. UTILITY
========================================================= */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.mt-0 {
    margin-top: 0 !important;
}

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