:root {
    /* Updated brand greens */
    --brand-green: #00a651; /* Primary brand color from logo */
    --primary-green: #00a651;
    --secondary-green: #05904a;
    --light-green: #e3f9ed;
    --accent-green: #00b85a;
    --dark-green: #007a3d;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --border-color: #e9ecef;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --sidebar-width: 280px;
    --topbar-height: 64px;
    /* Bootstrap variable overrides - force our green */
    --bs-primary: #00a651 !important;
    --bs-primary-rgb: 0,166,81 !important;
    --bs-btn-bg: #00a651 !important;
    --bs-btn-border-color: #00a651 !important;
    --bs-btn-hover-bg: #007a3d !important;
    --bs-btn-hover-border-color: #007a3d !important;
    --bs-btn-active-bg: #007a3d !important;
    --bs-btn-active-border-color: #007a3d !important;
}

/* Dashboard stats cards - equal height */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.75rem;
}

.stats-row .col-md-3,
.stats-row .col-sm-6 {
    display: flex;
    padding: 0.75rem;
}

.stats-row .card {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 140px; /* Minimum height for consistency */
}

.stats-row .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem 1rem;
}

/* Ensure all dashboard cards have consistent styling */
.dashboard-card {
    border: none !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
    border-radius: 0.75rem !important;
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.stats-icon {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 166, 81, 0.1);
    color: #00a651;
    margin: 0 auto 1rem auto;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    padding-top: var(--topbar-height);
}

/* Top Navigation */
.navbar {
    height: var(--topbar-height);
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%) !important;
    box-shadow: var(--shadow);
    z-index: 1030;
}

.navbar-brand { font-weight: 700; font-size: 1.25rem; }

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--topbar-height));
}

/* Force Bootstrap primary buttons to brand green with maximum specificity */
.btn.btn-primary, 
a.btn.btn-primary,
.btn-primary,
button.btn-primary {
    background-color: #00a651 !important;
    background-image: linear-gradient(135deg, #00a651 0%, #00b85a 100%) !important;
    border-color: #00a651 !important;
    color: #fff !important;
    border: 1px solid #00a651 !important;
    border-radius: 0.55rem !important;
    font-weight: 600 !important;
    transition: all 0.18s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
}

.btn.btn-primary:focus, 
.btn.btn-primary:hover, 
.btn.btn-primary:active,
.btn.btn-primary:focus-visible,
.btn.btn-primary.focus,
.btn.btn-primary.active,
a.btn.btn-primary:focus,
a.btn.btn-primary:hover,
a.btn.btn-primary:active,
button.btn-primary:focus,
button.btn-primary:hover,
button.btn-primary:active {
    background-color: #007a3d !important;
    background-image: linear-gradient(135deg, #007a3d 0%, #00a651 100%) !important;
    border-color: #007a3d !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important;
}

.sidebar.active {
    transform: translateX(0);
}
.sidebar-header { padding: 1.5rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
sidebar-header { padding: 1.5rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); }

.btn-outline-primary { border-color: var(--primary-green) !important; color: var(--primary-green) !important; border-radius: 0.55rem; font-weight: 600; background: #fff; transition: all 0.18s ease; }
.btn-outline-primary:focus, .btn-outline-primary:hover, .btn-outline-primary:active { background-color: var(--primary-green) !important; border-color: var(--primary-green) !important; color:#fff !important; }

.sidebar-nav .nav-item {
    margin: 0.25rem 0.75rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(4px);
}

.sidebar-nav .nav-link.active {
    background-color: var(--accent-green);
    color: white;
    box-shadow: var(--shadow);
}

.sidebar-nav .nav-link i {
    width: 1.5rem;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.sidebar-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 1rem 0.75rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1010;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Content */
.content {
    margin-left: 0;
    padding: 1.5rem;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left 0.3s ease;
}

.content.sidebar-open {
    margin-left: var(--sidebar-width);
}

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Participant cards: very light green background for visibility */
.participant-card {
    background-color: var(--light-green) !important; /* soft green */
    border: 1px solid rgba(0, 166, 81, 0.08) !important;
}

.participant-card .card-body {
    background-color: transparent !important;
}

.participant-card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, var(--light-green) 0%, white 100%);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0.75rem 0.75rem 0 0 !important;
    font-weight: 600;
    color: var(--text-dark);
}

/* Buttons */
/* Primary button styles with brand green */
.btn-primary {
    background-color: #00a651 !important;
    background-image: linear-gradient(135deg, #00a651 0%, #00b85a 100%) !important;
    border-color: #00a651 !important;
    color: #fff !important;
    border: none;
    border-radius: 0.55rem;
    font-weight: 600;
    transition: all 0.18s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.btn-primary:focus, .btn-primary:hover, .btn-primary:active {
    background-color: #007a3d !important;
    background-image: linear-gradient(135deg, #007a3d 0%, #00a651 100%) !important;
    border-color: #007a3d !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.btn-outline-primary {
    border-color: #00a651 !important;
    color: #00a651 !important;
    border-radius: 0.55rem;
    font-weight: 600;
    background: #fff;
    transition: all 0.18s ease;
}

.btn-outline-primary:focus, .btn-outline-primary:hover, .btn-outline-primary:active {
    background-color: #00a651 !important;
    border-color: #00a651 !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-left: 4px solid var(--accent-green);
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stats-card .stats-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-green) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.stats-card .stats-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.stats-card .stats-label {
    color: var(--text-light);
    font-weight: 500;
    margin: 0;
}

/* Tables */
.table {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: var(--light-green);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.75rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-left-color: var(--accent-green);
    color: #155724;
}

.alert-warning {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

/* Forms */
.form-control {
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content.sidebar-open {
        margin-left: 0;
    }
    
    .sidebar {
        width: 100%;
        max-width: var(--sidebar-width);
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
}

@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0);
    }
    
    .content {
        margin-left: var(--sidebar-width);
    }
    
    .sidebar-overlay {
        display: none;
    }
    
    #sidebarToggle {
        display: none;
    }
}

/* Utility Classes */
.text-primary-green { color: var(--primary-green) !important; }

.bg-primary-green { background-color: var(--primary-green) !important; }

.border-primary-green { border-color: var(--primary-green) !important; }

/* Top status bar gradient update */
.top-status-bar {
    background: linear-gradient(90deg, var(--primary-green), var(--secondary-green));
}

/* Link / interactive accents */
a, .link-green { color: var(--primary-green); }
a:hover, .link-green:hover { color: var(--dark-green); }

/* Utility for brand badge */
.brand-badge { background: var(--primary-green); color:#fff; padding:2px 8px; border-radius:6px; font-size:.75rem; letter-spacing:.5px; }


/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
