/* ==========================================================================
   SoftControl Kontraktportal
   Neutrale flader, SoftControl-rød som accent. Komponenter:
   app-skal (sidebar/topbar) · sidehoved · kort · tabeller · badges · faner ·
   værktøjslinje · sidepanel · valgkort · dashboard
   ========================================================================== */

:root {
    --sc-red: #9b2321;
    --sc-red-dark: #7a1b1a;
    --sc-red-tint: #fbefee;
    --sc-orange: #e2a300;
    --sc-orange-dark: #c48f00;
    --sc-primary: var(--sc-red);
    --sc-primary-dark: var(--sc-red-dark);
    --sc-accent: var(--sc-orange);

    --sc-bg: #f5f6f8;
    --sc-surface: #ffffff;
    --sc-surface-muted: #f9fafb;
    --sc-card-bg: var(--sc-surface);
    --sc-border: #e4e7ec;
    --sc-border-strong: #d0d5dd;
    --sc-text: #1d2433;
    --sc-muted: #5f6b7a;
    --sc-subtle: #8a94a3;

    --sc-info: #1f5fbf;
    --sc-info-tint: #eaf1fc;
    --sc-success: #157347;
    --sc-success-tint: #e7f5ee;
    --sc-warning-tint: #fff7e0;

    --sc-radius: 10px;
    --sc-radius-sm: 8px;
    --sc-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    --sc-shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);
    --sc-sidebar-width: 252px;
    --sc-topbar-height: 60px;
    --sc-focus-ring: 0 0 0 0.2rem rgba(155, 35, 33, 0.18);
    --sc-font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Bootstrap */
    --bs-body-font-family: var(--sc-font);
    --bs-body-color: var(--sc-text);
    --bs-body-bg: var(--sc-bg);
    --bs-border-color: var(--sc-border);
    --bs-link-color: var(--sc-red);
    --bs-link-color-rgb: 155, 35, 33;
    --bs-link-hover-color: var(--sc-red-dark);
    --bs-link-hover-color-rgb: 122, 27, 26;
    --bs-secondary-color: var(--sc-muted);
    --bs-border-radius: var(--sc-radius-sm);
}

html {
    font-size: 15px;
}

body.sc-body {
    font-family: var(--sc-font);
    background: var(--sc-bg);
    color: var(--sc-text);
    min-height: 100vh;
}

.sc-skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2000;
    padding: 0.5rem 0.75rem;
    background: var(--sc-surface);
    border-radius: var(--sc-radius-sm);
    box-shadow: var(--sc-shadow-lg);
}

/* ---------- Ikoner ---------- */

.sc-icon {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    vertical-align: -0.2em;
}

.sc-icon-sm {
    width: 0.9rem;
    height: 0.9rem;
}

.btn .sc-icon {
    margin-top: -0.1em;
}

/* ---------- App-skal ---------- */

.sc-shell {
    display: flex;
    min-height: 100vh;
}

.sc-shell-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/*
 * Indholdsområdet er flydende og centreret. Det fylder skærmen op til en 24"-skærm (1920 px minus sidebar);
 * på større skærme (fx 27") forbliver det centreret i den bredde, så tabeller og tekst ikke bliver for lange.
 * Skal 27" (2560 px) fyldes helt ud, sæt --sc-content-max til 2240px.
 */
:root {
    --sc-content-max: 1680px;
    --sc-content-narrow: 880px;
    --sc-content-compact: 560px;
    --sc-gutter: clamp(1rem, 2.5vw, 2.5rem);
}

.sc-container {
    width: 100%;
    max-width: calc(var(--sc-content-max) + 2 * var(--sc-gutter));
    margin: 0 auto;
    padding: 0 var(--sc-gutter);
}

.sc-container-narrow {
    max-width: calc(var(--sc-content-narrow) + 2 * var(--sc-gutter));
}

.sc-container-compact {
    max-width: calc(var(--sc-content-compact) + 2 * var(--sc-gutter));
}

/* Smalle sider: kolonner i sidens øverste række fylder hele den smalle bredde. */
.sc-container-narrow > .row > [class*="col-"],
.sc-container-narrow > form.row > [class*="col-"],
.sc-container-compact > .row > [class*="col-"],
.sc-container-compact > form.row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
}

.sc-sidebar {
    background: var(--sc-surface);
    border-right: 1px solid var(--sc-border);
}

@media (min-width: 992px) {
    /* Sidebarens hvide flade og kant følger hele sidens højde, også når sidebaren er sticky. */
    .sc-has-sidebar .sc-shell {
        background: linear-gradient(
            to right,
            var(--sc-surface) calc(var(--sc-sidebar-width) - 1px),
            var(--sc-border) calc(var(--sc-sidebar-width) - 1px),
            var(--sc-border) var(--sc-sidebar-width),
            transparent var(--sc-sidebar-width));
    }

    .sc-sidebar {
        position: sticky;
        top: 0;
        width: var(--sc-sidebar-width);
        height: 100vh;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 991.98px) {
    .sc-sidebar.offcanvas-lg {
        --bs-offcanvas-width: 280px;
    }
}

.sc-sidebar-head {
    height: var(--sc-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--sc-border);
    flex-shrink: 0;
}

.sc-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem 1.5rem;
}

.sc-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    line-height: 1.1;
    text-decoration: none;
    color: var(--sc-text);
}

.sc-brand:hover {
    text-decoration: none;
    color: var(--sc-text);
}

.sc-brand-mark {
    height: 32px;
    width: auto;
    flex-shrink: 0;
    display: block;
}

.sc-brand-compact .sc-brand-mark {
    height: 26px;
}

.sc-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sc-logo {
    color: var(--sc-text);
    font-weight: 700;
    font-size: 1.12rem;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.sc-logo-control {
    font-weight: 400;
}

.sc-brand-sub {
    color: var(--sc-muted);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 600;
    line-height: 1;
}

.sc-nav-section + .sc-nav-section {
    margin-top: 1.25rem;
}

.sc-nav-heading {
    margin: 0 0 0.35rem;
    padding: 0 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sc-subtle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sc-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--sc-radius-sm);
    color: var(--sc-muted);
    font-weight: 600;
    font-size: 0.93rem;
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.sc-nav-link:hover {
    background: var(--sc-surface-muted);
    color: var(--sc-text);
}

.sc-nav-link.active {
    background: var(--sc-red-tint);
    color: var(--sc-red);
}

.sc-nav-link.active::before {
    content: "";
    position: absolute;
    left: -0.75rem;
    top: 0.45rem;
    bottom: 0.45rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--sc-red);
}

.sc-nav-link .sc-icon {
    width: 1.15rem;
    height: 1.15rem;
}

.sc-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--sc-topbar-height);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 var(--sc-gutter);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--sc-border);
}

@media (max-width: 575.98px) {
    .sc-topbar {
        padding: 0 0.75rem;
    }
}

.sc-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sc-topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--sc-border);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--sc-text);
    background: var(--sc-surface);
}

.sc-topbar-btn:hover,
.sc-topbar-btn[aria-expanded="true"] {
    border-color: var(--sc-border-strong);
    background: var(--sc-surface-muted);
}

.sc-topbar-btn.is-active {
    border-color: var(--sc-orange);
    background: var(--sc-warning-tint);
}

.sc-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border: 0;
    padding: 0.25rem 0.4rem;
    border-radius: 999px;
    color: var(--sc-text);
}

.sc-user-btn:hover,
.sc-user-btn[aria-expanded="true"] {
    background: var(--sc-surface-muted);
}

.sc-user-btn-text {
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.sc-user-btn-name {
    font-weight: 600;
    font-size: 0.88rem;
}

.sc-user-btn-role {
    font-size: 0.75rem;
    color: var(--sc-muted);
}

.sc-switcher {
    width: 320px;
    padding: 0;
    overflow: hidden;
}

.sc-switcher-head {
    padding: 0.75rem;
    border-bottom: 1px solid var(--sc-border);
}

.sc-switcher-title {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sc-subtle);
}

.sc-switcher-list {
    max-height: 340px;
    overflow-y: auto;
    padding: 0.35rem 0;
}

.sc-switcher-list form {
    margin: 0;
}

.sc-switcher-list .dropdown-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    white-space: normal;
    line-height: 1.3;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.sc-switcher-list .dropdown-item.active small {
    color: rgba(255, 255, 255, 0.8) !important;
}

.sc-switcher-foot {
    padding: 0.75rem;
    border-top: 1px solid var(--sc-border);
}

.sc-impersonation-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem var(--sc-gutter);
    background: var(--sc-warning-tint);
    border-bottom: 1px solid #f3dc99;
    color: #5c4300;
    font-size: 0.92rem;
}

.sc-impersonation-banner form {
    margin: 0;
}

.sc-banner-btn {
    background: #fff;
    border: 1px solid #e8cf86;
    font-weight: 600;
}

.sc-main {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.sc-footer {
    padding: 1.25rem 0;
    font-size: 0.82rem;
    color: var(--sc-subtle);
    border-top: 1px solid var(--sc-border);
}

/* Sider uden login (fx fejlsider) bruger samme skal uden sidebar. */
body:not(.sc-has-sidebar) .sc-topbar .sc-brand-mark {
    height: 30px;
}

/* ---------- Sidehoved ---------- */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Ældre sider har <h1> og <p> direkte i sidehovedet (uden wrapper) – stak dem. */
.page-header:has(> h1) {
    display: block;
}

.page-header h1 {
    color: var(--sc-text);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 0.25rem;
}

.page-header p,
.page-subtitle {
    color: var(--sc-muted);
    margin-bottom: 0;
    max-width: 70ch;
}

.page-header > .d-flex,
.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ---------- Kort ---------- */

.sc-card {
    background: var(--sc-card-bg);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius);
    padding: 1.5rem;
    box-shadow: var(--sc-shadow);
}

.sc-card h3 {
    color: var(--sc-text);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Kort hvor tabellen går helt ud til kanten. */
.sc-card-flush {
    padding: 0;
    overflow: hidden;
}

.sc-card > .table-responsive:last-child .table,
.sc-card > .table:last-child {
    margin-bottom: 0;
}

/* Tabeller direkte i et almindeligt kort (ældre sider) går kant til kant ligesom i .sc-card-flush. */
.sc-card:not(.sc-card-flush) > .table-sc {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    width: calc(100% + 3rem);
    max-width: none;
}

.sc-card:not(.sc-card-flush) > .table-responsive:not(.sc-inset-table):not(.percent-price-grid-wrapper) {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
}

.sc-card:not(.sc-card-flush) > .table-sc:first-child,
.sc-card:not(.sc-card-flush) > .table-responsive:not(.sc-inset-table):not(.percent-price-grid-wrapper):first-child {
    margin-top: -1.5rem;
}

.sc-card:not(.sc-card-flush) > .table-sc:last-child,
.sc-card:not(.sc-card-flush) > .table-responsive:not(.sc-inset-table):not(.percent-price-grid-wrapper):last-child {
    margin-bottom: -1.5rem !important;
}

.sc-card:not(.sc-card-flush) > .table-sc:first-child thead th:first-child,
.sc-card:not(.sc-card-flush) > .table-responsive:not(.sc-inset-table):not(.percent-price-grid-wrapper):first-child thead th:first-child {
    border-top-left-radius: var(--sc-radius);
}

.sc-card:not(.sc-card-flush) > .table-sc:first-child thead th:last-child,
.sc-card:not(.sc-card-flush) > .table-responsive:not(.sc-inset-table):not(.percent-price-grid-wrapper):first-child thead th:last-child {
    border-top-right-radius: var(--sc-radius);
}

.sc-callout {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.9rem 1.25rem;
    background: var(--sc-surface-muted);
    border-bottom: 1px solid var(--sc-border);
}

.sc-callout {
    flex-wrap: wrap;
}

.sc-callout > div {
    flex: 1 1 220px;
}

.sc-callout > .sc-icon {
    margin-top: 0.2rem;
    color: var(--sc-red);
}

.sc-callout-muted {
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-sm);
}

.sc-callout-muted > .sc-icon {
    color: var(--sc-orange-dark);
}

/* Status-callouts: grønt ikon = i orden (fx underskrevet), rødt = mangler. */
.sc-callout-success > .sc-icon {
    color: var(--sc-success);
}

.sc-callout-danger > .sc-icon {
    color: var(--sc-red);
}

/* ---------- Knapper ---------- */

.btn {
    border-radius: var(--sc-radius-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-sm {
    border-radius: 6px;
}

.btn-sc-primary {
    background: var(--sc-red);
    border-color: var(--sc-red);
    color: #fff;
    box-shadow: 0 1px 2px rgba(122, 27, 26, 0.25);
}

.btn-sc-primary:hover,
.btn-sc-primary:focus,
.btn-sc-primary:active {
    background: var(--sc-red-dark) !important;
    border-color: var(--sc-red-dark) !important;
    color: #fff !important;
}

.btn-sc-secondary {
    background: var(--sc-surface);
    border-color: var(--sc-border-strong);
    color: var(--sc-text);
    box-shadow: var(--sc-shadow);
}

.btn-sc-secondary:hover,
.btn-sc-secondary:focus,
.btn-sc-secondary:active {
    background: var(--sc-surface-muted) !important;
    border-color: var(--sc-border-strong) !important;
    color: var(--sc-text) !important;
}

.btn-sc-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--sc-muted);
}

.btn-sc-ghost:hover,
.btn-sc-ghost:focus {
    background: var(--sc-surface-muted);
    color: var(--sc-text);
}

.btn-primary {
    --bs-btn-bg: var(--sc-red);
    --bs-btn-border-color: var(--sc-red);
    --bs-btn-hover-bg: var(--sc-red-dark);
    --bs-btn-hover-border-color: var(--sc-red-dark);
    --bs-btn-active-bg: var(--sc-red-dark);
    --bs-btn-active-border-color: var(--sc-red-dark);
}

.sc-icon-btn {
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border: 0;
    border-radius: var(--sc-radius-sm);
    color: var(--sc-muted);
    background: transparent;
}

.sc-icon-btn:hover,
.sc-icon-btn[aria-expanded="true"] {
    background: var(--sc-bg);
    color: var(--sc-text);
}

.btn.is-loading {
    opacity: 0.7;
    cursor: progress;
}

.btn:focus-visible,
.sc-person:focus-visible,
.sc-nav-link:focus-visible {
    outline: 0;
    box-shadow: var(--sc-focus-ring);
}

/* ---------- Dropdowns ---------- */

.dropdown-menu {
    --bs-dropdown-border-color: var(--sc-border);
    --bs-dropdown-border-radius: var(--sc-radius);
    --bs-dropdown-link-active-bg: var(--sc-red);
    --bs-dropdown-item-padding-y: 0.4rem;
    box-shadow: var(--sc-shadow-lg);
    padding: 0.35rem;
    font-size: 0.92rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 6px;
}

.dropdown-item .sc-icon {
    color: var(--sc-subtle);
}

.dropdown-item.text-danger .sc-icon {
    color: currentColor;
}

.dropdown-menu form {
    margin: 0;
}

.dropdown-menu button.dropdown-item {
    width: 100%;
    text-align: left;
}

/* ---------- Tabeller ---------- */

.table-sc {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--sc-surface-muted);
    margin-bottom: 0;
}

.table-sc > :not(caption) > * > * {
    padding: 0.8rem 1rem;
    border-bottom-color: var(--sc-border);
}

.table-sc > :not(caption) > * > *:first-child {
    padding-left: 1.5rem;
}

.table-sc > :not(caption) > * > *:last-child {
    padding-right: 1.5rem;
}

.table-sc thead th,
.table-sc thead {
    background: var(--sc-surface-muted);
}

.table-sc th {
    color: var(--sc-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid var(--sc-border);
}

.table-sc tbody tr:last-child > * {
    border-bottom: 0;
}

.sc-col-actions {
    width: 1%;
    text-align: right;
    white-space: nowrap;
}

.sc-table-empty {
    margin: 0;
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--sc-muted);
}

.sc-link-quiet {
    color: var(--sc-text);
    text-decoration: none;
    font-weight: 600;
}

.sc-link-quiet:hover {
    color: var(--sc-red);
    text-decoration: underline;
}

/* Rækkehandlinger: knapper i sidste kolonne står på én linje. */
.table-sc td.text-end {
    white-space: nowrap;
}

.table-sc td.text-end .btn + .btn,
.table-sc td.text-end form + .btn,
.table-sc td.text-end .btn + form {
    margin-left: 0.25rem;
}

/* ---------- Person-celle ---------- */

.sc-person {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    color: inherit;
    border-radius: var(--sc-radius-sm);
}

.sc-person:hover .sc-person-name {
    color: var(--sc-red);
}

.sc-person-static,
.sc-person-static:hover .sc-person-name {
    cursor: default;
    color: inherit;
}

.sc-person-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

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

.sc-person-meta {
    font-size: 0.84rem;
    color: var(--sc-muted);
}

.sc-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sc-red-tint);
    color: var(--sc-red);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sc-avatar-dark {
    background: #eceef2;
    color: var(--sc-text);
}

.sc-avatar-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

/* ---------- Badges ---------- */

.sc-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.sc-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    background: #eef0f3;
    color: #3a4352;
    white-space: nowrap;
}

.sc-badge-accent {
    background: var(--sc-red-tint);
    color: var(--sc-red);
}

.sc-badge-info {
    background: var(--sc-info-tint);
    color: var(--sc-info);
}

.sc-badge-success {
    background: var(--sc-success-tint);
    color: var(--sc-success);
}

.sc-badge-warning {
    background: var(--sc-warning-tint);
    color: #8a6400;
}

.sc-badge-muted {
    background: transparent;
    color: var(--sc-subtle);
    box-shadow: inset 0 0 0 1px var(--sc-border);
}

.sc-badge-dark {
    background: #2b3240;
    color: #fff;
}

.badge-sc {
    background: var(--sc-orange);
    color: #fff;
}

.badge {
    font-weight: 600;
    border-radius: 999px;
}

/* ---------- Faner ---------- */

.sc-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--sc-border);
    overflow-x: auto;
    /* Fanens understregning stikker 1px ud under rækken; uden dette får rækken en lodret mini-scrollbar. */
    scrollbar-width: none;
}

.sc-tabs::-webkit-scrollbar {
    display: none;
}

.sc-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--sc-muted);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

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

.sc-tab.active {
    color: var(--sc-red);
    border-bottom-color: var(--sc-red);
}

.sc-tab-count {
    min-width: 1.5rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: #eef0f3;
    color: var(--sc-muted);
    font-size: 0.75rem;
    text-align: center;
    line-height: 1.5;
}

.sc-tab.active .sc-tab-count {
    background: var(--sc-red-tint);
    color: var(--sc-red);
}

/* ---------- Værktøjslinje over tabeller ---------- */

.sc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--sc-border);
}

.sc-toolbar form {
    margin: 0;
}

.sc-toolbar-filter .form-select {
    min-width: 240px;
}

.sc-search {
    position: relative;
    flex: 1 1 260px;
    max-width: 380px;
    margin: 0;
}

.sc-search .sc-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sc-subtle);
    pointer-events: none;
}

.sc-search .form-control {
    padding-left: 2.25rem;
}

/* ---------- Tom tilstand ---------- */

.sc-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--sc-muted);
}

.sc-empty > .sc-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--sc-subtle);
    margin-bottom: 0.75rem;
}

.sc-empty-title {
    font-weight: 700;
    color: var(--sc-text);
    margin-bottom: 0.25rem;
}

/* ---------- Formularer ---------- */

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

legend.form-label {
    float: none;
}

.form-control,
.form-select {
    /* --bs-body-bg er sidens grå baggrund – felter skal være hvide. */
    background-color: var(--sc-surface);
    border-color: var(--sc-border-strong);
    border-radius: var(--sc-radius-sm);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
    background-color: var(--sc-surface-muted);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--sc-red);
    box-shadow: var(--sc-focus-ring);
}

.form-check-input {
    border-color: #98a2b3;
}

.form-check-input:disabled {
    border-color: var(--sc-border-strong);
}

.form-check-input:checked {
    background-color: var(--sc-red);
    border-color: var(--sc-red);
}

.form-check-input:focus {
    border-color: var(--sc-red);
    box-shadow: var(--sc-focus-ring);
}

.form-text {
    color: var(--sc-muted);
}

.input-validation-error {
    border-color: #dc3545;
}

.field-validation-valid,
.validation-summary-valid {
    display: none !important;
}

.sc-validation-summary ul {
    margin: 0;
    padding-left: 1.1rem;
}

/* Valgkort (radio som kort) */
.sc-choice-group {
    display: grid;
    gap: 0.5rem;
}

@media (min-width: 576px) {
    .sc-choice-group {
        grid-template-columns: 1fr 1fr;
    }
}

.sc-choice {
    position: relative;
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--sc-border-strong);
    border-radius: var(--sc-radius-sm);
    cursor: pointer;
    transition: border-color 0.12s ease, background-color 0.12s ease;
}

.sc-choice:hover {
    background: var(--sc-surface-muted);
}

.sc-choice input {
    margin-top: 0.2rem;
    accent-color: var(--sc-red);
}

.sc-choice:has(input:checked) {
    border-color: var(--sc-red);
    background: var(--sc-red-tint);
}

.sc-choice:has(input:focus-visible) {
    box-shadow: var(--sc-focus-ring);
}

.sc-choice-body {
    display: flex;
    flex-direction: column;
}

.sc-choice-title {
    font-weight: 700;
}

.sc-choice-text {
    font-size: 0.84rem;
    color: var(--sc-muted);
}

/* ---------- Sidepanel (offcanvas) ---------- */

.sc-panel.offcanvas-end {
    --bs-offcanvas-width: min(500px, 100vw);
    border-left: 1px solid var(--sc-border);
    box-shadow: var(--sc-shadow-lg);
}

.sc-panel .offcanvas-header > .sc-icon-btn {
    margin-left: auto;
    margin-top: -0.25rem;
}

.sc-panel .offcanvas-header {
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--sc-border);
}

.sc-panel .offcanvas-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.sc-panel-eyebrow {
    margin: 0 0 0.15rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sc-subtle);
}

.sc-panel .offcanvas-body {
    padding: 1.5rem;
}

.sc-panel-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--sc-border);
    background: var(--sc-surface-muted);
}

.sc-panel[aria-busy="true"] {
    cursor: progress;
}

.sc-danger-zone {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    border: 1px solid #f1c9c8;
    border-radius: var(--sc-radius-sm);
    background: #fffafa;
    transition: box-shadow 0.3s ease;
}

.sc-danger-zone h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #a12623;
    margin-bottom: 0.35rem;
}

.sc-danger-zone p {
    font-size: 0.88rem;
    color: var(--sc-muted);
}

.sc-danger-zone.is-highlighted {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.18);
}

/* ---------- Dashboard ---------- */

.sc-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sc-stat {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.15rem 1.25rem;
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius);
    box-shadow: var(--sc-shadow);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

a.sc-stat:hover {
    border-color: var(--sc-border-strong);
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
    color: inherit;
}

.sc-stat-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sc-muted);
}

.sc-stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.sc-stat-hint {
    font-size: 0.8rem;
    color: var(--sc-subtle);
}

.sc-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.75rem;
}

.sc-quick {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius);
    background: var(--sc-surface);
    color: var(--sc-text);
    text-decoration: none;
    font-weight: 600;
    transition: border-color 0.12s ease, background-color 0.12s ease;
}

.sc-quick:hover {
    border-color: var(--sc-red);
    background: var(--sc-red-tint);
    color: var(--sc-red);
}

.sc-quick-icon {
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--sc-radius-sm);
    background: var(--sc-red-tint);
    color: var(--sc-red);
}

.sc-quick-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.sc-quick-text small {
    font-weight: 400;
    color: var(--sc-muted);
}

.sc-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sc-subtle);
    margin: 0 0 0.75rem;
}

.sc-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sc-link-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--sc-border);
}

.sc-link-list li:last-child {
    border-bottom: none;
}

.sc-link-list a {
    color: var(--sc-red);
    text-decoration: none;
    font-weight: 600;
}

.sc-link-list a:hover {
    text-decoration: underline;
}

.sc-help-list,
.sc-token-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sc-token-list li {
    margin-bottom: 0.5rem;
}

.sc-help-list li {
    padding: 0.35rem 0;
}

/* ---------- Alerts ---------- */

.alert {
    border-radius: var(--sc-radius-sm);
}

/* ---------- Login ---------- */

.sc-login-body {
    font-family: var(--sc-font);
    color: var(--sc-text);
    background: var(--sc-bg);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(226, 163, 0, 0.12) 0%, transparent 42%),
        radial-gradient(circle at 100% 100%, rgba(155, 35, 33, 0.1) 0%, transparent 42%);
    min-height: 100vh;
}

.sc-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--sc-shadow-lg);
    border: 1px solid var(--sc-border);
    border-top: 4px solid var(--sc-red);
}

@media (max-width: 575.98px) {
    .login-card {
        padding: 1.75rem 1.25rem;
    }
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand-lockup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.login-brand-mark {
    height: 44px;
    width: auto;
    display: block;
}

.login-logo {
    display: block;
    color: var(--sc-text);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.login-logo-control {
    font-weight: 400;
}

.login-brand p {
    color: var(--sc-muted);
    margin: 0.25rem 0 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    font-weight: 600;
}

.demo-credentials code {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

/* ---------- Adgangskode-felt ---------- */

.password-input-wrap {
    position: relative;
}

.password-input-wrap .form-control {
    padding-right: 2.75rem;
}

.password-toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--sc-muted);
    cursor: pointer;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus-visible {
    color: var(--sc-text);
}

.password-toggle-btn:focus-visible {
    outline: 2px solid var(--sc-red);
    outline-offset: -2px;
}

.password-toggle-icon-hide {
    display: none;
}

.password-toggle-btn.is-visible .password-toggle-icon-show {
    display: none;
}

.password-toggle-btn.is-visible .password-toggle-icon-hide {
    display: block;
}

/* ---------- Kontraktvisning og editor ---------- */

.contract-preview-frame {
    display: block;
    width: 100%;
    min-height: 800px;
    height: 80vh;
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-sm);
    background: #fff;
}

.font-monospace {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
}

.sc-wysiwyg-editor .tox-tinymce {
    border-radius: var(--sc-radius-sm);
    border-color: var(--sc-border) !important;
    max-height: calc(100vh - 220px);
}

.sc-wysiwyg-editor .tox .tox-edit-area {
    overflow: auto;
}

.sc-wysiwyg-editor .tox .tox-edit-area__iframe {
    background: #fff;
}

/* Opret kontrakt — uafhængige kolonner, 0,5 cm mellem kort */
.contract-create-layout {
    display: flex;
    flex-direction: column;
    gap: 0.5cm;
}

.contract-create-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5cm;
    align-items: start;
}

@media (min-width: 992px) {
    .contract-create-columns {
        grid-template-columns: 1fr 1fr;
    }
}

.contract-create-col {
    display: flex;
    flex-direction: column;
    gap: 0.5cm;
    min-width: 0;
}

.contract-create-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5cm;
    align-items: start;
}

.contract-create-row-full {
    grid-template-columns: 1fr;
}

.contract-create-card {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
}

.contract-create-card h3 {
    flex-shrink: 0;
}

.contract-create-cell-spacer {
    display: none;
}

.contract-create-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.contract-create-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.25rem;
    margin-top: 0.5rem;
}

@media (max-width: 575.98px) {
    .contract-create-actions {
        flex-direction: column;
    }

    .contract-create-actions .btn {
        width: 100%;
    }
}

.sc-pdf-bg-preview img {
    max-height: 220px;
    width: 100%;
    object-fit: contain;
    background: #fff;
}

/* ---------- Faner som knapper (Bootstrap tab) ---------- */

button.sc-tab {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}

button.sc-tab.active {
    border-bottom-color: var(--sc-red);
}

/* ---------- Formular-sektioner ---------- */

.sc-subheading {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.sc-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.4rem 1.25rem;
}

/* Tabel inde i et kort med indhold omkring: egen ramme i stedet for kant til kant. */
.sc-inset-table,
.percent-price-grid-wrapper {
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-sm);
}

.sc-inset-table .table-sc > :not(caption) > * > *:first-child,
.percent-price-grid-wrapper .table-sc > :not(caption) > * > *:first-child {
    padding-left: 0.85rem;
}

.sc-inset-table .table-sc > :not(caption) > * > *:last-child,
.percent-price-grid-wrapper .table-sc > :not(caption) > * > *:last-child {
    padding-right: 0.85rem;
}

.sc-inset-table tfoot td {
    border-top: 1px solid var(--sc-border);
    background: var(--sc-surface-muted);
}

/* ---------- Handlingslinje i bunden af lange formularer ---------- */

.sc-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 1010;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius);
    box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.06);
}

.sc-action-bar-note {
    flex: 1 1 280px;
    margin: 0;
    text-align: right;
    font-size: 0.82rem;
    color: var(--sc-muted);
}

@media (max-width: 767.98px) {
    .sc-action-bar-note {
        text-align: left;
    }
}

/* Telefon: kompakt handlingslinje, så den ikke dækker forhåndsvisningen. */
@media (max-width: 575.98px) {
    .sc-action-bar {
        gap: 0.35rem;
        margin-top: 1rem;
        padding: 0.5rem;
    }

    .sc-action-bar .btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.85rem;
    }

    .sc-action-bar-note {
        display: none;
    }
}

/* ---------- Forhåndsvisning i fane ---------- */

.sc-preview-body {
    position: relative;
    min-height: 240px;
    padding: 1rem;
    background: var(--sc-surface-muted);
}

.sc-preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 4rem 1rem;
    color: var(--sc-muted);
}

.sc-preview-body .contract-preview-frame {
    box-shadow: var(--sc-shadow);
}

/* Fanen «Forhåndsvisning»: siden slutter ved handlingslinjen, så kun PDF-fladen scroller (preview-tabs.js). */
body.sc-preview-open .sc-footer {
    display: none;
}

body.sc-preview-open .sc-main {
    padding-bottom: 0;
}

/* PDF tegnet med PDF.js: egen scrollflade, så positionen bevares når forhåndsvisningen dannes igen. */
.sc-pdf-pages {
    height: max(480px, 80vh);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 1rem;
    border-radius: var(--sc-radius-sm);
    background: #525659;
    transition: opacity 0.2s ease;
}

.sc-pdf-pages:focus-visible {
    outline: 0;
    box-shadow: var(--sc-focus-ring);
}

.sc-pdf-pages.is-updating {
    opacity: 0.55;
    cursor: progress;
}

/* Centreret, men bredere sider (høj zoom) scroller vandret i stedet for at blive klippet til venstre. */
.sc-pdf-page {
    width: fit-content;
    margin: 0 auto;
}

.sc-pdf-page + .sc-pdf-page {
    margin-top: 1rem;
}

.sc-pdf-page canvas {
    display: block;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.sc-zoom {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    margin-right: 0.35rem;
    padding-right: 0.5rem;
    border-right: 1px solid var(--sc-border);
}

.sc-zoom .sc-icon-btn {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
}

.sc-zoom-value {
    min-width: 3.2rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.sc-zoom .btn.active {
    background: var(--sc-red-tint);
    color: var(--sc-red);
}

@media (max-width: 575.98px) {
    .sc-pdf-pages {
        height: 70vh;
        padding: 0.5rem;
    }

    .sc-pdf-page + .sc-pdf-page {
        margin-top: 0.5rem;
    }
}

/* ---------- Mellemside (fx supportvisning) ---------- */

.sc-interstitial {
    max-width: 560px;
    margin: 2rem auto 0;
    padding: 2rem;
    text-align: center;
}

.sc-interstitial h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 1rem 0 0.5rem;
}

.sc-interstitial .page-subtitle {
    margin: 0 auto 0.75rem;
}

.sc-interstitial-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--sc-warning-tint);
    color: #8a6400;
}

.sc-interstitial-icon .sc-icon {
    width: 1.4rem;
    height: 1.4rem;
}

.sc-interstitial-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.sc-interstitial-actions form {
    margin: 0;
}

.sc-picker {
    text-align: left;
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-sm);
    overflow: hidden;
}

.sc-picker .sc-search {
    display: block;
    max-width: none;
    padding: 0.6rem;
    border-bottom: 1px solid var(--sc-border);
}

.sc-picker .sc-search .sc-icon {
    left: 1.35rem;
}

.sc-picker-list {
    max-height: 320px;
    overflow-y: auto;
}

.sc-picker-list form {
    margin: 0;
}

.sc-picker-list form + form {
    border-top: 1px solid var(--sc-border);
}

.sc-picker-item {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0.7rem 2.5rem 0.7rem 1rem;
    border: 0;
    background: var(--sc-surface);
    text-align: left;
    color: var(--sc-text);
}

.sc-picker-item:hover,
.sc-picker-item:focus-visible {
    background: var(--sc-red-tint);
    outline: 0;
}

.sc-picker-name {
    font-weight: 600;
}

.sc-picker-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sc-subtle);
}

.sc-picker-item:hover .sc-picker-arrow {
    color: var(--sc-red);
}

@media (max-width: 575.98px) {
    .sc-interstitial {
        margin-top: 0.5rem;
        padding: 1.5rem 1.15rem;
    }

    .sc-interstitial-actions,
    .sc-interstitial-actions form,
    .sc-interstitial-actions .btn {
        width: 100%;
    }
}

/* ---------- Rækkehandlinger ---------- */

.sc-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}

.sc-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 52ch;
}

/* ---------- iPad og telefon ---------- */

@media (max-width: 991.98px) {
    .sc-topbar {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .sc-impersonation-banner {
        padding-left: 1rem;
        padding-right: 1rem;
        flex-wrap: wrap;
    }

    .sc-main {
        padding-top: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .sc-main {
        padding-top: 1.25rem;
        padding-bottom: 2rem;
    }

    .page-header {
        align-items: flex-start;
        margin-bottom: 1.15rem;
    }

    .page-header h1 {
        font-size: 1.35rem;
    }

    .sc-card {
        border-radius: var(--sc-radius-sm);
    }

    .sc-card:not(.sc-card-flush) {
        padding: 1.15rem;
    }

    .sc-card:not(.sc-card-flush) > .table-responsive:not(.sc-inset-table):not(.percent-price-grid-wrapper) {
        margin-left: -1.15rem;
        margin-right: -1.15rem;
    }

    .sc-card:not(.sc-card-flush) > .table-responsive:not(.sc-inset-table):not(.percent-price-grid-wrapper):first-child {
        margin-top: -1.15rem;
    }

    .sc-card:not(.sc-card-flush) > .table-responsive:not(.sc-inset-table):not(.percent-price-grid-wrapper):last-child {
        margin-bottom: -1.15rem !important;
    }

    .sc-toolbar {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .sc-search,
    .sc-toolbar-filter,
    .sc-toolbar-filter .form-select {
        flex: 1 1 100%;
        max-width: none;
        min-width: 0;
        width: 100%;
    }

    .sc-toolbar .ms-auto {
        margin-left: 0 !important;
    }

    .table-sc > :not(caption) > * > * {
        padding: 0.7rem 0.6rem;
    }

    .table-sc > :not(caption) > * > *:first-child {
        padding-left: 1rem;
    }

    .table-sc > :not(caption) > * > *:last-child {
        padding-right: 0.6rem;
    }

    .sc-avatar {
        width: 2rem;
        height: 2rem;
        font-size: 0.72rem;
    }

    .sc-person {
        gap: 0.6rem;
    }

    .sc-person-meta {
        overflow-wrap: anywhere;
    }

    .sc-person-text .sc-badges {
        margin-top: 0.35rem;
    }

    .sc-tab {
        padding: 0.6rem 0.55rem;
    }

    .sc-tab > .sc-icon {
        display: none;
    }

    .sc-stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
    }

    .sc-stat {
        padding: 0.85rem 0.9rem;
    }

    .sc-stat-value {
        font-size: 1.5rem;
    }

    .sc-stat-hint {
        display: none;
    }

    .sc-panel .offcanvas-header,
    .sc-panel .offcanvas-body {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .sc-panel-footer {
        padding: 0.75rem 1.1rem;
    }

    .sc-panel-footer .btn {
        flex: 1;
    }

    .sc-switcher {
        width: min(320px, calc(100vw - 1.5rem));
    }
}

/* Touch (iPad/telefon): større trykflader og 16px felter, så iOS ikke zoomer ind ved fokus. */
@media (pointer: coarse) {
    .sc-icon-btn {
        width: 2.75rem;
        height: 2.75rem;
    }

    .btn-sm {
        min-height: 2.25rem;
    }

    .dropdown-item {
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }

    .sc-nav-link {
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    .form-control,
    .form-select {
        font-size: 16px;
    }

    .sc-choice {
        padding: 0.9rem;
    }
}

/* ---------- Print ---------- */

@media print {
    .sc-sidebar,
    .sc-topbar,
    .sc-footer,
    .contract-create-form button,
    .contract-create-form .btn,
    .sc-action-bar,
    .sc-tabs,
    #pane-preview,
    .sc-impersonation-banner,
    .page-header .btn {
        display: none !important;
    }

    .sc-main {
        padding: 0;
    }

    .contract-create-form input:not([type="hidden"]),
    .contract-create-form select,
    .contract-create-form textarea {
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .contract-create-form .form-check-input {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* Selvbetjening for slutkunder (udfyldningslink uden login) – bredere kort på login-layoutet. */
.login-card.sc-onboarding-card {
    max-width: 1040px;
}

.sc-onboarding-card .login-brand {
    margin-bottom: 1.5rem;
}
