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

:root {
    --primary: #03135c;
    --primary-strong: #020c42;
    --accent: #e39d4d;
    --accent-2: #03135c;

    --surface: #ffffff;
    --panel: #ffffff;
    --muted: #475569;
    --text: #0f172a;
    --border: #e2e8f0;
    --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    --shadow-strong: 0 18px 40px rgba(15, 23, 42, 0.14);

    --radius: 14px;
    --radius-sm: 10px;

    --container: 1180px;

    --ring: 0 0 0 4px rgba(227, 157, 77, 0.22);
    --transition: 180ms ease;
}

/* Reset base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    padding: 0;
    margin: 0;
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    background: #f8fafc;
    color: var(--text);
    min-height: 100vh;
}

img {
    max-width: 100%;
    display: block;
}

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

a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* Tipografia e legibilidade */
h1,
h2,
h3,
h4 {
    color: var(--primary);
    letter-spacing: -0.02em;
}

p {
    color: #1f2937;
    line-height: 1.75;
}

.muted {
    color: var(--muted);
}

.hidden {
    display: none !important;
}

/* Header / Topbar */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
}

.brand {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand span {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--accent);
    color: var(--primary);
    font-weight: 900;
}

/* Botão hamburger (se quiseres usar no mobile) */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.nav-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Layout */
.layout {
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: 100vh;
}

/* Sidebar */
aside {
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 18px;
    position: sticky;
    top: 0;
    min-height: 100vh;
}

.menu {
    display: grid;
    gap: 8px;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    color: var(--primary);
    border: 1px solid transparent;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.menu a.active,
.menu a:hover {
    background: rgba(227, 157, 77, 0.13);
    border-color: rgba(227, 157, 77, 0.28);
    transform: translateY(-1px);
}

.main {
    padding: 24px;
}

/* Overlay para sidebar mobile */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    display: none;
    z-index: 60;
}

body.sidebar-open .sidebar-overlay {
    display: block;
}

/* Cards */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-strong);
    border-color: rgba(3, 19, 92, 0.18);
}

.card-light {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

.card-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.section-title {
    margin: 10px 0 14px;
    color: var(--primary);
    font-weight: 800;
}

/* Stats */
.stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat .value {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
    text-decoration: none;
    user-select: none;
}

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

.btn:active {
    transform: translateY(0px);
    opacity: .95;
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    border-color: rgba(3, 19, 92, 0.25);
    color: var(--primary);
}

.btn-sm {
    padding: 9px 12px;
    font-size: 13px;
    border-radius: 10px;
}

/* Forms */
form {
    display: grid;
    gap: 12px;
}

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

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--primary);
    font-size: 15px;
    transition: box-shadow var(--transition), border-color var(--transition);
}

input::placeholder,
textarea::placeholder {
    color: rgba(71, 85, 105, 0.65);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(227, 157, 77, 0.8);
    box-shadow: var(--ring);
}

/* Helpers */
.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

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

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(3, 19, 92, 0.06);
    border: 1px solid rgba(3, 19, 92, 0.10);
    color: var(--primary);
    font-size: 12px;
}

/* Table (melhor em mobile: permite scroll horizontal) */
.table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.table th,
.table td {
    padding: 12px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    color: var(--primary);
    font-size: 13px;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: rgba(227, 157, 77, 0.08);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}

.badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.25);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.25);
}

.badge-danger {
    background: rgba(248, 113, 113, 0.12);
    color: #b91c1c;
    border-color: rgba(248, 113, 113, 0.25);
}

.badge-secondary {
    background: rgba(148, 163, 184, 0.12);
    color: #334155;
    border-color: rgba(148, 163, 184, 0.25);
}

/* Alerts */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    color: var(--primary);
    font-size: 14px;
    box-shadow: var(--shadow);
}

.alert-danger {
    border-color: rgba(248, 113, 113, 0.25);
    color: #b91c1c;
}

.alert-success {
    border-color: rgba(16, 185, 129, 0.25);
    color: #047857;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    max-width: 520px;
    width: 100%;
    box-shadow: var(--shadow-strong);
    padding: 20px;
    position: relative;
    animation: pop 160ms ease;
}

@keyframes pop {
    from {
        transform: translateY(6px) scale(.98);
        opacity: 0.6;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal h3 {
    margin: 0 0 10px;
    color: var(--primary);
}

.modal .close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    background: transparent;
    border: none;
    font-size: 18px;
    color: var(--primary);
}

.logo-img {
    height: 40px;
    width: auto;
}

/* Responsive */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    /* Sidebar drawer */
    aside {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        min-height: auto;
        width: 290px;
        z-index: 70;
        transform: translateX(-105%);
        transition: transform var(--transition);
        box-shadow: var(--shadow-strong);
    }

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

    .nav-toggle {
        display: inline-flex;
    }

    .main {
        padding: 18px;
    }
}

@media (max-width: 640px) {
    .nav {
        flex-direction: column;
        align-items: flex-start;
    }
}