:root {
  --bg: #0b0b0d;
  --bg-soft: #121217;
  --surface: #17171f;
  --surface-2: #1d1d27;
  --border: #2a2a38;
  --text: #f4f4f7;
  --muted: #a4a4b5;
  --danger: #d3202f;
  --danger-soft: #ff3b4f;
  --gold: #d4af37;
  --gold-soft: #ffcf54;
  --green: #1fbf75;
  --blue: #2f8cff;
  --orange: #ff9a35;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 270px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top right, #2a0c12 0%, var(--bg) 45%);
  color: var(--text);
  font-family: "Barlow", sans-serif;
  overflow-x: hidden;
}
h1, h2, h3, h4, .title-font {
  margin: 0;
  font-family: "Bebas Neue", cursive;
  letter-spacing: 0.08rem;
  font-weight: 400;
}
button, input, select, textarea { font-family: "Barlow", sans-serif; }
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  border-right: 1px solid var(--border);
  background: linear-gradient(160deg, #121219 0%, #0a0a0f 100%);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(120deg, #1c1b24, #101016);
}
.brand-badge {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, var(--danger), #751421, var(--gold));
  display: grid;
  place-items: center;
  font-family: "Bebas Neue", cursive;
  font-size: 1.2rem;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08);
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.brand h1 { font-size: 1.55rem; }
.brand small { color: var(--muted); font-size: 0.8rem; }
.nav {
  display: grid;
  gap: 8px;
  overflow: auto;
}
.nav button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 500;
  transition: 0.2s ease;
}
.nav button:hover {
  background: #1b1b24;
  border-color: #2f2f40;
}
.nav button.active {
  background: linear-gradient(120deg, #2b1116, #1c1a14);
  border-color: #4b3132;
  box-shadow: inset 0 0 0 1px #654640;
}
.sidebar-footer {
  margin-top: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #12121a;
  color: var(--muted);
  font-size: 0.84rem;
}
.content {
  margin-left: var(--sidebar-w);
  padding: clamp(14px, 2vw, 24px);
  width: calc(100vw - var(--sidebar-w));
}
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: #111119;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  align-items: center;
  gap: 10px;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9;
}
.sidebar-backdrop.show { display: block; }
.user-menu-wrap {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 31;
}
.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.user-mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #26263a;
  border: 1px solid #3f3f56;
  display: inline-grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
}
.user-dropdown {
  display: none;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #12121d;
  padding: 8px;
  min-width: 190px;
  box-shadow: var(--shadow);
}
.user-dropdown.show {
  display: grid;
  gap: 6px;
}
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: radial-gradient(circle at top, #2c0f16 0%, #09090d 55%);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.auth-overlay.show { display: flex; }
.auth-card {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  background: #11111a;
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.auth-card h2 { font-size: 2rem; margin-bottom: 6px; }
.section {
  display: none;
  animation: fade 0.22s ease;
}
.section.active { display: block; }
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.section-header h2 { font-size: 2.2rem; }
.section-subtitle { color: var(--muted); margin-top: 4px; }
.btn {
  border: 1px solid transparent;
  background: #242432;
  color: var(--text);
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s ease;
  font-weight: 600;
}
.btn:hover { filter: brightness(1.08); }
.btn-primary {
  background: linear-gradient(120deg, var(--danger), #991b2a);
  border-color: #9f2735;
}
.btn-gold {
  background: linear-gradient(120deg, #7e651d, var(--gold));
  color: #191309;
  border-color: #ab8630;
}
.btn-outline {
  background: transparent;
  border-color: #3b3b50;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.card {
  background: linear-gradient(130deg, #181821, #13131a);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(10px, 1.8vw, 14px);
  box-shadow: var(--shadow);
}
.kpi-label { color: var(--muted); font-size: 0.86rem; }
.kpi-value {
  font-size: 1.75rem;
  margin-top: 4px;
  font-weight: 700;
}
.kpi-trend {
  color: var(--gold-soft);
  font-size: 0.82rem;
  margin-top: 6px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 8px;
}
.list li {
  padding: 10px;
  border: 1px solid #303042;
  border-radius: 10px;
  background: #171722;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 0.94rem;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #13131b;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
th, td {
  text-align: left;
  padding: 11px;
  border-bottom: 1px solid #2a2a37;
  font-size: 0.92rem;
  vertical-align: middle;
}
th {
  color: var(--gold-soft);
  font-weight: 600;
  background: #171722;
  position: sticky;
  top: 0;
  z-index: 1;
}
.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-ativo, .status-pago { background: #123725; color: #8df5be; }
.status-inativo { background: #2f2f3f; color: #bbb; }
.status-inadimplente, .status-vencido { background: #40161c; color: #ff7c8e; }
.status-pendente { background: #3f2e11; color: #f7c96f; }
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.input, select, textarea {
  width: 100%;
  border: 1px solid #333347;
  background: #111119;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  outline: none;
}
.input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.12);
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(120deg, #2f2f40, #171724);
  border: 1px solid #3f3f53;
  font-size: 0.82rem;
  font-weight: 700;
  margin-right: 8px;
}
.name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-wrap {
  min-height: 260px;
  display: grid;
  place-items: center;
}
.bar-chart {
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  gap: 12px;
  min-height: 220px;
  padding: 10px 4px 0;
}
.bar-item {
  text-align: center;
  flex: 1;
}
.bar {
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--gold), #715818);
  border: 1px solid #a8822d;
  transition: 0.25s ease;
}
.bar-item:nth-child(odd) .bar {
  background: linear-gradient(180deg, #e53949, #6f1420);
  border-color: #a22734;
}
.bar-label { margin-top: 6px; color: var(--muted); font-size: 0.85rem; }
.weekly-grid {
  display: grid;
  grid-template-columns: 90px repeat(6, 1fr);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  min-height: 420px;
  background: #111119;
}
.weekly-grid > div {
  border-right: 1px solid #2a2a37;
  border-bottom: 1px solid #2a2a37;
  padding: 8px;
  min-width: 150px;
}
.weekly-header {
  background: #171723;
  position: sticky;
  top: 0;
  z-index: 2;
  font-weight: 700;
  color: var(--gold-soft);
}
.time-cell {
  background: #15151f;
  font-weight: 600;
  color: var(--muted);
  min-width: 90px !important;
  position: sticky;
  left: 0;
  z-index: 2;
}
.class-tag {
  display: block;
  padding: 6px;
  border-radius: 8px;
  margin-bottom: 6px;
  border: 1px solid #38384d;
  background: #1b1b28;
  font-size: 0.82rem;
}
.class-tag strong { display: block; color: var(--gold-soft); }
.calendar {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #101017;
}
.calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: #171722;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #2a2a37;
}
.day-name, .day-cell {
  background: #11111a;
  min-height: 96px;
  padding: 8px;
}
.day-name {
  min-height: auto;
  font-weight: 700;
  color: var(--gold-soft);
  text-align: center;
  font-size: 0.86rem;
}
.day-cell {
  cursor: pointer;
  transition: 0.15s;
}
.day-cell:hover { background: #171726; }
.day-num { font-weight: 700; margin-bottom: 4px; }
.event-dot {
  display: block;
  border-radius: 8px;
  padding: 2px 6px;
  margin-bottom: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid transparent;
}
.event-aula { background: #133463; color: #98c4ff; border-color: #2f73d1; }
.event-marketing { background: #4e3b12; color: #ffd77a; border-color: #b98d33; }
.event-competicao { background: #501824; color: #ff9aaa; border-color: #a62e43; }
.event-academia { background: #113b28; color: #96f4c6; border-color: #2f9d70; }
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.kanban-col {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #12121b;
  min-height: 280px;
  padding: 10px;
  transition: 0.18s ease;
}
.kanban-col.drag-over {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.45);
  background: #171722;
}
.kanban-col h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--gold-soft);
}
.kanban-card {
  border: 1px solid #333348;
  border-radius: 10px;
  background: #1a1a28;
  padding: 8px;
  margin-bottom: 8px;
  cursor: grab;
}
.kanban-card:active {
  cursor: grabbing;
}
.kanban-card.dragging {
  opacity: 0.45;
  transform: scale(0.99);
}
.kanban-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.btn-mini {
  border: 1px solid #3c3c52;
  background: #202031;
  color: var(--text);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
}
.btn-mini:hover { filter: brightness(1.08); }
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.kanban-meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 6px;
}
.two-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 18px;
  z-index: 99;
}
.modal-backdrop.show { display: flex; }
.modal {
  width: min(930px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 14px;
  background: #101018;
  border: 1px solid #353549;
  box-shadow: var(--shadow);
}
.modal .table-wrap table { min-width: 560px; }
.profile-modal .table-wrap table { min-width: 100%; }
.profile-modal .grid-2 { grid-template-columns: 1fr 1fr; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #2d2d3f;
  position: sticky;
  top: 0;
  background: #151522;
  z-index: 1;
}
.modal-body { padding: 14px; }
.modal-footer {
  border-top: 1px solid #2d2d3f;
  padding: 12px 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.form-grid .full { grid-column: 1 / -1; }
label { font-size: 0.84rem; color: var(--muted); display: block; margin-bottom: 4px; }
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.small-muted { color: var(--muted); font-size: 0.83rem; }
.logo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-preview {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 1px solid #3b3b50;
  object-fit: cover;
  background: #0f0f16;
  display: none;
}
.logo-preview.show { display: block; }

.toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 24px));
}
.toast {
  border: 1px solid #3b3b50;
  background: #151521;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  animation: toastIn 0.18s ease;
}
.toast.success { border-color: #1e6a46; background: #13281f; }
.toast.error { border-color: #8b2a39; background: #2b151a; }
.toast.info { border-color: #2b4f8c; background: #162238; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 1280px) {
  :root { --sidebar-w: 240px; }
  .section-header h2 { font-size: 2rem; }
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .two-cols { grid-template-columns: 1fr; }
  table { min-width: 700px; }
}
@media (max-width: 1150px) {
  .grid-2, .config-grid { grid-template-columns: 1fr; }
  .weekly-grid { font-size: 0.84rem; }
}
@media (max-width: 1024px) {
  :root { --sidebar-w: 280px; }
  .mobile-topbar { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow);
  }
  .content {
    margin-left: 0;
    width: 100%;
    padding: 72px 14px 16px;
  }
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .filters, .toolbar { flex-wrap: wrap; }
  .modal {
    width: min(96vw, 930px);
    max-height: 94vh;
  }
  .user-menu-wrap {
    top: 10px;
    right: 10px;
  }
}
@media (max-width: 900px) {
  .section-header h2 { font-size: 1.9rem; }
  .section-subtitle { font-size: 0.92rem; }
  .filters, .toolbar { flex-direction: column; }
  .filters > *, .toolbar > * { max-width: 100% !important; width: 100%; }
  .cards { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .weekly-grid {
    border-radius: 10px;
    min-height: 360px;
  }
  .calendar-head h3 {
    font-size: 1rem;
    text-align: center;
    flex: 1;
  }
  .btn {
    min-height: 40px;
    padding: 10px 12px;
  }
  th, td { padding: 9px; }
  table { min-width: 640px; }
  .modal {
    width: 100%;
    max-height: 95vh;
  }
  .profile-modal .grid-2 { grid-template-columns: 1fr; }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .user-menu-wrap { display: none; }
}
@media (max-width: 640px) {
  .mobile-topbar { padding: 8px 10px; }
  .mobile-topbar strong { font-size: 0.95rem; }
  .content { padding: 64px 8px 12px; }
  .card { padding: 10px; border-radius: 10px; }
  .section-header { margin-bottom: 10px; }
  .section-header h2 { font-size: 1.55rem; }
  .kpi-value { font-size: 1.5rem; }
  .weekly-grid > div { min-width: 120px; padding: 6px; }
  .day-name, .day-cell { min-height: 78px; padding: 6px; }
  .event-dot { font-size: 0.7rem; }
  .toast-container {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }
}
@media (max-width: 420px) {
  .brand h1 { font-size: 1.35rem; }
  .section-header h2 { font-size: 1.42rem; }
  .btn { font-size: 0.88rem; }
  .kpi-value { font-size: 1.35rem; }
  th, td { font-size: 0.84rem; }
  .modal-header h3 { font-size: 1.15rem; }
  .sidebar { width: min(88vw, 300px); }
}
