/* =====================================================================
   كود أعمال — نظام التصميم المركزي (Design System)
   كل الألوان والخطوط والمكوّنات تُعرّف هنا. أي تعديل على الهوية من هنا فقط.
   ===================================================================== */

/* ============ الخط: IBM Plex Sans Arabic (مستضاف محلياً) ============ */
/* لكل وزن: ملف عربي (بنطاق يونيكود عربي) + ملف لاتيني (افتراضي للأرقام واللاتيني) */
@font-face { font-family:'IBM Plex Sans Arabic'; font-style:normal; font-weight:400; font-display:swap;
  src:url('/assets/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Sans Arabic'; font-style:normal; font-weight:400; font-display:swap;
  src:url('/assets/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2') format('woff2');
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-089F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200D; }
@font-face { font-family:'IBM Plex Sans Arabic'; font-style:normal; font-weight:500; font-display:swap;
  src:url('/assets/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Sans Arabic'; font-style:normal; font-weight:500; font-display:swap;
  src:url('/assets/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2') format('woff2');
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-089F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200D; }
@font-face { font-family:'IBM Plex Sans Arabic'; font-style:normal; font-weight:600; font-display:swap;
  src:url('/assets/fonts/ibm-plex-sans-arabic-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Sans Arabic'; font-style:normal; font-weight:600; font-display:swap;
  src:url('/assets/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2') format('woff2');
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-089F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200D; }
@font-face { font-family:'IBM Plex Sans Arabic'; font-style:normal; font-weight:700; font-display:swap;
  src:url('/assets/fonts/ibm-plex-sans-arabic-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Sans Arabic'; font-style:normal; font-weight:700; font-display:swap;
  src:url('/assets/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2') format('woff2');
  unicode-range:U+0600-06FF,U+0750-077F,U+0870-089F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200D; }

/* ============ التوكنز (Design Tokens) ============ */
:root {
    /* الهوية */
    --brand-primary:        #FF5284;
    --brand-primary-hover:  #ED3E6E;
    --brand-primary-active: #D62E5C;
    --brand-primary-soft:   #FFF0F4;   /* خلفية وردية خفيفة جداً */
    --brand-secondary:      #F6D3AD;   /* بيج */
    --brand-secondary-soft: #FBEBD7;
    --brand-light:          #FFEED4;   /* بيج فاتح */

    /* المحايدة */
    --bg:        #F7F8FA;   /* خلفية الصفحة */
    --surface:   #FFFFFF;
    --surface-2: #FBFCFD;
    --text:      #1F2430;   /* النص الأساسي */
    --text-soft: #4B5563;
    --muted:     #6B7280;   /* نص ثانوي */
    --border:    #E6E8EE;
    --border-strong: #D5DAE2;

    /* الحالات الوظيفية (ليست ألوان هوية) */
    --success: #16A34A; --success-bg: #ECFDF3; --success-bd:#BBF7D0;
    --warning: #D97706; --warning-bg: #FFF7ED; --warning-bd:#FED7AA;
    --danger:  #DC2626; --danger-bg:  #FEF2F2; --danger-bd: #FECACA;
    --info:    #2563EB; --info-bg:    #EFF6FF; --info-bd:   #BFDBFE;
    --neutral: #6B7280; --neutral-bg: #F1F5F9; --neutral-bd:#E2E8F0;

    /* الخط */
    --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif;
    --fw-normal: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;

    /* أحجام Typography */
    --fs-page-title: 22px;
    --fs-section:    18px;
    --fs-card-title: 15px;
    --fs-body:       14px;
    --fs-small:      12.5px;

    /* المسافات */
    --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
    --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;

    /* الأركان والظلال */
    --radius-sm: 8px; --radius: 10px; --radius-lg: 14px; --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
    --shadow:    0 1px 3px rgba(16,24,40,.07), 0 1px 2px rgba(16,24,40,.04);

    /* أبعاد التخطيط */
    --sidebar-w: 262px;
    --topbar-h: 64px;
    --ring: 0 0 0 3px rgba(255,82,132,.22);
}

/* ============ إعادة ضبط أساسية ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }
body {
    font-family: var(--font);
    font-size: var(--fs-body);
    font-weight: var(--fw-normal);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
svg { display: block; }

/* ============ Typography System ============ */
.page-title   { font-size: var(--fs-page-title); font-weight: var(--fw-bold); line-height: 1.3; }
.section-title{ font-size: var(--fs-section); font-weight: var(--fw-bold); line-height: 1.35; }
.card-title   { font-size: var(--fs-card-title); font-weight: var(--fw-semibold); }
.text-body    { font-size: var(--fs-body); font-weight: var(--fw-normal); }
.text-small,
.caption      { font-size: var(--fs-small); color: var(--muted); }
.numeric      { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; letter-spacing: .2px; }
.text-muted   { color: var(--muted); }
.text-brand   { color: var(--brand-primary); }

/* ============ الأيقونات (Lucide) ============ */
.icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none;
        stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }

/* ============ الأزرار (Button System) ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    font-size: var(--fs-body); font-weight: var(--fw-semibold); line-height: 1;
    cursor: pointer; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .icon { width: 18px; height: 18px; }

.btn-primary   { background: var(--brand-primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-primary-hover); }
.btn-primary:active:not(:disabled){ background: var(--brand-primary-active); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); }

.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #B91C1C; }
.btn-danger-soft { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bd); }
.btn-danger-soft:hover:not(:disabled) { background: #FEE2E2; }

.btn-ghost     { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: var(--neutral-bg); color: var(--text); }

.btn-sm { height: 34px; padding: 0 12px; font-size: var(--fs-small); border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* ============ الحقول (Forms) ============ */
.field { margin-bottom: var(--space-4); }
.field label, .form-label {
    display: block; font-size: var(--fs-body); font-weight: var(--fw-medium);
    margin-bottom: 6px; color: var(--text-soft);
}
.input, .select, textarea.input {
    width: 100%; height: 40px; padding: 0 12px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-family: inherit; font-size: var(--fs-body); font-weight: var(--fw-medium);
    color: var(--text); background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 10px 12px; line-height: 1.6; }
.input::placeholder { color: #9AA3B2; font-weight: var(--fw-normal); }
.input:focus, .select:focus, textarea.input:focus {
    outline: none; border-color: var(--brand-primary); box-shadow: var(--ring);
}
.input.is-error { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: var(--fs-small); margin-top: 5px; }

input[type="checkbox"], input[type="radio"] {
    width: 17px; height: 17px; accent-color: var(--brand-primary); cursor: pointer;
}

/* ============ التنبيهات (Alerts) ============ */
.alert {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 15px; border-radius: var(--radius-sm);
    font-size: var(--fs-body); font-weight: var(--fw-medium);
    margin-bottom: var(--space-4); border: 1px solid transparent;
}
.alert .icon { width: 18px; height: 18px; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success-bd); }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-bd); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-bd); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info-bd); }

/* ============ الشارات (Badges / Status) ============ */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: var(--fs-small); font-weight: var(--fw-semibold);
    padding: 3px 10px; border-radius: var(--radius-pill); line-height: 1.5;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral); }
.badge-brand   { background: var(--brand-primary-soft); color: var(--brand-primary-active); }

/* ============ البطاقات (Cards) ============ */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: var(--space-6);
}
.card + .card { margin-top: var(--space-4); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }

/* ============ رأس الصفحة ============ */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-5); gap: var(--space-3); flex-wrap: wrap; }
.page-head h1, .page-head h3 { font-size: var(--fs-section); font-weight: var(--fw-bold); line-height: 1.3; }
.page-head .page-title { font-size: var(--fs-page-title); }
.page-head .sub { color: var(--muted); font-size: var(--fs-small); margin-top: 3px; font-weight: var(--fw-normal); }

/* ============ بطاقات الإحصائيات ============ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: var(--space-5); display: flex; align-items: center; gap: var(--space-4);
}
.stat-card .s-icon {
    width: 46px; height: 46px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    background: var(--brand-primary-soft); color: var(--brand-primary);
}
.stat-card .s-icon.beige { background: var(--brand-secondary-soft); color: #B4763A; }
.stat-card .s-icon.neutral { background: var(--neutral-bg); color: var(--text-soft); }
.stat-card .s-icon .icon { width: 22px; height: 22px; }
.stat-card .s-value { font-size: 24px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-card .s-label { font-size: var(--fs-small); color: var(--muted); margin-top: 2px; }

/* ============ الجداول (Table) ============ */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 13px 18px; text-align: right; font-size: var(--fs-body); }
table.data thead th {
    background: var(--surface-2); color: var(--muted);
    font-weight: var(--fw-semibold); font-size: var(--fs-small);
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data tbody tr { border-bottom: 1px solid var(--border); }
table.data tbody tr:last-child { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num, table.data th.num { font-variant-numeric: tabular-nums; }
.cell-strong { font-weight: var(--fw-semibold); }
.cell-ltr { direction: ltr; text-align: right; }
.actions { display: flex; gap: 8px; align-items: center; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .icon { width: 34px; height: 34px; margin: 0 auto 10px; color: var(--border-strong); }

/* ============ التخطيط: Sidebar + Topbar ============ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w); background: var(--surface);
    border-inline-start: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; right: 0; z-index: 20;
}
.sidebar-brand { padding: 18px 20px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--border); }
.sidebar-brand .logo { width: 38px; height: 38px; flex-shrink: 0; }
.sidebar-brand .name { font-weight: var(--fw-bold); font-size: 15.5px; color: var(--text); line-height: 1.25; }
.sidebar-brand .name small { display: block; color: var(--muted); font-weight: var(--fw-medium); font-size: 11px; }

.nav { padding: 10px; flex: 1; overflow-y: auto; }
.nav-section { color: #9AA3B2; font-size: 11px; font-weight: var(--fw-bold); padding: 14px 12px 6px; letter-spacing: .3px; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    font-size: var(--fs-body); font-weight: var(--fw-medium);
    color: var(--text-soft); margin-bottom: 2px;
    transition: background-color .12s, color .12s;
}
.nav-item .icon { width: 19px; height: 19px; color: var(--muted); }
.nav-item:hover { background: var(--neutral-bg); color: var(--text); }
.nav-item:hover .icon { color: var(--text-soft); }
.nav-item.active { background: var(--brand-primary-soft); color: var(--brand-primary-active); font-weight: var(--fw-semibold); }
.nav-item.active .icon { color: var(--brand-primary); }
.nav-item.is-soon { color: #AEB4BF; cursor: default; }
.nav-item.is-soon .icon { color: #C7CCD4; }
.nav-item .soon { margin-inline-start: auto; font-size: 10px; background: var(--neutral-bg); color: var(--muted); padding: 2px 8px; border-radius: var(--radius-pill); font-weight: var(--fw-semibold); }

.main { flex: 1; margin-right: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: var(--topbar-h); background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--space-6); position: sticky; top: 0; z-index: 10;
}
.topbar .t-title { font-size: var(--fs-section); font-weight: var(--fw-bold); }
.topbar .t-right { display: flex; align-items: center; gap: var(--space-4); }

.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--brand-primary-soft); color: var(--brand-primary-active);
    display: flex; align-items: center; justify-content: center; font-weight: var(--fw-bold);
}
.user-chip .u-name { font-size: var(--fs-body); font-weight: var(--fw-semibold); line-height: 1.2; }
.user-chip .u-role { font-size: var(--fs-small); color: var(--muted); }

.content { padding: var(--space-6); flex: 1; }

/* ============ النماذج (تخطيط) ============ */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: var(--space-6); max-width: 620px; }
.role-checks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.check-chip { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; font-size: var(--fs-body); font-weight: var(--fw-medium); user-select: none; transition: border-color .12s, background-color .12s; }
.check-chip:hover { border-color: var(--brand-primary); background: var(--brand-primary-soft); }
.form-actions { margin-top: var(--space-5); display: flex; gap: 10px; }

/* ============ شبكة الصلاحيات ============ */
.perm-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 20px; margin-bottom: var(--space-3); }
.perm-group h4 { font-size: var(--fs-card-title); font-weight: var(--fw-bold); margin-bottom: 13px; display: flex; align-items: center; gap: 8px; }
.perm-group h4 .icon { width: 18px; height: 18px; color: var(--brand-primary); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.perm-item { display: flex; align-items: center; gap: 9px; font-size: var(--fs-small); padding: 8px 10px; border-radius: var(--radius-sm); }
.perm-item:hover { background: var(--surface-2); }
.perm-item code { font-size: 12px; color: var(--text-soft); direction: ltr; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ============ صفحة الدخول ============ */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 38px 32px; }
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-brand .logo { width: 56px; height: 56px; margin: 0 auto 14px; }
.auth-brand h1 { font-size: 21px; font-weight: var(--fw-bold); }
.auth-brand p { color: var(--muted); font-size: var(--fs-small); margin-top: 4px; }

/* ============ صفحات الأخطاء ============ */
.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px; }
.error-page h1 { font-size: 64px; color: var(--brand-primary); font-weight: var(--fw-bold); }

/* ============ بوابة العميل ============ */
.cust-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.cust-bar { max-width: 1100px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cust-brand { display: flex; align-items: center; gap: 10px; }
.cust-brand .logo { width: 34px; height: 34px; }
.cust-brand .name { font-weight: var(--fw-bold); font-size: 15px; }
.cust-nav { display: flex; align-items: center; gap: 4px; }
.cust-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: var(--radius-sm); font-size: 14px; font-weight: var(--fw-medium); color: var(--text-soft); }
.cust-nav a .icon { width: 18px; height: 18px; }
.cust-nav a:hover { background: var(--neutral-bg); color: var(--text); }
.cust-nav a.active { background: var(--brand-primary-soft); color: var(--brand-primary-active); }
.cust-balance { display: inline-flex; align-items: center; gap: 8px; background: var(--brand-primary-soft); color: var(--brand-primary-active); padding: 7px 13px; border-radius: var(--radius-pill); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.cust-main { max-width: 1100px; margin: 0 auto; padding: 24px 20px; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; display: flex; flex-direction: column; }
.product-card .p-cat { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.product-card .p-name { font-weight: var(--fw-semibold); font-size: 15px; margin-bottom: 8px; flex: 1; }
.product-card .p-price { font-size: 20px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; margin-bottom: 12px; }
.product-card .p-type { font-size: 11.5px; color: var(--muted); margin-bottom: 12px; }

/* عمودان يتحوّلان لعمود واحد على الجوال */
.two-col { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }

/* الشريط السفلي (جوال فقط) */
.cust-bottom-nav { display: none; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 24px; width: 100%; max-width: 420px; }
.modal h3 { font-size: 17px; font-weight: var(--fw-bold); margin-bottom: 4px; }

/* ============ استجابة ============ */
@media (max-width: 860px) {
    .sidebar { transform: translateX(100%); }
    .main { margin-right: 0; }
}

/* ===== الجوال: بوابة العميل ===== */
@media (max-width: 768px) {
    .two-col { grid-template-columns: 1fr; }

    /* إخفاء روابط الأعلى وإظهار شريط سفلي بالأيقونات */
    .cust-nav { display: none; }
    .cust-bar { height: 58px; padding: 0 16px; }
    .cust-brand .name { display: none; }
    .cust-main { padding: 18px 16px calc(78px + env(safe-area-inset-bottom)); }

    .cust-bottom-nav {
        display: flex;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
        background: var(--surface); border-top: 1px solid var(--border);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        box-shadow: 0 -2px 10px rgba(15,23,42,.05);
    }
    .cust-bottom-nav a {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
        padding: 6px 4px; border-radius: var(--radius-sm);
        font-size: 11px; font-weight: var(--fw-medium); color: var(--muted);
    }
    .cust-bottom-nav a .icon { width: 22px; height: 22px; }
    .cust-bottom-nav a.active { color: var(--brand-primary); }

    /* بطاقتان بالصف على الجوال */
    .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-card { padding: 14px; }
    .product-card .p-price { font-size: 18px; }

    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .page-title { font-size: 20px; }

    /* الجداول: تمرير أفقي بدل الانكسار */
    .table-card, .card { overflow-x: auto; }
}

@media (max-width: 380px) {
    .shop-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
}
