/**
 * Layout responsivo: mobile (<768), tablet (768–1023), desktop (≥1024)
 */

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 0.7s linear infinite; }

/* Body lock quando o drawer está aberto */
body.sidebar-open {
  overflow: hidden;
}

/* Toolbars: empilha no mobile, linha no tablet+ */
.page-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 768px) {
  .page-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.page-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}
@media (min-width: 768px) {
  .page-toolbar__filters { width: auto; }
}
.page-toolbar__filters input[type="search"],
.page-toolbar__filters input[type="date"],
.page-toolbar__filters input:not([type]),
.page-toolbar__filters select {
  min-width: 0;
  flex: 1 1 8rem;
}
@media (min-width: 768px) {
  .page-toolbar__filters input[type="search"] { flex: 0 1 14rem; }
}
.page-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}
@media (min-width: 768px) {
  .page-toolbar__actions { width: auto; justify-content: flex-end; }
}
.page-toolbar__actions > button,
.page-toolbar__actions > a {
  width: 100%;
}
@media (min-width: 640px) {
  .page-toolbar__actions > button,
  .page-toolbar__actions > a {
    width: auto;
  }
}

/* Tabelas: no mobile o conteúdo cabe; min-width só no tablet+ */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  width: 100%;
  min-width: 0;
}
@media (min-width: 768px) {
  .table-scroll table {
    min-width: 36rem;
  }
}

/* Lista compacta: todas as colunas visíveis sem scroll lateral (só mobile) */
.fit-list {
  display: flex;
  flex-direction: column;
}
@media (min-width: 768px) {
  .fit-list {
    display: none;
  }
}
.fit-list__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.fit-list__row:last-child {
  border-bottom: 0;
}
.fit-list__title {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.875rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fit-list__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.45rem;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.35;
}
.fit-list__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}
.fit-list__empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* Modais: quase fullscreen no mobile */
.modal-panel {
  width: calc(100% - 1.5rem);
  max-width: 32rem;
  max-height: min(90vh, 100dvh - 2rem);
  overflow-y: auto;
  margin: 1rem auto;
}
@media (min-width: 640px) {
  .modal-panel {
    width: 100%;
    margin-top: 4rem;
  }
}
.modal-panel--lg {
  max-width: 42rem;
}

/* Cards de stats */
.stat-value {
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 700;
}
@media (min-width: 768px) {
  .stat-value { font-size: 1.75rem; }
}

/* Safe area (notch) */
@supports (padding: env(safe-area-inset-bottom)) {
  #sidebar .absolute.bottom-0 {
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }
}

/* Dashboard admin — cards (padrão MVP agendamento) */
.admin-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}
.admin-stat-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.admin-stat-card__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #64748b;
}
.admin-stat-card__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 0 0 0.15rem;
}
.admin-stat-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: #0f172a;
  margin: 0;
}
.admin-stat-card--green .admin-stat-card__icon { background: #dcfce7; color: #16a34a; }
.admin-stat-card--emerald .admin-stat-card__icon { background: #d1fae5; color: #059669; }
.admin-stat-card--blue .admin-stat-card__icon { background: #ffe4e6; color: #c41e3a; }
.admin-stat-card--cyan .admin-stat-card__icon { background: #ffe4e6; color: #e11d48; }
.admin-stat-card--purple .admin-stat-card__icon { background: #fff1f2; color: #9f1239; }
.admin-stat-card--amber .admin-stat-card__icon { background: #fef3c7; color: #d97706; }
.admin-stat-card--red .admin-stat-card__icon { background: #ffe4e6; color: #e11d48; }
.admin-stat-card--gray .admin-stat-card__icon { background: #f1f5f9; color: #64748b; }
