/* Visual novo do painel administrativo: mesmo azul-marinho e dourado da plataforma do aluno.
   Vem DEPOIS de admin.css e painel.css; só sobrescreve aparência (cores, bordas, sombras), não estrutura. */
:root {
  --sidebar-w: 252px;
  --topbar-h: 64px;
  --bg: #060a22;
  --bg-card: #0b1238;
  --bg-elevated: #101a4e;
  --bg-hover: #16226a;
  --border: rgba(110, 130, 230, .22);
  --purple: #f5b800;
  --purple-light: #ffc61a;
  --gold: #ffb020;
  --green: #22c55e;
  --blue: #3b82f6;
  --red: #ef4444;
  --text: #e8edff;
  --text-dim: #94a1cc;
  --text-bright: #ffffff;
  --card-grad: linear-gradient(160deg, rgba(16, 26, 78, .92), rgba(8, 13, 42, .96));
  --ring: 0 0 0 3px rgba(245, 184, 0, .22);
}

body {
  background: radial-gradient(ellipse 80% 40% at 50% 0%, rgba(30, 50, 150, .28), transparent 70%), #060a22;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Menu lateral ---------- */
.sidebar {
  background: linear-gradient(180deg, #08103a 0%, #050818 100%);
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 40px rgba(0, 0, 0, .35);
  scrollbar-width: thin;
}
.sidebar-logo { padding: 22px 18px 16px; border-bottom: 1px solid var(--border); }
.sidebar-logo img { max-width: 150px !important; }
.sidebar-logo .logo-sub { margin-top: 8px; font-size: 10px; letter-spacing: .16em; color: var(--purple-light); font-weight: 700; }
.sidebar-section { padding: 18px 12px 6px 18px; letter-spacing: .14em; font-weight: 800; color: #7684b8; }
.sidebar-item {
  position: relative; margin: 2px 10px; padding: 9px 12px; border-radius: 12px; font-weight: 600;
  color: #aab5dd; border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.sidebar-item .icon {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  font-size: 15px; background: rgba(110, 130, 230, .12); transition: background .15s;
}
.sidebar-item:hover { background: rgba(110, 130, 230, .12); color: #fff; }
.sidebar-item:hover .icon { background: rgba(110, 130, 230, .22); }
.sidebar-item.active {
  color: #ffd45e; font-weight: 800;
  background: linear-gradient(90deg, rgba(245, 184, 0, .22), rgba(245, 184, 0, .05));
  border-color: rgba(245, 184, 0, .5);
  box-shadow: 0 0 18px rgba(245, 168, 0, .12);
}
.sidebar-item.active::before {
  content: ''; position: absolute; left: -11px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #ffd23d, #f5a800);
}
.sidebar-item.active .icon { background: rgba(245, 184, 0, .22); }
.sidebar-item .badge-count { background: linear-gradient(180deg, #f87171, #dc2626); box-shadow: 0 0 10px rgba(239, 68, 68, .45); }
.sidebar-item.sb-sub { border-radius: 10px; }

/* ---------- Topo e conteúdo ---------- */
.topbar {
  background: rgba(6, 10, 34, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .page-title { font-size: 18px; font-weight: 900; color: #fff; letter-spacing: -.01em; }
.topbar .admin-badge {
  background: linear-gradient(180deg, rgba(245, 184, 0, .28), rgba(245, 184, 0, .1)); color: #ffd45e;
  border: 1px solid rgba(245, 184, 0, .5); padding: 5px 14px;
}
.content, .page-content { padding: 28px; }
h1, h2 { color: #fff; letter-spacing: -.01em; }
.page-header h1, .page-title-lg { font-size: 26px; font-weight: 900; }

/* ---------- Cartões de números ---------- */
.kpi-grid { gap: 18px; }
.kpi-card, .cardp {
  background: var(--card-grad); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.kpi-card:hover, .cardp:hover { transform: translateY(-3px); border-color: rgba(245, 184, 0, .5); box-shadow: 0 14px 36px rgba(0, 0, 0, .38), 0 0 22px rgba(245, 168, 0, .1); }
.kpi-card::before, .cardp::before { height: 4px; border-radius: 18px 18px 0 0; box-shadow: 0 0 14px var(--c, currentColor); }
.kpi-card.purple::before { background: linear-gradient(90deg, #ffd23d, #f5a800); }
.kpi-card.blue::before   { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.kpi-card.green::before  { background: linear-gradient(90deg, #4ade80, #16a34a); }
.kpi-card.gold::before   { background: linear-gradient(90deg, #ffc247, #f59e0b); }
.kpi-card.red::before    { background: linear-gradient(90deg, #f87171, #dc2626); }
.kpi-label { color: #9aa8d6; font-weight: 700; letter-spacing: .08em; }
.kpi-value, .cardp .n { font-weight: 900; letter-spacing: -.02em; text-shadow: 0 0 24px rgba(255, 255, 255, .06); }
.kpi-icon { opacity: .22; font-size: 34px; }
.cardp .t { color: #fff; }
.cardp.verde { --c: #22c55e; } .cardp.amarelo { --c: #ffb020; } .cardp.vermelho { --c: #ef4444; } .cardp.azul { --c: #3b82f6; }

/* ---------- Painéis, tabelas ---------- */
.data-card {
  background: var(--card-grad); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.data-card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); background: rgba(110, 130, 230, .05); }
.data-card-title { font-size: 15px; font-weight: 800; color: #fff; }
.data-card-body { padding: 22px; }
.data-table th, .tb th { background: rgba(110, 130, 230, .08); color: #8e9cca; font-weight: 800; letter-spacing: .07em; border-bottom: 1px solid var(--border); }
.data-table td, .tb td { border-bottom: 1px solid rgba(110, 130, 230, .12); }
.data-table tr:hover td, .tb tr:hover td { background: rgba(245, 184, 0, .05); }
.data-table .avatar { background: linear-gradient(135deg, #ffd23d, #f5a800); color: #1a1205; box-shadow: 0 0 0 2px rgba(245, 184, 0, .3); }
.hub a { background: var(--card-grad); border-radius: 16px; transition: transform .15s, border-color .15s; }
.hub a:hover { transform: translateY(-3px); border-color: rgba(245, 184, 0, .55); }

/* ---------- Estados ---------- */
.status, .pill { border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 35%, transparent); }
.status.active, .status.approved, .status.enrolled { background: rgba(34, 197, 94, .14); color: #4ade80; }
.status.risk, .status.rejected { background: rgba(239, 68, 68, .14); color: #f87171; }
.status.pending, .status.assigned { background: rgba(255, 176, 32, .14); color: #ffc247; }
.aviso { border-radius: 14px; }
.risk-item { border-radius: 14px; }

/* ---------- Botões e campos ---------- */
.btn { border-radius: 10px; font-weight: 700; letter-spacing: .01em; }
.btn-primary { background: linear-gradient(180deg, #ffd23d, #f5a800); color: #1a1205; box-shadow: 0 6px 18px rgba(245, 168, 0, .28); }
.btn-success { background: linear-gradient(180deg, #34d399, #16a34a); color: #04140a; }
.btn-danger { background: linear-gradient(180deg, #f87171, #dc2626); }
.btn-ghost { background: rgba(110, 130, 230, .1); border: 1px solid var(--border); color: #dbe4ff; }
.btn:hover { opacity: 1; filter: brightness(1.1); }
.search-input, .filter-select, .ph select, .ph input, .frm input, .frm select, .frm textarea {
  background: rgba(8, 13, 42, .85); border: 1px solid rgba(110, 130, 230, .35); border-radius: 10px; color: #fff;
}
.search-input:focus, .filter-select:focus, .ph select:focus, .ph input:focus, .frm input:focus, .frm select:focus, .frm textarea:focus,
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: #6a79ab; }

/* ---------- Abas ---------- */
.tabs { border-bottom: 1px solid var(--border); }
.tab { font-weight: 700; }
.tab.active { color: var(--purple-light); border-bottom-color: var(--purple); }
.abas { border-bottom: 1px solid var(--border); }
.aba { border-radius: 10px; font-weight: 800; }
.aba.ativa { background: linear-gradient(90deg, rgba(245, 184, 0, .24), rgba(245, 184, 0, .08)); color: #ffd45e; box-shadow: inset 0 0 0 1px rgba(245, 184, 0, .45); }
.ph { background: rgba(6, 10, 34, .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }

/* ---------- Janelas ---------- */
.modal-overlay { background: rgba(2, 4, 20, .72); backdrop-filter: blur(4px); }
.modal, .modal.larga { background: linear-gradient(160deg, #0f1a52, #080d30); border: 1px solid rgba(110, 130, 230, .45); border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.modal-title { font-size: 18px; font-weight: 900; color: #fff; }
.profile-panel { background: linear-gradient(180deg, #0b1238, #060a22); border-left: 1px solid rgba(110, 130, 230, .4); box-shadow: -20px 0 60px rgba(0, 0, 0, .5); }
.panel-header { background: rgba(8, 13, 42, .95); backdrop-filter: blur(8px); }
.admin-toast { background: #101a4e; border: 1px solid var(--border); border-left: 4px solid #22c55e; border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); }
.score-item, .funnel-step, .approval-card { background: rgba(16, 26, 78, .6); border: 1px solid rgba(110, 130, 230, .2); border-radius: 12px; }

/* ---------- Detalhes ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(110, 130, 230, .35); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(245, 184, 0, .55); }
::selection { background: rgba(245, 184, 0, .35); }

/* o conteúdo nunca passa da largura da tela; tabelas largas rolam dentro do cartão */
.main { min-width: 0; max-width: calc(100vw - var(--sidebar-w)); }
.content, .page-content { min-width: 0; }
.data-card { max-width: 100%; }
.data-card-body, .tb-wrap { overflow-x: auto; }
.tb, .data-table { min-width: 0; }
.tb th, .tb td { padding: 9px 10px; }
.topbar { min-width: 0; } .topbar .topbar-right { flex-shrink: 0; }
.ph { max-width: 100%; }
.grade2, .grid-2, .grid-3, .col-60-40, .col-50-50, .cards4, .kpi-grid { min-width: 0; }
.grade2 > *, .grid-2 > *, .grid-3 > *, .col-60-40 > *, .col-50-50 > * { min-width: 0; }

@media (max-width: 900px) {
  .main { max-width: 100vw; }
  .content, .page-content { padding: 16px; }
}

/* ---------- Menu lateral no layout novo: ícone em quadro, título + legenda, seta; item ativo preenchido ---------- */
.sidebar { display: flex; flex-direction: column; padding-bottom: 12px; }
.sidebar-item {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 14px; align-items: center; gap: 12px;
  margin: 3px 12px; padding: 8px 12px 8px 8px; border-radius: 14px;
}
.sidebar-item .icon { width: 40px; height: 40px; border-radius: 12px; font-size: 17px; background: rgba(110, 130, 230, .14); border: 1px solid rgba(110, 130, 230, .22); }
.sb-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sb-tx b { font-size: 15px; font-weight: 700; color: #e8edff; }
.sb-tx small { margin-top: 2px; font-size: 11.5px; font-weight: 500; color: #8e9cca; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-seta { font-style: normal; font-size: 22px; line-height: 1; color: #7684b8; justify-self: end; transition: transform .15s; }
.sb-seta.aberta { transform: rotate(90deg); }
.sidebar-item:hover { background: rgba(110, 130, 230, .12); }
.sidebar-item:hover .sb-seta { color: #fff; }
.sidebar-item.active {
  background: linear-gradient(180deg, #ffd23d, #f5a800); border-color: transparent;
  box-shadow: 0 10px 26px rgba(245, 168, 0, .28); color: #1a1205;
}
.sidebar-item.active::before { display: none; }
.sidebar-item.active .icon { background: rgba(26, 18, 5, .16); border-color: rgba(26, 18, 5, .18); }
.sidebar-item.active .sb-tx b { color: #1a1205; font-weight: 800; }
.sidebar-item.active .sb-tx small { color: rgba(26, 18, 5, .7); }
.sidebar-item.active .sb-seta { color: #1a1205; }
.sidebar-item.sb-sub { display: flex; margin: 1px 12px 1px 30px; padding: 8px 12px; font-size: 13px; border-radius: 10px; color: #aab5dd; }
.sidebar-item.sb-sub:hover { color: #fff; }
.sb-rodape { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid var(--border); }
.sb-user { display: grid; grid-template-columns: 40px minmax(0, 1fr) 36px; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; background: rgba(110, 130, 230, .1); border: 1px solid var(--border); }
.sb-av { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-weight: 900; color: #1a1205; background: linear-gradient(135deg, #ffd23d, #f5a800); }
.sb-un { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; } .sb-un b { font-size: 14px; color: #fff; } .sb-un small { font-size: 11px; color: #8e9cca; }
.sb-sair { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: rgba(6, 10, 34, .6); color: #cfd8f7; font-size: 16px; cursor: pointer; }
.sb-sair:hover { border-color: rgba(245, 184, 0, .6); color: #ffd45e; }

.sb-rodape { display: flex; flex-direction: column; gap: 10px; }
.sb-cta { display: flex; align-items: center; justify-content: center; gap: 10px; height: 48px; border-radius: 14px; font-size: 16px; font-weight: 800; color: #1a1205; background: linear-gradient(180deg, #ffd23d, #f5a800); box-shadow: 0 8px 22px rgba(245, 168, 0, .3); }
.sb-cta span { font-size: 22px; line-height: 1; }
.sb-cta:hover { filter: brightness(1.08); }
.sb-data { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: 12px; font-size: 14px; font-weight: 600; color: #dbe4ff; background: rgba(110, 130, 230, .1); border: 1px solid var(--border); }

.sb-periodo { position: relative; }
.sb-data { width: 100%; cursor: pointer; font-family: inherit; text-align: left; }
.sb-data #sbData { flex: 1; }
.sb-data .sb-seta { font-style: normal; font-size: 18px; color: #7684b8; transition: transform .15s; } .sb-data[aria-expanded="true"] .sb-seta { transform: rotate(180deg); }
.sb-data:hover { border-color: rgba(245, 184, 0, .5); }
.sb-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 300; padding: 14px; border-radius: 16px; background: linear-gradient(160deg, #101a52, #080d30); border: 1px solid rgba(110, 130, 230, .45); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.sb-pop[hidden] { display: none; }
.sb-pop-t { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #8e9cca; margin-bottom: 8px; }
.sb-pop-op { display: block; width: 100%; text-align: left; padding: 9px 12px; margin-bottom: 4px; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 600; color: #dbe4ff; background: transparent; border: 1px solid transparent; cursor: pointer; }
.sb-pop-op:hover { background: rgba(110, 130, 230, .14); } .sb-pop-op.on { color: #ffd45e; background: rgba(245, 184, 0, .12); border-color: rgba(245, 184, 0, .45); }
.sb-pop-dt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .sb-pop-dt label { font-size: 11px; font-weight: 700; color: #9aa8d6; display: grid; gap: 4px; } .sb-pop-dt input { width: 100%; min-width: 0; padding: 8px; font-size: 12px; }
.sb-pop-ok { width: 100%; margin-top: 10px; padding: 10px; border: 0; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 800; color: #1a1205; background: linear-gradient(180deg, #ffd23d, #f5a800); cursor: pointer; }

.sb-data { font-size: 13px; white-space: nowrap; } .sb-data #sbData { overflow: hidden; text-overflow: ellipsis; }
.sb-pop-dt { grid-template-columns: 1fr; }
.sb-user { grid-template-columns: 40px minmax(0, 1fr) auto; }
.sb-sair { width: auto; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }

.sb-user { grid-template-columns: minmax(0, 1fr) 36px 36px; gap: 6px; }
.sb-perfil { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; border-radius: 12px; padding: 2px; }
.sb-perfil:hover .sb-un b { color: #ffd45e; }

.sb-bt { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: #cfd8f7; cursor: pointer; padding: 0; }
.sb-bt:hover { border-color: rgba(245, 184, 0, .6); color: #ffd45e; }
.sb-bt svg { width: 16px; height: 16px; }

/* ---------- Tema claro (botão do sol no menu) ---------- */
html[data-tema="claro"] {
  --bg: #f1f4fb; --bg-card: #ffffff; --bg-elevated: #eaeffa; --bg-hover: #e1e8f8;
  --border: rgba(30, 50, 120, .16); --text: #14204a; --text-dim: #5a6694; --text-bright: #0b1330;
  --purple: #e09a00; --purple-light: #b87400; --gold: #c2790a; --green: #15803d; --red: #dc2626;
  --card-grad: linear-gradient(160deg, #ffffff, #f6f8fe);
}
html[data-tema="claro"] body { background: radial-gradient(ellipse 80% 40% at 50% 0%, rgba(80, 110, 230, .12), transparent 70%), #f1f4fb; color: #14204a; }
html[data-tema="claro"] h1, html[data-tema="claro"] h2, html[data-tema="claro"] .topbar .page-title, html[data-tema="claro"] .data-card-title, html[data-tema="claro"] .kpi-value, html[data-tema="claro"] .cardp .t, html[data-tema="claro"] .modal-title { color: #0b1330; }
html[data-tema="claro"] .sidebar { background: linear-gradient(180deg, #ffffff, #f4f6fc); box-shadow: 8px 0 30px rgba(20, 30, 80, .08); }
html[data-tema="claro"] .sidebar-logo img { filter: invert(1) hue-rotate(180deg) brightness(.35); }
html[data-tema="claro"] .sb-tx b { color: #14204a; } html[data-tema="claro"] .sb-tx small { color: #6b76a0; }
html[data-tema="claro"] .sidebar-item .icon { background: #eef1fa; border-color: rgba(30, 50, 120, .12); }
html[data-tema="claro"] .sidebar-item:hover { background: #eef2fc; }
html[data-tema="claro"] .sidebar-item.sb-sub { color: #4a5688; } html[data-tema="claro"] .sidebar-item.sb-sub:hover { color: #0b1330; }
html[data-tema="claro"] .sidebar-section { color: #8590b8; }
html[data-tema="claro"] .sb-seta { color: #8590b8; }
html[data-tema="claro"] .sb-data, html[data-tema="claro"] .sb-user { background: #f3f6fd; color: #14204a; }
html[data-tema="claro"] .sb-un b { color: #14204a; } html[data-tema="claro"] .sb-un small { color: #6b76a0; }
html[data-tema="claro"] .sb-bt, html[data-tema="claro"] .sb-sair { background: #fff; color: #4a5688; }
html[data-tema="claro"] .sb-pop { background: #ffffff; box-shadow: 0 20px 50px rgba(20, 30, 80, .2); } html[data-tema="claro"] .sb-pop-op { color: #14204a; } html[data-tema="claro"] .sb-pop-t { color: #6b76a0; }
html[data-tema="claro"] .topbar, html[data-tema="claro"] .ph { background: rgba(255, 255, 255, .88); }
html[data-tema="claro"] .kpi-card, html[data-tema="claro"] .cardp, html[data-tema="claro"] .data-card, html[data-tema="claro"] .hub a { box-shadow: 0 8px 24px rgba(20, 30, 80, .08); }
html[data-tema="claro"] .kpi-label { color: #5a6694; }
html[data-tema="claro"] .data-card-header { background: #f3f6fd; }
html[data-tema="claro"] .data-table th, html[data-tema="claro"] .tb th { background: #f0f3fb; color: #5a6694; }
html[data-tema="claro"] .data-table td, html[data-tema="claro"] .tb td { color: #14204a; border-bottom-color: rgba(30, 50, 120, .1); }
html[data-tema="claro"] .data-table tr:hover td, html[data-tema="claro"] .tb tr:hover td { background: #fff7e6; }
html[data-tema="claro"] .search-input, html[data-tema="claro"] .filter-select, html[data-tema="claro"] .ph select, html[data-tema="claro"] .ph input, html[data-tema="claro"] .frm input, html[data-tema="claro"] .frm select, html[data-tema="claro"] .frm textarea, html[data-tema="claro"] input, html[data-tema="claro"] select, html[data-tema="claro"] textarea { background: #fff; color: #14204a; border-color: rgba(30, 50, 120, .25); }
html[data-tema="claro"] .btn-ghost { background: #eef2fc; color: #14204a; }
html[data-tema="claro"] .modal, html[data-tema="claro"] .modal.larga { background: #ffffff; }
html[data-tema="claro"] .profile-panel, html[data-tema="claro"] .panel-header { background: #ffffff; }
html[data-tema="claro"] .score-item, html[data-tema="claro"] .funnel-step, html[data-tema="claro"] .approval-card { background: #f3f6fd; border-color: rgba(30, 50, 120, .14); }
html[data-tema="claro"] .tab, html[data-tema="claro"] .aba { color: #5a6694; } html[data-tema="claro"] .tab.active { color: #b87400; } html[data-tema="claro"] .aba.ativa { color: #8a5a00; }
