/* SiteHunt — design-system inspireret af WeHunt (2026)
   Mørk som standard, lys via [data-bs-theme="light"]. Tokens først, komponenter efter. */

:root,
[data-bs-theme="dark"] {
    --bg:            #0F1110;
    --surface:       #1C201E;
    --surface-2:     #242926;
    --surface-3:     #2E3430;
    --inset:         #0F1110;
    --line:          rgba(230, 232, 230, 0.10);
    --line-strong:   rgba(230, 232, 230, 0.18);
    --text:          #E6E8E6;
    --text-muted:    #8E9490;
    --text-faint:    #6B716D;

    --forest:        #243E31;   /* sidebar */
    --forest-2:      #2D4B3C;
    --sage:          #9FCAB2;   /* primær accent */
    --sage-ink:      #1B3126;   /* tekst på sage */
    --sage-soft:     rgba(159, 202, 178, 0.14);
    --cream:         #EEF1E6;   /* aktiv nav-pille */
    --cream-ink:     #2A2F1F;
    --wheat:         #CDD3A3;   /* sekundær accent (WeHunt-topbar) */

    --good:          #7FC69A;
    --warn:          #E3B15E;
    --bad:           #E07B6A;
    --info:          #86B6D8;

    --radius:        8px;
    --radius-lg:     12px;
    --sidebar-width: 264px;

    --font-sans:  "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;

    /* Bootstrap-bro */
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-secondary-color: var(--text-muted);
    --bs-tertiary-bg: var(--surface-2);
    --bs-secondary-bg: var(--surface-2);
    --bs-border-color: var(--line);
    --bs-emphasis-color: #fff;
    --bs-link-color: var(--sage);
    --bs-link-color-rgb: 159, 202, 178;
    --bs-link-hover-color: #C3E0CF;
    --bs-link-hover-color-rgb: 195, 224, 207;
    --bs-font-sans-serif: var(--font-sans);
    --bs-card-bg: var(--surface);
    --bs-primary: #9FCAB2;
    --bs-primary-rgb: 159, 202, 178;
    --bs-success-rgb: 127, 198, 154;
    --bs-light-rgb: 36, 41, 38;
    --bs-white-rgb: 28, 32, 30;
    --bs-dark-rgb: 230, 232, 230;

    /* Gamle navne bevares, så eksisterende templates virker */
    --sidebar-bg: var(--forest);
    --sidebar-hover: var(--forest-2);
    --sidebar-active: var(--cream);
    --sidebar-text: #E6E8E6;
    --sidebar-muted: #9DB0A5;
    --accent-orange: var(--sage);
    --accent-orange-hover: #B6D8C5;
    --body-bg: var(--bg);
    --card-bg: var(--surface);
    --text-dark: var(--text);
    --border-color: var(--line);
    --success-green: var(--good);
    --danger-red: var(--bad);
    --info-blue: var(--info);
}

[data-bs-theme="light"] {
    --bg:          #F4F5F0;
    --surface:     #FFFFFF;
    --surface-2:   #F0F2EC;
    --surface-3:   #E5E9E1;
    --inset:       #F0F2EC;
    --line:        rgba(27, 49, 38, 0.10);
    --line-strong: rgba(27, 49, 38, 0.18);
    --text:        #1C2320;
    --text-muted:  #5F6A64;
    --text-faint:  #87918B;
    --sage:        #3F7A5B;
    --sage-ink:    #FFFFFF;
    --sage-soft:   rgba(63, 122, 91, 0.10);
    --good:        #2F8A55;
    --warn:        #B5781C;
    --bad:         #C0503E;
    --info:        #3B78A8;

    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-secondary-color: var(--text-muted);
    --bs-tertiary-bg: var(--surface-2);
    --bs-secondary-bg: var(--surface-2);
    --bs-border-color: var(--line);
    --bs-emphasis-color: #000;
    --bs-link-color: var(--sage);
    --bs-link-color-rgb: 63, 122, 91;
    --bs-link-hover-color: #2E5C44;
    --bs-link-hover-color-rgb: 46, 92, 68;
    --bs-card-bg: var(--surface);
    --bs-primary: #3F7A5B;
    --bs-primary-rgb: 63, 122, 91;
    --bs-success-rgb: 47, 138, 85;
    --bs-light-rgb: 240, 242, 236;
    --bs-white-rgb: 255, 255, 255;
    --bs-dark-rgb: 28, 35, 32;
    --accent-orange-hover: #2E5C44;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    font-size: 14px;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .h1, .h2, .h3, .page-title, .display-font {
    font-family: var(--font-serif);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text);
}
h4, h5, h6, .h4, .h5, .h6 { font-weight: 600; color: var(--text); }
h1, .h1 { font-size: 2rem; }
h2, .h2 { font-size: 1.6rem; }
.text-muted, .text-secondary { color: var(--text-muted) !important; }
.text-dark { color: var(--text) !important; }
a { color: var(--sage); }
.tabular, .stat-value, .table td { font-variant-numeric: tabular-nums; }

/* ============ SIDEBAR (flydende panel à la WeHunt) ============ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--forest);
    color: var(--sidebar-text);
    position: fixed;
    top: 16px; left: 16px; bottom: 16px;
    border-radius: var(--radius);
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    display: flex; align-items: center; gap: 0.7rem;
}
.sidebar-brand-logo { width: 34px; height: 34px; }
.sidebar-brand-text {
    font-family: var(--font-serif);
    font-size: 1.55rem;
    color: var(--wheat);
    letter-spacing: -0.01em;
    line-height: 1;
}

.sidebar-season-selector { padding: 0 1rem 0.75rem; }
.sidebar-season-label {
    display: block;
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--sidebar-muted);
    margin: 0 0 0.4rem 0.25rem;
}
.sidebar-season-label i { margin-right: 4px; }
.sidebar-season-dropdown {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    background-color: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    color: #fff; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239DB0A5' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}
.sidebar-season-dropdown:hover { border-color: rgba(255,255,255,0.25); }
.sidebar-season-dropdown:focus { outline: 2px solid var(--wheat); outline-offset: 1px; }
.sidebar-season-dropdown option { background: var(--forest); color: #fff; }

.sidebar-menu { padding: 0.25rem 0 0.5rem; flex: 1; }
.sidebar-section { margin-bottom: 0.35rem; }
.sidebar-section-title {
    padding: 0.7rem 1.4rem 0.35rem;
    font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--sidebar-muted);
}
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav-item { margin: 1px 12px; }
.sidebar-nav-link {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.55rem 0.8rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px; font-weight: 600;
    transition: background-color .15s ease, color .15s ease;
}
.sidebar-nav-link:hover { background-color: var(--forest-2); color: #fff; }
.sidebar-nav-link.active {
    background-color: var(--cream);
    color: var(--cream-ink);
    font-weight: 700;
}
.sidebar-nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar-nav-link .nav-count {
    margin-left: auto;
    min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 999px;
    background: var(--sage); color: var(--sage-ink);
    font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-nav-link.active .nav-count { background: var(--forest); color: var(--cream); }

.sidebar-submenu { list-style: none; padding: 0; margin: 0 0 0 2.5rem; }
.sidebar-submenu .sidebar-nav-link { padding: 0.4rem 0.75rem; font-size: 13px; }

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: auto 0.5rem 0;
}
.theme-toggle {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.5rem 0.8rem; margin-bottom: 0.25rem;
    color: var(--sidebar-text); font-weight: 600; font-size: 14px;
    background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.theme-toggle .switch {
    margin-left: auto; width: 44px; height: 24px; border-radius: 999px;
    background: rgba(0,0,0,.25); position: relative; transition: background .2s;
}
.theme-toggle .switch::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--cream); transition: transform .2s;
}
[data-bs-theme="light"] .theme-toggle .switch { background: var(--sage); }
[data-bs-theme="light"] .theme-toggle .switch::after { transform: translateX(20px); }

.sidebar-logout-form { margin: 0.25rem 0 0; }
.sidebar-logout { color: var(--sidebar-muted); font-weight: 500; margin-bottom: 0; }
.sidebar-logout:hover { color: var(--sidebar-text); }

.sidebar-profile {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.5rem; border-radius: 6px;
    transition: background-color .15s;
}
.sidebar-profile:hover { background-color: var(--forest-2); }
.sidebar-profile-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    object-fit: cover; background-color: var(--forest-2);
    display: flex; align-items: center; justify-content: center;
}
.sidebar-profile-avatar i { color: var(--sidebar-muted); }
.sidebar-profile-info { flex: 1; min-width: 0; }
.sidebar-profile-name {
    font-size: 13px; font-weight: 600; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-profile-role { font-size: 11px; color: var(--sidebar-muted); }

/* ============ MAIN ============ */
.main-content {
    margin-left: calc(var(--sidebar-width) + 32px);
    flex: 1; min-width: 0; min-height: 100vh;
    display: flex; flex-direction: column;
}
.content-wrapper { flex: 1; padding: 1.75rem 2rem 2rem 0.5rem; max-width: 1480px; width: 100%; }

.page-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 1rem; flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.page-title { font-size: 2rem; margin: 0; line-height: 1.15; }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 0.3rem; }
.eyebrow {
    font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--text-muted);
}

/* ============ CARDS ============ */
.card {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: none;
}
.card-header, .card-footer {
    background: transparent;
    border-color: var(--line);
    padding: 0.9rem 1.25rem;
    font-weight: 600; font-size: 14px;
    color: var(--text);
}
.card-header h5, .card-header h6 { margin: 0; font-size: 15px; }
.card-body { padding: 1.25rem; }
.card-title { font-weight: 600; }
.card.bg-primary, .card.bg-success, .card.bg-info, .card.bg-warning, .card.bg-danger { border: 0; }

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}
.stat-value {
    font-family: var(--font-serif);
    font-size: 2.2rem; font-weight: 400;
    color: var(--text); line-height: 1;
}
.stat-label {
    font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Inset-felter (som "Næste jagt"-rækken i WeHunt) */
.inset {
    background: var(--inset);
    border-radius: 6px;
    padding: 0.55rem 0.8rem;
    color: var(--text-muted);
    font-size: 12px;
}

/* ============ BUTTONS ============ */
.btn { border-radius: var(--radius); font-weight: 600; font-size: 14px; }
.btn-primary, .btn-success {
    --bs-btn-bg: var(--sage); --bs-btn-border-color: var(--sage); --bs-btn-color: var(--sage-ink);
    --bs-btn-hover-bg: var(--accent-orange-hover); --bs-btn-hover-border-color: var(--accent-orange-hover); --bs-btn-hover-color: var(--sage-ink);
    --bs-btn-active-bg: var(--accent-orange-hover); --bs-btn-active-color: var(--sage-ink);
    --bs-btn-disabled-bg: var(--sage); --bs-btn-disabled-border-color: var(--sage); --bs-btn-disabled-color: var(--sage-ink);
}
.btn-outline-primary, .btn-outline-success {
    --bs-btn-color: var(--sage); --bs-btn-border-color: var(--sage);
    --bs-btn-hover-bg: var(--sage-soft); --bs-btn-hover-border-color: var(--sage); --bs-btn-hover-color: var(--sage);
    --bs-btn-active-bg: var(--sage-soft); --bs-btn-active-color: var(--sage);
}
.btn-outline-secondary {
    --bs-btn-color: var(--text); --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: var(--line-strong);
}
.btn-secondary, .btn-light {
    --bs-btn-bg: var(--surface-2); --bs-btn-border-color: var(--line); --bs-btn-color: var(--text);
    --bs-btn-hover-bg: var(--surface-3); --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: var(--line-strong);
}

/* ============ TABLES ============ */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--line);
    --bs-table-hover-bg: var(--sage-soft);
    --bs-table-hover-color: var(--text);
    --bs-table-striped-bg: rgba(255,255,255,0.02);
    margin-bottom: 0;
}
.table th, .table thead th {
    font-weight: 600; font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
    border-bottom-width: 1px;
}
.table td { vertical-align: middle; padding: 0.8rem 0.75rem; }
.table.table-sm td { padding: 0.35rem 0.75rem; }
.table.table-sm th { padding: 0.4rem 0.75rem; }
.table-light, .table > .table-light, thead.table-light th {
    --bs-table-bg: var(--surface-2); --bs-table-color: var(--text-muted);
}

/* ============ BADGES ============ */
.badge { font-weight: 600; padding: 0.4em 0.7em; border-radius: 999px; }
.badge.bg-success { background-color: rgba(127,198,154,.18) !important; color: var(--good) !important; }
.badge.bg-primary { background-color: var(--sage) !important; color: var(--sage-ink) !important; }
.badge.bg-secondary { background-color: var(--surface-3) !important; color: var(--text) !important; }
.badge.bg-warning { background-color: rgba(227,177,94,.18) !important; color: var(--warn) !important; }
.badge.bg-danger { background-color: rgba(224,123,106,.18) !important; color: var(--bad) !important; }
.badge.bg-info { background-color: rgba(134,182,216,.18) !important; color: var(--info) !important; }
.badge.bg-light { background-color: var(--surface-2) !important; color: var(--text) !important; }
.badge-pill-white { background: rgba(255,255,255,.92); color: #0F1F16; }

/* ============ FORMS ============ */
.form-control, .form-select {
    background-color: var(--inset);
    color: var(--text);
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    padding: 0.55rem 0.85rem;
}
.form-control::placeholder { color: var(--text-faint); }
.form-control:focus, .form-select:focus {
    background-color: var(--inset); color: var(--text);
    border-color: var(--sage);
    box-shadow: 0 0 0 3px var(--sage-soft);
}
.form-label { font-weight: 600; font-size: 13px; margin-bottom: 0.35rem; }
.form-check-input:checked { background-color: var(--sage); border-color: var(--sage); }
.input-group-text { background: var(--surface-2); color: var(--text-muted); border-color: var(--line-strong); }

/* ============ BOOTSTRAP-UTILITIES I MØRK TILSTAND ============ */
.bg-white { background-color: var(--surface) !important; }
.bg-light { background-color: var(--surface-2) !important; color: var(--text); }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--line) !important; }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-color: var(--text); --bs-list-group-border-color: var(--line);
              --bs-list-group-action-hover-bg: var(--surface-2); --bs-list-group-action-hover-color: var(--text); }
.modal-content { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.nav-tabs { --bs-nav-tabs-border-color: var(--line); --bs-nav-tabs-link-active-bg: transparent;
            --bs-nav-tabs-link-active-color: var(--sage); --bs-nav-tabs-link-active-border-color: transparent transparent var(--sage); }
.nav-tabs .nav-link { color: var(--text-muted); font-weight: 600; border-width: 0 0 2px; }
.nav-pills .nav-link.active { background: var(--cream); color: var(--cream-ink); }
.progress { background-color: var(--surface-3); border-radius: 999px; }
.progress-bar { background-color: var(--sage); }

/* ============ MAP ============ */
.map-container { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); }
#map, #location-map { border-radius: var(--radius-lg); }
[data-bs-theme="dark"] .leaflet-container { background: #1a1d1b; }

/* ============ BREADCRUMB ============ */
.breadcrumb { background: none; padding: 0; margin-bottom: 0.4rem; font-size: 12px; --bs-breadcrumb-divider-color: var(--text-faint); }
.breadcrumb-item a { color: var(--text-muted); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--sage); }
.breadcrumb-item.active { color: var(--text); font-weight: 600; }

/* ============ ALERTS ============ */
.alert { border: 1px solid var(--line); border-radius: var(--radius); }
.alert-success { background: rgba(127,198,154,.12); color: var(--good); }
.alert-info    { background: rgba(134,182,216,.12); color: var(--info); }
.alert-warning { background: rgba(227,177,94,.12);  color: var(--warn); }
.alert-danger  { background: rgba(224,123,106,.12); color: var(--bad); }

/* ============ FOOTER ============ */
.footer {
    padding: 1rem 2rem 1.5rem 0.5rem;
    font-size: 12px;
    color: var(--text-faint);
}

/* ============ ART-IKONER ============ */
.species-icon { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.species-icon-sm { width: 24px; height: 24px; }
.species-icon-lg { width: 56px; height: 56px; }

/* ============ HIT RATIO ============ */
.ratio-ring { --p: 0; --size: 132px; width: var(--size); height: var(--size); border-radius: 50%;
    background: conic-gradient(var(--sage) calc(var(--p) * 1%), var(--surface-3) 0);
    display: grid; place-items: center; }
.ratio-ring::before { content: ""; grid-area: 1/1; width: calc(var(--size) - 22px); height: calc(var(--size) - 22px);
    border-radius: 50%; background: var(--surface); }
.ratio-ring > * { grid-area: 1/1; position: relative; text-align: center; }
.ratio-ring .ratio-value { font-family: var(--font-serif); font-size: 2rem; line-height: 1; }
.ratio-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ratio-bar > span { display: block; height: 100%; background: var(--sage); border-radius: 999px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 992px) {
    :root { --sidebar-width: 76px; }
    .sidebar-brand-text, .sidebar-section-title, .sidebar-nav-link span, .sidebar-nav-link .nav-count,
    .sidebar-profile-info, .sidebar-season-selector, .theme-toggle span { display: none; }
    .sidebar-brand { justify-content: center; padding: 1rem 0.5rem; }
    .sidebar-nav-item { margin: 1px 8px; }
    .sidebar-nav-link { justify-content: center; padding: 0.7rem; }
    .sidebar-nav-link i { font-size: 1.25rem; }
    .sidebar-profile { justify-content: center; }
    .theme-toggle .switch { margin: 0 auto; }
}
@media (max-width: 768px) {
    .sidebar { top: 0; left: 0; bottom: 0; border-radius: 0; transform: translateX(-110%); transition: transform .3s ease; --sidebar-width: 264px; width: 264px; }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open .sidebar-brand-text, .sidebar.open .sidebar-section-title, .sidebar.open .sidebar-nav-link span,
    .sidebar.open .sidebar-profile-info, .sidebar.open .sidebar-season-selector, .sidebar.open .theme-toggle span { display: block; }
    .sidebar.open .sidebar-nav-link { justify-content: flex-start; }
    .main-content { margin-left: 0; }
    .content-wrapper { padding: 1rem 16px; }
    .footer { padding: 1rem 16px; }
    .mobile-header { display: flex !important; }
}
.mobile-header {
    display: none;
    background: var(--forest); color: #fff;
    padding: 0.8rem 1rem;
    align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; z-index: 900;
}
@media (max-width: 768px) { body { padding-top: 56px; } }
.mobile-header .brand { font-family: var(--font-serif); font-size: 1.3rem; color: var(--wheat); }
.mobile-menu-btn { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* ============ DIVERSE ============ */
.bi-star-fill { color: var(--warn); }
.bi-star { color: var(--text-faint); }

.profile-avatar-large {
    width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
    border: 4px solid var(--surface);
}
.profile-header {
    background: var(--forest);
    color: #fff; padding: 2rem;
    border-radius: var(--radius-lg); margin-bottom: 1.5rem;
}

.hunt-type-klapjagt     { background-color: #5E9C76 !important; color: #fff !important; }
.hunt-type-drivjagt     { background-color: #B5654F !important; color: #fff !important; }
.hunt-type-andejagt     { background-color: #4F83A8 !important; color: #fff !important; }
.hunt-type-roughshooting{ background-color: #7D857F !important; color: #fff !important; }

@media print {
    .sidebar, .footer, .btn, .mobile-header { display: none !important; }
    .main-content { margin-left: 0; }
    .card { border: 1px solid #ddd; }
}

.loading { opacity: 0.6; pointer-events: none; }

.dropdown-menu {
    --bs-dropdown-bg: var(--surface-2); --bs-dropdown-color: var(--text);
    --bs-dropdown-link-color: var(--text); --bs-dropdown-link-hover-bg: var(--surface-3); --bs-dropdown-link-hover-color: var(--text);
    --bs-dropdown-border-color: var(--line);
    border-radius: var(--radius);
}
.dropdown-item { padding: 0.5rem 1rem; font-size: 14px; }

.municipality-badge { background-color: var(--forest); color: #fff; }
.toggle-btn { cursor: pointer; padding: 0.25rem 0.5rem; border-radius: 4px; transition: background-color .15s; }
.toggle-btn:hover { background-color: var(--surface-2); }

:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }

/* ============ DÆMPEDE FARVEDE HEADERS/KNAPPER ============ */
.card-header.bg-warning, .card-header.bg-info, .card-header.bg-primary,
.card-header.bg-success, .card-header.bg-danger, .card-header.bg-dark, .card-header.bg-secondary {
    background: var(--surface-2) !important; color: var(--text) !important;
    border-bottom: 1px solid var(--line);
}
.card-header.bg-warning { box-shadow: inset 3px 0 0 var(--warn); }
.card-header.bg-info    { box-shadow: inset 3px 0 0 var(--info); }
.card-header.bg-success, .card-header.bg-primary { box-shadow: inset 3px 0 0 var(--sage); }
.card-header.bg-danger  { box-shadow: inset 3px 0 0 var(--bad); }
.card-header .text-white, .card-header.text-white { color: var(--text) !important; }
.btn-warning, .btn-info {
    --bs-btn-bg: var(--sage); --bs-btn-border-color: var(--sage); --bs-btn-color: var(--sage-ink);
    --bs-btn-hover-bg: var(--accent-orange-hover); --bs-btn-hover-border-color: var(--accent-orange-hover); --bs-btn-hover-color: var(--sage-ink);
}
.btn-outline-warning, .btn-outline-info {
    --bs-btn-color: var(--sage); --bs-btn-border-color: var(--sage);
    --bs-btn-hover-bg: var(--sage-soft); --bs-btn-hover-color: var(--sage); --bs-btn-hover-border-color: var(--sage);
}

/* ============ FORSIDE / SÆSON / HANDLINGSCENTER ============ */
.greet-date { font-size: 13px; color: var(--text-muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.panel-pad { padding: 20px 24px; }
.panel-title { font-family: var(--font-serif); font-weight: 400; font-size: 22px; margin: 0; }
.label-xs { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.hero-hunt { overflow: hidden; display: flex; flex-direction: column; }
.hero-hunt-top { min-height: 200px; background: linear-gradient(180deg, #2D4B3C 0%, #1B3126 100%); position: relative;
                 display: flex; align-items: flex-end; padding: 24px; color: #fff; }
.hero-hunt-top.has-image { background-size: cover; background-position: center; }
.hero-hunt-top.has-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.65) 100%); }
.hero-hunt-top > * { position: relative; }
.hero-hunt-top .kicker { color: #CDD3A3; }
.hero-hunt-top h2 { font-family: var(--font-serif); font-weight: 400; font-size: 32px; margin: 6px 0 0; color: #fff; }
.hero-pill { position: absolute !important; top: 16px; right: 16px; background: rgba(255,255,255,.92); color: #0F1F16;
             font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.hero-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 20px 24px; }
.hero-facts .v { font-size: 15px; font-weight: 600; margin-top: 4px; }
.row-list > .r { display: grid; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.row-list > .r:first-child { border-top: 0; }
.row-list a.r { color: var(--text); text-decoration: none; }
.row-list a.r:hover { background: var(--sage-soft); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 6px; }
.upcoming-grid { grid-template-columns: 110px minmax(0, 1fr) 200px 130px; }
.warn-text { color: var(--warn); }
.mini-stat { background: var(--inset); border-radius: 6px; padding: 10px 12px; flex: 1; }
.big-num { font-family: var(--font-serif); font-size: 40px; line-height: 1; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 260px; padding-top: 24px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: 100%; justify-content: flex-end; }
.bars .bar { width: 100%; max-width: 56px; background: #3F6150; border-radius: 4px 4px 0 0; min-height: 2px; }
[data-bs-theme="light"] .bars .bar { background: #B9D3C4; }
.bars .col.current .bar { background: var(--sage); }
.bars .col .n, .bars .col .y { font-size: 12px; color: var(--text-muted); }
.bars .col.current .n, .bars .col.current .y { color: var(--text); font-weight: 700; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius); padding: 3px; }
.seg a { padding: 6px 14px; border-radius: 6px; color: var(--text-muted); font-weight: 600; font-size: 13px; text-decoration: none; }
.seg a.active { background: var(--cream); color: var(--cream-ink); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week .day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 76px; }
.week .day.has-hunt { background: var(--forest); border-color: var(--forest); color: #fff; }
.week .day .d { font-size: 11px; color: var(--text-muted); }
.week .day.has-hunt .d, .week .day .open { color: var(--wheat); font-weight: 600; }
[data-bs-theme="light"] .week .day .open { color: var(--sage); }
.week .day .t { font-size: 12px; margin-top: 4px; font-weight: 600; }
.week .day a { color: inherit; text-decoration: none; }
.count-big { font-family: var(--font-serif); font-size: 28px; }
@media (max-width: 1200px) { .upcoming-grid { grid-template-columns: 90px minmax(0, 1fr) 110px; } .upcoming-grid .loc { display: none; } }
@media (max-width: 992px) { .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ============ LANDEFLAG ============ */
.flags { display: inline-flex; gap: 3px; align-items: center; vertical-align: middle; }
.flag { width: 18px; height: 13px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }

/* ============ OMFANG / REVIR ============ */
.scope-pill { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 2px 8px; border-radius: 999px;
              background: var(--sage-soft); color: var(--sage); font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; vertical-align: 1px; }
.ground-hero { background: linear-gradient(180deg, #2D4B3C 0%, #1B3126 100%); border-radius: var(--radius-lg); padding: 28px; color: #fff; margin-bottom: 1.25rem; }
.ground-hero h1 { color: #fff; margin: 0; }
.ground-hero .meta { color: #CDD3A3; font-size: 13px; margin-top: 4px; }
.ground-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; overflow-x: auto; }
.ground-tabs a { padding: 10px 14px; color: var(--text-muted); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.ground-tabs a.active { color: var(--sage); border-bottom-color: var(--sage); }
.ground-tabs a .n { color: var(--text-faint); font-weight: 500; margin-left: 4px; }
.member-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 220px 40px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.member-row:first-child { border-top: 0; }
.avatar-initials { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text); }
.cal-month { margin-bottom: 1.25rem; }
.cal-month h3 { font-family: var(--font-serif); font-weight: 400; font-size: 20px; margin: 0 0 8px; }
.cal-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 6px; color: var(--text); text-decoration: none; }
.cal-item:hover { border-color: var(--sage); color: var(--text); }
.cal-date { text-align: center; line-height: 1.1; }
.cal-date .d { font-family: var(--font-serif); font-size: 24px; }
.cal-date .w { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.cal-item.past { opacity: .7; }

/* ============ STORVILDT-DETALJER / BILLEDER ============ */
.bg-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 2px 0 8px; }
.bg-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.bg-panel .form-label { font-size: 12px; margin-bottom: 2px; color: var(--text-muted); }
.photo-previews { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.photo-thumb-sm { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }

/* ============ ØKONOMI: UDFOLDBARE POSTER ============ */
.entries-table tbody.entry { border-top: 1px solid var(--line); }
.entries-table .entry-row { cursor: pointer; }
.entries-table .entry-row:hover > td { background: var(--sage-soft); }
.entries-table .entry-row:focus-visible { outline: 2px solid var(--sage); outline-offset: -2px; }
.entries-table .entry-chevron { display: inline-block; transition: transform .15s; color: var(--text-muted); }
.entries-table tbody.entry.open .entry-chevron { transform: rotate(90deg); color: var(--sage); }
.entries-table tbody.entry.open > tr > td { background: var(--surface-2); }
.entries-table .entry-detail > td { border-top: 0; }
.detail-dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 13px; }
.detail-dl dt { color: var(--text-muted); font-weight: 500; }
.detail-dl dd { margin: 0; }
.detail-notes { margin-top: 10px; padding: 10px 12px; background: var(--inset); border-radius: 6px; font-size: 13px; white-space: pre-line; }
.entries-table tfoot th { border-top: 2px solid var(--line-strong); padding-top: 12px; padding-bottom: 12px; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text); }

/* ============ RUM: Min jagt / revir (11. okt 2026) ============ */
.space-switch { padding: 0 0.75rem 0.9rem; }
.space-switch-btn {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border: 0; border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.24); color: var(--sidebar-text); text-align: left;
}
.space-switch-btn:hover, .space-switch-btn:focus-visible { background: rgba(0, 0, 0, 0.36); }
.space-switch-btn > .bi { color: var(--wheat); margin-left: auto; }
.space-switch-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.space-switch-kind { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sidebar-muted); }
.space-switch-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.space-badge {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px;
    display: grid; place-items: center;
    font-family: var(--font-serif); font-weight: 700; font-size: 15px; color: #1F1A10;
}
.space-badge-me { border-radius: 50%; background: var(--wheat); color: var(--cream-ink); font-family: var(--font-sans); font-size: 12px; }
.space-badge-img { object-fit: cover; background: var(--surface-2); }
.space-menu { min-width: 300px; padding: 6px; border-radius: var(--radius-lg); max-height: 70vh; overflow-y: auto; }
.space-menu .dropdown-header { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.space-item { display: flex !important; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius); white-space: normal; }
.space-item small { color: var(--text-muted); }
.space-item.active, .space-item:active { background: var(--surface-3); color: var(--text); }

/* Revirets rum: farven følger reviret */
body.space-ground .sidebar {
    background: color-mix(in srgb, var(--ground-accent) 12%, #15140F);
    border-top: 4px solid var(--ground-accent);
}
body.space-ground .sidebar-nav-link.active { background: var(--ground-accent); color: #1F1A10; }
body.space-ground .sidebar-nav-link:hover:not(.active) { background: rgba(255, 255, 255, 0.06); }
body.space-ground .space-switch-btn > .bi { color: var(--ground-accent); }

.ground-banner {
    position: relative; min-height: 230px; border-radius: var(--radius-lg); overflow: hidden;
    border-bottom: 4px solid var(--ground-accent, var(--sage));
    background-color: color-mix(in srgb, var(--ground-accent, #9FCAB2) 35%, #15140F);
    background-size: cover; background-repeat: no-repeat;
    margin-bottom: 1.5rem; color: #fff; display: flex; align-items: flex-end;
}
.ground-banner .pattern { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ground-accent, #9FCAB2); }
.ground-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,17,16,0) 30%, rgba(15,17,16,.82) 100%); }
.ground-banner-body { position: relative; z-index: 1; width: 100%; padding: 22px 26px; display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.ground-banner h1 { margin: 0; font-family: var(--font-serif); font-weight: 400; font-size: 2.6rem; color: #fff; line-height: 1.1; }
.ground-banner .meta { color: #E6E8E6; font-size: 14px; margin-top: 6px; }
.ground-banner .role-pill { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--ground-accent, var(--sage)); color: #1F1A10; }
.ground-banner .banner-action { position: absolute; z-index: 1; top: 12px; right: 14px; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: var(--radius); background: rgba(15,17,16,.65); color: #E6E8E6; text-decoration: none; }
.ground-banner .banner-action:hover { background: rgba(15,17,16,.85); color: #fff; }
.btn-ground { background: var(--ground-accent, var(--sage)); color: #1F1A10; font-weight: 700; border: 0; }
.btn-ground:hover, .btn-ground:focus { background: color-mix(in srgb, var(--ground-accent, #9FCAB2) 85%, #fff); color: #1F1A10; }
.btn-outline-ground { border: 1px solid var(--ground-accent, var(--sage)); color: var(--ground-accent, var(--sage)); font-weight: 600; background: transparent; }
.btn-outline-ground:hover { background: var(--ground-accent, var(--sage)); color: #1F1A10; }
.ground-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; text-decoration: none;
               background: color-mix(in srgb, var(--chip, #9FCAB2) 18%, transparent); color: color-mix(in srgb, var(--chip, #9FCAB2) 75%, #fff); white-space: nowrap; }
.ground-chip:hover { background: color-mix(in srgb, var(--chip, #9FCAB2) 30%, transparent); color: #fff; }
.ground-chip.guest { background: transparent; border: 1px solid var(--line-strong); color: var(--text-muted); }
.ground-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; color: var(--text); text-decoration: none; height: 100%; }
.ground-card:hover { border-color: var(--line-strong); color: var(--text); }
.ground-card .cover { height: 110px; background-size: cover; background-position: center; background-color: color-mix(in srgb, var(--chip, #9FCAB2) 30%, #15140F); position: relative; }
.ground-card .cover .pattern { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--chip, #9FCAB2); }
.ground-card .bar { height: 4px; background: var(--chip, var(--sage)); }
.ground-card .body { padding: 12px 16px; }
.ground-card .name { font-weight: 700; }
.ground-card .sub { font-size: 12px; color: var(--text-muted); }

/* Indstillinger: fokuspunkt i topbilledet */
.cover-preview { position: relative; height: 200px; border-radius: var(--radius); overflow: hidden; background-size: cover; cursor: crosshair;
                 background-color: color-mix(in srgb, var(--ground-accent, #9FCAB2) 35%, #15140F); }
.cover-preview .focus-dot { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.45); pointer-events: none; }
.cover-preview .pattern { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ground-accent, #9FCAB2); }
.accent-swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; display: inline-block; }
.btn-check:checked + .accent-swatch { border-color: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.5); }
.btn-check:focus-visible + .accent-swatch { outline: 2px solid var(--sage); outline-offset: 2px; }

@media (max-width: 992px) {
    .space-switch-text, .space-switch-btn > .bi { display: none; }
    .space-switch { padding: 0 0.5rem 0.75rem; }
    .space-switch-btn { justify-content: center; }
}
@media (max-width: 768px) {
    .sidebar.open .space-switch-text { display: flex; }
    .sidebar.open .space-switch-btn > .bi { display: inline-block; }
    .sidebar.open .space-switch-btn { justify-content: flex-start; }
    .ground-banner h1 { font-size: 2rem; }
}
body.space-ground .content-wrapper a:not(.btn):not(.ground-chip):not(.banner-action):not(.dropdown-item):not(.r):not(.cal-item) { color: color-mix(in srgb, var(--ground-accent) 80%, #fff); }
body.space-ground .ground-tabs a.active { color: var(--ground-accent); border-bottom-color: var(--ground-accent); }

/* ============ REVIRKORT (11. okt 2026) ============ */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.map-card { margin: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.map-card figcaption { padding: 10px 12px 12px; }
.map-thumb { display: block; width: 100%; height: 170px; padding: 0; border: 0; background: var(--inset); cursor: zoom-in; }
.map-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-thumb:hover img, .map-thumb:focus-visible img { opacity: .9; }
.map-thumb-pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-muted); text-decoration: none; cursor: pointer; }
.map-thumb-pdf i { font-size: 2.6rem; color: var(--bad); }
.map-thumb-pdf:hover { color: var(--text); }
.map-upload { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 14px; }

/* ============ REVIRETS BUDGET (11. okt 2026) ============ */
.ratio-bar.over > span { background: var(--warn); }
body.space-ground .ratio-bar:not(.over) > span { background: var(--ground-accent); }
.budget-table tfoot td { border-top: 2px solid var(--line-strong); }
.budget-edit td { vertical-align: middle; }
.budget-edit input.amount { max-width: 150px; text-align: right; margin-left: auto; }

/* ============ JAGTLISTE: kommende / afholdt, én linje pr. jagt (13. okt 2026) ============ */
.hl-heading { font-family: var(--font-serif); font-weight: 400; font-size: 1.4rem; margin: 0 0 .6rem; }
.hl-heading span { font-family: var(--font-sans); font-size: 13px; color: var(--text-muted); margin-left: 6px; }
.hl-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 210px 120px 44px 120px 112px 28px; gap: 12px; align-items: center;
          min-height: 44px; padding: 6px 12px; margin-bottom: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.hl-row:hover { border-color: var(--line-strong); }
.hl-row.next { border-color: var(--sage); box-shadow: inset 3px 0 0 var(--sage); }
.hl-row.past { background: transparent; }
.hl-row.past .hl-date, .hl-row.past .hl-title { color: var(--text-muted); }
.hl-row.past:hover .hl-title { color: var(--text); }
.hl-date { white-space: nowrap; color: var(--text); font-variant-numeric: tabular-nums; }
.hl-date .to { color: var(--text-muted); margin-left: 2px; }
.hl-title { font-weight: 600; font-size: 14px; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-title:hover { color: var(--sage); }
.hl-loc { min-width: 0; overflow: hidden; }
.hl-loc .ground-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.hl-type { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-icons { display: flex; gap: 8px; color: var(--text-muted); white-space: nowrap; }
.hl-num { text-align: right; white-space: nowrap; color: var(--text-muted); }
.hl-num b { color: var(--text); font-weight: 600; }
.hl-register { font-weight: 600; }
.hl-status { text-align: right; white-space: nowrap; }
.hl-check { border: 0; background: transparent; color: var(--good); padding: 0 0 0 4px; font-size: 15px; }
.hl-edit { color: var(--text-muted); text-align: center; }
.hl-edit:hover { color: var(--text); }
.hl-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.hl-pill.planned { background: rgba(227, 177, 94, .14); color: var(--warn); }
.hl-pill.confirmed { background: var(--sage-soft); color: var(--sage); }
.hl-pill.done { background: transparent; color: var(--text-muted); border: 1px solid var(--line-strong); }
.hl-pill.cancelled { background: rgba(224, 123, 106, .12); color: var(--bad); text-decoration: line-through; }
@media (max-width: 1300px) { .hl-row { grid-template-columns: 110px minmax(0, 1fr) 170px 44px 110px 104px 28px; } .hl-type { display: none; } }
@media (max-width: 900px)  { .hl-row { grid-template-columns: 96px minmax(0, 1fr) 100px 28px; } .hl-loc, .hl-icons, .hl-status { display: none; } }

/* ============ LOGO (13. okt 2026): rundt mærke fra logo-full.jpg ============ */
.sidebar-brand-logo { width: 40px; height: 40px; border-radius: 50%; }
.mobile-header .brand { display: inline-flex; align-items: center; gap: 8px; }
.mobile-brand-logo { width: 28px; height: 28px; border-radius: 50%; }
