﻿
:root {
    --bg: #fff;
    --text: #222;
    --muted: #666;
    --border: #e6e6e6;
    --border-strong: #d9d9d9;
    --accent: #0078d7;
    --hover: #fafafa;
    --chip-bg: #f5faff;
    --chip-text: #1f4b7a
}

.hidden {
    display: none !important;
}

/* ===== Base ===== */
body {
    font-family: "Segoe UI",Roboto,Arial,sans-serif;
    font-size: 15px;
    color: var(--text);
    margin: 20px;
    background: #f4f6f8
}

h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px
}

.meta {
    margin-bottom: 12px;
    color: #444
}

.status {
    margin: 8px 0 14px;
    font-size: 14px;
    color: #444
}

    .status.hidden {
        display: none
    }

.error {
    color: #a00
}

.btn {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: #fff;
    cursor: pointer
}

.spinner {
    display: inline-block;
    width: 14px !important;
    height: 14px !important;
    border: 2px solid #ccc !important;
    border-top-color: #555 !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
    vertical-align: -2px !important;
    margin-right: 8px !important;
    font-size: 14px!important;
}

.spinner {
    pointer-events: none;
    filter: none !important;
    opacity: 1 !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 8px 0 12px;
    color: #444;
    flex-wrap: wrap;
}

.muted {
    color: var(--muted);
}

.linkbtn {
    background: none;
    border: none;
    color: #0047b3;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font: inherit
}

.pill {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    padding: 4px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--chip-text);
    margin-left: 8px
}

/* Tabs (Møder + statusser) */
.status-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* ⬅️ centrerer hver linje */
    gap: 6px;
}

.tab-btn {
    border: 1px solid var(--border-strong);
    background: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 15px;
    cursor: pointer;
    line-height: 1.2;
}

    .tab-btn.active, .active > .status-count {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent);
    }

.status-count {
    margin-left: 0px;
    font-size: 12px;
    color: var(--muted);
}

/* ===== Desktop tabel ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08)
}

    .table th {
        text-align: left;
        padding: 10px 12px;
        background: #f8f8f8;
        border-bottom: 2px solid var(--border-strong);
        color: #333;
        font-weight: 600;
        font-size: 14px
    }

    .table td {
        padding: 10px 12px;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
        background: #fff
    }

    .table tr:last-child td {
        border-bottom: none
    }

    .table tr:hover td {
        background: var(--hover)
    }

.phone a {
    color: #a00;
    font-weight: 500;
    text-decoration: none
}

.phone::before, .møder::before {
    content: "📞";
    margin-right: 6px
}

.besigtigelser::before {
    content: "🏠";
    margin-right: 6px
}


input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
    accent-color: var(--accent)
}

.show-details {
    cursor: pointer;
    color: #0047b3;
    text-decoration: underline;
    float:right;
}

    .show-details:focus {
        outline: 2px solid var(--accent);
        outline-offset: 2px
    }

.sep-row td {
    background: #f3f6fb;
    border-top: 2px solid var(--border-strong);
    font-weight: 600
}

tr.past td {
    color: #8a8a8a;
    background: #fbfbfb
}

tr.past:hover td {
    background: #fbfbfb
}

/* Detaljer (desktop) */
.details-row td {
    background: #fbfdff;
    border-top: 1px dashed var(--border-strong)
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    margin-top: 6px
}

    .details-table th {
        width: 200px;
        text-align: left;
        padding: 10px 12px;
        background: #f5f9ff;
        color: #1f4b7a;
        border-bottom: 1px solid var(--border);
        font-weight: 600;
        vertical-align: top
    }

    .details-table td {
        padding: 10px 12px;
        border-bottom: 1px solid var(--border);
        vertical-align: top
    }

    .details-table tr:last-child th,
    .details-table tr:last-child td {
        border-bottom: none
    }

/* ===== Mobil ===== */
.mobile-only {
    display: none
}

/* hver mobil-kort-række */
tr.mobile-card > td {
    padding: 8px;
    border-bottom: none;
    background: transparent
}

.mob-card-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
    margin: 0px;
    overflow: hidden;
}

.mob-table {
    width: 100%;
    border-collapse: collapse
}

    .mob-table tr {
        border-bottom: 1px solid var(--border)
    }

        .mob-table tr:last-child {
            border-bottom: none
        }

.mob-hdr {
    background: #f8f8f8;
    color: #333;
    font-weight: 600;
    cursor: pointer;
}

    .mob-hdr td {
        padding: 12px 14px
    }

/* Skjul alle detaljer som default */
.mob-card-box .mob-row {
    display: none;
}

.mob-card-box .mob-details-container
{
    display: none;
}

/* Når kortet er åbent → vis alle rækker */
.mob-card-box.open .mob-row {
    display: table-row;
}

.mob-card-box.open .mob-details-container {
    display: table-row;
}

.mob-row td {
    padding: 12px 14px
}

.mob-label {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 4px
}

.mob-val {
    display: block
}

.mob-actions a,
.mob-actions button {
    font-weight: 600;
    text-decoration: underline;
    color: #0047b3;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer
}

.mob-pill {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--chip-bg);
    color: var(--chip-text)
}

/* mobil-separator og detaljer */
tr.mobile-sep > td {
    padding: 8px;
    border-bottom: none;
    background: transparent
}

tr.mobile-sep {
    width: 100%;
}

.mob-sep-box {
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
    margin: 10px 0;
    overflow: hidden
}

.mob-sep-head {
    padding: 12px 14px;
    background: #f8f8f8;
    font-weight: 600
}

tr.mob-details-container > td {
    padding: 0;
    border-bottom: none;
    background: transparent
}

tr.mob-details-container {
    width: 100%;
}

.mob-details {
    background: #fbfdff;
    padding: 8px 10px 12px;
    width: 95%;
}

    .mob-details table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0
    }

    .mob-details .pair-header {
        background: #f5f9ff;
        color: #1f4b7a;
        font-weight: 600;
        border: 1px solid var(--border-strong);
        border-bottom: none;
        border-radius: 8px 8px 0 0;
        padding: 10px 12px
    }

    .mob-details .pair-value {
        border: 1px solid var(--border-strong);
        border-top: none;
        border-radius: 0 0 8px 8px;
        padding: 10px 12px;
        margin-bottom: 8px
    }

/* ===== Breakpoint ===== */
@media (max-width:76800px) {
    .desktop-only {
        display: none
    }

    .mobile-only {
        display: table
    }

    body {
        margin: 12px
    }

    .toolbar {
        position: sticky;
        top: 0;
        background: #f4f6f8;
        z-index: 99;
        padding: 6px 0px 10px 0px;
    }

    #todayTableMobile,
    #leadTableMobile {
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid var(--border-strong, #ddd);
        background: #fff;
        width: 100%;
    }
}

/* ===== Breakpoint ===== */
@media (min-width:500px) {

    #todayTableMobile,
    #leadTableMobile {
        width: 500px;
    }
}

/* Action-knap til at skifte status */
.mob-actions .status-change-btn {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    text-decoration: none; /* fjern underline fra den generelle regel */
    display: inline-block;
}

    .mob-actions .status-change-btn:hover {
        background: #005fb8; /* lidt mørkere blå */
    }

    .mob-actions .status-change-btn:active {
        transform: scale(0.96);
    }

    .mob-actions .status-change-btn::after {
        content: "⚡";
        font-size: 14px;
    }

.status-change-btn {
    border: none;
    background: linear-gradient(135deg, #0078d7, #005bb5);
    color: #fff;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

    .status-change-btn:hover {
        background: linear-gradient(135deg, #0089ff, #0066cc);
        transform: translateY(-1px);
        box-shadow: 0 3px 7px rgba(0,0,0,0.2);
    }

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 6px;
    vertical-align: middle; /* <– sørger for perfekt lodret centrering */
}

.status-change-btn {
    display: inline-flex;
    align-items: center; /* <– lodret centreret */
    justify-content: center;
    gap: 6px;
}

.mob-val {
    display: block;
    max-height: 100px; /* din grænse */
    overflow: hidden;
    position: relative;
}

/* Når der ER klippet, laver vi plads til knappen */
.mob-val--truncated {
    padding-right: 60px; /* så teksten ikke ligger under knappen */
}

.mob-val__more {
    position: absolute;
    right: 0;
    bottom: 0;
    font-size: 11px;
    border: none;
    background: none;
    padding: 0 0 0 4px;
    color: #0070c9;
    cursor: pointer;
}

/* Når vi viser hele teksten */
.mob-val--expanded {
    max-height: none;
    overflow: visible;
}

/* Teksten i Seneste besked må aldrig gøre tabellen bredere end skærmen */
.mob-val {
    display: block;
    word-break: break-word; /* bryd meget lange ord / links */
    overflow-wrap: break-word; /* ekstra sikkerhed, bryd hvor som helst */
}

.pair-value {
    display: block;
    max-width: 100%;
    word-break: break-word; /* bryd meget lange ord / links */
    overflow-wrap: break-word; /* ekstra sikkerhed, bryd hvor som helst */
}

.tab-btn {
    position: relative;
}

    /* Fælles stil for dag-badges */
    .tab-btn .day-count {
        display: inline-block;
        font-size: 11px;
        padding: 1px 6px;
        border-radius: 10px;
        margin-left: 4px;
        background: #eef5ff;
        color: #1f4b7a;
        border: 1px solid #c2d7ff;
        vertical-align: middle;
        white-space: nowrap;
    }

        /* Skjul helt hvis der ikke er tekst (0 møder) */
        .tab-btn .day-count:empty {
            display: none;
        }

    /* Hvis du vil skelne visuelt mellem i dag / i morgen */
    .tab-btn .day-today, tr.mobile-card.showInfo.day-today > td::after {
        background: #ffe9e9;
        border-color: #ffb3b3;
        color: #8a1c1c;
    }

    .tab-btn .day-tomorrow, tr.mobile-card.showInfo.day-tomorrow > td::after {
        background: #e9fff0;
        border-color: #b3ffd1;
        color: #176033;
    }

.status-actions {
    text-align: right;
    margin-bottom: 10px;
}

.zero-status {
    display:none!important;
}

.finish-status-btn {
    float:left;
}

.centered {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dashboard-logo {
    height: 60px; /* større logo */
    margin-bottom: 8px;
    object-fit: contain;
}


/* Fuldskærms loader-overlay */
.full-screen-loader {
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0; */
    background: var(--accent);
    background: radial-gradient(circle at top, var(--accent) 0, #1f2a3f 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: #fff;
}

/* Indholdet i midten */
.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* Selve spinneren */
.loader-spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    animation: loader-spin 0.9s linear infinite;
}

.loader-content p {
    font-size: 16px;
    opacity: 0.9;
}

/* Simpel spin-animation */
@keyframes loader-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Genbrug gerne din hidden-klasse til at skjule loaderen */
.hidden {
    display: none !important;
}

/* Kun let ekstra styling til optout, ingen layout-hacks */
body.optout-body {
    /* Behold det normale dashboard layout – ændr kun fx baggrundsfarve hvis du vil */
    background-color: #f5f5f5;
}

/* 1) Dæmp hele kortet */
tr.mobile-card.dimmed .mob-card-box {
    opacity: .55;
    filter: grayscale(.8);
}

/* 2) Badge i headeren (mob-hdr) */
tr.mobile-card.showInfo > td {
    position: relative;
}

tr.mobile-card.showInfo > td::after {
    content: attr(data-infotext);
    position: absolute;
    right: 15px;
    top: 0px; /* fast top */
    transform: none; /* ingen 50% hack */

    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(0,0,0,.18);
    background: rgba(255,255,255,.7);
    white-space: nowrap;
    z-index: 10;
}

    /* tooltip */
    tr.mobile-card.showInfo > td[data-infoTooltip]:not([data-infoTooltip=""])::before {
        content: attr(data-infoTooltip);
        position: absolute;
        right: 15px;
        top: 28px;
        background: #111;
        color: #fff;
        font-size: 11px;
        padding: 6px 8px;
        border-radius: 6px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: .2s;
    }

tr.mobile-card.showInfo:hover > td::before {
    opacity: 1;
}

/* 4) Valgfrit: gør "Vis detaljer" stadig klikbar hvis du vil */
tr.mobile-card.showInfo button.show-details {
    pointer-events: auto;
    opacity: 1;
}

#logoutLink {
    display: none;
}

.menu-center-offset {
    position: absolute;
    left: 53%;
    top: 14px;
    transform: translateX(-50%) translateX(200px);
    z-index:1000;
}

#searchBoxWrapper {
    width: 500px;
    height: 0px;
    left: 1%;
    z-index: 100;
}

#searchBoxWrapper > button {
    float: left;
    font-size: 200%;
}

.search-left {
    position: relative; /* reference */
    display: inline-block;
}

.search-container {
    position: absolute;
    width: 96%;
    left: 0;
    background: #fff;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,.15);
    display: none;
    z-index: 999;
}

.search-container input {
    width: 220px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,.2);
}

.clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(0,0,0,.25);
    border-radius: 999px; /* helt rund */
    background: #fff;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all .15s ease;
    padding: 0px;
}

    .clear-btn:hover {
        background: #f2f2f2;
        border-color: rgba(0,0,0,.4);
        color: #000;
    }

    .clear-btn:active {
        transform: translateY(-50%) scale(.95);
    }

@media (max-width: 500px) {
    .menu-center-offset {
        transform: translateX(-50%) translateX(160px);
    }

    #searchBoxWrapper {
        width: 350px;
    }
}

.logout-btn, .user-menu-btn {
    position: relative;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    color: #444;
    background: #f1f1f1;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
}

    /* hover */
    .logout-btn:hover, .user-menu-btn:hover {
        background: #e5e5e5;
        color: #000;
    }

    /* ---------- LOADING STATE ---------- */

    .logout-btn.loading, .user-menu-btn.loading {
        pointer-events: none;
        color: transparent; /* skjul teksten */
    }

        /* spinner i midten */
        .logout-btn.loading::after, .user-menu-btn.loading::after {
            content: '';
            width: 12px;
            height: 12px;
            border: 2px solid #bbb;
            border-top-color: #444;
            border-radius: 50%;
            animation: logout-spin 0.8s linear infinite;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

/* animation */
@keyframes logout-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Center + luft */
.login-shell {
    display: flex;
    justify-content: center;
    padding: 20px;
}

/* “Card” som dashboard-områder */
.login-card {
    width: 100%;
    max-width: 520px; /* <- fylder ikke hele bredden */
    background: #fff;
    border: 1px solid #e8eaee;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.06);
    padding: 18px 18px 16px;
}

.login-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
}

.login-status {
    margin: 0 0 10px;
    font-size: 13px;
    color: #444;
}

.login-form {
    margin: 0;
}

.login-label {
    display: block;
    font-size: 12px;
    color: #555;
    margin-bottom: 6px;
}

.login-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.login-input {
    flex: 1;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #dfe3ea;
    border-radius: 8px;
    outline: none;
    font-size: 13px;
}

.login-input:focus {
    border-color: #b8c4ff;
    box-shadow: 0 0 0 3px rgba(184,196,255,0.35);
}

.login-btn {
    height: 34px;
    padding: 0 12px;
    border: 1px solid #dfe3ea;
    background: #f1f1f1;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

    .login-btn:hover {
        background: #e5e5e5;
    }

.login-help {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

/* Mobil: knap under input */
@media (max-width: 520px) {
    .login-row {
        flex-direction: column;
        align-items: stretch;
    }

    .login-btn {
        width: 100%;
    }
}

.icon-only-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: black;
    float: right;
    margin-top: -10px; 
}

/* Hover */
.icon-only-btn:hover {
    color: #1a73e8;
}

.status-extra-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.status-extra-dialog {
    background: #fff;
    border-radius: 8px;
    padding: 16px 18px;
    max-width: 420px;
    width: 85%;
    box-shadow: 0 4px 18px rgba(0,0,0,.18);
    font-size: 14px;
}

.status-extra-dialog h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.status-extra-dialog .field {
    margin-bottom: 10px;
}

.status-extra-dialog label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.search-left input,
.status-extra-dialog input,
.status-extra-dialog textarea,
.status-extra-dialog select {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font: inherit;
}

.status-extra-dialog textarea {
    min-height: 70px;
    resize: vertical;
}

.status-extra-dialog .actions {
    margin-top: 12px;
    text-align: right;
}

.status-extra-dialog .actions button {
    margin-left: 8px;
}

.hideInFlow {
    display:none;
}

.user-menu {
    position: relative;
    display: inline-block;
}


    .user-menu-btn:hover {
        background: #005fa3;
    }

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 110%;
    background: white;
    min-width: 160px;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,.15);
    overflow: hidden;
    z-index: 1000;
}

.user-dropdown a {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

.user-dropdown a:hover {
    background: #f3f6fa;
}

.user-dropdown.show {
    display: block;
}

.menu-link {
    border: none;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}
