/* ===== Admin Panel Stylesheet ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #25D366;
    --primary-dark: #128C7E;
    --secondary: #075E54;
    --sidebar-bg: #0f1b2d;
    --sidebar-hover: #1a2d42;
    --sidebar-active: rgba(37,211,102,0.15);
    --sidebar-text: rgba(255,255,255,0.7);
    --sidebar-text-active: #25D366;
    --card-bg: #ffffff;
    --body-bg: #f0f4f8;
    --dark: #1e293b;
    --gray: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 15px rgba(0,0,0,0.08);
    --radius: 14px;
    --transition: all 0.25s ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    font-family: 'Poppins', sans-serif;
    background: var(--body-bg);
    color: var(--dark);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    min-height: 100vh;
    position: fixed;
    left: 0; top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 28px 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.brand-text { color: white; }
.brand-text h2 { font-size: 0.95rem; font-weight: 700; line-height: 1.2; }
.brand-text p { font-size: 0.75rem; color: rgba(255,255,255,0.5); margin-top: 2px; }

.sidebar-nav {
    padding: 20px 12px;
    flex: 1;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 12px;
    margin: 16px 0 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-icon { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }

.nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 50px;
    font-weight: 700;
}

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

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== TOP BAR ===== */
.topbar {
    background: white;
    padding: 0 30px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--dark);
    padding: 4px;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
}

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

.topbar-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

.topbar-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
}

/* ===== PAGE BODY ===== */
.page-body {
    padding: 30px;
    flex: 1;
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

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

.stat-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.icon-green { background: rgba(37,211,102,0.12); }
.icon-yellow { background: rgba(251,191,36,0.12); }
.icon-blue { background: rgba(59,130,246,0.12); }
.icon-red { background: rgba(239,68,68,0.12); }

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-info p { font-size: 0.85rem; color: var(--gray); font-weight: 500; }

/* ===== DATA TABLE ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: var(--transition);
    min-width: 200px;
}

.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,211,102,0.1); }

.select-filter {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: 'Poppins', sans-serif;
    outline: none;
    cursor: pointer;
    background: white;
}

.table-wrapper { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead { background: #f8fafc; }

thead th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }

.group-info { display: flex; flex-direction: column; }
.group-name { font-weight: 600; color: var(--dark); margin-bottom: 2px; }
.group-sub { font-size: 0.78rem; color: var(--gray); }

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* Action Buttons */
.action-btns { display: flex; gap: 6px; align-items: center; }

.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
}

.btn-approve { background: #d1fae5; color: #065f46; }
.btn-approve:hover { background: #10b981; color: white; }
.btn-reject { background: #fee2e2; color: #991b1b; }
.btn-reject:hover { background: #ef4444; color: white; }
.btn-view { background: #dbeafe; color: #1e40af; }
.btn-view:hover { background: #3b82f6; color: white; }
.btn-delete { background: #fef3c7; color: #92400e; }
.btn-delete:hover { background: #f59e0b; color: white; }
.btn-edit { background: #ede9fe; color: #5b21b6; }
.btn-edit:hover { background: #7c3aed; color: white; }

/* Admin Buttons */
.btn-add {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    text-decoration: none;
}

.btn-add:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(37,211,102,0.35); color: white; }

.btn-logout {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    text-decoration: none;
}

.btn-logout:hover { background: #ef4444; color: white; }

/* ===== FORM CARD ===== */
.form-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.form-section h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-form-group { margin-bottom: 18px; }

.admin-form-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--dark);
    margin-bottom: 6px;
}

.admin-form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: var(--transition);
    background: #f8fafc;
    color: var(--dark);
}

.admin-form-control:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(37,211,102,0.1);
}

.admin-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1a2d42 50%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.login-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}

.login-title { font-size: 1.6rem; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
.login-sub { color: var(--gray); font-size: 0.9rem; margin-bottom: 30px; }

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
    margin-top: 8px;
}

.login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(37,211,102,0.35); }

/* ===== ALERT ===== */
.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.alert-error { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.alert-info { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }

/* ===== CHART PLACEHOLDER ===== */
.chart-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 120px;
    padding: 0 10px;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    justify-content: flex-end;
}

.bar {
    width: 100%;
    background: linear-gradient(to top, var(--primary-dark), var(--primary));
    border-radius: 6px 6px 0 0;
    min-height: 10px;
    transition: height 0.5s ease;
}

.bar-label { font-size: 0.7rem; color: var(--gray); }

/* ===== MOBILE ===== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-body { padding: 20px 16px; }
    .card-header { padding: 16px; }
    .admin-form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 16px; }
    .login-card { padding: 32px 24px; }
}
