
/* R45-P8.3 — Beds Executive Comparison UX Redesign */
.page-beds {
    --b83-ink: #101a33;
    --b83-muted: #64728d;
    --b83-line: #dce4ef;
    --b83-soft: #f6f8fc;
    --b83-primary: #5146e5;
    --b83-compare: #14a89a;
    --b83-navy: #0a2850;
    --b83-navy-2: #0d4563;
    --b83-shadow: 0 14px 42px rgba(31, 51, 82, .08);
}

.page-beds .beds83-page {
    display: grid;
    gap: 18px;
    color: var(--b83-ink);
}

.page-beds .beds83-controls,
.page-beds .beds83-card,
.page-beds .beds83-details {
    background: #fff;
    border: 1px solid var(--b83-line);
    border-radius: 22px;
    box-shadow: var(--b83-shadow);
}

.page-beds .beds83-controls {
    display: grid;
    grid-template-columns: minmax(235px, .62fr) minmax(0, 2.38fr);
    grid-template-areas:
        "copy filter"
        "note note"
        "alert alert";
    gap: 14px 22px;
    padding: 18px 20px;
    align-items: end;
}

.page-beds .beds83-controls-copy { grid-area: copy; align-self: center; min-width: 0; }
.page-beds .beds83-controls-copy > span,
.page-beds .beds83-card-head span,
.page-beds .beds83-agenda header span,
.page-beds .beds83-unit-head > div > span,
.page-beds .beds83-details summary span {
    display: block;
    color: #5b21b6;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .045em;
}
.page-beds .beds83-controls-copy strong {
    display: block;
    margin: 6px 0 5px;
    font-size: 21px;
    line-height: 1.25;
}
.page-beds .beds83-controls-copy strong i {
    margin: 0 5px;
    color: #6d28d9;
    font-size: 13px;
    font-style: normal;
}
.page-beds .beds83-controls-copy p {
    margin: 0;
    color: var(--b83-muted);
    font-size: 14px;
    line-height: 1.45;
}

.page-beds .beds83-filter {
    grid-area: filter;
    display: grid;
    grid-template-columns: minmax(135px, .8fr) minmax(115px, .65fr) minmax(115px, .65fr) minmax(235px, 1.35fr) minmax(105px, .55fr);
    gap: 10px;
    align-items: end;
    min-width: 0;
}
.page-beds .beds83-filter.is-range {
    grid-template-columns: minmax(125px, .7fr) minmax(145px, .8fr) minmax(145px, .8fr) minmax(115px, .65fr) minmax(220px, 1.2fr) minmax(105px, .55fr);
}
.page-beds .beds83-filter label { min-width: 0; }
.page-beds .beds83-filter label > span {
    display: block;
    margin: 0 0 6px;
    color: #3f4d68;
    font-size: 11px;
    font-weight: 900;
}
.page-beds .beds83-filter select,
.page-beds .beds83-filter input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d8e0ec;
    border-radius: 13px;
    background: #fff;
    padding: 0 12px;
    color: var(--b83-ink);
    font: inherit;
    font-weight: 750;
}
.page-beds .beds83-filter button {
    min-height: 46px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #5630b5, #168fa7);
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}
.page-beds .beds83-contract-note {
    grid-area: note;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #dce4ef;
    border-radius: 12px;
    background: #f7f9fc;
    color: #43506a;
    font-size: 13px;
}
.page-beds .beds83-contract-note.is-fair {
    border-color: #c7e7d7;
    background: #f1faf5;
    color: #235b45;
}
.page-beds .beds83-contract-note > span {
    display: grid;
    place-items: center;
    flex: 0 0 23px;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    background: #e8e2fa;
    color: #5b21b6;
    font-weight: 900;
}
.page-beds .beds83-contract-note.is-fair > span { background: #d8f1e3; color: #087f63; }
.page-beds .beds83-contract-note p { margin: 0; }
.page-beds .beds83-alert { grid-area: alert; margin: 0; color: #9f1239; font-weight: 800; }

.page-beds .beds83-state {
    padding: 28px;
    border: 1px solid #fecdd3;
    border-radius: 20px;
    background: #fff1f2;
}

.page-beds .beds83-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.14fr) minmax(430px, .86fr);
    grid-template-areas:
        "copy metrics"
        "live live";
    gap: 18px 28px;
    padding: 26px;
    border-radius: 24px;
    background: linear-gradient(132deg, var(--b83-navy) 0%, #0b345b 56%, var(--b83-navy-2) 100%);
    color: #fff;
    box-shadow: 0 20px 54px rgba(7, 39, 76, .18);
}
.page-beds .beds83-hero:after {
    content: "";
    position: absolute;
    right: -100px;
    bottom: -150px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.08);
}
.page-beds .beds83-hero-copy { grid-area: copy; position: relative; z-index: 1; }
.page-beds .beds83-hero-copy > span {
    color: #7ee7dc;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .06em;
}
.page-beds .beds83-hero-copy h2 {
    margin: 9px 0 6px;
    color: #fff;
    font-size: clamp(32px, 3vw, 44px);
    line-height: 1.05;
    letter-spacing: -.035em;
}
.page-beds .beds83-hero-movement {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin: 4px 0 13px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    color: #fff !important;
    font-size: 17px;
    font-weight: 900;
}
.page-beds .beds83-hero-copy p {
    max-width: 720px;
    margin: 0;
    color: #d9e7f4;
    font-size: 16px;
    line-height: 1.65;
}
.page-beds .beds83-period-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    color: #fff;
    font-size: 13px;
}
.page-beds .beds83-period-line i { color: #7ee7dc; font-style: normal; font-weight: 900; }

.page-beds .beds83-hero-metrics {
    grid-area: metrics;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-self: center;
}
.page-beds .beds83-hero-metrics article {
    min-width: 0;
    padding: 15px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 16px;
    background: rgba(255,255,255,.09);
    backdrop-filter: blur(6px);
}
.page-beds .beds83-hero-metrics span {
    display: block;
    min-height: 32px;
    color: #bcd2e6;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
}
.page-beds .beds83-hero-metrics strong {
    display: block;
    margin: 7px 0 5px;
    color: #fff;
    font-size: 32px;
    line-height: 1;
}
.page-beds .beds83-hero-metrics small { color: #d4e3ef; font-weight: 750; }

.page-beds .beds83-live-strip {
    grid-area: live;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(100px, .55fr)) minmax(230px, 1.8fr);
    gap: 0;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 15px;
    background: rgba(255,255,255,.075);
}
.page-beds .beds83-live-strip > span {
    padding: 10px 14px;
    border-right: 1px solid rgba(255,255,255,.12);
}
.page-beds[dir="rtl"] .beds83-live-strip > span { border-right: 0; border-left: 1px solid rgba(255,255,255,.12); }
.page-beds .beds83-live-strip small { display: block; color: #bcd2e6; font-size: 10px; font-weight: 800; }
.page-beds .beds83-live-strip b { display: block; margin-top: 3px; color: #fff; font-size: 21px; }
.page-beds .beds83-live-strip em {
    align-self: center;
    padding: 10px 15px;
    color: #d5e5f1;
    font-size: 12px;
    font-style: normal;
    line-height: 1.4;
}

.page-beds .beds83-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(315px, .55fr);
    gap: 18px;
}
.page-beds .beds83-card { padding: 21px; }
.page-beds .beds83-card-head,
.page-beds .beds83-unit-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}
.page-beds .beds83-card-head h2,
.page-beds .beds83-agenda h2,
.page-beds .beds83-unit-head h2 {
    margin: 6px 0 5px;
    color: var(--b83-ink);
    font-size: clamp(25px, 2.2vw, 31px);
    line-height: 1.15;
    letter-spacing: -.025em;
}
.page-beds .beds83-card-head p,
.page-beds .beds83-unit-head p {
    margin: 0;
    color: var(--b83-muted);
    line-height: 1.5;
}
.page-beds .beds83-legend {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #46536c;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.page-beds .beds83-legend i { width: 10px; height: 10px; border-radius: 3px; }
.page-beds .beds83-legend .is-primary { background: var(--b83-primary); }
.page-beds .beds83-legend .is-compare { background: var(--b83-compare); }
.page-beds .beds83-chart-stage { position: relative; min-height: 370px; margin-top: 8px; }
.page-beds .beds83-chart-target { min-height: 360px; height: 360px; }

.page-beds .beds83-agenda header { margin-bottom: 12px; }
.page-beds .beds83-agenda article {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
    padding: 14px 0;
    border-top: 1px solid var(--b83-line);
}
.page-beds .beds83-agenda article:first-of-type { border-top: 0; }
.page-beds .beds83-agenda article > div span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: #eee9ff;
    color: #5b21b6;
    font-weight: 900;
}
.page-beds .beds83-agenda article small { display: block; color: var(--b83-muted); font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.page-beds .beds83-agenda article strong { display: block; margin: 4px 0; font-size: 16px; line-height: 1.3; }
.page-beds .beds83-agenda article b { color: #0c7181; font-size: 15px; }
.page-beds .beds83-agenda article p { margin: 7px 0 0; color: var(--b83-muted); font-size: 13px; line-height: 1.45; }

.page-beds .beds83-unit-review { padding: 21px; }
.page-beds .beds83-unit-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(115px, 1fr));
    gap: 8px;
}
.page-beds .beds83-unit-kpis span {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--b83-line);
    border-radius: 13px;
    background: var(--b83-soft);
}
.page-beds .beds83-unit-kpis small { display: block; min-height: 28px; color: var(--b83-muted); font-size: 10px; font-weight: 800; }
.page-beds .beds83-unit-kpis b { display: block; margin-top: 4px; font-size: 20px; }
.page-beds .beds83-unit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.62fr) minmax(250px, .38fr);
    gap: 16px;
    margin-top: 12px;
}
.page-beds .beds83-unit-chart { position: relative; min-height: 335px; }
.page-beds .beds83-unit-chart .beds83-chart-target { height: 330px; min-height: 330px; }
.page-beds .beds83-bed-signals {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    background: #f6f8fc;
}
.page-beds .beds83-bed-signals article {
    padding: 12px;
    border: 1px solid var(--b83-line);
    border-radius: 13px;
    background: #fff;
}
.page-beds .beds83-bed-signals small { display: block; color: var(--b83-muted); font-size: 10px; font-weight: 900; }
.page-beds .beds83-bed-signals strong { display: block; margin: 5px 0; font-size: 15px; }
.page-beds .beds83-bed-signals b { color: #0c7181; }
.page-beds .beds83-bed-signals > p { margin: 2px 1px 0; color: var(--b83-muted); font-size: 13px; line-height: 1.45; }

.page-beds .beds83-details { overflow: hidden; }
.page-beds .beds83-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 20px;
    cursor: pointer;
    list-style: none;
}
.page-beds .beds83-details summary::-webkit-details-marker { display: none; }
.page-beds .beds83-details summary strong { display: block; margin-top: 4px; font-size: 17px; }
.page-beds .beds83-details summary > b {
    padding: 8px 12px;
    border-radius: 999px;
    background: #f0ecff;
    color: #5b21b6;
    font-size: 12px;
}
.page-beds .beds83-details[open] summary { border-bottom: 1px solid var(--b83-line); }
.page-beds .beds83-detail-content { display: grid; gap: 18px; padding: 20px; }
.page-beds .beds83-detail-content section { min-width: 0; }
.page-beds .beds83-detail-content header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.page-beds .beds83-detail-content h3 { margin: 0; font-size: 20px; }
.page-beds .beds83-detail-content header p { margin: 0; color: var(--b83-muted); }
.page-beds .beds83-table-wrap { overflow: auto; border: 1px solid var(--b83-line); border-radius: 14px; }
.page-beds .beds83-table-wrap table { width: 100%; min-width: 720px; border-collapse: collapse; }
.page-beds .beds83-table-wrap th,
.page-beds .beds83-table-wrap td { padding: 13px 14px; border-bottom: 1px solid var(--b83-line); text-align: left; }
.page-beds[dir="rtl"] .beds83-table-wrap th,
.page-beds[dir="rtl"] .beds83-table-wrap td { text-align: right; }
.page-beds .beds83-table-wrap th { background: #f5f7fb; color: #4b5871; font-size: 11px; }
.page-beds .beds83-table-wrap tr:last-child td { border-bottom: 0; }

@media (max-width: 1320px) {
    .page-beds .beds83-controls { grid-template-columns: 1fr; grid-template-areas: "copy" "filter" "note" "alert"; }
    .page-beds .beds83-filter,
    .page-beds .beds83-filter.is-range { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .page-beds .beds83-unit-field { grid-column: span 2; }
    .page-beds .beds83-hero { grid-template-columns: 1fr; grid-template-areas: "copy" "metrics" "live"; }
}
@media (max-width: 1060px) {
    .page-beds .beds83-main-grid,
    .page-beds .beds83-unit-grid { grid-template-columns: 1fr; }
    .page-beds .beds83-live-strip { grid-template-columns: repeat(4, 1fr); }
    .page-beds .beds83-live-strip em { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.12); }
}
@media (max-width: 760px) {
    .page-beds .beds83-controls,
    .page-beds .beds83-card,
    .page-beds .beds83-unit-review { padding: 15px; }
    .page-beds .beds83-filter,
    .page-beds .beds83-filter.is-range { grid-template-columns: 1fr; }
    .page-beds .beds83-unit-field { grid-column: auto; }
    .page-beds .beds83-hero { padding: 20px 16px; }
    .page-beds .beds83-hero-metrics,
    .page-beds .beds83-live-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-beds .beds83-live-strip em { grid-column: 1 / -1; }
    .page-beds .beds83-card-head,
    .page-beds .beds83-unit-head { flex-direction: column; }
    .page-beds .beds83-unit-kpis { grid-template-columns: 1fr; width: 100%; }
    .page-beds .beds83-chart-target { height: 320px; min-height: 320px; }
    .page-beds .beds83-detail-content header { flex-direction: column; }
}


/* R45-P8.3.1 — All-units default and scope clarity */
.page-beds .beds831-scope-name {
    font-size: 18px !important;
    line-height: 1.25 !important;
    word-break: break-word;
}
.page-beds .beds83-controls-copy strong {
    word-break: normal;
}


/* R45-P8.4 — Light capacity KPI cards and semantic movement colors */
.page-beds .beds84-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.page-beds .beds84-kpi {
    --tone: #7c3aed;
    position: relative;
    min-width: 0;
    min-height: 150px;
    overflow: hidden;
    padding: 21px 20px 18px;
    border: 1px solid var(--b83-line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15,23,42,.045);
}
.page-beds .beds84-kpi::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--tone);
}
.page-beds[dir="rtl"] .beds84-kpi::before {
    inset: 0 0 0 auto;
}
.page-beds .beds84-kpi::after {
    content: "";
    position: absolute;
    width: 96px;
    height: 96px;
    right: -38px;
    bottom: -48px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--tone) 10%, white);
}
.page-beds[dir="rtl"] .beds84-kpi::after {
    right: auto;
    left: -38px;
}
.page-beds .beds84-kpi.tone-violet { --tone: #7c3aed; }
.page-beds .beds84-kpi.tone-blue { --tone: #2563eb; }
.page-beds .beds84-kpi.tone-teal { --tone: #0f9f8f; }
.page-beds .beds84-kpi.tone-amber { --tone: #d97706; }

.page-beds .beds84-kpi-label {
    display: block;
    margin-bottom: 8px;
    color: #52627a;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}
.page-beds .beds84-kpi > strong {
    position: relative;
    z-index: 1;
    display: block;
    color: var(--b83-ink);
    font-size: clamp(30px, 2.55vw, 42px);
    line-height: 1.05;
    letter-spacing: -.035em;
}
.page-beds .beds84-kpi > small {
    position: relative;
    z-index: 1;
    display: block;
    min-height: 36px;
    margin-top: 8px;
    color: var(--b83-muted);
    font-size: 13px;
    line-height: 1.4;
}
.page-beds .beds84-delta {
    position: relative;
    z-index: 1;
    display: inline-flex;
    width: fit-content;
    margin-top: 8px;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}
.page-beds .beds84-delta.positive {
    color: #047857;
    background: #e8f8f2;
}
.page-beds .beds84-delta.negative {
    color: #c5283d;
    background: #fff0f2;
}
.page-beds .beds84-delta.neutral {
    color: #475569;
    background: #f1f5f9;
}

.page-beds .beds84-summary-card {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(0, 2.25fr);
    gap: 22px;
    align-items: center;
    padding: 22px 24px;
    background: linear-gradient(100deg, #ffffff 0%, #f8f4ff 48%, #effbfd 100%);
}
.page-beds .beds84-summary-intro > span {
    display: block;
    color: #5b21b6;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .045em;
}
.page-beds .beds84-summary-intro h2 {
    margin: 6px 0 8px;
    color: var(--b83-ink);
    font-size: clamp(25px, 2.2vw, 32px);
    line-height: 1.16;
    letter-spacing: -.025em;
}
.page-beds .beds84-summary-intro > strong {
    display: block;
    margin-bottom: 6px;
    font-size: 17px;
    line-height: 1.35;
}
.page-beds .beds84-summary-intro p {
    margin: 0;
    color: var(--b83-muted);
    font-size: 15px;
    line-height: 1.55;
}
.page-beds .beds84-period-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: #43506a;
    font-size: 12px;
}
.page-beds .beds84-period-line i {
    color: #6d28d9;
    font-style: normal;
    font-weight: 900;
}
.page-beds .beds84-summary-signals {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-left: 1px solid #dfe7f2;
}
.page-beds[dir="rtl"] .beds84-summary-signals {
    border-left: 0;
    border-right: 1px solid #dfe7f2;
}
.page-beds .beds84-summary-signals article {
    min-width: 0;
    padding: 10px 16px;
    border-right: 1px solid #dfe7f2;
}
.page-beds[dir="rtl"] .beds84-summary-signals article {
    border-right: 0;
    border-left: 1px solid #dfe7f2;
}
.page-beds .beds84-summary-signals article:last-child {
    border-right: 0;
    border-left: 0;
}
.page-beds .beds84-summary-signals span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
}
.page-beds .beds84-summary-signals strong {
    display: block;
    margin-top: 8px;
    color: var(--b83-ink);
    font-size: 18px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.page-beds .beds84-summary-signals small {
    display: block;
    margin-top: 6px;
    color: #53657f;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
}

/* Semantic movement colors across the whole Beds page. */
.page-beds .is-positive,
.page-beds .is-up {
    color: #047857 !important;
}
.page-beds .is-negative,
.page-beds .is-down {
    color: #c5283d !important;
}
.page-beds .is-neutral {
    color: #64748b !important;
}
.page-beds .beds83-agenda article b,
.page-beds .beds83-bed-signals b {
    color: inherit;
}
.page-beds .beds83-table-wrap .is-up {
    color: #047857 !important;
}
.page-beds .beds83-table-wrap .is-down {
    color: #c5283d !important;
}

/* Flow-safe header spacing */
.page-beds .elite-topbar--flow-safe {
    margin-bottom: 18px;
}
.page-beds .beds83-page > section,
.page-beds .beds83-page > details {
    scroll-margin-top: 18px;
}

@media (max-width: 1120px) {
    .page-beds .beds84-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .page-beds .beds84-summary-card {
        grid-template-columns: 1fr;
    }
    .page-beds .beds84-summary-signals {
        border-left: 0;
        border-right: 0;
        border-top: 1px solid #dfe7f2;
        padding-top: 10px;
    }
}
@media (max-width: 700px) {
    .page-beds .beds84-kpi-grid {
        grid-template-columns: 1fr;
    }
    .page-beds .beds84-summary-signals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .page-beds .beds84-summary-signals article:nth-child(2) {
        border-right: 0;
    }
}
@media (max-width: 460px) {
    .page-beds .beds84-summary-signals {
        grid-template-columns: 1fr;
    }
    .page-beds .beds84-summary-signals article {
        border-right: 0;
        border-left: 0;
        border-bottom: 1px solid #dfe7f2;
    }
    .page-beds .beds84-summary-signals article:last-child {
        border-bottom: 0;
    }
}
