/* «Клиент уже ходил»: выдача задним числом. Свёрнуто по умолчанию, раскрывается одной строкой. */
.bd {
    --bd-accent: var(--primary, #0e7c74);
    grid-column: 1 / -1;
    margin: 6px 0 2px;
    border: 1px dashed color-mix(in srgb, var(--bd-accent) 35%, transparent);
    border-radius: 12px;
    background: transparent;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.bd.is-open {
    border-style: solid;
    border-color: color-mix(in srgb, var(--bd-accent) 30%, transparent);
    background: color-mix(in srgb, var(--bd-accent) 4%, var(--surface, #fff));
}

.bd__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.bd__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--bd-accent) 12%, var(--surface, #fff));
    color: var(--bd-accent);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.bd__icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bd__toggle:hover .bd__icon, .bd.is-open .bd__icon { transform: rotate(-35deg); }

.bd__toggle-text { flex: 1; min-width: 0; }
.bd__toggle-text b { display: block; font-size: 14.5px; font-weight: 600; }
.bd__toggle-text small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--crm-muted, #6b7280); }

.bd__chev {
    flex: none;
    width: 9px;
    height: 9px;
    margin-right: 4px;
    border-right: 2px solid var(--crm-muted, #6b7280);
    border-bottom: 2px solid var(--crm-muted, #6b7280);
    transform: rotate(45deg);
    transition: transform 0.25s ease;
}

.bd.is-open .bd__chev { transform: rotate(-135deg); }

.bd__body { padding: 2px 14px 14px; animation: bd-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }

.bd__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }

.bd__label {
    margin: 0;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--crm-muted, #6b7280);
}

.bd__date {
    width: auto !important;
    min-width: 150px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--crm-line, #e5e9e8);
    border-radius: 9px;
    background: var(--surface, #fff);
    color: var(--crm-ink, #14201b);
    font: inherit;
    font-size: 14px;
}

.bd__date:focus { outline: none; border-color: var(--bd-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bd-accent) 16%, transparent); }

.bd__quick { display: flex; flex-wrap: wrap; gap: 6px; }

.bd__quick button {
    height: 30px;
    padding: 0 11px;
    border: 1px solid var(--crm-line, #e5e9e8);
    border-radius: 999px;
    background: var(--surface, #fff);
    color: var(--crm-ink, #14201b);
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.bd__quick button:hover { border-color: var(--bd-accent); color: var(--bd-accent); }
.bd__quick .bd__reset { border-style: dashed; color: var(--crm-muted, #6b7280); }

.bd__days { margin-top: 14px; }
.bd__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.bd__chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 13px 0 11px;
    border: 1px solid var(--crm-line, #e5e9e8);
    border-radius: 10px;
    background: var(--surface, #fff);
    color: var(--crm-ink, #14201b);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: transform 0.18s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    animation: bd-chip 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: calc(var(--i, 0) * 30ms);
}

.bd__chip input { position: absolute; opacity: 0; pointer-events: none; }

.bd__chip i {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--crm-line, #cfd8d6);
    border-radius: 6px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.bd__chip i::after {
    content: "";
    width: 9px;
    height: 5px;
    margin-top: -2px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) scale(0);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bd__chip:hover { border-color: var(--bd-accent); }
.bd__chip:active { transform: scale(0.96); }

.bd__chip.is-on {
    border-color: var(--bd-accent);
    background: var(--bd-accent);
    color: #fff;
    box-shadow: 0 6px 14px -8px var(--bd-accent);
}

.bd__chip.is-on i { border-color: rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.18); }
.bd__chip.is-on i::after { transform: rotate(-45deg) scale(1); }
.bd__chip.is-off { opacity: 0.45; pointer-events: none; }

.bd__note { margin: 12px 0 0; font-size: 13px; line-height: 1.45; color: var(--crm-muted, #6b7280); }
.bd__note:empty { display: none; }
.bd__note b { color: var(--crm-ink, #14201b); font-weight: 600; }
.bd__error { margin: 8px 0 0; font-size: 13px; color: #b42318; }

@keyframes bd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes bd-chip { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .bd__body, .bd__chip { animation: none; }
}

/* На ресепшене общие правила формы делают label колонкой во всю ширину — возвращаем чипам строку. */
.bd .bd__chip {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: auto !important;
    margin: 0 !important;
    line-height: 1 !important;
    white-space: nowrap;
}

.bd .bd__chip i { flex: none; margin: 0; }
.bd .bd__label { display: inline-block; width: auto; }
.bd .bd__date { flex: none; }
.bd .bd__chip { color: var(--crm-ink, #14201b) !important; font-weight: 500 !important; font-size: 13.5px !important; }
.bd .bd__chip.is-on { color: #fff !important; }
