﻿/* =========================================================
   Base / layout
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
}

.centered {
    width: min(100% - 32px, 1220px);
    margin-left: auto;
    margin-right: auto;
}

.insights-header.centered {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#menu.menu-center-offset {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

canvas {
    max-width: 100%;
}

#leadFlowOverview {
    width: 100%;
    max-width: 1200px;
    margin: 0px 0px 25px;
    padding: 0 24px;
}

/* =========================================================
   Range / slider
========================================================= */

.range-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 24px auto;
    text-align: center;
}

    .range-wrapper label {
        display: block;
        margin-bottom: 6px;
        font-weight: 600;
    }

#daysSlider {
    width: 100%;
    accent-color: #111;
}

.total-saved {
    margin-top: 8px;
    font-size: 14px;
}

/* =========================================================
   ROI dashboard / old charts
========================================================= */

.roi-dashboard {
    width: 100%;
    max-width: 900px;
    margin: 32px auto;
    font-family: sans-serif;
}

    .roi-dashboard h2 {
        text-align: center;
    }

.kpi-box {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

    .kpi-box > div {
        min-width: 220px;
        text-align: center;
    }

.kpi-label {
    font-size: 14px;
    color: #777;
}

.kpi-value {
    font-size: 20px; /* ca. 30% mindre end 28px */
    font-weight: bold;
}

.chart-section {
    width: 100%;
    margin: 32px auto;
    padding: 24px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.05);
}

#stageFunnelTable {
    width: 100%;
}

/* =========================================================
   LeadFlow dashboard container
========================================================= */

.lfo-dashboard {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    font-size: 13px;
}

.lfo-brand-name {
    font-size: 20px;
}

.lfo-active {
    font-size: 13px;
}

.lfo-live {
    font-size: 12px;
}

/* =========================================================
   Top KPI cards
========================================================= */

.lfo-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.lfo-kpi {
    min-width: 0;
    min-height: 120px;
    padding: 22px;
    gap: 18px;
}

.lfo-kpi-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    font-size: 26px;
}

.lfo-kpi-title,
.lfo-label {
    font-size: 12px;
    line-height: 1.25;
}

.lfo-kpi-value {
    font-size: 31px; /* ca. 30% mindre end 44px */
}

.lfo-kpi-change {
    font-size: 11px; /* ca. 30% mindre end 16px */
}

/* =========================================================
   Main grid / panels
========================================================= */

.lfo-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 20px;
}

.lfo-panel {
    min-width: 0;
    overflow: hidden;
    padding: 22px;
}

.lfo-panel-title {
    font-size: 15px; /* ca. 30% mindre end 22px */
    margin-bottom: 22px;
}

    .lfo-panel-title span {
        font-size: 20px; /* ca. 30% mindre end 28px */
    }

.lfo-card-small {
    min-width: 0;
    overflow: hidden;
    padding: 16px;
}

.lfo-big {
    font-size: 29px; /* ca. 30% mindre end 42px */
}

/* =========================================================
   Reagerende leads
   Booking rate øverst, booket efter under
========================================================= */

.lfo-reacting-grid,
.lfo-reacting-stack {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-bottom: 18px;
}

.lfo-booking-rate-card,
.lfo-booked-after-card {
    width: 100%;
}

.lfo-booking-rate-card {
    min-height: auto;
}

    .lfo-booking-rate-card .lfo-big {
        font-size: 34px; /* ca. 30% mindre end 48px */
    }

/* =========================================================
   Booket efter
   En separat boks pr. kontakttrin
========================================================= */

.lfo-booked-after {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-top: 16px !important;
}

/* Skjul den gamle item-variant hvis den stadig findes i DOM */
.lfo-booked-after-item {
    display: none !important;
}

.lfo-booked-after-box {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(8, 13, 18, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.lfo-booked-after-left {
    min-width: 0;
}

.lfo-booked-after-label {
    color: #f8fafc;
    font-size: 10px; /* ca. 30% mindre end 14px */
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
}

.lfo-booked-after-percent {
    margin-top: 4px;
    color: #68d33b;
    font-size: 10px; /* ca. 30% mindre end 14px */
    font-weight: 900;
    line-height: 1.2;
}

.lfo-booked-after-count {
    color: #ffffff;
    font-size: 22px; /* ca. 30% mindre end 32px */
    font-weight: 900;
    line-height: 1;
    margin-left: 16px;
}

/* =========================================================
   Lists
========================================================= */

.lfo-list-box {
    padding: 16px;
}

.lfo-list-row {
    min-width: 0;
    min-height: 44px;
    font-size: 12px;
}

.lfo-booking-row {
    grid-template-columns: 12px minmax(0, 1fr) 88px 48px 60px;
    gap: 8px;
}

.lfo-cold-row {
    grid-template-columns: minmax(0, 1fr) 70px 12px;
    gap: 8px;
}

.lfo-list-row strong,
.lfo-name,
.lfo-channel {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lfo-channel {
    font-size: 11px;
}

.lfo-dot {
    width: 7px;
    height: 7px;
}

/* =========================================================
   Cold leads / response box
========================================================= */

.lfo-response-box {
    min-height: 130px;
    padding: 16px;
}

.lfo-response-change {
    font-size: 11px; /* ca. 30% mindre end 15px */
}

.lfo-cold-row .red {
    color: #ef4444;
    font-weight: 900;
}

.lfo-cold-row .yellow {
    color: #f6b51d;
    font-weight: 900;
}

.lfo-cold-row .green {
    color: #68d33b;
    font-weight: 900;
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 1050px) {
    .lfo-kpis {
        grid-template-columns: 1fr;
    }

    .lfo-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .lfo-reacting-grid,
    .lfo-reacting-stack {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 700px) {
    #leadFlowOverview {
        padding: 0 12px;
    }

    .lfo-dashboard {
        padding: 18px;
        border-radius: 14px;
    }

    .lfo-kpi-value,
    .lfo-big {
        font-size: 25px; /* ca. 30% mindre end 36px */
    }

    .lfo-panel-title {
        font-size: 13px; /* ca. 30% mindre end 18px */
    }

    .lfo-booked-after-box {
        align-items: flex-start;
    }

    .lfo-booking-row,
    .lfo-cold-row {
        grid-template-columns: 1fr;
        padding: 14px 0;
    }

    .lfo-dot {
        display: none;
    }
}

.history-controls {
    width: min(100% - 32px, 1200px);
    margin: 24px auto 0;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

    .history-controls label {
        font-weight: 700;
        color: #111827;
    }

    .history-controls input {
        padding: 8px 10px;
        border-radius: 10px;
        border: 1px solid #d1d5db;
    }

    .history-controls button {
        padding: 9px 14px;
        border: 0;
        border-radius: 10px;
        background: #111827;
        color: white;
        font-weight: 700;
        cursor: pointer;
    }

.history-controls {
    width: min(100% - 32px, 1200px);
    margin: 24px auto 0;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

    .history-controls label {
        font-weight: 700;
        color: #111827;
    }

    .history-controls input {
        padding: 8px 10px;
        border-radius: 10px;
        border: 1px solid #d1d5db;
    }

    .history-controls button {
        padding: 9px 14px;
        border: 0;
        border-radius: 10px;
        background: #111827;
        color: white;
        font-weight: 700;
        cursor: pointer;
    }

        .history-controls button:hover {
            background: #1f2937;
        }