/* ===== DATETIME PICKER =====
   Свой поповер выбора даты/времени (backend/static/datetime-picker.js).
   Два класса, оба ставит сам модуль и только при pointer:fine:
     gt-dtp-on   — поповер работает;
     gt-dtp-icon — сверх того браузер умеет спрятать свою кнопку календаря,
                   значит рисуем свою. Firefox этого не умеет, там остаётся
                   его собственная кнопка — она и открывает наш поповер.
   Без классов (телефоны, страницы без скрипта) поле полностью нативное. */
html.gt-dtp-icon input[type="date"],
html.gt-dtp-icon input[type="month"],
html.gt-dtp-icon input[type="datetime-local"],
html.gt-dtp-icon input[type="time"] {
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px 18px;
    padding-right: 34px;
    cursor: pointer;
}
html.gt-dtp-icon input[type="date"],
html.gt-dtp-icon input[type="month"],
html.gt-dtp-icon input[type="datetime-local"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M3 10h18'/%3E%3C/svg%3E");
}
html.gt-dtp-icon input[type="time"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}
html.gt-dtp-icon.dark input[type="date"],
html.gt-dtp-icon.dark input[type="month"],
html.gt-dtp-icon.dark input[type="datetime-local"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M3 10h18'/%3E%3C/svg%3E");
}
html.gt-dtp-icon.dark input[type="time"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}
/* Заблокированное поле поповера не открывает — и иконку показывать незачем. */
html.gt-dtp-icon input[type="date"]:disabled,
html.gt-dtp-icon input[type="month"]:disabled,
html.gt-dtp-icon input[type="datetime-local"]:disabled,
html.gt-dtp-icon input[type="time"]:disabled {
    background-image: none;
    padding-right: 12px;
    cursor: default;
}
/* Нативный индикатор — единственное, чем в Chrome открывается его же выпадашка. */
html.gt-dtp-icon input[type="date"]::-webkit-calendar-picker-indicator,
html.gt-dtp-icon input[type="month"]::-webkit-calendar-picker-indicator,
html.gt-dtp-icon input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html.gt-dtp-icon input[type="time"]::-webkit-calendar-picker-indicator {
    display: none;
}

.gt-dtp {
    position: fixed;
    z-index: 10055;   /* выше .modal-backdrop (10050), ниже тоста */
    display: none;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    background: #FFFFFF;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
    color: #0F172A;
    font-size: 13px;
    line-height: 1.2;
    overflow-y: auto;
    overscroll-behavior: contain;
    user-select: none;
}
.gt-dtp.is-open { display: block; }
.gt-dtp__panes { display: flex; gap: 10px; align-items: flex-start; }

.gt-dtp__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 6px;
}
.gt-dtp__nav {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748B;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.gt-dtp__nav:hover { background: #F1F5F9; color: #0F172A; }
.gt-dtp__nav[disabled] { color: #CBD5E1; cursor: default; }
.gt-dtp__title {
    flex: 1;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-align: center;
    text-transform: capitalize;
    cursor: pointer;
}
.gt-dtp__title:hover { background: #F1F5F9; }
.gt-dtp__title--static { cursor: default; }
.gt-dtp__title--static:hover { background: transparent; }

.gt-dtp__dows {
    display: grid;
    grid-template-columns: repeat(7, 34px);
    gap: 2px;
    margin-bottom: 2px;
    color: #94A3B8;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    text-transform: capitalize;
}
.gt-dtp__grid { display: grid; grid-template-columns: repeat(7, 34px); gap: 2px; }
.gt-dtp__day {
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}
.gt-dtp__day:hover { background: #EFF6FF; }
.gt-dtp__day--other { color: #CBD5E1; }
.gt-dtp__day--today { box-shadow: inset 0 0 0 1px #2563EB; }
.gt-dtp__day--selected,
.gt-dtp__day--selected:hover { background: #2563EB; color: #FFFFFF; font-weight: 700; }
.gt-dtp__day[disabled] { color: #E2E8F0; cursor: default; background: transparent; }

.gt-dtp__months { display: grid; grid-template-columns: repeat(3, 78px); gap: 4px; }
.gt-dtp__month {
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-transform: capitalize;
    cursor: pointer;
}
.gt-dtp__month:hover { background: #EFF6FF; }
.gt-dtp__month--selected,
.gt-dtp__month--selected:hover { background: #2563EB; color: #FFFFFF; font-weight: 700; }
.gt-dtp__month[disabled] { color: #E2E8F0; cursor: default; background: transparent; }

.gt-dtp__times {
    max-height: 246px;
    min-width: 92px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.gt-dtp__time {
    display: block;
    width: 100%;
    min-height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-variant-numeric: tabular-nums;
    text-align: left;
    cursor: pointer;
}
.gt-dtp__time:hover { background: #EFF6FF; }
.gt-dtp__time--selected,
.gt-dtp__time--selected:hover { background: #2563EB; color: #FFFFFF; font-weight: 700; }

.gt-dtp__foot {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #E2E8F0;
}
.gt-dtp__btn {
    flex: 1;
    min-height: 34px;
    border: 0;
    border-radius: 9px;
    background: #EFF6FF;
    color: #1D4ED8;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.gt-dtp__btn:hover { background: #DBEAFE; }
.gt-dtp__btn--ghost { background: transparent; color: #64748B; }
.gt-dtp__btn--ghost:hover { background: #F1F5F9; }

html.dark .gt-dtp {
    border-color: #334155;
    background: #0F172A;
    color: #F1F5F9;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
html.dark .gt-dtp__nav { color: #94A3B8; }
html.dark .gt-dtp__nav:hover,
html.dark .gt-dtp__title:hover { background: #1E293B; color: #F1F5F9; }
html.dark .gt-dtp__dows { color: #64748B; }
html.dark .gt-dtp__day:hover,
html.dark .gt-dtp__month:hover,
html.dark .gt-dtp__time:hover { background: #1E293B; }
html.dark .gt-dtp__day--other { color: #475569; }
html.dark .gt-dtp__day--today { box-shadow: inset 0 0 0 1px #60A5FA; }
html.dark .gt-dtp__day[disabled],
html.dark .gt-dtp__month[disabled] { color: #334155; }
html.dark .gt-dtp__foot { border-top-color: #334155; }
html.dark .gt-dtp__btn { background: #1E293B; color: #93C5FD; }
html.dark .gt-dtp__btn:hover { background: #334155; }
html.dark .gt-dtp__btn--ghost { background: transparent; color: #94A3B8; }
html.dark .gt-dtp__btn--ghost:hover { background: #1E293B; }
