:root {
    --vf: #1B5E20; --vm: #2E7D32; --or: #C8922E; --orl: #D4A94A;
    --nr: #0E1E17; --bl: #ffffff; --g2: #666; --g3: #999; --g5: #f5f5f5;
    --r: 12px; --r-lg: 16px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --t: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: #f0f2f5; color: #1a1a1a; line-height: 1.6; }

/* AUTH PAGES */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--nr) 0%, var(--vf) 100%); padding: 2rem; }
.auth-container { width: 100%; max-width: 440px; }
.auth-card { background: var(--bl); border-radius: var(--r-lg); padding: 2.5rem; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.auth-card-wide { max-width: 600px; }
.auth-container:has(.auth-card-wide) { max-width: 640px; }
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--vf); }
.auth-card h1 { text-align: center; color: var(--vf); font-size: 1.5rem; margin-bottom: 0.25rem; }
.auth-subtitle { text-align: center; color: var(--g2); font-size: 0.9rem; margin-bottom: 2rem; }
.auth-form .form-group { margin-bottom: 1.25rem; }
.auth-form label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--g2); margin-bottom: 0.4rem; }
.auth-form input, .auth-form select, .auth-form textarea {
    width: 100%; padding: 0.8rem 1rem; border: 1.5px solid #e0e0e0; border-radius: 8px;
    font-size: 0.95rem; font-family: inherit; transition: border-color var(--t);
}
.auth-form input:focus, .auth-form select:focus, .auth-form textarea:focus { outline: none; border-color: var(--vf); }
.btn-auth {
    width: 100%; padding: 0.9rem; background: var(--vf); color: var(--bl); border: none;
    border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all var(--t);
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-auth:hover { background: var(--vm); transform: translateY(-1px); box-shadow: 0 4px 15px rgba(27,94,32,0.3); }
.auth-footer { text-align: center; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #f0f0f0; }
.auth-footer p { font-size: 0.9rem; color: var(--g2); }
.auth-footer a { color: var(--vf); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
.back-link { display: inline-block; margin-top: 0.75rem; font-size: 0.85rem; color: var(--g3) !important; font-weight: 400 !important; }
.form-section-title { color: var(--vf); font-size: 0.95rem; margin: 1.5rem 0 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; gap: 0.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ALERTS */
.alert { padding: 0.85rem 1.25rem; border-radius: 8px; margin-bottom: 1.5rem; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.alert-error { background: #fdecea; color: #c62828; border: 1px solid #f5c6cb; }
.alert-success { background: #e8f5e9; color: #1B5E20; border: 1px solid #c8e6c9; }

/* ADMIN LAYOUT */
.admin-body { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px; background: var(--nr); color: var(--bl); padding: 1.5rem 0;
    display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
    transition: transform var(--t);
}
.sidebar-header { display: flex; align-items: center; gap: 0.75rem; padding: 0 1.5rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.sidebar-header span { font-weight: 700; font-size: 1rem; }
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.9rem; transition: all var(--t);
}
.nav-item:hover { color: var(--bl); background: rgba(255,255,255,0.05); }
.nav-item.active { color: var(--or); background: rgba(200,146,46,0.1); border-right: 3px solid var(--or); }
.nav-item i { width: 20px; text-align: center; }
.nav-item .badge { background: var(--or); color: var(--nr); font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 50px; font-weight: 700; margin-left: auto; }
.sidebar-footer { padding: 1rem 0; border-top: 1px solid rgba(255,255,255,0.08); }
.logout { color: rgba(255,255,255,0.4) !important; }
.logout:hover { color: #ef5350 !important; }

.main-content { flex: 1; margin-left: 260px; display: flex; flex-direction: column; }

.topbar {
    background: var(--bl); padding: 1rem 2rem; display: flex; align-items: center; gap: 1rem;
    border-bottom: 1px solid #e8e8e8; position: sticky; top: 0; z-index: 50;
}
.topbar h2 { font-size: 1.1rem; color: var(--nr); flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 0.75rem; }
.topbar-user span { font-size: 0.85rem; color: var(--g2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--vf); color: var(--bl); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; }
.menu-btn { display: none; background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--nr); }

.content { padding: 2rem; }

/* WELCOME */
.welcome-banner { background: linear-gradient(135deg, var(--vf), var(--vm)); border-radius: var(--r-lg); padding: 2rem; color: var(--bl); display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.welcome-banner h1 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.welcome-banner p { opacity: 0.8; font-size: 0.9rem; }
.welcome-date { opacity: 0.7; font-size: 0.85rem; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stats-compact { margin-bottom: 1.5rem; }
.stat-card { background: var(--bl); border-radius: var(--r); padding: 1.5rem; display: flex; align-items: center; gap: 1rem; box-shadow: var(--shadow); transition: all var(--t); }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.12); }
.stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.stat-vf .stat-icon { background: #e8f5e9; color: var(--vf); }
.stat-or .stat-icon { background: #fff3e0; color: var(--or); }
.stat-blue .stat-icon { background: #e3f2fd; color: #1565c0; }
.stat-purple .stat-icon { background: #f3e5f5; color: #7b1fa2; }
.stat-number { font-family: 'Space Grotesk', sans-serif; font-size: 1.75rem; font-weight: 700; color: var(--nr); display: block; }
.stat-label { font-size: 0.8rem; color: var(--g3); }

/* CARDS */
.card { background: var(--bl); border-radius: var(--r-lg); box-shadow: var(--shadow); margin-bottom: 1.5rem; overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid #f0f0f0; }
.card-header h3 { font-size: 1rem; color: var(--nr); display: flex; align-items: center; gap: 0.5rem; }
.card-header h3 i { color: var(--vf); }

/* TABLES */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #fafafa; padding: 0.85rem 1.25rem; text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--g3); text-transform: uppercase; letter-spacing: 0.5px; }
.data-table td { padding: 0.85rem 1.25rem; border-top: 1px solid #f5f5f5; font-size: 0.9rem; vertical-align: middle; }
.data-table tr:hover { background: #fafffe; }
.empty-state { text-align: center; color: var(--g3); padding: 3rem !important; font-style: italic; }

/* BADGES & STATUS */
.badge-type { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 50px; font-size: 0.75rem; font-weight: 600; background: #e8f5e9; color: var(--vf); }
.badge-orphelinat { background: #fff3e0; color: #e65100; }
.badge-ong { background: #e3f2fd; color: #0d47a1; }
.badge-enfant { background: #fce4ec; color: #880e4f; }
.badge-staff { background: #e8eaf6; color: #283593; }

.status-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 50px; font-size: 0.72rem; font-weight: 600; }
.status-nouvelle, .status-en_attente, .status-en-verification { background: #fff3e0; color: #e65100; }
.status-actif, .status-active, .status-publie, .status-acceptee { background: #e8f5e9; color: #1B5E20; }
.status-inactif, .status-inactive, .status-brouillon, .status-refusee { background: #fafafa; color: #999; }
.status-traitee, .status-diplome { background: #e3f2fd; color: #0d47a1; }
.status-insere, .status-employe { background: #f3e5f5; color: #6a1b9a; }
.status-en_formation { background: #e0f7fa; color: #00695c; }

.text-success { color: var(--vf); }
.text-warning { color: var(--or); }

/* BUTTONS */
.btn-primary { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.25rem; background: var(--vf); color: var(--bl); border: none; border-radius: 8px; font-size: 0.85rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: all var(--t); }
.btn-primary:hover { background: var(--vm); transform: translateY(-1px); }
.btn-sm { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.85rem; background: #f5f5f5; color: var(--nr); border: 1px solid #e0e0e0; border-radius: 6px; font-size: 0.8rem; font-weight: 500; cursor: pointer; text-decoration: none; transition: all var(--t); }
.btn-sm:hover { background: #e8e8e8; }
.btn-sm.btn-danger { background: #fdecea; color: #c62828; border-color: #f5c6cb; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; background: #f5f5f5; color: var(--g2); border: none; cursor: pointer; text-decoration: none; transition: all var(--t); font-size: 0.85rem; }
.btn-icon:hover { background: var(--vf); color: var(--bl); }
.btn-icon.btn-danger:hover { background: #c62828; color: var(--bl); }
.actions { display: flex; gap: 0.4rem; }

/* FILTERS */
.filters { padding: 1rem 1.5rem; border-bottom: 1px solid #f0f0f0; }
.filter-form { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.filter-input { padding: 0.55rem 1rem; border: 1.5px solid #e0e0e0; border-radius: 8px; font-size: 0.9rem; font-family: inherit; min-width: 200px; }
.filter-input:focus { outline: none; border-color: var(--vf); }
.filter-select { padding: 0.55rem 1rem; border: 1.5px solid #e0e0e0; border-radius: 8px; font-size: 0.9rem; font-family: inherit; }
.inline-form { display: flex; gap: 0.75rem; align-items: center; padding: 1rem 1.5rem; flex-wrap: wrap; }

/* FORMS */
.admin-form { padding: 1.5rem; }
.admin-form .form-group { margin-bottom: 1.25rem; }
.admin-form label { display: block; font-size: 0.85rem; font-weight: 500; color: #444; margin-bottom: 0.4rem; }
.admin-form input, .admin-form select, .admin-form textarea {
    width: 100%; padding: 0.7rem 1rem; border: 1.5px solid #e0e0e0; border-radius: 8px;
    font-size: 0.9rem; font-family: inherit; transition: border-color var(--t);
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { outline: none; border-color: var(--vf); }
.admin-form textarea { resize: vertical; min-height: 80px; }
.content-editor { min-height: 300px; font-family: 'Inter', monospace; }

/* GALLERY */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; padding: 1.5rem; }
.gallery-item { border-radius: 8px; overflow: hidden; position: relative; aspect-ratio: 1; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item-actions { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.7); padding: 0.5rem; display: flex; align-items: center; justify-content: space-between; }
.gallery-item-actions span { color: var(--bl); font-size: 0.75rem; }
.albums-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.25rem; padding: 1.5rem; }
.album-card { border: 1px solid #e8e8e8; border-radius: var(--r); overflow: hidden; transition: all var(--t); }
.album-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.album-cover { background: linear-gradient(135deg, var(--vf), var(--vm)); padding: 2rem; text-align: center; color: var(--bl); }
.album-cover i { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.album-count { font-size: 0.8rem; opacity: 0.8; }
.album-info { padding: 1rem; }
.album-info h4 { font-size: 0.95rem; margin-bottom: 0.25rem; }
.album-info p { font-size: 0.8rem; color: var(--g3); margin-bottom: 0.75rem; }
.album-actions { display: flex; gap: 0.5rem; }
.upload-form { padding: 1.5rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid #f0f0f0; }
.upload-zone { display: flex; align-items: center; gap: 0.75rem; color: var(--g2); }
.upload-zone i { font-size: 1.5rem; color: var(--vf); }

/* ORG DETAIL */
.org-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; padding: 1.5rem 0; }
.info-item { display: flex; flex-direction: column; gap: 0.25rem; }
.info-item strong { font-size: 0.8rem; color: var(--g3); text-transform: uppercase; letter-spacing: 0.5px; }
.info-item span { font-size: 0.95rem; }
.org-description { padding: 1rem 0; border-top: 1px solid #f0f0f0; margin-top: 1rem; }
.org-description p { color: var(--g2); margin-top: 0.5rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-btn { display: block; }
    .topbar { padding: 1rem; }
    .content { padding: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .welcome-banner { flex-direction: column; text-align: center; gap: 1rem; }
    .auth-card { padding: 1.5rem; }
}
