* {
    box-sizing: border-box;
}


/* ========================================
   AMALIE VINIMPORT - FARVEPALET
   ======================================== */

:root {
    --wine-dark: #4a1018;
    --wine: #7f1d2d;
    --wine-hover: #681724;
    --wine-soft: #f3e7e5;

    --cream: #f7f1e7;
    --cream-light: #fcf9f3;
    --beige: #eadfcd;
    --beige-soft: #f2e9db;

    --gold: #b88735;
    --gold-soft: #d4b16a;

    --text: #35191b;
    --text-soft: #725f58;

    --border: #e6d9c7;
    --white: #ffffff;

    --success: #39724b;
    --success-bg: #edf5ef;

    --warning: #a36d19;
    --warning-bg: #fbf3df;

    --danger: #9b3540;
    --danger-bg: #f9e9e9;
}


body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--cream);
    color: var(--text);
}


/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;

    background:
        linear-gradient(
            180deg,
            #421217 0%,
            #5a1720 55%,
            #351014 100%
        );

    padding: 30px 20px;
    z-index: 1000;

    box-shadow:
        4px 0 20px rgba(54, 15, 20, 0.12);
}

.sidebar h2 {
    color: #fffaf2;
    margin-top: 0;
    margin-bottom: 40px;
    font-size: 20px;
    line-height: 1.3;
}

.sidebar a {
    display: block;

    color: #ead9d2;

    text-decoration: none;

    padding: 12px 14px;
    margin-bottom: 5px;

    border-radius: 7px;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.10);
    color: white;
}

.sidebar a.active {
    background: #f3e6d4;
    color: var(--wine-dark);
    font-weight: 700;
}


/* ========================================
   HOVEDINDHOLD
   ======================================== */

main {
    margin-left: 220px;
    padding: 35px;
    max-width: 1800px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

header h1 {
    margin: 0;
    font-size: 30px;
    color: var(--wine-dark);
    letter-spacing: -0.4px;
}

header p {
    margin-top: 8px;
    margin-bottom: 0;
    color: var(--text-soft);
}

.user {
    background: var(--cream-light);

    color: var(--wine-dark);

    padding: 12px 18px;

    border-radius: 8px;
    border: 1px solid var(--border);

    box-shadow:
        0 2px 8px rgba(74, 16, 24, 0.05);

    font-weight: 600;
}


/* ========================================
   DATOFILTER
   ======================================== */

.filters {
    display: flex;
    align-items: end;
    gap: 15px;

    background: var(--cream-light);

    padding: 20px;
    margin-top: 25px;

    border-radius: 10px;
    border: 1px solid var(--border);

    box-shadow:
        0 2px 8px rgba(74, 16, 24, 0.04);
}

.filters div {
    display: flex;
    flex-direction: column;
}

.filters label {
    font-size: 13px;
    font-weight: 700;

    margin-bottom: 6px;

    color: var(--text-soft);
}

.filters input,
.filters select {
    padding: 9px 11px;

    border: 1px solid #d8c9b5;
    border-radius: 5px;

    background: white;
    color: var(--text);

    font-family: inherit;
}

.filters input:focus,
.filters select:focus {
    outline: none;

    border-color: var(--wine);

    box-shadow:
        0 0 0 3px rgba(127, 29, 45, 0.10);
}


/* ========================================
   KNAPPER
   ======================================== */

button {
    padding: 10px 20px;

    border: 0;
    border-radius: 6px;

    background: var(--wine);
    color: white;

    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.1s ease;
}

button:hover {
    background: var(--wine-hover);
}

button:active {
    transform: translateY(1px);
}


/* ========================================
   DASHBOARD-SEKTIONER
   ======================================== */

.dashboard-section {
    margin-top: 30px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;

    margin-bottom: 14px;
}

.section-heading h2 {
    margin: 0;

    font-size: 20px;

    color: var(--wine-dark);
}

.section-heading p {
    margin: 5px 0 0;

    color: var(--text-soft);

    font-size: 13px;
}


/* ========================================
   KPI-KORT
   ======================================== */

.kpis {
    display: grid;
    gap: 18px;
}


/* Primære KPI'er */

.kpis-primary {
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
}


/* Sekundære KPI'er */

.kpis-secondary {
    grid-template-columns:
        repeat(6, minmax(0, 1fr));
}


.card {
    background: var(--cream-light);

    padding: 22px;

    border-radius: 10px;

    border: 1px solid var(--border);

    box-shadow:
        0 2px 8px rgba(74, 16, 24, 0.04);
}

.card span {
    display: block;

    color: var(--text-soft);

    font-size: 13px;
    font-weight: 700;

    margin-bottom: 12px;
}

.card strong {
    display: block;

    font-size: 23px;
    line-height: 1.2;

    color: var(--wine-dark);
}


/* Primære KPI'er */

.kpis-primary .card {
    min-height: 115px;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpis-primary .card strong {
    font-size: 25px;
}


/* Sekundære KPI'er */

.kpis-secondary .card {
    min-height: 100px;
}

.kpis-secondary .card strong {
    font-size: 20px;
}


/* ========================================
   PERFORMANCE-FARVER
   ======================================== */


/* 100 % eller mere */

.performance-good,
.positive {
    color: var(--success) !important;
    font-weight: 700;
}


/* 90 - 99,9 % */

.performance-warning {
    color: var(--warning) !important;
    font-weight: 700;
}


/* Under 90 % */

.performance-bad,
.negative {
    color: var(--danger) !important;
    font-weight: 700;
}


/* KPI-kort */

.performance-card:has(.performance-good),
.performance-card:has(.positive) {
    border-left:
        4px solid var(--success);

    background:
        linear-gradient(
            90deg,
            var(--success-bg) 0%,
            var(--cream-light) 35%
        );
}

.performance-card:has(.performance-warning) {
    border-left:
        4px solid var(--warning);

    background:
        linear-gradient(
            90deg,
            var(--warning-bg) 0%,
            var(--cream-light) 35%
        );
}

.performance-card:has(.performance-bad),
.performance-card:has(.negative) {
    border-left:
        4px solid var(--danger);

    background:
        linear-gradient(
            90deg,
            var(--danger-bg) 0%,
            var(--cream-light) 35%
        );
}


/* Performance i tabeller */

.performance-good {
    background: var(--success-bg);
    padding: 5px 8px;
    border-radius: 5px;
}

.performance-warning {
    background: var(--warning-bg);
    padding: 5px 8px;
    border-radius: 5px;
}

.performance-bad {
    background: var(--danger-bg);
    padding: 5px 8px;
    border-radius: 5px;
}


/* ========================================
   PANELER
   ======================================== */

.panel {
    background: var(--cream-light);

    margin-top: 30px;
    padding: 25px;

    border-radius: 10px;
    border: 1px solid var(--border);

    box-shadow:
        0 2px 8px rgba(74, 16, 24, 0.04);
}

.panel > h2 {
    margin-top: 0;

    color: var(--wine-dark);
}

.panel > p {
    color: var(--text-soft);
}


/* ========================================
   TABELLER
   ======================================== */

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;

    color: var(--wine-dark);

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;

    background: var(--beige-soft);
}

th,
td {
    padding: 14px;

    border-bottom:
        1px solid var(--border);
}

td {
    font-size: 14px;
}

tbody tr {
    transition:
        background 0.12s ease;
}

tbody tr:hover {
    background: #f5ecdf;
}

tbody tr:last-child td {
    border-bottom: 0;
}


/* Links i tabeller */

table a {
    color: var(--wine);
    font-weight: 700;
    text-decoration: none;
}

table a:hover {
    color: var(--wine-dark);
    text-decoration: underline;
}


/* ========================================
   SALGSMÅL
   ======================================== */

.targets-table {
    margin-top: 10px;
}

.targets-table th {
    padding-top: 12px;
    padding-bottom: 12px;
}

.targets-table td {
    vertical-align: middle;
}


/* Inputfelter */

.target-input {
    width: 180px;

    padding: 10px 12px;

    border: 1px solid #d8c9b5;
    border-radius: 6px;

    background: white;
    color: var(--text);

    font-size: 14px;
    font-family: inherit;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.target-input:hover {
    border-color: var(--gold);
}

.target-input:focus {
    outline: none;

    border-color: var(--wine);

    box-shadow:
        0 0 0 3px rgba(127, 29, 45, 0.10);
}


/* "kr." efter input */

.input-suffix {
    display: inline;

    margin-left: 6px;

    color: var(--text-soft);

    font-size: 13px;
    font-weight: 500;
}


/* DG-kolonne */

.target-dg {
    font-weight: 700;
    color: var(--wine-dark);
}


/* Total-række */

.targets-total-row {
    background: var(--beige-soft);
}

.targets-total-row td {
    padding-top: 18px;
    padding-bottom: 18px;

    border-top:
        2px solid #d6c2a5;

    border-bottom: 0;
}

.targets-total-row strong {
    color: var(--wine-dark);
    font-size: 14px;
}


/* Gem-knap */

.targets-actions {
    display: flex;
    justify-content: flex-end;

    margin-top: 22px;
}

.targets-actions button {
    padding: 12px 24px;
    font-size: 14px;
}


/* ========================================
   SMÅ DETALJER
   ======================================== */

small {
    color: var(--text-soft);
}

strong {
    font-weight: 700;
}

::selection {
    background: var(--wine);
    color: white;
}


/* ========================================
   RESPONSIVT LAYOUT
   ======================================== */

@media (max-width: 1400px) {

    .kpis-primary {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .kpis-secondary {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}


@media (max-width: 900px) {

    .sidebar {
        width: 190px;
    }

    main {
        margin-left: 190px;
        padding: 25px;
    }

    .kpis-primary,
    .kpis-secondary {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .panel {
        overflow-x: auto;
    }

    .filters {
        flex-wrap: wrap;
    }

}


@media (max-width: 650px) {

    .sidebar {
        position: static;

        width: 100%;
        height: auto;
    }

    main {
        margin-left: 0;
        padding: 20px;
    }

    header {
        align-items: flex-start;
        flex-direction: column;
    }

    .filters {
        align-items: stretch;
        flex-direction: column;
    }

    .kpis-primary,
    .kpis-secondary {
        grid-template-columns: 1fr;
    }

}
/* ========================================
   BREDE DASHBOARD-TABELLER
   ======================================== */

.table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.table-scroll table {
    min-width: 1180px;
}

/* Paneler må aldrig vokse ud over main */
.panel {
    min-width: 0;
    max-width: 100%;
}

/* ========================================
   PERFORMANCE BADGES
   ======================================== */

/*
   Performance skal være en diskret markering
   af tallet - ikke farve hele KPI-kortet.
*/

.performance-card:has(.performance-good),
.performance-card:has(.performance-warning),
.performance-card:has(.performance-bad) {
    background: var(--cream-light);
    border-left: 1px solid var(--border);
}

.performance-good,
.performance-warning,
.performance-bad {
    display: inline-block;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 6px;
    font-weight: 700;
}

.performance-good {
    color: var(--success) !important;
    background: var(--success-bg);
}

.performance-warning {
    color: var(--warning) !important;
    background: var(--warning-bg);
}

.performance-bad {
    color: var(--danger) !important;
    background: var(--danger-bg);
}

/* Performance i tabeller skal være kompakt */
td .performance-good,
td .performance-warning,
td .performance-bad {
    white-space: nowrap;
}

/* Undgå at meget brede tabeller påvirker hele siden */
main {
    min-width: 0;
    width: calc(100% - 220px);
}

@media (max-width: 900px) {
    main {
        width: calc(100% - 190px);
    }
}

@media (max-width: 650px) {
    main {
        width: 100%;
    }
}
/* ========================================
   SIDEBAR - BRUGER / LOG UD
   ======================================== */

.sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar-navigation {
    display: block;
}

.sidebar-user {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(212, 177, 106, 0.35);
}

.sidebar-user-label {
    margin: 0 14px 6px;

    color: var(--gold-soft);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
}

.sidebar-user-name {
    margin: 0 14px 16px;

    color: #fffaf2;

    font-size: 16px;
    font-weight: 700;
}

.sidebar .logout-link {
    display: block;

    margin: 0;
    padding: 10px 14px;

    background: var(--beige);
    color: var(--wine-dark);

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;

    font-size: 14px;
    font-weight: 700;

    text-align: center;
}

.sidebar .logout-link:hover {
    background: var(--gold-soft);
    color: var(--wine-dark);
}


/* Mobil: brugerområdet skal ikke presses ned */

@media (max-width: 650px) {

    .sidebar-user {
        margin-top: 25px;
    }

}
/* ========================================
   AMALIE PORTAL
   ======================================== */

.portal-body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(
            135deg,
            var(--cream-light) 0%,
            var(--cream) 55%,
            var(--beige-soft) 100%
        );
}

.portal-main {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 46px 0 70px;
}

.portal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 48px;
}

.portal-header h1 {
    margin: 6px 0 8px;
    color: var(--wine-dark);
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1;
}

.portal-header p {
    margin: 0;
    color: var(--text-soft);
    font-size: 17px;
}

.portal-eyebrow {
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.8px;
}

.portal-user {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--wine-dark);
    font-weight: 700;
}

.portal-user a {
    color: var(--wine);
    font-size: 13px;
    text-decoration: none;
}

.portal-user a:hover {
    text-decoration: underline;
}

.portal-intro {
    margin-bottom: 20px;
}

.portal-intro h2 {
    margin: 0 0 5px;
    color: var(--wine-dark);
    font-size: 23px;
}

.portal-intro p {
    margin: 0;
    color: var(--text-soft);
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.portal-module-card {
    position: relative;
    display: flex;
    min-height: 210px;
    flex-direction: column;
    padding: 28px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(74, 16, 24, 0.07);
    color: var(--text);
    text-decoration: none;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.portal-module-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 5px;
    background: linear-gradient(
        90deg,
        var(--wine-dark),
        var(--wine),
        var(--gold)
    );
    content: "";
}

.portal-module-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold-soft);
    box-shadow: 0 16px 36px rgba(74, 16, 24, 0.12);
}

.portal-module-label {
    margin-bottom: 22px;
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.6px;
}

.portal-module-card h2 {
    margin: 0 0 10px;
    color: var(--wine-dark);
    font-size: 25px;
}

.portal-module-card p {
    max-width: 500px;
    margin: 0;
    color: var(--text-soft);
    line-height: 1.55;
}

.portal-module-link {
    margin-top: auto;
    padding-top: 24px;
    color: var(--wine);
    font-weight: 800;
}

.portal-placeholder {
    max-width: 760px;
    padding: 34px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(74, 16, 24, 0.07);
}

.portal-placeholder-label {
    margin-bottom: 10px;
    color: var(--success);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.portal-placeholder h2 {
    margin: 0 0 12px;
    color: var(--wine-dark);
}

.portal-placeholder p {
    margin: 0 0 25px;
    color: var(--text-soft);
    line-height: 1.6;
}

.portal-back-button {
    display: inline-block;
    padding: 11px 16px;
    background: var(--wine);
    border-radius: 8px;
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
}

.portal-back-button:hover {
    background: var(--wine-hover);
}

@media (max-width: 760px) {
    .portal-main {
        width: min(100% - 28px, 1180px);
        padding-top: 28px;
    }

    .portal-header {
        flex-direction: column;
        margin-bottom: 34px;
    }

    .portal-grid {
        grid-template-columns: 1fr;
    }

    .portal-user {
        width: 100%;
        box-sizing: border-box;
        justify-content: space-between;
    }
}

