/* ==========================================================
   _dashboard.css — Dashboard / Home
   Mantém estilos específicos do dashboard.
   Estilos reutilizáveis foram renomeados sem prefixo .dash-
   e movidos para este mesmo arquivo (compartilhados via $_styles).
   ========================================================== */

.page-dashboard {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100dvh;
}

/* ============================================================
   COMPONENTES REUTILIZÁVEIS
   ============================================================ */

/* --- toolbar: filtros + busca ----------------------------- */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

/* --- search-field ----------------------------------------- */
.search-field {
  flex: 1;
  min-width: 180px;
  max-width: 360px;
  position: relative;
}
.search-field__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-field input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1.5px solid var(--line-dark);
  border-radius: var(--radius-md);
  background: var(--surface);
  font: inherit;
  font-size: .875rem;
  color: var(--text);
  transition: border-color var(--t), box-shadow var(--t);
}
.search-field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(27,172,182,.12);
}

/* --- filter-tabs ------------------------------------------ */
.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius-md);
}

.filter-tab {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--t), color var(--t);
  white-space: nowrap;
}
.filter-tab:hover { color: var(--text); }
.filter-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--brand);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* --- section ---------------------------------------------- */
.section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section__title {
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin: 0;
}

/* --- empty-state ------------------------------------------ */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-state__icon { opacity: .2; }
.empty-state__title { font-size: 1.125rem; font-weight: 700; }
.empty-state__desc  { font-size: .875rem; color: var(--text-muted); max-width: 320px; }

/* --- skeleton --------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--line) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.4s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shine {
  to { background-position: -200% 0; }
}

/* ============================================================
   ESPECÍFICOS DO DASHBOARD
   ============================================================ */

/* --- Favorites (apenas dashboard) ------------------------- */
.dash-favorites {
  margin-bottom: 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

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

.dash-favorites__title {
  margin: 0;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dash-favorites__count {
  font-size: .75rem;
  color: var(--text-muted);
}

.dash-favorites__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.dash-favorites__grid button {
  top: 0px;
  right: 0px;
  width: 24px;
  height: 24px;
}

.dash-fav-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
  position: relative;
}

.dash-fav-card__link {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  text-decoration: none;
  color: inherit;
}

.dash-fav-card__thumb {
  width: 56px;
  height: 56px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--line);
}

.dash-fav-card__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  font-weight: 700;
  color: var(--text-muted);
}

.dash-fav-card__name {
  margin: 0;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dash-fav-card__favorite {
  position: absolute;
  top: 4px;
  right: 6px;
  z-index: 1;
  width: 28px;
  height: 28px;
  font-size: 1.25rem;
  background: transparent;
  padding: 0;
}

/* --- Container de projetos -------------------------------- */
.dash-projects {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* --- bignumbers (KPIs reutilizáveis) ----------------------- */
/* Uso: <ul class="cards bignumbers"> com um <li> por KPI contendo
   <strong slot="value"> (número grande) e <p slot="label"> (rótulo).
   Reutilizável em qualquer página que importe esta folha. */
.bignumbers {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 14px;
}

.bignumbers li {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px 18px 18px;
  gap: 6px;
  cursor: default;
}

/* KPI não é clicável — anula o hover de card navegável. */
.bignumbers li:hover {
  box-shadow: var(--shadow-sm);
  transform: none;
  border-color: var(--line);
}

.bignumbers li strong {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}

.bignumbers li p {
  margin: 0;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- Responsivo ------------------------------------------ */
@media (max-width: 640px) {
  .dash-main   { padding: 24px 16px 60px; }
  main > header { margin-bottom: 24px; }
  .toolbar { gap: 8px; }
}
