/* =====================================================================
   نظام المحاسبة الذكي — الهوية البصرية الفخمة (كحلي داكن + ذهبي)
   ===================================================================== */
:root{
    --navy-1: #0b1220;
    --navy-2: #16213a;
    --navy-3: #1c2b4a;
    --gold: #c9a24b;
    --gold-light: #e8cf8a;
    --gold-dark: #9c7a2e;
    --ink: #16213a;
    --muted: #64748b;
    --bg-app: #f3f5fa;
    --card-bg: #ffffff;
    --card-border: #eceff5;
    --shadow-sm: 0 2px 10px rgba(22,33,58,.06);
    --shadow-md: 0 10px 28px rgba(22,33,58,.10);
    --shadow-lg: 0 20px 45px -10px rgba(11,18,32,.25);
}

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

body {
    font-family: 'Cairo', 'Tahoma', 'Segoe UI', sans-serif;
    background: var(--bg-app);
    color: var(--ink);
    direction: rtl;
}

/* ---------- صفحات الدخول ---------- */
.auth-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(150deg, var(--navy-1) 0%, var(--navy-2) 55%, var(--navy-3) 100%);
}
.auth-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    width: 360px;
    box-shadow: var(--shadow-lg);
}
.auth-box h2 { margin-bottom: 20px; text-align: center; color: var(--navy-2); }
.auth-box label { display: block; margin: 12px 0 4px; font-size: 14px; }
.auth-box input {
    width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px;
}
.auth-box button {
    width: 100%; margin-top: 20px; padding: 12px; border: none; border-radius: 6px;
    background: linear-gradient(90deg, var(--gold-light), var(--gold)); color: #1a1508; font-size: 15px;
    font-weight: 700; cursor: pointer;
}
.auth-box button:hover { filter: brightness(1.05); }
.alert { background: #fdecea; color: #b3261e; padding: 10px; border-radius: 6px; margin-bottom: 10px; font-size: 14px; }
.alert-error { background: #fdecea; color: #b3261e; }

/* ---------- هيكل الداشبورد ---------- */
.app-shell { display: flex; min-height: 100vh; }

/* خلفية زخرفية خفيفة لمنطقة المحتوى (نمط مالي: بنوك/فواتير/عملات) */
.main-content {
    flex: 1; padding: 26px 28px; min-width: 0; position: relative;
    background:
        radial-gradient(circle at 100% 0%, rgba(201,162,75,.05), transparent 32%),
        radial-gradient(circle at 0% 100%, rgba(28,43,74,.04), transparent 35%);
}
.main-content::before{
    content: "";
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    opacity: .5;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='none' stroke='%23c9a24b' stroke-width='1' opacity='0.07'%3E%3Cpath d='M20 90 L55 65 L90 90 V130 H80 V100 H65 V130 H45 V100 H30 V130 H20 Z'/%3E%3Crect x='120' y='120' width='60' height='42' rx='4'/%3E%3Cline x1='128' y1='132' x2='168' y2='132'/%3E%3Cline x1='128' y1='142' x2='160' y2='142'/%3E%3Cline x1='128' y1='152' x2='150' y2='152'/%3E%3Ccircle cx='170' cy='45' r='16'/%3E%3Cpath d='M170 38v14M164 45h12'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 380px 380px;
    background-repeat: repeat;
}

.sidebar {
    width: 250px; flex-shrink: 0; padding: 22px 0;
    background: linear-gradient(180deg, var(--navy-1), var(--navy-2) 60%, var(--navy-3));
    color: #fff;
    border-left: 1px solid rgba(201,162,75,.18);
    box-shadow: var(--shadow-lg);
    position: relative; z-index: 2;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 20px 20px; margin-bottom: 8px; border-bottom: 1px solid rgba(201,162,75,.15); }
.sidebar-logo {
    width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #22335a, #101a30);
    border: 1px solid rgba(201,162,75,.35);
}
.sidebar-logo svg { width: 20px; height: 20px; }
.sidebar h3 {
    font-size: 16px; font-weight: 800; letter-spacing: .2px;
    background: linear-gradient(90deg, var(--gold-light), var(--gold) 65%, #f3e2b3);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sidebar a {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 20px; color: #b7c2dd; text-decoration: none; font-size: 14px;
    border-right: 3px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.sidebar a:hover { background: rgba(201,162,75,.08); color: #fff; }
.sidebar a.active {
    background: linear-gradient(90deg, rgba(201,162,75,.16), transparent);
    color: var(--gold-light); border-right-color: var(--gold);
    font-weight: 600;
}
.sidebar .logout { margin-top: 16px; border-top: 1px solid rgba(201,162,75,.15); padding-top: 14px; color: #f2a19a; }
.sidebar .logout:hover { background: rgba(220,38,38,.08); color: #ff9d94; }

.topbar {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px;
    background: var(--card-bg); padding: 14px 20px; border-radius: 14px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--card-border);
    position: relative; z-index: 2;
}
.topbar h1 { font-size: 19px; color: var(--navy-2); font-weight: 700; }
.topbar h1::before { content: "◆ "; color: var(--gold); font-size: 12px; }

.user-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #475569; font-weight: 600; }
.user-avatar {
    width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #1a1508; font-weight: 800; font-size: 13px;
}

/* زر فتح القائمة (يظهر بالموبايل بس) */
.menu-toggle-btn {
    display: none; background: linear-gradient(135deg, var(--navy-2), var(--navy-1)); color: var(--gold-light); border: 1px solid rgba(201,162,75,.3); border-radius: 8px;
    width: 40px; height: 40px; font-size: 18px; cursor: pointer; flex-shrink: 0;
}
.sidebar-overlay { display: none; }

@media (max-width: 800px) {
    .app-shell { position: relative; overflow-x: hidden; }
    .sidebar {
        position: fixed; top: 0; right: 0; height: 100vh; width: 260px; z-index: 1001;
        transform: translateX(100%); transition: transform .25s ease; overflow-y: auto;
        box-shadow: -4px 0 20px rgba(0,0,0,.3);
    }
    .sidebar.sidebar-open { transform: translateX(0); }
    .menu-toggle-btn { display: inline-flex; align-items: center; justify-content: center; }
    .main-content { padding: 14px; width: 100%; }
    .topbar { padding: 10px 12px; border-radius: 12px; flex-wrap: wrap; gap: 8px; }
    .topbar h1 { font-size: 15px; }
    .topbar-right { gap: 8px; }
    .user-chip { font-size: 12.5px; gap: 6px; }
    .user-avatar { width: 26px; height: 26px; font-size: 11px; }
    .theme-toggle-btn { width: 34px; height: 34px; font-size: 15px; }
    .sidebar-overlay.active {
        display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000;
    }
    .cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
    .card { padding: 14px; border-radius: 12px; }
    .card .label { font-size: 12px; margin-bottom: 6px; }
    .card .value { font-size: 18px; }
    .panel { padding: 16px; border-radius: 12px; }
    .panel h2 { font-size: 15px; }
}

@media (max-width: 420px) {
    .cards { grid-template-columns: repeat(2, 1fr); }
    .topbar h1 { font-size: 14px; }
    .user-chip span:not(.user-avatar) { display: none; }
}

/* ---------- بطاقات الأرقام ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 26px; position: relative; z-index: 2; }
.card {
    background: var(--card-bg); padding: 20px; border-radius: 14px; box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
    border-top: 3px solid var(--gold);
    transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card .label { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.card .value { font-size: 23px; font-weight: 800; color: var(--navy-2); }
.card.positive { border-top-color: #16a34a; }
.card.negative { border-top-color: #dc2626; }
.card.warning { border-top-color: #d97706; }

/* ألوان مخصصة لكل بنك — أنيقة وبتدرجات ناعمة */
.card.bank-blue   { border-top-color: #2563eb; background: linear-gradient(160deg, #eef4ff, #ffffff); }
.card.bank-red    { border-top-color: #dc2626; background: linear-gradient(160deg, #fef2f2, #ffffff); }
.card.bank-yellow { border-top-color: #d97706; background: linear-gradient(160deg, #fffaf0, #ffffff); }
.card.bank-green  { border-top-color: #16a34a; background: linear-gradient(160deg, #f0fdf6, #ffffff); }
.card.bank-purple { border-top-color: #7c3aed; background: linear-gradient(160deg, #f6f4ff, #ffffff); }

/* ---------- الجداول ---------- */
table { width: 100%; border-collapse: collapse; background: var(--card-bg); border-radius: 10px; overflow: hidden; }
table th, table td { padding: 12px 14px; text-align: right; font-size: 14px; border-bottom: 1px solid #f0f2f7; white-space: nowrap; }
table th { background: linear-gradient(180deg, #182741, var(--navy-2)); color: var(--gold-light); font-weight: 700; letter-spacing: .2px; }
table tr:hover { background: #faf7ef; }

/* ---------- منطقة سحب الجداول ---------- */
.table-scroll {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
}
.table-scroll::-webkit-scrollbar { height: 6px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 10px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.table-scroll table { margin: 0; }

.table-scroll::before, .table-scroll::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 24px;
    pointer-events: none; z-index: 2; opacity: 0; transition: opacity .2s ease;
}
.table-scroll::before {
    right: 0; background: linear-gradient(to left, rgba(0,0,0,.10), transparent);
}
.table-scroll::after {
    left: 0; background: linear-gradient(to right, rgba(0,0,0,.10), transparent);
}
.table-scroll.has-more-right::before { opacity: 1; }
.table-scroll.has-more-left::after { opacity: 1; }

/* ---------- اللوحات (Panels) ---------- */
.panel {
    background: var(--card-bg); border-radius: 14px; padding: 22px; margin-bottom: 22px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--card-border); position: relative; z-index: 2;
}
.panel h2 {
    font-size: 16px; margin-bottom: 16px; color: var(--navy-2); font-weight: 800;
    padding-bottom: 12px; border-bottom: 1px solid #f0f2f7;
    display: flex; align-items: center; gap: 8px;
}
.panel h2::before { content: ""; width: 4px; height: 16px; background: linear-gradient(180deg, var(--gold-light), var(--gold)); border-radius: 3px; display: inline-block; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.form-row > div { flex: 1; min-width: 150px; }
.form-row label { display: block; font-size: 13px; margin-bottom: 5px; color: var(--muted); font-weight: 600; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #e2e6ee; border-radius: 8px; font-size: 14px;
    font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,75,.14);
}
.btn {
    background: linear-gradient(90deg, var(--navy-3), var(--navy-2)); color: #fff; border: 1px solid rgba(201,162,75,.35);
    padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 14px; font-family: inherit; font-weight: 600;
    transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
a.btn { display: inline-block; text-decoration: none; }
.btn-active { background: linear-gradient(90deg, var(--gold-light), var(--gold)); color: #1a1508; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 16px; }

.badge { padding: 4px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-blue { background: #dbeafe; color: #1e40af; }

/* ---------- الشات بوت ---------- */
.chat-widget {
    position: fixed; bottom: 20px; left: 20px; width: 350px; max-width: calc(100vw - 40px); z-index: 999;
    box-shadow: var(--shadow-lg); border-radius: 14px; overflow: hidden; border: 1px solid rgba(201,162,75,.25);
    background: #fff; display: flex; flex-direction: column; max-height: 500px;
}
.chat-header {
    background: linear-gradient(90deg, var(--navy-2), var(--navy-1)); color: var(--gold-light); padding: 13px 16px; font-size: 14px; font-weight: 700;
    display: flex; justify-content: space-between; align-items: center; cursor: pointer;
}
.chat-body { flex: 1; overflow-y: auto; padding: 12px; font-size: 13px; max-height: 320px; }
.chat-msg { margin-bottom: 10px; padding: 9px 13px; border-radius: 10px; max-width: 85%; }
.chat-msg.user { background: linear-gradient(90deg, var(--navy-3), var(--navy-2)); color: #fff; margin-right: auto; margin-left: 0; text-align: left; }
.chat-msg.bot { background: #f4f2ea; color: #222; }
.chat-input-row { display: flex; border-top: 1px solid #eee; }
.chat-input-row input {
    flex: 1; border: none; padding: 10px; font-size: 13px; outline: none; font-family: inherit;
}
.chat-input-row button {
    background: linear-gradient(90deg, var(--gold-light), var(--gold)); color: #1a1508; border: none; padding: 0 16px; cursor: pointer; font-weight: 700; font-family: inherit;
}
.chat-mic-btn {
    background: #f4f2ea !important; color: var(--navy-2) !important; font-size: 16px; padding: 0 12px !important;
    border-right: 1px solid #eee; border-left: 1px solid #eee; transition: background .2s;
}
.chat-mic-btn.recording {
    background: #fee2e2 !important; color: #dc2626 !important;
    animation: mic-pulse 1s infinite;
}
@keyframes mic-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}
.chat-quick-replies { display: flex; flex-wrap: wrap; gap: 6px; padding: 9px 10px; border-top: 1px solid #eee; }
.chat-quick-replies button {
    background: #f4f2ea; color: var(--navy-2); border: 1px solid #e7e0cc; border-radius: 16px;
    padding: 5px 12px; font-size: 13px; cursor: pointer; font-family: inherit; font-weight: 600;
}
.chat-quick-replies button:hover { background: #ecdfb9; }
.chat-confirm-row { display: flex; gap: 8px; margin: -4px 0 10px 0; }
.chat-confirm-row button {
    border: none; border-radius: 6px; padding: 6px 14px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.chat-confirm-row .chat-confirm-yes { background: #16a34a; color: #fff; }
.chat-confirm-row .chat-confirm-no { background: #e2e8f0; color: #222; }

/* الأيقونة الدائرية الصغيرة (زر فتح الشات) */
.chat-fab {
    display: none; width: 58px; height: 58px; border-radius: 50%; border: 1px solid rgba(201,162,75,.4);
    background: linear-gradient(135deg, var(--navy-2), var(--navy-1)); color: var(--gold-light); font-size: 26px;
    align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 6px 18px rgba(11,18,32,.45); transition: transform .15s ease, box-shadow .15s ease;
}
.chat-fab:hover { transform: scale(1.06); box-shadow: 0 8px 22px rgba(11,18,32,.55); }
.chat-fab:active { transform: scale(.96); }

.chat-collapsed { background: transparent; box-shadow: none; width: 58px; height: 58px; border-radius: 50%; }
.chat-collapsed .chat-fab { display: flex; }
.chat-collapsed .chat-header,
.chat-collapsed .chat-body, .chat-collapsed .chat-input-row, .chat-collapsed .chat-quick-replies { display: none; }

/* ---------- الشات بوت على الموبايل ---------- */
@media (max-width: 600px) {
    .chat-widget {
        left: 10px; right: 10px; bottom: 10px; width: auto;
        max-height: 70vh; border-radius: 14px;
    }
    .chat-header { padding: 14px 15px; font-size: 15px; }
    .chat-body { max-height: 45vh; font-size: 14px; }
    .chat-input-row input { font-size: 15px; padding: 12px; }
    .chat-input-row button, .chat-mic-btn { padding: 0 14px; font-size: 15px; }
    .chat-msg { max-width: 90%; }
    .chat-widget.chat-collapsed { left: auto; right: 10px; width: 54px; height: 54px; }
    .chat-fab { width: 54px; height: 54px; font-size: 24px; }
}

/* أزرار تصدير التقارير */
.btn-export {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(90deg, #16a34a, #15803d); color: #fff; border: none; padding: 10px 16px;
    border-radius: 8px; cursor: pointer; text-decoration: none; font-size: 14px; font-weight: 600;
}
.btn-export:hover { filter: brightness(1.08); }
.panel form button[type="submit"] {
    background: linear-gradient(90deg, var(--navy-3), var(--navy-2)); color: #fff; border: 1px solid rgba(201,162,75,.35); padding: 10px 16px;
    border-radius: 8px; cursor: pointer; font-size: 14px; font-family: inherit; font-weight: 600;
}
.panel form button[type="submit"]:hover { filter: brightness(1.15); }
.alert-success { background: #eafaf1; color: #14532d; }

/* ---------- نافذة التعديل المنبثقة ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(11,18,32,.6);
    display: none; align-items: center; justify-content: center;
    z-index: 2000; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 480px;
    max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); border-top: 3px solid var(--gold);
}
.modal-box h3 { margin-bottom: 16px; color: var(--navy-2); font-size: 17px; font-weight: 800; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- أزرار تعديل/حذف بجداول الحركات ---------- */
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.btn-edit { background: #0f766e; }
.btn-edit:hover { background: #0d5f59; }
.btn-delete { background: #dc2626; }
.btn-delete:hover { background: #b91c1c; }
.btn-cancel { background: #94a3b8; }
.btn-cancel:hover { background: #64748b; }

/* ---------- زر تبديل الوضع الليلي/النهاري ---------- */
.topbar-right { display: flex; align-items: center; gap: 14px; }
.theme-toggle-btn {
    background: #f4f2ea; border: 1px solid #e7e0cc; border-radius: 50%; width: 38px; height: 38px;
    font-size: 17px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.theme-toggle-btn:hover { background: #ecdfb9; }

/* =====================================================================
   الوضع الليلي (Dark Mode)
   ===================================================================== */
body.dark-mode { background: var(--navy-1); color: #e2e8f0; }
body.dark-mode .main-content::before { opacity: .35; }

body.dark-mode .sidebar { background: linear-gradient(180deg, #070c16, var(--navy-1) 60%, var(--navy-2)); }
body.dark-mode .sidebar a { color: #94a3b8; }
body.dark-mode .sidebar a:hover { background: rgba(201,162,75,.08); color: #fff; }
body.dark-mode .sidebar a.active { background: linear-gradient(90deg, rgba(201,162,75,.14), transparent); color: var(--gold-light); }
body.dark-mode .sidebar .logout { border-top-color: rgba(201,162,75,.12); }

body.dark-mode .topbar { background: #111a2c; border-color: #223049; }
body.dark-mode .topbar h1 { color: #e2e8f0; }
body.dark-mode .user-chip { color: #cbd5e1; }
body.dark-mode .theme-toggle-btn { background: #1e293b; color: #fbbf24; border-color: #334155; }
body.dark-mode .theme-toggle-btn:hover { background: #334155; }

body.dark-mode .card { background: #111a2c; border-color: #223049; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
body.dark-mode .card .label { color: #94a3b8; }
body.dark-mode .card .value { color: #f1f5f9; }
body.dark-mode .card.bank-blue   { background: linear-gradient(160deg, #172554, #111a2c); }
body.dark-mode .card.bank-red    { background: linear-gradient(160deg, #450a0a, #111a2c); }
body.dark-mode .card.bank-yellow { background: linear-gradient(160deg, #422006, #111a2c); }
body.dark-mode .card.bank-green  { background: linear-gradient(160deg, #052e16, #111a2c); }
body.dark-mode .card.bank-purple { background: linear-gradient(160deg, #2e1065, #111a2c); }

body.dark-mode .panel { background: #111a2c; border-color: #223049; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
body.dark-mode .panel h2 { color: #f1f5f9; border-bottom-color: #223049; }

body.dark-mode table { color: #e2e8f0; background: #111a2c; }
body.dark-mode table th { background: #0b1220; color: var(--gold-light); }
body.dark-mode table td, body.dark-mode table th { border-color: #223049; }
body.dark-mode table tr:hover { background: #1a2438; }
body.dark-mode .table-scroll { border-color: #223049; }

body.dark-mode .form-row label { color: #94a3b8; }
body.dark-mode .form-row input,
body.dark-mode .form-row select,
body.dark-mode .form-row textarea {
    background: #0f172a; color: #e2e8f0; border-color: #334155;
}

body.dark-mode .modal-box { background: #111a2c; }
body.dark-mode .modal-box h3 { color: #f1f5f9; }

body.dark-mode .chat-widget { background: #111a2c; box-shadow: 0 4px 20px rgba(0,0,0,.4); border-color: rgba(201,162,75,.2); }
body.dark-mode .chat-body { background: #111a2c; }
body.dark-mode .chat-msg.bot { background: #1e293b; color: #e2e8f0; }
body.dark-mode .chat-input-row { border-top-color: #334155; }
body.dark-mode .chat-input-row input { background: #0f172a; color: #e2e8f0; border-color: #334155; }
body.dark-mode .chat-quick-replies { border-top-color: #334155; }
body.dark-mode .chat-quick-replies button { background: #1e293b; color: #e2e8f0; }
body.dark-mode .chat-quick-replies button:hover { background: #334155; }

body.dark-mode .auth-box { background: #1e293b; }
body.dark-mode .auth-box h2 { color: #93c5fd; }
body.dark-mode .auth-box label { color: #94a3b8; }
body.dark-mode .auth-box input { background: #0f172a; color: #e2e8f0; border-color: #334155; }

/* بعض الصفحات فيها صناديق تنبيه/صفوف مجاميع بخلفية فاتحة مكتوبة مباشرة
   بالـ inline style (زي background:#fff5f5 أو #f8fafc). بالوضع الليلي لون
   النص العام بيصير فاتح فبيختفي فوق هالخلفيات الفاتحة. هاي القاعدة بتخلي
   أي عنصر مكتوب فيه inline background فاتح يرجع نصه غامق ومقروء. */
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#f8fafc"],
body.dark-mode [style*="background: #f8fafc"],
body.dark-mode [style*="background:#f1f5f9"],
body.dark-mode [style*="background: #f1f5f9"] {
    color: #1e293b !important;
}
body.dark-mode [style*="background:#fff"] code,
body.dark-mode [style*="background: #fff"] code,
body.dark-mode [style*="background:#f8fafc"] code,
body.dark-mode [style*="background: #f8fafc"] code {
    color: #9a3412;
}

/* ترقيم الصفحات (Pagination) - سجلات الحركات بكل الأقسام */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e5e9f0;
}
.pagination-info {
    font-size: 12px;
    color: #94a3b8;
    margin-inline-end: 8px;
}
.pagination-dots {
    padding: 0 4px;
    color: #94a3b8;
}
.pagination .btn-active {
    background: #16213a;
    color: #fff;
    pointer-events: none;
}
