/* =========================================================
   إدارة شبكتي — "Mint Ledger" Design System (app.css)
   ---------------------------------------------------------
   سوفت-فاينتك: خلفية ضبابية، بانلات بيضاء عائمة بحواف دائرية
   وظلال ناعمة، لون زمردي/تيل. خط Plex Arabic + أرقام JetBrains Mono.
   ألوان كل لوحة من theme-{admin|merchant}.css
   ========================================================= */

[hidden] { display: none !important; }
html { overflow-x: hidden; }

/* ====== Design Tokens ====== */
:root {
    /* خلفية رمادية محايدة + أسطح بيضاء بحدود 1px (طابع مالي حادّ) */
    --cc-bg: #f5f6f7;
    --cc-surface: #ffffff;
    --cc-surface-2: #f3f4f6;
    --cc-text: #0f172a;
    --cc-text-muted: #64748b;
    --cc-border: #e3e6ea;

    --cc-danger: #dc2626;
    --cc-danger-bg: #fdecec;
    --cc-warning: #d97706;
    --cc-warning-bg: #fdf3e3;
    --cc-success: #0f9d6b;
    --cc-success-bg: #e4f5ee;
    --cc-info: #2f7fd6;
    --cc-info-bg: #e8f1fb;

    /* اللون الأساسي — محجوز للأزرار الرئيسية والحالة النشطة والروابط فقط */
    --cc-primary: #10b981;
    --cc-primary-dark: #059669;
    --cc-primary-glow: rgba(16, 185, 129, 0.10);

    /* ظلال خفيفة جدًا — التعريف الأساسي عبر حدود 1px وليس الظل */
    --sh-xs: 0 1px 1px rgba(15, 23, 42, 0.03);
    --sh-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --sh-md: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px -8px rgba(15, 23, 42, 0.10);
    --sh-lg: 0 2px 6px -2px rgba(15, 23, 42, 0.08), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
    --sh-primary: 0 2px 6px -2px rgba(16, 150, 105, 0.30);

    /* انحناءات أصغر — مظهر حادّ كثيف */
    --r-xs: 8px;
    --r-sm: 10px;
    --r-md: 12px;
    --r-lg: 12px;
    --r-xl: 14px;

    --sidebar-width: 268px;
    --sidebar-gap: 16px;
}

/* ====== Reset + Base ====== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.mono {
    font-family: 'JetBrains Mono', ui-monospace, monospace !important;
    font-feature-settings: "tnum" 1;
    letter-spacing: -0.01em;
}

body {
    background: var(--cc-bg);
    color: var(--cc-text);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    font-weight: 500;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; font-family: inherit; }
img { max-width: 100%; display: block; }

::selection { background: var(--cc-primary-glow); color: var(--cc-primary-dark); }

/* thin soft scrollbars */
* { scrollbar-width: thin; scrollbar-color: #cdddd6 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #cdddd6; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #aecabe; background-clip: content-box; }

/* ====== Sidebar (floating, detached) ====== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--cc-surface);
    position: fixed;
    top: var(--sidebar-gap);
    bottom: var(--sidebar-gap);
    right: var(--sidebar-gap);
    border: 1px solid var(--cc-border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-md);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: visible;
}

.sidebar-header {
    padding: 22px 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
}

.brand-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.brand-logos img {
    height: 46px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    padding: 10px 14px;
    background: var(--cc-surface-2);
    border: 1px solid var(--cc-border);
    border-radius: var(--r-md);
}
.brand-logos .brand-logo-main { height: 46px; }
.brand-logos-sep { display: none; }

.brand-text { text-align: center; width: 100%; min-width: 0; }
.brand-text h2 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--cc-text);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-text span {
    font-size: 9.5px;
    color: var(--cc-primary-dark);
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-top: 5px;
    display: block;
    text-transform: uppercase;
    opacity: 0.9;
}

.close-sidebar {
    position: absolute;
    top: 12px; left: 12px;
    width: 32px; height: 32px;
    border-radius: 10px;
    color: var(--cc-text-muted);
    display: none;
    align-items: center;
    justify-content: center;
}
.close-sidebar:hover { color: var(--cc-danger); background: var(--cc-danger-bg); }

.sidebar-nav {
    padding: 6px 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--cc-text-muted);
    text-transform: uppercase;
    padding: 18px 12px 7px;
    opacity: 0.65;
}
.nav-section-label:first-child { padding-top: 6px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cc-text-muted);
    transition: background 0.2s, color 0.2s, transform 0.2s;
    position: relative;
    margin: 0 2px;
}
.nav-link i { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }
.nav-link > span:first-of-type { flex: 1; }
.nav-link:hover {
    background: var(--cc-surface-2);
    color: var(--cc-text);
}
.nav-link:hover i { opacity: 1; }

.nav-link.active {
    background: linear-gradient(135deg, var(--cc-primary), var(--cc-primary-dark));
    color: #fff;
    font-weight: 700;
    box-shadow: var(--sh-primary);
}
.nav-link.active i { opacity: 1; }

.sidebar-footer { padding: 14px; }

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px;
    border-radius: 14px;
    background: var(--cc-surface-2);
    color: var(--cc-danger);
    font-size: 13.5px;
    font-weight: 700;
    transition: 0.2s;
}
.logout-btn:hover { background: var(--cc-danger-bg); }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 28, 22, 0.45);
    z-index: 999;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

/* ====== Sidebar user block ====== */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px;
    margin-bottom: 10px;
    background: var(--cc-surface-2);
    border: 1px solid var(--cc-border);
    border-radius: 16px;
}
.sidebar-user .user-avatar {
    width: 40px; height: 40px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--cc-primary), var(--cc-primary-dark));
    color: #fff;
    display: grid; place-items: center;
    flex-shrink: 0;
    box-shadow: var(--sh-primary);
}
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-name {
    font-size: 13px; font-weight: 700; color: var(--cc-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
    font-size: 10px; font-weight: 600; color: var(--cc-text-muted);
    letter-spacing: 0.5px; margin-top: 2px;
}

/* ====== Main wrapper (beside floating sidebar) ====== */
.main-wrapper {
    flex: 1;
    margin-right: calc(var(--sidebar-width) + var(--sidebar-gap) * 2);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin 0.3s;
}
.content { padding: 28px 30px 48px; max-width: 1280px; margin: 0 auto; width: 100%; }

/* ====== Mobile Menu FAB ====== */
.mobile-menu-fab {
    display: none;
    position: fixed;
    top: 16px; left: 16px;
    width: 46px; height: 46px;
    border-radius: 15px;
    background: var(--cc-surface);
    color: var(--cc-primary-dark);
    border: 1px solid var(--cc-border);
    box-shadow: var(--sh-md);
    z-index: 95;
    align-items: center;
    justify-content: center;
}
.mobile-menu-fab:hover { background: var(--cc-primary-glow); }

/* ====== Impersonation Banner ====== */
.impersonation-bar {
    background: var(--cc-warning-bg);
    border: 1px solid rgba(217, 138, 31, 0.3);
    border-radius: var(--r-md);
    padding: 13px 18px;
    margin-bottom: 18px;
    box-shadow: var(--sh-sm);
}
.impersonation-bar .imp-inner {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-size: 13px; font-weight: 600; color: #8a5712;
}
.impersonation-bar i { color: var(--cc-warning); flex-shrink: 0; }
.impersonation-bar span { flex: 1; min-width: 200px; }
.impersonation-bar .imp-end-btn {
    background: var(--cc-warning); color: #fff;
    padding: 8px 14px; border-radius: 10px;
    font-weight: 700; font-size: 12px;
    display: inline-flex; align-items: center; gap: 6px;
    transition: 0.2s;
}
.impersonation-bar .imp-end-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* ====== Breadcrumbs ====== */
.breadcrumb {
    display: flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 600;
    color: var(--cc-text-muted); margin-bottom: 14px;
}
.breadcrumb a { color: var(--cc-text-muted); transition: 0.2s; display: inline-flex; align-items: center; gap: 4px; }
.breadcrumb a:hover { color: var(--cc-primary-dark); }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .current { color: var(--cc-primary-dark); font-weight: 700; }

.page-subtitle { font-size: 13px; color: var(--cc-text-muted); font-weight: 500; margin-bottom: 16px; }

/* ====== Page Header ====== */
.page-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    flex-wrap: wrap; gap: 16px; margin-bottom: 26px;
}
.page-header h2 { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 5px; }
.page-header p { color: var(--cc-text-muted); font-size: 13.5px; font-weight: 500; }

/* ====== Stat Cards ====== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--r-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--sh-xs);
    transition: border-color 0.15s, box-shadow 0.15s;
    position: relative;
}
.stat-card:hover { border-color: #d7dce1; box-shadow: var(--sh-sm); }

.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--r-sm);
    background: var(--cc-surface-2);
    color: var(--cc-text-muted);
    display: grid; place-items: center;
    flex-shrink: 0;
    border: 1px solid var(--cc-border);
}
.stat-info h3 { font-size: 12px; color: var(--cc-text-muted); margin-bottom: 4px; font-weight: 600; }
.stat-info p { font-size: 24px; font-weight: 800; color: var(--cc-text); line-height: 1.1; letter-spacing: -0.02em;
    font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: "tnum" 1; }

/* ====== Card Panel ====== */
.card-panel {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--r-lg);
    padding: 16px;
    box-shadow: var(--sh-xs);
    width: 100%;
}
.card-panel + .card-panel { margin-top: 16px; }
.card-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 12px; margin-bottom: 18px;
}
.card-panel-header h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }

/* ====== Tables ====== */
.table-responsive {
    width: 100%; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--r-sm);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 600px; }
th {
    text-align: right;
    padding: 10px 14px;
    background: var(--cc-surface-2);
    color: var(--cc-text-muted);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border-bottom: 1px solid var(--cc-border);
}
th:first-child { border-start-start-radius: var(--r-xs); }
th:last-child  { border-start-end-radius: var(--r-xs); }
td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--cc-border);
    font-size: 13px;
    font-weight: 500;
}
/* الأرقام: خط ثابت + محاذاة لليسار (طابع مالي) */
td.mono, td .mono { font-feature-settings: "tnum" 1; }
tbody tr { transition: background 0.12s; }
tbody tr:hover td { background: var(--cc-surface-2); }
tr:last-child td { border-bottom: 0; }
.empty-row td { text-align: center; color: var(--cc-text-muted); padding: 40px 16px; font-weight: 500; }

/* ====== Empty State ====== */
.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 56px 24px; gap: 14px;
}
.empty-state-icon {
    width: 76px; height: 76px;
    border-radius: 24px;
    background: var(--cc-surface-2);
    color: var(--cc-primary-dark);
    display: grid; place-items: center;
    margin-bottom: 4px;
    border: 1px solid var(--cc-border);
}
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--cc-text); }
.empty-state-desc { font-size: 13px; font-weight: 500; color: var(--cc-text-muted); max-width: 360px; line-height: 1.7; }
.empty-state .btn { margin-top: 8px; }
td .empty-state { padding: 40px 16px; }

/* ====== Badges ====== */
.badge {
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    display: inline-block;
    background: var(--cc-surface-2);
    color: var(--cc-text-muted);
}
.badge-success { background: var(--cc-success-bg); color: #0a7a4f; }
.badge-pending { background: var(--cc-warning-bg); color: #a4640f; }
.badge-failed  { background: var(--cc-danger-bg);  color: #b3271c; }
.badge-info    { background: var(--cc-info-bg);    color: #1f6fad; }
.badge-neutral { background: var(--cc-surface-2);  color: var(--cc-text-muted); }

/* ====== Buttons ====== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 13.5px;
    font-weight: 700;
    transition: transform 0.2s cubic-bezier(0.22,1,0.36,1), box-shadow 0.2s, background 0.2s, filter 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}
.btn-primary {
    background: linear-gradient(135deg, var(--cc-primary), var(--cc-primary-dark));
    color: #fff;
    box-shadow: var(--sh-primary);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.04); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
    background: var(--cc-surface);
    color: var(--cc-text);
    border-color: var(--cc-border);
    box-shadow: var(--sh-xs);
}
.btn-secondary:hover { background: var(--cc-surface-2); transform: translateY(-1px); }
.btn-danger { background: var(--cc-danger); color: #fff; box-shadow: 0 8px 18px -8px rgba(225, 72, 59, 0.6); }
.btn-danger:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-ghost { color: var(--cc-text-muted); }
.btn-ghost:hover { background: var(--cc-surface-2); color: var(--cc-text); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 12.5px; border-radius: 11px; }
.btn-lg { padding: 15px 28px; font-size: 15px; border-radius: 16px; }

/* ====== Icon Action Buttons ====== */
.action-btns { display: flex; gap: 6px; align-items: center; }
.btn-icon {
    width: 37px; height: 37px;
    border-radius: 12px;
    display: grid; place-items: center;
    transition: 0.2s;
    border: 1px solid var(--cc-border);
    background: var(--cc-surface);
    color: var(--cc-text-muted);
}
.btn-icon:hover { transform: translateY(-2px); box-shadow: var(--sh-sm); }
.btn-icon.edit     { color: var(--cc-primary-dark); background: var(--cc-primary-glow); border-color: transparent; }
.btn-icon.delete   { color: var(--cc-danger);  background: var(--cc-danger-bg);   border-color: transparent; }
.btn-icon.suspend  { color: var(--cc-warning); background: var(--cc-warning-bg);  border-color: transparent; }
.btn-icon.activate { color: var(--cc-success); background: var(--cc-success-bg);  border-color: transparent; }
.btn-icon.view     { color: var(--cc-info);    background: var(--cc-info-bg);     border-color: transparent; }

/* ====== Forms ====== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 13px; color: var(--cc-text); }
.form-control,
input[type="text"].form-control,
input[type="number"].form-control,
input[type="password"].form-control,
input[type="email"].form-control,
input[type="url"].form-control,
select.form-control,
textarea.form-control {
    width: 100%;
    padding: 13px 16px;
    border-radius: 14px;
    border: 1px solid var(--cc-border);
    background: var(--cc-surface-2);
    font-size: 14px;
    font-weight: 500;
    color: var(--cc-text);
    outline: none;
    transition: 0.22s;
    font-family: inherit;
}
.form-control:focus {
    border-color: var(--cc-primary);
    background: var(--cc-surface);
    box-shadow: 0 0 0 4px var(--cc-primary-glow);
}
.form-control::placeholder { color: #9fb3aa; font-weight: 500; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 11.5px; color: var(--cc-text-muted); margin-top: 5px; font-weight: 500; line-height: 1.6; }

/* ====== Alerts ====== */
.alert {
    padding: 14px 18px; border-radius: var(--r-md);
    font-size: 13px; font-weight: 600;
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 20px; border: 1px solid transparent;
}
.alert-success { background: var(--cc-success-bg); color: #0a7a4f; border-color: rgba(16,168,111,0.2); }
.alert-danger  { background: var(--cc-danger-bg);  color: #b3271c; border-color: rgba(225,72,59,0.2); }
.alert-warning { background: var(--cc-warning-bg); color: #a4640f; border-color: rgba(217,138,31,0.2); }
.alert-info    { background: var(--cc-info-bg);    color: #1f6fad; border-color: rgba(47,143,214,0.2); }

/* ====== Modals ====== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(8, 28, 22, 0.5);
    z-index: 2000; display: none; place-items: center;
    padding: 20px; backdrop-filter: blur(6px);
}
.modal-overlay.show { display: grid; }
.modal-card {
    background: var(--cc-surface);
    width: 100%; max-width: 540px;
    border-radius: var(--r-xl);
    padding: 28px;
    animation: slideUp 0.4s cubic-bezier(0.22,1,0.36,1);
    box-shadow: var(--sh-lg);
    border: 1px solid var(--cc-border);
    max-height: 90vh; overflow-y: auto;
}
.modal-card.lg { max-width: 740px; }
.modal-card.sm { max-width: 420px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 9px; }
.modal-close { color: var(--cc-text-muted); padding: 6px; border-radius: 9px; }
.modal-close:hover { color: var(--cc-danger); background: var(--cc-danger-bg); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-start; margin-top: 22px; }
@keyframes slideUp {
    from { transform: translateY(24px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ====== Switch (toggle) ====== */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #c3d6cd; transition: 0.3s; border-radius: 26px; }
.switch .slider::before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background: #fff; transition: 0.3s; border-radius: 50%; box-shadow: var(--sh-xs); }
.switch input:checked + .slider { background: var(--cc-primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ====== Filter Chips ====== */
.filters-bar { display: flex; gap: 10px; margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.filters-bar::-webkit-scrollbar { display: none; }
.filter-chip {
    padding: 9px 16px; border-radius: 999px;
    background: var(--cc-surface); border: 1px solid var(--cc-border);
    font-size: 13px; font-weight: 600; color: var(--cc-text-muted);
    white-space: nowrap; transition: 0.2s;
}
.filter-chip:hover { color: var(--cc-text); border-color: #cfe0d8; }
.filter-chip.active { background: var(--cc-primary-glow); color: var(--cc-primary-dark); border-color: transparent; font-weight: 700; }

/* ====== Role Badges ====== */
.role-badge { padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.role-super_admin { background: var(--cc-danger-bg);   color: var(--cc-danger); }
.role-merchant    { background: var(--cc-primary-glow); color: var(--cc-primary-dark); }
.role-provider    { background: var(--cc-warning-bg);   color: var(--cc-warning); }
.role-customer    { background: var(--cc-surface-2);    color: var(--cc-text-muted); }

/* ============== SETTINGS CARD PATTERN ============== */
.s-card {
    background: var(--cc-surface); border: 1px solid var(--cc-border);
    border-radius: var(--r-lg); margin-bottom: 20px; overflow: hidden;
    box-shadow: var(--sh-sm);
}
.s-card-header {
    display: flex; align-items: center; gap: 14px; padding: 16px 20px;
    border-bottom: 1px solid var(--cc-border);
    background: var(--cc-surface-2);
}
.s-card-icon {
    width: 44px; height: 44px; border-radius: var(--r-sm);
    display: grid; place-items: center; flex-shrink: 0;
    border: 1px solid var(--cc-border);
}
/* أيقونات مسطّحة: لون دلالي خفيف على خلفية مكتومة (لا تدرّجات) */
.s-card-icon.blue   { background: var(--cc-info-bg);    color: var(--cc-info); }
.s-card-icon.green  { background: var(--cc-success-bg); color: var(--cc-success); }
.s-card-icon.amber  { background: var(--cc-warning-bg); color: var(--cc-warning); }
.s-card-icon.purple { background: #efe9fb;              color: #7c3aed; }
.s-card-icon.red    { background: var(--cc-danger-bg);  color: var(--cc-danger); }
.s-card-icon.teal   { background: var(--cc-primary-glow); color: var(--cc-primary-dark); }
.s-card-header-text { flex: 1; min-width: 0; }
.s-card-header-text h3 { font-size: 16px; font-weight: 700; color: var(--cc-text); }
.s-card-header-text p  { font-size: 12px; color: var(--cc-text-muted); margin-top: 4px; font-weight: 500; line-height: 1.5; }
.s-card-body   { padding: 20px; }
.s-card-footer { padding: 14px 20px; border-top: 1px solid var(--cc-border); background: var(--cc-surface-2); display: flex; gap: 10px; flex-wrap: wrap; }
.s-row-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .s-row-2 { grid-template-columns: 1fr 1fr; } }

.s-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.s-pill.green { background: var(--cc-success-bg); color: #0a7a4f; }
.s-pill.amber { background: var(--cc-warning-bg); color: #a4640f; }
.s-pill.red   { background: var(--cc-danger-bg); color: var(--cc-danger); }
.s-pill.gray  { background: var(--cc-surface-2); color: var(--cc-text-muted); }
.s-pill.blue  { background: var(--cc-info-bg); color: #1f6fad; }

.s-toggle { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.s-toggle input { opacity: 0; width: 0; height: 0; }
.s-toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #c3d6cd; border-radius: 999px; transition: 0.25s; }
.s-toggle-slider:before { position: absolute; content: ''; height: 20px; width: 20px; top: 3px; right: 3px; border-radius: 50%; background: #fff; transition: 0.25s; box-shadow: var(--sh-xs); }
.s-toggle input:checked + .s-toggle-slider { background: var(--cc-primary); }
.s-toggle input:checked + .s-toggle-slider:before { transform: translateX(-22px); }

.settings-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.settings-tabs {
    background: var(--cc-surface); border: 1px solid var(--cc-border);
    border-radius: var(--r-md); padding: 8px; position: sticky; top: 16px;
    box-shadow: var(--sh-sm);
}
.settings-tab {
    display: flex; align-items: center; gap: 11px; padding: 11px 14px;
    border-radius: 12px; color: var(--cc-text);
    font-weight: 600; font-size: 13.5px; cursor: pointer; transition: 0.18s;
    border: 1px solid transparent;
}
.settings-tab:hover { background: var(--cc-surface-2); }
.settings-tab.active { background: linear-gradient(135deg, var(--cc-primary), var(--cc-primary-dark)); color: #fff; box-shadow: var(--sh-primary); }
.settings-tab i { flex-shrink: 0; opacity: 0.9; }
.settings-tab.active i { opacity: 1; }
.settings-tab-num { margin-inline-start: auto; background: var(--cc-surface-2); color: var(--cc-text-muted); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.settings-tab.active .settings-tab-num { background: rgba(255,255,255,0.25); color: #fff; }
.settings-pane { display: none; }
.settings-pane.active { display: block; animation: paneFade 0.24s ease-out; }
@keyframes paneFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 880px) {
    .settings-layout { grid-template-columns: 1fr; gap: 14px; }
    .settings-tabs { position: static; padding: 4px; display: flex; overflow-x: auto; gap: 4px; }
    .settings-tab { flex-shrink: 0; padding: 9px 14px; font-size: 12.5px; }
    .settings-tab-num { display: none; }
}

/* Period chips */
.period-chips { display: inline-flex; gap: 4px; background: var(--cc-surface-2); padding: 4px; border-radius: 14px; border: 1px solid var(--cc-border); }
.period-chip { padding: 7px 15px; border: 0; background: transparent; color: var(--cc-text-muted); font-weight: 600; font-size: 12px; border-radius: 10px; cursor: pointer; transition: 0.18s; }
.period-chip:hover { color: var(--cc-text); }
.period-chip.active { background: linear-gradient(135deg, var(--cc-primary), var(--cc-primary-dark)); color: #fff; box-shadow: var(--sh-primary); }

/* ============== NAV LINK BADGE ============== */
.nav-link-badge {
    background: var(--cc-danger); color: #fff;
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 999px; font-size: 11px; font-weight: 700;
    display: grid; place-items: center; margin-inline-start: auto;
    animation: navBadgePulse 1.8s ease-in-out infinite;
}
.nav-link.active .nav-link-badge { background: #fff; color: var(--cc-primary-dark); }
.nav-link-badge[hidden] { display: none !important; }
@keyframes navBadgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(225, 72, 59, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(225, 72, 59, 0); }
}

/* ============== NETWORK SWITCHER ============== */
.network-switcher { position: relative; padding: 0 14px 12px; }
.net-current {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 11px 13px; background: var(--cc-surface-2);
    border: 1px solid var(--cc-border); border-radius: 15px;
    color: var(--cc-text); font: inherit; text-align: start; cursor: pointer; transition: 0.18s;
}
.net-current i { color: var(--cc-primary-dark); flex-shrink: 0; }
.net-current:disabled { cursor: default; }
.network-switcher.has-multiple .net-current:hover { border-color: var(--cc-primary); background: var(--cc-primary-glow); }
.net-current-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.net-current-label { font-size: 9.5px; font-weight: 600; color: var(--cc-text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.net-current-name { font-size: 13.5px; font-weight: 700; color: var(--cc-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-current-chev { color: var(--cc-text-muted); transition: 0.2s; }
.network-switcher.open .net-current-chev { transform: rotate(180deg); color: var(--cc-primary); }
.net-menu {
    position: absolute; top: calc(100% - 6px); inset-inline-start: 14px; inset-inline-end: 14px;
    background: var(--cc-surface); border: 1px solid var(--cc-border);
    border-radius: 15px; box-shadow: var(--sh-lg); overflow: hidden; z-index: 50;
    animation: netMenuIn 0.2s ease-out;
}
@keyframes netMenuIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.net-menu-head { padding: 9px 13px 7px; font-size: 10.5px; font-weight: 700; color: var(--cc-text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--cc-border); }
.net-menu-item-form { margin: 0; }
.net-menu-item { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 13px; background: transparent; border: 0; text-align: start; cursor: pointer; font: inherit; color: var(--cc-text); transition: 0.15s; }
.net-menu-item:hover:not(:disabled) { background: var(--cc-surface-2); }
.net-menu-item.active { background: var(--cc-primary-glow); color: var(--cc-primary-dark); font-weight: 700; cursor: default; }
.net-menu-item .net-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.net-menu-item.is-sub { padding-inline-start: 28px; }
.net-menu-item.is-sub::before { content: ''; position: absolute; inset-inline-start: 18px; top: 50%; width: 8px; height: 1px; background: var(--cc-border); }
.net-menu-item .net-item-badge { font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--cc-primary-glow); color: var(--cc-primary-dark); }
.net-menu-item.active .net-item-badge { background: rgba(16,185,129,0.18); }

/* ====== Money amounts ====== */
.amt-gross { font-weight: 700; }
.amt-comm  { color: var(--cc-success); }
.amt-fee   { color: var(--cc-danger); font-size: 12px; opacity: 0.85; }
.amt-net   { color: var(--cc-primary-dark); }

/* ====== Spinner ====== */
@keyframes cc-spin { to { transform: rotate(360deg); } }
.cc-spin { animation: cc-spin 0.8s linear infinite; display: inline-block; }

/* ====== Toasts ====== */
.toast-container { position: fixed; top: 24px; left: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: var(--cc-surface); border: 1px solid var(--cc-border);
    border-inline-start: 4px solid var(--cc-primary);
    padding: 14px 20px; border-radius: 14px; box-shadow: var(--sh-lg);
    display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px;
    animation: toastIn 0.45s cubic-bezier(0.22,1,0.36,1); transition: opacity 0.5s;
}
.toast.danger  { border-inline-start-color: var(--cc-danger); }
.toast.warning { border-inline-start-color: var(--cc-warning); }
.toast.success { border-inline-start-color: var(--cc-success); }
@keyframes toastIn { from { transform: translateX(-110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ====== Page-load stagger (subtle entrance) ====== */
.content > .stats-grid > .stat-card,
.content > .card-panel,
.content > .s-card {
    animation: riseIn 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
.content > .stats-grid > .stat-card:nth-child(1) { animation-delay: 0.03s; }
.content > .stats-grid > .stat-card:nth-child(2) { animation-delay: 0.09s; }
.content > .stats-grid > .stat-card:nth-child(3) { animation-delay: 0.15s; }
.content > .stats-grid > .stat-card:nth-child(4) { animation-delay: 0.21s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ====== Responsive ====== */
@media (max-width: 992px) {
    .sidebar { top: 0; bottom: 0; right: 0; border-radius: 0; transform: translateX(110%); box-shadow: var(--sh-lg); }
    .sidebar.show { transform: translateX(0); }
    .sidebar-overlay.show { opacity: 1; visibility: visible; }
    .close-sidebar { display: flex; }
    .main-wrapper { margin-right: 0; }
    .mobile-menu-fab { display: flex; }
    .content { padding-top: 76px; }
}
@media (max-width: 576px) {
    .stat-card { padding: 18px; border-radius: var(--r-md); }
    .card-panel { padding: 16px; border-radius: var(--r-md); }
    .form-row { grid-template-columns: 1fr; }
    .modal-card { padding: 22px; border-radius: var(--r-lg); }
    .page-header h2 { font-size: 20px; }
}

/* ====================================================================== */
/*  Neutral / sharp financial layer — محايد، حادّ، كثيف. اللون = معنى فقط. */
/* ====================================================================== */

/* --- الشريط الجانبي --- */
.nav-link { letter-spacing: -0.01em; }
.nav-link:hover { background: var(--cc-surface-2); }
.nav-link.active { box-shadow: none; }
/* شريط لمسي قائد على حافة العنصر النشط */
.nav-link.active::before {
    content: ""; position: absolute; top: 8px; bottom: 8px;
    inset-inline-start: 6px; width: 3px; border-radius: 99px;
    background: rgba(255,255,255,.9);
}

/* --- الجداول --- */
/* تمرير أفقي على الشاشات الصغيرة كي لا تُقص أعمدة الإجراءات (إلغاء القيد...) على الجوال */
.table-responsive { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
th { text-transform: none; letter-spacing: 0; }

/* --- الأزرار --- */
.btn-primary { position: relative; }
.btn-icon:hover { border-color: transparent; }

/* --- العناوين --- */
.card-panel-header h2 { display: flex; align-items: center; gap: 8px; }

/* --- الشارات (pills) — حالة بلون دلالي فقط --- */
.badge { font-weight: 700; letter-spacing: -0.005em; }

/* --- أكورديون (خيارات مطويّة تتوسّع عند الضغط) --- */
.acc .acc-head { display:flex; align-items:center; justify-content:space-between; width:100%; background:none; border:0; cursor:pointer; font:inherit; color:var(--cc-text); padding:2px; }
.acc .acc-body { display:none; margin-top:14px; }
.acc.open .acc-body { display:block; }
.acc .acc-chev { transition:transform .2s; color:var(--cc-text-muted); }
.acc.open .acc-chev { transform:rotate(180deg); }

