/* ========================================
   Vinkje - Vogelspotting App
   ======================================== */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    transition: background-color 0.3s, color 0.3s;
}

/* === Thema's === */

/* Natuur/Groen */
.theme-nature {
    --primary: #2d6a4f;
    --primary-dark: #1b4332;
    --primary-light: #40916c;
    --accent: #95d5b2;
    --accent-light: #d8f3dc;
    --bg: #f0f7f4;
    --bg-card: #ffffff;
    --bg-nav: #1b4332;
    --text: #1b1b1b;
    --text-light: #6b7280;
    --text-nav: #ffffff;
    --border: #d1e7dd;
    --danger: #dc3545;
    --danger-light: #f8d7da;
    --success: #198754;
    --success-light: #d1e7dd;
    --shadow: rgba(45, 106, 79, 0.1);
    --input-bg: #ffffff;
    --input-border: #ced4da;
}

/* IJsvogel - Blauw/Oranje */
.theme-kingfisher {
    --primary: #1b4965;
    --primary-dark: #0f2d40;
    --primary-light: #2a6f97;
    --accent: #e07a3a;
    --accent-light: #fde8d0;
    --bg: #f0f4f8;
    --bg-card: #ffffff;
    --bg-nav: #0f2d40;
    --text: #1b1b1b;
    --text-light: #6b7280;
    --text-nav: #ffffff;
    --border: #c9d6df;
    --danger: #dc3545;
    --danger-light: #f8d7da;
    --success: #198754;
    --success-light: #d1e7dd;
    --shadow: rgba(27, 73, 101, 0.1);
    --input-bg: #ffffff;
    --input-border: #ced4da;
}

/* Minimalistisch */
.theme-minimal {
    --primary: #333333;
    --primary-dark: #1a1a1a;
    --primary-light: #555555;
    --accent: #888888;
    --accent-light: #f0f0f0;
    --bg: #fafafa;
    --bg-card: #ffffff;
    --bg-nav: #1a1a1a;
    --text: #1a1a1a;
    --text-light: #888888;
    --text-nav: #ffffff;
    --border: #e0e0e0;
    --danger: #dc3545;
    --danger-light: #f8d7da;
    --success: #198754;
    --success-light: #d1e7dd;
    --shadow: rgba(0, 0, 0, 0.08);
    --input-bg: #ffffff;
    --input-border: #d0d0d0;
}

/* === Navbar === */
.navbar {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    height: 56px;
    background: var(--bg-nav);
    color: var(--text-nav);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px var(--shadow);
}

a.navbar-brand,
a.navbar-brand:link,
a.navbar-brand:hover,
a.navbar-brand:active,
a.navbar-brand:visited {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1.5rem;
    flex-shrink: 0;
    text-decoration: none !important;
    color: inherit;
}

.navbar-logo {
    width: 32px;
    height: 32px;
}

.navbar-title {
    font-weight: 700;
    font-size: 1.2rem;
}

.navbar-menu {
    display: flex;
    gap: 0.25rem;
    flex: 1;
    overflow-x: auto;
}

.nav-link {
    color: var(--text-nav);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-link:hover { background: rgba(255,255,255,0.15); }
.nav-link.active { background: rgba(255,255,255,0.25); font-weight: 600; }

.nav-icon { font-size: 1rem; }

.mobile-logout { display: none; }

.navbar-logout {
    background: rgba(255,255,255,0.15);
    color: var(--text-nav);
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.navbar-logout:hover { background: rgba(255,255,255,0.25); }

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-nav);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: auto;
}

/* Mobile nav */
@media (max-width: 768px) {
    .navbar-toggle { display: block; }
    .navbar-logout { display: none; }

    .navbar-menu {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg-nav);
        flex-direction: column;
        padding: 0.5rem;
        box-shadow: 0 4px 12px var(--shadow);
    }

    .navbar-menu.open { display: flex; }

    .navbar-menu .mobile-logout {
        display: none;
    }

    .navbar-menu.open .mobile-logout {
        display: block;
        background: none;
        border: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 0.25rem;
        padding: 0.75rem 0.75rem 0.5rem;
        color: var(--text-nav);
        opacity: 0.7;
        cursor: pointer;
        font-size: 0.95rem;
        text-align: left;
        width: 100%;
    }

    .navbar-menu.open .mobile-logout:hover {
        opacity: 1;
    }
}

/* === Main Content === */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* === Page Header === */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* === Cards === */
.stat-card, .action-card, .sighting-form-card, .settings-section, .login-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 4px var(--shadow);
    border: 1px solid var(--border);
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* === Action Card === */
.action-card {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 2rem;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-secondary {
    background: var(--accent-light);
    color: var(--primary);
    border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--border); }

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #c82333; }

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-text {
    background: none;
    color: var(--text-light);
    border: none;
    padding: 0.5rem;
}
.btn-text:hover { color: var(--primary); }

.btn-block { width: 100%; }
.btn-large { padding: 0.75rem 1.5rem; font-size: 1.1rem; }
.btn-small { padding: 0.25rem 0.5rem; font-size: 0.8rem; }

/* === Forms === */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

input[type="text"], input[type="password"], input[type="email"],
input[type="date"], input[type="number"], select, textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text);
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

textarea { resize: vertical; }

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    min-height: 1.2rem;
    margin-bottom: 0.5rem;
}

/* === Login === */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 0.75rem;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

/* Login stappen */
.login-greeting {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.login-info {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.login-message {
    font-size: 1rem;
    color: var(--text);
    text-align: center;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.login-success-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 0.75rem;
    color: var(--success);
}

.login-error-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 0.75rem;
    color: var(--danger);
}

.login-error-text {
    color: var(--danger);
}

.login-alt {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.login-alt a {
    color: var(--primary);
    text-decoration: none;
}

.login-alt a:hover {
    text-decoration: underline;
}

.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.login-links a {
    color: var(--primary);
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

.login-method-choice {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.login-method-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.login-method-option input[type="radio"] {
    accent-color: var(--primary);
}

/* Settings info grid */
.settings-info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    align-items: center;
}

.settings-info-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
}

.settings-info-value {
    display: flex;
    align-items: center;
}

.settings-btn-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Admin tabs */
.admin-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.admin-tab {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.admin-tab:hover {
    color: var(--text);
}

.admin-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.form-control {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
}

.badge-warning {
    background: #ffc107;
    color: #1b1b1b;
}

/* Handmatige locatie badge */
.location-manual-badge {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--text-light);
    opacity: 0.7;
    cursor: default;
    margin-left: 0.15rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* === Section === */
.section {
    margin-bottom: 1.5rem;
}

.section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

/* === Sighting List === */
.sighting-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sighting-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.sighting-bird {
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sighting-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    align-items: center;
    flex-shrink: 0;
}

.sighting-time {
    width: 3.2rem;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.sighting-location {
    width: 16rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

/* "Alle waarnemingen": gebruikersnaam op vaste breedte voor uitlijning */
.sighting-item.sighting-show-user .sighting-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    width: 7rem;
    flex-shrink: 0;
}

.sighting-username {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* "Mijn waarnemingen": geen gebruikerskolom */
.sighting-item:not(.sighting-show-user) .sighting-user {
    display: none;
}

/* Soorten-weergave */
.sighting-meta-species .sighting-time {
    width: auto;
    white-space: nowrap;
}

.sighting-meta-species .sighting-location {
    width: auto;
    flex: 1;
    text-align: right;
}

.sighting-day-header {
    font-weight: 600;
    color: var(--primary);
    padding: 0.75rem 0 0.25rem;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
}

/* === Search === */
.search-wrapper {
    position: relative;
}

.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 4px 12px var(--shadow);
}

.search-result-item {
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.search-result-item:hover { background: var(--accent-light); }

/* === Selected Bird === */
.selected-bird {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--accent-light);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.selected-bird-name {
    flex: 1;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
}

/* === Top 10 === */
.top10-section {
    margin: 1rem 0;
}

.top10-section h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.top10-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.top10-btn {
    padding: 0.4rem 0.75rem;
    background: var(--accent-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--primary);
    transition: all 0.2s;
}

.top10-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* === Location === */
.location-section {
    margin: 1rem 0;
}

.location-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--accent-light);
    color: var(--text);
}

.location-loading { opacity: 0.6; }
.location-success { color: var(--success); }
.location-error { color: var(--danger); background: var(--danger-light); }

.map-search-wrapper {
    position: relative;
    margin-bottom: 0.5rem;
}

.map-search-wrapper input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--bg-card);
    color: var(--text);
}

.map-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}

.map-search-results .search-result-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.map-search-results .search-result-item:last-child {
    border-bottom: none;
}

.map-search-results .search-result-item:hover {
    background: var(--accent-light);
}

.location-map {
    height: 250px;
    border-radius: 8px;
    margin-top: 0.75rem;
    border: 1px solid var(--border);
    z-index: 0;
}

.location-gps-btn {
    margin-top: 0.5rem;
}

/* === Datum/Tijd inline === */
.datetime-section {
    margin: 1rem 0;
}

.form-inline {
    display: flex;
    gap: 1rem;
}

.form-inline .form-field {
    flex: 1;
}

.form-inline .form-field input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--bg-card);
    color: var(--text);
}

/* === Filter Bar === */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.filter-group {
    flex: 1;
    min-width: 120px;
    position: relative;
}

.filter-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.filter-group input, .filter-group select {
    font-size: 0.9rem;
    padding: 0.5rem;
}

/* === Pagination === */
.pagination {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* === Admin Table === */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th, .admin-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    background: var(--accent-light);
    font-weight: 600;
    color: var(--primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.admin-table tr:hover { background: var(--accent-light); }

.row-inactive { opacity: 0.5; }

.actions-cell {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

/* === Badge === */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }

/* === Modal === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.modal-wide { max-width: 700px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 1.2rem; color: var(--primary); }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.25rem;
}

.modal-content form, .modal-content > div:not(.modal-header):not(.modal-footer) {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

/* === Sighting Detail Modal === */
.modal-detail { max-width: 800px; }

.detail-section {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.detail-section:last-child { border-bottom: none; }

.detail-scientific {
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.detail-category {
    display: inline-block;
    background: var(--bg-input);
    color: var(--text-light);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.detail-description {
    line-height: 1.6;
    margin: 0.5rem 0;
    color: var(--text);
}

.detail-wiki-link {
    display: inline-block;
    color: var(--primary);
    font-size: 0.85rem;
    text-decoration: none;
    margin-top: 0.25rem;
}
.detail-wiki-link:hover { text-decoration: underline; }

.detail-photo {
    text-align: center;
    padding: 0.75rem 1.25rem;
    background: var(--bg-input);
}

.detail-bird-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    object-fit: contain;
}

.detail-meta-section {
    font-size: 0.9rem;
}

.detail-meta-row {
    padding: 0.3rem 0;
}

.detail-notes-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-notes-view {
    display: block;
    white-space: pre-wrap;
    line-height: 1.5;
}

.detail-notes-updated {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    font-style: italic;
}

.detail-notes-edit-btn {
    align-self: flex-start;
    margin-top: 0.25rem;
    opacity: 0.7;
}

.detail-notes-edit {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.detail-notes-textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.detail-notes-actions {
    display: flex;
    gap: 0.5rem;
}

.detail-map-section {
    padding: 0.75rem 1.25rem;
}

.detail-map {
    height: 250px;
    border-radius: 8px;
    z-index: 0;
}

.sighting-item[onclick] {
    cursor: pointer;
    transition: background 0.15s;
}
.sighting-item[onclick]:hover {
    background: var(--bg-input);
}

@media (max-width: 600px) {
    .modal-detail { max-width: 100%; }
    .detail-bird-image { max-height: 200px; }
    .detail-map { height: 200px; }
    .location-map { height: 200px; }
}

/* === Permissions === */
.perm-category {
    margin-bottom: 1.5rem;
}

.perm-category h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.perm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    gap: 0.75rem;
}

.perm-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.perm-info strong { font-size: 0.85rem; }
.perm-info .text-muted { font-size: 0.8rem; }

.perm-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.perm-control select {
    width: auto;
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
}

.perm-role-default { font-size: 0.75rem; }

/* === Settings === */
.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section h2 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* === Theme Selector === */
.theme-selector {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.theme-option {
    cursor: pointer;
    text-align: center;
}

.theme-option input[type="radio"] {
    display: none;
}

.theme-preview {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid var(--border);
    overflow: hidden;
    margin-bottom: 0.35rem;
    transition: border-color 0.2s;
}

.theme-option input:checked + .theme-preview {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--accent);
}

.theme-preview-header { height: 15px; }
.theme-preview-body { height: 45px; }

.theme-preview-nature .theme-preview-header { background: #1b4332; }
.theme-preview-nature .theme-preview-body { background: #f0f7f4; }

.theme-preview-kingfisher .theme-preview-header { background: #0f2d40; }
.theme-preview-kingfisher .theme-preview-body { background: #f0f4f8; }

.theme-preview-minimal .theme-preview-header { background: #1a1a1a; }
.theme-preview-minimal .theme-preview-body { background: #fafafa; }

.theme-option span {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 300;
    transition: bottom 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-show { bottom: 80px; }
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }

/* === Utilities === */
.text-muted { color: var(--text-light); }

/* === Responsive === */
@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .stat-number { font-size: 1.5rem; }

    .admin-table { font-size: 0.8rem; }
    .admin-table th, .admin-table td { padding: 0.4rem 0.5rem; }

    .filter-bar { flex-direction: column; }
    .filter-group { min-width: unset; }

    .sighting-item { flex-wrap: wrap; }
    .sighting-meta { flex-basis: 100%; }
    .sighting-location { width: 10rem; }

    .perm-item { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
    .main-content { padding: 1rem 0.75rem; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* === Feedback FAB === */
.feedback-fab {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feedback-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* === Feedback Modal === */
.modal-feedback {
    max-width: 480px;
}

.feedback-type-btns {
    display: flex;
    gap: 0.75rem;
}

.feedback-type-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border) !important;
    transition: border-color 0.2s, background 0.2s;
}

.feedback-type-btn.active {
    border-color: var(--primary) !important;
    background: var(--accent-light);
    color: var(--primary-dark);
    font-weight: 600;
}

/* === Wishlist === */
.wishlist-heart,
.wishlist-heart-btn {
    color: #e74c3c;
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
}

.wishlist-heart-btn {
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: transform 0.2s;
}

.wishlist-heart-btn:hover {
    transform: scale(1.3);
}

.wishlist-heart-btn.active,
.wishlist-heart.active {
    color: #e74c3c;
}

.wishlist-heart-btn:not(.active) {
    color: var(--text-light);
}

.wishlist-item {
    display: flex;
    align-items: center;
}

.wishlist-item .sighting-bird {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wishlist-remove-btn {
    font-size: 1.2rem;
    color: var(--text-light) !important;
    padding: 0.1rem 0.4rem !important;
}

.wishlist-remove-btn:hover {
    color: var(--danger) !important;
}

.wishlist-alert-item {
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid #e74c3c;
}

.wishlist-alert-item:hover {
    background: var(--accent-light);
}

.wishlist-alert-icon {
    margin-right: 0.25rem;
}

.wishlist-on-list {
    opacity: 0.5;
    cursor: default;
}

/* === History Toggle === */
.history-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.history-toggle-btn {
    flex: 1;
    border-radius: 0;
    border: none;
    background: var(--bg-card);
    color: var(--text-light);
    padding: 0.6rem 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.history-toggle-btn.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 -3px 0 var(--primary-dark);
}

.history-toggle-btn:not(.active):hover {
    background: var(--accent-light);
    color: var(--primary);
}

.sighting-user {
    font-weight: 500;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.sighting-avatar {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
    flex-shrink: 0;
}

/* Clickable stat cards */
.stat-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.stat-card-link:active {
    transform: translateY(0);
}

.sighting-other {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
}

.sighting-other .sighting-user {
    color: var(--primary-light);
}

/* === Species List === */
.species-summary {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.species-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.species-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
}

.species-header:hover {
    background: var(--accent-light);
}

.species-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.species-name {
    font-weight: 600;
    color: var(--text);
}

.species-scientific {
    font-style: italic;
    font-size: 0.8rem;
    color: var(--text-light);
}

.species-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.species-count {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.species-last {
    font-size: 0.8rem;
    color: var(--text-light);
}

.species-toggle {
    font-size: 0.65rem;
    color: var(--text-light);
    transition: transform 0.2s;
}

.species-group.open .species-toggle {
    transform: rotate(180deg);
}

.species-sightings {
    display: none;
    border-top: 1px solid var(--border);
    padding: 0.25rem 0.75rem;
}

.species-group.open .species-sightings {
    display: block;
}

.species-sightings .sighting-item {
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 0.5rem 0;
}

.species-sightings .sighting-item:last-child {
    border-bottom: none;
}

@media (max-width: 600px) {
    .species-stats {
        gap: 0.5rem;
    }

    .species-last {
        display: none;
    }
}

/* === About / Over pagina === */
.about-header-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 4px var(--shadow);
    border: 1px solid var(--border);
}

.about-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.about-app-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.about-version-badge {
    text-align: right;
}

.about-version-badge .badge {
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
}

.about-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.about-feature-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 4px var(--shadow);
    border: 1px solid var(--border);
}

.about-feature-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.about-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent-light);
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
}

.about-feature-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.about-feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.about-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.about-check {
    color: var(--success);
    font-size: 0.75rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

/* Release notes */
.about-releases {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.about-release {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.about-release-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    transition: background 0.15s;
}

.about-release-header:hover {
    background: var(--accent-light);
}

.about-release-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.about-release-version {
    font-family: monospace;
    font-weight: 600;
    font-size: 0.95rem;
}

.about-release-toggle {
    font-size: 0.7rem;
    color: var(--text-light);
    transition: transform 0.2s;
}

.about-release.open .about-release-toggle {
    transform: rotate(180deg);
}

.about-release-body {
    display: none;
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--border);
}

.about-release.open .about-release-body {
    display: block;
}

.about-release-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.about-release-body h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: 0.75rem;
    margin-bottom: 0.35rem;
}

.about-release-body ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.about-release-body ul li {
    font-size: 0.85rem;
    color: var(--text-light);
    padding-left: 1rem;
    position: relative;
}

.about-release-body ul li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* Navbar versie */
.navbar-version {
    font-size: 0.7rem;
    opacity: 0.5;
    margin-left: 0.25rem;
    font-weight: 400;
}

@media (max-width: 600px) {
    .about-features-grid {
        grid-template-columns: 1fr;
    }

    .about-header-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .about-version-badge {
        text-align: left;
    }
}

/* ===================== Admin gebruikerslijst ===================== */
.admin-user-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
}

.admin-user-row:hover {
    border-color: var(--primary-light);
}

.admin-user-row.expanded {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.admin-user-inactive {
    opacity: 0.6;
}

.admin-user-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    gap: 1rem;
}

.admin-user-identity {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
    min-width: 0;
}

.admin-user-name {
    font-weight: 600;
}

.admin-user-username,
.admin-user-email {
    font-size: 0.82rem;
}

.admin-user-badges {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.admin-user-chevron {
    font-size: 1.2rem;
    color: var(--text-light);
    line-height: 1;
    transition: transform 0.2s;
    display: inline-block;
    margin-left: 0.25rem;
}

.admin-user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-page);
}

/* ===================== Toggle switch ===================== */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 2.5rem;
    height: 1.4rem;
    background: var(--border);
    border-radius: 999px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.1rem;
    height: 1.1rem;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-label input:checked + .toggle-switch {
    background: var(--primary);
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(1.1rem);
}

.toggle-label input:disabled + .toggle-switch {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ===================== E-mail template editor ===================== */
.admin-template-vars {
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.875rem;
}

.template-vars-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 1rem;
    margin-top: 0.6rem;
    align-items: baseline;
}

.template-vars-grid code {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-size: 0.82rem;
    white-space: nowrap;
    color: var(--primary);
}

.template-body-editor {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    resize: vertical;
}

/* ===================== Avatar picker ===================== */
.avatar-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, 3.2rem);
    gap: 0.4rem;
    max-height: 20rem;
    overflow-y: auto;
    padding: 0.25rem;
}

.avatar-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    background: var(--bg-page);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    padding: 0.25rem;
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.avatar-option:hover {
    border-color: var(--primary-light);
    background: var(--accent-light);
}

.avatar-option.selected {
    border-color: var(--primary);
    background: var(--accent-light);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.avatar-option img {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
}

/* Navbar avatar */
.navbar-avatar-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.navbar-avatar-img {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid var(--primary-light);
    background: var(--bg-card);
    padding: 0.15rem;
    object-fit: contain;
    transition: border-color 0.15s;
}

.navbar-avatar-img:hover {
    border-color: var(--accent);
}
