/* Dashboard premium — KPI hero, gráficos, alertas */

.dashboard-toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
  margin-bottom: var(--space-5);
  padding: 14px 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.dashboard-toolbar:hover {
  transform: none;
  box-shadow: var(--shadow-md);
}

.dashboard-toolbar__head {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
}

.dashboard-toolbar__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.dashboard-toolbar__title i {
  color: var(--accent);
  font-size: 22px;
}

.dashboard-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-left: auto;
  width: auto;
  flex: 0 0 auto;
  min-width: 0;
}

.dashboard-toolbar__filters .form-group {
  margin-bottom: 0;
  min-width: 0;
}

.dashboard-toolbar__filters .form-group:first-of-type {
  width: min(168px, 38vw);
}

.dashboard-toolbar__filters .form-group:nth-of-type(2) {
  width: 88px;
}

.dashboard-toolbar__filters select {
  width: 100%;
  min-height: 38px;
  height: 38px;
  padding: 0 10px;
  font-size: 13px;
}

@media (max-width: 640px) {
  .dashboard-toolbar__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-toolbar__filters {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .dashboard-toolbar__filters .form-group:first-of-type,
  .dashboard-toolbar__filters .form-group:nth-of-type(2) {
    flex: 1 1 auto;
    width: auto;
  }
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.kpi-row--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .kpi-row {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 100% 0%, rgba(37, 99, 235, 0.08), transparent 55%);
  pointer-events: none;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.kpi-card__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  position: relative;
}

.kpi-card__value {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 800;
  margin-top: var(--space-2);
  color: var(--primary);
  position: relative;
  letter-spacing: -0.02em;
}

.kpi-card__hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: var(--space-3);
  line-height: 1.45;
  position: relative;
}

.kpi-card__hint--list {
  max-height: 100px;
  overflow-y: auto;
  white-space: pre-line;
}

.kpi-card--accent {
  border-color: rgba(37, 99, 235, 0.25);
}

.kpi-card--success {
  border-color: rgba(5, 150, 105, 0.28);
}

.kpi-card--warning {
  border-color: rgba(217, 119, 6, 0.28);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.dash-pendencias-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4) var(--space-5) var(--space-3);
  margin-bottom: var(--space-4);
}

.dash-pendencias-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.dash-pendencias-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-pendencias-card__title i {
  color: var(--accent);
  font-size: 14px;
}

.dash-pendencias-list {
  max-height: 280px;
  min-height: 120px;
  overflow-y: auto;
  padding: 0;
}

.dash-pendencias-list .audiencias-empty {
  margin: 0;
  padding: var(--space-4);
  text-align: center;
}

@media (max-width: 900px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4) var(--space-5) var(--space-3);
  min-height: 320px;
}

.chart-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.chart-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.chart-card__sub {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.chart-area {
  min-height: 260px;
}

.dashboard-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

@media (max-width: 900px) {
  .dashboard-split {
    grid-template-columns: 1fr;
  }
}

.dashboard-table-card .data-table-wrap {
  max-height: 320px;
  overflow: auto;
}

.empty-hint {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  padding: var(--space-5);
}

.dashboard-provisionado-card {
  margin-top: 0;
  margin-bottom: 8px;
}

.dashboard-provisionado-hint {
  font-size: 13px;
  color: var(--text-light);
  margin: 0 0 14px 0;
  line-height: 1.45;
}

.dashboard-provisionado-table-wrap {
  max-height: 360px;
  overflow: auto;
}

.dashboard-provisionado-total-row td {
  border-top: 2px solid var(--border);
  background: var(--bg-secondary);
  font-weight: 700;
}

.dashboard-pagto-sim,
.dashboard-pagto-avista,
.dashboard-pagto-parcial,
.dashboard-pagto-parcelado,
.dashboard-pagto-misto,
.dashboard-pagto-nao {
  display: inline-block;
  min-width: 58px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.dashboard-pagto-sim,
.dashboard-pagto-avista {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
}

.dashboard-pagto-parcial {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

.dashboard-pagto-parcelado {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.dashboard-pagto-misto {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
}

.dashboard-pagto-nao {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

/* —— Overview operacional (cards pastéis + calendário + visão geral) —— */
.dash-overview {
  margin: 0 0 var(--space-6);
}

.dash-hero {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dash-hero-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  min-height: 148px;
  padding: 16px 16px 14px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.dash-hero-card:hover,
.dash-hero-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
  outline: none;
}

.dash-hero-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.dash-hero-card__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.dash-hero-card__icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  opacity: 0.85;
}

.dash-hero-card__value {
  margin-top: 10px;
  font-size: clamp(1.7rem, 2.4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.dash-hero-card__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

.dash-hero-card__hint {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.dash-hero-card__go {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.dash-hero-card--purple {
  background: #f3e8ff;
  color: #6d28d9;
}
.dash-hero-card--purple .dash-hero-card__hint { color: #7c3aed; }
.dash-hero-card--purple .dash-hero-card__go { color: #7c3aed; }

.dash-hero-card--blue {
  background: #dbeafe;
  color: #1d4ed8;
}
.dash-hero-card--blue .dash-hero-card__hint { color: #2563eb; }
.dash-hero-card--blue .dash-hero-card__go { color: #2563eb; }

.dash-hero-card--green {
  background: #d1fae5;
  color: #047857;
}
.dash-hero-card--green .dash-hero-card__hint { color: #059669; }
.dash-hero-card--green .dash-hero-card__go { color: #059669; }

.dash-hero-card--orange {
  background: #ffedd5;
  color: #c2410c;
}
.dash-hero-card--orange .dash-hero-card__hint { color: #ea580c; }
.dash-hero-card--orange .dash-hero-card__go { color: #ea580c; }

.dash-hero-card--pink {
  background: #fce7f3;
  color: #be185d;
}
.dash-hero-card--pink .dash-hero-card__hint { color: #db2777; }
.dash-hero-card--pink .dash-hero-card__go { color: #db2777; }

.dash-overview-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.88fr) minmax(280px, 1.05fr) minmax(320px, 1.45fr);
  gap: 16px;
  align-items: stretch;
}

.dash-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 16px 18px 18px;
  min-width: 0;
  min-height: 100%;
}

.dash-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.dash-panel__title,
.dash-geral-block__title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.dash-geral-block__title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.dash-panel__link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 0;
}

.dash-panel__link:hover,
.dash-panel__link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.dash-cal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-cal-nav__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  min-width: 108px;
  text-align: center;
}

.dash-cal-nav__btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dash-cal-nav__btn:hover,
.dash-cal-nav__btn:focus-visible {
  background: var(--accent-muted);
  color: var(--accent);
  outline: none;
}

.dash-cal-weekdays,
.dash-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
}

.dash-cal-weekdays {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
}

.dash-cal-weekdays span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 22px;
}

.dash-cal-grid {
  gap: 2px;
}

.dash-cal-day {
  position: relative;
  width: 100%;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  border-radius: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.dash-cal-day.is-muted {
  color: var(--text-light);
  opacity: 0.45;
}

.dash-cal-day.is-today {
  color: #fff;
  font-weight: 800;
}

.dash-cal-day.is-today::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  z-index: -1;
}

.dash-cal-day.has-event:not(.is-today)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--accent);
}

.dash-cal-day:hover:not(.is-today)::before,
.dash-cal-day:focus-visible:not(.is-today)::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-muted);
  z-index: -1;
}

.dash-cal-day:focus-visible {
  outline: none;
}

.dash-cal-hoje {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.dash-cal-hoje__label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.dash-cal-hoje__list {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.45;
}

.dash-cal-hoje__item {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 4px;
}

.dash-cal-hoje__item strong {
  color: var(--text);
  font-weight: 700;
}

.dash-aud-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
}

.dash-aud-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 8px 4px 8px 0;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

.dash-aud-item:nth-child(2) { border-left-color: #2563eb; }
.dash-aud-item:nth-child(3) { border-left-color: #059669; }
.dash-aud-item:nth-child(4) { border-left-color: #ea580c; }
.dash-aud-item:nth-child(5) { border-left-color: #db2777; }

.dash-aud-item__date {
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  text-transform: uppercase;
}

.dash-aud-item__time {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: none;
  margin-top: 2px;
}

.dash-aud-item__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.dash-aud-item__meta {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.dash-empty {
  font-size: 13px;
  color: var(--text-light);
  padding: 12px 0;
}

.dash-geral-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}

.dash-donut-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dash-donut {
  position: relative;
  width: 108px;
  height: 108px;
  flex: 0 0 108px;
  border-radius: 50%;
  background: conic-gradient(#e2e8f0 0 100%);
}

.dash-donut__hole {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.dash-donut__hole strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.dash-donut__hole span {
  font-size: 10px;
  color: var(--text-light);
  font-weight: 600;
}

.dash-donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: var(--text);
}

.dash-donut-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.dash-donut-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
}

.dash-donut-legend span {
  color: var(--text-light);
  margin-left: auto;
  font-weight: 700;
}

.dash-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-bar-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.dash-bar-row__label {
  color: var(--text-light);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-bar-row__track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-secondary);
  overflow: hidden;
}

.dash-bar-row__fill {
  height: 100%;
  border-radius: 999px;
  background: #7c3aed;
}

.dash-bar-row__n {
  text-align: right;
  font-weight: 800;
  color: var(--text);
}

.dash-activity {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-activity li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  margin-bottom: 10px;
  font-size: 12px;
}

.dash-activity__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-muted);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.dash-activity__text {
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
}

.dash-activity__time {
  color: var(--text-light);
  font-size: 11px;
  white-space: nowrap;
}

.dash-urgente {
  grid-column: 2;
  grid-row: 2;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 14px;
  padding: 12px 14px;
}

.dash-urgente__title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: #b91c1c;
}

.dash-urgente__list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: #7f1d1d;
}

.dash-urgente__list li {
  margin-bottom: 6px;
  padding-left: 12px;
  position: relative;
}

.dash-urgente__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ef4444;
}

@media (max-width: 1180px) {
  .dash-hero {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash-overview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-panel--geral {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .dash-hero,
  .dash-overview-grid,
  .dash-geral-grid {
    grid-template-columns: 1fr;
  }

  .dash-panel--geral,
  .dash-urgente {
    grid-column: auto;
    grid-row: auto;
  }
}

[data-theme="dark"] .dash-hero-card__go,
[data-theme="blue"] .dash-hero-card__go {
  background: #fff;
}

[data-theme="dark"] .dash-urgente,
[data-theme="blue"] .dash-urgente {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.35);
}

[data-theme="dark"] .dash-urgente__title,
[data-theme="blue"] .dash-urgente__title {
  color: #fecaca;
}

[data-theme="dark"] .dash-urgente__list,
[data-theme="blue"] .dash-urgente__list {
  color: #fecaca;
}
