/* ============================================================
   style.css — TransferPro Premium Dark UI v3
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #080c14;
    --bg2: #0d1220;
    --surface: #111827;
    --surface2: #1a2235;
    --surface3: #212d42;
    --border: rgba(255, 255, 255, 0.08);
    --border2: rgba(255, 255, 255, 0.13);
    --text: #e2e8f7;
    --text2: #94a3b8;
    --muted: #64748b;
    --mtn: #f59e0b;
    --mtn2: #fbbf24;
    --mtn-glow: transparent;
    --syr: #38bdf8;
    --syr2: #7dd3fc;
    --syr-glow: transparent;
    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.15);
    --red: #f43f5e;
    --red-dim: rgba(244, 63, 94, 0.15);
    --blue: #6366f1;
    --blue-dim: rgba(99, 102, 241, 0.2);
    --purple: #a855f7;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.7);
}

body {
    font-family: "Tajawal", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 60px;
    position: relative;
    background-image: radial-gradient(
            ellipse 80% 50% at 50% -10%,
            rgba(99, 102, 241, 0.12),
            transparent
    ),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 100% 100%,
    40px 40px,
    40px 40px;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--surface3);
    border-radius: 3px;
}

/* ══════════════════════════════════════════
   HEADER + DROPDOWN NAV
══════════════════════════════════════════ */
header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(8, 12, 20, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, var(--mtn) 0%, #fb923c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    -webkit-text-fill-color: var(--mtn);
    font-size: 1.15rem;
    margin-inline-end: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.balance-badge {
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.balance-badge strong {
    color: var(--green);
    font-weight: 700;
}

/* ── Dropdown Menu ── */
.nav-menu {
    position: relative;
}

.nav-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 7px 16px;
    border-radius: 22px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.nav-menu-btn:hover,
.nav-menu-btn.open {
    border-color: var(--blue);
    color: var(--text);
    background: var(--blue-dim);
}

.nav-menu-btn .chevron {
    font-size: 0.7rem;
    transition: transform 0.25s;
}

.nav-menu-btn.open .chevron {
    transform: rotate(180deg);
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    min-width: 230px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.22s,
    transform 0.22s;
    z-index: 300;
}

.nav-dropdown.open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--muted);
    text-transform: uppercase;
    padding: 10px 16px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.88rem;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
    border: none;
    background: none;
    font-family: inherit;
    width: 100%;
    text-align: right;
}

.nav-item:hover {
    background: var(--surface3);
    color: var(--text);
}

.nav-item i {
    width: 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.nav-item:hover i {
    color: var(--blue);
}

.nav-item.danger {
    color: #fda4af;
}

.nav-item.danger:hover {
    background: var(--red-dim);
    color: var(--red);
}

.nav-item.danger i {
    color: inherit;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* sub-items for transfer services */
.nav-sub {
    padding-right: 26px;
    font-size: 0.82rem;
}

.nav-sub i {
    font-size: 0.75rem;
}

/* User chip */
.user-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text2);
}

.user-chip .role-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.role-dot.admin {
    background: var(--purple);
    box-shadow: 0 0 6px var(--purple);
}

.role-dot.agent {
    background: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
}

.role-dot.operator {
    background: var(--blue);
    box-shadow: 0 0 6px var(--blue);
}

.nav-items {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.88rem;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
    border: none;
    background: none;
    font-family: inherit;
    width: 100%;
    text-align: right;
}

.nav-items:hover {
    background: var(--surface3);
    color: var(--text);
}

.nav-items:hover i {
    width: 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.nav-items:hover i {
    color: var(--blue);
}

.nav-items.danger {
    color: #fda4af;
}

.nav-items.danger:hover {
    background: var(--red-dim);
    color: var(--red);
}

.nav-items.danger i {
    color: inherit;
}

/* ══════════════════════════════════════════
   TRANSFER SUBMENU داخل القائمة الرئيسية
══════════════════════════════════════════ */

/* زر "خدمات التحويل" الذي يفتح الـ submenu */
.nav-has-sub {
    justify-content: flex-start;
}

.nav-sub-arrow {
    margin-right: auto; /* يدفع السهم لليمين */
    font-size: 0.65rem;
    color: var(--muted);
    transition: transform 0.25s;
    flex-shrink: 0;
}

/* الحاوية المنسدلة الفرعية */
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.18);
    border-top: 1px solid transparent;
}

.nav-submenu.open {
    max-height: 520px; /* أكبر من المحتوى المتوقع */
    border-top-color: var(--border);
}

/* تسميات المجموعة (Syriatel / MTN) */
.nav-sub-group-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 8px 24px 3px;
}

.nav-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface3);
}

.nav-user-info {
    flex: 1;
    min-width: 0;
}

.nav-user-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    word-break: break-word;
}

.nav-user-role {
    font-size: 0.72rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-user-uname {
    color: var(--blue);
    font-weight: 600;
}

/* ── الرصيد في القائمة ── */
.nav-balance-row {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
}

.nav-balance-trigger:hover {
    color: var(--text);
}

.nav-balance-trigger i:first-child {
    color: var(--green);
    font-size: 0.9rem;
}

.nav-balance-reveal {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s,
    opacity 0.25s;
}

.nav-balance-row:hover .nav-balance-reveal {
    max-height: 20px;
    opacity: 1;
}

.nav-balance-reveal strong {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--green);
    letter-spacing: -0.01em;
}

/* ══════════════════════════════════════════
   PROFILE MODAL
══════════════════════════════════════════ */
.profile-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 1.4rem;
}

.profile-modal-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--blue-dim);
    border: 2px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #c7d2fe;
    flex-shrink: 0;
}

.profile-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 1.2rem;
}

.profile-info-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.profile-info-label {
    font-size: 0.72rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-info-label i {
    width: 13px;
    text-align: center;
    color: var(--blue);
}

.profile-info-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

.profile-edit-section {
    border-top: 1px solid var(--border);
    padding-top: 1.1rem;
}

.profile-edit-label {
    font-size: 0.82rem;
    color: var(--text2);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-edit-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.profile-edit-row .input-field {
    flex: 1;
}

/* ══════════════════════════════════════════
   إزالة أسهم أعلى/أسفل من حقول الأرقام
   (يشمل كل input[type=number] في الموقع)
══════════════════════════════════════════ */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
}

/* ══════════════════════════════════════════
   MAIN / PAGE SYSTEM
══════════════════════════════════════════ */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 28px 22px;
    display: none;
}

main.page.active {
    display: block;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.section-title i {
    color: var(--blue);
    text-align: center;
}

/* ══════════════════════════════════════════
   SERVICE LIST (مستطيلات تحت بعضها)
══════════════════════════════════════════ */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s,
    border-color 0.18s,
    box-shadow 0.18s,
    background 0.18s;
}

.service-row::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.25s;
}

.service-row:hover {
    transform: translateX(-3px);
}

.mtn-row:hover {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.1);
}

.syr-row:hover {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.1);
}

/* شعار الشركة (صورة أو أيقونة) */
.company-logo {
    width: 52px;
    height: 52px;
    border-radius: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    display: block;
}

.company-logo::before,
.company-logo::after {
    display: none;
}

.company-logo * {
    background: transparent;
    border: none;
    box-shadow: none;
}

.company-logo img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 0;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

/* fallback icon if no image */
.company-logo .fallback-icon {
    font-size: 1.4rem;
}

.row-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.row-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}

.row-desc {
    font-size: 0.75rem;
    color: var(--muted);
}

.row-badge {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    position: relative;
    z-index: 1;
}

.row-badge.mtn {
    background: transparent;
    color: var(--mtn2);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.row-badge.syr {
    background: transparent;
    color: var(--syr2);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.row-arrow {
    color: var(--muted);
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════
   FORM PANEL
══════════════════════════════════════════ */
.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 8px 18px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    margin-bottom: 22px;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: var(--border2);
    color: var(--text);
    background: var(--surface3);
}

.form-panel-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 540px;
    box-shadow: var(--shadow);
}

.panel-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.panel-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
}

.panel-header p {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 7px;
}

.form-group label i {
    color: var(--blue);
    width: 14px;
}

.input-field {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s,
    box-shadow 0.2s;
    -webkit-appearance: none;
}

.input-field:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-field::placeholder {
    color: var(--muted);
}

select.input-field {
    cursor: pointer;
    padding-left: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
}

select.input-field option {
    background: var(--surface2);
}

/* ── باقات (dropdown select بدلاً من grid) ── */
.units-select-wrap {
    position: relative;
}

.units-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.85rem;
    padding: 10px 14px;
}

/* ── نتيجة ── */
.result-box {
    margin-top: 20px;
    padding: 16px 18px;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
}

.result-box.success {
    background: var(--green-dim);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-box.fail {
    background: var(--red-dim);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.result-box i {
    font-size: 1.3rem;
    margin-top: 1px;
    flex-shrink: 0;
}

.result-box.success i {
    color: var(--green);
}

.result-box.fail i {
    color: var(--red);
}

.error-msg {
    font-size: 0.76rem;
    color: var(--red);
    margin-top: 5px;
    display: block;
}

/* ── Submit ── */
.submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    transition: opacity 0.2s,
    transform 0.12s;
}

.submit-btn:hover {
    opacity: 0.88;
}

.submit-btn:active {
    transform: scale(0.98);
}

.submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.submit-btn.mtn-btn {
    background: linear-gradient(135deg, #d97706, var(--mtn));
    color: #000;
}

.submit-btn.syr-btn {
    background: linear-gradient(135deg, #0284c7, var(--syr));
    color: #fff;
}

/* ══════════════════════════════════════════
   ADMIN – سجل + إحصاء
══════════════════════════════════════════ */
.admin-top {
    display: flex;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-top h2 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-inline-end: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.83rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.action-btn:hover {
    border-color: var(--border2);
    color: var(--text);
    background: var(--surface3);
}

.action-btn.danger:hover {
    border-color: rgba(244, 63, 94, 0.4);
    color: var(--red);
    background: var(--red-dim);
}

.btn-admin-credit {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 7px 16px;
    border-radius: 22px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    justify-content: space-between;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-wrap {
    flex: 1;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: border-color 0.2s;
}

.search-wrap:focus-within {
    border-color: var(--blue);
}

.search-wrap i {
    color: var(--muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.search-wrap input {
    background: none;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text);
    width: 100%;
}

.search-wrap input::placeholder {
    color: var(--muted);
}

.filter-sel {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 9px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.84rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    padding-left: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 8px center;
}

.filter-sel:focus {
    border-color: var(--blue);
}

.filter-sel option {
    background: var(--surface2);
}

/* ── Table ── */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* تحريك بالإصبع على الجوال */
    scroll-behavior: smooth;
    /* ظل يشير للتمرير الأفقي */
    box-shadow: inset -8px 0 8px -4px rgba(0, 0, 0, 0.18),
    inset 8px 0 8px -4px rgba(0, 0, 0, 0.18);
}

/* إزالة الظل عند عدم وجود scroll */
.table-wrap:not([data-scroll]) {
    box-shadow: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    /* عرض أدنى يجبر الجدول على التمرير بدلاً من إخفاء الأعمدة */
    min-width: 720px;
}

thead {
    background: var(--surface2);
    /* ترويسة ثابتة داخل منطقة السكرول */
    position: sticky;
    top: 0;
    z-index: 2;
}

th {
    padding: 11px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-align: right;
    white-space: nowrap;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
    /* عرض أدنى لكل عمود لمنع التضييق الشديد */
    min-width: 80px;
}

th:first-child {
    text-align: center;
    min-width: 40px;
}

td {
    padding: 10px 14px;
    font-size: 0.83rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}

td:first-child {
    text-align: center;
    color: var(--muted);
    font-size: 0.76rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.018);
}

/* مؤشر بصري للتمرير الأفقي على الجوال */
.table-scroll-hint {
    display: none;
    font-size: 0.72rem;
    color: var(--muted);
    padding: 4px 14px 0;
    text-align: center;
    animation: fadeHint 3s ease forwards;
}

@keyframes fadeHint {
    0% {
        opacity: 0.8;
    }
    70% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
    }
}

@media (max-width: 700px) {
    .table-scroll-hint {
        display: block;
    }
}

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge.mtn {
    background: transparent;
    color: var(--mtn2);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge.syr {
    background: transparent;
    color: var(--syr2);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge.ok {
    background: var(--green-dim);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.pending {
    background: var(--orange-dim);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.fail-b {
    background: var(--red-dim);
    color: #fda4af;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge.admin-b {
    background: rgba(168, 85, 247, 0.15);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge.agent-b {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.op-b {
    background: var(--blue-dim);
    color: #c7d2fe;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.empty-state {
    padding: 50px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 2.4rem;
    color: var(--surface3);
    display: block;
    margin-bottom: 14px;
}

.empty-state p {
    color: var(--text2);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.empty-state small {
    color: var(--muted);
    font-size: 0.8rem;
}

/* ══════════════════════════════════════════
   USERS PAGE
══════════════════════════════════════════ */
.users-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.user-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--blue-dim);
    border: 2px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #c7d2fe;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.user-meta {
    font-size: 0.76rem;
    color: var(--muted);
    margin-top: 2px;
}

.user-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ══════════════════════════════════════════
   MODAL
══════════════════════════════════════════ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 28px 26px;
    max-width: 420px;
    width: 93%;
    box-shadow: var(--shadow-lg);
    transform: translateY(-12px);
    transition: transform 0.25s;
    text-align: center;
}

.modal-backdrop.open .modal-box {
    transform: translateY(0);
}

.modal-box.wide {
    max-width: 520px;
    text-align: right;
}

.modal-icon {
    font-size: 2rem;
    color: #fbbf24;
    margin-bottom: 14px;
    display: block;
}

.modal-box h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.modal-box p {
    font-size: 0.85rem;
    color: var(--text2);
    margin-bottom: 22px;
    line-height: 1.6;
}

.modal-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-box.wide .modal-btns {
    justify-content: flex-start;
}

.btn-cancel {
    background: var(--surface3);
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 9px 24px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.18s;
}

.btn-cancel:hover {
    color: var(--text);
    border-color: var(--border2);
}

.btn-confirm {
    background: linear-gradient(135deg, #be123c, var(--red));
    border: none;
    color: #fff;
    padding: 9px 24px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.18s;
}

.btn-confirm:hover {
    opacity: 0.88;
}

.btn-confirm.blue {
    background: linear-gradient(135deg, #4f46e5, var(--blue));
}

/* ══════════════════════════════════════════
   TOAST
══════════════════════════════════════════ */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 300px;
    max-width: 90vw;
    text-align: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

.toast.success {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    border: 1px solid #22d3ee;
    color: #fff;
}

.toast.error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border: 1px solid #f87171;
    color: #fff;
}

/* ══════════════════════════════════════════
   API BAR
══════════════════════════════════════════ */
.api-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 34px;
    background: rgba(8, 12, 20, 0.93);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    font-size: 0.74rem;
    color: var(--muted);
    z-index: 90;
}

.api-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.api-dot.loading {
    background: #fbbf24;
    animation: blink 1s infinite;
}

.api-dot.online {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}

.api-dot.offline {
    background: var(--red);
}

/* ══════════════════════════════════════════
   SPINNER / ANIMATIONS
══════════════════════════════════════════ */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.spinner.dark {
    border-color: rgba(0, 0, 0, 0.2);
    border-top-color: #000;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 640px) {
    header {
        padding: 0 14px;
    }

    .logo span {
        display: none;
    }

    main {
        padding: 18px 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-row > * {
        width: 100%;
    }

    .admin-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-panel-inner {
        padding: 18px 14px;
    }

    .modal-btns {
        flex-direction: column;
    }

    .nav-dropdown {
        left: auto;
        right: 0;
    }
}

/* ══════════════════════════════════════════
   SHAMCASH MODAL STYLES (محسّن جداً)
══════════════════════════════════════════ */
.shamcash-modal {
    max-width: 420px;
    padding: 20px 18px;
}

.shamcash-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.9rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}

.shamcash-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #d8b4fe;
    flex-shrink: 0;
}

.shamcash-header h3 {
    font-size: 0.92rem;
    font-weight: 800;
    margin: 0;
}

.shamcash-header p {
    font-size: 0.7rem;
    color: var(--muted);
    margin: 1px 0 0;
}

/* ── قسم معلومات الحساب + QR ── */
.shamcash-account-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 0.9rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}

/* كود الحساب */
.shamcash-code-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shamcash-code-label {
    font-size: 0.65rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.shamcash-code-label i {
    color: var(--purple);
    font-size: 0.75rem;
}

.shamcash-code-value {
    font-size: 0.7rem;
    font-family: "Courier New", monospace;
    color: var(--text);
    word-break: break-all;
    background: rgba(255, 255, 255, 0.02);
    padding: 5px 7px;
    border-radius: 4px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    font-weight: 500;
    letter-spacing: 0em;
    line-height: 1.2;
}

.shamcash-copy-btn {
    background: linear-gradient(135deg, var(--blue), #818cf8);
    border: none;
    color: #fff;
    padding: 5px 8px;
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: opacity 0.2s,
    transform 0.12s;
    font-weight: 600;
}

.shamcash-copy-btn:hover {
    opacity: 0.88;
}

.shamcash-copy-btn:active {
    transform: scale(0.96);
}

/* صورة QR */
.shamcash-qr-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shamcash-qr-label {
    font-size: 0.65rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.shamcash-qr-label i {
    color: var(--purple);
    font-size: 0.75rem;
}

.shamcash-qr-img-wrap {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 95px;
    overflow: hidden;
}

.shamcash-qr-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 90px;
}

.shamcash-qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--muted);
    text-align: center;
    font-size: 0.65rem;
    line-height: 1.2;
}

.shamcash-qr-placeholder i {
    font-size: 1.3rem;
    opacity: 0.5;
}

/* ── قسم النموذج ── */
.shamcash-form-section {
    margin-bottom: 0.8rem;
}

.shamcash-form-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 5px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.shamcash-form-title i {
    color: var(--purple);
    font-size: 0.85rem;
}

.shamcash-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 4px;
}

.shamcash-label i {
    color: var(--purple);
    width: 11px;
    text-align: center;
    font-size: 0.8rem;
}

/* ── رفع الصورة ── */
.shamcash-upload-wrap {
    background: var(--bg2);
    border: 2px dashed var(--border2);
    border-radius: 7px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color 0.2s,
    background 0.2s;
    min-height: 80px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.shamcash-upload-wrap:hover {
    border-color: var(--purple);
    background: rgba(168, 85, 247, 0.05);
}

.shamcash-upload-wrap.drag {
    border-color: var(--purple);
    background: rgba(168, 85, 247, 0.1);
}

.shamcash-upload-icon {
    font-size: 1.5rem;
    color: var(--purple);
    opacity: 0.7;
}

#scUploadLabel {
    font-size: 0.8rem;
    color: var(--text2);
    text-align: center;
    line-height: 1.3;
}

#scImagePreview {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 6px;
    text-align: center;
}

#scPreviewImg {
    max-height: 85px;
    border-radius: 5px;
    border: 1px solid var(--border);
    object-fit: contain;
}

#scImagePreview button {
    margin-top: 4px;
    padding: 3px 6px;
    background: none;
    border: 1px solid var(--red-dim);
    color: var(--red);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.68rem;
    transition: background 0.2s,
    color 0.2s;
    font-family: inherit;
    font-weight: 500;
}

#scImagePreview button:hover {
    background: var(--red-dim);
    color: #ff6b7a;
}

/* ── رسالة النتيجة ── */
#scResultMsg {
    border-radius: 7px;
    padding: 6px 10px;
    font-size: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 0.6rem !important;
}

#scResultMsg i {
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── تقليل حجم form-group ── */
.shamcash-modal .form-group {
    margin-bottom: 10px;
}

.shamcash-modal .input-field {
    padding: 8px 11px;
    font-size: 0.85rem;
}

/* ── أزرار المودال ── */
.shamcash-modal .modal-btns {
    margin-top: 0.8rem !important;
    gap: 8px;
}

.shamcash-modal .btn-cancel,
.shamcash-modal .btn-confirm {
    padding: 7px 16px !important;
    font-size: 0.82rem !important;
    border-radius: 7px !important;
}

/* ══════════════════════════════════════════
   RESPONSIVE — SHAMCASH
══════════════════════════════════════════ */
@media (max-width: 640px) {
    .shamcash-modal {
        max-width: 95vw;
        padding: 16px 14px;
    }

    .shamcash-account-section {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .shamcash-upload-wrap {
        min-height: 70px;
        padding: 14px 10px;
        border-radius: 10px;
    }

    .shamcash-upload-icon {
        font-size: 1.8rem;
    }

    #scUploadLabel {
        font-size: 0.9rem;
    }

    .shamcash-qr-img-wrap {
        height: 85px;
    }

    .shamcash-header {
        gap: 8px;
    }
}

/* ============================================================
   ADDITIONS TO style.css — Mobile + UX Improvements
   أضف هذا المحتوى في نهاية ملف style.css الموجود
   ============================================================ */

/* ── زر تحويل الرصيد في الهيدر (للإدمن) ── */
.btn-admin-credit {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: linear-gradient(
            135deg,
            rgba(245, 158, 11, 0.15),
            rgba(245, 158, 11, 0.08)
    );
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 9px;
    color: var(--mtn2);
    font-family: "Tajawal", sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-admin-credit:hover {
    background: linear-gradient(
            135deg,
            rgba(245, 158, 11, 0.25),
            rgba(245, 158, 11, 0.15)
    );
    border-color: rgba(245, 158, 11, 0.6);
}

/* ── زر العودة للرئيسية (لكل الصفحات) ── */
.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border2);
    border-radius: 9px;
    color: var(--text2);
    font-family: "Tajawal", sans-serif;
    font-size: 0.82rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.back-home-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

/* ── رصيد المستخدم في الهيدر ── */
.user-balance-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 20px;
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--green);
}

/* ── تحسينات الجوال للهيدر ── */
@media (max-width: 640px) {
    header {
        padding: 0 14px;
        height: 56px;
    }

    .logo {
        font-size: 1rem;
        gap: 7px;
    }

    .logo i {
        font-size: 1rem;
    }

    .nav-menu-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
        gap: 5px;
    }

    .nav-menu-btn .chevron {
        display: none;
    }

    .btn-admin-credit span {
        display: none;
    }

    /* إخفاء النص في الجوال */
    .btn-admin-credit {
        padding: 7px 10px;
    }
}

/* ── تحسين القوائم المنسدلة في الجوال ── */
@media (max-width: 640px) {
    .nav-dropdown {
        position: fixed;
        width: calc(100vw - 20px);
        max-width: 300px;
        left: 10px;
        right: 10px;
        max-height: 70vh;
        overflow-y: auto;
        top: 60px;
    }

    html,
    body {
        overflow-x: hidden;
    }

    body.menu-open {
        overflow: hidden;
    }
}

/* ── تحسين الصفحة الرئيسية في الجوال ── */
@media (max-width: 640px) {
    main {
        padding: 14px 12px;
    }

    .section-title {
        font-size: 0.78rem;
    }

    .service-row {
        padding: 12px 14px;
    }

    .company-logo {
        width: 40px !important;
        height: 40px !important;
        border-radius: 0 !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        overflow: hidden !important;
    }

    .company-logo::before,
    .company-logo::after {
        display: none !important;
    }

    .company-logo img {
        width: 40px !important;
        height: 40px !important;
        object-fit: cover !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        background: transparent !important;
    }

    .row-name {
        font-size: 0.9rem;
    }

    /* نموذج التحويل في الجوال */
    .form-card {
        padding: 16px;
    }

    .service-header {
        font-size: 0.9rem;
        padding: 14px;
    }
}

/* ── الاستاتيستيكس (بطاقات الإحصاء) ── */
@media (max-width: 500px) {
    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stats-row .stat-card:last-child {
        grid-column: 1/-1;
    }
}

/* ── مودال الملف الشخصي (تحسينات) ── */
.profile-services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.profile-svc-tag {
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 7px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--blue2);
}

.profile-svc-none {
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
}

/* ── رصيد المستخدم في مودال الملف الشخصي ── */
.profile-balance-display {
    background: rgba(16, 185, 129, 0.07);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-bottom: 12px;
}

.pbd-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.pbd-val {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--green);
}

.pbd-cur {
    font-size: 0.9rem;
    color: var(--text2);
    margin-right: 5px;
}

/* ── رسالة "رصيدك صفر" ── */
.zero-balance-warn {
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: #fda4af;
    display: none;
    align-items: center;
    gap: 8px;
}

.zero-balance-warn.show {
    display: flex;
}

/* ── تحسين جدول العمليات في الجوال ── */
@media (max-width: 700px) {
    .table-wrap {
        font-size: 0.78rem;
    }

    .table-wrap th,
    .table-wrap td {
        padding: 8px 8px;
    }
}

/* ── API status bar تحسين ── */
@media (max-width: 640px) {
    .api-bar {
        font-size: 0.72rem;
        padding: 0 12px;
    }
}

/* ── تحسين صفحة تغيير كلمة المرور ── */
.change-pw-back {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--blue);
    text-decoration: none;
    font-size: 0.88rem;
    margin-top: 1rem;
    justify-content: center;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    transition: border-color 0.2s;
}

.change-pw-back:hover {
    border-color: var(--blue);
}

/* ══════════════════════════════════════════
   THEME TOGGLE BUTTON
══════════════════════════════════════════ */
.theme-toggle {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text2);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--blue);
    color: var(--text);
    background: var(--surface3);
}

.theme-toggle i {
    font-size: 1rem;
}

/* ══════════════════════════════════════════
   LIGHT THEME
══════════════════════════════════════════ */
[data-theme="light"] {
    --bg: #f0f4f8;
    --bg2: #ffffff;
    --surface: #ffffff;
    --surface2: #f8fafc;
    --surface3: #e2e8f0;
    --border: rgba(0, 0, 0, 0.08);
    --border2: rgba(0, 0, 0, 0.12);
    --text: #1e293b;
    --text2: #475569;
    --muted: #94a3b8;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.1);
    --blue-dim: rgba(99, 102, 241, 0.12);
    --green-dim: rgba(16, 185, 129, 0.12);
    --red-dim: rgba(244, 63, 94, 0.12);
    --mtn-glow: transparent;
    --syr-glow: transparent;
}

[data-theme="light"] body {
    background-image: radial-gradient(
            ellipse 80% 50% at 50% -10%,
            rgba(99, 102, 241, 0.08),
            transparent
    ),
    linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 100% 100%,
    40px 40px,
    40px 40px;
}

[data-theme="light"] header {
    background: rgba(240, 244, 248, 0.95);
    border-bottom-color: var(--border);
}

[data-theme="light"] .service-row:hover {
    transform: translateX(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .modal-backdrop {
    background: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .modal-box {
    background: var(--surface2);
    border-color: var(--border2);
}

[data-theme="light"] .table-wrap,
[data-theme="light"] .stat-card,
[data-theme="light"] .service-row,
[data-theme="light"] .form-panel-inner {
    background: #ffffff;
    border-color: var(--border);
}

[data-theme="light"] .nav-dropdown {
    background: #ffffff;
    border-color: var(--border2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .nav-user-header {
    background: var(--surface3);
}

[data-theme="light"] .api-bar {
    background: rgba(240, 244, 248, 0.95);
    border-top-color: var(--border);
}

[data-theme="light"] .services-empty {
    background: #ffffff;
    border-color: var(--border);
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: var(--bg);
}

/* ══════════════════════════════════════════
   PROFILE PAGE STYLES
══════════════════════════════════════════ */
.profile-page-container {
    max-width: 700px;
    margin: 0 auto;
}

.profile-page-header {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.profile-page-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--blue-dim);
    border: 3px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--blue);
    flex-shrink: 0;
}

.profile-page-user-info {
    flex: 1;
}

.profile-page-user-info h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.profile-page-role {
    display: inline-block;
    background: var(--blue-dim);
    color: var(--blue);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-left: 8px;
}

.profile-page-username {
    color: var(--muted);
    font-size: 0.85rem;
}

.profile-page-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.profile-page-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-page-stat-card i {
    font-size: 1.8rem;
    color: var(--green);
    flex-shrink: 0;
}

.profile-page-stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-page-stat-label {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-page-stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
}

.profile-page-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.profile-page-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-page-section h3 i {
    color: var(--blue);
}

.profile-page-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-page-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text2);
    text-decoration: none;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.profile-page-action-btn:hover {
    border-color: var(--blue);
    color: var(--text);
    background: var(--surface3);
}

.profile-page-action-btn i {
    color: var(--blue);
    width: 20px;
    text-align: center;
}

.profile-page-action-btn.danger {
    border-color: rgba(244, 63, 94, 0.25);
}

.profile-page-action-btn.danger i {
    color: var(--red);
}

.profile-page-action-btn.danger:hover {
    background: var(--red-dim);
    border-color: var(--red);
    color: var(--red);
}

/* ══════════════════════════════════════════
   SHAM CASH PAGE STYLES
══════════════════════════════════════════ */
.shamcash-page-container {
    max-width: 900px;
    margin: 0 auto;
}

.shamcash-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.shamcash-page-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #d8b4fe;
    flex-shrink: 0;
}

.shamcash-page-header h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.shamcash-page-header p {
    font-size: 0.82rem;
    color: var(--muted);
}

.shamcash-page-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 700px) {
    .shamcash-page-grid {
        grid-template-columns: 1fr;
    }
}

.shamcash-page-account-card,
.shamcash-page-form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.shamcash-page-account-card h3,
.shamcash-page-form-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.shamcash-page-account-card h3 i {
    color: var(--purple);
}

.shamcash-page-form-card h3 i {
    color: var(--blue);
}

.shamcash-page-info {
    margin-top: 20px;
}

.shamcash-info-card {
    display: flex;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    align-items: flex-start;
}

.shamcash-info-card i {
    font-size: 1.3rem;
    color: var(--blue);
    flex-shrink: 0;
    margin-top: 2px;
}

.shamcash-info-card strong {
    display: block;
    color: var(--text);
    margin-bottom: 6px;
    font-size: 0.88rem;
}

.shamcash-info-card p {
    color: var(--text2);
    font-size: 0.82rem;
    margin-bottom: 3px;
}

/* Devices dropdown */
.devices-dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 12px;
    min-width: 250px;
    max-width: 320px;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
}

.devices-dropdown-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text2);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.device-item:last-of-type {
    border-bottom: none;
}

.device-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.device-info > i {
    color: var(--blue);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.device-name {
    font-size: 0.82rem;
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.device-type {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 2px;
}

.devices-dropdown-close {
    width: 100%;
    margin-top: 8px;
    padding: 6px;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text2);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.78rem;
}

/* ─────────────────────────────────────────
   جداول الجوال — scroll أفقي بدلاً من إخفاء
   ───────────────────────────────────────── */
/* إلغاء mobile-hide القديمة — الجداول تتمرر الآن */
.mobile-hide {
    display: table-cell;
}

.mobile-hide2 {
    display: table-cell;
}

@media (max-width: 700px) {
    /* جدول المستخدمين */
    #usersBody td,
    #usersBody th {
        padding: 8px 8px;
        font-size: 0.76rem;
    }

    #usersBody td:first-child {
        padding-right: 8px;
    }

    .action-btn {
        padding: 5px 8px;
        font-size: 0.72rem;
    }
}

/* User Services Modal */
.svc-admin-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.svc-admin-group-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.svc-admin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.svc-admin-item:hover {
    border-color: var(--blue);
}

.svc-admin-item.has-service {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.3);
}

.svc-admin-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
}

.svc-admin-checkbox {
    display: none;
}

.svc-admin-checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.svc-admin-checkbox:checked + .svc-admin-checkmark {
    background: var(--blue);
    border-color: var(--blue);
}

.svc-admin-checkbox:checked + .svc-admin-checkmark::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: white;
    font-size: 0.75rem;
}

.svc-admin-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.svc-admin-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--surface3);
    color: var(--muted);
}

.svc-admin-badge.mtn {
    background: rgba(245, 158, 11, 0.15);
    color: var(--mtn);
}

.svc-admin-badge.syr {
    background: rgba(56, 189, 248, 0.15);
    color: var(--syr);
}

@media (max-width: 500px) {
    #userServicesModal .modal-box {
        margin: 10px;
        max-width: calc(100% - 20px) !important;
    }

    .svc-admin-name {
        font-size: 0.82rem;
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .profile-page-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .profile-page-user-info h2 {
        font-size: 1.2rem;
    }

    .profile-page-avatar {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }

    .shamcash-page-header {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }

    .shamcash-page-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }

    .profile-page-stats {
        grid-template-columns: 1fr;
    }

    .devices-dropdown {
        left: auto;
        right: 0;
        min-width: 180px;
    }
}

/* Services loading */
.services-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--muted);
    font-size: 0.9rem;
}

.services-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--border2);
    border-radius: var(--radius);
    margin: 20px 0;
}

.services-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    color: var(--blue);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.services-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 16px 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.services-group-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.service-row.disabled-service {
    opacity: 0.5;
    pointer-events: none;
}

.service-row.inactive-admin {
    opacity: 0.6;
    background: var(--surface);
}

.service-row.inactive-admin::after {
    content: "معطّل";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(244, 63, 94, 0.2);
    color: var(--red);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Notification badge */
.nav-badge {
    background: var(--red);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: auto;
    min-width: 22px;
    text-align: center;
}

/* Header inbox button */
.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text2);
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.header-icon-btn:hover {
    background: var(--surface3);
    color: var(--text);
    border-color: var(--blue);
}

.header-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--red);
    color: #fff;
    padding: 1px 5px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .header-icon-btn {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
}

/* ══════════════════════════════════════════
   DEVICES DROPDOWN MENU
══════════════════════════════════════════ */
.devices-dropdown-menu {
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 12px;
    min-width: 240px;
    max-width: 320px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.btn-danger-sm {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--red);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-danger-sm:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: rgba(244, 63, 94, 0.5);
}

.devices-dropdown-menu .device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.devices-dropdown-menu .device-item:last-child {
    border-bottom: none;
}

.devices-dropdown-menu .device-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.devices-dropdown-menu .device-name {
    font-size: 0.82rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.devices-dropdown-menu .device-meta {
    font-size: 0.68rem;
    color: var(--muted);
    margin-top: 2px;
}

/* ══════════════════════════════════════════
   LOGS PAGE — جداول السجلات (تمرير أفقي كامل)
══════════════════════════════════════════ */
.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    /* عرض أدنى يجبر الجدول على التمرير بدلاً من كسر المحتوى */
    min-width: 700px;
    table-layout: auto;
}

.logs-table thead tr {
    background: var(--surface2, rgba(255, 255, 255, .04));
    /* الترويسة تبقى ظاهرة عند التمرير الرأسي */
    position: sticky;
    top: 0;
    z-index: 3;
}

.logs-table th {
    padding: 10px 12px;
    text-align: right;
    font-weight: 700;
    font-size: 0.74rem;
    color: var(--muted);
    white-space: nowrap; /* منع كسر عناوين الأعمدة */
    border-bottom: 1px solid var(--border);
    background: var(--surface2, rgba(255, 255, 255, .04));
    min-width: 80px; /* حد أدنى لكل عمود */
    letter-spacing: 0.04em;
}

.logs-table td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    vertical-align: middle;
    color: var(--text);
    white-space: nowrap; /* منع كسر محتوى الخلايا */
}

.logs-table tbody tr:last-child td {
    border-bottom: none;
}

.logs-table tbody tr:hover {
    background: rgba(255, 255, 255, .03);
}

.logs-table .empty {
    text-align: center;
    padding: 32px;
    color: var(--muted);
}

.logs-table .empty i {
    display: block;
    font-size: 1.8rem;
    opacity: .2;
    margin-bottom: 8px;
}

/* حاوية الجدول — تمرير أفقي بدون إخفاء أعمدة */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* تلميح التمرير الأفقي على الجوال */
@media (max-width: 768px) {
    .logs-table {
        font-size: 0.78rem;
    }

    .logs-table th,
    .logs-table td {
        padding: 8px 10px;
    }

    /* إشارة بصرية: ظل على الجانب الأيمن يدل على وجود محتوى للتمرير */
    .table-wrap {
        background: linear-gradient(to right, var(--surface, #111827) 20px, transparent 20px),
        linear-gradient(to left, var(--surface, #111827) 20px, transparent 20px),
        radial-gradient(ellipse at left, rgba(0, 0, 0, .25) 0%, transparent 70%),
        radial-gradient(ellipse at right, rgba(0, 0, 0, .25) 0%, transparent 70%);
        background-attachment: local, local, scroll, scroll;
        background-size: 20px 100%, 20px 100%, 12px 100%, 12px 100%;
        background-repeat: no-repeat;
        background-position: left, right, left, right;
        border-radius: 10px;
    }
}
