/* برق من | MyBargh — استایل پنل مدیریت */
:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #f59e0b;
  --brand-ink: #78350f;
  --dark: #0f172a;
  --ok: #059669;
  --err: #dc2626;
  --warn: #d97706;
  --info: #2563eb;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Vazirmatn, Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.7;
}
a { color: var(--info); text-decoration: none; }

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

/* سایدبار */
.sidebar {
  width: 235px; flex-shrink: 0;
  background: var(--dark); color: #cbd5e1;
  padding: 18px 0 30px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { font-size: 18px; font-weight: 800; color: #fff; padding: 0 20px 16px; border-bottom: 1px solid #1e293b; margin-bottom: 12px; }
.brand span { font-size: 11px; color: var(--brand); font-weight: 400; display: block; letter-spacing: 1px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 9px;
  color: #cbd5e1; padding: 9px 20px; font-size: 13.5px;
  border-right: 3px solid transparent;
}
.sidebar nav a:hover { background: #1e293b; color: #fff; }
.sidebar nav a.active { background: #1e293b; color: #fff; border-right-color: var(--brand); }
.sidebar nav a.logout { margin-top: 14px; color: #f87171; }
.sidebar .ic { width: 20px; text-align: center; }

/* محتوا */
.content { flex: 1; padding: 26px 30px 60px; max-width: 1200px; }
.page-title { font-size: 21px; font-weight: 800; margin: 0 0 20px; }

/* کارت و جدول */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; }
.card h2 { font-size: 15px; margin: 0 0 14px; font-weight: 700; }
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.stat .num { font-size: 24px; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: 12.5px; }

table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; }
th, td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
th { background: #f8fafc; color: var(--muted); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
tr:hover td { background: #fafcff; }

/* فرم */
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 110px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #fcd34d; border-color: var(--brand); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.inline-form { display: inline; }

/* دکمه‌ها */
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 8px; border: 1px solid transparent;
  background: var(--dark); color: #fff; font: inherit; font-size: 13.5px; cursor: pointer;
}
.btn:hover { opacity: .92; }
.btn.brand { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.btn.ok { background: var(--ok); }
.btn.err { background: var(--err); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }

/* بج و وضعیت */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.badge.green { background: #d1fae5; color: #065f46; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.yellow { background: #fef3c7; color: #92400e; }
.badge.gray { background: #e2e8f0; color: #334155; }
.badge.blue { background: #dbeafe; color: #1e40af; }

/* هشدار */
.alert { padding: 11px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 13.5px; }
.alert.success { background: #d1fae5; color: #065f46; }
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.warning { background: #fef3c7; color: #92400e; }

/* صفحه‌بندی */
.pagination { margin: 16px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.pg { padding: 5px 11px; background: var(--card); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); font-size: 13px; }
.pg.active { background: var(--dark); color: #fff; border-color: var(--dark); }
.pg-dots { padding: 5px 4px; color: var(--muted); }

/* ورود */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--dark); }
.login-card { background: var(--card); border-radius: 16px; padding: 34px 34px 28px; width: 360px; max-width: 92vw; }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card p { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.login-card .btn { width: 100%; margin-top: 18px; padding: 11px; }

.muted { color: var(--muted); font-size: 12.5px; }
.mono { direction: ltr; font-family: monospace; }
.mt { margin-top: 14px; }
pre.src { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 12px; white-space: pre-wrap; font-family: inherit; font-size: 13px; max-height: 300px; overflow-y: auto; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar nav a { border-right: none; border-bottom: 2px solid transparent; }
  .sidebar nav a.active { border-bottom-color: var(--brand); }
  .content { padding: 18px 14px 40px; }
}
