/* =========================================================
   RESET
========================================================= */

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

html {
    font-size: 16px;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: var(--background);
    color: var(--text);
}

a {
    color: inherit;
}


/* =========================================================
   VARIÁVEIS
========================================================= */

:root {

    /* Paleta GoodLine
       #f5fafb - fundo claro
       #b9e6ff - azul claro
       #4b9edb - azul principal
       #1f5b88 - azul médio
       #143956 - azul escuro
    */

    --primary: #4b9edb;
    --primary-hover: #1f5b88;
    --primary-soft: #b9e6ff;
    --primary-dark: #143956;

    --background: #f5fafb;
    --surface: #ffffff;

    --text: #143956;
    --text-light: #1f5b88;

    --border: #b9e6ff;

    --sidebar-background: #143956;
    --sidebar-background-alt: #1f5b88;
    --sidebar-text: #f5fafb;
    --sidebar-text-muted: #b9e6ff;

    --sidebar-width: 250px;

    --topbar-height: 64px;

    --radius: 10px;

    --shadow:
        0 1px 3px rgba(20, 57, 86, 0.10);
}


/* =========================================================
   APP
========================================================= */

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


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

.sidebar {

    width: var(--sidebar-width);
    min-height: 100vh;

    background: var(--sidebar-background);
    color: var(--sidebar-text);

    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    z-index: 100;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


.sidebar-brand {

    height: var(--topbar-height);

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 0 20px;

    border-bottom:
        1px solid rgba(185, 230, 255, 0.18);
}


.brand-logo {

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background: var(--primary);

    font-weight: 700;
}


.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text strong {
    font-size: 16px;
}

.brand-text span {
    font-size: 11px;
    color: var(--sidebar-text-muted);
}


.sidebar-menu {

    flex: 1;

    padding: 18px 12px;

    overflow-y: auto;
}


.menu-label {

    display: block;

    padding: 20px 12px 8px;

    color: var(--sidebar-text-muted);

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 1px;
}


.menu-item {

    display: flex;
    align-items: center;

    gap: 12px;

    min-height: 44px;

    padding: 0 12px;

    margin-bottom: 3px;

    border-radius: 7px;

    text-decoration: none;

    color: #dceefa;

    font-size: 14px;

    transition: 0.15s;
}


.menu-item:hover {

    background: rgba(185, 230, 255, 0.12);

    color: var(--sidebar-text);
}


.menu-item.active {

    background: var(--primary);

    color: var(--sidebar-text);
}


.menu-icon {

    width: 20px;

    text-align: center;

    font-size: 17px;
}


/* =========================================================
   USUÁRIO - SIDEBAR
========================================================= */

.sidebar-user {

    display: flex;
    align-items: center;

    gap: 11px;

    min-height: 70px;

    padding: 12px 16px;

    border-top: 1px solid rgba(185, 230, 255, 0.18);

    background: var(--sidebar-background);
}


.sidebar-user-avatar {

    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--sidebar-background-alt);
    color: var(--sidebar-text);

    font-size: 13px;
    font-weight: 700;
}


.sidebar-user-data {

    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 2px;
}


.sidebar-user-data strong {

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    color: var(--sidebar-text);

    font-size: 13px;
}


.sidebar-user-data span {

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    color: var(--sidebar-text-muted);

    font-size: 11px;
}


/* =========================================================
   MAIN
========================================================= */

.app-main {

    display: flex;
    flex-direction: column;

    min-height: 100vh;

    width: calc(100% - var(--sidebar-width));

    margin-left: var(--sidebar-width);
}


/* =========================================================
   BOTÃO MENU - SOMENTE MOBILE
========================================================= */

.menu-toggle {

    display: none;
}


.menu-toggle-dots {

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 3px;
}


.menu-toggle-dots span {

    width: 4px;
    height: 4px;

    border-radius: 50%;

    background: currentColor;
}


/* =========================================================
   CONTENT
========================================================= */

.content {

    flex: 1;

    padding: 28px;
}


.page-header {

    display: flex;

    justify-content: space-between;
    align-items: center;

    margin-bottom: 24px;
}


.page-header h1 {

    font-size: 24px;

    margin-bottom: 5px;
}


.page-header p {

    color: var(--text-light);

    font-size: 14px;
}


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

.dashboard-cards {

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 20px;
}


.stat-card {

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 20px;

    box-shadow: var(--shadow);
}


.stat-card-header {

    display: flex;

    justify-content: space-between;
    align-items: center;

    margin-bottom: 18px;
}


.stat-label {

    color: var(--text-light);

    font-size: 13px;

    font-weight: 500;
}


.stat-icon {

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(185, 230, 255, 0.45);

    border-radius: 8px;

    font-weight: 600;
}


.stat-value {

    display: block;

    font-size: 25px;

    margin-bottom: 6px;
}


.stat-detail {

    color: var(--text-light);

    font-size: 12px;
}


/* =========================================================
   GRID
========================================================= */

.dashboard-grid {

    display: grid;

    grid-template-columns:
        2fr 1fr;

    gap: 20px;

    margin-bottom: 20px;
}


/* =========================================================
   CARD
========================================================= */

.card {

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    margin-bottom: 20px;
}


.card-header {

    display: flex;

    justify-content: space-between;
    align-items: center;

    padding: 20px;

    border-bottom: 1px solid var(--border);
}


.card-header h2 {

    font-size: 16px;

    margin-bottom: 4px;
}


.card-header p {

    color: var(--text-light);

    font-size: 12px;
}


/* =========================================================
   EMPTY STATE
========================================================= */

.empty-state {

    min-height: 180px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;

    padding: 30px;
}


.empty-state strong {

    font-size: 14px;

    margin-bottom: 6px;
}


.empty-state p {

    color: var(--text-light);

    font-size: 12px;
}


/* =========================================================
   QUICK ACTIONS
========================================================= */

.quick-actions {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 15px;

    padding: 20px;
}


.quick-action {

    border: 1px solid var(--border);

    border-radius: 8px;

    padding: 18px;

    text-decoration: none;

    transition: 0.15s;
}


.quick-action:hover {

    border-color: var(--primary);

    transform: translateY(-1px);
}


.quick-action strong {

    display: block;

    font-size: 14px;

    margin-bottom: 5px;
}


.quick-action span {

    color: var(--text-light);

    font-size: 12px;
}


/* =========================================================
   FOOTER
========================================================= */

.footer {

    display: flex;

    justify-content: space-between;

    padding: 18px 28px;

    border-top: 1px solid var(--border);

    background: var(--surface);

    color: var(--text-light);

    font-size: 11px;
}


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

.sidebar-overlay {

    display: none;

    position: fixed;

    inset: 0;

    background: rgba(20, 57, 86, 0.48);

    z-index: 90;
}


/* =========================================================
   RESPONSIVO
========================================================= */

@media (max-width: 1100px) {

    .dashboard-cards {

        grid-template-columns:
            repeat(2, 1fr);

    }


    .quick-actions {

        grid-template-columns:
            repeat(2, 1fr);

    }

}


@media (max-width: 800px) {

    .sidebar {

        transform: translateX(-100%);

        transition: transform 0.2s;
    }


    .sidebar.open {

        transform: translateX(0);
    }


    .sidebar-overlay.open {

        display: block;
    }


    .app-main {

        width: 100%;

        margin-left: 0;
    }


    .menu-toggle {

        width: 42px;
        height: 42px;

        display: flex;
        align-items: center;
        justify-content: center;

        position: fixed;

        top: 14px;
        left: 14px;

        z-index: 85;

        border: 1px solid var(--border);
        border-radius: 50%;

        background: var(--surface);
        color: var(--text);

        box-shadow: var(--shadow);

        cursor: pointer;
    }


    .menu-toggle:hover {

        background: rgba(185, 230, 255, 0.45);
    }


    .menu-toggle:focus-visible {

        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }


    .dashboard-grid {

        grid-template-columns: 1fr;
    }


    .content {

        padding: calc(var(--topbar-height) + 5px) 20px 20px;
    }

}


@media (max-width: 550px) {

    .dashboard-cards {

        grid-template-columns: 1fr;
    }


    .quick-actions {

        grid-template-columns: 1fr;
    }



    .footer {

        flex-direction: column;

        gap: 5px;
    }

}

/* =========================================================
   CORE - COMPONENTES ADMINISTRATIVOS
========================================================= */

.card-body { padding: 20px; }

.alert { margin-bottom: 18px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 13px; }
.alert-success { border-color: #9bd7b1; }
.alert-error { border-color: #e1a7a7; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); text-decoration: none; cursor: pointer; font: inherit; font-size: 13px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-small { min-height: 32px; padding: 0 10px; font-size: 12px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-stack { display: grid; gap: 14px; }
.form-grid label, .form-stack label { display: flex; flex-direction: column; gap: 6px; color: var(--text); font-size: 12px; font-weight: 600; }
.form-grid input, .form-grid select, .form-stack input, .form-stack select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; }
.form-grid small { color: var(--text-light); font-weight: 400; }
.check-label { flex-direction: row !important; align-items: center; align-self: end; min-height: 42px; }
.check-label input { width: auto; min-height: 0; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.data-table th { color: var(--text-light); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.data-table td strong, .data-table td small { display: block; }
.data-table td small { margin-top: 3px; color: var(--text-light); font-size: 11px; }
.table-empty { padding: 30px !important; text-align: center !important; color: var(--text-light); }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; background: rgba(185,230,255,.45); font-size: 11px; font-weight: 600; }

.sidebar-logout { margin-left: auto; color: var(--sidebar-text-muted); text-decoration: none; font-size: 18px; }
.sidebar-logout:hover { color: var(--sidebar-text); }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--background); }
.login-card { width: min(420px, 100%); padding: 28px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand > div:last-child { display: flex; flex-direction: column; }
.login-brand span { color: var(--text-light); font-size: 11px; }
.login-card h1 { margin-bottom: 6px; font-size: 22px; }
.login-card > p { margin-bottom: 20px; color: var(--text-light); font-size: 13px; }

@media (max-width: 800px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-actions { grid-column: 1; }
    .content { padding-top: 72px; }
}
