/* ==========================================================================
   Power RH — sistema de design
   Arquivo único compartilhado por todas as telas. Substitui os 20 CSS que
   repetiam o mesmo layout, a mesma sidebar e a mesma importação de fonte.
   Escrito mobile-first: o padrão vale para celular e as media queries vão
   somando espaço conforme a tela cresce.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Verde da marca. O #00e900 original é neon demais para texto e botão
     (contraste insuficiente), então virou a ponta clara de uma escala:
     500/600 são os tons usáveis em superfície branca. */
  --brand-50:  #e8fbed;
  --brand-100: #c6f5d2;
  --brand-200: #8fe9a8;
  --brand-300: #52d977;
  --brand-400: #22c250;
  --brand-500: #0ea63a;
  --brand-600: #0a862f;
  --brand-700: #096b28;
  --brand-800: #0a5522;
  --brand-900: #08461d;

  --gray-50:  #f7f8fa;
  --gray-100: #eef0f4;
  --gray-200: #e2e5ec;
  --gray-300: #cbd0da;
  --gray-400: #9aa2b1;
  --gray-500: #6b7383;
  --gray-600: #4d5563;
  --gray-700: #3a4150;
  --gray-800: #262c38;
  --gray-900: #171b23;

  --red-50:   #fef2f2;
  --red-500:  #dc2626;
  --red-600:  #b91c1c;
  --amber-50: #fffbeb;
  --amber-500:#d97706;
  --blue-50:  #eff6ff;
  --blue-500: #2563eb;

  /* Papéis semânticos */
  --bg:            var(--gray-50);
  --surface:       #ffffff;
  --surface-muted: var(--gray-100);
  --border:        var(--gray-200);
  --border-strong: var(--gray-300);
  --text:          var(--gray-800);
  --text-muted:    var(--gray-500);
  --text-inverse:  #ffffff;
  --accent:        var(--brand-600);
  --accent-hover:  var(--brand-700);
  --accent-soft:   var(--brand-50);
  --danger:        var(--red-500);
  --focus-ring:    0 0 0 3px var(--brand-200);

  /* Escala de espaçamento (base 4px) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(23, 27, 35, 0.06);
  --shadow:    0 1px 3px rgba(23, 27, 35, 0.08), 0 4px 12px rgba(23, 27, 35, 0.05);
  --shadow-lg: 0 8px 30px rgba(23, 27, 35, 0.12);

  --sidebar-width: 260px;
  --topbar-height: 60px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  /* Sem width:100vw — era ele que criava barra horizontal em toda página,
     porque 100vw ignora a largura da barra de rolagem vertical. */
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--gray-900);
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Conteúdo visível só para leitores de tela */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   3. Shell da aplicação
   Celular: uma coluna, sidebar vira gaveta sobreposta.
   Desktop: duas colunas, sidebar fixa.
   -------------------------------------------------------------------------- */

.container {
  display: block;
  min-height: 100vh;
}

/* Barra superior — só aparece no celular/tablet */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--topbar-height);
  padding: 0 var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar__menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.topbar__menu:hover {
  background: var(--surface-muted);
}

.brand {
  display: flex;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gray-900);
}

.brand__accent {
  color: var(--accent);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  max-width: 85vw;
  height: 100vh;
  padding: var(--space-4) var(--space-3);
  background: var(--surface);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar.is-open {
  transform: translateX(0);
}

.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-5);
}

.sidebar__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.sidebar__close:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar__link:hover {
  background: var(--surface-muted);
  color: var(--text);
}

/* Item da página atual — o CSS antigo tinha a regra .active, mas nenhuma
   página chegava a aplicar a classe. */
.sidebar__link.is-active {
  background: var(--accent-soft);
  color: var(--brand-700);
  font-weight: 600;
}

.sidebar__link .material-icons-sharp {
  font-size: 1.35rem;
}

.sidebar__footer {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.sidebar__link--danger:hover {
  background: var(--red-50);
  color: var(--red-600);
}

/* Fundo escurecido atrás da gaveta */
.sidebar__overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(23, 27, 35, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.sidebar__overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Área de conteúdo */
main,
.main {
  padding: var(--space-5) var(--space-4) var(--space-7);
  max-width: 100%;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

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

.page-header p {
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (min-width: 992px) {
  .topbar {
    display: none;
  }

  .container {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    transform: none;
    max-width: none;
    height: 100vh;
  }

  .sidebar__close {
    display: none;
  }

  .sidebar__overlay {
    display: none;
  }

  main,
  .main {
    padding: var(--space-6) var(--space-6) var(--space-7);
    /* minmax(0,1fr) acima + este min-width impedem que uma tabela larga
       estoure a coluna e volte a criar rolagem horizontal na página. */
    min-width: 0;
  }
}

@media (min-width: 1400px) {
  main,
  .main {
    padding-left: var(--space-7);
    padding-right: var(--space-7);
  }
}

/* --------------------------------------------------------------------------
   4. Cards
   -------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card + .card {
  margin-top: var(--space-5);
}

.card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.card__body {
  padding: var(--space-5);
}

.card__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
}

/* Painel de estatística */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.stat {
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.stat__label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.stat__value {
  margin-top: var(--space-1);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--gray-900);
}

/* --------------------------------------------------------------------------
   5. Botões
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  /* Alvo confortável para o dedo */
  min-height: 44px;
}

.btn--primary {
  background: var(--accent);
  color: var(--text-inverse);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--text-inverse);
}

.btn--secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--secondary:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.btn--danger {
  background: var(--danger);
  color: var(--text-inverse);
}

.btn--danger:hover {
  background: var(--red-600);
  color: var(--text-inverse);
}

.btn--block {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Botão só de ícone, usado nas colunas de ação das tabelas */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-icon:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-icon--danger:hover {
  background: var(--red-50);
  border-color: var(--red-500);
  color: var(--red-600);
}

.btn-icon--success:hover {
  background: var(--brand-50);
  border-color: var(--brand-500);
  color: var(--brand-700);
}

.btn-icon.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-icon svg {
  width: 17px;
  height: 17px;
}

.actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   6. Formulários
   -------------------------------------------------------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .form-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}

.input,
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="date"],
.field input[type="number"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  padding: var(--space-3);
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: var(--focus-ring);
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: var(--surface-muted);
  color: var(--text-muted);
  cursor: not-allowed;
}

.field__hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Caixa de seleção */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.checkbox:hover {
  background: var(--gray-50);
}

.checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox span {
  font-size: 0.9rem;
}

/* Envio de arquivo */
.field input[type="file"] {
  width: 100%;
  padding: var(--space-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--gray-50);
  font-size: 0.9rem;
  cursor: pointer;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

@media (max-width: 639px) {
  .form-actions .btn {
    width: 100%;
  }
}

/* Barra de filtro/pesquisa acima das listagens */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.toolbar .field {
  flex: 1 1 180px;
}

.toolbar__actions {
  display: flex;
  gap: var(--space-3);
  flex: 0 0 auto;
}

@media (max-width: 639px) {
  .toolbar__actions {
    width: 100%;
  }

  .toolbar__actions .btn {
    flex: 1;
  }
}

/* Foto de perfil no topo dos formulários */
.avatar-field {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface-muted);
  flex-shrink: 0;
}

.avatar--sm {
  width: 40px;
  height: 40px;
}

.avatar--lg {
  width: 96px;
  height: 96px;
}

/* --------------------------------------------------------------------------
   7. Tabelas
   No celular cada linha vira um card, usando o rótulo que o PHP escreve em
   data-label. Antes a tabela simplesmente estourava a largura da tela.
   -------------------------------------------------------------------------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: middle;
}

.table thead th {
  position: sticky;
  top: 0;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.table tbody tr {
  border-bottom: 1px solid var(--border);
}

.table tbody tr:last-child {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: var(--gray-50);
}

.table td {
  color: var(--gray-700);
}

.table .col-actions {
  width: 1%;
  white-space: nowrap;
}

/* A coluna de ações tem largura mínima (width:1%), então o flex-wrap padrão
   fazia os botões empilharem um por linha e esticarem a altura da linha. */
.table .col-actions .actions {
  flex-wrap: nowrap;
}

/* Linha que ainda não foi vista (currículos novos) */
.table tbody tr.is-unread td {
  font-weight: 600;
  color: var(--gray-900);
}

.table tbody tr.is-unread td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

@media (max-width: 860px) {
  .table-wrap {
    overflow-x: visible;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table thead {
    display: none;
  }

  .table tbody tr {
    margin-bottom: var(--space-4);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .table tbody tr:hover {
    background: var(--surface);
  }

  .table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
    text-align: right;
  }

  .table td:last-child {
    border-bottom: 0;
  }

  /* O rótulo da coluna aparece à esquerda, já que o cabeçalho sumiu */
  .table td::before {
    content: attr(data-label);
    flex: 0 0 40%;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    text-align: left;
  }

  .table td[data-label=""]::before,
  .table td:not([data-label])::before {
    content: none;
  }

  .table .col-actions {
    width: auto;
    white-space: normal;
  }

  .table td.col-actions {
    justify-content: flex-end;
  }

  .table tbody tr.is-unread td:first-child {
    box-shadow: none;
  }
}

/* Estado vazio */
.empty {
  padding: var(--space-7) var(--space-5);
  text-align: center;
  color: var(--text-muted);
}

.empty__icon {
  font-size: 2.5rem;
  color: var(--gray-300);
}

.empty h3 {
  margin-top: var(--space-3);
  color: var(--gray-700);
}

.empty p {
  margin-top: var(--space-1);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   8. Etiquetas
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge--success {
  background: var(--brand-50);
  color: var(--brand-700);
}

.badge--danger {
  background: var(--red-50);
  color: var(--red-600);
}

.badge--neutral {
  background: var(--gray-100);
  color: var(--gray-600);
}

.badge--info {
  background: var(--blue-50);
  color: var(--blue-500);
}

.badge--warning {
  background: var(--amber-50);
  color: var(--amber-500);
}

/* --------------------------------------------------------------------------
   9. Paginação
   Agrupada: primeira, reticências, janela ao redor da atual, reticências,
   última. Antes eram impressos todos os números, um por página.
   -------------------------------------------------------------------------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  list-style: none;
}

.pagination__info {
  width: 100%;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

.page-link:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
  color: var(--text);
}

.page-link.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-inverse);
  font-weight: 700;
  cursor: default;
}

.page-link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 40px;
  color: var(--text-muted);
}

/* No celular os números do meio saem e ficam só as setas + página atual,
   para a paginação nunca quebrar em várias linhas. */
@media (max-width: 560px) {
  .pagination .page-item--number,
  .pagination .page-item--ellipsis {
    display: none;
  }

  .pagination .page-item--current {
    display: block;
  }

  .page-link--label {
    display: none;
  }
}

@media (min-width: 561px) {
  .page-item--current-mobile {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   10. Alertas
   -------------------------------------------------------------------------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.9rem;
  margin-bottom: var(--space-5);
}

.alert--success {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-800);
}

.alert--danger {
  background: var(--red-50);
  border-color: #fecaca;
  color: var(--red-600);
}

.alert--info {
  background: var(--blue-50);
  border-color: #bfdbfe;
  color: var(--blue-500);
}

/* Aviso flutuante. Fica em posição fixa justamente para que cada página possa
   incluí-lo onde já incluía, sem precisar reposicionar no HTML. */
.toast-stack {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  left: var(--space-4);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  pointer-events: auto;
  animation: toast-in 0.25s ease;
}

.toast__text {
  flex: 1;
  min-width: 0;
}

.toast__close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  line-height: 1;
}

.toast__close:hover {
  opacity: 1;
}

.toast--success {
  border-color: var(--brand-200);
  background: var(--brand-50);
  color: var(--brand-800);
}

.toast--danger {
  border-color: #fecaca;
  background: var(--red-50);
  color: var(--red-600);
}

.toast--info {
  border-color: #bfdbfe;
  background: var(--blue-50);
  color: var(--blue-500);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (min-width: 640px) {
  .toast-stack {
    left: auto;
    max-width: 380px;
  }
}

/* --------------------------------------------------------------------------
   11. Telas de autenticação
   -------------------------------------------------------------------------- */

.auth {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.auth__aside {
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-7);
  background: linear-gradient(150deg, var(--brand-700), var(--brand-500));
}

.auth__aside img {
  max-width: 340px;
  width: 100%;
}

.auth__main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-4);
}

.auth__card {
  width: 100%;
  max-width: 400px;
}

.auth__brand {
  margin-bottom: var(--space-6);
  text-align: center;
}

.auth__brand h1 {
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.auth__brand p {
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth__links {
  margin-top: var(--space-4);
  text-align: center;
  font-size: 0.88rem;
}

@media (min-width: 900px) {
  .auth {
    grid-template-columns: 1fr 1fr;
  }

  .auth__aside {
    display: flex;
  }
}

/* --------------------------------------------------------------------------
   12. Formulário público (currículo, primeiro cadastro)
   -------------------------------------------------------------------------- */

.public-page {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-7);
}

.public-page__header {
  margin-bottom: var(--space-5);
  text-align: center;
}

.public-page__header img {
  max-width: 180px;
  margin: 0 auto var(--space-4);
}

.public-page__header p {
  margin-top: var(--space-2);
  color: var(--text-muted);
}

.fieldset {
  padding-top: var(--space-5);
  margin-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.fieldset__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

/* Em tela estreita o título espremia ao lado do botão e quebrava em duas
   linhas; empilhar fica mais legível. */
@media (max-width: 560px) {
  .fieldset__header {
    flex-direction: column;
    align-items: stretch;
  }

  .fieldset__header .btn {
    width: 100%;
  }
}

/* Blocos repetíveis (experiência, formação, cursos) */
.repeat-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.repeat-item {
  position: relative;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--gray-50);
}

.repeat-item__remove {
  margin-top: var(--space-3);
}

.lgpd {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--gray-50);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lgpd p {
  margin-bottom: var(--space-3);
}

.is-hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   13. Visualização de dados (perfil, currículo detalhado)
   -------------------------------------------------------------------------- */

.data-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .data-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .data-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.data-item {
  min-width: 0;
}

.data-item__label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.data-item__value {
  margin-top: 2px;
  color: var(--gray-800);
  word-break: break-word;
}

.data-item__value--empty {
  color: var(--gray-400);
}

.profile-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.profile-head__name {
  min-width: 0;
}

.profile-head__name h2 {
  word-break: break-word;
}

.profile-head__name p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Cartões de pessoa no dashboard */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-4);
}

.person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.person:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.person__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-800);
  word-break: break-word;
}

.person__role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.person--add {
  border-style: dashed;
  color: var(--text-muted);
  justify-content: center;
  min-height: 150px;
}

.person--add:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.person--add .material-icons-sharp {
  font-size: 2rem;
}

/* --------------------------------------------------------------------------
   14. Impressão (currículo)
   -------------------------------------------------------------------------- */

@media print {
  .topbar,
  .sidebar,
  .sidebar__overlay,
  .no-print,
  .form-actions {
    display: none !important;
  }

  .container {
    display: block;
  }

  main,
  .main {
    padding: 0;
  }

  .card {
    border: 0;
    box-shadow: none;
  }

  body {
    background: #fff;
  }
}

/* --------------------------------------------------------------------------
   15. Utilitários
   -------------------------------------------------------------------------- */

.stack     { display: flex; flex-direction: column; gap: var(--space-4); }
.row       { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.row--end  { justify-content: flex-end; }
.text-muted{ color: var(--text-muted); }
.text-sm   { font-size: 0.85rem; }
.mt-0      { margin-top: 0; }
.mt-4      { margin-top: var(--space-4); }
.mb-4      { margin-bottom: var(--space-4); }
.w-full    { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
