:root {
    --primary: #044f27;
    --primary-light: #066135;
    --primary-dark: #03381d;
    --success: #e8f5e9;
    --warning: #fff3e0;
    --danger: #ffebee;
    --text: #333;
    --text-light: #666;
    --bg: #f8fff9;
    --card-bg: #ffffff;
    --border: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f0f7f1 0%, #e6f3e8 100%);
    min-height: 100vh;
    color: var(--text);
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--primary);
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    z-index: 1000;
}

.logo {
    padding: 30px 24px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-img {
    max-height: 112px;
    width: auto;
    display: block;
    margin: 0 auto 12px;
    object-fit: contain;
}

.logo span {
    color: #a8e6cf;
}

.nav-menu {
    list-style: none;
    padding: 16px 0;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link i {
    width: 20px;
    margin-right: 12px;
    font-size: 18px;
    text-align: center;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-left: 28px;
}

.nav-link.active {
    background: var(--primary-light);
    color: white;
    font-weight: 600;
    position: relative;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #a8e6cf;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 30px;
    transition: all 0.3s ease;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.header h1 {
    font-size: 26px;
    color: var(--primary);
    font-weight: 600;
}

.header-greeting {
    font-size: 28px;
    color: var(--primary);
    font-weight: 700;
    margin-left: auto;
    text-align: right;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.user-name {
    font-weight: 600;
}

.user-phone {
    font-size: 13px;
    color: var(--text-light);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(4, 79, 39, 0.08);
    border: 1px solid rgba(4, 79, 39, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: var(--success);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-change {
    font-size: 13px;
    font-weight: 600;
}

.positive { color: #044f27; }
.negative { color: #b00020; }

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(4, 79, 39, 0.08);
    border: 1px solid rgba(4, 79, 39, 0.1);
}

.card h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    text-align: left;
    padding: 14px 12px;
    background: #f8fff9;
    color: var(--primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
}

tr:hover {
    background: #f8fff9;
}

.status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status.active {
    background: var(--success);
    color: var(--primary);
}

.status.pending {
    background: var(--warning);
    color: #e65100;
}

/* Activity List */
.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 14px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.activity-text {
    flex: 1;
}

.activity-time {
    font-size: 12px;
    color: var(--text-light);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1100;
    background: var(--primary);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 70px 20px 20px;
    }

    .menu-toggle {
        display: block;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 22px;
    }

    .main-content {
        padding: 80px 15px 15px;
    }

    .stat-card, .card {
        padding: 18px;
    }
}

/* Logout Button */
.logout-btn {
    margin-left: 10px;
    padding: 8px 12px;
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.logout-btn:hover {
    background: #c82333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    position: relative;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 2% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
    border: 1px solid var(--border);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--success);
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary);
    font-size: 20px;
    font-weight: 600;
}

.close {
    color: var(--primary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--primary-dark);
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary);
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(4, 79, 39, 0.1);
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fff9;
    border-radius: 0 0 16px 16px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 85vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        margin: 2% auto;
        max-height: 95vh;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 13px;
    }
}