/* ============================================================
   V13.23.50 - Premium Compact Safe UI Layer
   Visual-only overrides. Existing layout, IDs, classes, backend,
   auth, permissions, tables, filters, pagination and navigation
   behavior remain unchanged.
   ============================================================ */

:root{
    --pc-navy-950:#06131f;
    --pc-navy-900:#0a1d2b;
    --pc-navy-850:#0d2633;
    --pc-teal-700:#0b5360;
    --pc-teal-600:#087f75;
    --pc-emerald-600:#0e9f78;
    --pc-emerald-500:#10b981;
    --pc-emerald-400:#20c997;
    --pc-accent:#48d6b2;
    --pc-light:#f4f7fa;
    --pc-text:#142033;
    --pc-muted:#718096;
    --pc-border:#dce5ec;
    --pc-dark-bg:#07111b;
    --pc-dark-surface:#0d1e2b;
    --pc-dark-elevated:#122735;

    --bg:#f4f7fa;
    --text:#142033;
    --muted:#718096;
    --primary:#0e9f78;
    --primary-2:#20c997;
    --border:rgba(113,128,150,.22);
    --radius:14px;
    --radius-sm:10px;
    --shadow:0 12px 28px -22px rgba(6,19,31,.40), 0 2px 8px -5px rgba(6,19,31,.16);
    --premium-shadow:0 12px 30px -24px rgba(6,19,31,.46), 0 2px 8px -6px rgba(6,19,31,.18);
    --surface:rgba(255,255,255,.90);
    --surface-strong:rgba(255,255,255,.96);
    --surface-soft:rgba(244,247,250,.86);
}


body.dark{
    --bg:#07111b;
    --bg-2:#0d1e2b;
    --text:#edf5f7;
    --muted:#94a8b8;
    --border:rgba(148,163,184,.14);
    --shadow:0 14px 30px -24px rgba(0,0,0,.82), 0 2px 10px -7px rgba(0,0,0,.64);
    --premium-shadow:0 14px 32px -24px rgba(0,0,0,.88), 0 2px 10px -7px rgba(0,0,0,.72);
    --surface:rgba(13,30,43,.88);
    --surface-strong:rgba(13,30,43,.96);
    --surface-soft:rgba(18,39,53,.78);
    color:#edf5f7;
}


html[dir="rtl"] body{font-family:'Cairo','Inter',system-ui,-apple-system,'Segoe UI',Arial,sans-serif;}
html[dir="ltr"] body{font-family:'Inter','Cairo',system-ui,-apple-system,'Segoe UI',Arial,sans-serif;}

body{
    font-size:14px;
    line-height:1.55;
    background:
        radial-gradient(circle at 88% 0%, rgba(32,201,151,.08), transparent 30%),
        radial-gradient(circle at 6% 28%, rgba(11,83,96,.055), transparent 28%),
        var(--bg);
}
body::before,
body::after{
    opacity:.16;
    animation:none;
    filter:blur(14px);
}

/* ---------- Sidebar: same structure, denser premium treatment ---------- */
.sidebar{
    padding:12px;
    background:
        radial-gradient(circle at top right, rgba(32,201,151,.14), transparent 34%),
        linear-gradient(160deg, #071520 0%, #0a2430 55%, #082e29 100%);
    border-left-color:rgba(255,255,255,.08);
    box-shadow:-12px 0 34px -28px rgba(2,8,18,.95);
}
.sidebar::before{opacity:.42;}
.sidebar-header{
    gap:9px;
    padding:8px 8px 10px;
    margin-bottom:8px;
    border-bottom-color:rgba(255,255,255,.08);
}
.sidebar-brand-mark{
    flex-basis:34px;
    width:34px;
    height:34px;
    border-radius:10px;
    font-size:.9rem;
    background:linear-gradient(135deg,#0e9f78,#087f75);
    box-shadow:0 8px 18px -12px rgba(72,214,178,.68), inset 0 1px 0 rgba(255,255,255,.20);
}
.sidebar-brand-copy h2{font-size:.95rem;letter-spacing:-.01em;}
.sidebar-brand-copy span{margin-top:1px;font-size:.64rem;color:rgba(255,255,255,.54);}
.sidebar-live-status{
    gap:6px;
    margin:0 2px 7px;
    padding:5px 8px;
    border-radius:8px;
    border-color:rgba(72,214,178,.12);
    background:rgba(14,159,120,.065);
    color:rgba(255,255,255,.68);
    font-size:.66rem;
}
.live-dot{width:6px;height:6px;flex-basis:6px;animation:none;box-shadow:0 0 0 2px rgba(72,214,178,.09);}
.menu-item{margin:2px 0;border-radius:9px;}
.menu-item a{
    gap:8px;
    padding:9px 10px;
    border-radius:9px;
    color:rgba(237,245,247,.72);
    font-size:.79rem;
    font-weight:650;
    transition:background-color .17s ease,border-color .17s ease,color .17s ease,box-shadow .17s ease;
}
.menu-item a i{
    width:28px;
    min-width:28px;
    padding:6px 0;
    border-radius:8px;
    color:#a9c0c8;
    background:rgba(255,255,255,.045);
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.035);
    font-size:.82rem;
}
.menu-item:hover a{transform:none;background:rgba(255,255,255,.045);color:#fff;}
.menu-item:hover a i{color:#d9f9ef;background:rgba(14,159,120,.10);}
.menu-item.active a{
    background:linear-gradient(135deg,rgba(16,185,129,.16),rgba(13,148,136,.07));
    border-color:rgba(72,214,178,.16);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.035), 0 8px 18px -16px rgba(16,185,129,.55);
}
.menu-item.active a::after{height:22px;width:2px;background:#48d6b2;}
.menu-item.active a i{color:#65e1c1;background:rgba(16,185,129,.12);filter:none;}
.sidebar-footer{
    margin-top:8px;
    padding-top:8px;
    border-top-color:rgba(255,255,255,.08);
}
.sidebar-footer .btn{margin-top:5px;min-height:35px;padding:7px 9px;font-size:.75rem;border-radius:9px;}
.sidebar .btn-secondary{background:rgba(255,255,255,.055);border-color:rgba(255,255,255,.08);color:#d5e2e6;}
.sidebar .btn-danger{background:rgba(127,29,29,.28);border-color:rgba(248,113,113,.15);color:#fecaca;box-shadow:none;}
.sidebar .btn-danger:hover{background:rgba(153,27,27,.36);border-color:rgba(248,113,113,.22);}

/* ---------- Header ---------- */
.header{
    min-height:0;
    padding:10px 14px;
    margin-bottom:14px;
    border-radius:13px;
    background:rgba(255,255,255,.88);
    border-color:rgba(113,128,150,.16);
    box-shadow:var(--premium-shadow);
}
body.dark .header{background:rgba(13,30,43,.88);border-color:rgba(148,163,184,.12);}
.header::after{height:1px;opacity:.48;background:linear-gradient(90deg,transparent,rgba(72,214,178,.70),transparent);}
.page-heading{gap:1px;}
.page-kicker{font-size:.61rem;color:#087f75;gap:5px;}
body.dark .page-kicker{color:#65e1c1;}
.header-left h1{font-size:1.28rem;font-weight:800;}
.icon-btn{
    width:34px;
    height:34px;
    border-radius:9px;
    background:#f8fafc;
    color:#385066;
    border-color:rgba(113,128,150,.18);
    box-shadow:none;
}
body.dark .icon-btn{background:#102330;color:#dbe7ec;border-color:rgba(148,163,184,.14);}
.icon-btn:hover{transform:none;background:rgba(14,159,120,.07);border-color:rgba(14,159,120,.28);color:#087f75;}
body.dark .icon-btn:hover{color:#65e1c1;background:rgba(16,185,129,.09);}
.user-info{gap:8px;padding:5px 7px 5px 10px;border-radius:10px;background:#f8fafc;}
body.dark .user-info{background:#102330;}
.user-avatar{width:30px;height:30px;border-radius:8px;background:linear-gradient(135deg,#0e9f78,#0b5360);box-shadow:none;font-size:.78rem;}
.user-copy strong{font-size:.74rem;}.user-copy small{font-size:.61rem;}

/* ---------- Common surfaces ---------- */
.dashboard-card,
.stat-card,
.settings-card,
.table-container,
.filters,
.auth-card,
.modal{
    border-color:rgba(113,128,150,.16);
    box-shadow:var(--shadow);
}
body.dark .dashboard-card,
body.dark .stat-card,
body.dark .settings-card,
body.dark .table-container,
body.dark .filters,
body.dark .auth-card,
body.dark .modal{
    border-color:rgba(148,163,184,.13);
}
.dashboard-card,
.settings-card{border-radius:13px;}
.card-header{padding:11px 13px;}
.card-header h3{font-size:.92rem;}
.card-content{padding:13px;}
.page-header{margin-bottom:12px;}
.page-header h2{font-size:1.18rem;margin-bottom:2px;}
.page-subtitle{font-size:.76rem;line-height:1.55;}

/* ---------- KPI cards: compact without changing grid behavior ---------- */
.stats-grid{gap:10px;margin-bottom:12px;}
.stat-card{
    padding:11px 12px;
    gap:10px;
    border-radius:12px;
    background:rgba(255,255,255,.90);
    box-shadow:0 10px 22px -19px rgba(6,19,31,.42);
}
body.dark .stat-card{background:rgba(13,30,43,.84);}
.stat-card:hover{transform:none;border-color:rgba(14,159,120,.22);box-shadow:0 12px 24px -20px rgba(6,19,31,.55);}
.stat-card.dashboard-link-card:active{transform:none;}
.stat-card.dashboard-link-card::after{font-size:.68rem;}
.stat-icon,
.stat-card .stat-icon{
    width:36px;
    height:36px;
    min-width:36px;
    border-radius:10px;
    font-size:.94rem;
    background:rgba(14,159,120,.09);
}
.stat-card .stat-icon::after{display:none;}
.stat-content h3{font-size:1.28rem;line-height:1.05;margin-bottom:3px;}
.stat-content p{font-size:.72rem;line-height:1.35;color:var(--muted);}

/* Dashboard-specific selectors match the existing V13.9 specificity. */
#dashboard-page .stat-card{
    min-height:96px;
    padding:11px 12px;
    gap:10px;
    align-items:center;
    border-radius:12px;
    background:linear-gradient(145deg,var(--surface-strong),var(--surface-soft));
    box-shadow:0 10px 22px -19px rgba(6,19,31,.42);
}
#dashboard-page .stat-card::before{top:10px;bottom:10px;width:2px;}
#dashboard-page .dashboard-stat-entity{min-height:88px;}
#dashboard-page .stat-icon{width:36px;height:36px;flex-basis:36px;border-radius:10px;font-size:.94rem;}
#dashboard-page .stat-content h3{font-size:1.34rem;line-height:1.08;}
#dashboard-page .stat-content p{font-size:.70rem;}

/* ---------- Forms ---------- */
.form-group{margin-bottom:11px;}
.form-group label,
.setting-item > label{font-size:.74rem;font-weight:750;}
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea{
    padding:8px 10px;
    min-height:38px;
    border-radius:9px;
    border-color:rgba(113,128,150,.22);
    background:#fff;
    color:var(--text);
    font-size:.79rem;
    box-shadow:inset 0 1px 0 rgba(6,19,31,.015);
    transition:border-color .17s ease,box-shadow .17s ease,background-color .17s ease;
}
textarea{min-height:72px;line-height:1.55;}
body.dark input:not([type="checkbox"]):not([type="radio"]),
body.dark select,
body.dark textarea,
body.dark .filters input,
body.dark .filters select{background:#0b1b27;color:var(--text);border-color:rgba(148,163,184,.15);}
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus{
    border-color:rgba(14,159,120,.48);
    box-shadow:0 0 0 3px rgba(16,185,129,.09);
}
.hint,
.settings-hint,
.form-hint{font-size:.68rem;line-height:1.55;color:var(--muted);}

/* ---------- Buttons ---------- */
.btn{
    min-height:36px;
    padding:7px 11px;
    gap:6px;
    border-radius:9px;
    font-size:.76rem;
    font-weight:750;
    box-shadow:none;
    transition:background-color .17s ease,border-color .17s ease,color .17s ease,box-shadow .17s ease,filter .17s ease;
}
.btn::after{content:none;display:none;}
.btn:hover:not(:disabled){transform:none;box-shadow:0 8px 16px -14px rgba(6,19,31,.50);}
.btn:active:not(:disabled){transform:none;}
.btn-sm{min-height:32px;padding:5px 9px;font-size:.69rem;border-radius:8px;}
.btn-primary{
    background:linear-gradient(135deg,#0e9f78 0%,#087f75 58%,#0b5360 100%);
    border-color:rgba(8,127,117,.32);
    color:#fff;
    box-shadow:0 8px 18px -14px rgba(14,159,120,.70);
}
.btn-primary:hover{filter:brightness(1.03);}
.btn-secondary{background:#f3f6f8;border-color:rgba(113,128,150,.19);color:#42566a;}
body.dark .btn-secondary{background:#102330;border-color:rgba(148,163,184,.14);color:#dce7eb;}
.btn-danger{background:#a73a43;border-color:rgba(127,29,29,.25);color:#fff;}

/* ---------- Tables ---------- */
.table-container{border-radius:12px;}
.data-table{font-size:.76rem;}
.data-table thead{background:#edf3f6;}
body.dark .data-table thead{background:#102330;}
.data-table thead th{
    padding:9px 10px;
    color:#405366;
    font-size:.68rem;
    font-weight:800;
    letter-spacing:.005em;
    border-color:rgba(113,128,150,.14);
}
body.dark .data-table thead th{color:#bdccd5;}
.data-table td{padding:9px 10px;border-color:rgba(113,128,150,.10);}
.data-table tbody tr{transition:background-color .16s ease;}
.data-table tbody tr:hover{transform:none;box-shadow:none;background:rgba(14,159,120,.035);}
body.dark .data-table tbody tr:hover{background:rgba(16,185,129,.045);}
.data-table .btn,.data-table .icon-btn{min-height:32px;}
.badge,.status-badge{font-size:.64rem;padding:4px 7px;border-radius:999px;box-shadow:none;}
.pagination{margin-top:10px;gap:5px;}
.page-btn{min-width:32px;min-height:32px;border-radius:8px;font-size:.7rem;}
.filters{gap:8px;padding:9px 10px;margin-bottom:10px;border-radius:11px;}

/* ---------- Settings: preserve existing compact navigation + panel logic ---------- */
#settings-page .settings-nav,
#settings-page .settings-nav.is-floating{
    gap:5px !important;
    padding:7px !important;
    margin-bottom:10px !important;
    border-radius:12px !important;
    border-color:rgba(113,128,150,.15) !important;
    background:rgba(255,255,255,.82) !important;
    box-shadow:0 9px 20px -18px rgba(6,19,31,.38) !important;
}
body.dark #settings-page .settings-nav,
body.dark #settings-page .settings-nav.is-floating{
    background:rgba(13,30,43,.88) !important;
    border-color:rgba(148,163,184,.12) !important;
    box-shadow:0 10px 22px -18px rgba(0,0,0,.62) !important;
}
#settings-page .settings-tab,
#settings-page .settings-tab[data-tone]{
    min-height:42px;
    gap:7px;
    padding:5px 8px;
    border-radius:8px;
    border-color:transparent;
    background:transparent;
    box-shadow:none;
    transition:background-color .17s ease,border-color .17s ease,color .17s ease;
}
#settings-page .settings-tab > i{
    width:30px;
    height:30px;
    flex-basis:30px;
    padding:0;
    border-radius:8px;
    border-color:rgba(113,128,150,.13);
    color:#536b7c;
    background:rgba(113,128,150,.06);
    font-size:.78rem;
    box-shadow:none;
}
body.dark #settings-page .settings-tab > i{color:#aac0ca;background:rgba(148,163,184,.07);border-color:rgba(148,163,184,.10);}
#settings-page .settings-tab-copy{gap:1px;}
#settings-page .settings-tab-copy small{font-size:.56rem;line-height:1.15;color:var(--muted);}
#settings-page .settings-tab-copy strong{font-size:.69rem;line-height:1.22;font-weight:780;}
#settings-page .settings-tab:hover{transform:none;background:rgba(14,159,120,.045);border-color:rgba(14,159,120,.10);box-shadow:none;}
#settings-page .settings-tab.active,
body.dark #settings-page .settings-tab.active{
    transform:none;
    background:linear-gradient(135deg,rgba(16,185,129,.13),rgba(13,148,136,.055));
    border-color:rgba(14,159,120,.18);
    box-shadow:inset 2px 0 0 rgba(72,214,178,.80);
}
html[dir="rtl"] #settings-page .settings-tab.active,
html[dir="rtl"] body.dark #settings-page .settings-tab.active{box-shadow:inset -2px 0 0 rgba(72,214,178,.80);}
#settings-page .settings-tab.active > i{
    color:#087f75;
    background:rgba(14,159,120,.09);
    border-color:rgba(14,159,120,.16);
    box-shadow:none;
}
body.dark #settings-page .settings-tab.active > i{color:#65e1c1;}
#settings-page .settings-card{padding:13px;border-radius:12px;box-shadow:0 9px 20px -19px rgba(6,19,31,.38);}
#settings-page .settings-card > h3{font-size:.91rem;margin-bottom:10px;}
#settings-page .settings-card > h3.settings-panel-heading{gap:7px;}
#settings-page .settings-panel-save-btn{min-height:32px;padding:5px 9px;border-radius:8px;font-size:.68rem;}
#settings-page .settings-panel-intro{margin:-2px 0 11px;padding:7px 9px;border-radius:8px;font-size:.7rem;}
#settings-page .settings-subtitle{margin:13px 0 8px;font-size:.8rem;}
#settings-page .settings-grid{gap:10px;}
#settings-page .setting-item{margin-bottom:9px;}
#settings-page .manager-rule-card{padding:13px;border-radius:11px;box-shadow:none;}
#settings-page .manager-rule-card::before{width:2px;}
#settings-page .manager-rule-header{margin:0 0 10px;padding-bottom:9px;}
#settings-page .manager-rule-icon{width:30px;height:30px;flex-basis:30px;border-radius:8px;}
#settings-page .manager-rule-header h4{font-size:.82rem;}
#settings-page .manager-rule-kicker{font-size:.6rem;}
#settings-page .settings-info-box{padding:9px 10px;border-radius:9px;font-size:.7rem;}

/* ---------- Modal / auth ---------- */
.modal{border-radius:14px;background:#fff;}
body.dark .modal{background:#0d1e2b;}
.modal-header,.modal-footer{padding:11px 13px;}
.modal-header h3{font-size:.94rem;}
.modal-body{padding:13px;}
.close-btn{color:var(--muted);}
.auth-card{border-radius:16px;}
.auth-header{padding:18px 18px 13px;}
.auth-body{padding:16px 18px 18px;}

/* Logout confirmation - uses existing modal infrastructure. */
.logout-confirm-body{text-align:center;padding-block:18px;}
.logout-confirm-icon{
    display:grid;
    place-items:center;
    margin:0 auto 10px;
    width:42px;
    height:42px;
    border-radius:12px;
    background:rgba(167,58,67,.09);
    color:#a73a43;
    border:1px solid rgba(167,58,67,.14);
    font-size:1rem;
}
.logout-confirm-body p{margin:0;color:var(--text);font-size:.82rem;font-weight:750;}
.logout-confirm-body small{display:block;margin-top:5px;color:var(--muted);font-size:.69rem;line-height:1.55;}

/* ---------- Icon contrast guarantees ---------- */
.settings-subtitle i,
.card-header h3 i,
.page-header h2 i{color:#087f75;}
body.dark .settings-subtitle i,
body.dark .card-header h3 i,
body.dark .page-header h2 i{color:#65e1c1;}
.btn i,.icon-btn i,.stat-icon i,.settings-tab i{opacity:1;visibility:visible;}

/* ---------- Motion: restrained ---------- */
.page{animation-duration:.18s;}
.modal,.auth-card,.settings-tab,.menu-item a,.btn,.icon-btn,input,select,textarea{transition-duration:.17s;}

@media (prefers-reduced-motion:reduce){
    *,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important;}
}

/* Keep mobile behavior intact; only tighten visual spacing. */
@media (max-width:760px){
    .sidebar{padding:10px;}
    .main-content{padding:14px;}
    .header{padding:9px 10px;margin-bottom:10px;}
    .stat-card{padding:10px;}
    #dashboard-page .stat-card{min-height:90px;padding:10px;}
    #dashboard-page .stat-icon{width:34px;height:34px;flex-basis:34px;}
    #settings-page .settings-nav{padding:6px !important;}
    #settings-page .settings-tab{min-height:42px;}
    #settings-page .settings-card{padding:11px;}
    .data-table thead th,.data-table td{padding:8px 9px;}
}


/* ============================================================
   V13.23.48 follow-up refinements
   - Recovery Bin cards more compact
   - Recovery customers icon visibility
   - Blocked numbers section more premium
   - Agents page tighter and more visible
   ============================================================ */

/* Recovery Bin: denser summary cards without changing structure */
#recovery-bin-page .page-header{margin-bottom:10px;}
#recovery-bin-page .page-header .muted{font-size:.72rem;line-height:1.55;}
#recovery-bin-page .recovery-summary-grid{
    gap:8px;
    margin-bottom:10px;
}
#recovery-bin-page .recovery-filter-card{
    min-height:78px;
    padding:9px 10px;
    gap:9px;
    border-radius:12px;
    background:linear-gradient(145deg,var(--surface-strong),var(--surface-soft));
    box-shadow:0 10px 22px -19px rgba(6,19,31,.40);
}
body.dark #recovery-bin-page .recovery-filter-card{
    background:linear-gradient(145deg,rgba(13,30,43,.96),rgba(18,39,53,.82));
}
#recovery-bin-page .recovery-filter-card .stat-icon{
    width:34px;
    height:34px;
    min-width:34px;
    border-radius:10px;
    font-size:.9rem;
    background:linear-gradient(135deg,rgba(14,159,120,.13),rgba(11,83,96,.08));
    color:#0b5360;
    box-shadow:inset 0 0 0 1px rgba(14,159,120,.12);
}
body.dark #recovery-bin-page .recovery-filter-card .stat-icon{color:#67e0c1;}
#recovery-bin-page .recovery-filter-card .stat-content h3{font-size:1.16rem;margin-bottom:2px;}
#recovery-bin-page .recovery-filter-card .stat-content p{font-size:.68rem;line-height:1.3;}
#recovery-bin-page .recovery-filter-card.is-active,
#recovery-bin-page .recovery-filter-card[aria-pressed="true"]{
    border-color:rgba(14,159,120,.22);
    box-shadow:0 12px 24px -20px rgba(6,19,31,.52), inset 0 0 0 1px rgba(14,159,120,.10);
}
#recovery-bin-page .recovery-card{margin-bottom:10px;}
#recovery-bin-page .recovery-card .card-header{padding:10px 12px;}
#recovery-bin-page .recovery-card .card-header h3{font-size:.88rem;}
#recovery-bin-page .recovery-card .data-table thead th,
#recovery-bin-page .recovery-card .data-table td{padding:8px 9px;}

/* Settings: blocked numbers should feel like an intentional control area */
#settings-page h4.settings-subtitle:has(+ .setting-item #blocked-customer-numbers){
    margin-top:16px;
    margin-bottom:10px;
    padding:10px 12px;
    border:1px solid rgba(167,58,67,.12);
    border-radius:11px 11px 0 0;
    background:linear-gradient(135deg,rgba(167,58,67,.055),rgba(244,247,250,.92));
    color:#7a2430;
}
body.dark #settings-page h4.settings-subtitle:has(+ .setting-item #blocked-customer-numbers){
    background:linear-gradient(135deg,rgba(167,58,67,.09),rgba(13,30,43,.92));
    border-color:rgba(248,113,113,.14);
    color:#fecaca;
}
#blocked-customer-numbers{
    min-height:110px;
    background:linear-gradient(180deg,rgba(255,250,250,.95),rgba(252,244,245,.98));
    border-color:rgba(167,58,67,.16);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.65), 0 8px 18px -18px rgba(127,29,29,.28);
}
body.dark #blocked-customer-numbers{
    background:linear-gradient(180deg,rgba(35,19,24,.95),rgba(23,18,22,.98));
    border-color:rgba(248,113,113,.16);
}
#blocked-customer-numbers:focus{box-shadow:0 0 0 3px rgba(167,58,67,.10);border-color:rgba(167,58,67,.32);}
#blocked-customer-numbers::placeholder{color:#b0898e;}
#blocked-customer-numbers + .hint{
    display:block;
    margin-top:8px;
    padding:8px 10px;
    border-radius:10px;
    background:rgba(167,58,67,.06);
    border:1px solid rgba(167,58,67,.09);
    color:#8a4a54;
}
body.dark #blocked-customer-numbers + .hint{
    background:rgba(127,29,29,.14);
    border-color:rgba(248,113,113,.12);
    color:#f8c7cf;
}

/* Agents page: make more of the page visible with tighter vertical rhythm */
#agents-page .page-header{
    margin-bottom:8px;
    align-items:center;
}
#agents-page .page-header h2{
    font-size:1.08rem;
    margin-bottom:0;
}
#agents-page .page-header .btn{
    min-height:34px;
    padding:6px 10px;
    font-size:.73rem;
}
#agents-page .table-toolbar{
    margin-bottom:8px;
    padding:8px 10px;
}
#agents-page .filters{
    gap:7px;
    padding:0;
    margin-bottom:0;
    background:transparent;
    box-shadow:none;
    border:none;
}
#agents-page .filters input,
#agents-page .filters select{
    min-height:36px;
    padding:7px 10px;
    font-size:.76rem;
}
#agents-page #agents-search{min-width:230px;}
#agents-page #agents-table-meta{
    font-size:.72rem;
    line-height:1.35;
}
#agents-page .table-container{border-radius:12px;}
#agents-page .data-table{font-size:.75rem;}
#agents-page .data-table thead th,
#agents-page .data-table td{padding:8px 9px;}
#agents-page .status-badge{font-size:.62rem;padding:4px 6px;}
#agents-page .action-buttons .btn-sm{min-height:30px;padding:5px 8px;}
#agents-page .table-footer{margin-top:8px;}

@media (max-width:760px){
    #recovery-bin-page .recovery-summary-grid{gap:7px;}
    #recovery-bin-page .recovery-filter-card{min-height:72px;padding:8px 9px;}
    #agents-page .page-header{margin-bottom:7px;}
    #agents-page .page-header .btn,
    #agents-page .filters input,
    #agents-page .filters select{width:100%;}
    #agents-page #agents-search{min-width:0;}
}


/* ============================================================
   V13.23.49 global spacing + agents width refinement
   - Add breathing room below top bar across pages
   - Fix clipped action buttons in Agents table
   - Avoid the "zoomed out only from top" feel
   ============================================================ */

/* Global page breathing room under the top header */
.main-content{padding-top:14px;}
.page{padding-top:4px;}
.page > .page-header:first-child,
.page > .sales-manager-page-header:first-child,
.page > .settings-page-header:first-child{
    margin-top:6px;
}
.page-header,
.sales-manager-page-header,
#settings-page .settings-page-header{
    margin-bottom:14px;
}
.page-header h2,
.sales-manager-page-header h2,
#settings-page .settings-page-header h2{
    line-height:1.14;
}
.page-header .muted,
.page-subtitle,
#settings-page .settings-page-header .page-subtitle{
    margin-top:4px;
}

/* Agents page: restore balance and fix width clipping properly */
#agents-page .page-header{
    margin-top:6px;
    margin-bottom:10px;
    gap:10px;
}
#agents-page .page-header h2{
    font-size:1.16rem;
    line-height:1.14;
}
#agents-page .page-header .btn{
    min-height:36px;
    padding:7px 12px;
    font-size:.76rem;
    border-radius:10px;
}
#agents-page .table-toolbar{
    margin-bottom:10px;
    padding:9px 10px;
}
#agents-page .filters{
    gap:8px;
}
#agents-page .filters input,
#agents-page .filters select{
    min-height:38px;
    padding:8px 10px;
    font-size:.78rem;
}
#agents-page .table-container{
    overflow-x:auto !important;
    overflow-y:auto !important;
    scrollbar-gutter:stable;
}
#agents-page .table-container .data-table{
    width:100% !important;
    min-width:1260px !important;
    table-layout:fixed !important;
}
#agents-page .data-table{
    font-size:.76rem !important;
}
#agents-page .data-table th,
#agents-page .data-table td{
    padding:8px 6px !important;
}
#agents-page .data-table th:nth-child(1),
#agents-page .data-table td:nth-child(1){ width:4% !important; }
#agents-page .data-table th:nth-child(2),
#agents-page .data-table td:nth-child(2){ width:13% !important; }
#agents-page .data-table th:nth-child(3),
#agents-page .data-table td:nth-child(3){ width:11.5% !important; }
#agents-page .data-table th:nth-child(4),
#agents-page .data-table td:nth-child(4){ width:8% !important; }
#agents-page .data-table th:nth-child(5),
#agents-page .data-table td:nth-child(5){ width:12% !important; }
#agents-page .data-table th:nth-child(6),
#agents-page .data-table td:nth-child(6){ width:9.5% !important; }
#agents-page .data-table th:nth-child(7),
#agents-page .data-table td:nth-child(7){ width:6% !important; }
#agents-page .data-table th:nth-child(8),
#agents-page .data-table td:nth-child(8){ width:12.5% !important; }
#agents-page .data-table th:nth-child(9),
#agents-page .data-table td:nth-child(9){ width:10% !important; }
#agents-page .data-table th:nth-child(10),
#agents-page .data-table td:nth-child(10){ width:6% !important; }
#agents-page .data-table th:nth-child(11),
#agents-page .data-table td:nth-child(11){ width:7.5% !important; }
#agents-page .action-buttons{
    justify-content:center;
    gap:5px !important;
    flex-wrap:nowrap !important;
    min-width:0;
}
#agents-page .action-buttons .btn-sm{
    width:30px !important;
    min-width:30px !important;
    height:30px !important;
    min-height:30px !important;
    padding:0 !important;
}

@media (max-width:1100px){
    #agents-page .table-container .data-table{min-width:1200px !important;}
}

@media (max-width:760px){
    .main-content{padding-top:12px;}
    .page{padding-top:2px;}
    .page > .page-header:first-child,
    .page > .sales-manager-page-header:first-child,
    .page > .settings-page-header:first-child{margin-top:4px;}
    #agents-page .page-header{margin-top:4px;}
    #agents-page .table-container .data-table{min-width:1120px !important;}
}

/* ============================================================
   V13.23.50 - Recovery actions + Transfer CRM refinements
   ============================================================ */

/* Recovery Bin: destructive controls are explicit but visually restrained. */
#recovery-bin-page .page-header .filters{
    align-items:center;
    flex-wrap:wrap;
}
#recovery-bin-page .recovery-empty-btn{
    min-height:36px;
    padding-inline:12px;
    background:linear-gradient(135deg,#9f3540,#7f1d2b);
    border-color:rgba(127,29,43,.28);
    box-shadow:0 8px 18px -15px rgba(127,29,43,.65);
    white-space:nowrap;
}
#recovery-bin-page .recovery-empty-btn:hover{
    background:linear-gradient(135deg,#aa3c47,#8f2432);
}
.recovery-row-actions{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    flex-wrap:wrap;
}
.recovery-row-actions .btn{
    min-height:31px;
    padding:5px 8px;
    font-size:.67rem;
}
.recovery-row-actions .btn-danger{
    background:rgba(167,58,67,.08);
    color:#96323e;
    border-color:rgba(167,58,67,.16);
}
.recovery-row-actions .btn-danger:hover{
    background:rgba(167,58,67,.14);
    color:#7f1d2b;
    border-color:rgba(167,58,67,.24);
}
body.dark .recovery-row-actions .btn-danger{
    background:rgba(167,58,67,.14);
    color:#fecaca;
    border-color:rgba(248,113,113,.15);
}
body.dark .recovery-row-actions .btn-danger:hover{
    background:rgba(167,58,67,.22);
    color:#fee2e2;
}

/* Group CRM/account notices: one compact card per operation.
   The matched-only option sits inside the same control cluster, not on a new row. */
.crm-notice-ops-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:9px;
    margin:10px 0 8px;
}
.crm-notice-op-card{
    min-width:0;
    padding:11px;
    border:1px solid rgba(113,128,150,.14);
    border-radius:12px;
    background:linear-gradient(145deg,rgba(255,255,255,.92),rgba(244,247,250,.82));
    box-shadow:0 9px 20px -19px rgba(6,19,31,.34);
}
body.dark .crm-notice-op-card{
    background:linear-gradient(145deg,rgba(13,30,43,.93),rgba(18,39,53,.76));
    border-color:rgba(148,163,184,.12);
}
.crm-notice-op-head{
    display:grid;
    grid-template-columns:34px minmax(0,1fr) auto;
    align-items:center;
    gap:9px;
}
.crm-notice-op-icon{
    display:grid;
    place-items:center;
    width:34px;
    height:34px;
    border-radius:10px;
    color:#087f75;
    background:linear-gradient(135deg,rgba(16,185,129,.11),rgba(8,127,117,.055));
    border:1px solid rgba(14,159,120,.11);
    font-size:.82rem;
}
body.dark .crm-notice-op-icon{color:#65e1c1;}
.crm-notice-op-copy{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:2px;
}
.crm-notice-op-copy strong{
    color:var(--text);
    font-size:.76rem;
    line-height:1.35;
}
.crm-notice-op-copy small{
    color:var(--muted);
    font-size:.62rem;
    line-height:1.5;
}
.crm-notice-op-controls{
    display:flex;
    align-items:center;
    gap:6px;
    flex-wrap:nowrap;
    padding-inline-start:4px;
}
.crm-notice-control{
    display:flex;
    align-items:center;
    gap:5px;
    min-height:30px;
    padding:4px 7px;
    border-radius:9px;
    background:rgba(113,128,150,.055);
    border:1px solid rgba(113,128,150,.10);
    white-space:nowrap;
}
.crm-notice-control > span{
    font-size:.61rem;
    font-weight:750;
    color:#526477;
}
.crm-notice-control-match{
    background:rgba(14,159,120,.055);
    border-color:rgba(14,159,120,.11);
}
.crm-notice-control-match > span{color:#0b716a;}
.crm-notice-control-match i{font-size:.58rem;}
body.dark .crm-notice-control{
    background:rgba(148,163,184,.055);
    border-color:rgba(148,163,184,.10);
}
body.dark .crm-notice-control > span{color:#b4c4cd;}
body.dark .crm-notice-control-match{
    background:rgba(16,185,129,.075);
    border-color:rgba(72,214,178,.10);
}
body.dark .crm-notice-control-match > span{color:#7ae4c8;}
.crm-notice-op-controls .switch{transform:scale(.86);transform-origin:center;}
.crm-notice-op-controls .switch-sm{transform:scale(.74);}
.crm-notice-help{
    display:block;
    margin-top:7px;
    padding:7px 9px;
    border-radius:9px;
    background:rgba(14,159,120,.04);
    border:1px solid rgba(14,159,120,.075);
}

/* Customers: 14 columns now include operation-isolated transfer CRM status.
   Allow horizontal scrolling instead of clipping actions or shrinking content. */
@media (min-width:1025px){
    #customers-page .table-container{
        overflow-x:auto !important;
        overflow-y:hidden;
    }
    #customers-page #customers-table{
        width:100% !important;
        min-width:1500px !important;
        table-layout:fixed !important;
    }
    #customers-page #customers-table th,
    #customers-page #customers-table td{
        padding:8px 7px !important;
    }
    #customers-page #customers-table th:nth-child(1),
    #customers-page #customers-table td:nth-child(1){width:3% !important;min-width:0 !important;}
    #customers-page #customers-table th:nth-child(2),
    #customers-page #customers-table td:nth-child(2){width:10% !important;min-width:0 !important;}
    #customers-page #customers-table th:nth-child(3),
    #customers-page #customers-table td:nth-child(3){width:10% !important;min-width:0 !important;}
    #customers-page #customers-table th:nth-child(4),
    #customers-page #customers-table td:nth-child(4){width:6% !important;min-width:0 !important;}
    #customers-page #customers-table th:nth-child(5),
    #customers-page #customers-table td:nth-child(5){width:7% !important;min-width:0 !important;}
    #customers-page #customers-table th:nth-child(6),
    #customers-page #customers-table td:nth-child(6){width:5% !important;min-width:0 !important;}
    #customers-page #customers-table th:nth-child(7),
    #customers-page #customers-table td:nth-child(7){width:8% !important;min-width:0 !important;}
    #customers-page #customers-table th:nth-child(8),
    #customers-page #customers-table td:nth-child(8){width:10% !important;min-width:0 !important;}
    #customers-page #customers-table th:nth-child(9),
    #customers-page #customers-table td:nth-child(9),
    #customers-page #customers-table th:nth-child(10),
    #customers-page #customers-table td:nth-child(10),
    #customers-page #customers-table th:nth-child(11),
    #customers-page #customers-table td:nth-child(11){width:6% !important;min-width:0 !important;}
    #customers-page #customers-table th:nth-child(12),
    #customers-page #customers-table td:nth-child(12){width:7% !important;min-width:0 !important;}
    #customers-page #customers-table th:nth-child(13),
    #customers-page #customers-table td:nth-child(13){width:4% !important;min-width:0 !important;}
    #customers-page #customers-table th:nth-child(14),
    #customers-page #customers-table td:nth-child(14){width:12% !important;min-width:0 !important;}
    #customers-page .customer-actions-cell .action-buttons{
        justify-content:center;
        flex-wrap:nowrap;
        gap:5px;
    }
}

/* Sales-manager detail view now exposes transfer CRM as well. */
.sales-manager-customers-table{min-width:650px;}

@media (max-width:1180px){
    .crm-notice-ops-grid{grid-template-columns:1fr;}
    .crm-notice-op-head{grid-template-columns:34px minmax(0,1fr) auto;}
}
@media (max-width:760px){
    #recovery-bin-page .recovery-empty-btn{width:100%;}
    .crm-notice-op-head{grid-template-columns:32px minmax(0,1fr);}
    .crm-notice-op-controls{
        grid-column:1 / -1;
        justify-content:flex-start;
        padding-inline-start:0;
        margin-top:2px;
    }
}

/* ===== V13.23.51 UI polish: CRM notice cards + customer filters ===== */
.crm-notice-op-card{
    display:flex;
    flex-direction:column;
    gap:10px;
}
.crm-notice-op-head{
    grid-template-columns:34px minmax(0,1fr);
    align-items:flex-start;
}
.crm-notice-op-copy strong,
.crm-notice-op-copy small{
    display:block;
    width:100%;
}
.crm-notice-op-copy strong{font-size:.8rem;}
.crm-notice-op-copy small{font-size:.64rem;}
.crm-notice-op-controls{
    width:100%;
    padding-inline-start:0;
    padding-top:8px;
    border-top:1px dashed rgba(113,128,150,.18);
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
}
.crm-notice-control{
    justify-content:space-between;
    min-height:38px;
    padding:7px 9px;
}
.crm-notice-control > span{
    font-size:.66rem;
    line-height:1.35;
}
.crm-notice-op-controls .switch{transform:scale(.9);}
.crm-notice-op-controls .switch-sm{transform:scale(.78);}
@media (max-width: 1180px){
    .crm-notice-ops-grid{grid-template-columns:1fr;}
}
@media (max-width: 760px){
    .crm-notice-op-controls{grid-template-columns:1fr;}
}

#customers-page .customer-page-filters{
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}
#customers-page .customer-page-filters input,
#customers-page .customer-page-filters select{
    min-width:150px;
}
#customers-page .customer-page-filters #customers-search{
    min-width:270px;
    flex:1 1 290px;
}
#customers-page .customers-clear-filters-btn{
    width:42px;
    min-width:42px;
    height:42px;
    padding:0;
    align-items:center;
    justify-content:center;
    color:#0f172a;
    border-color:rgba(245,158,11,.38);
    background:linear-gradient(135deg, rgba(253,186,116,.96), rgba(251,191,36,.88));
    box-shadow:0 12px 28px -10px rgba(245,158,11,.65);
}
#customers-page .customers-clear-filters-btn:hover{
    filter:brightness(1.04);
    box-shadow:0 16px 32px -10px rgba(245,158,11,.72);
}
body.dark #customers-page .customers-clear-filters-btn{color:#0f172a;}

@media (min-width:1025px){
    #customers-page #customers-table{
        min-width:1570px !important;
    }
    #customers-page #customers-table th:nth-child(9),
    #customers-page #customers-table td:nth-child(9){width:9% !important;}
    #customers-page #customers-table th:nth-child(10),
    #customers-page #customers-table td:nth-child(10){width:7.5% !important;}
    #customers-page #customers-table th:nth-child(11),
    #customers-page #customers-table td:nth-child(11){width:13% !important;}
}

/* ============================================================
   V13.23.52 toggle/filter/barcode visual fixes
   ============================================================ */

/* CRM status cards: keep each label visibly attached to its own switch. */
.crm-notice-op-card{
    display:flex;
    flex-direction:column;
    gap:10px;
}
.crm-notice-op-head{
    display:grid;
    grid-template-columns:34px minmax(0,1fr);
    align-items:start;
    gap:9px;
}
.crm-notice-op-controls{
    width:100%;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    padding:8px 0 0;
    border-top:1px dashed rgba(113,128,150,.18);
}
.crm-notice-control{
    min-width:0;
    min-height:36px;
    display:flex;
    flex-direction:row;
    align-items:center;
    justify-content:flex-start;
    gap:8px;
    padding:5px 8px;
    direction:rtl;
    white-space:nowrap;
}
.crm-notice-control > span{
    display:inline-flex;
    align-items:center;
    gap:4px;
    flex:0 1 auto;
    min-width:0;
    font-size:.67rem;
    line-height:1.25;
    overflow:visible;
}
.crm-notice-control .switch,
.crm-notice-control .switch.switch-sm{
    width:46px !important;
    min-width:46px !important;
    height:26px !important;
    flex:0 0 46px !important;
    transform:none !important;
    margin:0 !important;
}
.crm-notice-control .switch .slider:before,
.crm-notice-control .switch.switch-sm .slider:before{
    width:20px !important;
    height:20px !important;
    right:3px !important;
}
.crm-notice-control .switch input:checked + .slider:before,
.crm-notice-control .switch.switch-sm input:checked + .slider:before{
    transform:translateY(-50%) translateX(-20px) !important;
}
@media (max-width:760px){
    .crm-notice-op-controls{grid-template-columns:1fr;}
}

/* Unified icon-only clear-filter action. Appears only when JS detects a filter. */
.filter-clear-icon{
    width:38px !important;
    min-width:38px !important;
    height:38px !important;
    min-height:38px !important;
    padding:0 !important;
    align-items:center !important;
    justify-content:center !important;
    border-radius:10px !important;
    color:#8a5800 !important;
    border:1px solid rgba(245,158,11,.26) !important;
    background:linear-gradient(135deg,rgba(255,247,224,.98),rgba(254,230,138,.74)) !important;
    box-shadow:0 9px 20px -16px rgba(180,83,9,.62) !important;
}
.filter-clear-icon i{font-size:.82rem;}
.filter-clear-icon:hover{
    color:#713f12 !important;
    border-color:rgba(245,158,11,.38) !important;
    box-shadow:0 12px 22px -16px rgba(180,83,9,.78) !important;
}
body.dark .filter-clear-icon{
    color:#fcd34d !important;
    background:linear-gradient(135deg,rgba(120,53,15,.30),rgba(146,64,14,.18)) !important;
    border-color:rgba(245,158,11,.24) !important;
}

/* Ledger pages now use the same compact toolbar language as the other data pages. */
#registered-movements-page .page-header,
#restricted-room-movements-page .page-header{
    align-items:center;
    margin-bottom:10px;
}
#registered-movements-page .movement-filter-toolbar,
#restricted-room-movements-page .movement-filter-toolbar{
    margin-bottom:10px;
    padding:9px 10px;
    gap:8px;
}
#registered-movements-page .movement-filter-toolbar .filters,
#restricted-room-movements-page .movement-filter-toolbar .filters{
    flex:1 1 auto;
    gap:7px;
    align-items:center;
    flex-wrap:wrap;
}
#registered-movements-page .movement-filter-toolbar input,
#registered-movements-page .movement-filter-toolbar select,
#restricted-room-movements-page .movement-filter-toolbar input,
#restricted-room-movements-page .movement-filter-toolbar select{
    min-height:38px;
    height:38px;
    padding:7px 10px;
    font-size:.76rem;
    border-radius:10px;
}
#registered-movements-page .movement-filter-toolbar .btn,
#restricted-room-movements-page .movement-filter-toolbar .btn{
    min-height:38px;
    height:38px;
    padding:7px 11px;
    font-size:.74rem;
    border-radius:10px;
    box-shadow:none;
}
#registered-movements-page .movement-filter-toolbar .filter-clear-icon,
#restricted-room-movements-page .movement-filter-toolbar .filter-clear-icon{
    padding:0 !important;
}
#registered-movements-page .movement-filter-toolbar .table-meta,
#restricted-room-movements-page .movement-filter-toolbar .table-meta{
    margin-inline-start:auto;
    white-space:nowrap;
    font-size:.7rem;
}

/* Barcode preview: never display browser's broken-image glyph/text. */
.dep-barcode-thumb{
    font-size:0;
    color:transparent;
}
.dep-barcode-thumb:not(.is-visible){
    visibility:hidden;
}
.dep-barcode-thumb.is-visible{
    visibility:visible;
}

/* V13.23.59 - MetaTrader insufficient Free Margin auto-cancel control */
#settings-panel-metatrader .metatrader-margin-auto-cancel-setting{
    margin-top:10px;
    padding:11px 12px;
    border:1px solid rgba(245,158,11,.16);
    border-radius:11px;
    background:linear-gradient(135deg,rgba(245,158,11,.055),rgba(14,159,120,.035));
    box-shadow:0 9px 20px -20px rgba(6,19,31,.32);
}
#settings-panel-metatrader .metatrader-margin-auto-cancel-setting > div{
    min-width:0;
}
#settings-panel-metatrader .metatrader-margin-auto-cancel-setting label:first-child{
    font-weight:700;
    color:var(--text);
}
#settings-panel-metatrader .metatrader-margin-auto-cancel-setting .hint{
    margin-top:3px;
    line-height:1.6;
}
body.dark #settings-panel-metatrader .metatrader-margin-auto-cancel-setting{
    background:linear-gradient(135deg,rgba(245,158,11,.075),rgba(16,185,129,.045));
    border-color:rgba(251,191,36,.14);
}

/* ===== V13.23.63 Message Center ===== */
.message-center-card{overflow:hidden;}
.message-center-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;}
.message-center-head h3{margin:0 0 6px;}
.message-center-head p{margin:0;max-width:860px;color:var(--text-muted,#64748b);font-size:.78rem;line-height:1.7;}
.message-center-head-actions{display:flex;gap:8px;flex-wrap:wrap;}
.message-center-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:16px 0 12px;}
.message-center-stats>div{padding:10px 12px;border:1px solid rgba(148,163,184,.18);border-radius:12px;background:rgba(148,163,184,.055);display:flex;align-items:center;justify-content:space-between;gap:8px;}
.message-center-stats span{font-size:.68rem;color:var(--text-muted,#64748b);}
.message-center-stats strong{font-size:1rem;letter-spacing:.01em;}
.message-center-toolbar{display:grid;grid-template-columns:minmax(260px,1fr) minmax(145px,.36fr) minmax(145px,.36fr) auto 42px;gap:8px;align-items:center;margin-bottom:10px;}
.message-center-search{position:relative;display:flex;align-items:center;}
.message-center-search>i{position:absolute;right:12px;opacity:.55;pointer-events:none;}
.message-center-search input{width:100%;padding-inline-start:36px;}
.message-center-edited-toggle{height:42px;display:flex;align-items:center;gap:7px;padding:0 11px;border:1px solid rgba(148,163,184,.2);border-radius:10px;background:rgba(148,163,184,.045);font-size:.7rem;white-space:nowrap;cursor:pointer;}
.message-center-edited-toggle input{margin:0;}
.message-center-clear-btn{width:42px;min-width:42px;height:42px;padding:0;align-items:center;justify-content:center;}
.message-center-language-tabs{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin:2px 0 12px;}
.message-center-lang{border:1px solid rgba(148,163,184,.2);background:rgba(148,163,184,.045);color:inherit;border-radius:10px;padding:7px 11px;display:inline-flex;align-items:center;gap:7px;font:inherit;font-size:.7rem;cursor:pointer;transition:.16s ease;}
.message-center-lang span{display:inline-grid;place-items:center;min-width:26px;height:20px;border-radius:6px;background:rgba(148,163,184,.12);font-size:.6rem;font-weight:800;direction:ltr;}
.message-center-lang.active{border-color:rgba(59,130,246,.4);background:rgba(59,130,246,.1);box-shadow:0 8px 24px -18px rgba(37,99,235,.75);}
.message-center-safety-note{margin:0 0 12px;}
.message-center-list{display:grid;gap:9px;max-height:760px;overflow:auto;padding:2px 3px 3px;scrollbar-gutter:stable;}
.message-center-item{border:1px solid rgba(148,163,184,.16);border-radius:13px;background:rgba(148,163,184,.035);padding:11px;transition:border-color .15s ease,background .15s ease,box-shadow .15s ease;}
.message-center-item:focus-within{border-color:rgba(59,130,246,.38);background:rgba(59,130,246,.045);box-shadow:0 12px 30px -24px rgba(37,99,235,.7);}
.message-center-item.is-custom{border-color:rgba(14,165,233,.27);}
.message-center-item.is-invalid{border-color:rgba(239,68,68,.48);background:rgba(239,68,68,.035);}
.message-center-item-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:8px;}
.message-center-item-title{min-width:0;display:flex;flex-direction:column;gap:4px;}
.message-center-item-title strong{font-size:.76rem;line-height:1.35;}
.message-center-key{font:600 .59rem/1.35 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--text-muted,#64748b);direction:ltr;text-align:left;overflow-wrap:anywhere;}
.message-center-badges{display:flex;gap:5px;flex-wrap:wrap;margin-top:1px;}
.message-center-badge{font-size:.57rem;padding:3px 6px;border-radius:999px;background:rgba(148,163,184,.1);border:1px solid rgba(148,163,184,.16);color:var(--text-muted,#64748b);}
.message-center-badge.custom{color:#0369a1;background:rgba(14,165,233,.1);border-color:rgba(14,165,233,.2);}
.message-center-item-actions{display:flex;gap:6px;align-items:center;}
.message-center-reset{width:32px;height:32px;min-width:32px;padding:0;display:inline-flex;align-items:center;justify-content:center;border-radius:9px;}
.message-center-item textarea{width:100%;min-height:84px;resize:vertical;font-size:.72rem;line-height:1.65;}
.message-center-item[data-lang="en"] textarea{direction:ltr;text-align:left;font-family:Inter,Arial,sans-serif;}
.message-center-item[data-lang="ar"] textarea,.message-center-item[data-lang="ku"] textarea{direction:rtl;text-align:right;}
.message-center-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-top:7px;}
.message-center-vars{display:flex;gap:4px;flex-wrap:wrap;direction:ltr;}
.message-center-var{font:600 .55rem/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;padding:4px 6px;border-radius:7px;background:rgba(15,23,42,.055);border:1px solid rgba(148,163,184,.15);}
.message-center-default-note{font-size:.58rem;color:var(--text-muted,#64748b);}
.message-center-invalid-note{font-size:.6rem;color:#dc2626;font-weight:700;}
@media(max-width:980px){.message-center-toolbar{grid-template-columns:1fr 1fr;}.message-center-search{grid-column:1/-1;}.message-center-clear-btn{justify-self:start}.message-center-stats{grid-template-columns:1fr 1fr 1fr;}}
@media(max-width:640px){.message-center-stats{grid-template-columns:1fr;}.message-center-toolbar{grid-template-columns:1fr;}.message-center-search{grid-column:auto}.message-center-edited-toggle{width:100%;}.message-center-list{max-height:none;}.message-center-item-head{flex-direction:column;}.message-center-item-actions{align-self:flex-end;}}

/* ===== V13.23.66 Message settings sub-tabs ===== */
#settings-panel-messages .message-settings-tabs-shell{
    display:flex;
    align-items:center;
    gap:10px;
    padding:7px;
    margin-bottom:12px;
    border:1px solid rgba(148,163,184,.16);
    border-radius:14px;
    background:linear-gradient(135deg,rgba(248,250,252,.92),rgba(241,245,249,.72));
    box-shadow:0 12px 30px -26px rgba(15,23,42,.42);
}
body.dark #settings-panel-messages .message-settings-tabs-shell{
    background:linear-gradient(135deg,rgba(30,41,59,.82),rgba(15,23,42,.62));
    border-color:rgba(148,163,184,.14);
}
#settings-panel-messages .message-settings-tabs{
    min-width:0;
    flex:1 1 auto;
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px;
}
#settings-panel-messages .message-settings-tab{
    min-width:0;
    min-height:42px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:8px 12px;
    border:1px solid transparent;
    border-radius:10px;
    background:transparent;
    color:var(--text-muted,#64748b);
    font:700 .72rem/1.35 Cairo,Inter,Arial,sans-serif;
    cursor:pointer;
    transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease;
}
#settings-panel-messages .message-settings-tab i{
    font-size:.78rem;
    opacity:.78;
}
#settings-panel-messages .message-settings-tab:hover{
    background:rgba(59,130,246,.055);
    border-color:rgba(59,130,246,.14);
    color:var(--text,#0f172a);
}
#settings-panel-messages .message-settings-tab.active{
    color:#0f3b66;
    border-color:rgba(14,116,144,.24);
    background:linear-gradient(135deg,rgba(224,242,254,.92),rgba(236,253,245,.86));
    box-shadow:0 10px 24px -20px rgba(14,116,144,.72),inset 0 0 0 1px rgba(255,255,255,.45);
}
#settings-panel-messages .message-settings-tab.active i{opacity:1;color:#0e7490;}
body.dark #settings-panel-messages .message-settings-tab:hover{
    background:rgba(56,189,248,.07);
    border-color:rgba(56,189,248,.13);
    color:#e2e8f0;
}
body.dark #settings-panel-messages .message-settings-tab.active{
    color:#e2f7ff;
    border-color:rgba(34,211,238,.22);
    background:linear-gradient(135deg,rgba(14,116,144,.22),rgba(5,150,105,.14));
    box-shadow:0 10px 24px -20px rgba(34,211,238,.48),inset 0 0 0 1px rgba(255,255,255,.025);
}
body.dark #settings-panel-messages .message-settings-tab.active i{color:#67e8f9;}
#settings-panel-messages .message-settings-tabs-save{
    flex:0 0 auto;
    min-height:42px;
    white-space:nowrap;
}
#settings-panel-messages .message-settings-tab-panel{display:none;}
#settings-panel-messages .message-settings-tab-panel.active{display:block;}
#settings-panel-messages .message-settings-tab-panel > h3:first-child,
#settings-panel-messages .message-settings-tab-panel .message-center-head h3{
    display:none;
}
#settings-panel-messages .message-settings-tab-panel .message-center-head{
    margin-bottom:2px;
}
#settings-panel-messages .message-settings-tab-panel .message-center-head p{
    max-width:940px;
}
@media(max-width:820px){
    #settings-panel-messages .message-settings-tabs-shell{align-items:stretch;flex-direction:column;}
    #settings-panel-messages .message-settings-tabs-save{width:100%;justify-content:center;}
}
@media(max-width:620px){
    #settings-panel-messages .message-settings-tabs{grid-template-columns:1fr;}
    #settings-panel-messages .message-settings-tab{justify-content:flex-start;}
}


/* V13.23.95 - Withdrawal Risk Management rule switches */
.risk-history-master-toggle{margin-top:2px;}
.risk-history-rules{display:grid;gap:8px;padding:8px 0 0;}
.risk-history-rules.is-disabled{opacity:.55;}
.risk-history-rules .manager-rule-toggle{margin:0;}

/* V13.23.96 - Risk history controls: nested list, readable RTL, operation scoped */
#settings-page .risk-history-control-card{
    margin-top:10px;
    padding:12px;
    border:1px solid var(--border);
    border-radius:14px;
    background:color-mix(in srgb,var(--surface) 94%,var(--primary) 6%);
}
#settings-page .risk-history-master-row,
#settings-page .risk-history-rule-row{
    direction:rtl;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:14px;
}
#settings-page .risk-history-master-row{padding:2px 2px 10px;}
#settings-page .risk-history-copy{min-width:0;display:block;}
#settings-page .risk-history-copy label{
    display:block;
    margin:0;
    font-weight:800;
    line-height:1.55;
    white-space:normal;
    overflow-wrap:anywhere;
}
#settings-page .risk-history-copy .hint{
    display:block;
    margin-top:4px;
    line-height:1.7;
    white-space:normal;
    overflow-wrap:anywhere;
}
#settings-page .risk-history-eyebrow{
    display:inline-flex;
    align-items:center;
    gap:6px;
    margin-bottom:5px;
    color:var(--primary);
    font-size:.72rem;
    font-weight:800;
}
#settings-page .risk-history-rule-list{
    position:relative;
    display:grid;
    gap:7px;
    margin-top:4px;
    padding:10px 14px 4px 0;
    border-right:2px solid color-mix(in srgb,var(--primary) 32%,transparent);
}
#settings-page .risk-history-rule-list.is-disabled{opacity:.48;filter:saturate(.65);}
#settings-page .risk-history-rule-row{
    grid-template-columns:28px minmax(0,1fr) auto;
    padding:9px 10px;
    border:1px solid color-mix(in srgb,var(--border) 82%,transparent);
    border-radius:11px;
    background:var(--surface);
}
#settings-page .risk-history-rule-number{
    width:24px;height:24px;
    display:inline-flex;align-items:center;justify-content:center;
    border-radius:8px;
    background:color-mix(in srgb,var(--primary) 12%,transparent);
    color:var(--primary);
    font-size:.72rem;font-weight:900;
}
#settings-page .risk-history-agent-note{
    direction:rtl;
    display:flex;
    align-items:flex-start;
    gap:8px;
    margin-top:10px;
    padding:8px 10px;
    border-radius:10px;
    background:color-mix(in srgb,var(--muted) 8%,transparent);
    color:var(--muted);
    font-size:.74rem;
    line-height:1.65;
}
#settings-page .risk-history-agent-note i{margin-top:3px;flex:0 0 auto;}
#settings-page .risk-history-master-switch,
#settings-page .risk-history-rule-row .switch{flex:0 0 auto;}
@media(max-width:720px){
    #settings-page .risk-history-control-card{padding:10px;}
    #settings-page .risk-history-rule-list{padding-right:9px;}
    #settings-page .risk-history-rule-row{grid-template-columns:24px minmax(0,1fr) auto;gap:9px;}
}

/* V13.23.98 - Per-rule history scope selector (full history vs checkpoint) */
#settings-page .risk-history-rule-controls{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:10px;
    min-width:220px;
}
#settings-page .risk-history-scope-control{
    display:flex;
    align-items:center;
    gap:7px;
    padding:5px 7px;
    border:1px solid color-mix(in srgb,var(--border) 82%,transparent);
    border-radius:9px;
    background:color-mix(in srgb,var(--surface) 96%,var(--primary) 4%);
    white-space:nowrap;
}
#settings-page .risk-history-scope-control > span{
    color:var(--muted);
    font-size:.68rem;
    font-weight:800;
}
#settings-page .risk-history-scope-control select{
    min-width:112px;
    height:30px;
    padding:3px 8px;
    border-radius:7px;
    border:1px solid var(--border);
    background:var(--surface);
    color:var(--text);
    font-size:.72rem;
    font-weight:800;
}
#settings-page .risk-history-rule-list.is-disabled .risk-history-scope-control{pointer-events:none;}
@media(max-width:860px){
    #settings-page .risk-history-rule-row{grid-template-columns:24px minmax(0,1fr);}
    #settings-page .risk-history-rule-controls{grid-column:2;min-width:0;justify-content:space-between;width:100%;}
    #settings-page .risk-history-scope-control{flex:1;justify-content:space-between;}
    #settings-page .risk-history-scope-control select{min-width:120px;}
}

/* Deposit-only MT5 Balance visibility and negative-balance restoration */
#settings-panel-metatrader .metatrader-deposit-balance-card{
    margin-top:12px;
    padding:12px 14px;
    border:1px solid rgba(100,116,139,.17);
    border-radius:12px;
    background:rgba(100,116,139,.035);
}
#settings-panel-metatrader .metatrader-deposit-balance-card .setting-item.inline{
    align-self:stretch;
    border-radius:8px;
    padding:8px 0;
}
#settings-panel-metatrader .metatrader-deposit-balance-card .hint{
    line-height:1.6;
    white-space:normal;
}
body.dark #settings-panel-metatrader .metatrader-deposit-balance-card{
    border-color:rgba(148,163,184,.16);
    background:rgba(148,163,184,.035);
}
@media(max-width:720px){
    #settings-panel-metatrader .metatrader-deposit-balance-card .settings-grid{
        grid-template-columns:minmax(0,1fr);
    }
}
