/* ══════════════════════════════════════════════════════════════
   مستودع مسك — Layout (landing · auth · dashboard shell)
   ══════════════════════════════════════════════════════════════ */

/* ─── العلامة ─── */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; }
.brand-mark { width: 38px; height: 38px; border-radius: var(--r-sm); background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-brand); }
.brand-mark .ico { width: 22px; height: 22px; }
.brand-name { line-height: 1; }
.brand-lg { font-size: 1.4rem; }
.brand-lg .brand-mark { width: 46px; height: 46px; }

/* ─── شريط التنقّل العام ─── */
.topnav { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--border); }
.topnav-inner { max-width: var(--container); margin: 0 auto; height: var(--topbar-h); padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topnav-links { display: flex; gap: 4px; }
.topnav-links a { padding: 8px 14px; border-radius: var(--r-sm); font-size: .9rem; font-weight: 600; color: var(--text-2); transition: var(--t); }
.topnav-links a:hover { color: var(--text); background: var(--surface-3); }
.topnav-actions { display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; }
.mobile-menu { display: none; flex-direction: column; gap: 6px; padding: 14px 24px 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.mobile-menu.open { display: flex; }
.mobile-menu a { padding: 10px 12px; border-radius: var(--r-sm); font-weight: 600; color: var(--text-2); }
.mobile-menu a:hover { background: var(--surface-3); }

/* ─── البطل (Hero) ─── */
.hero { max-width: var(--container); margin: 0 auto; padding: 56px 24px 40px; position: relative; }
.hero::before {
    content: ''; position: absolute; inset: -50px 0 auto 0; height: 560px; z-index: -1; pointer-events: none; opacity: .85;
    background:
        radial-gradient(440px circle at 16% 22%, var(--violet-soft), transparent 62%),
        radial-gradient(480px circle at 84% 8%, var(--brand-soft), transparent 60%),
        radial-gradient(380px circle at 58% 64%, var(--sun-soft), transparent 66%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--r-full); background: var(--brand-tint); color: var(--brand-strong); font-size: .82rem; font-weight: 700; margin-bottom: 20px; }
.hero-eyebrow .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.hero-copy h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 900; line-height: 1.12; margin-bottom: 18px; }
.hero-copy > p { font-size: 1.08rem; color: var(--text-2); max-width: 520px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 34px; }
.hero-stats { display: flex; align-items: center; gap: 22px; }
.hero-stats > div:not(.sep) { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.9rem; font-weight: 900; letter-spacing: -.02em; }
.hero-stats span { font-size: .82rem; color: var(--text-2); }
.hero-stats .sep { width: 1px; height: 38px; background: var(--border-2); }

.hero-visual { position: relative; height: 420px; }
.hero-blob { position: absolute; inset: 8% 6%; border-radius: 42% 58% 56% 44% / 50% 44% 56% 50%; background: linear-gradient(140deg, var(--brand-400), var(--brand-700)); opacity: .14; filter: blur(8px); animation: blob 12s ease-in-out infinite; }
@keyframes blob { 50% { border-radius: 56% 44% 42% 58% / 44% 56% 44% 56%; transform: scale(1.05); } }
.float-card { position: absolute; display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 15px; box-shadow: var(--sh-md); animation: floaty 5s ease-in-out infinite; }
.float-card strong { font-size: .9rem; display: block; }
.float-card small { font-size: .74rem; color: var(--text-2); }
.float-card b { font-size: .92rem; color: var(--brand); white-space: nowrap; }
.fc-ico { width: 40px; height: 40px; border-radius: var(--r-xs); display: flex; align-items: center; justify-content: center; background: hsl(var(--hue,200) 72% 94%); color: hsl(var(--hue,200) 60% 40%); }
[data-theme="dark"] .fc-ico { background: hsl(var(--hue,200) 40% 18%); color: hsl(var(--hue,200) 70% 66%); }
.float-card.f1 { top: 8%; right: 4%; animation-delay: 0s; }
.float-card.f2 { top: 42%; left: 0; animation-delay: .8s; }
.float-card.f3 { bottom: 12%; right: 12%; animation-delay: 1.6s; }
@keyframes floaty { 50% { transform: translateY(-12px); } }
.hero-panel { position: absolute; bottom: 4%; left: 6%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh-lg); width: 188px; }
.hp-label { font-size: .76rem; color: var(--text-2); }
.hp-value { font-size: 1.5rem; font-weight: 900; color: var(--brand); margin: 2px 0 10px; }
.hp-bars { display: flex; align-items: flex-end; gap: 5px; height: 38px; }
.hp-bars span { flex: 1; background: var(--brand-soft); border-radius: 3px; animation: bar 1.6s ease-in-out infinite; }
.hp-bars span:nth-child(odd) { background: var(--brand); }
.hp-bars span:nth-child(1){height:40%;animation-delay:0s} .hp-bars span:nth-child(2){height:70%;animation-delay:.1s} .hp-bars span:nth-child(3){height:50%;animation-delay:.2s} .hp-bars span:nth-child(4){height:90%;animation-delay:.3s} .hp-bars span:nth-child(5){height:60%;animation-delay:.4s} .hp-bars span:nth-child(6){height:80%;animation-delay:.5s} .hp-bars span:nth-child(7){height:45%;animation-delay:.6s}
@keyframes bar { 50% { transform: scaleY(.7); } }

/* ─── الأقسام العامة ─── */
.section { max-width: var(--container); margin: 0 auto; padding: 64px 24px; }
.section-alt { max-width: none; background: var(--surface-2); border-block: 1px solid var(--border); }
.section-alt > * { max-width: var(--container); margin-inline: auto; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.eyebrow { display: inline-block; font-size: .82rem; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); font-weight: 900; margin-bottom: 12px; }
.section-head p { color: var(--text-2); font-size: 1.02rem; }

.cats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.cat-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); transition: var(--t); box-shadow: var(--sh-xs); text-align: center; }
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: hsl(var(--hue,200) 70% 70%); }
.cat-ico { width: 54px; height: 54px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; background: hsl(var(--hue,200) 72% 94%); color: hsl(var(--hue,200) 60% 40%); }
[data-theme="dark"] .cat-ico { background: hsl(var(--hue,200) 40% 17%); color: hsl(var(--hue,200) 72% 66%); }
.cat-name { font-weight: 700; font-size: .95rem; }
.cat-count { font-size: .78rem; color: var(--text-2); }

.cta-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 40px; padding: 32px 36px; border-radius: var(--r-xl); background: linear-gradient(130deg, var(--brand-600), var(--brand-800)); color: #fff; flex-wrap: wrap; box-shadow: var(--sh-md); }
.cta-banner h3 { font-size: 1.5rem; margin-bottom: 6px; }
.cta-banner p { opacity: .9; max-width: 460px; }
.cta-banner .btn-primary { background: #fff; color: var(--brand-strong); box-shadow: none; }
.cta-banner .btn-primary:hover { background: var(--brand-50); }

.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.feature { padding: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-xs); transition: var(--t); }
.feature:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.feature-ico { width: 52px; height: 52px; border-radius: var(--r); background: var(--brand-tint); color: var(--brand); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.feature-ico .ico { width: 26px; height: 26px; }
.features-grid .feature:nth-child(1) .feature-ico { background: var(--brand-tint);   color: var(--brand); }
.features-grid .feature:nth-child(2) .feature-ico { background: var(--violet-soft);  color: var(--violet); }
.features-grid .feature:nth-child(3) .feature-ico { background: var(--sun-soft);     color: var(--sun); }
.features-grid .feature:nth-child(4) .feature-ico { background: var(--rose-soft);    color: var(--rose); }
.features-grid .feature:nth-child(5) .feature-ico { background: var(--sky-soft);     color: var(--sky); }
.features-grid .feature:nth-child(6) .feature-ico { background: var(--emerald-soft); color: var(--emerald); }
.feature h3 { font-size: 1.15rem; margin-bottom: 8px; }
.feature p { color: var(--text-2); font-size: .92rem; }

.public-footer { background: var(--surface-2); border-top: 1px solid var(--border); padding: 48px 24px 24px; }
.footer-grid { max-width: var(--container); margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
.footer-brand p { color: var(--text-2); font-size: .9rem; margin-top: 12px; max-width: 320px; }
.footer-col h4 { font-size: .95rem; margin-bottom: 12px; }
.footer-col a { display: block; color: var(--text-2); font-size: .88rem; padding: 4px 0; transition: var(--t); }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { max-width: var(--container); margin: 28px auto 0; padding-top: 20px; border-top: 1px solid var(--border); text-align: center; color: var(--text-3); font-size: .84rem; }

/* ─── شاشة الدخول ─── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside { position: relative; background: var(--side-bg); color: var(--side-text-strong); padding: 40px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.auth-back { position: absolute; top: 28px; right: 32px; display: inline-flex; align-items: center; gap: 6px; color: var(--side-text); font-weight: 600; font-size: .88rem; transition: var(--t); z-index: 2; }
.auth-back:hover { color: #fff; }
.auth-aside-inner { position: relative; z-index: 2; max-width: 380px; }
.auth-aside-inner h2 { font-size: 1.8rem; margin: 24px 0 28px; line-height: 1.4; }
.auth-perks { display: flex; flex-direction: column; gap: 14px; }
.auth-perks li { display: flex; align-items: center; gap: 12px; font-size: .98rem; color: var(--side-text); }
.tick { width: 26px; height: 26px; border-radius: 999px; background: rgba(255,255,255,.1); color: var(--brand-300); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-aside-deco { position: absolute; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(circle, var(--brand-500), transparent 68%); opacity: .28; bottom: -180px; left: -120px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 30px; box-shadow: var(--sh-md); }
.auth-tabs { display: flex; background: var(--surface-2); border-radius: var(--r); padding: 5px; margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 10px; border-radius: var(--r-sm); font-weight: 700; color: var(--text-2); transition: var(--t); }
.auth-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); }
.auth-hint { text-align: center; font-size: .82rem; color: var(--text-2); margin-top: 14px; }
.auth-hint b { color: var(--brand); }

/* ─── هيكل اللوحة (Dashboard shell) ─── */
.app-shell { min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; z-index: 80; transition: transform .3s var(--ease); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 8px 10px 18px; font-weight: 800; font-size: 1.2rem; color: #fff; border-bottom: 1px solid var(--side-border); margin-bottom: 14px; }
.sidebar-brand span { display: flex; flex-direction: column; line-height: 1.1; }
.sidebar-brand small { font-size: .68rem; font-weight: 600; color: var(--side-text); }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--r-sm); color: var(--side-text); font-weight: 600; font-size: .92rem; transition: var(--t); position: relative; text-align: right; width: 100%; }
.nav-item .ico { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item span:first-of-type { flex: 1; }
.nav-item:hover { background: var(--side-hover); color: var(--side-text-strong); }
.nav-item.active { background: var(--side-active); color: #fff; box-shadow: var(--sh-brand); }
.nav-item.danger:hover { background: rgba(225,29,72,.16); color: #fda4b4; }
.nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.nav-item.active .nav-badge { background: rgba(255,255,255,.25); }
.sidebar-foot { display: flex; flex-direction: column; gap: 4px; padding-top: 14px; border-top: 1px solid var(--side-border); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 70; height: var(--topbar-h); background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; }
.topbar-start { display: flex; align-items: center; gap: 12px; }
.topbar-start h1 { font-size: 1.2rem; font-weight: 800; }
.topbar-end { display: flex; align-items: center; gap: 10px; }
.sidebar-toggle { display: none; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 14px 5px 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-full); font-weight: 700; font-size: .88rem; }
.content { padding: 24px; max-width: 1320px; width: 100%; margin: 0 auto; flex: 1; }
.view { display: none; animation: viewIn .3s var(--ease); }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

.scrim { position: fixed; inset: 0; background: rgba(8,15,25,.5); z-index: 75; opacity: 0; visibility: hidden; transition: opacity .3s var(--ease); }
.scrim.show { opacity: 1; visibility: visible; }

/* ─── الاستجابة ─── */
@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-visual { height: 340px; max-width: 480px; margin: 0 auto; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .topnav-links { display: none; }
    .menu-toggle { display: inline-flex; }
    .topnav-actions .btn-ghost, .topnav-actions .btn-primary { display: none; }
    .auth { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .sidebar { position: fixed; inset-block: 0; inset-inline-end: 0; transform: translateX(100%); box-shadow: var(--sh-lg); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: inline-flex; }
}
@media (max-width: 600px) {
    .hero { padding-top: 32px; }
    .hero-stats { gap: 14px; }
    .hero-stats strong { font-size: 1.5rem; }
    .section { padding: 44px 18px; }
    .content { padding: 16px; }
    .topbar { padding: 0 14px; }
    .user-chip span:last-child { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
    .cart-row { grid-template-columns: auto 1fr auto; row-gap: 10px; }
    .cart-line { grid-column: 2 / -1; text-align: right; }
    .cart-del { position: absolute; }
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal { max-width: none; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 94vh; }
    .stepper-step { width: 64px; }
    .toast-container { left: 12px; right: 12px; max-width: none; }
}
