/* ==========================================================================
   قالب داشبورد به سبک Gleek
   لایه‌ی روکش روی platform.css — سایدبار روشن با گروه‌بندی، نوار بالای
   صفحه، کارت‌های آماری گرادیانی و پنل‌های سفید با سایه‌ی ملایم.
   ========================================================================== */

:root {
  --gl-primary: #6a4df4;
  --gl-primary-d: #5638e0;
  --gl-primary-l: #f2efff;
  --gl-pink: #ff4f8b;
  --gl-orange: #ff8a3c;
  --gl-teal: #17c3b2;
  --gl-blue: #2f9cf4;
  --gl-ink: #2b2e44;
  --gl-muted: #8e94a9;
  --gl-line: #edeff5;
  --gl-bg: #f5f6fa;
  --gl-side: #ffffff;
  --gl-shadow: 0 4px 18px rgba(43, 46, 68, .07);
}

/* ---------------- پوسته‌ی تمام‌صفحه ----------------
   پنل دیگر کشوی کناری نیست؛ یک صفحه‌ی کامل و مستقل است که
   تمام viewport را می‌پوشاند. */
.hp-dash {
  position: fixed;
  inset: 0;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  z-index: 1100;
  background: var(--gl-bg);
  grid-template-columns: 250px 1fr;
  grid-template-rows: 64px 1fr;
  grid-template-areas: "side head" "side main";
  box-shadow: none;
  border-radius: 0;
  /* ورود نرم به‌جای لغزش از کنار */
  transform: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s;
}
.hp-dash.show {
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: hpDashIn .26s ease;
}
@keyframes hpDashIn {
  from { opacity: 0; transform: scale(.985); }
  to   { opacity: 1; transform: none; }
}
/* دیگر چیزی پشت پنل دیده نمی‌شود، پس پرده لازم نیست */
.hp-dash-overlay,
.hp-dash-overlay.show { display: none !important; }

/* ---------------- ترتیب لایه‌ها ----------------
   لایه ۱: سایت | لایه ۲: منوی شناور | لایه ۳: پنل تمام‌صفحه
   لایه ۴: مودال استعلام — باید همیشه روی پنل بیاید، نه زیرش. */
.hp-overlay { z-index: 1300; }
.hp-toast-wrap { z-index: 1400; }

/* ---------------- سایدبار روشن ---------------- */
.hp-dash-side {
  grid-area: side;
  background: var(--gl-side);
  color: var(--gl-ink);
  padding: 0 0 24px;
  border-inline-start: 1px solid var(--gl-line);
  height: 100%;
  overflow-y: auto;
}

/* سربرگ برند بالای سایدبار */
.hp-dash-side .who {
  background: var(--gl-primary);
  color: #fff;
  border: 0;
  margin: 0 0 14px;
  padding: 0 18px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 0;
}
.hp-dash-side .who .av {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  border: 2px solid rgba(255, 255, 255, .5);
  font-size: 14px;
}
.hp-dash-side .who b { color: #fff; font-size: 13.5px; }
.hp-dash-side .who small { color: rgba(255, 255, 255, .75); }

/* آیتم‌های ناوبری */
.hp-nav-item {
  color: #6b7089;
  font-size: 13.5px;
  padding: 10px 20px;
  border-radius: 0;
  margin: 0;
  gap: 13px;
  border-inline-end: 3px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.hp-nav-item i { font-size: 16px; color: #b3b8ca; transition: color .15s; }
.hp-nav-item:hover { background: var(--gl-primary-l); color: var(--gl-primary); }
.hp-nav-item:hover i { color: var(--gl-primary); }
.hp-nav-item.active {
  background: var(--gl-primary-l);
  color: var(--gl-primary);
  font-weight: 600;
  border-inline-end-color: var(--gl-primary);
}
.hp-nav-item.active i { color: var(--gl-primary); }
.hp-nav-item .badge { background: var(--gl-pink); font-weight: 600; }

/* عنوان گروه‌ها */
.hp-nav-sep {
  font-size: 10px;
  font-weight: 700;
  color: #b3b8ca;
  padding: 18px 20px 7px;
  letter-spacing: 1.1px;
}

/* ---------------- نوار بالای صفحه ---------------- */
.hp-dash-main { grid-area: main; padding: 0; background: var(--gl-bg); overflow-y: auto; }

.hp-dash-head {
  grid-area: head;
  background: #fff;
  border-bottom: 1px solid var(--gl-line);
}
.hp-dash-main .top,
.hp-dash-head .top {
  padding: 0 26px;
  height: 64px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hp-dash-head .top h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gl-ink);
  margin: 0;
}
.hp-dash-close {
  background: var(--gl-primary-l);
  color: var(--gl-primary);
  border-radius: 50%;
  width: 34px; height: 34px;
  box-shadow: none;
  font-size: 14px;
  transition: background .15s;
}
.hp-dash-close:hover { background: var(--gl-primary); color: #fff; }

/* بدنه‌ی محتوا */
.hp-dash-body { padding: 22px 26px 40px; }

/* نوار مسیر */
.hp-crumb {
  background: #fbfbfe;
  border-bottom: 1px solid var(--gl-line);
  padding: 11px 26px;
  font-size: 12px;
  color: var(--gl-muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.hp-crumb b { color: var(--gl-primary); font-weight: 600; }
.hp-crumb .sep { color: #c9cddb; }

/* ---------------- کارت‌های آماری گرادیانی ---------------- */
.hp-stats {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
.hp-stat {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  padding: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 7px 20px rgba(43, 46, 68, .13);
  transition: transform .18s, box-shadow .18s;
}
.hp-stat:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(43, 46, 68, .18); }

/* گرادیان‌ها به ترتیب رنگ‌های Gleek */
.hp-stat:nth-child(1) { background: linear-gradient(135deg, #ff5f96, #ff8f6b); }
.hp-stat:nth-child(2) { background: linear-gradient(135deg, #ffa034, #ffc46b); }
.hp-stat:nth-child(3) { background: linear-gradient(135deg, #7b5cff, #a78bfa); }
.hp-stat:nth-child(4) { background: linear-gradient(135deg, #16c8b7, #4ee0c1); }
.hp-stat:nth-child(5) { background: linear-gradient(135deg, #2f9cf4, #62c0ff); }
.hp-stat:nth-child(6) { background: linear-gradient(135deg, #f75c8d, #ff9db8); }

/* حباب تزئینی گوشه‌ی کارت */
.hp-stat::before {
  content: '';
  position: absolute;
  inset-inline-start: -26px;
  bottom: -34px;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
}
.hp-stat .ic {
  background: rgba(255, 255, 255, .22) !important;
  color: #fff !important;
  width: 46px; height: 46px;
  border-radius: 12px;
  font-size: 21px;
  margin: 0;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}
.hp-stat b {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  position: relative;
  z-index: 1;
}
.hp-stat small {
  color: rgba(255, 255, 255, .88);
  font-size: 11.5px;
  letter-spacing: .3px;
  position: relative;
  z-index: 1;
}

/* ---------------- پنل‌ها ---------------- */
.hp-panel {
  border: 0;
  border-radius: 12px;
  box-shadow: var(--gl-shadow);
  padding: 0;
  margin-bottom: 20px;
  overflow: hidden;
}
.hp-panel h3 {
  margin: 0;
  padding: 16px 20px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--gl-ink);
  border-bottom: 1px solid var(--gl-line);
}
.hp-panel > *:not(h3) { padding-inline: 20px; }
.hp-panel > *:not(h3):last-child { padding-bottom: 18px; }
.hp-panel > h3 + * { padding-top: 16px; }
.hp-panel .hp-table,
.hp-panel .hp-bars { padding-inline: 0; }
.hp-panel .hp-table { margin-top: 0; }

/* ردیف‌ها */
.hp-row { border-bottom: 1px solid var(--gl-line); padding: 13px 0; }
.hp-row:last-child { border-bottom: 0; }
.hp-row .main b { color: var(--gl-ink); font-weight: 600; }

/* ---------------- جدول ---------------- */
.hp-table { border-collapse: separate; border-spacing: 0; }
.hp-table thead th {
  background: #fbfbfe;
  color: var(--gl-muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: none;
  padding: 12px 20px;
  border-bottom: 1px solid var(--gl-line);
}
.hp-table tbody td {
  padding: 13px 20px;
  font-size: 12.5px;
  color: #5b6079;
  border-bottom: 1px solid var(--gl-line);
}
.hp-table tbody tr:last-child td { border-bottom: 0; }
.hp-table tbody tr { transition: background .13s; }
.hp-table tbody tr:hover { background: #fafaff; }

/* ---------------- نشان‌ها ---------------- */
.hp-badge {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
}
.hp-badge.ok   { background: #e7f9f3; color: #12a37f; }
.hp-badge.warn { background: #fff4e6; color: #e07a1f; }
.hp-badge.err  { background: #ffecf1; color: #e5396b; }

/* ---------------- دکمه‌ها ---------------- */
.hp-btn {
  background: var(--gl-primary);
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(106, 77, 244, .28);
  transition: background .15s, transform .12s, box-shadow .15s;
}
.hp-btn:hover:not(:disabled) {
  background: var(--gl-primary-d);
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(106, 77, 244, .34);
}
.hp-btn.ghost {
  background: var(--gl-primary-l);
  color: var(--gl-primary);
  box-shadow: none;
}
.hp-btn.ghost:hover:not(:disabled) { background: #e6e0ff; color: var(--gl-primary-d); }
.hp-btn.outline {
  background: transparent;
  border: 1px solid var(--gl-line);
  color: #5b6079;
  box-shadow: none;
}
.hp-btn.outline:hover:not(:disabled) { border-color: var(--gl-primary); color: var(--gl-primary); background: transparent; }
.hp-btn.danger { background: var(--gl-pink); box-shadow: 0 4px 12px rgba(255, 79, 139, .3); }

/* ---------------- فرم‌ها ---------------- */
.hp-dash .hp-field input,
.hp-dash .hp-field select,
.hp-dash .hp-field textarea {
  border-radius: 8px;
  border-color: #e3e6ef;
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.hp-dash .hp-field input:focus,
.hp-dash .hp-field select:focus,
.hp-dash .hp-field textarea:focus {
  border-color: var(--gl-primary);
  box-shadow: 0 0 0 3px rgba(106, 77, 244, .12);
  outline: none;
}
.hp-dash .hp-field > span { color: var(--gl-muted); font-size: 12px; font-weight: 600; }

/* ---------------- تب‌های مدیریت ---------------- */
.hp-admin-tabs button {
  border-radius: 7px;
  border: 1px solid var(--gl-line);
  background: #fff;
  color: #6b7089;
  font-size: 12.5px;
  padding: 8px 15px;
  transition: all .14s;
}
.hp-admin-tabs button:hover { border-color: var(--gl-primary); color: var(--gl-primary); }
.hp-admin-tabs button.active {
  background: var(--gl-primary);
  border-color: var(--gl-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(106, 77, 244, .26);
}

/* ---------------- نمودار میله‌ای ---------------- */
.hp-bars { gap: 12px; padding: 8px 20px 4px; }
.hp-bars .b {
  background: linear-gradient(180deg, #8b6cff, var(--gl-primary));
  border-radius: 7px 7px 3px 3px;
  transition: filter .15s;
}
.hp-bars .b:hover { filter: brightness(1.12); }
.hp-bars .b span { color: var(--gl-ink); font-weight: 700; font-size: 11px; }
.hp-bars .b small { color: var(--gl-muted); font-size: 10px; }

/* ---------------- کارت‌های شبکه‌ای ---------------- */
.hp-card2 {
  border: 0;
  border-radius: 12px;
  box-shadow: var(--gl-shadow);
  transition: transform .16s, box-shadow .16s;
}
.hp-card2:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(43, 46, 68, .14); }

/* ---------------- حالت خالی ---------------- */
.hp-empty { color: var(--gl-muted); padding: 34px 20px; }
.hp-empty i { color: #d3d7e5; font-size: 40px; }

/* ---------------- یادداشت ---------------- */
.hp-dash .hp-note {
  background: var(--gl-primary-l);
  color: var(--gl-primary);
  border: 0;
  border-radius: 9px;
  font-size: 12.5px;
}

/* ---------------- واکنش‌گرا ---------------- */
@media (max-width: 860px) {
  .hp-dash {
    grid-template-columns: 1fr;
    grid-template-rows: 64px auto 1fr;
    grid-template-areas: "head" "side" "main";
  }
  .hp-dash-side {
    display: block;
    border: 0;
    border-bottom: 1px solid var(--gl-line);
    max-height: 190px;
  }
  .hp-dash-side .who { display: none; }
  .hp-dash-main .top { padding-inline: 18px; }
  .hp-dash-body { padding: 16px 18px 32px; }
  .hp-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 13px; }
  .hp-stat { padding: 16px; }
  .hp-stat b { font-size: 19px; }
}

/* ==========================================================================
   اسکرول‌بارهای شیشه‌ای
   ========================================================================== */
.hp-dash-side,
.hp-dash-main,
.hp-modal-body.scroll,
.hp-chat,
.hp-suggest,
.hp-tabs,
.hp-dash .hp-table-wrap {
  scrollbar-width: thin;
  scrollbar-color: rgba(106, 77, 244, .38) transparent;
}

.hp-dash-side::-webkit-scrollbar,
.hp-dash-main::-webkit-scrollbar,
.hp-modal-body.scroll::-webkit-scrollbar,
.hp-chat::-webkit-scrollbar,
.hp-suggest::-webkit-scrollbar,
.hp-tabs::-webkit-scrollbar,
.hp-dash .hp-table-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.hp-dash-side::-webkit-scrollbar-track,
.hp-dash-main::-webkit-scrollbar-track,
.hp-modal-body.scroll::-webkit-scrollbar-track,
.hp-chat::-webkit-scrollbar-track,
.hp-suggest::-webkit-scrollbar-track,
.hp-tabs::-webkit-scrollbar-track,
.hp-dash .hp-table-wrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .35);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(43, 46, 68, .05);
}

/* دستگیره‌ی شیشه‌ای: نیمه‌شفاف با هایلایت داخلی */
.hp-dash-side::-webkit-scrollbar-thumb,
.hp-dash-main::-webkit-scrollbar-thumb,
.hp-modal-body.scroll::-webkit-scrollbar-thumb,
.hp-chat::-webkit-scrollbar-thumb,
.hp-suggest::-webkit-scrollbar-thumb,
.hp-tabs::-webkit-scrollbar-thumb,
.hp-dash .hp-table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  background-color: rgba(106, 77, 244, .32);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .65),
    inset -1px -1px 0 rgba(86, 56, 224, .28);
  backdrop-filter: blur(6px);
  transition: background-color .18s;
}
.hp-dash-side::-webkit-scrollbar-thumb:hover,
.hp-dash-main::-webkit-scrollbar-thumb:hover,
.hp-modal-body.scroll::-webkit-scrollbar-thumb:hover,
.hp-chat::-webkit-scrollbar-thumb:hover,
.hp-suggest::-webkit-scrollbar-thumb:hover,
.hp-tabs::-webkit-scrollbar-thumb:hover,
.hp-dash .hp-table-wrap::-webkit-scrollbar-thumb:hover {
  background-color: rgba(106, 77, 244, .58);
}
.hp-dash-side::-webkit-scrollbar-corner,
.hp-dash-main::-webkit-scrollbar-corner { background: transparent; }

/* اسکرول کلی صفحه هم شیشه‌ای شود */
html { scrollbar-width: thin; scrollbar-color: rgba(106, 77, 244, .34) transparent; }
body::-webkit-scrollbar { width: 11px; }
body::-webkit-scrollbar-track { background: rgba(240, 241, 248, .6); }
body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  background-color: rgba(106, 77, 244, .3);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .6);
}
body::-webkit-scrollbar-thumb:hover { background-color: rgba(106, 77, 244, .55); }

/* ==========================================================================
   پلاک به سبک iToll
   نوار پرچم سه‌رنگ + «I.R.IRAN» سمت راست، خانه‌های سفید داخل قاب مشکی.
   ========================================================================== */
.hp-plate {
  --pl-h: 62px;
  display: flex;
  align-items: stretch;
  gap: 0;
  direction: ltr;
  background: #fff;
  border: 2px solid #111827;
  border-radius: 10px;
  overflow: hidden;
  height: var(--pl-h);
  box-shadow: 0 3px 10px rgba(17, 24, 39, .13);
  max-width: 400px;
  transition: border-color .15s, box-shadow .15s;
}
.hp-plate:focus-within {
  border-color: var(--gl-primary, #6a4df4);
  box-shadow: 0 0 0 4px rgba(106, 77, 244, .14);
}

/* نوار آبی کشور سمت راست (در LTR: آخرین آیتم) */
.hp-plate .flag {
  order: 9;
  width: 40px;
  flex: 0 0 40px;
  background: #09266f;
  color: #fff;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: 4px 0;
  font-size: 0;
  position: relative;
}
/* پرچم سه‌رنگ */
.hp-plate .flag::before {
  content: '';
  width: 20px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(
    to bottom,
    #00bc3b 0 33.33%,
    #ffffff 33.33% 66.66%,
    #f52207 66.66% 100%
  );
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .3);
}
/* نوشته‌ی I.R.IRAN */
.hp-plate .flag::after {
  content: 'I.R.IRAN';
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  margin-top: 3px;
  direction: ltr;
}

/* خانه‌های ورودی */
.hp-plate input {
  border: 0;
  border-radius: 0;
  border-inline-end: 1.5px solid #d7dbe6;
  background: #fff;
  text-align: center;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: 1px;
  color: #111827;
  padding: 0 2px;
  height: 100%;
  box-shadow: none;
}
.hp-plate input:focus {
  outline: none;
  border-color: #d7dbe6;
  background: #f4f2ff;
  box-shadow: none;
}
.hp-plate input::placeholder { color: #c3c8d6; font-weight: 600; }

/* ترتیب راست‌به‌چپ واقعی پلاک ایران: ۱۲ | ب | ۳۴۵ | ایران ۶۷ */
.hp-plate .p2 { order: 1; flex: 0 0 62px; }
.hp-plate .p1 { order: 2; flex: 0 0 52px; font-size: 19px; }
.hp-plate .p3 { order: 3; flex: 1 1 auto; min-width: 78px; }
.hp-plate .pi {
  order: 4;
  flex: 0 0 66px;
  border-inline-end: 0;
  font-size: 18px;
  background: #fff;
}

/* برچسب «ایران» بالای خانه‌ی کد شهر */
.hp-plate .iran-wrap {
  order: 4;
  flex: 0 0 66px;
  display: flex;
  flex-direction: column;
  border-inline-end: 0;
}
.hp-plate .iran-wrap .cap {
  font-size: 9px;
  font-weight: 700;
  color: #6b7089;
  text-align: center;
  line-height: 1;
  padding-top: 5px;
  letter-spacing: .5px;
}
.hp-plate .iran-wrap input {
  flex: 1;
  border-inline-end: 0;
  font-size: 18px;
  padding-bottom: 3px;
}

/* ---------------- پلاک موتورسیکلت (دو طبقه) ---------------- */
.hp-plate.moto {
  --pl-h: 74px;
  max-width: 250px;
}
.hp-plate.moto .rows {
  order: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.hp-plate.moto .rows input {
  flex: 1;
  border-inline-end: 0;
  border-bottom: 1.5px solid #d7dbe6;
  font-size: 22px;
  letter-spacing: 4px;
}
.hp-plate.moto .rows input:last-child { border-bottom: 0; }
.hp-plate.moto .flag { order: 9; }

@media (max-width: 560px) {
  .hp-plate { --pl-h: 54px; }
  .hp-plate input { font-size: 17px; }
  .hp-plate .p2 { flex: 0 0 50px; }
  .hp-plate .p1 { flex: 0 0 42px; }
  .hp-plate .pi, .hp-plate .iran-wrap { flex: 0 0 54px; }
  .hp-plate .flag { width: 32px; flex: 0 0 32px; }
  .hp-plate .flag::after { font-size: 6px; }
}
