/**
 * Design System — Master CRUD Page (Stories 024–025)
 * Densidade SaaS: toolbar conectada à tabela, linhas compactas, pills e ícones.
 */

.master-page {
  min-width: 0;
}

.master-page__stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cadastros-hero .master-page__title,
.analytics-card--hero .master-page__title {
  margin: 0 0 0.15rem;
  color: #F8FAFC;
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.master-page__header {
  margin-bottom: 0.75rem;
}

.master-page__title {
  margin: 0 0 0.15rem;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--color-text);
  line-height: 1.25;
}

.master-page__description {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.45;
  max-width: 40rem;
}

/* Painel: toolbar + tabela sem “vão” visual */
.master-page__panel {
  padding: 0;
  overflow: hidden;
}

.master-page__list {
  min-height: 3rem;
}

.master-page__list .empty-state {
  margin: 0;
  padding: 1.75rem 1.25rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* ——— MasterToolbar ——— */
.master-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  background: #fafbfc;
}

.master-toolbar__tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
  flex: 1 1 auto;
}

.master-toolbar__search-wrap {
  display: block;
  flex: 1 1 12rem;
  max-width: 18rem;
  min-width: 10rem;
}

.master-toolbar__search {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.master-toolbar__filter-wrap {
  display: block;
  flex-shrink: 0;
}

.master-toolbar__filter {
  appearance: none;
  margin: 0;
  padding: 0.4rem 1.75rem 0.4rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background-color: var(--color-surface);
  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='%2364748b' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  color: var(--color-text);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.3;
  cursor: pointer;
  min-width: 7.5rem;
}

.master-toolbar__filter:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.master-empty-filter {
  padding: 2rem 1.25rem;
  text-align: center;
}

.master-empty-filter__title {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.master-empty-filter__hint {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.master-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* ——— MasterTable (densidade) ——— */
.master-table,
.master-page__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.master-table th,
.master-table td,
.master-page__table th,
.master-page__table td {
  padding: 0.45rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.master-table th,
.master-page__table th {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f8fafc;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.master-table tbody tr:hover,
.master-page__table tbody tr:hover {
  background: #f8fafc;
}

.master-table tr:last-child td,
.master-page__table tr:last-child td {
  border-bottom: none;
}

.master-table .actions,
.master-page__table .actions {
  white-space: nowrap;
  text-align: right;
}

.master-table th.col-actions,
.master-page__table th.col-actions {
  text-align: right;
  width: 6.5rem;
}

.master-table .col-status,
.master-page__table .col-status {
  width: 6.5rem;
}

/* ——— Nome + cor ——— */
.master-name {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.master-name__swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.master-name__text {
  font-weight: 500;
  color: var(--color-text);
}

/* ——— StatusBadge (pills) ——— */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.35;
  border: 1px solid transparent;
}

.status-pill--active {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.status-pill--inactive {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}

.row--inactive .master-name__text {
  color: var(--color-muted);
}

/* Story 057 — lados Banco/Outro no formulário de transferência */
.form-help {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--color-muted);
  line-height: 1.4;
}

.transfer-lado {
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem 0.75rem;
  margin: 0;
}

.transfer-lado legend {
  padding: 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.transfer-lado__tipos {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.transfer-lado__tipos label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 400;
}

.badge--muted {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
}
