/* ═══════════════════════════════════════════════════════
   ATLAS NGO — Admin Stylesheet
   ═══════════════════════════════════════════════════════ */

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

:root {
    --navy: #1a365d;
    --navy-dark: #0d2137;
    --navy-mid: #1e3a5f;
    --green: #10b981;
    --green-dark: #059669;
    --red: #ef4444;
    --orange: #f59e0b;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
}

/* ─── Login Page ────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-mid) 100%);
}
.login-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}
.login-box h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    text-align: center;
    margin-bottom: 0.5rem;
}
.login-box .subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}
.login-box img {
    height: 48px;
    margin: 0 auto 1.5rem;
    display: block;
}

/* ─── Form Elements ─────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}
.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: auto; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}
.btn-green { background: var(--green); color: var(--white); }
.btn-green:hover { background: var(--green-dark); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-dark); }
.btn-gray { background: var(--gray-200); color: var(--gray-700); }
.btn-gray:hover { background: var(--gray-300); }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: #dc2626; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }

/* ─── Admin Layout ──────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: 250px;
    background: var(--navy-dark);
    color: var(--white);
    padding: 0;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
}
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sidebar-header img { height: 36px; filter: brightness(0) invert(1); }
.sidebar-header span { font-weight: 700; font-size: 1.125rem; }
.sidebar-nav { padding: 1rem 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.sidebar-nav a.active { background: var(--green); color: var(--white); }
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-divider {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 0.5rem 0;
}

.admin-main {
    flex: 1;
    margin-left: 250px;
    min-height: 100vh;
}
.admin-topbar {
    background: var(--white);
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-topbar h2 { font-size: 1.125rem; font-weight: 700; color: var(--navy); }
.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.admin-topbar-right span { font-size: 0.875rem; color: var(--gray-600); }
.admin-content { padding: 1.5rem; }

/* ─── Cards ─────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}
.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header h3 { font-size: 1rem; font-weight: 700; color: var(--navy); }
.card-body { padding: 1.5rem; }

/* ─── Stats Grid ────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}
.stat-card .label {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy);
    margin-top: 0.25rem;
}
.stat-card .icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}
.stat-card .icon svg { width: 20px; height: 20px; }
.stat-green .icon { background: rgba(16,185,129,0.1); }
.stat-green .icon svg { color: var(--green); }
.stat-navy .icon { background: rgba(26,54,93,0.1); }
.stat-navy .icon svg { color: var(--navy); }
.stat-orange .icon { background: rgba(245,158,11,0.1); }
.stat-orange .icon svg { color: var(--orange); }

/* ─── Table ─────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
    background: var(--gray-50);
}
table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
table tr:hover { background: var(--gray-50); }
.table-actions {
    display: flex;
    gap: 0.375rem;
}

/* ─── Badges ────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-green { background: rgba(16,185,129,0.1); color: var(--green); }
.badge-blue { background: rgba(6,182,212,0.1); color: #06b6d4; }
.badge-gray { background: var(--gray-200); color: var(--gray-600); }
.badge-red { background: rgba(239,68,68,0.1); color: var(--red); }
.badge-orange { background: rgba(245,158,11,0.1); color: var(--orange); }

/* ─── Alerts ────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.alert-success { background: rgba(16,185,129,0.1); color: #065f46; border: 1px solid rgba(16,185,129,0.2); }
.alert-error { background: rgba(239,68,68,0.1); color: #991b1b; border: 1px solid rgba(239,68,68,0.2); }

/* ─── Grid Layouts ──────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-grid .full-width { grid-column: 1 / -1; }

/* ─── Thumbnail Preview ─────────────────────────────── */
.thumb-preview {
    width: 120px;
    height: 80px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 1px solid var(--gray-200);
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    .admin-sidebar { width: 100%; position: relative; }
    .admin-main { margin-left: 0; }
    .admin-layout { flex-direction: column; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
}
