html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

h1:focus { outline: none; }

.blazor-error-boundary {
    background: #b3433a;
    color: white;
    padding: 1rem;
}
.blazor-error-boundary::after { content: "Der opstod en fejl."; }

/* ---------- Auth-sider (SSR EditForm med InputText) ---------- */
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--mud-palette-background, #f4f7f8);
    padding: 24px;
}
.auth-shell .field { margin-bottom: 16px; }
.auth-shell .field label { display:block; font-size:13px; font-weight:500; color:#4a5d68; margin-bottom:6px; }
.auth-shell .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5d9;
    border-radius: 8px;
    font: inherit;
    background: #ffffff;
    color: #1a2b35;
}
.auth-shell .form-input:focus {
    outline: 2px solid #2c7a8c;
    outline-offset: 1px;
    border-color: #2c7a8c;
}
.auth-shell .btn-primary {
    width: 100%;
    padding: 12px 16px;
    background: #2c7a8c;
    color: #ffffff;
    border: 1px solid #2c7a8c;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.auth-shell .btn-primary:hover { background: #246575; }
.auth-shell .auth-links { display:flex; justify-content:space-between; margin-top:16px; font-size:13px; }
.auth-shell .auth-links a { color:#2c7a8c; text-decoration:none; }
.auth-shell .auth-links a:hover { text-decoration:underline; }
.auth-shell .validation-message { color:#b3433a; font-size:12px; margin-top:4px; }

/* ---------- Sprogvaelger paa auth-sider (EmptyLayout) ---------- */
.empty-layout-lang {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    z-index: 1300;
}

/* ---------- Status-chip tekst (MudChip-override) ---------- */
.status-chip {
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: .04em;
    text-transform: uppercase;
    height: 22px !important;
    padding: 0 10px !important;
}

/* ---------- Patient-bar — gradient header over tabs ---------- */
.patient-bar {
    background: linear-gradient(180deg, #eef4f5 0%, #e8eff1 100%);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* ---------- Mobil: skjul markerede elementer + søgefelt fylder hele bredden ---------- */
@media (max-width: 599.95px) {
    .hide-on-mobile,
    th.hide-on-mobile,
    td.hide-on-mobile { display: none !important; }
    .records-search { max-width: 100% !important; width: 100% !important; }
}


/* ---------- Record bottom navigation (mobil) ---------- */
.record-bottom-nav { display: none; }

@media (max-width: 599.95px) {
    /* Skjul MudTabs-headeren — bottom nav overtager */
    .record-tabs-wrap .mud-tabs-tabbar { display: none !important; }

    /* Plads så indhold ikke gemmes under bar'en (inkl. safe-area for iOS) */
    .record-tabs-wrap { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important; }

    .record-bottom-nav {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 1200;
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 2px;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        background: #ffffff;
        border-top: 1px solid var(--mud-palette-lines-default);
        box-shadow: 0 -2px 8px rgba(0,0,0,.06);
    }

    .record-bottom-nav__item {
        appearance: none;
        background: transparent;
        border: 0;
        padding: 6px 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: var(--mud-palette-text-secondary, #5b6770);
        font-size: 11px;
        line-height: 1.2;
        font-weight: 500;
        border-radius: 8px;
        cursor: pointer;
        transition: background-color .15s ease, color .15s ease;
        min-height: 56px;
    }

    .record-bottom-nav__item:active { background: rgba(0,0,0,.04); }

    .record-bottom-nav__item.is-active {
        color: var(--mud-palette-primary, #2c7a8c);
        background: var(--mud-palette-primary-hover, #e8f2f4);
    }

    .record-bottom-nav__label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}

/* ---------- Delte behandlere — desktop: én række, mobil: grid med meta under navn ---------- */
.share-row__meta {
    display: flex;
    align-items: center;
    gap: 12px;
}
.share-row__since { min-width: 120px; text-align: right; }

@media (max-width: 599.95px) {
    .share-row {
        display: grid !important;
        grid-template-columns: auto 1fr;
        column-gap: 12px;
        row-gap: 8px;
        align-items: start;
    }
    .share-row > .mud-avatar {
        grid-column: 1;
        grid-row: 1;
    }
    .share-row__name {
        grid-column: 2;
        grid-row: 1;
    }
    .share-row__meta {
        grid-column: 1 / -1;
        grid-row: 2;
        flex-wrap: wrap;
        gap: 8px;
    }
    .share-row__since {
        min-width: 0;
        text-align: left;
        flex: 1;
    }
}

/* ---------- Sticky sidebar i Records-layout ---------- */
.sidebar-sticky { position: sticky; top: 80px; }
@media (max-width: 960px) {
    .sidebar-sticky { position: static; }
}

/* ---------- MudDataGrid hover-tone ---------- */
.mud-table-row:hover { background: var(--mud-palette-primary-hover, #e8f2f4) !important; }

/* ---------- VAS bar + spark (Record log tab) ---------- */
.vas-bar {
    height: 8px;
    background: linear-gradient(90deg, #3b8e6e 0%, #c47a35 50%, #b3433a 100%);
    border-radius: 4px;
    position: relative;
    opacity: .35;
}
.vas-fill {
    position: absolute; top: 0; left: 0; bottom: 0;
    background: linear-gradient(90deg, #3b8e6e 0%, #c47a35 100%);
    border-radius: 4px;
    box-shadow: 0 0 0 2px #ffffff inset;
}
.spark {
    display: flex; align-items: flex-end; gap: 3px;
    height: 36px;
}
.spark-bar {
    flex: 1;
    background: #cbd5d9;
    border-radius: 2px;
    min-height: 8%;
    transition: background .15s;
}
.spark-bar.active { background: #2c7a8c; }
.vas-knob {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--mud-palette-lines-default);
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    transform: translate(-50%, -50%);
}

/* ---------- VAS udviklingsgraf (graf = historik, hover viser detaljer) ---------- */
.vas-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 92px;
    padding-top: 4px;
}
.vas-chart-bar {
    flex: 1;
    min-width: 6px;
    min-height: 6%;
    border-radius: 3px 3px 0 0;
    transition: opacity .15s;
    cursor: pointer;
}
.vas-chart-bar:hover { opacity: .7; }

/* ---------- VAS niveau-vælger (0-10) ---------- */
.vas-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.vas-level {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--mud-palette-lines-default);
    background: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .1s ease, box-shadow .1s ease;
}
.vas-level:hover { transform: translateY(-1px); }
.vas-level.active {
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,.22);
}


.user-menu-activator {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--mud-palette-text-primary);
    transition: background-color .15s ease;
}
.user-menu-activator:hover {
    background: rgba(0,0,0,.04);
}
.user-menu-logout {
    all: unset;
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--mud-palette-text-primary);
    cursor: pointer;
}
.user-menu-logout:hover {
    background: rgba(0,0,0,.04);
}

.brand-mark-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
    line-height: 0;
}
.brand-env-badge {
    position: absolute;
    top: 6px;
    right: -8px;
    font-size: 20px;
    line-height: 1;
    transform: rotate(-15deg);
    text-shadow: 0 1px 2px rgba(0,0,0,.18);
    pointer-events: none;
    animation: brand-env-wiggle 3s ease-in-out infinite;
}
@keyframes brand-env-wiggle {
    0%, 100% { transform: rotate(-15deg); }
    50%      { transform: rotate(-5deg) translateY(-1px); }
}
