:root {
    --navy: #0b1739;
    --navy-light: #142657;

    --blue: #2563eb;
    --blue-hover: #1d4ed8;
    --blue-soft: #eff6ff;

    --orange: #ff7a1a;
    --orange-hover: #ea6508;
    --orange-soft: #fff3e8;

    --green: #16a34a;
    --green-soft: #ecfdf3;

    --yellow: #f59e0b;
    --yellow-soft: #fffbeb;

    --red: #dc2626;
    --red-soft: #fef2f2;

    --background: #f4f6f9;
    --card: #ffffff;

    --text: #12213d;
    --muted: #667085;

    --border: #dde3ec;

    --shadow:
        0 2px 8px rgba(11, 23, 57, 0.04);

    --radius: 14px;
}


/* =========================
   RESET
========================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        Arial,
        Helvetica,
        sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
    color: var(--blue-hover);
}


/* =========================
   TOPO / NAVEGAÇÃO
========================= */

.topbar {
    height: 70px;
    min-height: 70px;

    background: var(--navy);
    color: white;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 0 30px;

    position: sticky;
    top: 0;

    z-index: 1000;

    box-shadow:
        0 2px 10px rgba(11, 23, 57, 0.10);
}


/* Logo / Home */

.topbar .brand,
.topbar a.brand,
.topbar a.brand:link,
.topbar a.brand:visited {
    display: inline-flex;
    align-items: center;

    color: #ffffff;

    font-size: 25px;
    font-weight: 800;

    letter-spacing: -0.5px;
    line-height: 1;

    white-space: nowrap;

    text-decoration: none;
}

.topbar .brand:hover,
.topbar a.brand:hover,
.topbar a.brand:focus {
    color: #ffffff;
    text-decoration: none;
}


/* Navegação desktop */

.topbar .nav {
    display: flex;
    align-items: center;

    gap: 25px;

    margin: 0;
    padding: 0;
}

.topbar .nav a,
.topbar .nav a:link,
.topbar .nav a:visited {
    color: #ffffff;

    font-weight: 600;
    font-size: 15px;

    white-space: nowrap;

    text-decoration: none;
}

.topbar .nav a:hover,
.topbar .nav a:focus {
    color: #cbd8ff;
}

.topbar .nav .nav-logout {
    opacity: .85;
}


/* =========================
   BOTÃO DO MENU MOBILE
========================= */

/*
   IMPORTANTE:
   Esta regra é mais específica que
   a regra geral de "button" abaixo.
   Assim o botão não aparece como
   um quadrado azul no computador.
*/

.topbar .menu-toggle {
    display: none;

    width: 44px;
    height: 44px;
    min-height: 44px;

    margin: 0;
    padding: 10px;

    background: transparent;
    color: white;

    border: 0;
    border-radius: 8px;

    box-shadow: none;

    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 5px;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
}

.topbar .menu-toggle:hover,
.topbar .menu-toggle:focus {
    background: rgba(255,255,255,.08);
    color: white;

    box-shadow: none;
    outline: none;

    transform: none;
}

.topbar .menu-toggle span {
    display: block;

    width: 23px;
    height: 2px;

    margin: 0;
    padding: 0;

    background: #ffffff;

    border: 0;
    border-radius: 999px;
}

.menu-overlay {
    display: none;
}


/* =========================
   CONTEÚDO
========================= */

.page {
    width: 100%;
    max-width: 1400px;

    margin: 0 auto;

    padding: 50px 30px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1,
.page-header h2 {
    margin: 5px 0;

    color: var(--navy);

    font-size: 32px;
}

.page-header p {
    color: var(--muted);

    font-size: 17px;

    margin: 0;
}


/* =========================
   CARDS
========================= */

.card {
    background: var(--card);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 25px;

    box-shadow: var(--shadow);
}

.card h2,
.card h3 {
    margin-top: 0;

    color: var(--navy);
}

.cards {
    display: grid;

    gap: 20px;
}

.grid {
    display: grid;

    gap: 20px;
}

.grid-2 {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
}


/* =========================
   MÉTRICAS
========================= */

.metric-label {
    display: block;

    color: var(--muted);

    font-size: 15px;

    margin-bottom: 5px;
}

.metric-value {
    display: block;

    color: var(--navy);

    font-size: 32px;
    font-weight: 800;

    line-height: 1.2;
}


/* =========================
   HERO / RADAR
========================= */

.hero-card {
    background:
        linear-gradient(
            135deg,
            var(--navy),
            var(--navy-light)
        );

    color: white;

    padding: 30px;

    border-radius: 18px;

    box-shadow:
        0 8px 28px rgba(11, 23, 57, 0.16);
}

.hero-card h1,
.hero-card h2,
.hero-card h3 {
    color: white;
}

.hero-card p {
    color: #dbe4ff;
}


/* =========================
   BOTÕES
========================= */

button,
.button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding: 11px 18px;

    border: 0;
    border-radius: 9px;

    background: var(--blue);
    color: white;

    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

button:hover,
.button:hover {
    background: var(--blue-hover);

    color: white;
}

.button.orange,
button.orange {
    background: var(--orange);
}

.button.orange:hover,
button.orange:hover {
    background: var(--orange-hover);
}

.button.secondary,
button.secondary {
    background: white;

    color: var(--navy);

    border: 1px solid var(--border);
}

.button.secondary:hover,
button.secondary:hover {
    background: #f8f9fc;
}


/*
   Reforço do botão do menu após
   as regras gerais dos botões.
*/

button.menu-toggle,
button.menu-toggle:hover,
button.menu-toggle:focus {
    display: none;

    background: transparent;

    color: white;

    border: 0;

    box-shadow: none;

    transform: none;
}


/* =========================
   FORMULÁRIOS
========================= */

.form-card {
    max-width: 800px;
}

.form-field {
    margin-bottom: 18px;
}

.form-row {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}

label {
    display: block;

    margin-bottom: 6px;

    color: var(--navy);

    font-size: 14px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;

    min-height: 44px;

    padding: 11px 12px;

    border: 1px solid #ccd4df;

    border-radius: 8px;

    background: white;

    color: var(--text);

    font-size: 16px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;

    border-color: var(--blue);

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12);
}


/* =========================
   TABELAS
========================= */

.table-card {
    overflow-x: auto;
}

table {
    width: 100%;

    border-collapse: collapse;
}

th {
    background: #f8fafc;

    color: var(--navy);

    font-weight: 700;
}

th,
td {
    padding: 14px 15px;

    text-align: left;

    border-bottom:
        1px solid var(--border);
}

tbody tr:hover {
    background: #fafbfe;
}


/* =========================
   BADGES
========================= */

.badge {
    display: inline-flex;

    align-items: center;

    padding: 5px 10px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 800;

    letter-spacing: 0.2px;
}

.badge-blue {
    background: var(--blue-soft);

    color: var(--blue);
}

.badge-orange {
    background: var(--orange-soft);

    color: var(--orange);
}


/* =========================
   ALERTAS
========================= */

.alert {
    border-radius: 10px;

    padding: 14px 16px;

    margin-bottom: 20px;

    font-weight: 600;
}

.alert-success {
    background: var(--green-soft);

    color: #166534;

    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: var(--yellow-soft);

    color: #92400e;

    border: 1px solid #fde68a;
}

.alert-error {
    background: var(--red-soft);

    color: #991b1b;

    border: 1px solid #fecaca;
}


/* =========================
   STATUS / SEMÁFORO
========================= */

.status {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    font-weight: 700;
}

.status::before {
    content: "";

    width: 10px;
    height: 10px;

    border-radius: 50%;

    flex: 0 0 auto;
}

.status.green::before {
    background: var(--green);
}

.status.yellow::before {
    background: var(--yellow);
}

.status.red::before {
    background: var(--red);
}


/* =========================
   PROGRESSO
========================= */

.progress {
    width: 100%;
    height: 12px;

    overflow: hidden;

    background:
        rgba(255,255,255,0.20);

    border-radius: 999px;
}

.progress-bar {
    height: 100%;

    background: var(--orange);

    border-radius: inherit;
}


/* =========================
   LOGIN / CADASTRO
========================= */

.auth-wrap {
    min-height: 100vh;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 30px;

    background:
        linear-gradient(
            135deg,
            var(--navy),
            #12275c
        );
}

.auth-card {
    width: 100%;

    max-width: 430px;

    background: white;

    padding: 35px;

    border-radius: 18px;

    box-shadow:
        0 18px 60px
        rgba(0,0,0,0.25);
}

.auth-card h1 {
    color: var(--navy);

    margin-top: 0;
}

.auth-card p {
    color: var(--muted);
}


/* =========================
   AÇÕES / MENU INTERNO
========================= */

.quick-actions {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 15px;
}


/* =========================
   RODAPÉ
========================= */

.footer {
    padding: 35px 10px;

    text-align: center;

    color: var(--muted);

    font-size: 13px;
}


/* =========================
   RESPONSIVO - TABLET
========================= */

@media (max-width: 1000px) {

    .grid-4 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .grid-3 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .quick-actions {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/* =========================
   RESPONSIVO - CELULAR
========================= */

@media (max-width: 700px) {

    .topbar {
        height: 64px;
        min-height: 64px;

        padding: 0 18px;

        flex-direction: row;

        align-items: center;
    }

    .topbar .brand,
    .topbar a.brand,
    .topbar a.brand:link,
    .topbar a.brand:visited {
        color: #ffffff;

        font-size: 22px;
    }

    .topbar .menu-toggle,
    button.menu-toggle,
    button.menu-toggle:hover,
    button.menu-toggle:focus {
        display: flex;

        background: transparent;

        color: white;

        border: 0;

        box-shadow: none;

        transform: none;
    }

    .topbar .menu-toggle {
        position: relative;

        z-index: 1200;
    }

    .topbar .nav {
        position: fixed;

        top: 0;
        right: -290px;

        width: 280px;

        max-width: 82vw;

        height: 100vh;

        padding:
            85px
            24px
            30px;

        background: var(--navy);

        display: flex;

        flex-direction: column;

        align-items: stretch;

        gap: 0;

        z-index: 1100;

        transition:
            right .25s ease;

        box-shadow:
            -8px 0 30px
            rgba(0,0,0,.18);
    }

    .topbar .nav.nav-open {
        right: 0;
    }

    .topbar .nav a,
    .topbar .nav a:link,
    .topbar .nav a:visited {
        display: block;

        padding: 15px 5px;

        color: white;

        border-bottom:
            1px solid
            rgba(255,255,255,.10);

        font-size: 16px;
    }

    .topbar .nav a:hover {
        color: #cbd8ff;
    }

    .menu-overlay {
        position: fixed;

        inset: 0;

        background:
            rgba(11,23,57,.45);

        z-index: 1050;
    }

    .menu-overlay.overlay-open {
        display: block;
    }

    body.menu-open {
        overflow: hidden;
    }

    .page {
        padding:
            30px
            15px;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .form-row,
    .quick-actions {
        grid-template-columns: 1fr;
    }

    .page-header h1,
    .page-header h2 {
        font-size: 27px;
    }
}