@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root{
  --bg:#0B0A0A; --bg-raised:#151515; --stone:#1D1B19; --stone-deep:#28211F;
  --ink:#F5F1E8; --ink-soft:#C7C2B4; --ink-faint:#8A8983; --line:#2E2C28;
  --accent:#7A1018; --accent-hover:#93151F;
  --good:#5C8A6A; --warn:#B98A3A; --bad:#A6394A;
  --font:'Vazirmatn', sans-serif; --dur:.25s; --ease:cubic-bezier(.22,.61,.36,1);
}
*{box-sizing:border-box; margin:0; padding:0;}
body{ background:var(--bg); color:var(--ink); font-family:var(--font); direction:rtl; }
a{ color:inherit; text-decoration:none; }
button, input, select, textarea{ font-family:inherit; color:inherit; }
button{ cursor:pointer; }
ul{ list-style:none; }
table{ width:100%; border-collapse:collapse; }

.disp{ font-weight:800; }
.label{ font-weight:600; font-size:12.5px; color:var(--ink-faint); }

/* -------- topbar / sidebar shell -------- */
.topbar{ display:flex; align-items:center; justify-content:space-between; padding:14px 22px; background:var(--bg-raised); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:50; }
.logo{ font-weight:800; font-size:15px; display:flex; align-items:center; gap:9px; }
.logo .tag{ font-size:10px; font-weight:600; color:var(--accent); border:1px solid var(--accent); padding:2px 7px; }
.tb-right{ display:flex; align-items:center; gap:14px; }
.avatar{ width:32px; height:32px; border-radius:50%; background:var(--accent); color:#F5F1E8; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12.5px; }
.logout-btn{ font-size:12.5px; color:var(--ink-faint); background:none; border:1px solid var(--line); border-radius:6px; padding:6px 12px; }

.shell{ display:flex; min-height:calc(100vh - 66px); }
.sidebar{ width:230px; flex-shrink:0; background:var(--bg-raised); border-inline-end:1px solid var(--line); padding:20px 14px; }
.side-link{ display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:8px; font-size:14px; color:var(--ink-soft); margin-bottom:2px; }
.side-link:hover{ background:var(--stone); color:var(--ink); }
.side-link.active{ background:var(--accent); color:#F5F1E8; }
.content{ flex:1; padding:30px 32px; min-width:0; }
@media(max-width:860px){ .shell{ flex-direction:column; } .sidebar{ width:100%; display:flex; overflow-x:auto; border-inline-end:none; border-bottom:1px solid var(--line); } .side-link{ white-space:nowrap; } .content{ padding:20px 16px; } }

.view-head{ margin-bottom:22px; }
.view-head h1{ font-size:22px; font-weight:800; }
.view-head p{ color:var(--ink-faint); font-size:13px; margin-top:4px; }

/* -------- cards / kpis -------- */
.kpi-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:26px; }
@media(max-width:760px){ .kpi-grid{ grid-template-columns:repeat(2,1fr); } }
.kpi{ background:var(--bg-raised); border:1px solid var(--line); border-radius:10px; padding:18px; }
.kpi .label{ margin-bottom:8px; display:block; }
.kpi .val{ font-weight:800; font-size:24px; }
.panel{ background:var(--bg-raised); border:1px solid var(--line); border-radius:10px; padding:20px; margin-bottom:20px; }
.panel-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.panel-head h3{ font-size:14.5px; font-weight:700; }

/* -------- table -------- */
.table-wrap{ overflow-x:auto; }
th{ text-align:start; font-size:12px; color:var(--ink-faint); padding:10px 12px; border-bottom:1px solid var(--line); white-space:nowrap; font-weight:600; }
td{ padding:12px; border-bottom:1px solid var(--line); font-size:13.5px; vertical-align:middle; }
tbody tr:hover{ background:var(--stone); }
.cell-sub{ font-size:11.5px; color:var(--ink-faint); }

.badge{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600; padding:4px 10px; border-radius:20px; }
.badge::before{ content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.badge.pending{ background:rgba(185,138,58,.15); color:var(--warn); }
.badge.processing, .badge.paymentConfirmed{ background:rgba(122,16,24,.15); color:var(--accent); }
.badge.shipped, .badge.packed{ background:rgba(139,131,110,.18); color:#B9B9B4; }
.badge.delivered{ background:rgba(92,138,106,.15); color:var(--good); }
.badge.cancelled, .badge.returned{ background:rgba(166,57,74,.15); color:var(--bad); }
.badge.low{ background:rgba(166,57,74,.15); color:var(--bad); }
.badge.ok{ background:rgba(92,138,106,.15); color:var(--good); }
.badge.open{ background:rgba(122,16,24,.15); color:var(--accent); }
.badge.resolved{ background:rgba(92,138,106,.15); color:var(--good); }

/* -------- forms / buttons -------- */
.btn{ font-size:13px; font-weight:600; padding:10px 20px; border-radius:6px; border:none; display:inline-block; }
.btn.primary{ background:var(--accent); color:#F5F1E8; }
.btn.primary:hover{ background:var(--accent-hover); }
.btn.ghost{ border:1px solid var(--line); color:var(--ink); background:none; }
.btn.ghost:hover{ background:var(--stone); }
.btn.sm{ padding:7px 14px; font-size:12px; }
.field{ display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.field label{ font-size:12.5px; color:var(--ink-faint); }
.field input, .field select, .field textarea{ background:var(--stone); border:1px solid var(--line); border-radius:6px; padding:10px 12px; font-size:14px; outline:none; }
.field input:focus, .field select:focus, .field textarea:focus{ border-color:var(--accent); }
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media(max-width:600px){ .form-grid{ grid-template-columns:1fr; } }

/* -------- timeline -------- */
.timeline{ display:flex; justify-content:space-between; position:relative; margin:26px 0 10px; }
.timeline::before{ content:""; position:absolute; top:9px; left:18px; right:18px; height:1px; background:var(--line); }
.t-step{ position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; gap:8px; flex:1; text-align:center; }
.t-dot{ width:18px; height:18px; border-radius:50%; background:var(--bg-raised); border:2px solid var(--line); }
.t-step.done .t-dot{ background:var(--accent); border-color:var(--accent); }
.t-label{ font-size:11px; color:var(--ink-faint); max-width:80px; }
.t-step.done .t-label{ color:var(--ink); }

/* -------- product grid -------- */
.product-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
@media(max-width:760px){ .product-grid{ grid-template-columns:repeat(2,1fr); } }
.p-card{ background:var(--bg-raised); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.p-card .p-img{ aspect-ratio:3/4; background:var(--stone); }
.p-body{ padding:14px; }
.p-card h4{ font-size:14px; margin-bottom:4px; }
.p-card .price{ font-weight:700; font-size:13.5px; }

/* -------- login page -------- */
.login-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; }
.login-card{ background:var(--bg-raised); border:1px solid var(--line); border-radius:14px; padding:40px 34px; width:100%; max-width:380px; text-align:center; }
.login-card .logo{ justify-content:center; margin-bottom:26px; font-size:20px; }
.login-card p{ color:var(--ink-faint); font-size:13px; margin-bottom:24px; }
.login-card input{ width:100%; background:var(--stone); border:1px solid var(--line); border-radius:8px; padding:13px 14px; font-size:15px; text-align:center; outline:none; margin-bottom:14px; }
.login-card input:focus{ border-color:var(--accent); }
.login-card .btn{ width:100%; padding:13px; }
.login-msg{ font-size:12.5px; margin-top:12px; min-height:16px; }
.login-msg.error{ color:var(--bad); }
.login-msg.ok{ color:var(--good); }
