/* === بوابة الدخول (صلاحية الأدمن فقط) - هوية MaliMor === */
.admin-gate {
    position: fixed;
    inset: 0;
    background: var(--bg-body);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.admin-gate-card {
    width: 100%;
    max-width: 360px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    font-family: var(--font-arabic), 'Cairo', sans-serif;
}
.admin-gate-logo {
    text-align: center;
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 6px;
}
.gate-mali { color: #fff; }
.gate-mor { color: var(--brand-color); }
.admin-gate-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}
.admin-gate-form .admin-gate-input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    color: #fff;
    font-size: 14px;
    margin-bottom: 10px;
    outline: none;
}
.admin-gate-form .admin-gate-input:focus {
    border-color: var(--brand-color);
}
.admin-gate-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--brand-color);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    margin-top: 8px;
}
.admin-gate-btn:hover { background: var(--brand-hover); }
.admin-gate-btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    margin-top: 12px;
}
.admin-gate-msg {
    text-align: center;
    font-size: 12px;
    margin-top: 12px;
    min-height: 18px;
}
.admin-gate-denied {
    text-align: center;
}
.admin-gate-denied p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}
#admin-app-wrap {
    display: flex;
    flex: 1;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    flex-direction: row;
}

/* === هوية MaliMor (مطابقة للمتجر) === */
:root {
    --brand-color: #10b981;
    --brand-hover: #059669;
    --cl-bg: #0f172a;
    --cl-card-dark: #111827;
    --cl-card-navy: #1e293b;
    --cl-card-light: #334155;
    --primary-gold: #10b981;
    --gold: var(--brand-color);
    --primary: var(--brand-color);
    --primary-glow: rgba(16, 185, 129, 0.2);
    --line-color: rgba(16, 185, 129, 0.4);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #162137;
    --border: rgba(255,255,255,0.08);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 14px;
    --shadow-soft: 0 8px 18px rgba(0,0,0,0.28);
    --sidebar-w: clamp(255px, 25vw, 300px);
    --header-h: clamp(56px, 7vw, 72px);
    --page-pad: clamp(12px, 2vw, 18px);
    --gap-sm: clamp(6px, 1vw, 10px);
    --gap-md: clamp(10px, 2vw, 16px);
    --font-arabic: 'Cairo', sans-serif;
    --font-english: 'Roboto', sans-serif;
}

/* Tier Users Page Styles */
#view-tier-users {
    display: none;
    padding: 15px;
    background: var(--bg-body);
}

#view-tier-users.active {
    display: block;
}

.tier-users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.tier-users-header h2 {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-main);
    margin: 0;
}

.tier-users-header button {
    min-width: auto;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 800;
}

.tier-info-card {
    background: linear-gradient(135deg, rgba(255,215,0,0.08), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,215,0,0.25);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.tic-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,215,0,0.12));
    border: 1px solid rgba(255,215,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-color);
    font-size: 22px;
    flex-shrink: 0;
}

.tic-info {
    flex: 1;
    min-width: 0;
}

.tic-info h3 {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-main);
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tier-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
}

.tier-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tier-stats strong {
    color: var(--text-main);
    font-weight: 800;
}

.tier-users-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tier-users-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    border: 1px dashed var(--border);
    border-radius: 16px;
    font-weight: 700;
}

.tier-users-empty i {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.5;
    display: block;
}

.tier-users-empty h3 {
    font-size: 16px;
    font-weight: 900;
    color: var(--text-main);
    margin: 0 0 8px 0;
}

.tier-users-empty p {
    font-size: 13px;
    margin: 0;
    opacity: 0.8;
}

.tier-users-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tier-user-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tier-user-card:hover {
    border-color: rgba(255,215,0,0.35);
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.tuc-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tuc-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,215,0,0.12));
    border: 1px solid rgba(255,215,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-color);
    font-size: 20px;
    font-weight: 900;
    flex-shrink: 0;
}

.tuc-info {
    flex: 1;
    min-width: 0;
}

.tuc-info h4 {
    font-size: 15px;
    font-weight: 900;
    color: var(--text-main);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-id {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'Chakra Petch', monospace;
}

.tuc-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-item {
    flex: 1;
    min-width: 100px;
    text-align: center;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    display: block;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 14px;
    font-weight: 900;
    color: var(--text-main);
    display: block;
}

.stat-value.urgent {
    color: var(--danger);
    animation: pulse 1.5s infinite;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.3);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-color), #fcd34d);
    transition: width 0.3s ease;
}

.tuc-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.tuc-actions button {
    flex: 1;
    min-width: auto;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 8px;
}

.tuc-actions button i {
    font-size: 11px;
    margin-left: 4px;
}

/* Light mode adjustments */
.light-mode #view-tier-users {
    background: #f4f6f9;
}

.light-mode .tier-info-card {
    background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(255,255,255,0.03));
    border-color: rgba(16,185,129,0.25);
}

.light-mode .tic-icon-box {
    background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(16,185,129,0.12));
    border-color: rgba(16,185,129,0.3);
    color: var(--brand-color);
}

.light-mode .tier-user-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border-color: rgba(0,0,0,0.08);
}

.light-mode .tuc-avatar {
    background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(16,185,129,0.12));
    border-color: rgba(16,185,129,0.3);
    color: var(--brand-color);
}

.light-mode .progress-fill {
    background: linear-gradient(90deg, var(--brand-color), #34d399);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tier-users-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .tier-info-card {
        flex-direction: column;
        text-align: center;
    }

    .tier-stats {
        justify-content: center;
    }

    .stats-row {
        flex-direction: column;
        gap: 8px;
    }

    .stat-item {
        text-align: center;
    }

    .tuc-actions {
        flex-direction: column;
        gap: 8px;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Light mode - هوية MaliMor */
body.light-mode {
    --primary-gold: #059669;
    --gold: var(--brand-hover);
    --primary: var(--brand-color);
    --primary-glow: rgba(16, 185, 129, 0.15);
    --line-color: rgba(16, 185, 129, 0.4);
    --text-main: #1a1e29;
    --text-muted: #5f6368;
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --bg-hover: #eef1f6;
    --border: rgba(0,0,0,0.08);
    --shadow-soft: 0 6px 16px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; font-family: var(--font-arabic), 'Cairo', sans-serif; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg-body); color: var(--text-main); height: 100vh; height: 100dvh; overflow: hidden; display: flex; font-size: clamp(12px, 1vw + 10px, 14px); transition: background-color 0.25s ease, color 0.25s ease; padding-bottom: 0 !important; }
.num-en { font-family: 'Segoe UI', sans-serif; direction: ltr; display: inline-block; font-weight: 700; }

.val-gold { color: var(--brand-color) !important; font-weight: 900; }
.light-mode .val-gold { color: var(--brand-hover) !important; }
.val-neg { color: #f43f5e; font-weight: 700; }

/* === Sidebar === */
.sidebar-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.8); z-index:1000; display:none; backdrop-filter: blur(4px); opacity:0; transition:0.3s; }
.sidebar-overlay.active { display:block; opacity:1; }

.sidebar { width: var(--sidebar-w); max-width: 280px; background: #111827; border-left: 1px solid var(--border); display: flex; flex-direction: column; z-index: 1001; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); flex-shrink: 0; position: relative; }
/* Override store.css defaults that hide the sidebar */
.sidebar { visibility: visible; pointer-events: auto; transform: none; }
.sidebar::before {
    content: "";
    position: absolute;
    top: 10%;
    bottom: 10%;
    left: -1px;
    width: 0.25px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(16, 185, 129, 0.2) 15%,
        #10b981 50%,
        rgba(16, 185, 129, 0.2) 85%,
        transparent 100%
    );
    pointer-events: none;
}
.light-mode .sidebar { background: #ffffff; border-left: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.light-mode .sidebar::before {
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(16, 185, 129, 0.15) 15%,
        #059669 50%,
        rgba(16, 185, 129, 0.15) 85%,
        transparent 100%
    );
}

.sb-profile { padding: 30px 20px 20px; background: #111827; border-bottom: 1px solid var(--border); text-align: center; }
.sb-avatar-wrap { position: relative; width: 70px; height: 70px; margin: 0 auto 10px; }
.sb-avatar { width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--primary); overflow: hidden; }
.sb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sb-name { font-weight: 800; font-size: 16px; color: #fff; margin-bottom: 2px; }
.sb-role { font-size: 11px; color: var(--brand-color); background: rgba(16,185,129,0.12); padding: 2px 10px; border-radius: 12px; }

.nav-menu { flex: 1; padding: 15px; overflow-y: auto; }
.nav-group-title { font-size: 11px; font-weight: 800; color: rgba(255,255,255,0.3); text-transform: uppercase; margin: 20px 10px 8px; letter-spacing: 1px; display: flex; align-items: center; gap: 5px; }
.nav-group-title::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.05); }
.light-mode .nav-group-title { color: rgba(0,0,0,0.4); }
.light-mode .nav-group-title::after { background: rgba(0,0,0,0.06); }

.nav-item { 
    padding: 10px 12px; border-radius: 10px; color: var(--text-muted); cursor: pointer; 
    display: flex; align-items: center; gap: 10px; font-weight: 600; transition: 0.2s; 
    margin-bottom: 3px;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    min-width: 0;
    font-size: 13px;
}
.nav-item:hover { background: var(--bg-hover); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(16,185,129,0.12), transparent); color: var(--brand-color); border-right: 3px solid var(--brand-color); }
.light-mode .nav-item { color: var(--text-muted); }
.light-mode .nav-item:hover { background: rgba(0,0,0,0.04); color: var(--text-main); }
.light-mode .nav-item.active { background: linear-gradient(90deg, rgba(16,185,129,0.1), transparent); color: var(--brand-color); border-right-color: var(--brand-color); }
.nav-item i { 
    font-size: 17px; 
    width: 24px;
    text-align: center; 
    color: var(--brand-color);
    opacity: 0.95;
}
.badge-count { margin-right: auto; background: var(--danger); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 6px; font-weight: bold; display:none; animation: pulse 2s infinite; }
.badge-count.active { display:block; }

/* === Master Sidebar (MaliMor) === */
.sidebar-master { display: flex; flex-direction: column; }
.sidebar-master .brand-box {
    height: 72px; display: flex; align-items: center; gap: 12px;
    padding: 0 20px; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar-master .brand-icon {
    width: 40px; height: 40px; background: var(--brand-color);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px;
}
.sidebar-master .brand-text { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: 0.5px; }
.sidebar-master .sidebar-scroll { flex: 1; overflow-y: auto; padding: 16px 12px; }
.sidebar-master .sidebar-scroll::-webkit-scrollbar { width: 5px; }
.sidebar-master .sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.sidebar-master .menu-header {
    font-size: 11px; font-weight: 700; color: var(--text-muted);
    margin: 14px 10px 8px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.8;
}
.sidebar-master .nav-item { margin-bottom: 4px; cursor: default; padding: 0; border-radius: 0; }
.sidebar-master .nav-item:hover { background: transparent; color: inherit; }
.sidebar-master .nav-link {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 14px; border-radius: 10px; color: var(--text-muted);
    cursor: pointer; transition: 0.2s; font-size: 13px; font-weight: 600;
}
.sidebar-master .nav-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-master .nav-item.active .nav-link {
    background: rgba(16,185,129,0.15); color: var(--brand-color); font-weight: 700;
    border-right: 3px solid var(--brand-color);
}
.sidebar-master .nav-left { display: flex; align-items: center; gap: 10px; }
.sidebar-master .nav-icon { width: 20px; text-align: center; font-size: 14px; color: var(--brand-color); }
.sidebar-master .badge { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.sidebar-master .badge.bg-danger { background: var(--danger); color: #fff; }
.sidebar-master .badge.bg-info { background: rgba(59, 130, 246, 0.25); color: #60a5fa; }
.sidebar-master #badge-dep:not(.active),
.sidebar-master #badge-ord:not(.active) { display: none; }
.sidebar-master #badge-dep.active,
.sidebar-master #badge-ord.active { display: inline-block; }
.sidebar-master .arrow-icon { transition: transform 0.25s; color: var(--text-muted); }
.sidebar-master .submenu { display: none; padding-right: 32px; margin-top: 4px; list-style: none; }
.sidebar-master .submenu-item {
    padding: 8px 10px; font-size: 12px; color: var(--text-muted);
    border-radius: 8px; cursor: pointer; display: block; position: relative; margin-bottom: 2px;
}
.sidebar-master .submenu-item:hover { color: var(--brand-color); }
.sidebar-master .submenu-item::before {
    content: ''; position: absolute; right: -14px; top: 50%; width: 5px; height: 5px;
    border-radius: 50%; background: rgba(255,255,255,0.15); transform: translateY(-50%);
}
.sidebar-master .submenu-item:hover::before { background: var(--brand-color); }
.sidebar-master .nav-item.open .submenu { display: block; animation: slideDown 0.25s ease; }
.sidebar-master .nav-item.open .arrow-icon { transform: rotate(-180deg); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.sidebar-master .mini-profile {
    padding: 14px 16px; border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.2); flex-shrink: 0;
}
.sidebar-master .mp-content { display: flex; align-items: center; gap: 10px; }
.sidebar-master .mp-img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--brand-color); object-fit: cover; }
.sidebar-master .mp-info { flex: 1; min-width: 0; }
.sidebar-master .mp-info h4 { margin: 0; font-size: 13px; color: #fff; font-weight: 700; }
.sidebar-master .mp-info span { font-size: 11px; color: var(--text-muted); }
.sidebar-master .mp-logout { color: var(--danger); cursor: pointer; padding: 6px; font-size: 14px; }
.sidebar-master .mp-logout:hover { opacity: 0.9; }

/* === Main Content === */
.main-content { flex: 1; display: flex; flex-direction: column; position: relative; width: 100%; min-height: 0; overflow: hidden; }
.header { height: var(--header-h); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--page-pad); background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px); z-index: 90; flex-shrink: 0; }
.light-mode .header { background: rgba(255,255,255,0.9); border-bottom: 1px solid var(--border); color: var(--text-main); }
.header-left { display:flex; align-items:center; gap:15px; }
.menu-toggle { display: none; font-size: 22px; cursor: pointer; color: #fff; padding:5px; }
.header-title { font-size: 16px; font-weight: 800; }

.head-profile { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.05); padding: 5px 10px; border-radius: 30px; cursor: pointer; border: 1px solid var(--border); }
.head-img { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; border: 1px solid var(--primary); flex-shrink: 0; }
.head-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.head-info { font-size: 11px; font-weight: 700; display: none; }
@media(min-width: 768px) { .head-info { display: block; } }

.workspace { 
    flex: 1; 
    overflow-y: auto; 
    overflow-x: hidden;
    padding: var(--page-pad); 
    padding-bottom: clamp(60px, 10vh, 100px); 
    -webkit-overflow-scrolling: touch; 
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    position: relative;
    min-height: 0;
    background: transparent;
}
.light-mode .workspace { background: #f4f6f9; }
.section { display: none; animation: slideUp 0.3s ease-out; }
.section.active { display: block; }
#view-notifs { min-height: auto; position: relative; }

/* === Dashboard (MaliMor) === */
.dash-view { padding: 0; display: flex; flex-direction: column; gap: 24px; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.welcome-text h2 { font-size: 20px; font-weight: 700; margin: 0 0 4px; color: #fff; }
.welcome-text p { color: var(--text-muted); font-size: 13px; margin: 0; }
.header-actions { display: flex; gap: 12px; align-items: center; }
.icon-btn {
    width: 44px; height: 44px; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 18px;
    cursor: pointer; transition: 0.25s; position: relative;
}
.icon-btn:hover { color: var(--brand-color); border-color: rgba(16,185,129,0.3); }
.badge-dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid var(--bg-card); }
.dash-btn-primary {
    background: var(--brand-color); border: none; padding: 10px 18px; border-radius: 10px;
    font-weight: 700; color: #fff; cursor: pointer; display: flex; align-items: center; gap: 8px;
    font-size: 13px; transition: 0.25s;
}
.dash-btn-primary:hover { background: var(--brand-hover); transform: translateY(-1px); }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.kpi-card {
    background: var(--bg-card); border-radius: 16px; padding: 20px; border: 1px solid var(--border);
    display: flex; flex-direction: column; justify-content: space-between; min-height: 140px;
    position: relative; overflow: hidden; cursor: pointer; transition: 0.25s;
}
.kpi-card:hover { transform: translateY(-4px); border-color: rgba(16,185,129,0.35); }
.kpi-head { display: flex; justify-content: space-between; align-items: flex-start; z-index: 2; }
.kpi-icon {
    width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.kpi-trend { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 20px; }
.trend-wait { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.kpi-body { z-index: 2; }
.kpi-val { font-size: 24px; font-weight: 800; color: #fff; display: block; margin-bottom: 4px; }
.kpi-label { font-size: 12px; color: var(--text-muted); }
.kpi-bg-icon { position: absolute; bottom: -15px; left: -15px; font-size: 80px; opacity: 0.06; transform: rotate(12deg); z-index: 1; }
.kpi-rev .kpi-icon { background: rgba(16,185,129,0.15); color: var(--brand-color); }
.kpi-ord .kpi-icon { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.kpi-usr .kpi-icon { background: rgba(16,185,129,0.12); color: var(--brand-color); }
.kpi-pen .kpi-icon { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 900px) { .dashboard-grid { grid-template-columns: 2fr 1fr; } }
.section-card {
    background: var(--bg-card); border-radius: 16px; padding: 20px; border: 1px solid var(--border);
}
.dash-view .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; border: none; padding: 0; }
.dash-view .card-title { font-size: 15px; font-weight: 700; color: #fff; }
.card-action { font-size: 12px; color: var(--brand-color); cursor: pointer; }
.card-action:hover { text-decoration: underline; }

.chart-container {
    height: 220px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
    padding-top: 16px; border-bottom: 1px solid var(--border);
}
.chart-col {
    flex: 1; background: rgba(255,255,255,0.06); border-radius: 8px 8px 0 0;
    position: relative; transition: 0.25s; min-height: 20px;
}
.chart-col:hover { background: var(--brand-color); }
.col-val { position: absolute; top: -22px; width: 100%; text-align: center; font-size: 11px; color: #fff; opacity: 0; transition: 0.25s; }
.chart-col:hover .col-val { opacity: 1; }
.col-label { position: absolute; bottom: -22px; width: 100%; text-align: center; font-size: 10px; color: var(--text-muted); }

.recent-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.recent-table th { text-align: right; font-size: 11px; color: var(--text-muted); padding: 10px 0; border-bottom: 1px solid var(--border); }
.recent-table td { padding: 12px 0; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 12px; }
.recent-table tr:last-child td { border-bottom: none; }
.prod-mini { display: flex; align-items: center; gap: 10px; }
.pm-icon { width: 36px; height: 36px; border-radius: 8px; background: rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--brand-color); }
.pm-info h5 { font-size: 13px; margin: 0; color: #fff; }
.pm-info span { font-size: 10px; color: var(--text-muted); }
.status-dot { padding: 4px 10px; border-radius: 15px; font-size: 10px; font-weight: 700; }
.st-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.st-wait { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.st-reject { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.dash-recent-empty { text-align: center; padding: 24px; color: var(--text-muted); font-size: 13px; }

/* === Cards === */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: clamp(12px, 2vw, 18px); margin-bottom: var(--gap-md); position: relative; overflow: hidden; box-shadow: var(--shadow-soft); }
.light-mode .card { background: #ffffff; border: 1px solid var(--border); box-shadow: var(--shadow-soft); color: var(--text-main); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.card-title { font-size: 14px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 8px; }

/* Ticker Preview */
.ticker-preview { background: #000; height: 50px; border-radius: 8px; border: 2px solid #334155; display: flex; flex-direction: column; justify-content: center; align-items: center; overflow: hidden; margin-bottom: 15px; position: relative; box-shadow: inset 0 0 15px #000; }
.light-mode .ticker-preview { background: #f8fafc; border-color: rgba(0,0,0,0.06); box-shadow: inset 0 0 8px rgba(0,0,0,0.04); }
.ticker-preview::before { content:'LIVE VIEW'; position:absolute; top:2px; left:5px; font-size:8px; color:#444; font-weight:bold; letter-spacing:1px; z-index: 2; }
.tp-text { white-space: nowrap; color: var(--warning); font-size: 14px; font-weight: 700; text-align: center; width: 100%; display:block; }
/* Enhanced live preview */
.ticker-preview {
    height: 60px;
    background: radial-gradient(circle at 50% 40%, rgba(255,255,255,0.04), transparent 55%), linear-gradient(135deg, rgba(17,24,39,0.92), rgba(15,23,42,0.88));
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 24px rgba(0,0,0,0.35), inset 0 0 18px rgba(0,0,0,0.5);
}
.light-mode .ticker-preview {
    background: radial-gradient(circle at 50% 40%, rgba(0,0,0,0.02), transparent 55%), linear-gradient(135deg, #ffffff, #f5f7fb);
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 8px 18px rgba(0,0,0,0.08), inset 0 0 10px rgba(0,0,0,0.04);
}
.ticker-preview::before {
    content:'LIVE VIEW';
    top:6px;
    left:10px;
    font-size:9px;
    color: var(--brand-color);
    opacity: 0.9;
    /* بدون glow - دستور MaliMor */
}
.light-mode .ticker-preview::before {
    color: var(--brand-color);
}
.tp-text {
    font-size: 15px;
    font-weight: 800;
}

/* Ticker animations (live preview) */
.ticker-preview { position: relative; overflow: hidden; }
.tp-text { display: inline-block; }
.anim-vertical-slow { animation: ticker-vertical 12s linear infinite; }
.anim-vertical-normal { animation: ticker-vertical 9s linear infinite; }
.anim-vertical-fast { animation: ticker-vertical 6s linear infinite; }
.anim-pulse { animation: ticker-pulse 1.6s ease-in-out infinite; }
.anim-flash { animation: ticker-flash 1s steps(2, end) infinite; }
.anim-none { animation: none; }

@keyframes ticker-vertical {
    0% { transform: translateY(120%); }
    100% { transform: translateY(-120%); }
}
@keyframes ticker-pulse {
    0%,100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.04); opacity: 0.82; }
}
@keyframes ticker-flash {
    0% { opacity: 1; }
    50% { opacity: 0.2; }
    100% { opacity: 1; }
}

/* Ads section typography boost */
.ads-card .card-title {
    font-size: 16px;
    font-weight: 900;
    gap: 8px;
}

/* Inputs & Buttons */
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 5px; }
.form-input { width: 100%; background: #141b2d; border: 1px solid var(--border); border-radius: 10px; padding: 12px 15px; color: #fff; font-size: 13px; transition: 0.2s; }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(16,185,129,0.25); }
.light-mode .form-input { background: #ffffff; border: 1px solid rgba(0,0,0,0.1); color: var(--text-main); }
.light-mode .form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(16,185,129,0.25); }
#promo-text { font-size: 14px; font-weight: 800; }
.form-input:disabled { opacity: 0.5; cursor: not-allowed; }

/* Payment Details Repeater */
.pay-detail-add { 
    display: flex; 
    gap: 10px; 
    align-items: flex-start; 
    margin-top: 8px; 
}
.pay-detail-add textarea {
    flex: 1;
    min-height: 100px;
    resize: vertical;
    font-size: 13px;
    line-height: 1.6;
}
.pay-detail-list { 
    margin-top: 10px; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    max-height: 350px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}
.pay-det-item { 
    display: flex; 
    align-items: flex-start; 
    gap: 12px; 
    background: rgba(255,255,255,0.04); 
    border: 1px solid rgba(255,255,255,0.08); 
    padding: 14px; 
    border-radius: 12px; 
    font-size: 13px; 
    color: #e2e8f0; 
    transition: all 0.2s ease;
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.6;
}
.pay-det-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,215,0,0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.pay-det-item button { 
    padding: 8px 12px; 
    min-height: 36px; 
    flex-shrink: 0;
    font-size: 11px;
}
.pay-det-empty { 
    font-size: 12px; 
    color: var(--text-muted); 
    background: rgba(255,255,255,0.02); 
    border: 1px dashed rgba(255,255,255,0.1); 
    padding: 24px; 
    border-radius: 12px; 
    text-align: center; 
}
.pay-det-empty i {
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.5;
    display: block;
}
.light-mode .pay-det-item { 
    background: #ffffff; 
    border: 1px solid rgba(0,0,0,0.1); 
    color: var(--text-main); 
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); 
}
.light-mode .pay-det-item:hover {
    background: #f8f9fa;
    border-color: rgba(16,185,129,0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.light-mode .pay-det-empty { 
    background: #f8f9fa; 
    border: 1px dashed rgba(0,0,0,0.15); 
    color: var(--text-muted); 
}
.light-mode .pay-detail-list {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.08);
}

/* Payment Modal Layout */
.pay-modal { max-width: 960px; }
.pay-modal-header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:16px; }
.pay-modal-title { font-size:18px; font-weight:900; color:var(--text-main); }
.pay-modal-subtitle { font-size:12px; color:var(--text-muted); margin-top:4px; line-height:1.6; }
.pay-modal-hint { display:flex; align-items:center; gap:8px; background:rgba(59,130,246,0.08); color:#93c5fd; padding:8px 10px; border-radius:10px; border:1px solid rgba(59,130,246,0.18); font-size:11px; }
.pay-modal-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:14px; }
.pay-modal-section { background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.05); border-radius:12px; padding:12px; display:flex; flex-direction:column; gap:10px; }
.pay-section-wide { grid-column:1/-1; }
.pay-legend { font-size:12px; font-weight:800; color:var(--brand-color); display:flex; align-items:center; gap:6px; }
.pay-upload-card { background:rgba(255,255,255,0.02); border:1px dashed rgba(255,255,255,0.15); border-radius:12px; padding:12px; cursor:pointer; transition:0.2s; }
.pay-upload-card:hover { border-color:rgba(16,185,129,0.35); box-shadow:0 6px 14px rgba(0,0,0,0.2); }
.pay-upload-preview { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-height:120px; color:var(--text-muted); position:relative; }
.pay-upload-preview img { max-height:120px; object-fit:contain; }
.pay-upload-preview .remove-img-btn { top:10px; right:10px; background:rgba(0,0,0,0.6); }
.pay-switch-row { display:flex; align-items:center; justify-content:space-between; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.06); padding:10px; border-radius:12px; }
.pay-switch-title { font-weight:800; font-size:12px; color:var(--text-main); }
.pay-switch-desc { font-size:11px; color:var(--text-muted); }
.pay-currency-chips { display:flex; gap:10px; flex-wrap:wrap; }
.pay-curr-chip { display:flex; align-items:center; gap:6px; padding:8px 12px; border-radius:10px; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08); font-size:12px; cursor:pointer; }
.pay-curr-chip input { accent-color:var(--brand-color); }
.pay-currency-settings { background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.06); border-radius:12px; padding:10px; margin-top:6px; }
.pay-settings-title { font-size:11px; font-weight:800; color:var(--text-main); display:flex; gap:6px; align-items:center; margin-bottom:8px; }
.pay-settings-list { display:flex; flex-direction:column; gap:12px; }
.pay-modal-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:14px; }

@media (max-width: 640px) {
    .pay-modal-grid { grid-template-columns:1fr; }
    .pay-modal-actions { grid-template-columns:1fr; }
}

/* New Pro Payment Modal */
.pay-modal-pro { max-width: 1000px; }
.pay-pro-header { display:flex; flex-direction:column; gap:14px; margin-bottom:16px; }
.pay-pro-title h3 { margin:2px 0 0; font-size:20px; font-weight:900; color:var(--text-main); }
.pay-pro-title p { margin:4px 0 0; color:var(--text-muted); font-size:13px; line-height:1.7; }
.pay-pro-badge { display:inline-flex; align-items:center; gap:8px; padding:6px 12px; border-radius:999px; background:rgba(16,185,129,0.12); color:var(--brand-color); border:1px solid rgba(16,185,129,0.35); font-weight:800; font-size:12px; }
.pay-pro-hero { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:10px; }
.pay-pro-hero-item { display:flex; gap:10px; padding:10px 12px; border-radius:12px; background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.06); box-shadow:0 8px 18px rgba(0,0,0,0.18); }
.pay-pro-hero-item .icon { width:34px; height:34px; border-radius:10px; background:rgba(16,185,129,0.16); display:flex; align-items:center; justify-content:center; color:var(--brand-color); }
.pay-pro-hero-item .label { font-weight:900; font-size:13px; color:var(--text-main); }
.pay-pro-hero-item .hint { font-size:11px; color:var(--text-muted); }
.pay-pro-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:12px; margin-bottom:12px; }
.pay-pro-card { background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.06); border-radius:14px; padding:12px; box-shadow:0 10px 20px rgba(0,0,0,0.18); display:flex; flex-direction:column; gap:10px; }
.pay-pro-card-wide { grid-column:1/-1; }
.pay-pro-card-head { font-weight:900; color:var(--text-main); display:flex; align-items:center; gap:8px; font-size:13px; }
.pay-pro-upload { border:1px dashed rgba(255,255,255,0.14); border-radius:12px; padding:10px; background:rgba(255,255,255,0.02); cursor:pointer; transition:0.2s; }
.pay-pro-upload:hover { border-color:rgba(16,185,129,0.4); box-shadow:0 8px 18px rgba(0,0,0,0.2); }
.pay-pro-upload-box { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:140px; position:relative; color:var(--text-muted); }
.pay-pro-upload-box img { max-height:140px; object-fit:contain; }
.pay-pro-upload-box .remove-img-btn { top:10px; right:10px; background:rgba(0,0,0,0.65); }
.pay-pro-switch { display:flex; align-items:center; justify-content:space-between; padding:10px; border-radius:12px; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.06); }
.pay-pro-switch .title { font-weight:800; font-size:12px; color:var(--text-main); }
.pay-pro-switch .desc { font-size:11px; color:var(--text-muted); }
.pay-pro-currs { display:flex; gap:10px; flex-wrap:wrap; }
.pay-pro-chip { display:flex; align-items:center; gap:6px; padding:8px 12px; border-radius:12px; background:linear-gradient(135deg, rgba(255,215,0,0.14), rgba(255,255,255,0.05)); border:1px solid rgba(255,255,255,0.12); font-size:12px; cursor:pointer; box-shadow:0 8px 16px rgba(0,0,0,0.18); }
.pay-pro-chip input { accent-color:var(--brand-color); }
.pay-pro-settings { background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.08); border-radius:12px; padding:10px; }
.pay-pro-settings-head { font-size:12px; font-weight:900; color:var(--text-main); display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.pay-pro-detail-add { display:flex; gap:10px; align-items:flex-start; }
.pay-pro-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:14px; }

/* Currency settings cards */
.currency-settings-card {
    background: linear-gradient(135deg, rgba(255,215,0,0.08) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid rgba(255,215,0,0.25);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.18);
}
.currency-settings-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:12px;
    padding-bottom:10px;
    border-bottom:1px solid rgba(255,215,0,0.24);
    cursor:pointer;
}
.currency-settings-icon {
    width:38px; height:38px;
    border-radius:12px;
    background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,215,0,0.12));
    border:1px solid rgba(255,215,0,0.3);
    display:flex; align-items:center; justify-content:center;
    color:var(--brand-color);
    font-size:18px;
}
.currency-code { font-weight:900; color:var(--brand-color); font-size:16px; letter-spacing:0.3px; }
.currency-note { font-size:11px; color:var(--text-muted); margin-top:2px; }
.currency-toggle-icon { color:var(--text-muted); transition:transform 0.2s ease; }
.currency-settings-grid {
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap:10px;
}
.currency-field { margin:0; }
.currency-field .form-label { font-size:12px; font-weight:800; color:var(--text-main); display:flex; align-items:center; gap:6px; }
.currency-field .form-label i { font-size:11px; color:var(--brand-color); }
.currency-field .form-input { font-size:13px; padding:10px; background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.1); }
.light-mode .currency-settings-card { background:#fffdf6; border-color:rgba(0,0,0,0.08); }
.light-mode .currency-settings-icon { background:#fff2cc; border-color:rgba(0,0,0,0.08); color:#b45309; }
.light-mode .currency-field .form-input { background:#ffffff; border-color:rgba(0,0,0,0.08); }

.currency-settings-card.collapsed .currency-settings-grid {
    display: none;
}
.currency-settings-card.collapsed .currency-toggle-icon {
    transform: rotate(-90deg);
}

@media (max-width: 720px) {
    .pay-pro-grid { grid-template-columns:1fr; }
    .pay-pro-actions { grid-template-columns:1fr; }
}

/* Admin Payment Cards - Stacked Sections Design */
.pay-admin-card {
    aspect-ratio: 1 / 1;
    width: 100%;
    padding: 0;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 20px 44px rgba(0,0,0,0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    background: linear-gradient(165deg, rgba(18,24,38,0.95) 0%, rgba(9,12,19,0.96) 60%, rgba(11,14,22,0.98) 100%);
    display: flex;
    flex-direction: column;
}
.pay-admin-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 22px 48px rgba(0,0,0,0.4);
    border-color: rgba(255,215,0,0.35);
}
.pay-admin-body {
    flex: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}
.pay-admin-logo {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pay-admin-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pay-logo-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-color);
    font-size: 48px;
    opacity: 0.9;
}
.pay-admin-info {
    width: 100%;
    background: #1a1a1a;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 56px;
    box-sizing: border-box;
}
.pay-admin-name {
    font-size: 14px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.2;
}
.light-mode .pay-admin-card {
    background: linear-gradient(135deg, #fff9eb 0%, #ffffff 70%);
    border-color: rgba(0,0,0,0.06);
    box-shadow: 0 12px 26px rgba(0,0,0,0.12);
}
.light-mode .pay-admin-info {
    background: #2d2d2d;
    border-top: 1px solid rgba(0,0,0,0.1);
}
.light-mode .pay-admin-name {
    color: #ffffff;
}

.btn { border: none; padding: 10px 16px; border-radius: 10px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: 0.2s; font-size: 12px; min-height: 40px; }
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--primary); color: #000; box-shadow: 0 6px 16px rgba(0,0,0,0.18); border: 1px solid rgba(0,0,0,0.08); }
.light-mode .btn-primary { color: #000; box-shadow: var(--shadow-soft); }
.btn-green { background:rgba(16, 185, 129, 0.15); color:var(--success); border:1px solid rgba(16, 185, 129, 0.2); }
.btn-red { background:rgba(239, 68, 68, 0.15); color:var(--danger); border:1px solid rgba(239, 68, 68, 0.2); }
.btn-outline-red { background:transparent; color:var(--danger); border:1px solid var(--danger); }
.btn-purple { background:rgba(168, 85, 247, 0.15); color:#a855f7; border:1px solid rgba(168, 85, 247, 0.2); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }

.font-card { border-top: 2px solid var(--primary); }
.font-card-title { margin-bottom: 6px; }
.font-hint { color: var(--text-muted); font-size: 12px; margin-bottom: 12px; }
.font-preview { background: rgba(255,255,255,0.04); border:1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 14px; display: grid; gap: 6px; }
.font-preview-title { font-size: clamp(15px, 3vw, 20px); font-weight: var(--fw-head, 900); }
.font-preview-body { font-size: clamp(13px, 2.8vw, 17px); font-weight: var(--fw-body, 700); }
.font-preview-label { font-size: clamp(12px, 2.6vw, 15px); color: #cbd5e1; font-weight: 700; }
.font-preview-small { font-size: clamp(11px, 2.4vw, 14px); color: #94a3b8; }
.font-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 6px; }
.font-note { color: var(--text-muted); font-size: 11px; }
.font-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.font-toast { margin-top: 10px; font-size: 12px; color: var(--success); display: none; }
.font-toast.show { display: block; }

/* Grids */
.order-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--gap-md); }
.items-grid { 
    display: grid; 
    grid-template-columns: repeat(3, minmax(0, 1fr)); 
    gap: var(--gap-sm);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    direction: rtl;
}

/* Ensure grid items flow correctly in RTL */
.items-grid > .item-box,
.cats-grid > .item-box,
.prods-grid > .item-box,
#banner-grid > .item-box {
    direction: rtl;
}

/* تطبيق المنع على جميع الحاويات الشبكية بشكل عام - شامل للأقسام الفرعية */
.items-grid, 
.prod-grid-stack,
.cats-grid,
.prods-grid,
.sortable-container,
.items-grid *, 
.prod-grid-stack *,
.cats-grid *,
.prods-grid *,
.sortable-container *,
.cats-grid.sortable-container,
.cats-grid.sortable-container * {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

/* منع سحب الصور في جميع الحاويات - شامل للأقسام الفرعية */
.items-grid img, 
.prod-grid-stack img,
.cats-grid img,
.prods-grid img,
.sortable-container img,
.cats-grid.sortable-container img {
    pointer-events: none !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    -webkit-touch-callout: none !important;
}

/* مؤشر السحب للبطاقات */
/* Cursor changes only when drag mode is enabled */
.item-box.drag-enabled {
    cursor: grab;
}
.item-box.drag-enabled:active {
    cursor: grabbing;
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap-md); }

/* Admin store-like layout controls */
#prod-grid.cats-grid { 
    grid-template-columns: repeat(2, minmax(150px, 1fr)); 
    direction: rtl;
}
#prod-grid.prods-grid { 
    grid-template-columns: repeat(3, minmax(150px, 1fr)); 
    direction: rtl;
}
#prod-grid.prod-grid-stack { 
    display: flex; 
    flex-direction: column; 
    gap: var(--gap-md);
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    -webkit-touch-callout: none !important;
    direction: rtl;
}
#prod-grid.prod-grid-stack .items-grid { 
    width: 100%; 
    direction: rtl;
}
#prod-grid.prod-grid-stack .items-grid.cats-grid { 
    grid-template-columns: repeat(2, minmax(150px, 1fr)); 
    direction: rtl;
}
#prod-grid.prod-grid-stack .items-grid.prods-grid { 
    grid-template-columns: repeat(3, minmax(140px, 1fr)); 
    direction: rtl;
}

/* Order Card */
.o-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 15px; position: relative; border-right: 4px solid transparent; }
.o-card.st-pending { border-right-color: var(--warning); }
.o-card.st-approved { border-right-color: var(--success); opacity: 0.8; }
.o-card.st-rejected { border-right-color: var(--danger); opacity: 0.6; }

.o-head { display:flex; justify-content:space-between; align-items:flex-start; border-bottom:1px solid var(--border); padding-bottom:8px; }
.o-body { display:flex; align-items:center; gap:12px; padding:8px 0; }
.o-icon { width:40px; height:40px; border-radius: 10px; background:rgba(255,255,255,0.03); display:flex; align-items:center; justify-content:center; font-size:18px; color:var(--primary); border:1px solid var(--border); }
.o-actions { display:flex; gap:8px; margin-top:8px; }

/* Item Box (Products) */

/* Unified Premium Button Design - All Action Buttons */
.btn-primary.btn-add-cat,
.btn-primary.btn-add-prod,
#drag-edit-mode-btn {
    /* Unified dimensions */
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 6px 14px !important;
    
    /* Unified typography */
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    letter-spacing: 0.3px !important;
    
    /* Perfect capsule shape */
    border-radius: 999px !important;
    
    /* Unified layout */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    
    /* Unified transitions */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    
    /* Prevent text selection */
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    
    /* Unified cursor */
    cursor: pointer !important;
}

/* Drag Edit Mode Button - Special styling */
#drag-edit-mode-btn {
    /* Reset default button styles */
    all: unset;
    box-sizing: border-box;
    
    /* حدود زمردية - هوية MaliMor */
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(16,185,129,0.3) !important;
    color: rgba(16,185,129,0.95) !important;
}

#drag-edit-mode-btn i {
    font-size: 10px !important;
    margin: 0 !important;
    line-height: 1 !important;
}

#drag-edit-mode-btn:hover {
    background: rgba(15, 23, 42, 1) !important;
    border-color: rgba(16,185,129,0.45) !important;
    color: rgba(16,185,129,1) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(16,185,129,0.2), 0 0 12px rgba(16,185,129,0.1) !important;
}

#drag-edit-mode-btn.active {
    background: rgba(16,185,129,0.18) !important;
    border-color: rgba(16,185,129,0.55) !important;
    color: rgba(16,185,129,1) !important;
    box-shadow: 0 3px 10px rgba(16,185,129,0.3), 0 0 8px rgba(16,185,129,0.2) !important;
}

#drag-edit-mode-btn.active:hover {
    background: rgba(16,185,129,0.25) !important;
    border-color: rgba(16,185,129,0.65) !important;
    box-shadow: 0 4px 12px rgba(16,185,129,0.4), 0 0 10px rgba(16,185,129,0.25) !important;
}

/* أزرار إضافة قسم/منتج - هوية MaliMor */
.btn-primary.btn-add-cat,
.btn-primary.btn-add-prod {
    /* خلفية زمردية */
    background: linear-gradient(135deg, rgba(16,185,129,0.95), rgba(16,185,129,0.85)) !important;
    border: 1px solid rgba(16,185,129,0.4) !important;
    color: #0f172a !important;
    
    /* Premium shadow */
    box-shadow: 0 3px 10px rgba(16,185,129,0.25), 0 0 8px rgba(16,185,129,0.15), inset 0 1px 0 rgba(255,255,255,0.2) !important;
}

.btn-primary.btn-add-cat:hover,
.btn-primary.btn-add-prod:hover {
    background: linear-gradient(135deg, rgba(16,185,129,1), rgba(16,185,129,0.95)) !important;
    border-color: rgba(16,185,129,0.5) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 14px rgba(16,185,129,0.35), 0 0 12px rgba(16,185,129,0.2), inset 0 1px 0 rgba(255,255,255,0.3) !important;
}

.btn-primary.btn-add-cat:active,
.btn-primary.btn-add-prod:active {
    transform: translateY(0) scale(0.98) !important;
    box-shadow: 0 2px 8px rgba(16,185,129,0.3), 0 0 6px rgba(16,185,129,0.15) !important;
}

/* Visual indicator for drag-enabled cards */
.item-box.drag-enabled {
    box-shadow: 0 10px 26px rgba(0,0,0,0.32) !important;
    position: relative;
}

.item-box.drag-enabled::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: rgba(16,185,129,0.8);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16,185,129,0.6);
    z-index: 10;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.item-box.drag-enabled:hover {
    box-shadow: 0 14px 30px rgba(0,0,0,0.36) !important;
}

/* Light Mode - Unified Premium Buttons */
.light-mode #drag-edit-mode-btn {
    background: rgba(255,255,255,0.98) !important;
    border-color: rgba(16,185,129,0.35) !important;
    color: rgba(16, 185, 129, 0.9) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 0 0 1px rgba(16,185,129,0.1) !important;
}

.light-mode #drag-edit-mode-btn:hover {
    background: rgba(255,255,255,1) !important;
    border-color: rgba(16,185,129,0.45) !important;
    color: rgba(16, 185, 129, 1) !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1), 0 0 0 1px rgba(16,185,129,0.15) !important;
}

.light-mode #drag-edit-mode-btn.active {
    background: rgba(16,185,129,0.15) !important;
    border-color: rgba(16,185,129,0.55) !important;
    color: rgba(16, 185, 129, 1) !important;
    box-shadow: 0 3px 10px rgba(16,185,129,0.25), 0 0 8px rgba(16,185,129,0.15) !important;
}

.light-mode #drag-edit-mode-btn.active:hover {
    background: rgba(16,185,129,0.22) !important;
    border-color: rgba(16,185,129,0.65) !important;
    box-shadow: 0 4px 12px rgba(16,185,129,0.3), 0 0 10px rgba(16,185,129,0.2) !important;
}

.light-mode .btn-primary.btn-add-cat,
.light-mode .btn-primary.btn-add-prod {
    background: linear-gradient(135deg, rgba(16,185,129,0.9), rgba(16,185,129,0.8)) !important;
    border-color: rgba(16,185,129,0.4) !important;
    color: #1a1e29 !important;
    box-shadow: 0 3px 10px rgba(16,185,129,0.2), 0 0 8px rgba(16,185,129,0.12), inset 0 1px 0 rgba(255,255,255,0.3) !important;
}

.light-mode .btn-primary.btn-add-cat:hover,
.light-mode .btn-primary.btn-add-prod:hover {
    background: linear-gradient(135deg, rgba(16,185,129,0.95), rgba(16,185,129,0.85)) !important;
    border-color: rgba(16,185,129,0.5) !important;
    box-shadow: 0 4px 14px rgba(16,185,129,0.3), 0 0 12px rgba(16,185,129,0.18), inset 0 1px 0 rgba(255,255,255,0.4) !important;
}

.light-mode .item-box.drag-enabled {
    box-shadow: 0 10px 20px rgba(0,0,0,0.12) !important;
}

.item-box { 
    background: radial-gradient(circle at 50% 35%, rgba(70,88,120,0.2), rgba(26,30,41,0.92)), #1a1e29; 
    border-radius: 18px; 
    overflow: hidden; 
    position: relative; 
    border: 1px solid rgba(255,255,255,0.08); 
    box-shadow: 0 10px 26px rgba(0,0,0,0.32); 
    display: flex; 
    flex-direction: column; 
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                border-color 0.3s ease, 
                filter 0.3s ease;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Enable dragging on entire item when drag mode is active */
.item-box.drag-enabled {
    cursor: grab;
}

.item-box.drag-enabled:active {
    cursor: grabbing;
}

/* GPU Acceleration for sub-categories (performance optimization) */
.sortable-container .item-box,
.cats-grid.sortable-container .item-box,
.prods-grid.sortable-container .item-box {
    will-change: transform !important;
    transform: translate3d(0, 0, 0) !important;
    touch-action: none !important;
    -webkit-transform: translate3d(0, 0, 0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    perspective: 1000px !important;
    -webkit-perspective: 1000px !important;
}
.item-box::after { 
    content: ''; 
    position: absolute; 
    bottom: 8px; 
    left: 0; 
    right: 0; 
    display: none;
    height: 0; 
    background: transparent;
    border-radius: 0 0 18px 18px; 
    box-shadow: none; 
    opacity: 0; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    pointer-events: none;
    z-index: 1;
}
.item-box:hover::after { 
    opacity: 0; 
    box-shadow: none; 
}
.light-mode .item-box::after { 
    display: none;
    background: transparent;
    box-shadow: none; 
    opacity: 0; 
}
.light-mode .item-box:hover::after { 
    opacity: 0; 
    box-shadow: none; 
}

.item-box:active {
    cursor: grabbing;
}
.item-box:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 14px 30px rgba(0,0,0,0.36), 0 0 14px rgba(16,185,129,0.12); 
    border-color: rgba(16,185,129,0.35); 
    filter: none;
}
.light-mode .item-box { 
    background: #ffffff; 
    border: 1px solid rgba(0,0,0,0.08); 
    box-shadow: var(--shadow-soft); 
}
.light-mode .item-box:hover { 
    box-shadow: 0 10px 20px rgba(0,0,0,0.12); 
    border-color: rgba(16,185,129,0.28); 
    filter: none;
}
.item-img { 
    width: 100%;
    aspect-ratio: 3 / 4; 
    background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.08), rgba(10,10,10,0.55)); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
    padding: 0; 
    overflow: hidden;
}
.item-img img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
    transition: transform 0.25s ease;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}
.item-box:hover .item-img img { transform: scale(1.04); }
.light-mode .item-img { background: #f5f7fb; }
.item-box:hover .item-img img { transform: scale(1.015); }

 .item-box[data-type="prod"] {
     aspect-ratio: 3 / 4;
     background: radial-gradient(circle at 50% 35%, rgba(70,88,120,0.25), rgba(26,30,41,0.95)), #1a1e29;
     border-radius: 20px;
     border: 1px solid rgba(255,255,255,0.1);
     box-shadow: 0 14px 36px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.05);
     transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
 }
 .item-box[data-type="prod"]:hover {
     border-color: rgba(16,185,129,0.35);
     box-shadow: 0 18px 38px rgba(0,0,0,0.36), 0 0 18px rgba(16,185,129,0.16), inset 0 1px 0 rgba(255,255,255,0.08);
     transform: translateY(-3px);
 }

 .light-mode .item-box[data-type="prod"] {
     background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.65), rgba(244,244,244,0.95));
     border-color: rgba(0,0,0,0.06);
     box-shadow: 0 12px 24px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
 }
 .light-mode .item-box[data-type="prod"]:hover {
     border-color: rgba(16,185,129,0.3);
     box-shadow: 0 12px 22px rgba(0,0,0,0.12), 0 0 12px rgba(16,185,129,0.1), inset 0 1px 0 rgba(255,255,255,0.95);
     transform: translateY(-3px);
 }

 .item-box[data-type="prod"] .item-img {
     flex: 8;
     aspect-ratio: auto;
     background: transparent;
 }
 .item-box[data-type="prod"] .item-img::before {
     content: "";
     position: absolute;
     width: 78%;
     height: 78%;
     border-radius: 50%;
     background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0) 60%);
     filter: blur(20px);
     z-index: 0;
 }
 .item-box[data-type="prod"] .item-img img {
     transition: transform 0.35s ease;
     position: relative;
     z-index: 1;
     filter: drop-shadow(0 8px 18px rgba(0,0,0,0.35));
 }
 .item-box[data-type="prod"]:hover .item-img img {
     transform: scale(1.1);
 }

 .item-box[data-type="prod"] .item-info {
     flex: 2;
     padding: 8px 10px;
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     background: rgba(0, 0, 0, 0.4);
     backdrop-filter: blur(5px);
     border-top: 1px solid rgba(255,255,255,0.1);
     gap: 4px;
     margin: 0;
     border-radius: 0;
     box-shadow: none;
 }
 .light-mode .item-box[data-type="prod"] .item-info {
     background: rgba(255,255,255,0.85);
     border-top: 1px solid rgba(0,0,0,0.06);
 }
 .light-mode .item-box[data-type="prod"] .item-info,
 .light-mode .item-box[data-type="prod"] .item-info span {
     color: #0f172a !important;
 }

/* Categories (item-box used as folder) to match store icons */
.item-box[data-enter] {
    background: transparent;
    border: none;
    box-shadow: none;
}
.item-box[data-enter] .item-img {
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    background: radial-gradient(circle at 50% 35%, rgba(70,88,120,0.25), rgba(26,30,41,0.95));
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 26px rgba(0,0,0,0.28);
    transition: 0.18s ease;
}
.item-box[data-enter]:hover .item-img {
    border-color: rgba(16,185,129,0.35);
    box-shadow: 0 14px 30px rgba(0,0,0,0.34);
    transform: translateY(-2px);
}
.light-mode .item-box[data-enter] .item-img {
    background: #ffffff;
    border: 2px solid rgba(0,0,0,0.08);
    box-shadow: var(--shadow-soft);
}
.light-mode .item-box[data-enter]:hover .item-img {
    border-color: rgba(16,185,129,0.28);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}
.item-box[data-enter] .item-info {
    font-size: 13px;
    font-weight: 900;
    color: var(--text-main);
    padding: 8px 10px;
    margin-top: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(16,185,129,0.5);
    border-bottom: 3px solid rgba(16,185,129,0.8);
    border-radius: 12px;
    box-shadow: 
        0 6px 16px rgba(0,0,0,0.22),
        0 0 0 1px rgba(16,185,129,0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 16px);
    align-self: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.item-box[data-enter]:hover .item-info {
    border-color: rgba(16,185,129,0.75);
    border-bottom-color: rgba(16,185,129,0.95);
    box-shadow: 
        0 10px 20px rgba(0,0,0,0.18), 
        0 0 0 1px rgba(16,185,129,0.25);
}
.light-mode .item-box[data-enter] .item-info {
    background: #ffffff;
    border: 1px solid rgba(16,185,129,0.45);
    border-bottom: 3px solid rgba(16,185,129,0.75);
    box-shadow: 
        var(--shadow-soft),
        0 0 0 1px rgba(16,185,129,0.15);
    color: var(--text-main);
}
.light-mode .item-box[data-enter]:hover .item-info {
    border-color: rgba(16,185,129,0.65);
    border-bottom-color: rgba(16,185,129,0.85);
    box-shadow: 
        0 8px 16px rgba(0,0,0,0.10), 
        0 0 0 1px rgba(16,185,129,0.25);
}
.item-img i { 
    font-size: 42px; 
    color: #fff; 
    opacity: 0.9;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}
.item-info { 
    padding: 10px 10px 12px; 
    text-align: center; 
    font-weight: 800; 
    font-size: 13px; 
    line-height: 1.4; 
    color: var(--text-main);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    margin: 0 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.item-box:hover .item-info {
    border-color: rgba(255,255,255,0.25);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}
.light-mode .item-info { 
    color: var(--text-main);
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(16,185,129,0.35);
    border-bottom: 2.5px solid rgba(16,185,129,0.65);
    box-shadow: 
        0 2px 6px rgba(0,0,0,0.08),
        0 0 0 1px rgba(16,185,129,0.1);
}
.light-mode .item-box:hover .item-info {
    border-color: rgba(16,185,129,0.5);
    border-bottom-color: rgba(16,185,129,0.75);
    box-shadow: 
        0 4px 10px rgba(0,0,0,0.12),
        0 0 0 1px rgba(16,185,129,0.2);
}

.item-actions { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    padding: 8px; 
    display: flex; 
    justify-content: space-between; 
    z-index: 10;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}
.item-actions .action-mini {
    pointer-events: auto;
}
.action-mini { 
    width: 28px; 
    height: 28px; 
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    color: #fff; 
    font-size: 12px; 
    backdrop-filter: blur(4px); 
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}
.btn-del-mini { background: rgba(239, 68, 68, 0.85); }
.btn-edit-mini { background: rgba(59, 130, 246, 0.85); }

/* Modals & Upload */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(5px); }
.modal-overlay.active { display: flex; animation: fadeIn 0.2s; }
.modal-content { background: #1e293b; width: 100%; max-width: clamp(320px, 90vw, 480px); padding: clamp(18px, 3vw, 26px); border-radius: 20px; border: 1px solid var(--border); max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.5); position: relative; }
.light-mode .modal-content { background: #ffffff; border: 1px solid rgba(0,0,0,0.08); box-shadow: var(--shadow-soft); color: var(--text-main); }

.modal-close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 32px;
    height: 32px;
    background-color: #ccc;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s;
}
.modal-close-btn:hover {
    background-color: red;
}

.upload-area { 
    border: 2px dashed var(--border); 
    padding: 20px; 
    text-align: center; 
    border-radius: 12px; 
    cursor: pointer; 
    margin-bottom: 15px; 
    position: relative; 
}
.upload-area img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
    display: none; 
    position: absolute; 
    top:0; 
    left:0; 
    border-radius: 12px; 
}
.upload-area.has-img img { display: block; background: #000; }

.upload-area.has-img .btn-remove-img {
    display: flex;
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: red;
    color: white;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    z-index: 10;
}
.upload-area .btn-remove-img {
    display: none;
}

.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #334155; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(18px); }

.lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 3000; display: none; align-items: center; justify-content: center; padding: 20px; }
.lightbox.active { display: flex; }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: 8px; box-shadow: 0 0 50px rgba(0,0,0,0.5); }
.lightbox-close { position: absolute; top: 20px; right: 20px; color: #fff; font-size: 30px; cursor: pointer; width:40px; height:40px; background:rgba(255,255,255,0.1); border-radius:50%; display:flex; align-items:center; justify-content:center; }

.loader-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.8); z-index:9999; display:none; justify-content:center; align-items:center; flex-direction:column; color:#fff; }
.loader { width:40px; height:40px; border:4px solid rgba(255,255,255,0.1); border-top:4px solid var(--primary); border-radius:50%; animation:spin 1s linear infinite; margin-bottom:10px; }

/* NEW PRO STYLES */
.mock-input {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.mock-label { font-size: 13px; color: var(--text-muted); font-weight: 600; flex:1; }
.mock-edit-btn { 
    width: 26px; height: 26px; border-radius: 6px; 
    background: rgba(255,255,255,0.1); 
    display: flex; align-items: center; justify-content: center; 
    cursor: pointer; color: var(--brand-color); transition: 0.2s;
}
.mock-edit-btn:hover { background: var(--brand-color); color: #fff; }
.inline-edit-input {
    background: transparent; border: none; border-bottom: 2px solid var(--primary);
    color: #fff; width: 100%; padding: 2px; font-size: 13px;
}
.pkg-item { display:flex; justify-content:space-between; align-items:center; background:rgba(255,255,255,0.05); padding:8px 10px; border-radius:6px; margin-bottom:5px; font-size:12px; }
.pkg-del { color:var(--danger); cursor:pointer; padding:2px 6px; font-weight:bold; }

/* BIG PRICE HERO */
.price-hero {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 15px;
    text-align: center;
    position: relative;
}
.price-hero label { color: var(--brand-color); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; font-weight: 800; display:block; margin-bottom:5px; }
.price-hero input {
    font-size: 26px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 800;
    color: var(--brand-color);
    text-align: center;
    height: 45px;
    background: transparent;
    border: none;
    width: 100%;
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}
.price-hero input::placeholder { color: rgba(16, 185, 129, 0.3); font-size:20px; }

/* Currency hint */
.curr-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-size: 12px;
    margin: 0 0 6px 0;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 8px 10px;
    width: 100%;
}
.curr-hint i { color: var(--brand-color); }
.light-mode .curr-hint {
    color: #0f172a;
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.06);
}

.dash-card-link {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dash-card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}
.user-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0e1b33, #081020);
    border: 1px solid rgba(16, 185, 129, 0.3);
    transition: transform 0.18s ease, border-color 0.18s ease;
    cursor: pointer;
}
.user-card:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.6);
}
.user-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.uc-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.uc-top {
    display: flex;
    align-items: center;
    gap: 8px;
}
.status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.status-icon i { font-size: 11px; color: #ffffff; }
.status-icon.status-green { background: #22c55e; }
.status-icon.status-red { background: #ef4444; }
.status-icon.status-orange { background: #f59e0b; }
.full-name {
    font-weight: 800;
    color: #ffffff;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.uc-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
}
.username {
    color: #10b981;
    font-family: 'Chakra Petch', monospace;
    font-weight: 800;
    font-size: 0.95rem;
}
.sep { color: #94a3b8; }
.id-badge {
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 12px;
}
.uc-balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.balance-amt {
    color: #00ff2a;
    font-weight: 900;
    font-size: 1.1rem;
}
.balance-cur {
    color: #ffffff;
    font-weight: 800;
    font-size: 0.75rem;
}

/* Uniform label styling inside User Details modal */
.ud-label {
    color: #8892b0;
    font-size: 0.9rem;
    font-weight: 700;
}
.ud-section-title {
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    padding: 0 4px;
    margin: 20px 0 10px;
}
.ud-divider {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 20px 0 10px;
}
.user-name {
    font-weight: 800;
    color: #e2e8f0;
}
.user-id {
    font-size: 12px;
    color: var(--text-muted);
}
.user-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}
.user-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-weight: 800;
}
.user-balance .lbl {
    color: #94a3b8;
    font-size: 12px;
}

.curr-options {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.curr-check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: #e2e8f0;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.curr-check-label input { margin: 0; accent-color: var(--brand-color); }
.curr-check-label:hover {
    border-color: rgba(16,185,129,0.5);
    background: rgba(16,185,129,0.08);
}
.wallets-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 10px;
}
.wallet-card {
    background: linear-gradient(160deg, rgba(255,255,255,0.06) 0%, rgba(15,23,42,0.85) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wallet-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.4);
}
.wallet-card .wc-title {
    font-size: 14px;
    font-weight: 800;
    color: #e2e8f0;
}
.wallet-card .wc-amount {
    font-size: 22px;
    font-weight: 900;
    color: var(--brand-color);
    letter-spacing: 0.3px;
}
.wallet-card .wc-meta {
    font-size: 12px;
    color: #94a3b8;
}
.wallet-card.total-liability {
    background: linear-gradient(135deg, #f59e0b, #b45309);
    border: 1px solid #fbbf24;
}
.wallet-card.total-liability .wc-title {
    color: #0b0f1a;
}
.wallet-card.total-liability .wc-amount {
    color: #0b0f1a;
    text-shadow: 0 1px 1px rgba(255,255,255,0.4);
}
.wallet-card.total-liability .wc-meta {
    color: #0b0f1a;
}

/* ========================================
   ENHANCED DRAG & DROP SYSTEM
   ======================================== */

/* Drag Handle - Hidden (dragging works on entire item) */
.drag-handle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Banner Order Badge */
.banner-order-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    min-width: 24px;
    height: 24px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(16, 185, 129, 0.8));
    color: #0f172a;
    font-size: 11px;
    font-weight: 900;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* SortableJS Ghost - Smooth placeholder */
.sortable-ghost {
    opacity: 0.4 !important;
    background: rgba(16, 185, 129, 0.12) !important;
    border: 2px dashed rgba(16, 185, 129, 0.6) !important;
    border-radius: 18px !important;
    box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.1) !important;
    transform: scale(0.96) translate3d(0, 0, 0) !important;
    visibility: visible !important;
    transition: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    will-change: transform, opacity !important;
    cursor: grabbing !important;
}

/* SortableJS Chosen - Item selected but not yet dragging */
.sortable-chosen {
    opacity: 1 !important;
    transform: scale(1.02) translate3d(0, 0, 0) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(16, 185, 129, 0.5) !important;
    z-index: 1000 !important;
    transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), 
                box-shadow 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    will-change: transform !important;
    cursor: grabbing !important;
}

/* SortableJS Drag - Actively dragging item */
.sortable-drag {
    opacity: 0.92 !important;
    transform: scale(1.04) rotate(1.5deg) translate3d(0, 0, 0) !important;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 0 3px rgba(16, 185, 129, 0.65),
        0 0 35px rgba(16, 185, 129, 0.25) !important;
    border-radius: 18px !important;
    cursor: grabbing !important;
    z-index: 10000 !important;
    will-change: transform !important;
    transition: transform 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    pointer-events: none !important;
}

/* SortableJS Fallback - The floating clone element */
.sortable-fallback {
    opacity: 0.92 !important;
    transform: scale(1.04) rotate(1.5deg) translate3d(0, 0, 0) !important;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 0 3px rgba(16, 185, 129, 0.65),
        0 0 35px rgba(16, 185, 129, 0.25) !important;
    border-radius: 18px !important;
    cursor: grabbing !important;
    z-index: 10000 !important;
    background: var(--bg-card) !important;
    will-change: transform !important;
    transition: transform 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
}

/* Dragging item specific style - Smoother pulse */
.is-dragging-item {
    animation: pulse-drag 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

@keyframes pulse-drag {
    0%, 100% { 
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(16, 185, 129, 0.6);
        transform: scale(1.05) rotate(2deg) translate3d(0, 0, 0);
    }
    50% { 
        box-shadow: 0 30px 75px rgba(0, 0, 0, 0.65), 0 0 0 4px rgba(16, 185, 129, 0.85);
        transform: scale(1.06) rotate(2.5deg) translate3d(0, 0, 0);
    }
}

/* Body class when dragging */
body.is-dragging {
    cursor: grabbing !important;
}

body.is-dragging * {
    cursor: grabbing !important;
}

/* Smooth transitions for non-dragged items during drag */
body.is-dragging .item-box:not(.sortable-drag):not(.sortable-ghost):not(.sortable-chosen) {
    transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    will-change: transform !important;
    transform: translate3d(0, 0, 0) !important;
}

/* Banner grid specific styles */
#banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    direction: rtl;
}

#banner-grid .item-box {
    aspect-ratio: 16/9;
    position: relative;
}

#banner-grid .item-img {
    aspect-ratio: 16/9;
    width: 100%;
    height: 100%;
}

/* Smooth reordering animation for non-dragged items - Mobile app-like */
#banner-grid .item-box,
.items-grid .item-box,
.sortable-container .item-box {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.4s ease !important;
    will-change: transform, opacity;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Enhanced smooth movement for sibling items during drag */
.sortable-sibling {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    will-change: transform !important;
    transform: translate3d(0, 0, 0) !important;
}

/* Target item that's about to be swapped */
.sortable-move-target {
    transform: scale(1.02) translate3d(0, 0, 0) !important;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Drop zone placeholder styles - Smooth animated */
.sortable-placeholder {
    background: rgba(16, 185, 129, 0.12) !important;
    border: 2px dashed rgba(16, 185, 129, 0.5) !important;
    border-radius: 18px !important;
    animation: placeholder-pulse 1.5s ease-in-out infinite !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes placeholder-pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1) translate3d(0, 0, 0);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.01) translate3d(0, 0, 0);
    }
}

/* Spring-back animation when item is dropped - Mobile app-like */
.sortable-spring-back {
    animation: spring-back 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes spring-back {
    0% {
        transform: scale(1.05) rotate(2deg) translate3d(0, 0, 0);
    }
    50% {
        transform: scale(0.98) rotate(-1deg) translate3d(0, 0, 0);
    }
    100% {
        transform: scale(1) rotate(0deg) translate3d(0, 0, 0);
    }
}

/* Light mode adjustments for drag and drop */
.light-mode .drag-handle {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .drag-handle i {
    color: rgba(0, 0, 0, 0.6);
}

.light-mode .drag-handle:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
}

.light-mode .drag-handle:hover i {
    color: #b45309;
}

.light-mode .sortable-ghost {
    background: rgba(16, 185, 129, 0.05) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
}

.light-mode .sortable-drag {
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.2),
        0 0 0 3px rgba(16, 185, 129, 0.6),
        0 0 40px rgba(16, 185, 129, 0.15) !important;
}

.light-mode .banner-order-badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(16, 185, 129, 0.8));
}

/* Smooth Drag Drop System Styles - Real-time DOM Swapping - All Directions */
.smooth-drag-active {
    opacity: 0.95 !important;
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.6),
        0 0 0 3px rgba(16, 185, 129, 0.7),
        0 0 40px rgba(16, 185, 129, 0.3) !important;
    z-index: 10000 !important;
    cursor: grabbing !important;
    will-change: transform !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    transition: none !important;
    pointer-events: none !important;
    touch-action: none !important;
}

.smooth-drag-moving {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    will-change: transform !important;
    z-index: 999 !important;
}

body.smooth-dragging {
    cursor: grabbing !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

body.smooth-dragging .item-box:not(.smooth-drag-active):not(.smooth-drag-moving) {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    will-change: transform !important;
    pointer-events: auto !important;
}

/* Ensure items can be dragged in all layouts */
.items-grid .item-box,
.cats-grid .item-box,
.prods-grid .item-box,
.sortable-container .item-box {
    position: relative;
    touch-action: none;
    -webkit-touch-callout: none;
}

/* Smooth drag item styles */
.item-box {
    position: relative;
    touch-action: none;
    -webkit-touch-callout: none;
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .drag-handle {
        width: 36px;
        height: 36px;
        opacity: 1;
    }
    
    .drag-handle i {
        font-size: 16px;
    }
}

/* Category/Product drag handles - hidden by default, shown when edit mode active */
/* Drag handles removed - dragging works on entire item when drag mode is enabled */

/* Order indicator badge */
.order-indicator {
    position: absolute;
    bottom: 8px;
    left: 8px;
    min-width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    color: rgba(255, 255, 255, 0.9);
    font-size: 10px;
    font-weight: 800;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    z-index: 8;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drag-enabled .order-indicator,
.item-box:hover .order-indicator {
    opacity: 1;
    transform: translateY(0);
}

.light-mode .order-indicator {
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.1);
}

/* When drag edit mode is active, show all indicators */
body.drag-edit-active .order-indicator {
    opacity: 1;
    transform: translateY(0);
}

/* Drag handles are hidden - dragging works on entire item */

/* ======================================== */

.light-mode .curr-check-label {
    color: #0f172a;
    border-color: rgba(0,0,0,0.08);
    background: rgba(0,0,0,0.02);
}
.light-mode .curr-check-label:hover {
    border-color: rgba(0,0,0,0.14);
    background: rgba(0,0,0,0.05);
}
/* === FILTER SYSTEM STYLES (NEW) === */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.filter-input-group {
    flex: 2;
    min-width: 250px;
    position: relative;
}
.filter-input-group i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.filter-input-group input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 35px 10px 10px;
    color: #fff;
    font-size: 12px;
    transition: 0.2s;
}
.filter-input-group input:focus {
    border-color: var(--primary);
    background: rgba(0,0,0,0.4);
}
.filter-date-group {
    flex: 2;
    display: flex;
    gap: 8px;
    min-width: 280px;
}
.date-input {
    flex: 1;
    position: relative;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 8px;
    display: flex;
    align-items: center;
}
.date-input .lbl {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 5px;
}
.date-input input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 11px;
    width: 100%;
    padding: 8px 0;
    font-family: 'Segoe UI', sans-serif;
}
/* Icon Selector Styles */
.icon-selector { display: flex; gap: 10px; flex-wrap: wrap; }
.is-opt { width: 48px; height: 48px; border-radius: 10px; background: transparent; display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; border: none; transition: all 0.2s; position: relative; color: #dce5ef; }
.is-opt:hover { background: rgba(255,255,255,0.06); transform: translateY(-1px); }
.is-opt.active { background: rgba(255,255,255,0.08); color: var(--primary); border: none; box-shadow: none; transform: scale(1.03); }

/* Style Selector */
.style-circle { border-radius: 50%; }
.style-square { border-radius: 4px; }
.style-rounded { border-radius: 12px; }
.style-pill { border-radius: 20px; }

/* Animation Selector */
.animation-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.anim-opt { background: rgba(255,255,255,0.03); border: 2px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 12px 8px; cursor: pointer; transition: all 0.3s; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.anim-opt:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }
.anim-opt.active { background: rgba(16, 185, 129, 0.15); border-color: var(--brand-color); box-shadow: 0 0 15px rgba(16, 185, 129, 0.2); }
.anim-opt i { font-size: 20px; color: #94a3b8; }
.anim-opt.active i { color: var(--brand-color); }
.anim-opt span { font-size: 10px; font-weight: 700; color: #94a3b8; }
.anim-opt.active span { color: var(--brand-color); }

/* Fix for date calendar icon color in dark mode */
::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }

@media (max-width: 768px) {
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-input-group, .filter-date-group { width: 100%; }
    .sidebar { position: fixed; top: 0; right: calc(-1 * var(--sidebar-w)); height: 100%; box-shadow: -5px 0 20px rgba(0,0,0,0.5); width: var(--sidebar-w); }
    .sidebar.open { right: 0; transform: none; visibility: visible; pointer-events: auto; }
    .menu-toggle { display: block; }
    .header { padding: 0 15px; }
    .header-left .head-profile { display: none; }
    .main-content {
        min-height: 0;
        overflow: hidden;
    }
    .workspace { 
        padding: 15px; 
        -webkit-overflow-scrolling: touch;
        overflow-y: scroll !important;
        overflow-x: hidden;
        overscroll-behavior-y: contain;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
        position: relative;
        min-height: 0;
        height: auto;
    }
    .order-grid { grid-template-columns: 1fr; }
    .items-grid { grid-template-columns: repeat(3, minmax(100px, 1fr)); }
    .grid-2 { grid-template-columns: 1fr; }
    #view-notifs {
        min-height: auto;
        height: auto;
        position: relative;
        overflow: visible;
    }
    .card {
        touch-action: pan-y;
    }
}
/* Desktop safety: ensure mobile overlay doesn't block desktop interactions */
@media (min-width: 768px) {
    .sidebar-overlay { display: none !important; opacity: 0 !important; pointer-events: none !important; z-index: -1 !important; }
    .sidebar { position: relative !important; right: 0 !important; transform: none !important; box-shadow: none !important; visibility: visible !important; pointer-events: auto !important; }
    .sidebar.open { transform: none !important; }
    .menu-toggle { display: none !important; }
    .header { z-index: 1002; }
    .main-content { z-index: 1000; }
}
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
/* Responsive adjustments (dynamic like store) */
@media (max-width: 1200px) {
    #prod-grid.cats-grid,
    #prod-grid.prod-grid-stack .items-grid.cats-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
    #prod-grid.prods-grid,
    #prod-grid.prod-grid-stack .items-grid.prods-grid {
        grid-template-columns: repeat(3, minmax(130px, 1fr));
    }
}

@media (max-width: 900px) {
    .header { padding: 0 12px; }
    #prod-grid.cats-grid,
    #prod-grid.prod-grid-stack .items-grid.cats-grid {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }
    #prod-grid.prods-grid,
    #prod-grid.prod-grid-stack .items-grid.prods-grid {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
}

@media (max-width: 640px) {
    .header { padding: 0 10px; }
    .card { padding: 12px; }
    .items-grid { gap: 8px; }
    #prod-grid.cats-grid,
    #prod-grid.prod-grid-stack .items-grid.cats-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
    #prod-grid.prods-grid,
    #prod-grid.prod-grid-stack .items-grid.prods-grid {
        grid-template-columns: repeat(3, minmax(100px, 1fr));
    }
}

@media (max-width: 440px) {
    #prod-grid.cats-grid,
    #prod-grid.prod-grid-stack .items-grid.cats-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
    #prod-grid.prods-grid,
    #prod-grid.prod-grid-stack .items-grid.prods-grid {
        grid-template-columns: repeat(3, minmax(90px, 1fr));
    }
    .sidebar { width: calc(var(--sidebar-w) * 0.9); }
}
