/* ── OS Dashboard ───────────────────────────────────────────────────────── */

#os-dashboard-page {
  padding: 0 0 48px;
}

/* ── Barra de filtros ── */
#os-dashboard-page .os-filters {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  margin-bottom: 24px;
}

#os-dashboard-page .os-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 160px;
}

#os-dashboard-page .os-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

#os-dashboard-page .os-input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-light-mode);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--background-color-main-light);
  color: var(--text-primary);
  box-sizing: border-box;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#os-dashboard-page select.os-input {
  padding-right: 28px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

#os-dashboard-page #os-db-custom-range .os-input {
  width: 100%;
  flex: 1;
}

#os-dashboard-page .os-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

html.dark-theme #os-dashboard-page .os-input {
  background-color: var(--background-main-dark-mode, #1e293b);
  border-color: var(--border-dark-mode, #334155);
  color: var(--text-primary);
}

#os-dashboard-page #os-db-custom-range {
  display: none;
  flex-direction: row;
  align-items: center;
  align-self: flex-end;
  gap: 8px;
  flex: 2 1 280px;
}

.os-db-date-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ── Grid de KPI cards ── */
.os-db-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.os-db-card {
  background: var(--background-color-main-light);
  border: 1px solid var(--border-light-mode);
  border-radius: 14px;
  padding: 22px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.15s;
}

.os-db-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.os-db-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.os-db-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
}

/* ── Linhas de gráficos ── */
.os-db-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* Card solto (evolução) */
#os-dashboard-page > .os-card {
  margin-bottom: 16px;
}

/* ── Painéis de gráfico ── */
#os-dashboard-page .os-card {
  background: var(--background-color-main-light);
  border: 1px solid var(--border-light-mode);
  border-radius: 14px;
  padding: 20px;
  overflow: hidden;
}

#os-dashboard-page .os-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light-mode);
}

.os-db-chart-wrap {
  position: relative;
  height: 230px;
}

.os-db-chart-wide {
  height: 190px;
}

/* ── Lista OS de hoje ── */
.os-db-today-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 255px;
  overflow-y: auto;
  padding-right: 2px;
}

.os-db-today-list::-webkit-scrollbar { width: 4px; }
.os-db-today-list::-webkit-scrollbar-track { background: transparent; }
.os-db-today-list::-webkit-scrollbar-thumb { background: var(--border-light-mode); border-radius: 4px; }

.os-db-today-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border-light-mode);
  transition: background 0.15s, border-color 0.15s;
}

.os-db-today-item:hover {
  background: var(--hover-bg, #f8fafc);
  border-color: #f97316;
}

.os-db-today-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  width: 40px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.os-db-today-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.os-db-today-info strong {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.os-db-today-info span {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Legenda SLA ── */
#os-db-sla-legend {
  text-align: center;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Estados vazio / loading ── */
#os-dashboard-page .os-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
}

#os-dashboard-page .os-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  gap: 10px;
  text-align: center;
}

#os-dashboard-page .os-empty i {
  font-size: 2.2rem;
  opacity: 0.3;
}

/* ── Responsivo ── */
@media (max-width: 1280px) {
  .os-db-cards { grid-template-columns: repeat(3, 1fr); }
}

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

@media (max-width: 640px) {
  .os-db-cards { grid-template-columns: repeat(2, 1fr); }
  #os-dashboard-page .os-filters { gap: 12px; }
}
