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

:root {
    --primary-color: #435ebe;
    --primary-light: #eff2fb;
    --sidebar-bg: #1e1e2d;
    --sidebar-hover: #2b2b40;
    --sidebar-text: #9899ac;
    --sidebar-text-active: #ffffff;
    --body-bg: #f5f5f9;
    --card-shadow: 0 0.125rem 0.25rem rgba(165, 163, 174, 0.3);
    --border-color: #d9dee3;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--body-bg);
    color: #566a7f;
    -webkit-font-smoothing: antialiased;
}

/* === LAYOUT === */
.sc-layout {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR (PREMIUM DARK) === */
.sc-sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sc-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.sc-brand-icon {
    width: 34px;
    height: 34px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: 0 4px 10px rgba(67, 94, 190, 0.4);
}

.sc-brand-text strong {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.sc-brand-text small {
    font-size: 0.75rem;
    color: var(--sidebar-text);
}

.sc-nav-section {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4a4b68;
    padding: 1.5rem 1.5rem 0.5rem;
}

.sc-nav {
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.sc-nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--sidebar-text);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.sc-nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sc-nav-link.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 10px rgba(67, 94, 190, 0.4);
}

.sc-sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* === MAIN CONTENT === */
.sc-main {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === TOPBAR === */
.sc-topbar {
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.sc-user-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    color: #4a5073;
    padding: 0.3rem 0.75rem;
    border-radius: 2rem;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}
.sc-user-chip:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.sc-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
}

/* === PAGE & COMPONENTS === */
.sc-page {
    padding: 2rem;
}

.sc-page-header h1 {
    font-weight: 800;
    color: #3b4359;
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.sc-page-header p {
    color: #8f95b2;
    font-size: 0.95rem;
}

/* Override Bootstrap Cards */
.card {
    border: none;
    box-shadow: var(--card-shadow);
    border-radius: 1rem;
    background-color: #fff;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 1rem 1rem 0 0 !important;
}

/* Override Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8f95b2;
    font-weight: 700;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    color: #566a7f;
    font-weight: 600;
}

/* Buttons */
.btn {
    font-weight: 700;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background-color: #354a96;
    border-color: #354a96;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(67, 94, 190, 0.3);
}

/* Stat Cards */
.sc-stat {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}

.sc-stat:hover {
    transform: translateY(-3px);
}

.sc-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.sc-stat-blue .sc-stat-icon {
    background: #eff2fb;
    color: #435ebe;
}

.sc-stat-green .sc-stat-icon {
    background: #e8fbee;
    color: #10b981;
}

.sc-stat-red .sc-stat-icon {
    background: #fceaea;
    color: #ef4444;
}

.sc-stat-amber .sc-stat-icon {
    background: #fef5e5;
    color: #f59e0b;
}

.sc-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #3b4359;
}

.sc-stat-label {
    font-size: 0.85rem;
    color: #8f95b2;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Login Page */
.sc-login-wrap {
    min-height: 100vh;
    display: flex;
    background: #f5f5f9;
    background-image: url('/img/domingos-martins.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.sc-login-form-side {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.sc-login-card {
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 450px;
    padding: 3rem;
}

.sc-login-logo {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 20px rgba(67, 94, 190, 0.4);
}

/* Quick Actions */
.sc-qa {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    color: #566a7f;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.sc-qa-icon {
    width: 50px;
    height: 50px;
    background: var(--body-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.sc-qa:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(67, 94, 190, 0.15);
}

.sc-qa:hover .sc-qa-icon {
    background: var(--primary-color);
    color: #fff;
}

/* Responsiveness */
@media (max-width: 991.98px) {
    .sc-sidebar {
        transform: translateX(-100%);
    }

    .sc-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    }

    .sc-main {
        margin-left: 0;
    }

    .sc-topbar {
        padding: 0 1rem;
    }

    .sc-page {
        padding: 1rem;
    }
}

.sc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 30, 45, 0.6);
    backdrop-filter: blur(3px);
    z-index: 1029;
}

.sc-overlay.open {
    display: block;
}

/* Custom Inputs */
.form-control,
.form-select {
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    color: #566a7f;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(67, 94, 190, 0.15);
}

/* Sidebar Accordion Overrides */
.sc-sidebar .accordion-button {
    color: var(--sidebar-text);
    background-color: transparent !important;
    box-shadow: none !important;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
}

.sc-sidebar .accordion-button:hover {
    background: var(--sidebar-hover) !important;
    color: var(--sidebar-text-active);
}

.sc-sidebar .accordion-button:not(.collapsed) {
    color: var(--sidebar-text-active) !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.sc-sidebar .accordion-button::after {
    filter: invert(0.6) sepia(1) saturate(0) hue-rotate(180deg) brightness(1.2);
}

.sc-sidebar .accordion-button:not(.collapsed)::after {
    filter: invert(1);
}

/* Fix nested links contrast inside accordion */
.sc-sidebar .accordion-body .sc-nav-link {
    color: #cbd5e1;
    /* brighter color */
}

.sc-sidebar .accordion-body .sc-nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}