/* Tema: azul claro, minimalista. Sobrescreve variáveis do Bootstrap 5.3. */
:root,
[data-bs-theme="light"] {
    --brand-50: #f3f7fc;
    --brand-100: #e6f0fb;
    --brand-200: #c9dcf5;
    --brand-500: #3d8bfd;
    --brand-600: #2f7de6;
    --brand-700: #1f63c4;

    --sidebar-width: 260px;

    --bs-primary: var(--brand-500);
    --bs-primary-rgb: 61, 139, 253;
    --bs-link-color: var(--brand-600);
    --bs-link-color-rgb: 47, 125, 230;
    --bs-link-hover-color: var(--brand-700);
    --bs-link-hover-color-rgb: 31, 99, 196;

    --bs-body-bg: var(--brand-50);
    --bs-body-color: #1e2a3a;
    --bs-secondary-color: #6b7f99;
    --bs-border-color: #dfe8f3;
    --bs-border-radius: 0.5rem;
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

body {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* --- Componentes Bootstrap com a cor primária ------------------------- */
.btn-primary {
    --bs-btn-bg: var(--brand-500);
    --bs-btn-border-color: var(--brand-500);
    --bs-btn-hover-bg: var(--brand-600);
    --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-700);
    --bs-btn-active-border-color: var(--brand-700);
    --bs-btn-disabled-bg: var(--brand-500);
    --bs-btn-disabled-border-color: var(--brand-500);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

.btn-light {
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-hover-bg: var(--brand-100);
    --bs-btn-hover-border-color: var(--brand-200);
    --bs-btn-active-bg: var(--brand-100);
    --bs-btn-active-border-color: var(--brand-200);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.2);
}

.card {
    --bs-card-border-color: var(--bs-border-color);
    --bs-card-cap-bg: #fff;
}

.dropdown-menu {
    --bs-dropdown-border-color: var(--bs-border-color);
    --bs-dropdown-link-active-bg: var(--brand-500);
}

/* --- Layout administrativo ------------------------------------------- */
.app {
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    min-height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--bs-border-color);
}

.topbar-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.content {
    flex: 1 1 auto;
    max-width: 1320px;
    width: 100%;
}

/* --- Sidebar ----------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid var(--bs-border-color);
    --bs-offcanvas-width: var(--sidebar-width);
}

@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        flex: 0 0 var(--sidebar-width);
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--bs-body-color);
    text-decoration: none;
}

.sidebar-brand small {
    display: block;
    font-weight: 400;
    color: var(--bs-secondary-color);
}

.sidebar-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.65rem;
    background: var(--brand-100);
    color: var(--brand-600);
    font-size: 1.15rem;
}

.sidebar-nav {
    overflow-y: auto;
    padding: 0.5rem 0.75rem 1rem;
}

.sidebar-heading {
    padding: 1.1rem 0.75rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--bs-border-radius);
    color: var(--bs-body-color);
    font-size: 0.925rem;
}

.sidebar .nav-link .bi {
    font-size: 1.05rem;
    color: var(--bs-secondary-color);
}

.sidebar .nav-link:hover {
    background: var(--brand-50);
}

.sidebar .nav-link.active {
    background: var(--brand-100);
    color: var(--brand-700);
    font-weight: 500;
}

.sidebar .nav-link.active .bi {
    color: var(--brand-600);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--bs-border-color);
}

.min-w-0 { min-width: 0; }

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: 0.85rem;
    font-weight: 600;
}

/* --- Cards de atalho (home) ------------------------------------------- */
.card-link {
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-link:hover {
    border-color: var(--brand-200);
    box-shadow: 0 4px 14px rgba(var(--bs-primary-rgb), 0.1);
}

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 0.75rem;
    border-radius: 0.65rem;
    background: var(--brand-100);
    color: var(--brand-600);
    font-size: 1.15rem;
}

/* --- Login ------------------------------------------------------------- */
.auth {
    min-height: 100vh;
    background:
        radial-gradient(60% 50% at 50% 0%, var(--brand-100) 0%, transparent 70%),
        var(--bs-body-bg);
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

#content-editor {
    max-height: 80%;
}