.dashboard {
  width: min(100%, 1380px);
  margin: 0 auto;
  padding: 18px;
  color: #1d2b3e;
}

.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-header h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.dashboard-header p {
  margin: 4px 0 0;
  color: #65748a;
  font-size: 14px;
}

.dashboard-filters,
.dashboard-custom-dates {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.dashboard-filters > label,
.dashboard-custom-dates label {
  display: grid;
  gap: 4px;
}

.dashboard-filters label > span {
  color: #617086;
  font-size: 13px;
  font-weight: 700;
}

.dashboard-filters .select { min-width: 150px; }
.dashboard-custom-dates .input { width: 142px; }
.dashboard-filter-button { min-width: 76px; }

.dashboard-section {
  margin-bottom: 18px;
}

.dashboard-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.dashboard-section-title > div,
.dashboard-panel header > div {
  display: grid;
  gap: 2px;
}

.dashboard-section-title h2,
.dashboard-panel h2 {
  margin: 0;
  font-size: 16px;
}

.dashboard-section-title span,
.dashboard-panel header span {
  color: #6a788c;
  font-size: 13px;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-kpi {
  min-width: 0;
  min-height: 106px;
  position: relative;
  display: grid;
  align-content: center;
  padding: 14px 50px 14px 15px;
  overflow: hidden;
  border: 1px solid #dbe3ea;
  border-left: 4px solid currentColor;
  border-radius: 7px;
  background: #fff;
  color: #2567ad;
  box-shadow: 0 5px 16px rgba(32, 51, 72, .05);
}

.dashboard-kpi:hover {
  border-color: currentColor;
  box-shadow: 0 8px 20px rgba(32, 51, 72, .09);
}

.dashboard-kpi strong {
  color: currentColor;
  font-size: 27px;
  line-height: 1;
}

.dashboard-kpi > span:last-child {
  margin-top: 7px;
  color: #526176;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
}

.dashboard-kpi-icon {
  width: 32px;
  height: 32px;
  position: absolute;
  top: 17px;
  right: 14px;
  display: grid;
  place-items: center;
  opacity: .88;
}

.dashboard-kpi-icon svg,
.dashboard-time-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.dashboard-kpi.green,
.dashboard-times .green { color: #28894b; }
.dashboard-kpi.blue,
.dashboard-times .blue { color: #2479c7; }
.dashboard-kpi.teal,
.dashboard-times .teal { color: #008f87; }
.dashboard-kpi.rose { color: #c95679; }
.dashboard-kpi.amber,
.dashboard-times .amber { color: #bd7300; }
.dashboard-kpi.red { color: #c83f46; }

.dashboard-times {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-times article {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 13px 15px;
  border: 1px solid #dbe3ea;
  border-radius: 7px;
  background: #fff;
}

.dashboard-time-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.dashboard-times article > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.dashboard-times strong {
  overflow: hidden;
  color: currentColor;
  font-size: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-times article > div span {
  color: #5e6c80;
  font-size: 14px;
}

.dashboard-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, .85fr);
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d9e1e8;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(32, 51, 72, .04);
}

.dashboard-panel > header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  border-bottom: 1px solid #e4e9ee;
}

.dashboard-legend {
  display: flex !important;
  align-items: center;
  gap: 14px !important;
}

.dashboard-legend span::before {
  content: "";
  width: 9px;
  height: 9px;
  display: inline-block;
  margin-right: 5px;
  border-radius: 2px;
  background: #2b78c5;
}

.dashboard-legend span.resolved::before { background: #39a36b; }

.dashboard-trend {
  height: 270px;
  display: grid;
  grid-template-columns: repeat(var(--dashboard-columns), minmax(10px, 1fr));
  align-items: end;
  gap: 3px;
  padding: 24px 16px 12px;
  border-bottom: 1px solid #edf1f4;
}

.dashboard-trend-column {
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 24px;
  align-items: end;
}

.dashboard-bars {
  height: 100%;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 2px;
}

.dashboard-bars i {
  width: min(12px, 40%);
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: #2b78c5;
}

.dashboard-bars i.resolved { background: #39a36b; }

.dashboard-trend-column > span {
  min-width: 0;
  overflow: visible;
  color: #627187;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}

.dashboard-trend-column > span.muted-label { visibility: hidden; }

.dashboard-queue-list {
  display: grid;
  gap: 3px;
  padding: 8px 14px 14px;
}

.dashboard-queue-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  padding: 9px 0;
  border-bottom: 1px solid #edf1f4;
}

.dashboard-queue-list article:last-child { border-bottom: 0; }
.dashboard-queue-list article > div { min-width: 0; display: grid; gap: 2px; }
.dashboard-queue-list strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-queue-list article span { color: #65748a; font-size: 13px; }
.dashboard-queue-list b { color: #5b687b; font-size: 13px; }
.dashboard-queue-list b:not(:empty) { align-self: center; }

.dashboard-queue-bar {
  height: 5px;
  grid-column: 1 / -1;
  overflow: hidden;
  border-radius: 3px;
  background: #edf2f5;
}

.dashboard-queue-bar i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #129c8b;
}

.dashboard-agents { margin-bottom: 12px; }
.dashboard-table-wrap { overflow-x: auto; }
.dashboard-agents table { width: 100%; border-collapse: collapse; }
.dashboard-agents th,
.dashboard-agents td { padding: 11px 14px; border-bottom: 1px solid #edf1f4; text-align: right; font-size: 13px; white-space: nowrap; }
.dashboard-agents th { color: #607086; background: #f7f9fa; font-weight: 700; }
.dashboard-agents th:first-child,
.dashboard-agents td:first-child { text-align: left; }
.dashboard-agents td:first-child { display: flex; align-items: center; gap: 9px; }
.dashboard-agents tbody tr:last-child td { border-bottom: 0; }
.dashboard-agent-avatar { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 30px; border-radius: 50%; background: #e1f3f0; color: #087b72; font-weight: 800; }
.dashboard-danger { color: #bd3030; font-weight: 800; }

.dashboard-contacts { margin-bottom: 2px; }
.dashboard-contact-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-contact-list a { min-width: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 2px 9px; padding: 12px 14px; border-right: 1px solid #edf1f4; border-bottom: 1px solid #edf1f4; color: #233349; }
.dashboard-contact-list a:nth-child(4n) { border-right: 0; }
.dashboard-contact-rank { width: 28px; height: 28px; grid-row: 1 / 3; display: grid; place-items: center; border-radius: 50%; background: #eef3f6; color: #637187; font-weight: 800; }
.dashboard-contact-list strong { min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-contact-list a > span:last-child { color: #6b798d; font-size: 13px; }
.dashboard-empty { min-height: 150px; display: grid; place-items: center; padding: 20px; color: #6a788c; font-size: 14px; text-align: center; }

@media (max-width: 1180px) {
  .dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-contact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-contact-list a:nth-child(4n) { border-right: 1px solid #edf1f4; }
  .dashboard-contact-list a:nth-child(2n) { border-right: 0; }
}

@media (max-width: 900px) {
  .dashboard-header { align-items: stretch; flex-direction: column; }
  .dashboard-filters { flex-wrap: wrap; }
  .dashboard-times { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-primary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .dashboard { padding: 12px; }
  .dashboard-kpis,
  .dashboard-times,
  .dashboard-contact-list { grid-template-columns: 1fr; }
  .dashboard-contact-list a { border-right: 0; }
}
