/* style.css — تصميم "One Million" بستايل لوحات التحكم التقنية الحديثة (Notch-style)
   سايدبار غامق + محتوى رمادي فاتح + كروت بيضا مدوّرة + لون أساسي أخضر ليموني.
   RTL بالكامل. كل الألوان في :root — غيّرها من هنا بس. */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@1,800;1,900&family=DM+Sans:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
    --accent: #C9A961;
    --gold-light: #F3E08F; --gold: #C9A961; --bronze: #8F6F36; --bronze-deep: #6B4A1E; --black: #0A0A0A;
    --gold-grad: linear-gradient(100deg, #F3E08F 0%, #C9A961 45%, #8F6F36 75%, #6B4A1E 100%);
    --btn-grad: linear-gradient(100deg, #F3E08F 0%, #C9A961 60%, #B8943F 100%);
    --font-display: 'Montserrat', 'IBM Plex Sans Arabic', sans-serif;
    --accent-hover: #B8943F;
    --accent-ink: #8F6F36;          /* لون النص "المميز" على الخلفية الفاتحة */
    --accent-soft: #f7f0dd;
    --bg: #f1f1f1;
    --card: #ffffff;
    --surface-2: #f7f7f7;           /* خلفية ثانوية داخل الكروت (inputs، صفوف) */
    --border: #e3e3e3;
    --border-strong: #cdcdcd;
    --text: #1a1a1a;
    --muted: #6b6b6b;
    --muted-soft: #9a9a9a;
    --green: #108043;
    --red: #d72c0d;
    --orange: #b45309;
    --sidebar: #0c0c0c;
    --sidebar-hover: #262626;
    --sidebar-active: #303030;
    --sidebar-text: #e6e6e6;
    --sidebar-muted: #8c8c8c;
    --radius: 12px;
    --shadow: 0 1px 0 rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 40px -10px rgba(0,0,0,0.25);
    /* أسماء قديمة بتتستخدم في بعض الصفحات (analytics…) */
    --gold-soft: var(--accent-soft);
    --gold-glow: var(--accent-soft);
    --input-bg: #ffffff;
    --focus: #1a1a1a;
    --badge-bg: #e9e9e9; --badge-fg: #4a4a4a;
    --ok-bg: #cdfed4;   --ok-fg: #0c5132;
    --warn-bg: #ffd9a8; --warn-fg: #6b3d00;
    --bad-bg: #fed3d1;  --bad-fg: #8e1f0b;
    --alert-bg: #fff4f4; --alert-bd: #f5c2bb; --alert-fg: #8e1f0b;
    --okbox-bg: #f0fbf2; --okbox-bd: #b7e4c1; --okbox-fg: #0c5132;
    --hover-soft: rgba(0,0,0,0.05);
    --scroll: rgba(0,0,0,0.18);
    --font: 'DM Sans', 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.55; background: var(--bg); color: var(--text); direction: rtl; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
input, select, button, textarea { font-family: var(--font); }
input::placeholder, textarea::placeholder { color: var(--muted-soft); }
::selection { background: var(--accent); color: #000; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 4px; }
.sidebar ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 7px; justify-content: center;
    padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; line-height: 1.4;
    cursor: pointer; border: 1px solid transparent; transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.06s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn-grad); color: #000; border-color: rgba(0,0,0,0.12); box-shadow: 0 1px 0 rgba(0,0,0,0.08); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-outline { background: var(--card); color: var(--text); border-color: var(--border-strong); box-shadow: 0 1px 0 rgba(0,0,0,0.04); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--hover-soft); color: var(--text); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Forms ---------- */
label { display: block; margin: 14px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--text); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"],
input[type="number"], input[type="date"], input[type="file"], select, textarea {
    width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border-strong);
    background: var(--input-bg); color: var(--text); font-size: 14px; transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(201,169,97,0.5); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
.muted { color: var(--muted); font-size: 13px; }
.inline-form { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; }
.alert-error {
    background: var(--alert-bg); border: 1px solid var(--alert-bd); color: var(--alert-fg);
    padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; font-size: 13px;
}

/* ---------- Landing (hero غامق بتدرّج وشبكة تقنية) ---------- */
.landing-hero {
    min-height: 100vh; position: relative; overflow: hidden; color: #fff;
    background:
        radial-gradient(900px 420px at 50% 0%, rgba(212,242,60,0.16), transparent 70%),
        linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px) 0 0 / 44px 44px,
        linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px) 0 0 / 44px 44px,
        #101010;
}
.landing-topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 48px; position: relative; z-index: 10; }
.landing-brand { color: #fff; font-weight: 700; font-size: 18px; letter-spacing: -0.3px; }
.landing-brand svg { fill: var(--accent); }
.landing-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.landing-hero .btn-outline { background: rgba(255,255,255,0.06); color: #fff; border-color: rgba(255,255,255,0.18); box-shadow: none; }
.landing-hero .btn-outline:hover { background: rgba(255,255,255,0.12); }
.landing-hero .btn-ghost { color: rgba(255,255,255,0.7); }
.landing-center { display: flex; flex-direction: column; align-items: center; padding: 72px 40px 48px; text-align: center; position: relative; z-index: 5; }
.landing-title { font-weight: 700; line-height: 0.95; letter-spacing: -4px; font-family: 'Inter', sans-serif; }
.landing-title .line1 { font-size: clamp(60px, 11vw, 132px); color: var(--accent); }
.landing-title .line2 { font-size: clamp(60px, 11vw, 132px); color: #fff; }
.landing-divider { width: 64px; height: 3px; background: var(--accent); border-radius: 2px; margin: 28px auto; }
.landing-sub1 { color: rgba(255,255,255,0.85); font-size: 18px; margin-bottom: 8px; }
.landing-sub2 { color: rgba(255,255,255,0.5); font-size: 15px; font-weight: 500; margin-bottom: 40px; }
.landing-cta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.landing-cta .btn { padding: 11px 20px; font-size: 14px; }
.landing-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 0 48px 60px; max-width: 1200px; margin: 0 auto; position: relative; z-index: 5; }
.landing-stat { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius); padding: 24px 16px; text-align: center; backdrop-filter: blur(6px); }
.landing-stat .num { color: var(--accent); font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.landing-stat .label { color: rgba(255,255,255,0.55); font-size: 13px; margin-top: 4px; }
@media (max-width: 720px) { .landing-stats { grid-template-columns: repeat(2, 1fr); padding: 0 16px 40px; } .landing-topbar { padding: 14px 16px; } }

/* ---------- Auth ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg); }
.auth-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 16px;
    padding: 32px; width: 100%; max-width: 420px; animation: fadeIn 0.3s ease; box-shadow: var(--shadow-lg);
}
.auth-card h2 { text-align: center; margin-bottom: 6px; color: var(--text); font-weight: 700; font-size: 20px; letter-spacing: -0.2px; }
.auth-card .btn { width: 100%; margin-top: 22px; padding: 11px 16px; }
.auth-links { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.auth-links a { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.alert-ok { background: var(--okbox-bg); border-color: var(--okbox-bd); color: var(--okbox-fg); }
.setup-icon { text-align: center; font-size: 30px; color: var(--accent-ink); margin-bottom: 6px; }

/* ---------- App shell ---------- */
.app-shell { display: flex; height: 100vh; overflow: hidden; background: var(--bg); }

.sidebar { width: 236px; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-brand .brand-text .sub { margin: 0; padding: 3px 8px; border-radius: 6px; background: rgba(201,169,97,0.12); color: var(--gold-light); }
.sidebar-brand { padding: 16px 14px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sidebar-brand .badge-logo {
    width: 32px; height: 32px; border-radius: 8px; background: var(--accent); overflow: hidden;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #000;
}
.sidebar-brand .badge-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px !important; }
.sidebar-brand .badge-logo svg { fill: #000; }
.sidebar-brand .brand-text { text-align: right; }
.sidebar-brand .brand-text .name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -0.3px; }
.sidebar-brand .brand-text .sub { color: var(--sidebar-muted); font-size: 11px; letter-spacing: 0.4px; margin-top: 1px; }

.sidebar-search {
    margin: 4px 12px 10px; display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    background: var(--sidebar-hover); border: 1px solid #333; border-radius: 8px; color: var(--sidebar-muted);
}
.sidebar-search input { flex: 1; min-width: 0; background: transparent !important; border: none !important; box-shadow: none !important; color: #fff; font-size: 13px; padding: 0 !important; width: auto; }
.sidebar-search input::placeholder { color: var(--sidebar-muted); }
.sidebar-search kbd { font-family: var(--font); font-size: 11px; color: var(--sidebar-muted); border: 1px solid #3a3a3a; border-radius: 4px; padding: 0 5px; }
.sidebar-search svg { flex-shrink: 0; }

.sidebar nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 1px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
    color: var(--sidebar-text); font-size: 13.5px; font-weight: 500; border: 1px solid transparent;
    transition: background 0.12s ease;
}
.sidebar nav a svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.sidebar nav a:hover { background: var(--sidebar-hover); }
.sidebar nav a.active { background: var(--sidebar-active); border-color: #3d3d3d; color: #fff; font-weight: 600; }
.sidebar nav a.active svg { opacity: 1; }
.sidebar nav .nav-section { font-size: 10.5px; letter-spacing: 1.4px; color: var(--sidebar-muted); padding: 14px 10px 4px; text-transform: uppercase; }
.sidebar nav a.hidden-by-search { display: none; }

.sidebar-user { margin: 6px 10px 10px; padding-top: 10px; border-top: 1px solid #2c2c2c; display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #000; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-user .who { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user a { color: var(--sidebar-muted); display: flex; padding: 6px; border-radius: 6px; }
.sidebar-user a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-user a svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-version { text-align: center; font-size: 10.5px; color: #5c5c5c; padding: 0 0 10px; letter-spacing: 0.4px; }

.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
/* الشريط العلوي يظهر على الموبايل بس (زي سايدبار التصميم المرجعي — من غير topbar على الديسكتوب) */
.topbar { display: none; height: 52px; background: var(--sidebar); color: #fff; align-items: center; justify-content: space-between; padding: 0 14px; flex-shrink: 0; }
.topbar .brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 15px; }
.topbar .brand svg { fill: var(--accent); }
.topbar .user { display: flex; align-items: center; gap: 10px; }
.topbar .user .avatar { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.topbar .user .avatar svg { stroke: #000; }

.content { flex: 1; overflow-y: auto; padding: 24px 28px 40px; animation: fadeIn 0.25s ease; }
.content h1 { margin-bottom: 18px; font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.content h2 { font-size: 15px; font-weight: 650; letter-spacing: -0.1px; }
.content h3 { font-size: 14px; font-weight: 650; }

/* ---------- Stats / Cards ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
    background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
    display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.stat-card.wide { grid-column: 1 / -1; }
.stat-card .stat-label { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.stat-num { color: var(--text); font-size: 24px; font-weight: 700; line-height: 1.15; letter-spacing: -0.5px; }
.stat-card .stat-icon {
    width: 34px; height: 34px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text); font-size: 15px;
}

/* ---------- Tables ---------- */
.data-table-wrap { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 16px; text-align: right; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--surface-2); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .empty { text-align: center; color: var(--muted); padding: 34px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; background: var(--badge-bg); color: var(--badge-fg); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.badge-active { background: var(--ok-bg); color: var(--ok-fg); }
.badge-pending { background: var(--warn-bg); color: var(--warn-fg); }
.badge-suspended { background: var(--bad-bg); color: var(--bad-fg); }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.product-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); transition: box-shadow 0.15s ease, transform 0.15s ease; }
.product-card:hover { box-shadow: 0 6px 20px -6px rgba(0,0,0,0.18); transform: translateY(-2px); }
.product-card h3 { margin-bottom: 8px; font-size: 14.5px; font-weight: 650; }
.product-card p { color: var(--muted); font-size: 13px; margin-bottom: 10px; line-height: 1.6; }
.product-card .price { color: var(--text); font-weight: 700; font-size: 16px; }

/* ---------- Search / filter bar ---------- */
.filter-bar {
    display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border-strong);
    border-radius: 10px; padding: 8px 14px; margin-bottom: 14px; transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.filter-bar:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(201,169,97,0.5); }
.filter-bar input, .filter-bar select { background: transparent !important; border: none !important; box-shadow: none !important; color: var(--text); font-size: 14px; outline: none; padding: 0; width: auto; border-radius: 0; }
.filter-bar input { flex: 1; }
.filter-bar select { padding: 5px 6px !important; background: var(--surface-2) !important; border-radius: 6px !important; }

/* ---------- Misc ---------- */
.activity-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.activity-item { background: var(--card); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); }
.activity-item strong { color: var(--text); font-size: 13px; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.back-link:hover { color: var(--text); }
.pill-list { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; }
.pill-list li { padding: 4px 14px; border-radius: 20px; background: var(--badge-bg); font-size: 13px; }
.page-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.page-actions h1 { margin-bottom: 0; }
.page-actions .actions-left { display: flex; gap: 8px; }

/* العناصر اللي في الـ views ومكتوب لها ستايل inline قديم (للوضع الغامق) — بنوحّدها مع الستايل الجديد */
.content .auth-card { box-shadow: var(--shadow); border: none; max-width: 100%; }
.content .auth-card h2 { text-align: right; font-size: 15px; }
.content code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 12.5px; }
.content a:not(.btn) { text-decoration: none; }

/* ---------- Quick-view Modal ---------- */
.qv-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); backdrop-filter: blur(2px); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.qv-overlay.open { display: flex; }
.qv-box { background: var(--card); border-radius: 16px; padding: 26px; width: 100%; max-width: 440px; position: relative; animation: fadeIn 0.18s ease; box-shadow: var(--shadow-lg); }
.qv-close { position: absolute; top: 14px; left: 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.qv-close:hover { background: var(--border); }
.qv-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.qv-row:last-child { border-bottom: none; }
.qv-loading { text-align: center; padding: 30px; color: var(--muted); }

/* ---------- Mobile ---------- */
.mobile-menu-btn { display: none; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; padding: 4px 8px; }
.sidebar-overlay { display: none; }

@media (max-width: 860px) {
    .app-shell { position: relative; flex-direction: column; }
    .sidebar { position: fixed; top: 0; right: 0; height: 100vh; width: 260px; z-index: 1001; transform: translateX(100%); transition: transform 0.22s ease; box-shadow: -10px 0 30px rgba(0,0,0,0.4); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; }
    .sidebar-overlay.open { display: block; }
    .topbar { display: flex; }
    .mobile-menu-btn { display: inline-flex; align-items: center; }
    .content { padding: 16px 14px 32px; }
    .content h1 { font-size: 18px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .cards-grid { grid-template-columns: 1fr; }
    .page-actions { flex-direction: column; align-items: stretch; }
    .page-actions h1 { text-align: center; }
    .page-actions .actions-left { flex-wrap: wrap; justify-content: center; }
    .filter-bar { flex-wrap: wrap; }
    .filter-bar form { flex-wrap: wrap; }
    .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 640px; }
    div[style*="grid-template-columns:1fr 1fr"], div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns:2fr 1fr"], div[style*="grid-template-columns: 2fr 1fr"] { grid-template-columns: 1fr !important; }
    .auth-card { padding: 24px 20px; }
    .landing-title .line1, .landing-title .line2 { font-size: clamp(48px, 16vw, 90px); }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .btn { padding: 9px 14px; }
}

/* ---------- الوضع الداكن ---------- */
[data-theme="dark"] {
    --accent-ink: #E2C575;
    --accent-soft: rgba(201,169,97,0.14);
    --bg: #0a0a0a;
    --card: #1b1b1d;
    --surface-2: #252527;
    --border: #2c2c2f;
    --border-strong: #3d3d41;
    --text: #ececee;
    --muted: #a1a1a8;
    --muted-soft: #6f6f76;
    --green: #3ecf8e;
    --red: #ff6b5a;
    --sidebar: #050505;
    --sidebar-hover: #17171a;
    --sidebar-active: #232327;
    --shadow: 0 0 0 1px rgba(255,255,255,0.04);
    --shadow-lg: 0 18px 50px -12px rgba(0,0,0,0.7);
    --input-bg: #141416;
    --focus: #C9A961;
    --badge-bg: #2c2c2f; --badge-fg: #c9c9ce;
    --ok-bg: rgba(62,207,142,0.16);  --ok-fg: #5be3a6;
    --warn-bg: rgba(201,169,97,0.18); --warn-fg: #E2C575;
    --bad-bg: rgba(255,107,90,0.16); --bad-fg: #ff8f81;
    --alert-bg: rgba(255,107,90,0.1); --alert-bd: rgba(255,107,90,0.35); --alert-fg: #ff9a8d;
    --okbox-bg: rgba(62,207,142,0.1); --okbox-bd: rgba(62,207,142,0.35); --okbox-fg: #5be3a6;
    --hover-soft: rgba(255,255,255,0.07);
    --scroll: rgba(255,255,255,0.18);
}
[data-theme="dark"] .product-card:hover { box-shadow: 0 6px 24px -6px rgba(0,0,0,0.7); }
[data-theme="dark"] select option { background: var(--card); color: var(--text); }
[data-theme="dark"] .auth-card, [data-theme="dark"] .qv-box { border: 1px solid var(--border); }
[data-theme="dark"] .btn-primary { color: #000; }

/* ---------- زر تبديل الوضع ---------- */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; border: none; background: transparent; color: var(--sidebar-muted); cursor: pointer; padding: 0; }
.theme-toggle:hover { background: var(--sidebar-hover); color: #fff; }
.theme-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .ic-sun { display: none; } .theme-toggle .ic-moon { display: inline-flex; }
[data-theme="dark"] .theme-toggle .ic-sun { display: inline-flex; } [data-theme="dark"] .theme-toggle .ic-moon { display: none; }
.theme-toggle-float { position: fixed; top: 14px; left: 14px; z-index: 50; width: 36px; height: 36px; font-size: 17px; background: var(--card); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.theme-toggle-float:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle-float .ic-sun, .theme-toggle-float .ic-moon { display: none; }
.theme-toggle-float .ic-moon { display: inline; }
[data-theme="dark"] .theme-toggle-float .ic-moon { display: none; }
[data-theme="dark"] .theme-toggle-float .ic-sun { display: inline; }
.landing-hero ~ .theme-toggle-float, body:has(.landing-hero) .theme-toggle-float { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.2); }

/* ---------- النوافذ المنبثقة (data-modal) ---------- */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 1100; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); }
.modal-overlay.open { display: flex; }
body.modal-lock { overflow: hidden; }
.modal-dialog { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 16px; width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; box-shadow: var(--shadow-lg); animation: fadeIn 0.18s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal-title { font-size: 15px; font-weight: 700; }
.modal-x { width: 28px; height: 28px; border-radius: 8px; border: none; background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 13px; }
.modal-x:hover { background: var(--border); color: var(--text); }
.modal-card { display: block !important; background: transparent !important; border: none !important; box-shadow: none !important; max-width: none !important; width: 100% !important; margin: 0 !important; padding: 4px 20px 20px !important; animation: none !important; }
.modal-card::before { display: none !important; }
.modal-card > h2:first-child, .modal-card > h3:first-child { display: none; }
.modal-card .btn[type="submit"]:not(.btn-sm) { width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
@media (max-width: 860px) { .modal-overlay { align-items: flex-end; padding: 0; } .modal-dialog { width: 100%; border-radius: 16px 16px 0 0; max-height: 92vh; } }

/* تعبئة المتصفح التلقائية (autofill) كانت بتطلع أزرق فاتح في الداكن */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, select:-webkit-autofill, textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important; -webkit-text-fill-color: var(--text) !important; caret-color: var(--text); transition: background-color 9999s ease-out;
}

/* ---------- الهوية البصرية (Brand Guidelines) ---------- */
.display { font-family: var(--font-display); font-style: italic; font-weight: 900; text-transform: uppercase; letter-spacing: -0.01em; }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.eyebrow { font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent-ink); font-weight: 600; }
.brand-logo { display: inline-flex; align-items: center; gap: 10px; line-height: 1; }
.brand-logo .mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-logo .word { display: flex; flex-direction: column; font-family: var(--font-display); font-style: italic; font-weight: 900; text-transform: uppercase; letter-spacing: -0.01em; line-height: 0.9; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; direction: ltr; text-align: left; }
.brand-logo .word span:first-child { font-size: 0.62em; letter-spacing: 0.2em; }
.brand-logo .word span:last-child { font-size: 1em; }
.brand-logo.mark-only .word { display: none; }
.sidebar-brand .brand-logo { font-size: 17px; }
.sidebar-brand .badge-logo { background: transparent; }
.sidebar nav a.active { background: linear-gradient(100deg, rgba(243,224,143,0.10), rgba(201,169,97,0.04)); border-color: rgba(201,169,97,0.35); }
.sidebar nav a.active svg { color: var(--gold-light); }
.content h1 { font-family: var(--font); }
.stat-num { font-variant-numeric: tabular-nums; }
.sidebar-user .avatar, .topbar .user .avatar { background: var(--btn-grad); }

.modal-dialog.modal-lg { width: min(900px, 100%); display: flex; flex-direction: column; height: min(86vh, 900px); overflow: hidden; }
.modal-frame { flex: 1; width: 100%; border: 0; background: var(--card); }
body.embed { background: var(--card); }
body.embed .content { padding: 8px 22px 26px; overflow: visible; animation: none; height: auto; }
body.embed .content > h1:first-child, body.embed .page-actions > h1, body.embed .back-link { display: none; }
body.embed .content .auth-card { box-shadow: none; max-width: 100%; border: none; padding: 0; background: transparent; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; margin-bottom: 10px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.setting-row b { font-size: 14.5px; }
.setting-row .muted { margin-top: 2px; }
