/*
 * Preise & Belegung (Agent D): Preise, Sperrzeiten, Zusatzoptionen, Preis-Links.
 * Wird automatisch nach admin2.css geladen (AdminPanelProvider, css/fw/admin2-*.css).
 */

/* ---------- Preis-Links: Teilen-Dialog ---------- */
.fw-pl-share {
    display: grid;
    gap: .875rem;
}

.fw-pl-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: .5rem .75rem;
    margin: 0;
    padding: .75rem .875rem;
    border-radius: .75rem;
    background: rgb(249 250 251);
    border: 1px solid rgb(229 231 235);
}

.dark .fw-pl-facts {
    background: rgb(255 255 255 / .04);
    border-color: rgb(255 255 255 / .1);
}

.fw-pl-facts dt {
    font-size: .75rem;
    color: rgb(107 114 128);
}

.fw-pl-facts dd {
    margin: 0;
    font-size: .875rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.fw-pl-facts .fw-pl-price {
    font-size: 1.125rem;
    font-weight: 700;
}

.fw-pl-linkrow input {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .8125rem;
}

.fw-pl-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.fw-pl-message {
    display: grid;
    gap: .375rem;
}

.fw-pl-message-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .25rem .75rem;
    font-size: .8125rem;
    color: rgb(107 114 128);
}

.fw-pl-message-text {
    width: 100%;
    resize: vertical;
    font: inherit;
    font-size: .8125rem;
    line-height: 1.45;
    padding: .5rem .625rem;
    border-radius: .5rem;
    border: 1px solid rgb(229 231 235);
    background: transparent;
    color: inherit;
}

.dark .fw-pl-message-text {
    border-color: rgb(255 255 255 / .1);
}

.fw-pl-warning {
    margin: 0;
    font-size: .8125rem;
    color: rgb(180 83 9);
}

.fw-pl-muted {
    margin: 0;
    color: rgb(107 114 128);
}

/* ---------- Tabellen: Zeilenaktionen (Icons, Bearbeiten, ⋮) in einer Zeile halten ---------- */
@media (min-width: 64rem) {
    :is(.fi-resource-preis-links, .fi-resource-sperrzeiten, .fi-resource-optionen, .fi-resource-preise) .fi-ta-content-ctn:not(.fw-stack) .fi-ta-cell > .fi-ta-actions {
        flex-wrap: nowrap;
    }
}

/* ---------- Sperrzeiten: aeltere Eintraege "Alle Wohnungen", die nicht wirken ---------- */
.fi-ta-row.fw-block-ineffective > td {
    background-color: rgb(254 242 242 / .7);
}

.dark .fi-ta-row.fw-block-ineffective > td {
    background-color: rgb(127 29 29 / .18);
}

/* ---------- Preise: Jahresuebersicht ---------- */
.fw-po {
    margin-bottom: .25rem;
}

.fw-po-body {
    display: grid;
    gap: .625rem;
}

.fw-po-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
}

.fw-po-chip {
    border: 1px solid var(--gray-300);
    background: transparent;
    color: inherit;
    border-radius: 999px;
    padding: .25rem .75rem;
    font-size: .8125rem;
    line-height: 1.25rem;
    cursor: pointer;
}

.fw-po-chip:hover {
    border-color: var(--primary-500);
}

.fw-po-chip.is-active {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: #fff;
    font-weight: 600;
}

.dark .fw-po-chip {
    border-color: var(--gray-600);
}

.fw-po-bar {
    position: relative;
    display: flex;
    height: 2.25rem;
    border-radius: .5rem;
    overflow: hidden;
    background: var(--gray-100);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--gray-950) 8%, transparent);
}

.dark .fw-po-bar {
    background: var(--gray-800);
}

.fw-po-seg {
    min-width: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
    border-right: 1px solid color-mix(in oklab, #fff 70%, transparent);
}

.fw-po-seg:last-of-type {
    border-right: 0;
}

.fw-po-seg span {
    padding-inline: .25rem;
    text-overflow: clip;
    overflow: hidden;
}

.fw-po-seg.is-season,
.fw-po-dot.is-season {
    background: color-mix(in oklab, var(--success-500) 30%, #fff);
    color: var(--success-800, #065f46);
}

.fw-po-seg.is-override,
.fw-po-dot.is-override {
    background: color-mix(in oklab, var(--info-500) 32%, #fff);
    color: var(--info-800, #1e40af);
}

.fw-po-seg.is-gap,
.fw-po-dot.is-gap {
    background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--warning-400) 55%, #fff) 0 6px, color-mix(in oklab, var(--warning-200, #fde68a) 70%, #fff) 6px 12px);
    color: var(--warning-800, #92400e);
}

.dark .fw-po-seg.is-season,
.dark .fw-po-dot.is-season {
    background: color-mix(in oklab, var(--success-500) 45%, var(--gray-900));
    color: #fff;
}

.dark .fw-po-seg.is-override,
.dark .fw-po-dot.is-override {
    background: color-mix(in oklab, var(--info-500) 45%, var(--gray-900));
    color: #fff;
}

.dark .fw-po-seg.is-gap,
.dark .fw-po-dot.is-gap {
    background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--warning-500) 55%, var(--gray-900)) 0 6px, color-mix(in oklab, var(--warning-500) 30%, var(--gray-900)) 6px 12px);
    color: #fff;
}

.fw-po-today {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--gray-900);
    box-shadow: 0 0 0 1px #fff;
    pointer-events: none;
}

.dark .fw-po-today {
    background: #fff;
    box-shadow: 0 0 0 1px var(--gray-900);
}

.fw-po-months {
    display: flex;
    margin-top: -.25rem;
    font-size: .6875rem;
    color: var(--gray-500);
}

.fw-po-months span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    padding-left: .125rem;
    border-left: 1px solid var(--gray-200);
}

.dark .fw-po-months span {
    border-color: var(--gray-700);
}

.fw-po-months small {
    font-size: inherit;
    color: var(--gray-400);
}

.fw-po-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
    font-size: .75rem;
    color: var(--gray-600);
}

.dark .fw-po-legend {
    color: var(--gray-400);
}

.fw-po-legend span {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}

.fw-po-dot {
    display: inline-block;
    width: .75rem;
    height: .75rem;
    border-radius: .1875rem;
    flex: none;
    vertical-align: -.0625rem;
}

.fw-po-dot.is-today {
    width: 2px;
    height: .875rem;
    border-radius: 0;
    background: var(--gray-900);
}

.dark .fw-po-dot.is-today {
    background: #fff;
}

.fw-po-gaps {
    border-radius: .75rem;
    padding: .625rem .75rem;
    background: color-mix(in oklab, var(--warning-500) 10%, transparent);
    border: 1px solid color-mix(in oklab, var(--warning-500) 35%, transparent);
    font-size: .875rem;
}

.fw-po-gaps-head {
    display: flex;
    gap: .5rem;
    align-items: flex-start;
}

.fw-po-gaps-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex: none;
    color: var(--warning-600);
}

.fw-po-gaps ul {
    margin: .375rem 0 0 1.75rem;
    padding: 0;
    list-style: none;
    display: grid;
    gap: .25rem;
}

.fw-po-gaps li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .125rem 1rem;
}

.fw-po-ok {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    font-size: .875rem;
    color: var(--success-700);
}

.fw-po-ok-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex: none;
}

.fw-po-toggle {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--primary-700);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.dark .fw-po-toggle {
    color: var(--primary-400);
}

.fw-po-toggle-icon {
    width: 1rem;
    height: 1rem;
    transition: transform .15s ease;
}

.fw-po-toggle-icon.is-open {
    transform: rotate(90deg);
}

.fw-po-table {
    width: 100%;
    margin-top: .5rem;
    border-collapse: collapse;
    font-size: .8125rem;
}

.fw-po-table th {
    text-align: left;
    font-weight: 600;
    color: var(--gray-500);
    padding: .375rem .5rem;
    border-bottom: 1px solid var(--gray-200);
}

.fw-po-table td {
    padding: .375rem .5rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
}

.dark .fw-po-table th,
.dark .fw-po-table td {
    border-color: var(--gray-800);
}

.fw-po-table .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.fw-po-table small {
    display: block;
    color: var(--gray-500);
    font-size: .75rem;
}

.fw-po-table tr.is-gap td {
    background: color-mix(in oklab, var(--warning-500) 7%, transparent);
}

@media (max-width: 39.98rem) {
    .fw-po-months small {
        display: none;
    }

    .fw-po-seg span {
        display: none;
    }
}

/* ---------- Preise: Preisrechner ---------- */
.fw-calc {
    display: grid;
    gap: .75rem;
    align-content: start;
}

.fw-calc-empty {
    display: grid;
    justify-items: center;
    gap: .5rem;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--gray-500);
    border: 1px dashed var(--gray-300);
    border-radius: .75rem;
}

.dark .fw-calc-empty {
    border-color: var(--gray-700);
}

.fw-calc-empty p {
    margin: 0;
    font-size: .875rem;
}

.fw-calc-empty-icon {
    width: 2rem;
    height: 2rem;
}

.fw-calc-head {
    padding: .75rem 1rem;
    border-radius: .75rem;
    background: color-mix(in oklab, var(--primary-500) 10%, transparent);
    border: 1px solid color-mix(in oklab, var(--primary-500) 30%, transparent);
}

.fw-calc-total {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.fw-calc-sub {
    font-size: .8125rem;
    color: var(--gray-600);
}

.dark .fw-calc-sub {
    color: var(--gray-400);
}

.fw-calc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.fw-calc-table td {
    padding: .5rem .25rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
}

.dark .fw-calc-table td {
    border-color: var(--gray-800);
}

.fw-calc-table .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    padding-left: .75rem;
}

.fw-calc-table tr.is-sub td {
    color: var(--gray-600);
    font-weight: 500;
}

.fw-calc-table tr.is-total td {
    border-bottom: 0;
    border-top: 2px solid var(--gray-300);
    font-weight: 700;
    font-size: 1rem;
}

.fw-calc-line {
    font-weight: 500;
}

.fw-calc-meta {
    font-size: .75rem;
    color: var(--gray-500);
}

.fw-calc-badge {
    display: inline-block;
    margin-left: .375rem;
    padding: 0 .375rem;
    border-radius: .375rem;
    font-size: .6875rem;
    font-weight: 600;
    line-height: 1.125rem;
    background: color-mix(in oklab, var(--warning-500) 18%, transparent);
    color: var(--warning-700);
    vertical-align: .0625rem;
}

.fw-calc-msg {
    display: grid;
    gap: .25rem;
    padding: .5rem .75rem;
    border-radius: .5rem;
    font-size: .8125rem;
    background: var(--gray-50);
    color: var(--gray-700);
}

.dark .fw-calc-msg {
    background: var(--gray-800);
    color: var(--gray-300);
}

.fw-calc-msg p {
    margin: 0;
}

.fw-calc-msg.is-warning {
    background: color-mix(in oklab, var(--warning-500) 12%, transparent);
    color: var(--warning-800, #92400e);
}

.fw-calc-msg.is-danger {
    background: color-mix(in oklab, var(--danger-500) 12%, transparent);
    color: var(--danger-700);
}

.dark .fw-calc-msg.is-warning {
    color: var(--warning-300);
}

.dark .fw-calc-msg.is-danger {
    color: var(--danger-300);
}

/* Preise-Tabelle: Zeitraum nicht mitten im Datum umbrechen */
@media (min-width: 64rem) {
    .fi-resource-preise .fi-ta-content-ctn:not(.fw-stack) .fi-ta-cell-start-date {
        min-width: 9rem;
    }
}

/* Zusatzoptionen-Tabelle: kurze Spalten nicht zerbrechen */
@media (min-width: 64rem) {
    .fi-resource-optionen .fi-ta-content-ctn:not(.fw-stack) .fi-ta-cell-price {
        min-width: 8.5rem;
    }

    .fi-resource-optionen .fi-ta-content-ctn:not(.fw-stack) .fi-ta-cell-booking-setting {
        min-width: 9.5rem;
    }
}

/* Jahresuebersicht: Wohnungs-Chips auf schmalen Bildschirmen unter die Ueberschrift */
.fw-po > .fi-section-header {
    flex-wrap: wrap;
    row-gap: .5rem;
}

.fw-po > .fi-section-header .fi-section-header-text-ctn {
    min-width: 14rem;
    flex: 1 1 14rem;
}

.fw-po > .fi-section-header .fi-section-header-after-ctn {
    max-width: 100%;
}

@media (max-width: 39.98rem) {
    .fw-po > .fi-section-header .fi-section-header-after-ctn {
        flex-basis: 100%;
    }
}
