/* ROOT VARIABLES & RESET */
:root {
    --primary-green: #2ecc71;
    --dark-green: #1b5e20;
    --light-green: #e8f5e9;
    --danger-red: #e74c3c;
    --warning-orange: #f39c12;
    --bg-light: #f4f7f6;
    --white: #ffffff;
    --text-dark: #2d3436;
    --text-muted: #636e72;
    --sidebar-width: 260px;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

/* LAYOUT STRUCTURE */
.dashboard-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR STYLING */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-green);
    color: var(--white);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 30px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-box {
    background: var(--white);
    color: var(--dark-green);
    font-weight: bold;
    padding: 5px 12px;
    border-radius: 6px;
    margin-right: 12px;
}

.brand-text {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
}

nav {
    flex-grow: 1;
    padding: 20px 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    color: #a5d6a7;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.nav-link i {
    width: 25px;
    font-size: 1.1rem;
}

.nav-link:hover, .nav-link.active {
    background: var(--primary-green);
    color: var(--white);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-link {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    background: rgba(231, 76, 60, 0.15);
    color: #ff7675;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: 0.3s;
}

.logout-link:hover {
    background: var(--danger-red);
    color: white;
}

/* MAIN CONTENT AREA */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    background: var(--bg-light);
}

.hero-header {
    background: var(--white);
    padding: 25px 40px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 10;
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-text h1 {
    font-size: 1.5rem;
    color: var(--dark-green);
}

.welcome-text p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-profile-trigger {
    display: flex;
    align-items: center;
    position: relative;
}

.admin-profile-trigger img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--primary-green);
    object-fit: cover;
}

/* SEARCH BOX */
.search-container {
    margin-top: 20px;
    background: #f1f1f1;
    border-radius: 10px;
    padding: 0 15px;
    display: flex;
    align-items: center;
}

.search-container i {
    color: var(--text-muted);
}

.search-container input {
    border: none;
    background: transparent;
    padding: 12px;
    width: 100%;
    outline: none;
    font-size: 0.95rem;
}

/* CONTENT BODY & CARDS */
.content-body {
    padding: 30px 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
    border-bottom: 4px solid var(--primary-green);
}

.stat-card i {
    font-size: 2.2rem;
    color: var(--primary-green);
    margin-right: 20px;
}

.stat-card h3 {
    font-size: 1.8rem;
    margin-bottom: 2px;
}

.stat-card p {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
}

/* TABLES STYLING */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-green {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.btn-green:hover {
    background: var(--dark-green);
}

.table-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.95rem;
}

.table-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ddd;
}

/* BADGES */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: capitalize;
}

.badge.active, .badge.Active { background: var(--light-green); color: var(--primary-green); }
.badge.disabled, .badge.Disabled { background: #ffebee; color: var(--danger-red); }
.badge.pending { background: #fff3e0; color: var(--warning-orange); }

/* CRUD BUTTONS */
.crud-btns button {
    border: none;
    background: transparent;
    margin-right: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s;
}

.crud-btns .edit { color: #3498db; }
.crud-btns .del { color: var(--danger-red); }
.crud-btns .status-btn { color: var(--warning-orange); }

.crud-btns button:hover {
    transform: scale(1.2);
}

/* PROFILE SETTINGS AREA */
.profile-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.profile-form-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
}

.profile-sidebar {
    text-align: center;
}

#profile-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 5px solid var(--light-green);
}

.file-label {
    display: inline-block;
    padding: 8px 15px;
    background: #eee;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
}

.file-label input { display: none; }

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
}

.btn-save-large {
    background: var(--primary-green);
    color: white;
    padding: 15px;
    width: 100%;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
}

/* MODAL STYLING */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none; /* Controlled by JS */
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    width: 450px;
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* ANALYTICS CHART */
.chart-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    height: 450px;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
    .sidebar { width: 70px; }
    .brand-text, .nav-link span, .sidebar-footer span { display: none; }
    .nav-link i { margin: 0 auto; }
    .profile-form-grid { grid-template-columns: 1fr; }
}
.chart-container-small {
    width: 300px;
    height: 300px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.chart-wrapper {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    height: 400px;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
}

.admin-profile-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2ecc71;
}