:root {
    --sidebar-width: 260px;
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-muted: #64748b;
    --sidebar-active: #38bdf8;
    --content-bg: #f1f5f9;
    --producao: #b91c1c;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--content-bg);
    min-height: 100vh;
}

body.auth-body {
    background: linear-gradient(160deg, #0f172a, #1e293b);
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-direction: column;
    z-index: 1030;
}

.app-offcanvas {
    background: var(--sidebar-bg);
    width: var(--sidebar-width);
}

.sidebar-brand {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand i {
    font-size: 1.6rem;
    color: var(--sidebar-active);
}

.sidebar-brand small {
    display: block;
    color: var(--sidebar-muted);
    font-size: 0.75rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0 1rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--sidebar-text);
    padding: 0.45rem 1rem;
    border-radius: 0;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(56, 189, 248, 0.12);
    color: #fff;
}

.sidebar-nav .nav-link .badge {
    font-size: 0.65rem;
}

.sidebar-nav .nav-link.nested {
    padding-left: 2.4rem;
    font-size: 0.9rem;
}

.nav-section {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.7rem;
    color: var(--sidebar-muted);
    padding: 1rem 1rem 0.35rem;
}

.nav-group-title {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.45rem 1rem 0.15rem;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.nav-muted,
.nav-hint {
    display: block;
    color: var(--sidebar-muted);
    font-size: 0.8rem;
    padding: 0.2rem 1rem 0.2rem 2.4rem;
}

.nav-hint {
    padding-left: 1rem;
    margin: 0;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.app-content {
    padding: 1.5rem;
}

.stat-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    min-height: 110px;
}

.stat-card strong {
    font-size: 1.8rem;
    line-height: 1.2;
}

.stat-label {
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card small {
    color: #94a3b8;
}

.stat-ok strong {
    color: #047857;
}

.stat-err strong {
    color: #b91c1c;
}

.badge-producao {
    background: #b91c1c;
    color: #fff;
}

.badge-homologacao {
    background: #c2410c;
    color: #fff;
}

.badge-teste {
    background: #1d4ed8;
    color: #fff;
}

.badge-desenvolvimento {
    background: #047857;
    color: #fff;
}

.alert-producao {
    background: #7f1d1d;
    color: #fff;
    border: 0;
}

.row-producao {
    background: #fef2f2;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-icon {
    font-size: 2.4rem;
    color: #0ea5e9;
}

.errorlist {
    color: #b91c1c;
    font-size: 0.875rem;
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
}

.sql-editor {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    min-height: 18rem;
    font-size: 0.9rem;
    line-height: 1.45;
    tab-size: 4;
}

.flag-risco .form-check-label {
    color: #b91c1c;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .app-main {
        margin-left: 0;
    }
}
