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

:root {
  --bg: #f7f5f8;
  --surface: #ffffff;
  --surface-2: #efe9f0;
  --ink: #271430;
  --ink-soft: #6b5f71;
  --ink-faint: #9c90a1;
  --line: #e5dee8;

  --primary: #4b215b;
  --primary-dark: #351340;
  --primary-soft: #ece0f0;

  --accent: #8d2391;
  --accent-dark: #6f1c73;
  --accent-soft: #f5e1f6;

  --gold: #b8862f;
  --gold-soft: #f4e9d3;

  --danger: #a3382f;
  --danger-soft: #f5e2df;
  --radius: 10px;

  --sidebar-bg: #4b215b;
}

[data-theme="dark"] {
  --bg: #18131d;
  --surface: #221a29;
  --surface-2: #2c2233;
  --ink: #f0eaf2;
  --ink-soft: #b8abbe;
  --ink-faint: #8b7d92;
  --line: #3a2f42;

  --primary: #9b6ba8;
  --primary-dark: #dcbde3;
  --primary-soft: #3a2a44;

  --accent: #d199d6;
  --accent-dark: #e6bce8;
  --accent-soft: #3d2640;

  --gold: #d9ad5f;
  --gold-soft: #3d3320;

  --danger: #e08579;
  --danger-soft: #422822;
}

[data-theme="dark"] .tag-situacao-encerrado { background: #362d3d; color: #b8abbe; }

* { box-sizing: border-box; }

input[type="checkbox"], input[type="radio"] {
  accent-color: var(--primary);
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  display: inline-block;
  vertical-align: middle;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

input[type="radio"] {
  border-radius: 50%;
}

input[type="checkbox"]:checked, input[type="radio"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

/* Regra global: o atributo hidden sempre vence, não importa qual classe
   esteja aplicada no elemento. Sem isso, qualquer classe que define
   "display" (como .field, .field-row, .actions-menu) sobrescreve o
   comportamento padrão do hidden e o elemento nunca some de verdade. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}

h1, h2, h3, .brand {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.app-shell {
  min-height: 100vh;
}

.main {
  margin-left: 72px;
}

/* Sidebar */
.sidebar {
  background: var(--sidebar-bg);
  color: #f3e9f5;
  padding: 28px 14px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 72px;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 100;
  transition: width 0.18s ease;
}

.sidebar:hover {
  width: 240px;
  padding: 28px 20px;
  box-shadow: 4px 0 24px rgba(0,0,0,0.35);
}

.brand-completo { white-space: nowrap; }

.sidebar:hover .brand-curto { display: none; }
.sidebar .brand-completo { display: none; }
.sidebar:hover .brand-completo { display: block; }

.nav-label {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.sidebar:hover .nav-label {
  opacity: 1;
  max-width: 160px;
}

.botao-tema span,
.mini-perfil span#mini-perfil-nome {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.sidebar:hover .botao-tema span,
.sidebar:hover .mini-perfil span#mini-perfil-nome {
  opacity: 1;
  max-width: 160px;
}

.rodape-sidebar {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mini-perfil-link {
  text-decoration: none;
  display: block;
  border-radius: 8px;
}

.botao-tema {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: none;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 8px 10px;
  color: #ddc4e0;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.sidebar:hover .botao-tema {
  justify-content: flex-start;
  gap: 8px;
}

.botao-tema:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.mini-perfil-link:hover .mini-perfil {
  background: rgba(255,255,255,0.08);
}

.mini-perfil {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 6px 4px;
  border-radius: 8px;
}

.sidebar:hover .mini-perfil {
  justify-content: flex-start;
  gap: 10px;
}

.mini-perfil span#mini-perfil-nome {
  font-size: 13.5px;
  font-weight: 500;
  color: #f3e9f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-pequeno {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  color: #f3e9f5;
}

.avatar-pequeno img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-minha-conta {
  font-size: 13px;
  color: #cbb4cf;
  text-decoration: none;
  padding: 2px 4px;
}

.link-minha-conta:hover {
  color: #f3e9f5;
  text-decoration: underline;
}

.avatar-grande {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 22px;
  font-weight: 700;
}

.avatar-grande img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-sair {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #f3e9f5;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.btn-sair:hover {
  background: rgba(255,255,255,0.16);
}

/* Autocompletar de Pessoa (Usuário) */
.autocomplete-lista {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 180px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(20, 20, 30, 0.10);
  z-index: 30;
}

.autocomplete-item {
  padding: 9px 12px;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--ink);
}

.autocomplete-item:hover,
.autocomplete-item.autocomplete-highlight {
  background: var(--surface-2);
}

.autocomplete-item.empty-hint {
  cursor: default;
  color: var(--ink-faint);
}

.autocomplete-item.empty-hint:hover {
  background: none;
}

.autocomplete-criar {
  color: var(--primary);
  font-weight: 500;
  border-top: 1px solid var(--line);
}

.brand {
  font-size: 17px;
  letter-spacing: 0.2px;
  line-height: 1.3;
}

.brand { text-align: center; }
.sidebar:hover .brand { text-align: left; }

.brand-completo span {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: #c9a8ce;
  margin-top: 2px;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-list a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 9px 12px;
  border-radius: 8px;
  color: #ddc4e0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
}

.sidebar:hover .nav-list a {
  justify-content: flex-start;
  gap: 10px;
}

.nav-icone {
  display: flex;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-list a.active .nav-icone {
  opacity: 1;
}

.nav-list a.active {
  background: rgba(255,255,255,0.14);
  color: #ffffff;
}

.nav-list a.disabled {
  color: #8a6d8e;
  cursor: default;
}

/* Main content */
.main {
  padding: 36px 44px;
  max-width: 1180px;
  min-width: 0;
  overflow-x: auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 22px;
  margin: 0;
}

.page-header p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.btn-ghost:hover { border-color: var(--ink-faint); }

.btn-text {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--ink-soft);
}

.btn-text:hover { background: var(--surface-2); }

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

/* Card / table */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: visible;
}

.card table thead tr:first-child th:first-child {
  border-top-left-radius: var(--radius);
}

.card table thead tr:first-child th:last-child {
  border-top-right-radius: var(--radius);
}

.card table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius);
}

.card table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  font-weight: 600;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.th-ordenavel {
  cursor: pointer;
  user-select: none;
}

.th-ordenavel:hover {
  color: var(--ink);
}

td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  vertical-align: middle;
}

.col-nome { min-width: 190px; }
.col-tipo { min-width: 135px; }
.col-periodo { min-width: 150px; }

.col-tipo, .col-periodo {
  white-space: nowrap;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: var(--surface-2); }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.tag-professor { background: var(--primary-soft); color: var(--primary); }
.tag-aluno { background: var(--accent-soft); color: var(--accent); }
.tag-paciente { background: var(--gold-soft); color: var(--gold); }

.tag-situacao-planejamento { background: var(--surface-2); color: var(--ink-soft); }
.tag-situacao-venda { background: var(--gold-soft); color: var(--gold); }
.tag-situacao-andamento { background: var(--primary-soft); color: var(--primary); }
.tag-situacao-encerrado { background: #e7e2e9; color: #6f6474; }
.tag-situacao-cancelado { background: var(--danger-soft); color: var(--danger); }

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 14px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 28, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-backdrop[hidden] { display: none; }

#modal-cadastro-rapido-pessoa-backdrop {
  z-index: 20;
}

#modal-plano-completo-backdrop,
#modal-cadastro-rapido-pessoa-fin-backdrop,
#modal-nova-pessoa-lancamento-backdrop,
#modal-nova-pessoa-contrato-backdrop {
  z-index: 20;
}

.modal {
  background: var(--surface);
  border-radius: 14px;
  width: 380px;
  padding: 28px;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-wide {
  width: 480px;
}

.modal-xl {
  width: 600px;
}

.modal-2xl {
  width: 760px;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field {
  flex: 1;
  min-width: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
}

.checkbox-label input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.empty-hint {
  color: var(--ink-faint);
}

.section-label-top {
  margin: 20px 0 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin: 20px 0 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.modal h2 {
  font-size: 17px;
  margin: 0 0 18px;
}

.field {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
}

.field input, .field select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
}

.field input[type="checkbox"], .field input[type="radio"] {
  width: 16px;
  height: 16px;
  padding: 0;
}

.campo-moeda {
  position: relative;
  display: block;
  width: 100%;
}

.campo-moeda::before {
  content: "R$";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--ink-soft);
  pointer-events: none;
}

.campo-moeda input {
  padding-left: 34px !important;
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.status-msg {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.status-msg.error { background: var(--danger-soft); color: var(--danger); }
.status-msg.success { background: var(--primary-soft); color: var(--primary); }

.actions-cell {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.checklist {
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 160px;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist .checkbox-label {
  font-size: 13.5px;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.filter-tab {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.filter-tab:hover {
  border-color: var(--ink-faint);
}

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Filter bar (Disciplinas) */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.filter-bar input[type="text"] {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
}

.filter-bar input[type="date"], .filter-bar input[type="month"] {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
}

.filter-bar select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  max-width: 200px;
}

.filter-bar input[type="text"]:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Expand toggle on Disciplinas rows */
.expand-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-faint);
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.expand-toggle:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.row-expandida td {
  background: var(--surface-2);
}

.linha-clicavel {
  cursor: pointer;
}

.linha-clicavel:hover td {
  background: var(--surface-2);
}

.linha-selecionada td {
  background: var(--primary-soft);
}

.expand-seta {
  color: var(--ink-faint);
  font-size: 12px;
}

.parcela-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.parcela-descricao {
  flex: 1;
  font-size: 13.5px;
  color: var(--ink);
}

.parcela-row input[type="date"],
.parcela-row input[type="number"] {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  width: 140px;
}

.parcela-row input:focus {
  outline: none;
  border-color: var(--primary);
}

.parcela-header {
  border-bottom: 1px solid var(--line);
}

.parcela-header .parcela-label {
  width: 140px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}

.parcela-total {
  border-bottom: none;
  border-top: 1px solid var(--line);
  font-weight: 600;
  margin-top: 4px;
  padding-top: 12px;
}

.parcela-total span:nth-child(2) {
  width: 140px;
}

/* Menu de ações (⋯) */
.actions-menu-wrapper {
  position: relative;
  display: inline-block;
}

.actions-menu-btn {
  font-size: 17px;
  line-height: 1;
  padding: 6px 10px;
  letter-spacing: 1px;
}

.actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(20, 20, 30, 0.14);
  min-width: 130px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 4px;
}

.actions-menu[hidden] {
  display: none;
}

.actions-menu button {
  background: none;
  border: none;
  text-align: left;
  padding: 8px 10px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
}

.actions-menu button:hover {
  background: var(--surface-2);
}

.actions-menu button.danger {
  color: var(--danger);
}

.actions-menu button.danger:hover {
  background: var(--danger-soft);
}

/* Configuração de colunas */
.coluna-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.coluna-config-row:last-child {
  border-bottom: none;
}

.coluna-config-setas {
  display: flex;
  gap: 2px;
}

.coluna-config-setas button:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Resumo financeiro (Lançamentos) */
.resumo-toggle {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 8px;
}

.resumo-toggle:hover {
  color: var(--ink);
}

.barra-selecao {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 13.5px;
  color: var(--primary);
}

/* Colunas redimensionáveis (Lançamentos) */
#tabela-lancamentos-elemento {
  table-layout: fixed;
}

.coluna-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  user-select: none;
}

.coluna-resize-handle:hover {
  background: var(--primary-soft);
}

.resumo-financeiro {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.resumo-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.resumo-financeiro-compacto {
  grid-template-columns: repeat(3, 1fr);
}

.resumo-financeiro-compacto .resumo-card {
  padding: 11px 14px;
}

.resumo-financeiro-compacto .resumo-titulo {
  font-size: 11px;
  margin-bottom: 4px;
}

.resumo-financeiro-compacto .resumo-linha {
  font-size: 12px;
  padding: 2px 0;
}

.resumo-titulo {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.resumo-linha {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  padding: 3px 0;
  color: var(--ink-soft);
}

.resumo-linha.resumo-total {
  color: var(--ink);
  font-weight: 600;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 7px;
}

/* Período personalizado */
.periodo-personalizado {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
}

.periodo-personalizado-campo {
  display: flex;
  align-items: center;
  gap: 6px;
}

.periodo-personalizado-campo label {
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 500;
}

.periodo-personalizado-campo input {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
}

.periodo-personalizado-campo input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Painel de filtros avançados (Lançamentos) */
.filtros-avancados {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(20, 20, 30, 0.14);
  min-width: 220px;
  z-index: 6;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filtros-avancados[hidden] {
  display: none;
}

.filtros-avancados .field {
  margin-bottom: 0;
}

.filtros-avancados select {
  width: 100%;
}

.aulas-painel {
  padding: 18px 20px 20px 52px;
  background: var(--surface-2);
}

.aulas-resumo {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.detalhe-lista {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 14px;
  margin-bottom: 4px;
}

.detalhe-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.detalhe-item:last-child {
  border-bottom: none;
}

.aula-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 8px;
  overflow: visible;
}

.aula-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  border-radius: 8px;
}

.aula-card-header:has(+ .aula-card-body) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.aula-card-header:hover {
  background: var(--surface-2);
}

.aula-card-tipo {
  font-size: 13.5px;
  font-weight: 500;
  min-width: 160px;
}

.aula-card-info {
  font-size: 13px;
  color: var(--ink-soft);
  flex: 1;
}

.aula-card-body {
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 13px;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.aula-card-body .linha {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

/* Payment status dot */
.dot-pago {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}

.dot-pago.verde { background: #3b8a4a; }
.dot-pago.vermelho { background: var(--danger); }
.dot-pago.cinza { background: var(--ink-faint); }

.dot-tipo-turma { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot-tipo-turma.roxo { background: #8b5cf6; }
.dot-tipo-turma.azul { background: #3b82f6; }
.dot-tipo-turma.vermelho { background: #ef4444; }
.dot-tipo-turma.laranja { background: #f97316; }
.dot-tipo-turma.cinza { background: var(--ink-faint); }

/* Stats cards (Turmas) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 13px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.stat-card:hover {
  border-color: var(--ink-faint);
}

.stat-card.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.stat-card .stat-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card.active .stat-label {
  color: var(--primary);
}

.stat-card .stat-value {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}

.stat-card .stat-breakdown {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.3;
}

/* Situação column: give it room and keep the tag from wrapping */
.col-situacao {
  min-width: 130px;
}

.tag {
  white-space: nowrap;
}

.paginacao {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 4px;
  flex-wrap: wrap;
}

.paginacao-por-pagina {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

.paginacao-por-pagina select {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  background: var(--surface);
  color: var(--ink);
}

.paginacao-info {
  font-size: 13px;
  color: var(--ink-soft);
}

.paginacao-botoes {
  display: flex;
  gap: 4px;
}

.paginacao-botoes button[disabled] {
  opacity: 0.4;
  cursor: default;
}

.atalho-rapido-tab {
  position: fixed;
  top: 90px;
  left: 72px;
  transform: none;
  width: 20px;
  height: 44px;
  background: var(--sidebar-bg);
  color: #ddc4e0;
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  font-size: 15px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.atalho-rapido-tab:hover {
  opacity: 1;
}

.atalho-rapido-flyout {
  position: fixed;
  top: 90px;
  left: 96px;
  transform: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 4px 4px 20px rgba(0,0,0,0.15);
  padding: 8px;
  z-index: 90;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.atalho-rapido-item {
  text-align: left;
  background: none;
  border: none;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
}

.atalho-rapido-item:hover {
  background: var(--surface-2);
}

.atalho-rapido-vazio {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink-faint);
  margin: 0;
}
