:root {
    --primary: #1e3a8a;
    --primary-dark: #142b63;
    --secondary: #0f766e;
    --sidebar-bg: linear-gradient(180deg, #10214f 0%, #1d376d 100%);
    --page-bg: #eef3f8;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-soft: #64748b;
    --border-soft: #d9e2ef;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text-main);
    font-family: Inter, Arial, sans-serif;
}

a {
    text-decoration: none;
}

.gov-header {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.gov-header-inner {
    min-height: 64px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gov-header-left,
.gov-header-right {
    display: flex;
    align-items: center;
}

.gov-header-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.gov-header-subtitle {
    font-size: 13px;
    opacity: 0.92;
    margin-top: 2px;
}

.gov-system-name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.sidebar {
    min-height: calc(100vh - 64px);
    background: var(--sidebar-bg);
    color: #fff;
}

.sidebar-inner {
    padding: 18px 16px 24px;
    position: sticky;
    top: 0;
}

.brand-box {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    padding: 18px 16px;
    margin-bottom: 22px;
}

.brand-logo {
    height: 34px;
    width: auto;
    display: block;
    margin-bottom: 12px;
}

.brand-caption {
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.88);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    padding: 14px 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    font-weight: 600;
    transition: 0.2s ease;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.18), rgba(6, 182, 212, 0.12));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    flex: 0 0 10px;
}

.nav-link.active .dot {
    background: #8de26a;
}

.content-wrap {
    min-height: calc(100vh - 64px);
    padding: 18px 20px 24px;
}

.page-shell {
    width: 100%;
}

.topbar {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 26px;
    padding: 26px 28px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    color: #1a2540;
}

.page-subtitle {
    margin-top: 8px;
    color: var(--text-soft);
    font-size: 15px;
}

.welcome-badge {
    background: #f3f7fb;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: 12px 18px;
    color: #334155;
    font-size: 14px;
    white-space: nowrap;
}

.welcome-badge strong {
    color: #18243f;
    margin-left: 4px;
}

.card,
.panel-card,
.stats-card,
.card-soft {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .icon-wrap {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.stat-card .stat-label {
    color: var(--text-soft);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.stat-card .stat-value {
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 10px;
}

.stat-card .stat-hint {
    color: var(--text-soft);
    margin-top: 8px;
}

.stat-primary .icon-wrap { background: linear-gradient(135deg, #2774d9 0%, #4a8fe8 100%); }
.stat-success .icon-wrap { background: linear-gradient(135deg, #4caf50 0%, #79cf7d 100%); }
.stat-info .icon-wrap { background: linear-gradient(135deg, #06b6d4 0%, #38d5ee 100%); }
.stat-warning .icon-wrap { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); }
.stat-danger .icon-wrap { background: linear-gradient(135deg, #ef4444 0%, #fb7185 100%); }

.section-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #18243f;
}

.form-label {
    font-weight: 700;
    color: #31415c;
}

.form-control,
.form-select {
    border-radius: 14px;
    border: 1px solid #d9e3f0;
    min-height: 48px;
}

.form-control:focus,
.form-select:focus {
    border-color: #7fb1ef;
    box-shadow: 0 0 0 .25rem rgba(25, 118, 210, .12);
}

textarea.form-control {
    min-height: auto;
}

.btn {
    border-radius: 14px;
    font-weight: 700;
    min-height: 46px;
}

.btn-primary {
    background: linear-gradient(135deg, #2774d9, #3f8ff1);
    border: 0;
}

.btn-success {
    background: linear-gradient(135deg, #4caf50, #64c568);
    border: 0;
}

.btn-dark {
    background: linear-gradient(135deg, #15213a, #233458);
    border: 0;
}

.table thead th {
    color: #607089;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: .78rem;
    border-bottom: 1px solid #e7eef7;
}

.table tbody td {
    vertical-align: middle;
    border-bottom: 1px solid #eef3f8;
}

.badge-soft {
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
}

.badge-pendente { background: #fff5db; color: #a16207; }
.badge-erro { background: #fee2e2; color: #b91c1c; }
.badge-processado { background: #dcfce7; color: #166534; }

.hero-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 28px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    padding: 32px 28px;
}

.login-form .login-logo,
.login-logo {
    height: 54px;
    width: auto;
    display: block;
    margin: 0 auto 20px;
}

.footer-note {
    color: #7c8ca6;
    font-size: .95rem;
    text-align: center;
    padding: 16px 0 6px;
}

.empty-state {
    padding: 28px;
    text-align: center;
    color: var(--text-soft);
}

@media (max-width: 991.98px) {
    .sidebar {
        min-height: auto;
    }

    .sidebar-inner {
        position: static;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .welcome-badge {
        white-space: normal;
    }
}

@media (max-width: 768px) {
    .gov-header-inner {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .content-wrap {
        padding: 14px;
    }

    .topbar {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .page-title {
        font-size: 24px;
    }
}
