@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --brand-primary: #18C6D8;
    --brand-secondary: #3ED4E6;
    --brand-tertiary: #082E52;
    --brand-navy-deep: #0B2340;
    --bg: #F7FAFC;
    --surface: #ffffff;
    --border: #DCE8EF;
    --text: #082E52;
    --text-muted: #607086;
    --danger: #c0392b;
    --success: #1e8e5a;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 4px 12px rgba(8, 46, 82, 0.08);
    --shadow-brand: 0 8px 25px rgba(24, 198, 216, 0.30);
    --gradient-brand: linear-gradient(135deg, #18C6D8, #3ED4E6);
    --gradient-navy: linear-gradient(180deg, #082E52, #0B2340);

    /* Official Avant design tokens (reference: complianceavant.com/clube) */
    --primary: #18C6D8;
    --primary-dark: #1099AF;
    --primary-light: #6DE2F0;
    --secondary: #082E52;
    --secondary-light: #124A73;
    --accent: #3ED4E6;
    --background: #F7FAFC;
    --surface-alt: #EEF7FA;
    --foreground: #0B2340;
    --muted-foreground: #607086;
    --text-light: #FFFFFF;
    --card: #FFFFFF;
    --card-shadow: 0 4px 20px rgba(8, 46, 82, 0.06);
    --glow: rgba(24, 198, 216, 0.18);
    --glow-strong: rgba(24, 198, 216, 0.30);
    --gradient-primary: linear-gradient(135deg, #18C6D8, #3ED4E6);
    --gradient-secondary: linear-gradient(135deg, #082E52, #124A73);
    --gradient-hero: linear-gradient(135deg, #082E52 0%, #18C6D8 100%);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--gradient-navy);
    color: #fff;
    padding: 24px 16px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    top: -120px;
    right: -100px;
    background: var(--gradient-primary);
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.22;
    pointer-events: none;
}

.sidebar .brand {
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--brand-tertiary);
    text-decoration: none;
    background: #fff;
    border-radius: var(--radius);
    padding: 10px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar .brand img { max-height: 44px; max-width: 100%; object-fit: contain; }
.sidebar .brand-fallback { font-weight: 800; font-size: 1.05rem; color: var(--brand-tertiary); }

.sidebar nav a {
    position: relative;
    display: block;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 9px 12px;
    border-radius: var(--radius);
    margin-bottom: 2px;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: linear-gradient(135deg, rgba(24, 198, 216, 0.24), rgba(24, 198, 216, 0.06));
    color: #fff;
}

.sidebar nav a.active { box-shadow: inset 3px 0 0 var(--brand-primary); }

.sidebar nav .section-label {
    position: relative;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.45);
    margin: 18px 12px 6px;
    font-weight: 700;
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(8, 46, 82, 0.05);
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar h1 { font-size: 1.15rem; margin: 0; font-weight: 700; }

.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.user-name { font-size: 0.88rem; color: var(--text); font-weight: 500; }
.user-logout {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    transition: color 0.15s ease, border-color 0.15s ease;
}
.user-logout:hover { color: var(--danger); border-color: var(--danger); }

.content { padding: 28px; flex: 1; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(8, 46, 82, 0.04), 0 8px 24px rgba(8, 46, 82, 0.06);
    padding: 20px;
    margin-bottom: 20px;
}

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--brand-primary);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-brand); }
.kpi-card:nth-child(4n+2) { border-top-color: var(--brand-secondary); }
.kpi-card:nth-child(4n+3) { border-top-color: var(--brand-tertiary); }
.kpi-card:nth-child(4n+4) { border-top-color: var(--primary-light); }
.kpi-card .label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.kpi-card .value { font-size: 1.6rem; font-weight: 800; color: var(--brand-tertiary); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; background: var(--surface-alt); }
thead tr:first-child th:first-child { border-top-left-radius: 8px; }
thead tr:first-child th:last-child { border-top-right-radius: 8px; }
tbody tr:nth-child(even) td { background: rgba(238, 247, 250, 0.4); }
tr:hover td { background: var(--bg); }
tbody tr { transition: background 0.1s ease; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-ativo { background: rgba(30, 142, 90, 0.12); color: var(--success); }
.badge-inativo { background: rgba(96, 112, 134, 0.15); color: var(--text-muted); }
.badge-cancelado { background: rgba(192, 57, 43, 0.12); color: var(--danger); }
.badge-plan { background: rgba(24, 198, 216, 0.12); color: #0f8ea0; }
.badge-a_fazer { background: rgba(96, 112, 134, 0.15); color: var(--text-muted); }
.badge-em_andamento { background: rgba(230, 162, 60, 0.15); color: #b7791f; }
.badge-concluida { background: rgba(30, 142, 90, 0.12); color: var(--success); }
.badge-baixa { background: rgba(96, 112, 134, 0.12); color: var(--text-muted); }
.badge-media { background: rgba(230, 162, 60, 0.15); color: #b7791f; }
.badge-alta { background: rgba(192, 57, 43, 0.12); color: var(--danger); }
.filter-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.filter-tabs a {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.filter-tabs a:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }
.filter-tabs a.active { background: var(--gradient-brand); color: #fff; border-color: transparent; font-weight: 600; box-shadow: var(--shadow-brand); }
.filter-tabs a.active:hover { background: var(--gradient-brand); color: #fff; }
.status-select { padding: 4px 8px; font-size: 0.82rem; border-radius: 6px; border: 1px solid var(--border); }

.kanban { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kanban-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 260px; flex-shrink: 0; box-shadow: 0 2px 8px rgba(8, 46, 82, 0.04); }
.kanban-col-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px; font-weight: 700; font-size: 0.88rem;
    border-top: 3px solid var(--brand-primary); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--bg);
}
.kanban-col-body { padding: 10px; min-height: 80px; display: flex; flex-direction: column; gap: 8px; }
.kanban-col-body.drag-over { background: rgba(24, 198, 216, 0.08); }
.kanban-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    padding: 10px 12px; cursor: grab; box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-brand); }
.kanban-card:active { cursor: grabbing; }
.kanban-card-title { display: block; font-weight: 600; font-size: 0.9rem; text-decoration: none; color: var(--text); }
.kanban-card-actions { margin-top: 6px; display: flex; gap: 10px; font-size: 0.95rem; }
.kanban-card-actions a { text-decoration: none; }
.text-right { text-align: right; }

.progress-bar { background: var(--bg); border-radius: 999px; height: 8px; overflow: hidden; margin-top: 6px; }
.progress-bar-fill { background: var(--gradient-brand); height: 100%; transition: width 0.3s ease; }
.curso-card { display: flex; justify-content: space-between; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 12px; background: var(--surface); box-shadow: var(--shadow); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.curso-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-brand); }
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius); margin-bottom: 10px; }
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.aula-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.aula-item:last-child { border-bottom: none; }

.btn {
    display: inline-block;
    background: var(--gradient-brand);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-brand);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(24, 198, 216, 0.4); }
.btn-secondary { background: transparent; color: var(--brand-tertiary); border: 1px solid var(--border); box-shadow: none; font-weight: 600; transition: background 0.15s ease, border-color 0.15s ease; }
.btn-secondary:hover { background: var(--surface-alt); border-color: var(--brand-primary); transform: none; box-shadow: none; }

form .field { margin-bottom: 16px; }
form label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
form input, form select, form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
form input:hover, form select:hover, form textarea:hover { border-color: var(--brand-secondary); }
form input:focus, form select:focus, form textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(24, 198, 216, 0.15);
}

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.9rem; border-left: 4px solid transparent; }
.alert-success { background: rgba(30, 142, 90, 0.1); color: var(--success); border-left-color: var(--success); }
.alert-error { background: rgba(192, 57, 43, 0.1); color: var(--danger); border-left-color: var(--danger); }

.login-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--background);
    overflow: hidden;
}
.login-particles { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.login-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}
.login-glow.one { width: 460px; height: 460px; background: var(--gradient-primary); top: -160px; left: -140px; opacity: 0.28; }
.login-glow.two { width: 420px; height: 420px; background: var(--gradient-secondary); bottom: -160px; right: -120px; opacity: 0.16; }

.login-card {
    position: relative;
    z-index: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--card-shadow), 0 12px 40px rgba(8, 46, 82, 0.10);
}
.login-card .login-logo { display: block; max-width: 200px; margin: 0 auto 24px; }
.login-card h1 { font-size: 1.3rem; margin: 0 0 6px; text-align: center; font-weight: 800; color: var(--secondary); }
.login-card p.subtitle { color: var(--muted-foreground); font-size: 0.88rem; margin: 0 0 24px; text-align: center; }
.login-forgot { display: block; text-align: right; font-size: 0.82rem; color: var(--brand-primary); text-decoration: none; margin: -8px 0 16px; }
.login-forgot:hover { text-decoration: underline; }
.login-forgot.centered { display: inline; text-align: center; margin: 0; }
.login-footer { position: absolute; z-index: 1; bottom: 20px; left: 0; right: 0; text-align: center; font-size: 0.78rem; color: var(--text-muted); }

.terms-page { max-width: 640px; margin: 40px auto; }
.terms-box { max-height: 340px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface); font-size: 0.88rem; line-height: 1.6; }

.text-muted { color: var(--text-muted); }
.module-placeholder { color: var(--text-muted); }
