:root {
    --brand-primary: #0a3d1a;
    --brand-secondary: #1e7e34;
    --brand-light: #f4f9f5;
    --brand-dark: #164627;
    --text-main: #2d3748;
    --text-muted: #718096;
    --bg-dashboard: #f8fafc;
    --white: #ffffff;
    --sidebar-width: 260px;
    --transition-speed: 0.3s;
}

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

/* ==================== LOGIN PAGE ==================== */
.login-body {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-primary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    color: #000000;
    animation: fadeInUp 0.6s ease-out;
}

.login-logo {
    max-height: 60px;
    display: block;
    margin: 0 auto 24px;
}

.form-floating-custom {
    position: relative;
    margin-bottom: 20px;
}

.form-floating-custom input {
    width: 100%;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 16px 20px;
    color: #333333;
    font-size: 1rem;
    outline: none;
    transition: all var(--transition-speed) ease;
}

.form-floating-custom input:focus {
    background: #ffffff;
    border-color: var(--brand-secondary);
    box-shadow: 0 0 10px rgba(30, 126, 52, 0.2);
}

.form-floating-custom label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
    transition: all var(--transition-speed) ease;
}

.form-floating-custom input:focus+label,
.form-floating-custom input:not(:placeholder-shown)+label {
    top: 0;
    font-size: 0.8rem;
    background: #ffffff;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--brand-primary);
    font-weight: 600;
    transform: translateY(-50%) scale(0.9);
}

.btn-login {
    background: linear-gradient(90deg, var(--brand-secondary) 0%, #28a745 100%);
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-weight: 700;
    color: var(--white);
    width: 100%;
    transition: all var(--transition-speed) ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
}

/* ==================== DASHBOARD LAYOUT ==================== */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--brand-dark);
    color: var(--white);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: all var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}
.sidebar-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    max-height: 40px;
    transition: all var(--transition-speed) ease;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-item {
    margin: 4px 16px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

.sidebar-link:hover,
.sidebar-item.active .sidebar-link {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    transition: transform var(--transition-speed) ease;
}

.sidebar-link:hover i {
    transform: scale(1.1);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Tooltips */
.sidebar-link, .sidebar-footer .btn {
    position: relative;
}

body.sidebar-collapsed .sidebar-link::after,
body.sidebar-collapsed .sidebar-footer .btn::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background-color: #000;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

body.sidebar-collapsed .sidebar-link:hover::after,
body.sidebar-collapsed .sidebar-footer .btn:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(15px);
}

/* Sidebar Collapsed State */
body.sidebar-collapsed .sidebar {
    width: 80px;
}

body.sidebar-collapsed .sidebar-header {
    padding: 24px 10px;
}

body.sidebar-collapsed .sidebar-header span {
    display: none;
}

body.sidebar-collapsed .sidebar-header img {
    max-width: 50px;
}

body.sidebar-collapsed .sidebar-header i {
    font-size: 1.5rem;
}

body.sidebar-collapsed .sidebar-link span,
body.sidebar-collapsed .sidebar-footer span {
    display: none;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 12px;
}

body.sidebar-collapsed .sidebar-link i {
    margin-right: 0 !important;
    font-size: 1.2rem;
}

body.sidebar-collapsed .sidebar-footer {
    padding: 24px 10px;
}

body.sidebar-collapsed .sidebar-footer .btn {
    padding: 10px;
}

body.sidebar-collapsed .sidebar-footer .btn i {
    margin-right: 0 !important;
}

/* Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 40px;
    transition: all var(--transition-speed) ease;
}

body.sidebar-collapsed .main-content {
    margin-left: 80px;
}

.top-navbar {
    background: var(--white);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 32px;
}

.user-initials-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}
.user-initials-circle:hover {
    transform: scale(1.05);
    color: white;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* Card glassmorphism & premium feel */
.stats-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all var(--transition-speed) ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

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

.stats-icon.primary {
    background-color: rgba(10, 61, 26, 0.1);
    color: var(--brand-primary);
}

.stats-icon.success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.stats-icon.info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

.dashboard-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.dashboard-section.active {
    display: block;
}

/* Premium Forms */
.admin-card {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
}

.card-title-premium {
    font-weight: 700;
    color: var(--brand-primary);
    border-left: 4px solid var(--brand-secondary);
    padding-left: 12px;
    margin-bottom: 24px;
}

/* Custom Table style */
.table-premium {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table-premium th {
    background-color: transparent;
    color: var(--text-muted);
    font-weight: 600;
    border: none;
    padding: 12px 16px;
}

.table-premium tbody tr {
    background-color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
    transition: all var(--transition-speed) ease;
}

.table-premium tbody tr:hover {
    transform: scale(1.005);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.table-premium td {
    padding: 16px;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.table-premium td:first-child {
    border-left: 1px solid #f1f5f9;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.table-premium td:last-child {
    border-right: 1px solid #f1f5f9;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* Custom badges */
.badge-status {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-status.ativo {
    background-color: #d1e7dd;
    color: #0f5132;
}

.badge-status.inativo {
    background-color: #f8d7da;
    color: #842029;
}

/* Custom Modals */
.modal-content-custom {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.modal-header-custom {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: var(--white);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    padding: 20px 24px;
}

.modal-header-custom .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

/* Float math challenge helper */
.challenge-box {
    background-color: var(--brand-light);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(30, 126, 52, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

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

    .main-content {
        margin-left: 0;
        padding: 20px;
    }
}