/* =====================================================
   Scouts SIK Gent - Admin Dashboard CSS
   ===================================================== */

:root {
    --admin-bg: #f5f6f4;
    --admin-card: #ffffff;
    --admin-border: #e3e6e0;
    --admin-text: #1a1f1a;
    --admin-muted: #6a716a;
    --admin-primary: #4a7c2e;
    --admin-primary-dark: #2d5a1d;
    --admin-accent: #e8761c;
    --admin-danger: #c84a3f;
    --admin-success: #5a9d35;
    --admin-warning: #f5c542;
    --sidebar-bg: #1f3a1f;
    --sidebar-active: #4a7c2e;
}

* { box-sizing: border-box; }

body.admin {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    line-height: 1.5;
}

/* Login screen */
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(31,58,31,.95), rgba(74,124,46,.85)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M0 60 L20 30 L40 50 L55 25 L80 60 L80 80 L0 80 Z' fill='%23ffffff' opacity='.05'/%3E%3C/svg%3E");
    background-size: cover, 200px;
    padding: 20px;
}
.login-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    max-width: 420px;
    width: 100%;
}
.login-card h1 {
    margin: 0 0 8px;
    font-family: 'Fraunces', serif;
    color: var(--admin-primary-dark);
}
.login-card .subtitle { color: var(--admin-muted); margin-bottom: 24px; }
.login-card .logo-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 12px;
}

/* Layout */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--sidebar-bg);
    color: rgba(255,255,255,.85);
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: 16px;
}
.sidebar-brand a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Fraunces', serif;
    font-size: 1.1rem;
    font-weight: 700;
}
.sidebar-brand small { display: block; font-size: .75rem; font-weight: 400; opacity: .6; }

.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav .nav-section {
    padding: 16px 24px 6px;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    opacity: .5;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    transition: all .15s;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: white; }
.sidebar-nav a.active {
    background: rgba(74,124,46,.3);
    color: white;
    border-left-color: var(--admin-accent);
}
.sidebar-nav .icon { font-size: 1.05rem; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,.1);
    margin-top: 16px;
    font-size: .85rem;
}

/* Main content */
.admin-main { padding: 28px; max-width: 100%; overflow-x: auto; }
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.admin-topbar h1 {
    margin: 0;
    font-family: 'Fraunces', serif;
    font-size: 1.8rem;
    color: var(--admin-primary-dark);
}
.admin-topbar .breadcrumb {
    font-size: .85rem;
    color: var(--admin-muted);
    margin-bottom: 4px;
}

/* Cards */
.card {
    background: var(--admin-card);
    border-radius: 14px;
    padding: 24px;
    border: 1px solid var(--admin-border);
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--admin-border);
}
.card-header h2, .card-header h3 { margin: 0; font-family: 'Fraunces', serif; }

/* Stats grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-tile {
    background: var(--admin-card);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--admin-border);
    border-left: 4px solid var(--admin-primary);
}
.stat-tile .label {
    font-size: .8rem;
    color: var(--admin-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}
.stat-tile .num {
    font-family: 'Fraunces', serif;
    font-size: 2rem;
    color: var(--admin-primary-dark);
    font-weight: 700;
    margin-top: 4px;
}
.stat-tile.accent { border-left-color: var(--admin-accent); }
.stat-tile.success { border-left-color: var(--admin-success); }
.stat-tile.warning { border-left-color: var(--admin-warning); }
.stat-tile.danger { border-left-color: var(--admin-danger); }

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 14px;
    overflow: hidden;
}
.table th, .table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}
.table th {
    background: #f0f4ec;
    font-weight: 600;
    color: var(--admin-primary-dark);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafbf9; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: .9rem;
    text-decoration: none;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all .15s;
}
.btn-primary { background: var(--admin-primary); color: white; }
.btn-primary:hover { background: var(--admin-primary-dark); color: white; }
.btn-secondary { background: var(--admin-accent); color: white; }
.btn-danger { background: var(--admin-danger); color: white; }
.btn-outline { background: transparent; color: var(--admin-primary); border-color: var(--admin-primary); }
.btn-outline:hover { background: var(--admin-primary); color: white; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-icon { padding: 6px 10px; }

/* Forms */
.form { display: grid; gap: 16px; }
.form-group { display: grid; gap: 6px; }
.form-group label { font-weight: 500; font-size: .9rem; color: var(--admin-text); }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--admin-border);
    border-radius: 8px;
    font: inherit;
    background: white;
    transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 0;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(74,124,46,.15);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-checkbox { display: flex; align-items: center; gap: 8px; }
.form-checkbox input { width: auto; }

/* Flash */
.flash {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: .92rem;
}
.flash-success { background: #d4f1c0; color: #2d5a0c; }
.flash-error { background: #f4d0cd; color: #84221b; }
.flash-info { background: #d6e9f7; color: #1c4a73; }
.flash-warning { background: #fbe7be; color: #7a5410; }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-success { background: #d4f1c0; color: #2d5a0c; }
.badge-danger { background: #f4d0cd; color: #84221b; }
.badge-warning { background: #fbe7be; color: #7a5410; }
.badge-info { background: #d6e9f7; color: #1c4a73; }
.badge-muted { background: #e8e9e5; color: #4a4f4a; }

/* Action group in tables */
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Empty state */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--admin-muted);
}
.empty .icon { font-size: 2.5rem; margin-bottom: 10px; }

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--admin-border);
    margin-bottom: 24px;
    overflow-x: auto;
}
.tabs a {
    padding: 12px 20px;
    color: var(--admin-muted);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}
.tabs a.active { color: var(--admin-primary); border-bottom-color: var(--admin-primary); }
.tabs a:hover { color: var(--admin-primary); }

/* Responsive */
.mobile-toggle {
    display: none;
    background: var(--admin-primary);
    color: white;
    border: 0;
    width: 44px; height: 44px;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
}

@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        width: 260px;
        z-index: 100;
        transition: left .3s;
    }
    body.sidebar-open .sidebar { left: 0; }
    .mobile-toggle { display: inline-flex; }
    .form-row { grid-template-columns: 1fr; }
}

/* Photo thumbs */
.photo-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-thumbs .thumb {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #eee;
}
.photo-thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumbs .thumb form { position: absolute; top: 4px; right: 4px; }
.photo-thumbs .thumb button {
    background: rgba(200, 74, 63, .9);
    color: white;
    border: 0;
    width: 24px; height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: .8rem;
}

/* Activity log items */
.log-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.log-item:last-child { border-bottom: 0; }
.log-time { color: var(--admin-muted); font-size: .85rem; }
