/* Tema da plataforma. As cores --brand, --accent e --gold são definidas pelo administrador. */
:root { --brand: 11 61 46; --accent: 22 163 74; --gold: 212 175 55; --bg: #f8fafc; --text: #1e293b; --muted: #64748b; --border: #e2e8f0; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: rgb(var(--accent)); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0; color: #0f172a; } h2 { font-size: 16px; margin: 0; color: #0f172a; } h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); margin: 4px 0 0; } .small { font-size: 12px; } .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; }
.icon { width: 16px; height: 16px; flex-shrink: 0; } .icon-lg { width: 22px; height: 22px; }

/* Layout do painel */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 256px; background: rgb(var(--brand)); color: #fff; display: flex; flex-direction: column; z-index: 30; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 20px; }
.brand-logo { width: 34px; height: 34px; border-radius: 8px; background: rgb(var(--gold)); color: rgb(var(--brand)); display: flex; align-items: center; justify-content: center; font-weight: 800; overflow: hidden; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff0; }
.brand-name { font-weight: 700; } .brand-area { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: rgb(var(--gold)); }
.nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; color: rgba(236, 253, 245, .8); margin-bottom: 2px; }
.nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.nav a.active { background: rgb(var(--accent)); color: #fff; font-weight: 600; }
.nav-group { font-size: 10px; letter-spacing: .1em; font-weight: 700; color: rgb(var(--gold)); padding: 14px 12px 4px; opacity: .9; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a { padding: 8px 14px; border-radius: 8px 8px 0 0; color: var(--muted); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; }
.tabs a:hover { text-decoration: none; color: var(--text); } .tabs a.active { color: rgb(var(--brand)); border-bottom-color: rgb(var(--accent)); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; margin: 0; } .kv dt { color: var(--muted); font-size: 13px; } .kv dd { margin: 0; word-break: break-word; }
@media (max-width: 700px) { .kv { grid-template-columns: 1fr; } }
.nav .count { margin-left: auto; background: rgb(var(--gold)); color: #0f172a; border-radius: 999px; font-size: 10px; font-weight: 700; padding: 0 6px; }
.side-footer { border-top: 1px solid rgba(255, 255, 255, .1); padding: 16px; font-size: 13px; }
.side-footer .email { color: rgba(236, 253, 245, .6); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.side-footer button { margin-top: 10px; background: none; border: 0; color: rgba(236, 253, 245, .8); display: flex; gap: 8px; align-items: center; cursor: pointer; padding: 6px 0; font: inherit; }
.main { margin-left: 256px; min-height: 100vh; }
.container { max-width: 1240px; margin: 0 auto; padding: 32px; }
.topbar { display: none; }
.overlay { display: none; }
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; width: 280px; max-width: 85%; }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .overlay { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 25; }
  .main { margin-left: 0; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; background: rgb(var(--brand)); color: #fff; padding: 12px 16px; align-items: center; justify-content: space-between; }
  .topbar button { background: none; border: 0; color: #fff; cursor: pointer; padding: 4px; }
  .container { padding: 16px; }
}
.maintenance-bar { background: #f59e0b; color: #fff; text-align: center; padding: 8px; font-weight: 600; }

/* Componentes */
.page-header { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.card-body { padding: 20px; } .card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid #f1f5f9; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }
.mt { margin-top: 24px; } .mb { margin-bottom: 24px; } .stack > * + * { margin-top: 16px; }
.stat { display: flex; gap: 14px; padding: 18px; align-items: flex-start; }
.stat-icon { border-radius: 10px; padding: 10px; display: flex; } .stat-label { font-size: 12px; color: var(--muted); margin: 0; } .stat-value { font-size: 20px; font-weight: 700; margin: 2px 0 0; color: #0f172a; } .stat-hint { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.tone-green { background: #ecfdf5; color: #047857; } .tone-gold { background: #fffbeb; color: #b45309; } .tone-blue { background: #f0f9ff; color: #0369a1; } .tone-red { background: #fef2f2; color: #dc2626; }
.badge { display: inline-block; white-space: nowrap; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 500; border: 1px solid; }
.badge-green { background: #ecfdf5; color: #047857; border-color: #a7f3d0; } .badge-yellow { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge-red { background: #fef2f2; color: #b91c1c; border-color: #fecaca; } .badge-gray { background: #f1f5f9; color: #475569; border-color: #e2e8f0; } .badge-blue { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.alert { border: 1px solid; border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; }
.alert-yellow { background: #fffbeb; border-color: #fde68a; color: #92400e; } .alert-red { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-green { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; } .alert-blue { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
.empty { text-align: center; border: 1px dashed #cbd5e1; border-radius: 12px; padding: 40px 20px; background: #fff; } .empty-title { font-weight: 600; margin: 0; }

/* Botões e formulários */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; padding: 9px 16px; font-weight: 600; font-size: 14px; border: 1px solid transparent; cursor: pointer; text-decoration: none !important; font-family: inherit; line-height: 1.2; }
.btn-primary { background: rgb(var(--accent)); color: #fff; } .btn-primary:hover { filter: brightness(.95); }
.btn-dark { background: rgb(var(--brand)); color: #fff; } .btn-gold { background: rgb(var(--gold)); color: #0f172a; }
.btn-outline { background: #fff; border-color: #cbd5e1; color: #334155; } .btn-outline:hover { background: #f8fafc; }
.btn-danger { background: #dc2626; color: #fff; } .btn-sm { padding: 5px 10px; font-size: 12px; } .btn-block { width: 100%; }
.btn.disabled { opacity: .5; pointer-events: none; } .btn-icon { background: none; border: 0; padding: 4px; border-radius: 6px; color: var(--muted); cursor: pointer; } .btn-icon:hover { background: #f1f5f9; }
.inline-form { display: inline; }
label.lbl { display: block; font-weight: 600; font-size: 13px; margin: 0 0 4px; color: #334155; }
.input, select.input, textarea.input { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 12px; font: inherit; background: #fff; color: var(--text); }
.input:focus { outline: 2px solid rgba(22, 163, 74, .25); border-color: rgb(var(--accent)); }
.input:disabled { background: #f1f5f9; }
.field { margin-bottom: 14px; } .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 6px 0; } .check input { margin-top: 3px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; } .filters .input { width: auto; min-width: 150px; } .filters .grow { flex: 1; min-width: 200px; }
.choice { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; }
.choice:has(input:checked) { border-color: rgb(var(--accent)); background: #ecfdf5; }

/* Tabelas */
.table-wrap { overflow-x: auto; margin: 0 -20px; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; white-space: nowrap; background: #f8fafc; border-bottom: 1px solid var(--border); padding: 9px 20px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table th a { color: inherit; } .table td { border-bottom: 1px solid #f1f5f9; padding: 11px 20px; vertical-align: middle; }
.table .sub { font-size: 12px; color: #94a3b8; } .nowrap { white-space: nowrap; } .right { text-align: right; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; color: var(--muted); font-size: 13px; gap: 8px; flex-wrap: wrap; }

/* Gráfico e progresso */
.chart { width: 100%; height: auto; } .chart-empty { height: 200px; display: flex; align-items: center; justify-content: center; color: #94a3b8; }
.bar { height: 8px; background: #f1f5f9; border-radius: 999px; overflow: hidden; } .bar > span { display: block; height: 100%; background: rgb(var(--accent)); }
.list { list-style: none; margin: 0; padding: 0; } .list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; } .list li:last-child { border: 0; }

/* Autenticação */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-side { background: rgb(var(--brand)); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; background-size: cover; background-position: center; }
.auth-side .big { font-size: 30px; font-weight: 800; } .auth-side p { color: rgba(236, 253, 245, .85); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 24px; background: #fff; } .auth-form > div { width: 100%; max-width: 380px; }
.auth-mobile-brand { display: none; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; font-weight: 800; font-size: 20px; color: rgb(var(--brand)); } }

/* Página pública / checkout */
.public { min-height: 100vh; background: #f1f5f9; padding: 32px 16px; } .public-inner { max-width: 1040px; margin: 0 auto; }
.checkout { display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px; } @media (max-width: 900px) { .checkout { grid-template-columns: 1fr; } }
.cover { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; background: rgba(11, 61, 46, .08); flex-shrink: 0; }
.price { font-size: 22px; font-weight: 800; } .strike { text-decoration: line-through; color: #94a3b8; font-size: 13px; }
.center-card { max-width: 520px; margin: 10vh auto; text-align: center; padding: 32px; }

/* Cursos */
.course { display: grid; grid-template-columns: 320px 1fr; gap: 24px; } @media (max-width: 1100px) { .course { grid-template-columns: 1fr; } .course aside { order: 2; } }
.lesson-link { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; color: #475569; font-size: 14px; }
.lesson-link.active { background: #ecfdf5; color: rgb(var(--brand)); font-weight: 600; } .lesson-link.locked { color: #94a3b8; }
.player { aspect-ratio: 16 / 9; width: 100%; background: #000; border: 0; display: block; }
.product-card { overflow: hidden; display: flex; flex-direction: column; } .product-card img, .product-card .ph { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }
.product-card .ph { background: linear-gradient(135deg, rgb(var(--brand)), rgb(var(--accent))); color: rgba(255, 255, 255, .8); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; }
.product-card .card-body { flex: 1; display: flex; flex-direction: column; } .product-card .card-body .push { margin-top: auto; padding-top: 14px; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; } .steps span { background: #f1f5f9; border-radius: 999px; padding: 4px 12px; font-size: 12px; color: var(--muted); }

/* Diálogo de confirmação */
dialog.confirm { border: 0; border-radius: 12px; padding: 24px; max-width: 440px; width: calc(100% - 32px); box-shadow: 0 20px 40px rgba(0, 0, 0, .2); }
dialog.confirm::backdrop { background: rgba(0, 0, 0, .4); }
.toast { position: fixed; top: 16px; right: 16px; z-index: 60; max-width: 380px; display: flex; flex-direction: column; gap: 8px; }
.toast div { padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 20px rgba(0, 0, 0, .12); font-weight: 500; }
.toast .ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; } .toast .error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.toast .info { background: #f0f9ff; color: #075985; border: 1px solid #bae6fd; }

/* Navegação pelo menu: indicador de carregamento sem deslocar o layout */
body.is-loading .main { opacity: .55; transition: opacity .15s; pointer-events: none; }
body.is-loading::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 80; background: linear-gradient(90deg, rgb(var(--accent)), rgb(var(--gold))); animation: loadbar 1s linear infinite; transform-origin: left; }
@keyframes loadbar { from { transform: scaleX(.1); } to { transform: scaleX(1); } }
.main h1:focus { outline: none; }
.sidebar { overscroll-behavior: contain; } .nav { overscroll-behavior: contain; }
details > summary { list-style: none; } details > summary::-webkit-details-marker { display: none; }
details.card > summary h2::before { content: "▸ "; } details.card[open] > summary h2::before { content: "▾ "; }

/* Menu em duas colunas: menus principais (trilho) e submenus ao lado, ambos na lateral esquerda */
.sidebar { width: 292px; }
.main { margin-left: 292px; }
.nav.nav2 { display: flex; padding: 0; overflow: hidden; min-height: 0; }
.nav2 .rail { width: 84px; flex-shrink: 0; overflow-y: auto; padding: 8px 6px; background: rgba(0, 0, 0, .14); display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
.nav2 .rail-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; color: rgba(236, 253, 245, .75); padding: 9px 4px; border-radius: 10px; cursor: pointer; font: inherit; font-size: 10.5px; line-height: 1.15; text-align: center; }
.nav2 .rail-btn .icon { width: 20px; height: 20px; }
.nav2 .rail-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav2 .rail-btn.current { color: rgb(var(--gold)); }
.nav2 .rail-btn.open { background: rgba(255, 255, 255, .14); color: #fff; }
.nav2 .rail-btn .dot { position: absolute; top: 4px; right: 6px; font-style: normal; background: rgb(var(--gold)); color: #0f172a; border-radius: 999px; font-size: 9px; font-weight: 700; padding: 0 4px; }
.nav2 .subs { flex: 1; min-width: 0; overflow-y: auto; padding: 8px 8px 16px; overscroll-behavior: contain; }
.nav2 .sub-title { font-size: 10px; letter-spacing: .1em; font-weight: 700; color: rgb(var(--gold)); padding: 8px 10px 6px; }
.nav2 .sub a { padding: 8px 10px; gap: 10px; font-size: 13.5px; }
@media (max-width: 1023px) { .sidebar { width: 300px; max-width: 92%; } .main { margin-left: 0; } }
