/* ==========================================================
   POYACITY — dashboard.css
========================================================== */

/* ==================== هدر داشبورد ==================== */

.dash-switch-btn {
  background: var(--purple);
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  transition: .3s;
}

.dash-switch-btn:hover {
  background: var(--orange);
  transform: translateY(-2px);
}

/* ==================== هیرو داشبورد ==================== */

.dash-hero {
  background: linear-gradient(135deg,
    var(--yellow) 0%,
    var(--green)  35%,
    var(--purple) 70%,
    var(--orange) 100%
  );
  padding: 60px 20px;
  text-align: center;
  color: #fff;
}

.dash-hero h1 {
  font-size: 42px;
  margin-bottom: 10px;
  color: #fff;
}

.dash-hero p {
  font-size: 18px;
  opacity: .9;
}

/* ==================== بخش‌های داشبورد ==================== */

.dash-section {
  padding: 40px 0;
}

.dash-section:nth-child(even) {
  background: #fff;
}

/* ==================== KPI ==================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.kpi-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: .3s;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 100%; height: 5px;
  background: linear-gradient(90deg,
    var(--yellow), var(--green), var(--purple), var(--orange), var(--red)
  );
}

.kpi-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.kpi-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.kpi-number {
  font-size: 36px;
  font-weight: bold;
  color: var(--purple);
  margin-bottom: 6px;
  line-height: 1.2;
}

.kpi-label {
  font-size: 14px;
  color: #666;
}

/* ==================== فیلتر ==================== */

.filter-bar {
  background: #fff;
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 160px;
}

.filter-group label {
  font-size: 13px;
  font-weight: bold;
  color: #555;
  margin: 0;
}

.filter-group select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fafafa;
  cursor: pointer;
  transition: .25s;
  outline: none;
}

.filter-group select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,200,83,.12);
}

.filter-group select:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.filter-reset-btn {
  padding: 10px 22px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: .25s;
  color: #555;
  font-weight: bold;
  align-self: flex-end;
}

.filter-reset-btn:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* ==================== نوار مسیر (بردکرامب) ==================== */

.breadcrumb {
  margin-top: 16px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #f0fff6, #fef9e7);
  border-radius: 12px;
  border-right: 4px solid var(--green);
  font-size: 14px;
  color: #444;
}

/* ==================== گرید نمودارها ==================== */

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.chart-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: .3s;
  position: relative;
  overflow: hidden;
}

.chart-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 100%; height: 4px;
  background: linear-gradient(90deg,
    var(--yellow), var(--green), var(--purple), var(--orange), var(--red)
  );
}

.chart-card:hover {
  box-shadow: var(--shadow-hover);
}

.chart-card h3 {
  font-size: 17px;
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

.chart-card--wide {
  grid-column: 1 / -1;
}

/* ==================== لودینگ ==================== */

.dash-loading {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 20px;
  font-size: 18px;
  color: #555;
}

.loading-spinner {
  width: 52px;
  height: 52px;
  border: 5px solid #eee;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.dash-error {
  text-align: center;
  padding: 60px 20px;
  font-size: 18px;
  color: var(--red);
}

/* ==================== موبایل ==================== */

@media (max-width: 768px) {

  .dash-hero h1 { font-size: 28px; }
  .dash-hero p  { font-size: 15px; }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kpi-number { font-size: 28px; }

  .filter-bar {
    flex-direction: column;
    padding: 18px;
  }

  .filter-group { min-width: 100%; }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-card--wide {
    grid-column: auto;
  }

  .form-header-inner {
    flex-wrap: wrap;
    gap: 8px;
  }

  .dash-switch-btn {
    font-size: 12px;
    padding: 8px 14px;
  }
}

/* ==================== داشبورد تخصصی ==================== */

.pro-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 10px 0;
}

.pro-tab {
  padding: 12px 24px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: #fff;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: .3s;
  font-weight: bold;
  color: #555;
}

.pro-tab:hover {
  border-color: var(--green);
  color: var(--green);
  transform: translateY(-2px);
}

.pro-tab.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0,200,83,.3);
}

.pro-panel {
  display: none;
}

.pro-panel.active {
  display: block;
}

.bank-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  padding: 24px 28px;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.bank-icon {
  font-size: 48px;
  line-height: 1;
}

.bank-header h2 {
  font-size: 26px;
  text-align: right;
  margin-bottom: 6px;
}

.bank-header p {
  color: #666;
  font-size: 14px;
}

@media (max-width: 768px) {
  .pro-tabs { gap: 8px; }
  .pro-tab  { padding: 10px 16px; font-size: 13px; }
  .bank-header { flex-direction: column; text-align: center; }
  .bank-header h2 { text-align: center; font-size: 20px; }
}

/* ==================== صفحه شهر ==================== */

.city-hero {
  background: linear-gradient(135deg,
    var(--green) 0%, var(--purple) 100%
  );
  padding: 50px 20px;
  color: #fff;
}

.city-hero-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.city-icon {
  font-size: 64px;
  line-height: 1;
}

.city-hero h1 {
  font-size: 38px;
  color: #fff;
  margin-bottom: 6px;
}

.city-hero p {
  font-size: 16px;
  opacity: .85;
}

/* ==================== جدول گزارش‌ها ==================== */

.reports-table-wrap {
  overflow-x: auto;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.reports-table th {
  background: #f4f7fb;
  padding: 12px 14px;
  text-align: right;
  font-weight: bold;
  color: #444;
  border-bottom: 2px solid var(--border);
}

.reports-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.reports-table tr:hover td {
  background: #f9fbff;
}

/* ==================== بج‌ها ==================== */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}

.badge--blue   { background: #e3f2fd; color: #1565c0; }
.badge--red    { background: #ffebee; color: #c62828; }
.badge--orange { background: #fff3e0; color: #e65100; }
.badge--gray   { background: #f5f5f5; color: #555; }

@media (max-width: 768px) {
  .city-hero-inner { flex-direction: column; text-align: center; }
  .city-hero h1    { font-size: 28px; }
  .city-icon       { font-size: 48px; }
}

/* ==================== جستجوی شهر ==================== */

.city-search-box {
  background: #fff;
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: var(--shadow);
  position: relative;
}

.city-search-box label {
  display: block;
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 12px;
  color: #444;
}

.city-search-row {
  display: flex;
  gap: 12px;
}

.city-search-row input {
  flex: 1;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: .25s;
}

.city-search-row input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,200,83,.12);
}

.city-search-row button {
  padding: 13px 28px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  transition: .25s;
  white-space: nowrap;
}

.city-search-row button:hover {
  background: var(--purple);
  transform: translateY(-2px);
}

.city-search-suggestions {
  position: absolute;
  top: 100%;
  right: 28px;
  left: 28px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-hover);
  margin-top: 6px;
  overflow: hidden;
  z-index: 50;
  display: none;
}

.city-search-suggestions.show {
  display: block;
}

.city-search-suggestion-item {
  padding: 12px 18px;
  cursor: pointer;
  transition: .2s;
  font-size: 14px;
  border-bottom: 1px solid #f5f5f5;
}

.city-search-suggestion-item:last-child {
  border-bottom: none;
}

.city-search-suggestion-item:hover {
  background: #f0fff6;
  color: var(--green);
}

/* ==================== جستجوی کلیدواژه ==================== */

.search-box {
  background: #fff;
  border-radius: 18px;
  padding: 6px 8px 6px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  padding: 14px 4px;
  background: transparent;
}

.search-box button {
  background: #f0f0f0;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: #777;
  flex-shrink: 0;
  transition: .25s;
}

.search-box button:hover {
  background: var(--red);
  color: #fff;
}

.search-result-info {
  margin-top: 12px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #f0fff6, #fef9e7);
  border-radius: 12px;
  border-right: 4px solid var(--green);
  font-size: 14px;
  color: #444;
}

/* ==================== هدر یکپارچه دکمه‌ها ==================== */

.header-nav-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 768px) {
  .header-nav-group {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ==================== چیدمان جدید هدر: لوگو وسط ==================== */

.form-header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.form-header-inner .back-link {
  justify-self: start;
}

.form-header-inner .form-header-logo {
  justify-self: center;
}

.form-header-inner .header-nav-group {
  justify-self: end;
}

@media (max-width: 900px) {
  .form-header-inner {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: center;
  }
  .form-header-inner .back-link,
  .form-header-inner .form-header-logo,
  .form-header-inner .header-nav-group {
    justify-self: center;
  }
}

/* ==================== آکاردئون گزارش‌ها بر اساس بانک ==================== */

.bank-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bank-accordion-item {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.bank-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;
  color: #333;
  transition: .25s;
  user-select: none;
}

.bank-accordion-header:hover {
  background: #f9fbff;
}

.bank-accordion-header .bank-accordion-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bank-accordion-header .bank-accordion-count {
  background: #f0f0f0;
  color: #666;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: bold;
}

.bank-accordion-arrow {
  transition: .3s;
  font-size: 13px;
  color: #999;
}

.bank-accordion-item.open .bank-accordion-arrow {
  transform: rotate(180deg);
}

.bank-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}

.bank-accordion-item.open .bank-accordion-body {
  max-height: 4000px;
}

.bank-accordion-body-inner {
  padding: 0 22px 20px;
}

.bank-accordion-empty {
  padding: 16px 0;
  color: #999;
  font-size: 13px;
  text-align: center;
}

/* ==================== کارت‌های گزارش داخل آکاردئون ==================== */

.report-detail-card {
  background: #f9fbff;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
  border-right: 4px solid var(--green);
}

.report-detail-card:last-child {
  margin-bottom: 0;
}

.report-detail-title {
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 12px;
  color: #222;
}

.report-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.report-detail-field {
  font-size: 13px;
  color: #555;
}

.report-detail-field b {
  display: block;
  color: #888;
  font-size: 11px;
  font-weight: normal;
  margin-bottom: 3px;
}