* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --sidebar: #111827;
    --sidebar-soft: #1f2937;
    --text: #172033;
    --muted: #718096;
    --border: #e7eaf0;
    --primary: #f28c28;
    --primary-soft: #fff4e8;
    --success: #22a06b;
    --shadow: 0 8px 28px rgba(15, 23, 42, .06);
}

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

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

/* SIDEBAR */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 245px;
    background: var(--sidebar);
    color: #fff;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 28px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 21px;
}

.brand strong {
    display: block;
    font-size: 18px;
    letter-spacing: .5px;
}

.brand span {
    display: block;
    margin-top: 2px;
    color: #9ca3af;
    font-size: 12px;
}

nav {
    margin-top: 28px;
    display: grid;
    gap: 7px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #aeb6c4;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    transition: .2s ease;
}

.nav-item:hover {
    background: var(--sidebar-soft);
    color: #fff;
}

.nav-item.active {
    background: rgba(242,140,40,.14);
    color: #fff;
}

.nav-item.active span {
    color: var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 8px 0;
    border-top: 1px solid rgba(255,255,255,.08);
}

.status {
    color: #9ca3af;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot,
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(34,160,107,.12);
}

/* CONTEÚDO */

.main {
    width: calc(100% - 245px);
    margin-left: 245px;
    padding: 38px 42px 28px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.eyebrow,
.panel-kicker {
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.4px;
}

h1 {
    font-size: 30px;
    margin-top: 5px;
    letter-spacing: -.7px;
}

.subtitle {
    margin-top: 7px;
    color: var(--muted);
    font-size: 14px;
}

.period-filter {
    min-width: 145px;
}

.period-filter label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 6px;
    font-weight: 700;
}

.period-filter select {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 12px;
    color: var(--text);
    outline: none;
}

.sync-info {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}

.separator {
    color: #c5cad3;
}

/* CARDS */

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 22px;
}

.card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.card {
    border-radius: 14px;
    padding: 21px;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    width: 4px;
    left: 0;
    top: 20px;
    bottom: 20px;
    border-radius: 0 4px 4px 0;
    background: var(--primary);
}

.card-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.card-value {
    margin-top: 10px;
    font-size: 32px;
    font-weight: 750;
    letter-spacing: -1px;
}

.card-footer {
    margin-top: 5px;
    color: #a0a8b5;
    font-size: 11px;
}

/* PAINÉIS */

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr);
    gap: 18px;
    margin-top: 18px;
}

.panel {
    border-radius: 14px;
    padding: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.panel h2 {
    margin-top: 4px;
    font-size: 17px;
}

.panel-total {
    background: var(--primary-soft);
    color: #b65e0a;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.course-list {
    padding-top: 8px;
}

.course-row {
    padding: 14px 0;
}

.course-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 8px;
}

.course-name {
    font-size: 13px;
    font-weight: 650;
}

.course-total {
    font-size: 13px;
    font-weight: 750;
}

.progress {
    height: 7px;
    background: #f0f2f6;
    border-radius: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width .5s ease;
}

.pos-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 20px 0;
}

.pos-summary div {
    background: var(--bg);
    border-radius: 10px;
    padding: 14px;
}

.pos-summary span {
    color: var(--muted);
    font-size: 10px;
    display: block;
}

.pos-summary strong {
    display: block;
    margin-top: 5px;
    font-size: 22px;
}

.mini-list {
    border-top: 1px solid var(--border);
}

.mini-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
    font-size: 11px;
}

.mini-row span:first-child {
    color: #566174;
}

.mini-row strong {
    white-space: nowrap;
}

.loading {
    padding: 30px 0;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.error {
    padding: 18px;
    background: #fff1f1;
    color: #b42318;
    border-radius: 9px;
    font-size: 12px;
}

footer {
    padding-top: 25px;
    color: #9aa2af;
    text-align: center;
    font-size: 11px;
}

/* RESPONSIVO */

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

    .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .sidebar {
        width: 72px;
        padding: 22px 10px;
    }

    .brand {
        justify-content: center;
        padding: 0 0 22px;
    }

    .brand > div:not(.brand-mark),
    .nav-item:not(.active) {
        font-size: 0;
    }

    .nav-item {
        justify-content: center;
    }

    .nav-item.active {
        font-size: 0;
    }

    .nav-item span {
        font-size: 18px;
    }

    .sidebar-footer {
        display: none;
    }

    .main {
        width: calc(100% - 72px);
        margin-left: 72px;
        padding: 25px 18px;
    }

    .topbar {
        flex-direction: column;
    }

    .period-filter {
        width: 100%;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .sync-info {
        flex-wrap: wrap;
    }
}


.page {
    display: none;
}

.page.active {
    display: block;
}


.data-table {
    table-layout: fixed;
}

.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    width: 45%;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: 35%;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    width: 20%;
    text-align: right;
}

.data-table td {
    vertical-align: middle;
}

.data-table td:first-child {
    font-weight: 600;
    color: var(--text);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}
