:root {
  /* Tema padrão (dark). Para tema light, veja css/theme-light.css */
  --bg: #0b1220;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.10);
  --border: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.70);

  --primary: #3b82f6;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;

  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% 0%, rgba(59,130,246,.25), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, rgba(16,185,129,.18), transparent 55%),
              var(--bg);
}

.container {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 18, 32, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-content {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
}

.brand {
  font-size: 1.15rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.brand-logo {
  height: 34px;
  width: auto;
  display: block;
  object-fit: contain;
}

.brand-title {
  font-weight: 700;
}

nav {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  align-items: center;
}

.auth-badge {
  font-size: .82rem;
  color: var(--text-secondary);
  padding: .35rem .6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  min-height: 1.6rem;
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  padding: 1.25rem 0 2.5rem;
}

.view { display: none; }
.view.active { display: block; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}

.section-header h2 { margin: 0; font-size: 1.25rem; }

.muted { margin: .25rem 0 0; color: var(--text-secondary); font-size: .9rem; }

.filter-section {
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-wrap: wrap;
}

input, select, textarea {
  width: 100%;
  padding: .7rem .85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
  color: var(--text);
  outline: none;
}

input::placeholder { color: rgba(255,255,255,.55); }

.filter-section input { width: 260px; }
.filter-section select { width: 220px; }

.btn {
  border: 0;
  border-radius: 10px;
  padding: .7rem .9rem;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  gap: .45rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0,0,0,.25);
}

.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: rgba(255,255,255,.10); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn-danger { background: var(--danger); color: white; }

.btn-small {
  padding: .45rem .6rem;
  border-radius: 8px;
  font-size: .9rem;
}

.nav-btn {
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1px solid var(--border);
  padding: .6rem .8rem;
  border-radius: 999px;
  cursor: pointer;
}

.nav-btn.active {
  background: rgba(59,130,246,.20);
  border-color: rgba(59,130,246,.45);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.treinamento-card {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}

.treinamento-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.22);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.card-header h3 {
  margin: 0;
  font-size: 1rem;
}

.card-categoria {
  font-size: .75rem;
  padding: .2rem .5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
}

.card-info { margin-top: .75rem; display: grid; gap: .4rem; }
.card-info-item { display: flex; gap: .5rem; align-items: center; color: var(--text-secondary); }
.card-info-item i { color: rgba(255,255,255,.7); }

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.status-badge {
  font-size: .8rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
}

.status-badge.aberto { border-color: rgba(16,185,129,.6); color: rgba(167, 243, 208, .95); }
.status-badge.em-andamento { border-color: rgba(245,158,11,.7); color: rgba(253, 230, 138, .95); }
.status-badge.encerrado { border-color: rgba(239,68,68,.6); color: rgba(254, 202, 202, .95); }
.status-badge.confirmada { border-color: rgba(16,185,129,.6); color: rgba(167, 243, 208, .95); }
.status-badge.cancelada { border-color: rgba(239,68,68,.6); color: rgba(254, 202, 202, .95); }

.quick-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
  padding: 1rem;
  margin: 0 0 1rem;
}

.quick-panel-header h3 { margin: 0; font-size: 1rem; }

.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

thead th {
  text-align: left;
  font-size: .85rem;
  color: var(--text-secondary);
  padding: .85rem .9rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}

tbody td {
  padding: .85rem .9rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.table-actions { display: flex; gap: .4rem; }

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  padding: 1rem;
}

.modal.active { display: flex; }

.modal-content {
  width: min(720px, 100%);
  background: rgba(11,18,32,.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
  position: relative;
}

.close {
  position: absolute;
  top: .7rem;
  right: .9rem;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
}

.modal-form { display: grid; gap: .85rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; }

.modal-info { display: grid; gap: .75rem; }
.modal-info-item { display: grid; grid-template-columns: 26px 1fr; gap: .75rem; align-items: flex-start; }
.modal-info-item i { margin-top: .1rem; color: rgba(255,255,255,.75); }

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
}

@media (max-width: 980px) {
  .header-content { grid-template-columns: 1fr; }
  .auth-actions { justify-content: flex-start; }
  .cards-grid { grid-template-columns: 1fr; }
  .filter-section input, .filter-section select { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
}
