/* !important: у dense-инпута MudBlazor свой отступ 8px/4px, он ломает выравнивание в ряду фильтров. */
.dash-dp-field .mud-input-control {
    margin: 0 !important;
}

.dash-dp-field .mud-input-slot {
    cursor: pointer;
    text-overflow: ellipsis;
}

.dash-dp-popover {
    border-radius: 14px;
    max-width: calc(100vw - 16px);
}

.dash-dp {
    --dp-cell: 36px;
    --dp-accent: var(--mud-palette-primary);
    --dp-accent-text: var(--mud-palette-primary-text);
    --dp-band: rgba(var(--mud-palette-primary-rgb), .12);
    --dp-hover: var(--mud-palette-action-default-hover);
    display: flex;
    flex-direction: column;
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .06);
    font-size: .875rem;
    line-height: 1.2;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.dash-dp button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.dash-dp button:disabled {
    cursor: default;
}

.dash-dp button:focus-visible,
.dash-dp__input:focus-visible {
    outline: 2px solid var(--dp-accent);
    outline-offset: -2px;
}

/* Режимы и пресеты */

.dash-dp__tabs {
    flex: none;
    display: flex;
    gap: 4px;
    padding: 6px 14px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.dash-dp .dash-dp__tab {
    position: relative;
    height: 38px;
    padding: 0 10px;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.dash-dp__tab:hover {
    color: var(--mud-palette-text-primary);
}

.dash-dp .dash-dp__tab.is-active {
    color: var(--mud-palette-text-primary);
    font-weight: 500;
}

.dash-dp__tab.is-active::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--dp-accent);
}

.dash-dp__presets {
    flex: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--mud-palette-background-gray);
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}

.dash-dp__presets::-webkit-scrollbar {
    display: none;
}

.dash-dp .dash-dp__preset {
    flex: none;
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.dash-dp__preset:hover {
    background: var(--dp-hover);
    color: var(--mud-palette-text-primary);
}

.dash-dp .dash-dp__preset.is-active {
    background: var(--dp-band);
    color: var(--dp-accent);
    font-weight: 500;
}

.dash-dp__preset-divider {
    flex: none;
    width: 1px;
    height: 16px;
    margin: 0 4px;
    background: var(--mud-palette-lines-default);
}

/* Основная часть */

.dash-dp__main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    min-width: 0;
}

.dash-dp__fields {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-dp__dash {
    color: var(--mud-palette-text-secondary);
}

.dash-dp__input {
    flex: 1;
    min-width: 0;
    height: 34px;
    padding: 0 10px;
    font: inherit;
    font-variant-numeric: tabular-nums;
    color: inherit;
    background: transparent;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: 8px;
    user-select: text;
}

.dash-dp__input:hover {
    border-color: var(--mud-palette-text-primary);
}

.dash-dp__input.is-invalid {
    border-color: var(--mud-palette-error);
}

.dash-dp__months {
    display: flex;
    gap: 20px;
}

.dash-dp__month {
    width: calc(var(--dp-cell) * 7);
}

.dash-dp__month--wide {
    width: calc(var(--dp-cell) * 14 + 20px);
}

.dash-dp__nav {
    display: flex;
    align-items: center;
    height: 32px;
    margin-bottom: 2px;
}

.dash-dp .dash-dp__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: var(--mud-palette-text-secondary);
}

.dash-dp__arrow:hover:not(:disabled) {
    background: var(--dp-hover);
    color: var(--mud-palette-text-primary);
}

.dash-dp__arrow:disabled {
    opacity: .3;
}

.dash-dp__title {
    flex: 1;
    text-align: center;
    font-weight: 600;
}

.dash-dp .dash-dp__title--btn {
    flex: 0 1 auto;
    margin: 0 auto;
    height: 28px;
    padding: 0 8px;
    border-radius: 8px;
    font-weight: 600;
}

.dash-dp__title--btn:hover {
    background: var(--dp-hover);
}

.dash-dp__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
    padding: 4px 0;
}

.dash-dp__weekdays .is-weekend {
    color: var(--mud-palette-error);
    opacity: .75;
}

/* Дни: лента диапазона рисуется фоном ячейки, края — скруглённой плашкой внутри. */

.dash-dp__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 2px;
}

.dash-dp .dash-dp__day {
    position: relative;
    height: var(--dp-cell);
    font-variant-numeric: tabular-nums;
}

.dash-dp__day > span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 9px;
}

.dash-dp__day.is-weekend {
    color: var(--mud-palette-error);
}

.dash-dp__day.is-today > span {
    font-weight: 700;
    box-shadow: inset 0 0 0 1px var(--mud-palette-lines-inputs);
}

.dash-dp__day:disabled {
    color: var(--mud-palette-text-disabled);
}

@media (hover: hover) {
    .dash-dp__day:hover:not(:disabled) > span {
        background: var(--dp-hover);
    }
}

.dash-dp__day.is-in,
.dash-dp__day[data-pv="in"] {
    background: var(--dp-band);
}

.dash-dp__day.is-start,
.dash-dp__day[data-pv="start"] {
    background: linear-gradient(to right, transparent 50%, var(--dp-band) 50%);
}

.dash-dp__day.is-end,
.dash-dp__day[data-pv="end"] {
    background: linear-gradient(to left, transparent 50%, var(--dp-band) 50%);
}

.dash-dp__day.is-start.is-end,
.dash-dp__day[data-pv="single"] {
    background: none;
}

/* Лента не выезжает за край недели: у крайних ячеек ряда она скругляется. */
.dash-dp__day.is-in:nth-child(7n+1),
.dash-dp__day[data-pv="in"]:nth-child(7n+1) {
    border-radius: 9px 0 0 9px;
}

.dash-dp__day.is-in:nth-child(7n),
.dash-dp__day[data-pv="in"]:nth-child(7n) {
    border-radius: 0 9px 9px 0;
}

.dash-dp .dash-dp__day.is-start > span,
.dash-dp .dash-dp__day.is-end > span {
    background: var(--dp-accent);
    color: var(--dp-accent-text);
    font-weight: 600;
    box-shadow: none;
}

.dash-dp__day[data-pv="in"]:not(.is-start):not(.is-end) > span {
    background: none;
}

/* Края превью выглядят как будущие края выбора. */
.dash-dp .dash-dp__day[data-pv="start"] > span,
.dash-dp .dash-dp__day[data-pv="end"] > span,
.dash-dp .dash-dp__day[data-pv="single"] > span {
    background: var(--dp-accent);
    color: var(--dp-accent-text);
    font-weight: 600;
    box-shadow: none;
}

/* Месяцы, кварталы, годы: те же состояния, что у дней, сетка в 4 колонки. */

.dash-dp__units {
    grid-template-columns: repeat(4, 1fr);
    row-gap: 6px;
    padding: 6px 0;
}

.dash-dp .dash-dp__unit {
    height: 44px;
}

.dash-dp__units .dash-dp__day.is-in:nth-child(n),
.dash-dp__units .dash-dp__day[data-pv="in"]:nth-child(n) {
    border-radius: 0;
}

.dash-dp__units .dash-dp__day.is-in:nth-child(4n+1),
.dash-dp__units .dash-dp__day[data-pv="in"]:nth-child(4n+1) {
    border-radius: 9px 0 0 9px;
}

.dash-dp__units .dash-dp__day.is-in:nth-child(4n),
.dash-dp__units .dash-dp__day[data-pv="in"]:nth-child(4n) {
    border-radius: 0 9px 9px 0;
}

/* Наведение на целую единицу (неделю) до первого клика. */
.dash-dp__day[data-pv="hover"]:not(.is-start):not(.is-end):not(.is-in) {
    background: var(--dp-hover);
}

.dash-dp__day[data-pv="hover"]:not(.is-start):not(.is-end) > span {
    background: none;
}

/* Выбор месяца */

.dash-dp__month-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px 0;
}

.dash-dp .dash-dp__month-btn {
    height: 44px;
    border-radius: 9px;
    text-transform: capitalize;
}

.dash-dp__month-btn:hover:not(:disabled) {
    background: var(--dp-hover);
}

.dash-dp .dash-dp__month-btn.is-current {
    background: var(--dp-band);
    color: var(--dp-accent);
    font-weight: 600;
}

.dash-dp__month-btn:disabled {
    color: var(--mud-palette-text-disabled);
}

/* Футер */

.dash-dp__footer {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
}

.dash-dp__summary {
    flex: 1;
    min-width: 0;
    color: var(--mud-palette-text-secondary);
    font-size: .8125rem;
}

/* Мобильная шторка */

.dash-dp-popover--sheet {
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    border-radius: 0;
    transform: none !important;
}

.dash-dp--sheet {
    --dp-cell: 46px;
    flex-direction: column;
    max-height: min(88dvh, 720px);
    padding-bottom: env(safe-area-inset-bottom);
    border: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .18);
    font-size: 1rem;
    animation: dash-dp-sheet-in .22s cubic-bezier(.2, .8, .2, 1);
    touch-action: pan-y;
}

@keyframes dash-dp-sheet-in {
    from {
        transform: translateY(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dash-dp--sheet {
        animation: none;
    }
}

.dash-dp__grip {
    flex: none;
    padding: 8px 16px 4px;
    touch-action: none;
    cursor: grab;
}

.dash-dp__handle {
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 8px;
    border-radius: 2px;
    background: var(--mud-palette-lines-inputs);
}

.dash-dp__sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
}

.dash-dp__sheet-title {
    font-size: 1.0625rem;
    font-weight: 600;
}

.dash-dp--sheet .dash-dp__tabs {
    padding: 0 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.dash-dp--sheet .dash-dp__tabs {
    gap: 0;
}

.dash-dp--sheet .dash-dp__tab {
    flex: 1 0 auto;
    height: 44px;
    padding: 0 6px;
}

.dash-dp--sheet .dash-dp__presets {
    gap: 6px;
    padding: 8px 12px;
}

.dash-dp--sheet .dash-dp__preset {
    height: 36px;
    padding: 0 14px;
}

.dash-dp--sheet .dash-dp__unit {
    height: 52px;
}

.dash-dp--sheet > .dash-dp__weekdays {
    flex: none;
    padding: 6px 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.dash-dp__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 12px 8px;
}

.dash-dp--sheet .dash-dp__month {
    width: auto;
}

.dash-dp__title--sheet {
    text-align: left;
    padding: 16px 8px 6px;
}

.dash-dp__times {
    flex: none;
    display: flex;
    gap: 16px;
    padding: 10px 16px 0;
    border-top: 1px solid var(--mud-palette-lines-default);
    color: var(--mud-palette-text-secondary);
}

.dash-dp__times input {
    margin-left: 6px;
    height: 40px;
    padding: 0 10px;
    font: inherit;
    color: var(--mud-palette-text-primary);
    background: transparent;
    border: 1px solid var(--mud-palette-lines-inputs);
    border-radius: 10px;
}

.dash-dp--sheet .dash-dp__footer {
    flex: none;
    gap: 12px;
    padding: 10px 16px 12px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.dash-dp--sheet .dash-dp__summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: .9375rem;
    color: var(--mud-palette-text-primary);
}

.dash-dp--sheet .dash-dp__summary > span + span {
    font-size: .8125rem;
    color: var(--mud-palette-text-secondary);
}

.dash-dp__apply.mud-button-root {
    height: 46px;
    padding: 0 22px;
    border-radius: 12px;
    text-transform: none;
    font-size: 1rem;
}

/* Уже выбранный край внутри превью нового диапазона растворяется в ленте. */
.dash-dp .dash-dp__day[data-pv="in"] {
    background: var(--dp-band);
}

.dash-dp .dash-dp__day[data-pv="in"] > span {
    background: none;
    color: inherit;
    font-weight: inherit;
}

/* Превью сильнее состояния выбора: у якоря (is-start + is-end) лента тянется к наведённому краю. */
.dash-dp .dash-dp__day[data-pv="start"] {
    background: linear-gradient(to right, transparent 50%, var(--dp-band) 50%);
}

.dash-dp .dash-dp__day[data-pv="end"] {
    background: linear-gradient(to left, transparent 50%, var(--dp-band) 50%);
}

.dash-dp .dash-dp__day[data-pv="single"] {
    background: none;
}

/* Время: список времён с шагом (TimePicker и правая колонка DateTimePicker). */

.dash-dp__slots {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 96px;
    max-height: 288px;
    padding: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.dash-dp .dash-dp__slot {
    flex: none;
    height: 32px;
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
}

.dash-dp__slot:hover {
    background: var(--dp-hover);
}

.dash-dp .dash-dp__slot.is-selected {
    background: var(--dp-accent);
    color: var(--dp-accent-text);
    font-weight: 600;
}

.dash-dp__split {
    display: flex;
}

.dash-dp__side {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--mud-palette-lines-default);
}

.dash-dp__side-title {
    padding: 14px 12px 4px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.dash-dp__side .dash-dp__slots {
    flex: 1 1 0;
    max-height: none;
    min-height: 0;
}

.dash-dp--sheet.dash-dp--time .dash-dp__slots {
    flex: 1 1 auto;
    width: auto;
    max-height: none;
    min-height: 0;
    padding: 8px 12px;
}

.dash-dp--sheet .dash-dp__slot {
    height: 46px;
    font-size: 1.0625rem;
}

.dash-dp--sheet .dash-dp__times {
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
}

/* Шторка с одним месяцем (DatePicker, DateTimePicker): навигация и выбор месяца крупнее. */
.dash-dp--sheet .dash-dp__nav {
    height: 44px;
    padding-top: 4px;
}

.dash-dp--sheet .dash-dp__arrow {
    width: 40px;
    height: 40px;
}

.dash-dp--sheet .dash-dp__month-grid {
    width: auto;
}

.dash-dp--sheet .dash-dp__month-btn {
    height: 52px;
}
