/* =========================================================
   FluentWorks - Portal do Aluno
   Design tokens - Versao Dark (azul moderno + marrom da marca)
   ---------------------------------------------------------
   Fundo geral (dash) .. #0B1626  (navy bem escuro)
   Superficie (cards) .. #101F35  (navy elevado)
   Superficie 2 ........ #16283F  (hover / elevado 2)
   Azul marca .......... #1E3A5F  (base, gradientes)
   Azul vivo ........... #2E7BD6  (acao primaria, glow)
   Marrom marca ........ #B5763E  (destaque / logo)
   Marrom escuro ....... #8B5E3C  (gradiente marrom)
   Texto claro ......... #EAF0F7
   Texto suave ......... #90A4C0
   Sucesso ............. #3ECF8E
   Erro ................ #FF6B6B
   Tipografia: Poppins (titulos/marca) + Inter (texto)
   ========================================================= */

:root {
    --marrom: #B5763E;
    --marrom-escuro: #8B5E3C;
    --marrom-tint: rgba(181, 118, 62, 0.16);
    --azul: #1E3A5F;
    --azul-vivo: #2E7BD6;
    --azul-vivo-escuro: #1F5FAE;
    --azul-tint: rgba(46, 123, 214, 0.14);
    --azul-glow: 0 0 0 1px rgba(46, 123, 214, 0.35), 0 8px 26px rgba(46, 123, 214, 0.30);
    --fundo: #0A1524;
    --fundo-2: #071019;
    --superficie: #101F35;
    --superficie-2: #16283F;
    --branco: #FFFFFF;
    --texto: #EAF0F7;
    --texto-suave: #8FA3BF;
    --borda: rgba(255, 255, 255, 0.08);
    --borda-forte: rgba(255, 255, 255, 0.14);
    --sucesso: #3ECF8E;
    --sucesso-bg: rgba(62, 207, 142, 0.14);
    --erro: #FF6B6B;
    --erro-bg: rgba(255, 107, 107, 0.14);
    --sombra: 0 10px 30px rgba(0, 0, 0, 0.35);
    --sombra-hover: 0 18px 44px rgba(0, 0, 0, 0.45);
    --raio: 16px;
    --raio-sm: 10px;
    --sidebar-w: 264px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--fundo);
    color: var(--texto);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-name {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 600;
    color: var(--texto);
    margin: 0 0 8px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

:focus-visible {
    outline: 2px solid var(--azul-vivo);
    outline-offset: 2px;
}

::selection { background: var(--azul-vivo); color: #fff; }

/* ============== LAYOUT GERAL ============== */

.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--fundo);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(1100px 480px at 85% -10%, rgba(46, 123, 214, 0.10) 0%, rgba(46, 123, 214, 0) 60%),
        var(--fundo);
}

.page-content {
    padding: 28px 32px 40px;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

.app-footer {
    padding: 18px 32px 26px;
    text-align: center;
    font-size: 12px;
    color: var(--texto-suave);
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.app-footer a {
    color: var(--texto-suave);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

.app-footer a:hover {
    color: var(--azul-vivo);
}

/* ============== SIDEBAR ============== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, #0D1D31 0%, #060D18 100%);
    border-right: 1px solid var(--borda);
    color: #EAF0F7;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 26px 24px 22px;
    border-bottom: 1px solid var(--borda);
}

.brand-mark {
    height: 40px;
    width: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 10px rgba(46, 123, 214, 0.25));
}

.brand-text .brand-name {
    color: #fff;
    font-size: 17px;
    margin: 0;
}

.brand-text .brand-sub {
    color: rgba(234,240,247,0.55);
    font-size: 11px;
    letter-spacing: 0.03em;
}

.sidebar-nav {
    flex: 1;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--raio-sm);
    color: rgba(234,240,247,0.68);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--azul-vivo) 0%, var(--azul-vivo-escuro) 100%);
    color: #fff;
    box-shadow: var(--azul-glow);
}

.sidebar-footer {
    padding: 16px 14px 22px;
    border-top: 1px solid var(--borda);
}

/* ============== TOPBAR ============== */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    background: rgba(16, 31, 53, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--borda);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--azul-vivo);
}

.topbar-title {
    font-size: 13px;
    color: var(--texto-suave);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user .user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--texto);
}

.topbar-user .user-level {
    font-size: 12px;
    color: var(--texto-suave);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--marrom-tint);
    color: var(--marrom);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--superficie);
    box-shadow: 0 0 0 1px var(--borda);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============== CARDS ============== */

.card {
    background: linear-gradient(180deg, var(--superficie) 0%, var(--superficie) 100%);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    padding: 24px;
    border: 1px solid var(--borda);
}

.card-title {
    font-size: 16px;
    margin-bottom: 4px;
}

.card-sub {
    font-size: 13px;
    color: var(--texto-suave);
    margin-bottom: 18px;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 980px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ============== HERO / SAUDACAO ============== */

.hero {
    background: linear-gradient(120deg, #16345B 0%, #0B1626 100%);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    padding: 32px;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}

.hero::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(181,118,62,0.30) 0%, rgba(181,118,62,0) 70%);
}

.hero::before {
    content: '';
    position: absolute;
    left: 30%;
    bottom: -90px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46,123,214,0.25) 0%, rgba(46,123,214,0) 70%);
}

.hero h1 {
    color: #fff;
    font-size: 24px;
    margin-bottom: 6px;
    position: relative;
}

.hero p {
    color: rgba(234,240,247,0.72);
    margin: 0;
    font-size: 14px;
    max-width: 480px;
    position: relative;
}

/* ============== STAT CARDS ============== */

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--texto);
}

.stat-label {
    font-size: 13px;
    color: var(--texto-suave);
}

.bg-marrom { background: var(--marrom-tint); color: var(--marrom); }
.bg-azul   { background: var(--azul-tint); color: var(--azul-vivo); }
.bg-sucesso{ background: var(--sucesso-bg); color: var(--sucesso); }

/* ============== PROGRESSO ============== */

.progress-track {
    width: 100%;
    height: 10px;
    background: var(--superficie-2);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--borda);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--azul-vivo) 0%, var(--marrom) 100%);
    border-radius: 20px;
    transition: width 0.4s ease;
}

/* ============== LISTAS DE AULAS ============== */

.aula-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--borda);
    border-radius: var(--raio-sm);
    margin-bottom: 12px;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.aula-item:hover {
    box-shadow: var(--sombra);
    border-color: var(--borda-forte);
    transform: translateY(-1px);
}

.aula-item:last-child { margin-bottom: 0; }

.aula-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--azul-tint);
    color: var(--azul-vivo);
    flex-shrink: 0;
}

.aula-data .dia { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 18px; line-height: 1; }
.aula-data .mes { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }

.aula-info { flex: 1; min-width: 0; }
.aula-info .aula-titulo { font-weight: 600; font-size: 14px; color: var(--texto); }
.aula-info .aula-meta { font-size: 12.5px; color: var(--texto-suave); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-agendada { background: var(--azul-tint); color: var(--azul-vivo); }
.badge-realizada { background: var(--sucesso-bg); color: var(--sucesso); }
.badge-cancelada { background: var(--erro-bg); color: var(--erro); }

/* ============== BOTOES ============== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--raio-sm);
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--azul-vivo) 0%, var(--azul-vivo-escuro) 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(46, 123, 214, 0.30);
}

.btn-primary:hover {
    box-shadow: var(--azul-glow);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--borda-forte);
    color: var(--texto);
}

.btn-outline:hover {
    border-color: var(--azul-vivo);
    color: var(--azul-vivo);
}

.btn-zoom {
    background: linear-gradient(135deg, #2D8CFF 0%, #0B5CD4 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(45, 140, 255, 0.30);
}

.btn-zoom:hover {
    box-shadow: 0 0 0 1px rgba(45, 140, 255, 0.4), 0 8px 26px rgba(45, 140, 255, 0.35);
    transform: translateY(-1px);
}

.zoom-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(45, 140, 255, 0.14);
    color: #62A9FF;
}

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============== FORMULARIOS ============== */

.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--texto);
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--borda-forte);
    border-radius: var(--raio-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--superficie-2);
    color: var(--texto);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control::placeholder { color: var(--texto-suave); }

.form-control:focus {
    border-color: var(--azul-vivo);
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 123, 214, 0.18);
}

.form-control:disabled { opacity: 0.6; cursor: not-allowed; }

select.form-control { cursor: pointer; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ============== TABS / FILTROS ============== */

.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--borda);
}

.tab-link {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--texto-suave);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab-link.active {
    color: var(--azul-vivo);
    border-bottom-color: var(--azul-vivo);
}

.filter-chip {
    padding: 7px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid var(--borda-forte);
    color: var(--texto-suave);
    display: inline-flex;
}

.filter-chip.active {
    background: var(--azul-tint);
    border-color: var(--azul-vivo);
    color: var(--azul-vivo);
}

/* ============== MATERIAIS ============== */

.material-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.material-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--azul-tint);
    color: var(--azul-vivo);
    display: flex;
    align-items: center;
    justify-content: center;
}

.material-card .material-titulo { font-weight: 600; font-size: 14.5px; color: var(--texto); }
.material-card .material-desc { font-size: 13px; color: var(--texto-suave); flex: 1; }

/* ============== FLASH MESSAGES ============== */

.alert {
    padding: 13px 16px;
    border-radius: var(--raio-sm);
    font-size: 13.5px;
    margin-bottom: 18px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success { background: var(--sucesso-bg); color: var(--sucesso); border-color: rgba(62, 207, 142, 0.3); }
.alert-error { background: var(--erro-bg); color: var(--erro); border-color: rgba(255, 107, 107, 0.3); }

/* ============== LOGIN PAGE ============== */

.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--fundo);
}

.login-visual {
    flex: 1.15;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 52px;
    color: #fff;
    background:
        linear-gradient(160deg, rgba(7, 16, 25, 0.90) 0%, rgba(30, 58, 95, 0.68) 48%, rgba(7, 16, 25, 0.94) 100%),
        url('../images/login-hero.jpg');
    background-size: cover;
    background-position: center;
}

.login-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 400px at 15% 90%, rgba(181,118,62,0.28) 0%, rgba(181,118,62,0) 70%);
    pointer-events: none;
}

.login-visual .login-visual-top,
.login-visual .login-visual-bottom {
    position: relative;
    z-index: 1;
}

.login-visual .quote {
    font-family: 'Poppins', sans-serif;
    font-size: 26px;
    font-weight: 600;
    max-width: 420px;
    line-height: 1.35;
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.login-visual .quote-author {
    margin-top: 14px;
    font-size: 13px;
    color: rgba(255,255,255,0.65);
}

.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--fundo-2);
}

.login-box {
    width: 100%;
    max-width: 380px;
}

.login-box .brand-mark { height: 52px; margin-bottom: 22px; }

.login-box h1 {
    font-size: 24px;
}

.login-box .login-sub {
    color: var(--texto-suave);
    font-size: 14px;
    margin-bottom: 28px;
}

@media (max-width: 900px) {
    .login-visual { display: none; }
}

/* ============== RESPONSIVIDADE ============== */

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--sombra-hover);
    }

    .sidebar.open { transform: translateX(0); }

    .main-content { margin-left: 0; }

    .topbar-menu-btn { display: inline-flex; }

    .page-content { padding: 20px 18px 50px; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    .hero { padding: 24px; }
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(4,9,16,0.65);
    z-index: 90;
}

.sidebar-backdrop.show { display: block; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--texto-suave);
}

.empty-state .empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    color: var(--marrom);
    opacity: 0.6;
}

/* ============== PAINEL ADMINISTRATIVO ============== */

.avatar-admin {
    background: var(--azul-tint);
    color: var(--azul-vivo);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 20px;
    margin-bottom: 4px;
}

.page-header p {
    margin: 0;
    font-size: 13.5px;
    color: var(--texto-suave);
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form .form-control { min-width: 220px; }

/* Tabela de dados */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--raio);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--texto-suave);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1.5px solid var(--borda);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--borda);
    vertical-align: middle;
    color: var(--texto);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.03); }

.table-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-user .avatar { width: 34px; height: 34px; font-size: 13px; }

.table-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--borda-forte);
    background: var(--superficie-2);
    color: var(--texto-suave);
    cursor: pointer;
    transition: all 0.15s ease;
}

.icon-btn:hover { border-color: var(--azul-vivo); color: var(--azul-vivo); }
.icon-btn.icon-btn-danger:hover { border-color: var(--erro); color: var(--erro); }

/* Grid de checkboxes (membros de grupo) */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding: 12px;
    border: 1.5px solid var(--borda-forte);
    border-radius: var(--raio-sm);
    background: var(--superficie-2);
}

@media (max-width: 640px) {
    .checkbox-grid { grid-template-columns: 1fr; }
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--texto);
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.checkbox-item:hover { background: var(--azul-tint); }
.checkbox-item input { accent-color: var(--azul-vivo); width: 16px; height: 16px; }

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.form-hint {
    font-size: 12px;
    color: var(--texto-suave);
    margin-top: 6px;
}

.badge-tipo-grupo { background: var(--azul-tint); color: var(--azul-vivo); }
.badge-tipo-particular { background: var(--marrom-tint); color: var(--marrom); }
