:root {
    --red: #e30613;
    --red-dark: #a80710;
    --red-soft: #fff0f2;
    --blue: #c8dde4;
    --blue-soft: #edf7f9;
    --blue-light: #f7fbfc;
    --bg: #f5f8f9;
    --card: #ffffff;
    --ink: #172126;
    --muted: #66757c;
    --line: #dce7ea;
    --line-soft: #edf2f3;
    --green: #1f9d6a;
    --green-soft: #e8f7ef;
    --amber: #f2a900;
    --amber-soft: #fff5dd;
    --danger: #b00014;
    --danger-soft: #ffe8eb;
    --shadow: 0 18px 45px rgba(24, 45, 54, 0.10);
    --shadow-soft: 0 8px 22px rgba(20, 40, 50, 0.04);
    --radius-xl: 30px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-pill: 999px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

/*
    Topnavigation:
    Bevidst uden baggrundsboks, border og afrundede hjørner.
    Menuen må ikke wrappe til to linjer, og den må ikke klippe første/sidste punkt.
*/
.header-inner {
    width: min(1440px, calc(100% - 56px));
    margin: 0 auto;
    padding: 14px 0;
    display: grid;
    grid-template-columns: 300px minmax(690px, 1fr) 230px;
    gap: 22px;
    align-items: center;
}

.brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
}

.brand img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand strong {
    display: block;
    font-size: 21px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.brand span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
}

.main-nav {
    min-width: 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    white-space: nowrap;
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 10px 12px;
    border-radius: var(--radius-pill);
    color: #26343a;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
    background: var(--red);
    color: #ffffff;
}

.userbox {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    text-align: right;
}

.userbox strong {
    display: block;
    font-size: 14px;
}

.userbox span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.userbox a {
    display: inline-block;
    margin-top: 6px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--red);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 850;
    flex: 0 0 auto;
}

.subbar {
    background: linear-gradient(90deg, var(--blue), #eef7f9);
    border-bottom: 1px solid var(--line);
}

.subbar-inner {
    width: min(1440px, calc(100% - 56px));
    margin: 0 auto;
    padding: 12px 0;
    display: grid;
    grid-template-columns: 420px minmax(320px, 1fr);
    align-items: center;
    gap: 20px;
}

.quicklinks {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 420px;
}

.quicklinks a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 13px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.82);
    color: #26343a;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.quicklinks a:hover {
    background: #ffffff;
}

.search {
    width: 720px;
    max-width: 100%;
    margin-left: auto;

    display: flex;
    align-items: center;
    padding: 4px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    box-shadow: 0 10px 26px rgba(24, 45, 54, 0.06);
}

.search input {
    min-width: 0;
    flex: 1;
    padding: 10px 14px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
}

.search input::placeholder {
    color: #77878e;
}

.search button {
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--red);
    color: #ffffff;
    padding: 9px 16px;
    font-weight: 850;
}

.page {
    width: min(1280px, calc(100% - 56px));
    margin: 0 auto;
    padding: 28px 0;
    flex: 1 0 auto;
}

.hero,
.hero-panel {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 24px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--blue), #f8fcfd 58%, #ffffff);
    box-shadow: var(--shadow);
}

.hero::after,
.hero-panel::after {
    content: "";
    position: absolute;
    right: -75px;
    top: -85px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(227, 6, 19, 0.10);
    pointer-events: none;
}

.hero > *,
.hero-panel > * {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--red-dark);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: -0.035em;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 4vw, 35px);
    line-height: 1.06;
}

h2 {
    font-size: 20px;
    line-height: 1.15;
}

h3 {
    font-size: 16px;
    line-height: 1.2;
}

.lead,
.hero-text {
    margin: 0;
    max-width: 760px;
    color: #52636b;
    line-height: 1.55;
    font-size: 1rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.btn,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-pill);
    padding: 12px 17px;
    font-weight: 850;
    cursor: pointer;
    text-decoration: none;
}

.btn.primary,
button.btn.primary,
a.btn.primary,
.button.primary {
    background: var(--red);
    color: #ffffff;
    border: 1px solid var(--red);
}

.btn.secondary,
button.btn.secondary,
a.btn.secondary,
.button.secondary {
    background: #ffffff;
    color: var(--ink);
    border: 1px solid var(--line);
}

.status-card {
    align-self: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-soft);
}

.status-card.is-ok {
    border-color: rgba(31, 157, 106, 0.28);
}

.status-card.is-error {
    border-color: rgba(176, 0, 20, 0.28);
}

.status-label,
.status-card > b {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.status-card strong {
    display: block;
    color: var(--ink);
}

.status-card span:last-child {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.status-line {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 0;
    border-bottom: 1px solid #eef3f4;
    color: #53646b;
}

.status-line:last-child {
    border-bottom: 0;
}

.status-line strong {
    color: var(--ink);
    text-align: right;
    font-size: 14px;
}

.kpis,
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 22px 0;
}

.kpi,
.metric-card,
.panel,
.work-card {
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.kpi,
.metric-card {
    min-height: 128px;
    border-radius: 22px;
    padding: 18px;
}

.kpi span,
.metric-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.kpi strong,
.metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
    letter-spacing: -0.045em;
}

.kpi small,
.metric-card small {
    display: inline-block;
    margin-top: 8px;
    color: var(--green);
    font-weight: 750;
}

.grid,
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 18px;
    margin-top: 18px;
}

.lower-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.panel,
.work-card {
    min-width: 0;
    border-radius: var(--radius-lg);
    padding: 20px;
}

.large-card {
    grid-row: span 2;
}

.subtle-panel,
.muted-card {
    background: linear-gradient(135deg, #ffffff, #f7fbfc);
}

.card-header,
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-header.compact {
    margin-bottom: 12px;
}

.pill,
.panel-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    background: var(--red-soft);
    border: 1px solid rgba(227, 6, 19, 0.12);
    color: var(--red-dark);
    text-decoration: none;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 0 0 10px;
    color: #7a8a91;
    text-align: left;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

td {
    padding: 13px 8px;
    border-top: 1px solid var(--line-soft);
    font-size: 14px;
    vertical-align: middle;
}

.animal {
    display: flex;
    align-items: center;
    gap: 10px;
}

.animal b,
.animal small {
    display: block;
}

.animal small {
    margin-top: 2px;
    color: var(--muted);
}

.paw {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--blue-soft);
    color: #47636d;
    font-size: 11px;
    font-weight: 850;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.badge.green {
    background: var(--green-soft);
    color: #12784d;
}

.badge.amber {
    background: var(--amber-soft);
    color: #8a5a00;
}

.badge.red {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge.blue {
    background: var(--blue-soft);
    color: #47636d;
}

.todo,
.event-list {
    display: grid;
    gap: 10px;
}

.task,
.event-item {
    border-radius: 16px;
    background: #f7fafb;
    border: 1px solid var(--line-soft);
}

.task {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 13px;
}

.task.muted {
    background: #fffdf7;
}

.dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--red);
}

.task p,
.event-item p,
.work-card p {
    margin: 0;
    color: #52636b;
    line-height: 1.45;
}

.work-card p {
    margin-top: 12px;
}

.task b {
    display: block;
    margin-bottom: 2px;
    color: var(--ink);
}

.event-item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
}

.event-date {
    color: var(--red-dark);
    font-size: 13px;
    font-weight: 850;
}

.event-item b {
    display: block;
    font-size: 14px;
}

.event-item p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.roadmap-list {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.roadmap-list li {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 14px;
    padding: 13px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid var(--line-soft);
}

.roadmap-list strong {
    color: var(--ink);
}

.roadmap-list span {
    color: var(--muted);
    line-height: 1.45;
}

.empty-state {
    margin: 0;
    padding: 16px;
    color: var(--muted);
    background: #f7fafb;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
}

.footer-note {
    margin: 18px 0 0;
    color: #74838a;
    font-size: 13px;
}

.footer,
.site-footer {
    width: min(1280px, calc(100% - 56px));
    margin: 28px auto 0;
    padding: 24px 0 36px;
    color: var(--muted);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    border-top: 1px solid var(--line);
}

.footer strong,
.site-footer strong {
    color: var(--ink);
    font-weight: 900;
}

.footer div,
.site-footer div {
    line-height: 1.45;
}

/* Lokale handlingsmenuer under sideoverskrift */
.module-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -8px 0 22px;
    padding: 6px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 26px rgba(18, 38, 49, 0.06);
    width: fit-content;
    max-width: 100%;
}

.module-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.module-action-link:hover,
.module-action-link:focus-visible {
    background: #ffffff;
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line);
    outline: none;
}

.module-action-link.is-active {
    background: var(--red);
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(227, 6, 19, 0.18);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1320px) {
    .header-inner {
        width: calc(100% - 40px);
        grid-template-columns: 280px minmax(620px, 1fr) 210px;
        gap: 16px;
    }

    .main-nav {
        gap: 3px;
    }

    .main-nav a {
        padding-left: 9px;
        padding-right: 9px;
        font-size: 12.5px;
    }

    .subbar-inner {
        width: calc(100% - 40px);
    }
}

@media (max-width: 1120px) {
    .header-inner {
        grid-template-columns: 1fr;
    }

    .main-nav {
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
    }

    .userbox {
        justify-content: flex-start;
        text-align: left;
    }

    .subbar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .search {
        min-width: 0;
        max-width: none;
    }

    .hero,
    .hero-panel,
    .grid,
    .content-grid,
    .lower-grid {
        grid-template-columns: 1fr;
    }

    .kpis,
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .page {
        width: calc(100% - 36px);
        padding: 18px 0;
    }

    .header-inner,
    .subbar-inner {
        width: calc(100% - 36px);
    }

    .brand img {
        width: 50px;
        height: 50px;
    }

    .quicklinks {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .hero,
    .hero-panel {
        padding: 22px;
    }

    h1 {
        font-size: 28px;
    }

    .kpis,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .card-header,
    .panel-header {
        flex-direction: column;
    }

    .roadmap-list li,
    .event-item {
        grid-template-columns: 1fr;
    }

    .footer,
    .site-footer {
        width: calc(100% - 36px);
        flex-direction: column;
    }

    .module-actions {
        width: 100%;
        border-radius: 22px;
    }

    .module-action-link {
        flex: 1 1 auto;
    }
}


/* Opret hændelse
   Gælder kun events/create.php via wrapperen .event-create-page.
   Bruger samme rolige breddeprincip som ejerformularerne.
*/
.event-create-page {
    width: min(100%, 1050px);
    margin-left: auto;
    margin-right: auto;
}

.event-create-page .page-header,
.event-create-page .success-card,
.event-create-page .notice,
.event-create-page .form-card,
.event-create-page .results-card {
    width: 100%;
}

@media (max-width: 780px) {
    .event-create-page {
        width: 100%;
    }
}


.kpi {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi span {
    min-height: 18px;
}

.kpi strong {
    margin-top: 10px;
    font-size: 34px;
}

.kpi small {
    min-height: 22px;
}

.kpi .actions {
    margin-top: 14px !important;
}

.kpi .panel-link {
    align-self: flex-start;
    background: var(--red-soft);
    color: var(--red-dark);
    border-color: rgba(227, 6, 19, 0.18);
}

.kpi .panel-link:hover {
    background: var(--red);
    color: #ffffff;
}

/* Demo-dashboard KPI links */
.kpi {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 150px;
}

.kpi strong {
    margin-top: 10px;
    font-size: 34px;
}

.kpi small {
    display: block;
    min-height: 34px;
    margin-top: 8px;
}

.kpi-link {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    color: var(--red);
    text-decoration: none;
    font-size: 13px;
    font-weight: 850;
}

.kpi-link:hover,
.kpi-link:focus-visible {
    color: var(--red-dark);
    outline: none;
}

/* DVBasen 2026 - rapportfilter: dato og sortering på én linje
   Tilføjes nederst i /assets/css/dvbasen.css
*/
.report-filter-grid {
    display: grid;
    grid-template-columns: minmax(190px, 0.85fr) minmax(190px, 0.85fr) minmax(300px, 1.3fr);
    gap: 18px;
    align-items: end;
}

.report-filter-grid .field {
    margin: 0;
    min-width: 0;
}

.report-filter-grid input,
.report-filter-grid select {
    width: 100%;
}

.report-filter-note {
    margin-top: 16px;
}

@media (max-width: 980px) {
    .report-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .report-filter-grid .field:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .report-filter-grid {
        grid-template-columns: 1fr;
    }

    .report-filter-grid .field:last-child {
        grid-column: auto;
    }
}

/* DVBasen 2026 - Rapportcenter: bredere detail-popup og pænere plejehistorik
   Tilføjes nederst i /assets/css/dvbasen.css
*/
.report-info-modal {
    width: min(760px, calc(100vw - 48px));
}

.report-foster-table th,
.report-foster-table td {
    vertical-align: top;
}

.report-foster-table .report-foster-agreement {
    width: 90px;
}

.report-foster-table .report-foster-date {
    width: 115px;
}

.report-foster-table .report-foster-duration {
    width: 120px;
    text-align: right;
}

.report-foster-table td:last-child {
    text-align: right;
    white-space: nowrap;
}

.report-family-name {
    display: block;
    color: var(--ink);
    font-weight: 800;
    line-height: 1.35;
}

.report-family-meta {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    line-height: 1.35;
}

@media (max-width: 760px) {
    .report-info-modal {
        width: min(100%, calc(100vw - 28px));
    }

    .report-foster-table th,
    .report-foster-table td {
        white-space: nowrap;
    }
}

/* DVBasen 2026 - rapportdetaljer i fuld bredde */
.report-detail-stack {
    display: grid;
    gap: 18px;
}

.report-detail-panel {
    scroll-margin-top: 130px;
}
