/* =====================================================
   بام پنل — استایل اصلی | بر پایه قالب «بام بانک ملی»
   primary: #2c92f2 | accent: #f89b17
   ===================================================== */

/* ---------- فونت‌ها ---------- */
@font-face {
  font-family: "IRANSans";
  src: url("fonts/IRANSans-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IRANSans";
  src: url("fonts/IRANSans-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IRANSans";
  src: url("fonts/IRANSans-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IRANSans";
  src: url("fonts/IRANSans-Black.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IRANSansFaNum";
  src: url("fonts/IRANSansFaNum-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IRANSansFaNum";
  src: url("fonts/IRANSansFaNum-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IRANSansFaNum";
  src: url("fonts/IRANSansFaNum-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- متغیرها ---------- */
:root {
  --foreground: #1e2129;
  --muted-foreground: #667085;
  --background: #f6f8fb;
  --card: #ffffff;
  --border: #e4e7ec;
  --input: #d0d5dd;
  --primary: #2c92f2;
  --primary-dark: #1f7ed9;
  --primary-soft: #eaf4fe;
  --accent: #f89b17;
  --success: #12b76a;
  --success-soft: #e7f8ef;
  --danger: #d92d20;
  --danger-soft: #fdecea;
  --warning: #dc6803;
  --warning-soft: #fef4e6;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 6px 18px -6px rgba(16, 24, 40, 0.12);
}

/* ---------- پایه ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: IRANSans, Tahoma, Arial, sans-serif;
  font-size: 14px;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, .fa-num { font-family: IRANSansFaNum, IRANSans, Tahoma, sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }
img { display: inline-block; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
.dir-ltr { direction: ltr; unicode-bidi: embed; }
.text-muted { color: var(--muted-foreground); }
.mt-0 { margin-top: 0; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c7cdd8; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }

/* =====================================================
   صفحه ورود (قالب بام)
   ===================================================== */
.auth-split { display: flex; min-height: 100vh; }
.auth-form-side {
  flex: 1 1 460px;
  display: flex; flex-direction: column;
  padding: 20px clamp(18px, 5vw, 64px);
  max-width: 640px;
  margin: 0 auto;
}
.auth-logos {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0 26px;
}
.auth-logos img { height: 40px; width: auto; }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-tabs {
  display: flex; gap: 6px;
  background: #eef2f7; padding: 5px; border-radius: 12px; margin-bottom: 24px;
}
.auth-tabs a, .auth-tabs button {
  flex: 1; height: 40px; border: none; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--muted-foreground);
  font-size: 14px; font-weight: 500; text-align: center; line-height: 40px;
}
.auth-tabs .tab-active { background: #fff; color: var(--foreground); box-shadow: var(--shadow-sm); }
.auth-title { font-size: 19px; font-weight: 700; margin: 0 0 6px; }
.auth-sub { color: var(--muted-foreground); font-size: 13px; margin: 0 0 20px; }
.auth-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted-foreground); font-size: 13px; margin-bottom: 14px;
}
.auth-foot { margin-top: 26px; text-align: center; font-size: 11.5px; color: var(--muted-foreground); line-height: 2; }

/* فیلد با لیبل شناور (معادل bam-field قالب) */
.bam-field { position: relative; margin-bottom: 14px; }
.bam-field input, .bam-field select {
  width: 100%; height: 56px; padding: 22px 14px 6px;
  font-size: 15px; background: transparent;
  border: 1px solid var(--input); border-radius: 10px;
  outline: none; transition: border-color .18s, box-shadow .18s;
  color: var(--foreground);
}
.bam-field select { padding-top: 20px; }
.bam-field input:focus, .bam-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 146, 242, 0.15);
}
.bam-field label {
  position: absolute; top: 50%; right: 14px; transform: translateY(-50%);
  color: #98a2b3; font-size: 14px; pointer-events: none;
  transition: all .16s ease; max-width: calc(100% - 30px);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.bam-field input:focus + label,
.bam-field input.has-value + label,
.bam-field select:focus + label,
.bam-field select.has-value + label {
  top: 11px; transform: none; font-size: 11.5px; color: var(--primary);
}
.bam-field.invalid input { border-color: var(--danger); }
.bam-field.invalid label { color: var(--danger); }
.bam-field .bam-error {
  display: block; min-height: 18px; font-size: 11.5px; color: var(--danger); padding-top: 3px;
}
.bam-field.has-suffix input { padding-left: 46px; }
.bam-field .suffix-btn {
  position: absolute; left: 8px; top: 28px; transform: translateY(-50%);
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: #98a2b3; border-radius: 8px; cursor: pointer;
}
.bam-field .suffix-btn:hover { color: var(--foreground); background: #eef2f7; }

/* دکمه اصلی بام */
.btn-baam {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border: none; border-radius: 10px;
  background: var(--primary); color: #fff; font-size: 14.5px; font-weight: 500;
  cursor: pointer; transition: background .18s, box-shadow .18s, transform .1s;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08); text-align: center;
}
.btn-baam:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(44, 146, 242, 0.35); }
.btn-baam:active { transform: translateY(1px); }
.btn-baam:disabled { opacity: .55; cursor: not-allowed; }
.btn-baam.btn-danger { background: var(--danger); }
.btn-baam.btn-danger:hover { background: #b42318; box-shadow: 0 4px 12px rgba(217, 45, 32, .3); }
.btn-baam.btn-outline {
  background: #fff; color: var(--primary); border: 1px solid var(--primary);
}
.btn-baam.btn-outline:hover { background: var(--primary-soft); box-shadow: none; }
.btn-baam.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 8px; }
.btn-baam.btn-block { width: 100%; }

/* نوار پیشرفت ثبت‌نام */
.bam-progress { height: 6px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.bam-progress > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2c92f2, #59aaf5); transition: width .35s ease; }

/* چک‌باکس قوانین */
.bam-check {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; color: #475467; padding: 4px; border-radius: 8px; margin-top: 4px;
}
.bam-check.invalid { outline: 1.5px solid var(--danger); outline-offset: 3px; }
.bam-check input { margin-top: 2px; accent-color: var(--primary); width: 16px; height: 16px; }

/* نیمه تصویرسازی */
.illus-half {
  flex: 1 1 52%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(46% 40% at 8% 100%, rgba(250, 220, 182, 0.55), rgba(250, 220, 182, 0) 72%),
    linear-gradient(150deg, #f1f3fb 0%, #eaedf8 45%, #e4e9f6 100%);
  padding: 30px;
}
.illus-half img { width: 100%; max-width: 600px; height: auto; }

/* هشدارها */
.alert {
  padding: 12px 16px; border-radius: 10px; font-size: 13.5px; line-height: 1.9;
  margin-bottom: 14px; border: 1px solid transparent;
}
.alert-success { background: var(--success-soft); color: #067647; border-color: #b5e6cb; }
.alert-error { background: var(--danger-soft); color: #b42318; border-color: #f4c7c3; }
.alert-info { background: var(--primary-soft); color: #175cd3; border-color: #cfe5fb; }
.alert-warning { background: var(--warning-soft); color: #b54708; border-color: #f8dfba; }

/* =====================================================
   پوسته پنل
   ===================================================== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: #fff; border-left: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px 18px; }
.sidebar-brand .brand-logo { height: 40px; width: auto; }
.brand-title { font-size: 15px; font-weight: 700; line-height: 20px; }
.brand-sub { font-size: 11px; color: var(--muted-foreground); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px; margin-bottom: 4px;
  font-size: 13.5px; color: rgba(30, 33, 41, 0.72); transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--primary-soft); color: var(--primary-dark); }
.nav-item.active {
  background: var(--primary); color: #fff; font-weight: 500;
  box-shadow: 0 6px 16px -6px rgba(44, 146, 242, 0.6);
}
.nav-item.nav-logout { color: var(--danger); }
.nav-item.nav-logout:hover { background: var(--danger-soft); color: var(--danger); }
.sidebar-bottom { border-top: 1px solid var(--border); padding: 12px; }
.sidebar-overlay { display: none; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 56px; padding: 0 20px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-title { font-size: 15px; font-weight: 500; }
.menu-btn {
  display: none; border: none; background: transparent; color: var(--muted-foreground);
  padding: 6px; border-radius: 8px; cursor: pointer;
}
.menu-btn:hover { background: #eef2f7; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.user-meta { text-align: left; }
.user-name { font-size: 13px; font-weight: 500; line-height: 16px; }
.user-handle { font-size: 11px; color: var(--muted-foreground); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.content { flex: 1; width: 100%; max-width: 1150px; margin: 0 auto; padding: 22px 20px 40px; }
.panel-footer {
  border-top: 1px solid var(--border); background: #fff;
  padding: 14px 20px; text-align: center; font-size: 11.5px; color: var(--muted-foreground);
}
.footer-ver { display: inline-block; margin-right: 12px; color: #98a2b3; }

/* =====================================================
   اجزای پنل
   ===================================================== */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px; margin-bottom: 18px;
}
.card-title {
  font-size: 15px; font-weight: 700; margin: 0 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-title .card-link { font-size: 12.5px; font-weight: 400; }

/* کارت‌های آمار */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px 18px;
  display: flex; align-items: center; gap: 12px;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.orange { background: var(--warning-soft); color: var(--warning); }
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat-value { font-size: 17px; font-weight: 700; line-height: 24px; }
.stat-label { font-size: 12px; color: var(--muted-foreground); }

/* شبکه دو ستونه */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.grid-side { margin-bottom: 18px; }

/* جدول */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 11px 12px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table thead th { font-size: 12px; color: var(--muted-foreground); font-weight: 500; background: #fafbfc; }
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr:last-child td { border-bottom: none; }
.table .amount-in { color: var(--success); font-weight: 600; }
.table .amount-out { color: var(--danger); font-weight: 600; }
.table-actions { display: flex; gap: 6px; align-items: center; }

/* نشان‌ها */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; line-height: 20px;
}
.badge-green { background: var(--success-soft); color: #067647; }
.badge-red { background: var(--danger-soft); color: #b42318; }
.badge-blue { background: var(--primary-soft); color: #175cd3; }
.badge-amber { background: var(--warning-soft); color: #b54708; }
.badge-gray { background: #eef2f7; color: #475467; }
.badge-orange { background: #fef4e6; color: #b54708; }

/* دکمه‌های کوچک جدولی */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 32px; padding: 0 12px; border-radius: 8px; font-size: 12.5px;
  border: 1px solid var(--border); background: #fff; color: var(--foreground);
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.btn-icon:hover { background: #f4f6fa; }
.btn-icon.primary { color: var(--primary); border-color: #cfe5fb; }
.btn-icon.primary:hover { background: var(--primary-soft); }
.btn-icon.danger { color: var(--danger); border-color: #f4c7c3; }
.btn-icon.danger:hover { background: var(--danger-soft); }
.btn-icon.success { color: var(--success); border-color: #b5e6cb; }
.btn-icon.success:hover { background: var(--success-soft); }
.btn-icon:disabled { opacity: .5; cursor: not-allowed; }

/* فرم‌های پنل (لیبل بالای فیلد) */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: #475467; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--input); border-radius: 10px;
  background: #fff; color: var(--foreground); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 1.9; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(44, 146, 242, 0.14);
}
.field .hint { font-size: 11.5px; color: var(--muted-foreground); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error { color: var(--danger); font-size: 12px; margin-top: 5px; }

/* کارت بانکی */
.bank-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.bank-card {
  position: relative; border-radius: 18px; padding: 20px 22px; color: #fff;
  min-height: 185px; display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden; box-shadow: 0 14px 30px -12px rgba(31, 126, 217, 0.45);
}
.bank-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 130% at 100% 0%, rgba(255,255,255,0.22), transparent 55%);
  pointer-events: none;
}
.bank-card-grad-1 { background: linear-gradient(135deg, #2c92f2 0%, #1f5ed9 100%); }
.bank-card-grad-2 { background: linear-gradient(135deg, #2d3a4e 0%, #101828 100%); }
.bank-card-grad-3 { background: linear-gradient(135deg, #f89b17 0%, #e2711d 100%); }
.bank-card .bc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.bank-card .bc-bank { font-size: 13px; font-weight: 700; }
.bank-card .bc-chip { width: 38px; height: 28px; border-radius: 6px; background: rgba(255,255,255,0.25); border: 1px solid rgba(255,255,255,0.4); }
.bank-card .bc-number { font-size: 18px; letter-spacing: 1px; direction: ltr; text-align: left; font-family: IRANSansFaNum, IRANSans, sans-serif; }
.bank-card .bc-bottom { display: flex; justify-content: space-between; align-items: flex-end; font-size: 11.5px; opacity: .92; }
.bank-card .bc-blocked { font-size: 11px; background: rgba(0,0,0,.25); padding: 2px 10px; border-radius: 999px; }

/* نمودار میله‌ای عمودی */
.chart {
  display: flex; align-items: stretch; gap: 12px; height: 190px; padding-top: 10px;
}
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.chart-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 5px; }
.chart-bar {
  width: 46%; max-width: 26px; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #59aaf5, #2c92f2); min-height: 3px;
}
.chart-bar.green { background: linear-gradient(180deg, #47d183, #12b76a); }
.chart-bar.orange { background: linear-gradient(180deg, #ffb254, #f89b17); }
.chart-label { font-size: 10.5px; color: var(--muted-foreground); white-space: nowrap; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted-foreground); margin-bottom: 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--primary); display: inline-block; }
.chart-dot.green { background: var(--success); }
.chart-dot.orange { background: var(--accent); }

/* گفت‌وگوی تیکت */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 78%; padding: 12px 16px; border-radius: 14px; background: #f1f5f9; }
.msg .msg-meta { font-size: 11px; color: var(--muted-foreground); margin-bottom: 6px; }
.msg .msg-body { font-size: 13.5px; line-height: 2; white-space: pre-wrap; word-break: break-word; }
.msg-mine { align-self: flex-start; background: var(--primary-soft); }
.msg-other { align-self: flex-end; }

/* صفحه‌بندی */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: #fff; color: var(--foreground); font-size: 13px;
}
.pagination .page-current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination a:hover { background: var(--primary-soft); }
.pagination .page-disabled { opacity: .45; pointer-events: none; }

/* حالت خالی و رسید */
.empty { text-align: center; color: var(--muted-foreground); padding: 36px 16px; font-size: 13px; }
.receipt { border: 1px dashed #b5e6cb; background: var(--success-soft); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.receipt h3 { margin: 0 0 12px; font-size: 14.5px; color: #067647; display: flex; align-items: center; gap: 8px; }
.receipt-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed #d3ecdf; }
.receipt-row:last-child { border-bottom: none; }
.receipt-row .rk { color: var(--muted-foreground); }
.receipt-row .rv { font-weight: 500; }

/* تب ساده */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs a {
  padding: 8px 18px; border-radius: 10px; font-size: 13px;
  background: #fff; border: 1px solid var(--border); color: var(--muted-foreground);
}
.tabs a.tab-active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }

/* فیلتر جستجو */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .field { margin-bottom: 0; min-width: 170px; flex: 0 1 auto; }
.filter-bar input, .filter-bar select { height: 40px; font-size: 13px; }
.filter-bar button { height: 40px; padding: 0 18px; border: none; border-radius: 10px; background: var(--primary); color: #fff; cursor: pointer; font-size: 13px; }

/* پروفایل */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-head .avatar { width: 56px; height: 56px; }
.profile-head .avatar svg { width: 26px; height: 26px; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .illus-half { display: none; }
  .sidebar {
    position: fixed; right: 0; top: 0; transform: translateX(100%);
    transition: transform .25s ease; box-shadow: -10px 0 40px rgba(16,24,40,.12);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35;
  }
  .menu-btn { display: inline-flex; }
  .user-meta { display: none; }
  .content { padding: 16px 14px 32px; }
  .form-row { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { flex-direction: column; text-align: center; gap: 8px; padding: 14px 10px; }
  .table th, .table td { padding: 9px 8px; }
}
