/* ==========================================================================
   معهد آيلا التعليمي — إضافات واجهة
   يعتمد الملف على public/css/app.css (نسخة Tailwind المترجمة من الموقع الأصلي)
   ========================================================================== */

:root {
    --app-primary: #0b3a63;
    --app-secondary: #1565c0;
    --app-cloud: #f3f6fb;
    --app-ink: #0f2c4c;
    --app-muted: #64748b;
    --app-ring: rgba(21, 101, 192, 0.18);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Cairo, Tajawal, "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--app-ink);
    background: var(--app-cloud);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(21, 101, 192, 0.18);
}

/* أدوات مساعدة غير موجودة في النسخة المترجمة */
.bg-primary\/8 { background-color: rgba(11, 58, 99, 0.08); }
.bg-primary\/4 { background-color: rgba(11, 58, 99, 0.04); }
.bg-primary\/12 { background-color: rgba(11, 58, 99, 0.12); }
.bg-secondary\/10 { background-color: rgba(21, 101, 192, 0.1); }
.text-secondary { color: var(--app-secondary); }
.border-primary\/15 { border-color: rgba(11, 58, 99, 0.15); }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.is-hidden { display: none !important; }
.no-underline { text-decoration: none; }
.cursor-pointer { cursor: pointer; }
.w-fit { width: fit-content; }
.min-w-0 { min-width: 0; }
.break-words { overflow-wrap: anywhere; }
.leading-6 { line-height: 1.5rem; }
.leading-7 { line-height: 1.75rem; }
.text-\[11px\] { font-size: 11px; }
.text-\[13px\] { font-size: 13px; }
.text-\[15px\] { font-size: 15px; }
.rounded-4xl { border-radius: 2rem; }
.shadow-card { box-shadow: 0 10px 30px -12px rgba(11, 58, 99, 0.25); }
.shadow-float { box-shadow: 0 18px 50px -22px rgba(11, 58, 99, 0.45); }
.backdrop-saturate { backdrop-filter: saturate(160%) blur(10px); }

/* حالة التنقل النشط */
.nav-pill-active {
    background: var(--app-primary);
    color: #fff !important;
    box-shadow: 0 8px 18px -10px rgba(11, 58, 99, 0.7);
}

.bottom-nav-active {
    color: var(--app-secondary) !important;
}

/* منع تداخل الـ Stacking Context في الحاويات المتحركة حتى لا تغطي النوافذ المنبثقة */
.fade-in {
    animation: eyalFadeIn 0.3s ease-out !important;
    transform: none !important;
}

@keyframes eyalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* النوافذ المنبثقة (Modals) — متوافقة بالكامل مع الموبايل ولا يغطيها أي عنصر */
.modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 9999 !important;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(8, 24, 40, 0.62);
    padding: 0.75rem 0 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overscroll-behavior: contain;
}

.modal-overlay.open {
    display: flex !important;
    animation: overlayIn 0.18s ease-out both;
}

.modal-panel {
    position: relative;
    width: 100%;
    max-height: calc(100vh - 1.25rem);
    max-height: calc(100dvh - 1rem);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border-radius: 1.5rem 1.5rem 0 0;
    background: #fff;
    padding: 1.15rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -10px 50px -12px rgba(8, 24, 40, 0.55);
    animation: sheetUp 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (max-width: 639px) {
    .modal-panel::before {
        content: "";
        display: block;
        width: 2.75rem;
        height: 0.28rem;
        margin: 0 auto 0.75rem;
        border-radius: 999px;
        background: rgba(11, 58, 99, 0.16);
    }

    .modal-panel .input,
    .modal-panel select.input,
    .modal-panel textarea.input {
        font-size: 16px;
    }
}

.modal-panel > div:first-child {
    position: sticky;
    top: -1.15rem;
    z-index: 15;
    background: #fff;
    margin-inline: -1rem;
    margin-top: -0.25rem;
    padding: 0.5rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(11, 58, 99, 0.06);
}

.modal-panel.modal-lg { max-width: 48rem; }
.modal-panel.modal-md { max-width: 36rem; }
.modal-panel.modal-sm { max-width: 26rem; }

@media (min-width: 640px) {
    .modal-overlay {
        align-items: center;
        padding: 1.25rem;
    }
    .modal-panel {
        border-radius: 1.5rem;
        max-height: min(90vh, calc(100dvh - 2.5rem));
        padding: 1.35rem 1.5rem;
        box-shadow: 0 30px 80px -20px rgba(8, 24, 40, 0.55);
    }
    .modal-panel > div:first-child {
        top: -1.35rem;
        margin-inline: -1.5rem;
        padding: 0.5rem 1.5rem 0.75rem;
    }
}

body.modal-open {
    overflow: hidden !important;
}

@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* القائمة الجانبية للهاتف */
.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 9980;
    display: none;
    background: rgba(8, 24, 40, 0.45);
    backdrop-filter: blur(2px);
}

.drawer-overlay.open { display: block; animation: overlayIn 0.18s ease-out both; }

.drawer-panel {
    position: fixed;
    inset-block: 0;
    right: 0;
    z-index: 9985;
    width: min(20rem, 86vw);
    transform: translateX(105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    background: #fff;
    box-shadow: -20px 0 60px -30px rgba(8, 24, 40, 0.6);
    display: flex;
    flex-direction: column;
}

.drawer-panel.open { transform: translateX(0); }

.drawer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.9rem;
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--app-primary);
    transition: background 0.15s ease;
}

.drawer-link:hover { background: rgba(11, 58, 99, 0.06); }

/* الشريط السفلي */
.bottom-nav {
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

/* تنبيهات عائمة */
.toast-stack {
    position: fixed;
    left: 50%;
    bottom: 6rem;
    z-index: 10050 !important;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100vw - 2rem);
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.9rem;
    background: #0b3a63;
    color: #fff;
    padding: 0.7rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 16px 40px -16px rgba(8, 24, 40, 0.7);
    animation: toastIn 0.24s ease-out both;
}

.toast.toast-success { background: #047857; }
.toast.toast-danger { background: #b91c1c; }

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

/* الجداول */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid rgba(11, 58, 99, 0.08);
    background: #fff;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    min-width: 34rem;
}

table.data-table thead th {
    background: #f8fafc;
    color: rgba(11, 58, 99, 0.65);
    font-weight: 800;
    text-align: right;
    padding: 0.75rem 0.9rem;
    white-space: nowrap;
    border-bottom: 1px solid rgba(11, 58, 99, 0.08);
}

table.data-table tbody td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid rgba(11, 58, 99, 0.06);
    vertical-align: middle;
}

table.data-table tbody tr:last-child td { border-bottom: 0; }
table.data-table tbody tr:hover { background: rgba(11, 58, 99, 0.02); }

/* أشرطة التقدم */
.progress {
    height: 0.5rem;
    border-radius: 999px;
    background: rgba(11, 58, 99, 0.08);
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--app-primary), var(--app-secondary));
}

/* مفاتيح التبديل */
.toggle {
    position: relative;
    display: inline-flex;
    height: 1.5rem;
    width: 2.75rem;
    flex-shrink: 0;
    align-items: center;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.2s ease;
    border: 0;
    cursor: pointer;
}

.toggle::after {
    content: "";
    position: absolute;
    top: 0.125rem;
    right: 0.125rem;
    height: 1.25rem;
    width: 1.25rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 44, 76, 0.3);
    transition: transform 0.2s ease;
}

.toggle[aria-checked="true"] { background: var(--app-secondary); }
.toggle[aria-checked="true"]::after { transform: translateX(-1.25rem); }

/* شارات الحالة */
.chip-success { background: #ecfdf5; color: #047857; }
.chip-warning { background: #fffbeb; color: #b45309; }
.chip-danger { background: #fef2f2; color: #b91c1c; }
.chip-info { background: #eff6ff; color: #1d4ed8; }
.chip-muted { background: #f1f5f9; color: #475569; }

/* بطاقة الخريطة الزخرفية */
.map-canvas {
    position: relative;
    min-height: 15rem;
    overflow: hidden;
    border-radius: 1.25rem;
    background:
        radial-gradient(circle at 30% 30%, rgba(21, 101, 192, 0.14), transparent 42%),
        repeating-linear-gradient(0deg, rgba(11, 58, 99, 0.06) 0 1px, transparent 1px 46px),
        repeating-linear-gradient(90deg, rgba(11, 58, 99, 0.06) 0 1px, transparent 1px 46px),
        #eef4fb;
}

.map-canvas::before,
.map-canvas::after {
    content: "";
    position: absolute;
    background: rgba(21, 101, 192, 0.14);
    border-radius: 999px;
}

.map-canvas::before { width: 130%; height: 14px; top: 42%; left: -15%; transform: rotate(-9deg); }
.map-canvas::after { width: 14px; height: 130%; top: -15%; right: 30%; transform: rotate(6deg); }

.map-pin {
    position: absolute;
    top: 42%;
    right: 42%;
    display: flex;
    height: 3.5rem;
    width: 3.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--app-primary);
    color: #fff;
    box-shadow: 0 0 0 10px rgba(21, 101, 192, 0.14), 0 16px 30px -12px rgba(11, 58, 99, 0.7);
    animation: pinPulse 2.4s ease-in-out infinite;
}

@keyframes pinPulse {
    0%, 100% { box-shadow: 0 0 0 8px rgba(21, 101, 192, 0.12), 0 16px 30px -12px rgba(11, 58, 99, 0.7); }
    50% { box-shadow: 0 0 0 16px rgba(21, 101, 192, 0.06), 0 16px 30px -12px rgba(11, 58, 99, 0.7); }
}

/* شعار */
.brand-logo {
    object-fit: contain;
    background: #fff;
}

/* أزرار الحضور */
.att-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(11, 58, 99, 0.12);
    background: #fff;
    padding: 0.35rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: rgba(11, 58, 99, 0.6);
    transition: all 0.15s ease;
    cursor: pointer;
}

.att-btn:hover { background: rgba(11, 58, 99, 0.04); }
.att-btn[data-active="present"] { background: #10b981; border-color: #10b981; color: #fff; }
.att-btn[data-active="absent"] { background: #f43f5e; border-color: #f43f5e; color: #fff; }
.att-btn[data-active="late"] { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.att-btn[data-active="excused"] { background: #0284c7; border-color: #0284c7; color: #fff; }

/* بطاقة الدورة */
.course-card {
    position: relative;
    overflow: hidden;
}

.course-card::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--app-primary), var(--app-secondary));
    opacity: 0.85;
}

/* الطباعة */
@media print {
    header, footer, .bottom-nav, .no-print { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #e2e8f0; }
}

/* ==========================================================================
   واجهة المحادثات بأسلوب واتساب (WhatsApp Mobile-First UI)
   ========================================================================== */
@media (max-width: 1023px) {
    body.wa-chat-page {
        overflow: hidden !important;
        height: 100vh;
        height: 100dvh;
    }
    body.wa-chat-page .bottom-nav,
    body.wa-chat-page footer {
        display: none !important;
    }
    body.wa-chat-page > div.min-h-screen {
        min-height: 0 !important;
        padding-bottom: 0 !important;
    }
    body.wa-chat-page main {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

.wa-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: var(--wa-mobile-h, calc(100dvh - 112px));
    background: #ffffff;
    overflow: hidden;
    position: relative;
}

@media (max-width: 1023px) {
    .wa-shell.wa-mobile-mode-list .wa-sidebar {
        display: flex !important;
        width: 100%;
        height: 100%;
    }
    .wa-shell.wa-mobile-mode-list .wa-main {
        display: none !important;
    }
    .wa-shell.wa-mobile-mode-chat .wa-sidebar {
        display: none !important;
    }
    .wa-shell.wa-mobile-mode-chat .wa-main {
        display: flex !important;
        width: 100%;
        height: 100%;
    }
}

@media (min-width: 1024px) {
    .wa-shell {
        display: grid !important;
        grid-template-columns: 350px minmax(0, 1fr);
        height: calc(100dvh - 10rem);
        min-height: 560px;
        max-height: 820px;
        border-radius: 1.25rem;
        border: 1px solid rgba(11, 58, 99, 0.12);
        box-shadow: 0 20px 50px -20px rgba(8, 24, 40, 0.22);
    }
    .wa-sidebar {
        display: flex !important;
        border-left: 1px solid #e2e8f0;
        height: 100%;
        overflow: hidden;
    }
    .wa-main {
        display: flex !important;
        height: 100%;
        overflow: hidden;
    }
    .wa-back-btn {
        display: none !important;
    }
}

.wa-sidebar {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    min-height: 0;
}

.wa-sidebar-header {
    flex-shrink: 0;
    background: #008069;
    color: #ffffff;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.wa-header-avatar {
    position: relative;
    display: flex;
    height: 2.5rem;
    width: 2.5rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 900;
}

.wa-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.24);
    padding: 0.38rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.wa-header-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

.wa-back-btn {
    display: inline-flex;
    height: 2.25rem;
    width: 2.25rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border: 0;
    cursor: pointer;
}

.wa-back-btn:hover {
    background: rgba(255, 255, 255, 0.24);
}

.wa-unread-pill {
    display: inline-flex;
    height: 1.25rem;
    min-width: 1.25rem;
     flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #25d366;
    color: #ffffff;
    padding: 0 0.4rem;
    font-size: 0.68rem;
    font-weight: 900;
}

.wa-search-bar {
    flex-shrink: 0;
    background: #f0f2f5;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e9edef;
}

.wa-search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.75rem;
    background: #ffffff;
    padding: 0.4rem 0.75rem;
    border: 1px solid #e2e8f0;
}

.wa-search-box input {
    width: 100%;
    border: 0;
    background: transparent;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e293b;
    outline: none;
}

.wa-conv-list {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #ffffff;
}

.wa-conv-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.15s ease;
    text-decoration: none;
    color: #111b21;
}

.wa-conv-item:hover {
    background: #f5f6f6;
}

.wa-conv-item.is-active {
    background: #e9edef;
}

.wa-conv-avatar {
    position: relative;
    display: flex;
    height: 3rem;
    width: 3rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 900;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.wa-avatar-admin { background: #e11d48; }
.wa-avatar-staff { background: #4f46e5; }
.wa-avatar-parent { background: #00a884; }

.wa-online-dot {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 0.75rem;
    width: 0.75rem;
    border-radius: 999px;
    border: 2px solid #ffffff;
    background: #25d366;
}

.wa-student-tag {
    margin-top: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: #008069;
}

.wa-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background-color: #efeae2;
}

.wa-chat-header {
    flex-shrink: 0;
    background: #008069;
    color: #ffffff;
    padding: 0.6rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    box-shadow: 0 1px 3px rgba(11, 20, 26, 0.14);
    z-index: 10;
}

.wa-messages-viewport {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0.9rem 0.85rem;
    background-color: #efeae2;
    background-image:
        radial-gradient(rgba(17, 27, 33, 0.045) 1.2px, transparent 1.2px),
        radial-gradient(rgba(17, 27, 33, 0.035) 1.2px, #efeae2 1.2px);
    background-size: 24px 24px;
    background-position: 0 0, 12px 12px;
}

.wa-encryption-pill {
    margin: 0 auto 0.85rem;
    max-width: 28rem;
    border-radius: 0.65rem;
    background: #ffeecd;
    color: #54656f;
    padding: 0.4rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 1px 1px rgba(11, 20, 26, 0.08);
}

.wa-bubble-row {
    display: flex;
    width: 100%;
    margin-bottom: 0.5rem;
}

.wa-bubble-row.is-me {
    justify-content: flex-start;
}

.wa-bubble-row.is-other {
    justify-content: flex-end;
}

.wa-bubble {
    position: relative;
    max-width: min(85%, 30rem);
    min-width: 7rem;
    padding: 0.45rem 0.7rem 0.35rem;
    border-radius: 0.75rem;
    font-size: 0.84rem;
    line-height: 1.5;
    color: #111b21;
    box-shadow: 0 1px 1.5px rgba(11, 20, 26, 0.14);
    word-break: break-word;
}

.wa-bubble.is-me {
    background: #d9fdd3;
    border-top-right-radius: 0.15rem;
}

.wa-bubble.is-other {
    background: #ffffff;
    border-top-left-radius: 0.15rem;
}

.wa-msg-card {
    margin-bottom: 0.4rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.96);
    padding: 0.6rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-right: 4px solid #00a884;
}

.wa-bubble-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-top: 0.2rem;
    font-size: 0.68rem;
    color: #667781;
    line-height: 1;
}

.wa-delete-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    border-radius: 0.35rem;
    padding: 0.15rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #e11d48;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.wa-delete-btn:hover {
    background: rgba(225, 29, 72, 0.08);
}

.wa-ticks {
    color: #53bdeb;
    font-weight: 900;
    font-size: 0.72rem;
    letter-spacing: -1px;
}

.wa-preview-bar {
    flex-shrink: 0;
    border-top: 1px solid #e2e8f0;
    background: #e9edef;
    padding: 0.5rem 0.85rem;
    font-size: 0.75rem;
}

.wa-preview-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-radius: 0.75rem;
    background: #ffffff;
    padding: 0.5rem 0.75rem;
    border-right: 4px solid #00a884;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.wa-composer {
    flex-shrink: 0;
    background: #f0f2f5;
    padding: 0.5rem 0.65rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(17, 27, 33, 0.08);
    z-index: 15;
}

.wa-composer-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.wa-input-pill {
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: #ffffff;
    border-radius: 999px;
    padding: 0.2rem 0.85rem;
    box-shadow: 0 1px 2px rgba(11, 20, 26, 0.08);
}

.wa-input-pill input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    padding: 0.45rem 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: #111b21;
}

.wa-icon-btn {
    height: 2.25rem;
    width: 2.25rem;
    flex-shrink: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #54656f;
    background: transparent;
    border: 0;
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

.wa-icon-btn:hover {
    background: rgba(17, 27, 33, 0.06);
    color: #111b21;
}

.wa-send-btn {
    height: 2.65rem;
    width: 2.65rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: #00a884;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    box-shadow: 0 2px 6px rgba(0, 168, 132, 0.35);
    transition: transform 0.15s ease, background 0.15s ease;
    cursor: pointer;
}

.wa-send-btn:hover {
    background: #008f6f;
}

.wa-send-btn:active {
    transform: scale(0.94);
}

/* ==========================================================================
   نظام الكروت المتوسعة والترقيم الذكي (Shadcn-Inspired Collapsible & Pagination)
   ========================================================================== */
.sc-card {
    background: #ffffff;
    border: 1px solid rgba(11, 58, 99, 0.09);
    border-radius: 1rem;
    box-shadow: 0 2px 10px -4px rgba(11, 58, 99, 0.06);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
}
.sc-card:hover {
    border-color: rgba(11, 58, 99, 0.2);
}
.sc-card.is-expanded {
    border-color: rgba(11, 58, 99, 0.25);
    box-shadow: 0 10px 26px -10px rgba(11, 58, 99, 0.14);
}

.sc-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}
.sc-summary:hover {
    background: rgba(11, 58, 99, 0.018);
}

.sc-summary-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 0%;
}

.sc-avatar {
    display: flex;
    height: 2.75rem;
    width: 2.75rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    background: rgba(11, 58, 99, 0.07);
    color: var(--app-primary, #0b3a63);
    font-size: 0.95rem;
    font-weight: 900;
}

.sc-title-wrap {
    min-width: 0;
    flex: 1 1 0%;
}

.sc-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.sc-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--app-primary, #0b3a63);
    line-height: 1.35;
}

.sc-subtitle {
    margin-top: 0.18rem;
    font-size: 0.73rem;
    font-weight: 600;
    color: rgba(11, 58, 99, 0.62);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.sc-summary-end {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.sc-chevron-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.32rem 0.6rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(11, 58, 99, 0.12);
    background: #f8fafc;
    color: var(--app-primary, #0b3a63);
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.18s ease;
}
.sc-chevron-btn:hover {
    background: rgba(11, 58, 99, 0.06);
}
.sc-chevron-icon {
    transition: transform 0.22s ease;
    display: inline-flex;
}
.sc-card.is-expanded .sc-chevron-icon {
    transform: rotate(180deg);
}
.sc-card.is-expanded .sc-chevron-btn {
    background: var(--app-primary, #0b3a63);
    color: #ffffff;
    border-color: var(--app-primary, #0b3a63);
}

.sc-details {
    display: none;
    border-top: 1px solid rgba(11, 58, 99, 0.07);
    background: #fafbfd;
    padding: 0.9rem 1rem;
}
.sc-card.is-expanded .sc-details {
    display: block;
    animation: scSlideDown 0.18s ease-out;
}

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

.sc-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.75rem;
}

.sc-kv {
    background: #ffffff;
    border: 1px solid rgba(11, 58, 99, 0.07);
    border-radius: 0.75rem;
    padding: 0.5rem 0.7rem;
}
.sc-kv-label {
    font-size: 0.66rem;
    font-weight: 700;
    color: rgba(11, 58, 99, 0.52);
    margin-bottom: 0.1rem;
}
.sc-kv-val {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--app-primary, #0b3a63);
    word-break: break-word;
}

.sc-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding-top: 0.65rem;
    border-top: 1px dashed rgba(11, 58, 99, 0.1);
}

/* ---------------- شريط الترقيم الذكي (Shadcn Pagination) ---------------- */
.sc-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.9rem;
    padding: 0.65rem 0.95rem;
    background: #ffffff;
    border: 1px solid rgba(11, 58, 99, 0.09);
    border-radius: 0.95rem;
    box-shadow: 0 2px 8px -4px rgba(11, 58, 99, 0.05);
}

.sc-page-info {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: rgba(11, 58, 99, 0.68);
}

.sc-page-size {
    border: 1px solid rgba(11, 58, 99, 0.15);
    border-radius: 0.55rem;
    padding: 0.22rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--app-primary, #0b3a63);
    background: #f8fafc;
    outline: none;
    cursor: pointer;
}

.sc-page-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.sc-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.55rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(11, 58, 99, 0.12);
    background: #ffffff;
    color: var(--app-primary, #0b3a63);
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}
.sc-page-btn:hover:not(:disabled) {
    background: rgba(11, 58, 99, 0.06);
    border-color: rgba(11, 58, 99, 0.25);
}
.sc-page-btn.is-active {
    background: var(--app-primary, #0b3a63);
    color: #ffffff;
    border-color: var(--app-primary, #0b3a63);
}
.sc-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.is-page-hidden {
    display: none !important;
}
