/* ===== PARTNER DASHBOARD: the day on top, the period below, the chart filling the rest of the window ===== */

.hv-pd {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: var(--hv-pd-height, auto);
}

/* With the menu hidden, the floating ☰ (filament-sidebar.css) takes the top-left corner: the panels start under it,
   inside the page's fitted height, so the chart gives up the room. */
@media (min-width: 64rem) {
    .fi-body-has-sidebar-fully-collapsible-on-desktop .fi-main-ctn:not(.fi-main-ctn-sidebar-open) .hv-pd {
        padding-top: 40px;
    }
}

/* Each band is a panel of its own, so the day stands apart from the period's filters, figures and chart. */
.hv-pd-band {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
}

.hv-pd-band--grow {
    flex: 1;
    min-height: 0;
}

.hv-pd-band__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
}

.hv-pd-band__title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.hv-pd-band__meta {
    font-size: 12.5px;
    color: #6b7280;
}

.hv-pd-refresh {
    display: inline-flex;
    margin-left: 4px;
    padding: 4px;
    border-radius: 6px;
    color: #9e7f59;
    vertical-align: middle;
}

.hv-pd-refresh:hover {
    background: #f3f4f6;
}

.hv-pd-refresh:focus-visible {
    outline: 2px solid #c4a97d;
    outline-offset: 1px;
}

.hv-pd-refresh__icon {
    width: 16px;
    height: 16px;
}

/* A turn every 0.7s while the page fetches (hv-spin: admin-dashboard.css). */
.hv-pd-refresh--spinning .hv-pd-refresh__icon {
    animation: hv-spin 0.7s linear infinite;
}

.hv-pd-filters .db-topbar {
    margin-bottom: 0;
}

/* ── The day's cards: one row on a desktop whatever the partner's rights leave ── */

.hv-pd-day {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.hv-day-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.hv-day-card:hover {
    border-color: #e3d1b5;
}

.hv-day-card:focus-visible {
    outline: 2px solid #c4a97d;
    outline-offset: 2px;
}

.hv-day-card__label {
    font-size: 13px;
    color: #4b5563;
}

.hv-day-card__value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
}

.hv-day-card__link {
    margin-top: auto;
    padding-top: 4px;
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #9e7f59;
}

.hv-day-card--attention {
    background: #fffbeb;
    border-color: #fcd34d;
}

.hv-day-card--attention .hv-day-card__value {
    color: #b45309;
}

.hv-day-card--calm .hv-day-card__value {
    color: #9ca3af;
}

.hv-day-card--calm .hv-day-card__link {
    color: #9ca3af;
    font-weight: 500;
}

/* ── The open card's chart: the rest of the window, two side by side for the balance ── */

.hv-pd-chart {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

@media (min-width: 1024px) {
    .hv-pd-chart--pair {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.hv-pd-chart > .fi-wi-chart {
    min-height: 0;
    height: 100%;
}

/* The chart's own height (StylesCharts) is a floor for a page that scrolls; here the window sets it. */
.hv-pd-chart .fi-wi-chart .fi-wi-chart-frame {
    min-height: 140px !important;
}

/* ── First steps: one panel in place of the day and the period, until the restaurant is on the site ── */

.hv-setup {
    max-width: 960px;
}

/* Beside the list, once the page is wide enough for both: the step at hand and what follows. The page's width
   decides, not the window's, so an open menu counts. */
.hv-setup-wrap {
    container-type: inline-size;
}

.hv-setup-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.hv-setup-help {
    display: none;
}

@container (min-width: 1000px) {
    .hv-setup-layout {
        grid-template-columns: minmax(0, 960px) minmax(300px, 1fr);
    }

    .hv-setup-help {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
}

/* A short window keeps the list alone, wider and tighter: the cards beside it would outgrow it, and a text
   wrapped on two lines would make the page scroll. */
@media (max-height: 720px) {
    .hv-setup-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .hv-setup-help {
        display: none;
    }

    .hv-setup {
        max-width: 1200px;
    }

    .hv-setup__step {
        padding: 6px 0;
    }
}

.hv-setup-help__card {
    gap: 6px;
}

.hv-setup-help__card--fill {
    flex: 1;
}

.hv-setup-help__lead {
    font-size: 13.5px;
    font-weight: 600;
    color: #111827;
}

/* The worked example needs a column wide enough to read its figures on one line each. */
.hv-setup-help {
    container-type: inline-size;
}

.hv-setup-help__example {
    display: none;
    margin-block: 4px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #f9fafb;
    font-size: 13px;
    color: #4b5563;
}

@container (min-width: 420px) {
    .hv-setup-help__example {
        display: block;
    }
}

.hv-setup-help__example-title {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.hv-setup-help__example dl > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-block: 2px;
}

.hv-setup-help__example dd {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hv-setup-help__example .hv-setup-help__example-total {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid #e5e7eb;
    font-weight: 600;
    color: #111827;
}

.hv-setup-help__link {
    margin-top: auto;
    padding-top: 4px;
    font-size: 12.5px;
    font-weight: 600;
    color: #9e7f59;
}

.hv-setup-help__link:hover {
    text-decoration: underline;
}

.hv-setup-help__label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9e7f59;
}

.hv-setup-help__title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.hv-setup-help__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 18px;
    list-style: disc;
    font-size: 13px;
    color: #4b5563;
}

.hv-setup-help__list--numbered {
    list-style: decimal;
}

.hv-setup__head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hv-setup__intro {
    font-size: 13px;
    color: #6b7280;
}

.hv-setup__bar {
    height: 6px;
    margin-top: 4px;
    overflow: hidden;
    border-radius: 3px;
    background: #f3f4f6;
}

.hv-setup__bar > span {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: #c4a97d;
}

.hv-setup__progress {
    font-size: 13px;
    font-weight: 600;
    color: #9e7f59;
}

.hv-setup__step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 0;
    border-top: 1px solid #f3f4f6;
}

.hv-setup__step:first-child {
    border-top: 0;
}

/* A tall window has room for the list to breathe; a short one keeps it tight, so nothing scrolls. */
@media (min-height: 850px) {
    .hv-setup__step {
        padding: 12px 0;
    }
}

.hv-setup__mark {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.hv-setup__mark svg {
    width: 16px;
    height: 16px;
}

.hv-setup__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hv-setup__title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.hv-setup__text {
    font-size: 12.5px;
    color: #6b7280;
}

.hv-setup__step--done .hv-setup__mark {
    border-color: #16a34a;
    background: #16a34a;
    color: #ffffff;
}

/* The step to do now spans the panel, with the brand's bar on its left. */
.hv-setup__step--current {
    margin-inline: -20px;
    padding-inline: 17px 20px;
    border-left: 3px solid #c4a97d;
    background: #fbf8f3;
}

.hv-setup__step--current .hv-setup__mark {
    border-color: #c4a97d;
    background: #c4a97d;
    color: #ffffff;
}

.hv-setup__step--waiting .hv-setup__mark {
    border-color: #f59e0b;
    color: #b45309;
}

.hv-setup__step--locked .hv-setup__mark,
.hv-setup__step--locked .hv-setup__title {
    border-color: #e5e7eb;
    color: #9ca3af;
}

/* A step that waits for an earlier one says which, where its button will be. */
.hv-setup__after {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    white-space: nowrap;
    color: #9ca3af;
}

.hv-setup__after svg {
    width: 14px;
    height: 14px;
}

/* Huvi's own step: the partner waits, nothing to press. */
.hv-setup__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    color: #6b7280;
}

.hv-setup__badge svg {
    width: 14px;
    height: 14px;
    color: #9e7f59;
}

.hv-setup__extra {
    margin-top: 6px;
    padding: 4px 14px;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
}

.hv-setup__extra-label {
    padding-top: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9ca3af;
}

.hv-setup__extra-label span {
    margin-left: 6px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

/* ── Dark ── */

.dark .hv-pd-band {
    background: #18181b;
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .hv-pd-band__title {
    color: #f4f4f5;
}

.dark .hv-pd-band__meta {
    color: #a1a1aa;
}

.dark .hv-pd-refresh,
.dark .hv-day-card__link {
    color: #c4a97d;
}

.dark .hv-pd-refresh:hover {
    background: #27272a;
}

/* The dark panel has the colour of its cards, filters and chart, so only their lines set them apart: a step lighter. */
.dark .hv-day-card {
    background: #18181b;
    border-color: #3f3f46;
}

.dark .hv-pd .db-pill-select-wrap,
.dark .hv-pd .db-pill-date-wrap {
    border-color: #3f3f46;
}

.dark .hv-pd .fi-wi-chart .fi-section {
    --tw-ring-color: #3f3f46;
}

.dark .hv-day-card:hover {
    background: #27272a;
}

.dark .hv-day-card__label {
    color: #a1a1aa;
}

.dark .hv-day-card__value {
    color: #f4f4f5;
}

.dark .hv-day-card--attention {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.5);
}

.dark .hv-day-card--attention .hv-day-card__value {
    color: #fbbf24;
}

.dark .hv-day-card--calm .hv-day-card__value,
.dark .hv-day-card--calm .hv-day-card__link {
    color: #71717a;
}

.dark .hv-setup__intro,
.dark .hv-setup__text {
    color: #a1a1aa;
}

.dark .hv-setup__progress {
    color: #c4a97d;
}

.dark .hv-setup__step {
    border-top-color: #27272a;
}

.dark .hv-setup__mark {
    border-color: #52525b;
    color: #a1a1aa;
}

.dark .hv-setup__title {
    color: #f4f4f5;
}

.dark .hv-setup__step--done .hv-setup__mark {
    border-color: #16a34a;
    background: #16a34a;
    color: #ffffff;
}

.dark .hv-setup__step--current .hv-setup__mark {
    border-color: #c4a97d;
    background: #c4a97d;
    color: #18181b;
}

.dark .hv-setup__step--waiting .hv-setup__mark {
    border-color: #f59e0b;
    color: #fbbf24;
}

.dark .hv-setup__step--locked .hv-setup__mark,
.dark .hv-setup__step--locked .hv-setup__title {
    border-color: #3f3f46;
    color: #71717a;
}

.dark .hv-setup__extra-label,
.dark .hv-setup__after {
    color: #71717a;
}

.dark .hv-setup__extra {
    border-color: #3f3f46;
}

.dark .hv-setup__bar {
    background: #27272a;
}

.dark .hv-setup__step--current {
    background: rgba(196, 169, 125, 0.08);
}

.dark .hv-setup__badge {
    border-color: #3f3f46;
    color: #a1a1aa;
}

.dark .hv-setup__badge svg {
    color: #c4a97d;
}

.dark .hv-setup-help__label {
    color: #c4a97d;
}

.dark .hv-setup-help__title {
    color: #f4f4f5;
}

.dark .hv-setup-help__list {
    color: #a1a1aa;
}

.dark .hv-setup-help__lead {
    color: #f4f4f5;
}

.dark .hv-setup-help__link {
    color: #c4a97d;
}

.dark .hv-setup-help__example {
    background: #27272a;
    color: #a1a1aa;
}

.dark .hv-setup-help__example-title {
    color: #a1a1aa;
}

.dark .hv-setup-help__example-total {
    border-top-color: #3f3f46;
    color: #f4f4f5;
}
