/* ==========================================================================
   Portal do Aluno — CME-PMRR
   Identidade visual compartilhada (Ementas, TDM, Desempenho, Notas).
   ========================================================================== */
:root {
    --navy: #0a1b3d;
    --navy-2: #10285a;
    --gold: #d8a72a;
    --gold-soft: #e6bd4f;
    --ink: #1f2a44;
    --muted: #6b7280;
    --line: #e6e8ee;
    --bg: #eef1f6;
    --card: #ffffff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ===== Top nav ===== */
.topbar { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 92px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 56px; width: auto; }
.brand .brand-txt strong { display: block; font-size: 26px; font-weight: 800; letter-spacing: .5px; line-height: 1; }
.brand .brand-txt span { display: block; font-size: 11px; letter-spacing: 2px; color: #c7d0e4; margin-top: 5px; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a { display: flex; align-items: center; gap: 8px; font-size: 15px; color: #d7deee; font-weight: 600; padding: 6px 2px; position: relative; transition: color .2s; }
.nav a i { font-size: 15px; }
.nav a:hover { color: #fff; }
.nav a.active { color: #fff; }
.nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 3px; border-radius: 3px; background: var(--gold); }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }

/* Logged-in user chip */
.user-chip { display: flex; align-items: center; gap: 11px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); padding: 8px 14px 8px 10px; border-radius: 999px; }
.user-chip .avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: var(--navy); font-size: 17px; }
.user-chip .user-info { display: flex; flex-direction: column; line-height: 1.25; }
.user-chip .user-info strong { font-size: 14px; font-weight: 700; color: #fff; }
.user-chip .status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #b8f0c6; font-weight: 600; }
.user-chip .status .dot { width: 8px; height: 8px; border-radius: 50%; background: #35d07f; box-shadow: 0 0 0 3px rgba(53,208,127,.25); }
.user-chip .sair { display: grid; place-items: center; width: 32px; height: 32px; margin-left: 4px; border-radius: 50%; color: #c7d0e4; font-size: 15px; transition: background .16s, color .16s; }
.user-chip .sair:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ===== Hero ===== */
.hero { background: linear-gradient(180deg, var(--navy-2) 0%, var(--navy) 100%); position: relative; overflow: hidden; }
.hero .wrap { display: flex; align-items: center; gap: 20px 30px; flex-wrap: wrap; padding: 16px 20px 26px; position: relative; z-index: 1; }
.hero-main { flex: 1; min-width: 260px; color: #fff; }
.hero-main h1 { font-size: 28px; font-weight: 800; line-height: 1.05; letter-spacing: -.5px; }
.hero-sub { color: var(--gold-soft); font-weight: 700; font-size: 15px; margin-top: 6px; }
.hero-desc { color: #c3cbdd; font-size: 14px; margin-top: 5px; max-width: 640px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; align-self: center; }
.hero-chip { display: inline-flex; align-items: center; gap: 9px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: #fff; font-weight: 700; font-size: 13.5px; padding: 9px 15px; border-radius: 10px; }
.hero-chip i { color: var(--gold); }

/* ===== Section title ===== */
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 2px 2px 16px; }
.page-section { padding-top: 30px; }

/* ===== Stat tiles ===== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: -20px auto 26px; position: relative; z-index: 2; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 12px 30px rgba(15,25,55,.08); display: flex; align-items: center; gap: 16px; }
.stat .stat-ico { width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex: 0 0 50px; }
.stat .stat-val { font-size: 28px; font-weight: 800; color: var(--navy); line-height: 1; }
.stat .stat-lbl { font-size: 12.5px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.stat-ico.navy { background: #e8edf7; color: var(--navy); }
.stat-ico.gold { background: #fbf1d8; color: #b8860b; }
.stat-ico.green { background: #e7f6ee; color: #1f8a52; }
.stat-ico.purple { background: #efeafc; color: #6d3fce; }

/* ===== Generic discipline cards ===== */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding-bottom: 34px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; transition: transform .16s, box-shadow .16s, border-color .16s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(15,25,55,.10); border-color: #d7dbe6; }
.card .top { display: flex; align-items: center; gap: 14px; }
.card .cico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 20px; flex: 0 0 48px; }
.card .info strong { display: block; font-size: 16px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.card .info span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.card p.card-text { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.card .card-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.card .card-total { font-size: 13px; color: var(--muted); }
.card .card-total b { color: var(--navy); font-weight: 800; }

/* ===== Badges / pills ===== */
.badge { font-weight: 700; font-size: 13px; padding: 6px 14px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.badge.green { background: #e7f6ee; color: #1f8a52; }
.badge.red { background: #fdecec; color: #d33a3a; }
.badge.gold { background: #fbf1d8; color: #b8860b; }
.badge.navy { background: #e8edf7; color: var(--navy); }
.badge.purple { background: #efeafc; color: #6d3fce; }

/* ===== Performance bars ===== */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 22px rgba(15,25,55,.06); padding: 8px 4px; }
.perf-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.perf-row:last-child { border-bottom: 0; }
.perf-ico { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 17px; flex: 0 0 42px; }
.perf-body { flex: 1; min-width: 0; }
.perf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.perf-head strong { font-size: 15px; font-weight: 700; color: var(--ink); }
.perf-head .nota { font-size: 15px; font-weight: 800; color: var(--navy); }
.perf-head .nota small { color: var(--muted); font-weight: 600; font-size: 12px; }
.bar-track { height: 9px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }
.perf-sit { flex: 0 0 auto; }

/* ===== Notas table ===== */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 22px rgba(15,25,55,.06); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.notas { width: 100%; border-collapse: collapse; min-width: 720px; }
table.notas thead th { background: #f7f8fb; text-align: center; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; padding: 14px 12px; border-bottom: 1px solid var(--line); }
table.notas thead th.disc-col { text-align: left; }
table.notas tbody td { padding: 14px 12px; text-align: center; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink); }
table.notas tbody tr:last-child td { border-bottom: 0; }
table.notas tbody tr:hover { background: #f9fafc; }
table.notas .disc-cell { display: flex; align-items: center; gap: 12px; text-align: left; }
table.notas .disc-cell .cico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 15px; flex: 0 0 36px; }
table.notas .disc-cell strong { font-weight: 700; font-size: 14.5px; }
table.notas td .max { display: block; font-size: 11px; color: #9aa2b4; font-weight: 600; margin-top: 2px; }
table.notas td.total-cell b { font-size: 16px; font-weight: 800; color: var(--navy); }
table.notas tfoot td { padding: 14px 12px; background: #f7f8fb; font-weight: 700; color: var(--ink); border-top: 2px solid var(--line); }

/* ===== Responsive ===== */
@media (max-width: 980px) {
    .nav { display: none; }
    .nav-toggle { display: block; }
    .hero .wrap { flex-direction: column; }
    .emblem { flex-basis: auto; flex-direction: row; justify-content: flex-start; }
    .emblem::after { display: none; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    .brand .brand-txt span { display: none; }
    .user-chip .user-info { display: none; }
    .user-chip { padding: 6px; }
    .hero-main h1 { font-size: 32px; }
    .stats { grid-template-columns: 1fr; }
    .cards { grid-template-columns: 1fr; }
    .topbar .wrap { height: 74px; }
    .perf-row { flex-wrap: wrap; }
}

/* Botao de voltar do cabecalho, presente em todas as telas da area do aluno. */
.voltar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 9px 16px;
    color: #d7deee;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.voltar-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, .16);
}

@media (max-width: 900px) {
    .voltar-btn span {
        display: none;
    }

    .voltar-btn {
        padding: 9px 12px;
    }
}
