:root {
    --mali-green-dark: #145a26;
    --mali-green: #1f7a33;
    --mali-green-light: #43a047;
    --mali-lime: #8bc34a;
    --mali-gold: #f4c20d;
    --mali-red: #e23b2e;
    --mali-orange: #ff6a3d;
    --sidebar-width: 250px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0fdf4;
    color: #2d3748;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--mali-green-dark) 0%, var(--mali-green) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 20px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sidebar-logo {
    width: 36px;
    height: auto;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    padding: 2px;
}

.sidebar-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    display: flex;
    align-items: baseline;
}

.sidebar-title .plus-icon {
    font-size: 32px;
    font-weight: 900;
    color: var(--mali-gold);
    line-height: 0;
    margin-left: 2px;
    text-shadow: 0 0 12px rgba(244,194,13,0.5);
    animation: pulse-plus 2s ease-in-out infinite;
}

@keyframes pulse-plus {
    0%, 100% { transform: scale(1); text-shadow: 0 0 12px rgba(244,194,13,0.5); }
    50% { transform: scale(1.15); text-shadow: 0 0 20px rgba(244,194,13,0.8); }
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

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

.sidebar-link.active {
    background: rgba(255,255,255,0.15);
    border-left-color: var(--mali-gold);
    color: #fff;
    font-weight: 600;
}

.sidebar-link i { font-size: 18px; }

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

.btn-switch-app {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: var(--mali-gold);
    color: var(--mali-green-dark);
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-switch-app:hover {
    background: #ffd633;
    color: var(--mali-green-dark);
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin 0.3s;
}

.topbar {
    background: #fff;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 999;
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--mali-green-dark);
    cursor: pointer;
}

.topbar-logos {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-logo {
    height: 32px;
    width: auto;
    border-radius: 4px;
    transition: transform 0.2s;
}

.topbar-logo:hover {
    transform: scale(1.08);
}

.topbar-user a { cursor: pointer; }

.content-area {
    padding: 24px;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.card-header {
    background: var(--mali-green-dark);
    color: #fff;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: 12px 20px;
}

.card-header .btn { margin-top: -3px; }

/* Stat Cards */
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--mali-green), var(--mali-gold));
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.stat-card:hover::before { opacity: 1; }

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 26px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--mali-green-dark);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #718096;
    margin-top: 6px;
    font-weight: 500;
}

/* Filters */
.filter-bar {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.filter-bar .form-label {
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 4px;
}

.filter-bar .form-select,
.filter-bar .form-control {
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    font-size: 14px;
}

.filter-bar .form-select:focus,
.filter-bar .form-control:focus {
    border-color: var(--mali-green);
    box-shadow: 0 0 0 3px rgba(31,122,51,0.15);
}

/* Buttons */
.btn-mali {
    background: linear-gradient(135deg, var(--mali-green), var(--mali-green-dark));
    border: none;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-mali:hover {
    opacity: 0.9;
    color: #fff;
    transform: translateY(-1px);
}

.btn-gold {
    background: var(--mali-gold);
    border: none;
    color: var(--mali-green-dark);
    border-radius: 8px;
    font-weight: 600;
}

.btn-gold:hover {
    background: #ffd633;
    color: var(--mali-green-dark);
}

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

.table thead th {
    background: var(--mali-green-dark);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #f0fdf4;
}

.table td { font-size: 13px; vertical-align: middle; }

/* Progress bars */
.progress {
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
}

.progress-bar {
    background: var(--mali-green);
    border-radius: 4px;
}

/* Badges */
.badge-success { background: var(--mali-green); }
.badge-warning { background: var(--mali-gold); color: var(--mali-green-dark); }
.badge-danger { background: var(--mali-red); }
.badge-info { background: var(--mali-green-light); }

/* Login */
.login-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 50%, #d1fae5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.login-card .card-body { padding: 40px 35px; }

.login-header { text-align: center; margin-bottom: 25px; }

.login-header img {
    width: 70px;
    height: auto;
    margin: 0 6px;
}

.login-header h4 {
    color: var(--mali-green-dark);
    font-weight: 700;
    margin-top: 15px;
}

.login-header p { color: #718096; font-size: 14px; }

.login-input {
    border-radius: 10px;
    padding: 12px 15px;
    border: 1.5px solid #e2e8f0;
    font-size: 14px;
}

.login-input:focus {
    border-color: var(--mali-green);
    box-shadow: 0 0 0 3px rgba(31,122,51,0.15);
}

.btn-login {
    background: linear-gradient(135deg, var(--mali-green), var(--mali-green-dark));
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.btn-login:hover { opacity: 0.9; color: #fff; }

/* Pagination */
.pagination .page-link {
    color: var(--mali-green-dark);
    border-radius: 6px;
    margin: 0 2px;
}

.pagination .active .page-link {
    background: var(--mali-green);
    border-color: var(--mali-green);
}

/* Dashboard hero */
.dashboard-hero {
    background: linear-gradient(135deg, var(--mali-green-dark) 0%, var(--mali-green) 60%, var(--mali-green-light) 100%);
    border-radius: 20px;
    padding: 28px 32px;
    color: #fff;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(20,90,38,0.25);
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    right: -40px; top: -40px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(244,194,13,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.dashboard-hero h3 {
    font-weight: 800;
    margin-bottom: 6px;
    font-size: 24px;
}

.dashboard-hero p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.dashboard-hero .hero-date {
    position: absolute;
    right: 24px; bottom: 20px;
    font-size: 13px;
    opacity: 0.8;
}

/* Mail modal */
.mail-modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.mail-recipient-card {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mail-recipient-card:hover {
    border-color: var(--mali-green);
    background: #f0fdf4;
}

.mail-recipient-card.selected {
    border-color: var(--mali-green);
    background: rgba(31,122,51,0.08);
}

.mail-recipient-card .form-check-input {
    margin-left: auto;
}

.tableau-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 2px solid #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin: 4px;
}

.tableau-chip:hover {
    border-color: var(--mali-green);
}

.tableau-chip.active {
    background: var(--mali-green);
    color: #fff;
    border-color: var(--mali-green);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}
