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

:root{
  --sidebar-w: 250px;
  --bg: #f3f5f9;
  --card: #ffffff;
  --ink: #1c2130;
  --muted: #6b7280;
  --line: #e7e9ef;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 14px;
}
*{box-sizing:border-box;}
body{
  margin:0; font-family:'Vazirmatn',Tahoma,sans-serif; background:var(--bg); color:var(--ink);
  font-size:14.5px;
}
a{ color:inherit; text-decoration:none; }

.admin-shell{ display:flex; min-height:100vh; }

/* ---------- Sidebar ---------- */
.sidebar{
  width:var(--sidebar-w); background:#161a2b; color:#cdd2e2; flex-shrink:0;
  position:sticky; top:0; height:100vh; overflow-y:auto; padding:22px 0;
  transition: transform .25s ease;
}
.sidebar .brand{ display:flex; align-items:center; gap:10px; padding:0 22px 22px; font-weight:800; font-size:18px; color:#fff; border-bottom:1px solid #262b41; margin-bottom:14px; }
.sidebar .brand span.dot{ width:10px; height:10px; border-radius:50%; background:var(--primary); display:inline-block; }
.sidebar nav a{
  display:flex; align-items:center; gap:12px; padding:11px 22px; color:#aeb4ca; font-size:14px; font-weight:500;
  border-inline-start:3px solid transparent;
}
.sidebar nav a:hover{ background:#1f2439; color:#fff; }
.sidebar nav a.active{ background:#1f2439; color:#fff; border-inline-start-color:var(--primary); }
.sidebar nav .icon{ width:20px; text-align:center; }
.sidebar .group-title{ padding:16px 22px 6px; font-size:11px; color:#5c6280; text-transform:uppercase; letter-spacing:.06em; }

/* ---------- Main ---------- */
.main{ flex:1; min-width:0; }
.topbar{
  display:flex; align-items:center; justify-content:space-between; background:#fff; padding:14px 24px;
  border-bottom:1px solid var(--line); position:sticky; top:0; z-index:5;
}
.topbar h1{ font-size:18px; margin:0; font-weight:700; }
.topbar .user{ display:flex; align-items:center; gap:10px; font-size:13.5px; color:var(--muted); }
.topbar .user .avatar{ width:34px; height:34px; border-radius:50%; background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; }
.menu-toggle{ display:none; background:none; border:none; font-size:22px; cursor:pointer; color:var(--ink); }

.content{ padding:24px; }

/* ---------- Cards / grid ---------- */
.stat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:22px; }
.stat-card{ background:var(--card); border-radius:var(--radius); padding:18px 20px; border:1px solid var(--line); }
.stat-card .label{ color:var(--muted); font-size:13px; margin-bottom:8px; }
.stat-card .value{ font-size:24px; font-weight:800; }
.stat-card .icon-badge{ width:42px;height:42px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:19px;margin-bottom:10px;}

.card{ background:var(--card); border-radius:var(--radius); border:1px solid var(--line); padding:20px; margin-bottom:20px; }
.card h2{ font-size:16px; margin:0 0 16px; font-weight:700; }
.card-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; flex-wrap:wrap; gap:10px;}

/* ---------- Tables ---------- */
table.tbl{ width:100%; border-collapse:collapse; font-size:13.8px; }
table.tbl th{ text-align:right; color:var(--muted); font-weight:600; padding:10px 12px; border-bottom:2px solid var(--line); white-space:nowrap; }
table.tbl td{ padding:12px; border-bottom:1px solid var(--line); vertical-align:middle; }
table.tbl tr:hover td{ background:#fafbfe; }
.thumb{ width:42px;height:42px;border-radius:8px;object-fit:cover;background:#eee; }

/* ---------- Badges ---------- */
.badge{ display:inline-block; padding:4px 10px; border-radius:999px; font-size:12px; font-weight:600; }
.badge.pending{ background:#fef3c7; color:#92400e; }
.badge.processing{ background:#dbeafe; color:#1e40af; }
.badge.shipped{ background:#e0e7ff; color:#3730a3; }
.badge.completed{ background:#dcfce7; color:#166534; }
.badge.cancelled{ background:#fee2e2; color:#991b1b; }
.badge.active{ background:#dcfce7; color:#166534; }
.badge.inactive{ background:#f1f2f6; color:#6b7280; }

/* ---------- Forms ---------- */
label{ display:block; font-weight:600; font-size:13.5px; margin:14px 0 6px; }
input[type=text], input[type=password], input[type=number], input[type=email],
input[type=date], input[type=file], select, textarea{
  width:100%; padding:10px 13px; border:1px solid #dcdfe6; border-radius:10px; font-family:inherit; font-size:14px; background:#fff;
}
textarea{ min-height:110px; resize:vertical; }
input:focus, select:focus, textarea:focus{ outline:2px solid var(--primary); border-color:transparent; }
.form-row{ display:flex; gap:16px; flex-wrap:wrap; }
.form-row > div{ flex:1; min-width:200px; }
.check-row{ display:flex; align-items:center; gap:8px; margin-top:14px; }
.check-row input{ width:auto; }
.hint{ color:var(--muted); font-size:12.5px; margin-top:5px; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:6px; background:var(--primary); color:#fff; border:none;
  padding:10px 18px; border-radius:10px; font-family:inherit; font-size:13.8px; font-weight:600; cursor:pointer; text-decoration:none;
}
.btn:hover{ background:var(--primary-dark); }
.btn.sm{ padding:6px 12px; font-size:12.8px; border-radius:8px; }
.btn.secondary{ background:#fff; color:var(--ink); border:1px solid #d7dae1; }
.btn.secondary:hover{ background:#f4f5f8; }
.btn.danger{ background:#fff; color:var(--danger); border:1px solid #f4c6c6; }
.btn.danger:hover{ background:#fef2f2; }
.btn.success{ background:var(--success); }

/* ---------- Alerts ---------- */
.alert{ padding:13px 16px; border-radius:10px; margin-bottom:18px; font-size:14px; }
.alert.success{ background:#ecfdf5; color:#065f46; }
.alert.error{ background:#fef2f2; color:#991b1b; }

/* ---------- Theme picker ---------- */
.theme-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:16px; }
.theme-card{ border:2px solid var(--line); border-radius:16px; overflow:hidden; cursor:pointer; background:#fff; transition:.15s; }
.theme-card:hover{ border-color:#c7cbe0; }
.theme-card.selected{ border-color:var(--primary); box-shadow:0 0 0 3px rgba(79,70,229,.15); }
.theme-preview{ height:110px; display:flex; }
.theme-preview .bar{ flex:1; }
.theme-body{ padding:12px 14px; }
.theme-body .name{ font-weight:700; font-size:14px; margin-bottom:3px; }
.theme-body .desc{ font-size:12px; color:var(--muted); }
.theme-body .pick-btn{ margin-top:10px; width:100%; }
.theme-body .current-tag{ display:inline-block; margin-top:10px; background:#ecfdf5; color:#065f46; font-size:12px; padding:5px 10px; border-radius:8px; font-weight:600; }

/* ---------- Login page ---------- */
.login-page{ min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#161a2b,#2a2f4d); }
.login-box{ background:#fff; width:100%; max-width:380px; border-radius:18px; padding:34px 30px; box-shadow:0 20px 60px rgba(0,0,0,.35); }
.login-box h1{ font-size:20px; margin:0 0 4px; text-align:center; }
.login-box p.sub{ text-align:center; color:var(--muted); font-size:13px; margin:0 0 22px; }
.captcha-row{ display:flex; align-items:center; gap:10px; margin-top:6px; }
.captcha-row img{ border-radius:10px; border:1px solid var(--line); }
.captcha-refresh{ background:none; border:1px solid var(--line); border-radius:10px; width:40px; height:40px; cursor:pointer; font-size:16px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px){
  .stat-grid{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 760px){
  .sidebar{ position:fixed; inset-inline-start:0; top:0; z-index:50; transform:translateX(105%); }
  html[dir="rtl"] .sidebar{ transform:translateX(105%); }
  .sidebar.open{ transform:translateX(0); }
  .menu-toggle{ display:block; }
  .stat-grid{ grid-template-columns:1fr 1fr; }
  .content{ padding:16px; }
  table.tbl{ display:block; overflow-x:auto; white-space:nowrap; }
}
