/* Phangan Wheels — мобильный кабинет */

:root {
    --bg: #f2efe8;
    --surface: #ffffff;
    --ink: #12211f;
    --muted: #6a7a75;
    --line: #e3ded3;
    --accent: #0f766e;
    --accent-ink: #0b5a54;
    --accent-soft: #e2f1ed;
    --ok: #15803d;
    --ok-soft: #e7f3ea;
    --warn: #b45309;
    --warn-soft: #fdf0dd;
    --danger: #b3261e;
    --danger-soft: #fbe9e7;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(18, 33, 31, .06), 0 10px 28px -18px rgba(18, 33, 31, .45);
    --tabbar-h: 64px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ---------- Верхняя панель ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 12px;
    background: linear-gradient(160deg, #10322f 0%, #0f2a2e 100%);
    color: #f4fbf9;
}

.topbar__kicker {
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #9fc4bd;
}

.topbar__title {
    margin: 2px 0 0;
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -.01em;
}

.ghostbtn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .08);
    color: #eaf5f2;
    font: inherit;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
}

.ghostbtn:active {
    background: rgba(255, 255, 255, .16);
}

/* ---------- Меню в шапке (три точки) ---------- */

.menu {
    position: relative;
    flex: 0 0 auto;
}

.menu__toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    font: inherit;
    font-size: 22px;
    line-height: 1;
    color: #eaf5f2;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.menu__toggle:active {
    background: rgba(255, 255, 255, .18);
}

.menu__sheet {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 5;
    min-width: 224px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 42, 46, .22);
}

.menu__item {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    font: inherit;
    font-size: 15px;
    text-align: left;
    color: var(--ink);
    text-decoration: none;
    background: none;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.menu__item:active {
    background: var(--accent-soft);
}

.menu__item--danger {
    color: var(--danger);
}

.menu__item--danger:active {
    background: var(--danger-soft);
}

.menu__form {
    margin: 6px 0 0;
    padding-top: 6px;
    border-top: 1px solid var(--line);
}

.menu__hint {
    margin: 2px 10px 8px;
    font-size: 12.5px;
    line-height: 1.35;
    color: var(--muted);
}

.tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    vertical-align: middle;
}

.tag--warn {
    background: #f6c26b;
    color: #3a2a00;
}

/* ---------- Страница ---------- */

.page {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 16px 24px;
    display: grid;
    gap: 18px;
}

.block {
    display: grid;
    gap: 10px;
}

.block__title {
    margin: 0;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.block__title--danger {
    color: var(--danger);
}

/* Сегодня — день, который требует действия прямо сейчас */
.block__title--muted {
    color: var(--muted);
}

.block__title--today {
    color: var(--accent-ink);
}

.stack {
    display: grid;
    gap: 10px;
}

/* ---------- Сводка ---------- */

.hero {
    background: linear-gradient(150deg, #12433d 0%, #0f2a2e 100%);
    color: #eefaf6;
    border-radius: 20px;
    padding: 18px 18px 16px;
    box-shadow: var(--shadow);
}

.hero__row {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.hero__num {
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.hero__label {
    font-size: 13px;
    color: #9fc4bd;
}

.hero__sub {
    font-size: 14px;
    color: #d6e9e4;
    margin-top: 2px;
}

.bar {
    margin-top: 14px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    overflow: hidden;
}

.bar__fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4fd1b5, #a7f3d0);
}

.tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: grid;
    gap: 2px;
    box-shadow: var(--shadow);
}

.tile__num {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.tile__label {
    font-size: 13px;
    color: var(--muted);
}

/* ---------- Карточки ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 10px;
}

.card--link:active {
    transform: scale(.995);
    background: #fbfaf7;
}

/* Занятая техника — в цвете стиля, свободная остаётся белой */
.card--rented {
    background: linear-gradient(165deg, #eaf7f3 0%, #dcefe9 100%);
    border-color: #b6ddd2;
    box-shadow: 0 1px 2px rgba(15, 118, 110, .10), 0 12px 26px -20px rgba(15, 118, 110, .55);
}

.card--rented .vehicle__model {
    color: var(--accent-ink);
}

.card--rented .vehicle__plate {
    color: #0a3f3a;
}

.card--rented .vehicle__meta {
    border-top-color: rgba(15, 118, 110, .22);
}

.card--rented .contact__line {
    color: var(--accent-ink);
}

.card--maintenance {
    background: linear-gradient(165deg, #fff8ea 0%, #fdf0dd 100%);
    border-color: #efdcb6;
}

.card--idle {
    background: #f4f3ef;
    border-color: #e0ddd4;
}

.card--hero {
    background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
}

.card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.card__main {
    min-width: 0;
}

.card__title {
    font-size: 17px;
    font-weight: 650;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card__title--big {
    font-size: 26px;
    letter-spacing: -.02em;
}

.card__icon {
    font-size: 18px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price {
    font-size: 14px;
    color: var(--accent-ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ---------- Карточка техники: модель → номер → класс ---------- */

.vehicle__model {
    font-size: 19px;
    font-weight: 650;
    letter-spacing: .01em;
    color: var(--ink);
    line-height: 1.2;
}

.vehicle__plate {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .04em;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    margin-top: 2px;
}

.vehicle__plate--xl {
    font-size: 15px;
    letter-spacing: .04em;
}

.vehicle__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 9px;
    border-top: 1px dashed var(--line);
    font-size: 13px;
    color: var(--muted);
}

.vehicle__type {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.vehicle__icon {
    font-size: 15px;
    line-height: 1;
}

.vehicle__price {
    color: var(--accent-ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.note {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: #fff8e6;
    border: 1px solid #f0e2bd;
    color: #6b5218;
    font-size: 14px;
}

.kv {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}

.kv__item {
    display: grid;
    gap: 1px;
}

.kv__label {
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
}

.kv__value {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

/* ---------- Бейджи ---------- */

.badge {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef1ef;
    color: #4b5a55;
    white-space: nowrap;
}

.badge--available,
.badge--completed {
    background: var(--ok-soft);
    color: var(--ok);
}

.badge--rented,
.badge--active,
.badge--pending {
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.badge--maintenance {
    background: var(--warn-soft);
    color: var(--warn);
}

.badge--overdue {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge--cancelled,
.badge--sold,
.badge--out-of-service {
    background: #ececec;
    color: #6b6b6b;
}

/* ---------- Фильтры ---------- */

.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.chips::-webkit-scrollbar {
    display: none;
}

.chip {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 14px;
    color: var(--muted);
}

.chip--active {
    background: #10322f;
    border-color: #10322f;
    color: #f0faf7;
}

/* ---------- Служебное ---------- */

.back {
    font-size: 14px;
    color: var(--accent-ink);
    width: fit-content;
}

.cta {
    display: block;
    text-align: center;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--accent-ink);
    font-weight: 600;
    font-size: 15px;
}

.empty {
    padding: 22px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .5);
}

/* ---------- Нижняя навигация ---------- */

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: var(--tabbar-h);
    color: var(--muted);
    font-size: 10px;
}

.tab__icon {
    font-size: 19px;
    line-height: 1;
    filter: grayscale(1) opacity(.55);
}

.tab--active {
    color: var(--accent-ink);
}

.tab--active .tab__icon {
    filter: none;
}

/* ---------- Вход ---------- */

.login-body {
    padding-bottom: 0;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    background: radial-gradient(120% 90% at 50% 0%, #16423c 0%, #0b1f1d 60%, #081615 100%);
    color: #eefaf6;
}

.login {
    width: min(420px, 100%);
    padding: 24px 20px 32px;
    display: grid;
    gap: 22px;
}

.login__brand {
    text-align: center;
    display: grid;
    gap: 4px;
}

.login__logo {
    font-size: 40px;
}

.login__title {
    margin: 0;
    font-size: 22px;
    letter-spacing: -.01em;
}

.login-body .muted {
    color: #9fc4bd;
}

.login__form {
    gap: 14px;
}

.field {
    display: grid;
    gap: 6px;
}

.field__label {
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.input {
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #fbfaf7;
    color: var(--ink);
    font: inherit;
    font-size: 16px; /* без зума на iOS */
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .15);
}

.btn {
    appearance: none;
    border: none;
    font: inherit;
    font-weight: 600;
    padding: 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn--primary {
    background: var(--accent);
    color: #fff;
}

.btn--primary:active {
    background: var(--accent-ink);
}

.login__error,
.login__ok {
    margin: 0;
    font-size: 14px;
    text-align: center;
}

.login__error {
    color: #ffb4ab;
}

.login__ok {
    color: #a7f3d0;
}

/* ---------- Кто снимает технику ---------- */

.renter {
    border-color: #cfe6df;
    background: linear-gradient(180deg, #ffffff 0%, #f4fbf8 100%);
}

.contact {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn--contact {
    flex: 1 1 auto;
    padding: 11px 14px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.btn--contact:active {
    background: #cbe8e1;
}

.contact--compact {
    gap: 6px;
    padding-top: 9px;
    border-top: 1px dashed var(--line);
}

.contact--compact .btn--contact {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 10px;
}

.contact__line {
    font-size: 14px;
    color: var(--accent-ink);
    font-variant-numeric: tabular-nums;
}

/* ---------- Формы ---------- */

.form {
    gap: 14px;
}

.card__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-ink);
}

.card__open {
    color: var(--accent-ink);
    font-weight: 600;
    align-self: center;
}

.card__cta {
    background: var(--accent);
    color: #fff;
    padding: 9px 20px;
    border-radius: 10px;
    font-weight: 600;
}

button.card__cta {
    border: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.card__cancel {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 13px;
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.card--booking {
    background: linear-gradient(165deg, #fff8ea 0%, #fdf3e2 100%);
    border-color: #efdcb6;
}

/* Статусы контрактов в списках */
.card--active {
    background: linear-gradient(165deg, #f2fbf8 0%, #e6f5f0 100%);
    border-color: #bfe3d9;
}

.card--active .vehicle__plate {
    color: #0a3f3a;
}

.card--active .kv__value,
.card--active .card__title {
    color: #123f3a;
}

.card--overdue {
    background: linear-gradient(165deg, #fdf3f1 0%, #fbe6e2 100%);
    border-color: #ecc4bf;
}

.card--overdue .card__title {
    color: #8c2f27;
}

.card--done {
    background: #faf9f6;
    border-color: #e8e4da;
}

.card--done .card__title,
.card--done .kv__value {
    color: #5d6561;
}

.card--cancelled {
    background: #f4f3ef;
    border-color: #e3e0d8;
    opacity: .7;
}

/* Бронь «встык»: техника освобождается в день выдачи или уже занята сразу после */
.badge--styk {
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.card--styk {
    border-color: var(--accent);
}

.card__note {
    margin-top: 2px;
    font-size: 12.5px;
    line-height: 1.3;
    color: var(--accent-ink);
}
/* Стрелки «смежных» броней: слева — до предыдущей аренды, справа — до следующей */
.card__gap {
    flex: 0 0 auto;
    align-self: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--accent-ink);
    background: var(--accent-soft);
    border-radius: 10px;
    padding: 6px 9px;
    white-space: nowrap;
}

.card__gap--prev {
    margin-right: 2px;
}

.card__gap--next {
    margin-left: 2px;
}
.card--busy {
    opacity: .55;
    background: #f4f3ef;
    border-style: dashed;
    box-shadow: none;
}

.card--booked {
    background: linear-gradient(165deg, #fffaf0 0%, #fdf3e0 100%);
    border-color: #eedcb8;
}

.card--booked .vehicle__plate {
    color: #6b4f14;
}

.contact__line--booking {
    color: #8a6a1f;
}

.card--booking .vehicle__model,
.card--booking .vehicle__plate {
    color: #6b4f14;
}

.card__cta:active {
    background: var(--accent-ink);
}

.seg__btn {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.note--warn {
    background: var(--warn-soft);
    border-color: #f0dcb4;
    color: var(--warn);
}

/* Мало заметная ссылка «продана навсегда» */
.sell-link {
    margin-top: -6px;
}

.sell-link button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 12.5px;
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* Своё поле даты: день.месяц.год */
.datefield {
    display: block;
}

.datefield__text {
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    font-size: 17px;
}

.dp {
    position: absolute;
    z-index: 100;
    width: 296px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 40px -20px rgba(18, 33, 31, .55);
    padding: 10px;
}

.dp__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 4px 8px;
}

.dp__title {
    font-weight: 600;
    font-size: 15px;
}

.dp__nav {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fbfaf7;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--ink);
}

.dp__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.dp__weekday {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    padding: 4px 0;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.dp__day {
    border: none;
    background: none;
    font: inherit;
    font-size: 15px;
    padding: 9px 0;
    border-radius: 10px;
    cursor: pointer;
    color: var(--ink);
}

.dp__day--today {
    box-shadow: inset 0 0 0 1px var(--accent);
}

.dp__day--selected {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.dp__foot {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.dp__today {
    border: none;
    background: none;
    color: var(--accent-ink);
    font-weight: 600;
    font-size: 14px;
    padding: 6px 10px;
    cursor: pointer;
}

/* Раскрывающийся блок для необратимых действий */.danger {
    border: 1px dashed #e2c9c5;
    border-radius: 12px;
    padding: 10px 14px;
    background: #fdf8f7;
}

.danger > summary {
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 600;
    color: #9b4b45;
}

.danger > summary::-webkit-details-marker {
    display: none;
}

.danger > summary::after {
    content: " ▾";
    font-weight: 400;
}

.danger[open] > summary::after {
    content: " ▴";
}

.danger .hint {
    margin: 8px 0 10px;
}

.danger form {
    margin: 0;
}

.input--area {
    min-height: 84px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.4;
}

.input--static {
    background: #f1efe9;
    color: var(--muted);
    display: flex;
    align-items: center;
}

.field__error {
    color: var(--danger);
    font-size: 12.5px;
}

.hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

/* ---------- Действия в карточке ---------- */

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.actions form {
    display: grid;
}

.actions .btn {
    width: 100%;
}

.actions .btn--primary {
    grid-column: 1 / -1;
}

.btn--ghost {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
}

.btn--danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn:disabled {
    opacity: .45;
}

/* ---------- Плавающая кнопка ---------- */

.fab {
    position: fixed;
    right: 16px;
    bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px));
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 30px;
    font-weight: 400;
    line-height: 56px;
    text-align: center;
    box-shadow: 0 10px 24px -8px rgba(15, 118, 110, .65);
    z-index: 25;
}

.fab:active {
    transform: scale(.96);
}

/* ---------- Сообщения ---------- */

.flash {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--ok-soft);
    color: var(--ok);
    font-size: 14px;
}

.flash--error {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ---------- Дополнительные фильтры ---------- */

.chips--sub {
    margin-top: -8px;
}

.chip--sub {
    font-size: 13px;
    padding: 6px 12px;
}

.chip--sub-active {
    background: var(--accent-soft);
    border-color: transparent;
    color: var(--accent-ink);
}

.chip__count {
    opacity: .6;
    font-size: 12px;
    margin-left: 2px;
}

/* ---------- Выбор варианта (срок, залог) ---------- */

.seg {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.seg__item {
    position: relative;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fbfaf7;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    min-width: 44px;
}

.seg__item--active {
    background: #10322f;
    border-color: #10322f;
    color: #f0faf7;
}

.seg__radio {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.seg__item:has(.seg__radio:checked) {
    background: #10322f;
    border-color: #10322f;
    color: #f0faf7;
}

.field__hint {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.35;
}

.until-form {
    display: grid;
    gap: 8px;
}

.until-form .input[type="date"] {
    font-size: 17px;
    font-variant-numeric: tabular-nums;
}

.field__opt {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    opacity: .7;
}

.card__action {
    display: block;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
    color: var(--accent-ink);
    font-weight: 600;
    font-size: 14px;
}

.btn--block {
    width: 100%;
}

.fab--wide {
    width: auto;
    height: 52px;
    padding: 0 22px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    line-height: 52px;
}

@media (min-width: 820px) {
    .page {
        padding-top: 24px;
        gap: 22px;
    }

    .tiles {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* ---------- Расписание ---------- */

.page--wide {
    max-width: 1100px;
}

.sched {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 10px 6px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.sched__head,
.sched__row {
    display: grid;
    grid-template-columns: 62px 1fr;
    align-items: center;
    gap: 4px;
}

.sched__head {
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 2;
    border-bottom: 1px solid var(--line);
    padding-bottom: 4px;
    margin-bottom: 2px;
}

.sched__days,
.sched__track {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    position: relative;
}

.sched__day {
    text-align: center;
    display: grid;
    line-height: 1.1;
}

.sched__dow {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

.sched__date {
    font-size: 10.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

.sched__day--today .sched__date {
    color: var(--accent-ink);
    font-weight: 700;
}

.sched__name {
    font-size: 11px;
    display: grid;
    gap: 0;
    padding-right: 2px;
    min-width: 0;
}

.sched__plate {
    font-weight: 500;
    font-size: 9.5px;
    line-height: 1.1;
    letter-spacing: .03em;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.sched__model {
    color: var(--ink);
    font-weight: 650;
    font-size: 11px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sched__row {
    min-height: 34px;
    border-bottom: 1px solid #f3f0e9;
}

.sched__row--idle {
    opacity: .4;
}

.sched__track {
    height: 32px;
}

.sched__cell {
    border-right: 1px solid #e9e4d8;
}

.sched__cell--today {
    background: rgba(15, 118, 110, .07);
}

.sched__bar {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-width: 6px;
}

.sched__bar--rent {
    background: #0f766e;
}

.sched__bar--book {
    background: #d9a441;
}

.sched__bar-text {
    color: #fff;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .02em;
}

.sched__row--load {
    border-bottom: none;
    min-height: 26px;
}

.sched__row--load .sched__name {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.sched__load {
    display: block;
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    padding-top: 5px;
    font-variant-numeric: tabular-nums;
}

.sched__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--muted);
    padding: 2px 4px;
}

.sched__swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 4px;
}

.sched__swatch--rent {
    background: #0f766e;
}

.sched__swatch--book {
    background: #d9a441;
}

.sched__swatch--free {
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--line);
}

.cta--quiet {
    background: transparent;
    border-style: dashed;
    color: var(--muted);
    font-weight: 500;
    font-size: 14px;
    padding: 11px;
}
/* ---------- Расписание: липкая навигация и свайп ---------- */

.sched-page .topbar {
    position: static;
}

.sched-nav {
    position: sticky;
    top: 0;
    z-index: 12;
    background: var(--bg);
    padding: 8px 0 6px;
    align-items: center;
}

.sched-nav__hint {
    font-size: 11.5px;
    color: var(--muted);
    padding-left: 4px;
    white-space: nowrap;
}

.sched {
    touch-action: pan-y;
}
@media (min-width: 820px) {
    .sched__head,
    .sched__row {
        grid-template-columns: 130px 1fr;
    }

    .sched__plate {
        font-size: 14px;
    }

    .sched__model {
        font-size: 11px;
    }
}
/* ---------- История платежей ---------- */

.payments {
    display: grid;
    gap: 2px;
    margin-top: 6px;
}

.payments__row {
    display: grid;
    grid-template-columns: 82px 1fr auto;
    gap: 8px;
    align-items: baseline;
    padding: 7px 2px;
    border-top: 1px solid #f3f0e9;
    font-size: 13px;
}

.payments__date {
    color: var(--muted);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
}

.payments__note {
    color: var(--ink);
}

.payments__amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
/* ---------- Страховка для опасных действий ---------- */

.danger {
    font-size: 14px;
}

.danger__summary {
    list-style: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    text-decoration: underline;
    padding: 4px;
}

.danger__summary::-webkit-details-marker {
    display: none;
}

.danger__box {
    border: 1px solid #ecc4bf;
    background: #fdf3f1;
    border-radius: var(--radius);
    padding: 14px;
    display: grid;
    gap: 12px;
}

.danger__text {
    margin: 0;
    font-size: 13px;
    color: #7a3b34;
    line-height: 1.4;
}

.btn--danger {
    background: #a33b31;
    color: #fff;
    border: 1px solid #a33b31;
    font-weight: 600;
    padding: 13px;
    border-radius: var(--radius);
    font-size: 15px;
}
.sched__track[data-vehicle] {
    cursor: pointer;
}

.sched__hint {
    margin: 0 2px;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}
/* ---------- Плавающие действия в карточке контракта ---------- */

.page--dock {
    padding-bottom: 170px;
}

.actiondock {
    position: fixed;
    right: 14px;
    bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom, 0px));
    z-index: 26;
    display: grid;
    gap: 8px;
    width: min(300px, calc(100vw - 28px));
}

.actiondock__secondary {
    display: block;
    text-align: center;
    padding: 11px 14px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--accent-ink);
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 8px 20px -12px rgba(0, 0, 0, .45);
}

.actiondock__form {
    display: block;
}

.actiondock__primary {
    display: block;
    width: 100%;
    box-shadow: 0 12px 26px -10px rgba(15, 118, 110, .8);
}
/* Одна кнопка в блоке .actions — на всю ширину, как ссылка-cta */
.actions > form:only-child {
    grid-column: 1 / -1;
}
/* ---------- Три плитки на сводке ---------- */

.tiles {
    grid-template-columns: repeat(3, 1fr);
}

.tile {
    padding: 12px 12px;
}

.tile__num {
    font-size: 24px;
}

.tile__label {
    font-size: 12px;
    line-height: 1.2;
}

.tile--booking {
    background: linear-gradient(165deg, #fffaf0 0%, #fdf3e0 100%);
    border-color: #eedcb8;
}

.tile--booking .tile__num {
    color: #8a6a1f;
}
/* ---------- Логотип ---------- */

.topbar__logo {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .45));
}

.login__logo {
    width: 104px;
    height: 104px;
    font-size: 0;
}
.topbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
/* ---------- Расписание: даты держатся под панелью ---------- */

.sched-page {
    --sched-nav-h: 46px;
}

.sched {
    overflow: visible;
}

.sched-nav {
    height: var(--sched-nav-h);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 0;
    scrollbar-width: none;
}

.sched-nav::-webkit-scrollbar {
    display: none;
}

.sched__head {
    top: var(--sched-nav-h);
    z-index: 11;
    padding-top: 6px;
    box-shadow: 0 6px 10px -8px rgba(0, 0, 0, .5);
}
/* ---------- Деньги в форме правки ---------- */

.moneybox {
    background: #f7f6f1;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: grid;
    gap: 6px;
    font-size: 13.5px;
}

.moneybox__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.moneybox__row strong {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.moneybox__preview {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: #0a5a52;
}

.payments__title {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}
.extrarow {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.extrarow .input {
    flex: 1;
    min-width: 0;
}

.extrarow .btn {
    flex: 0 0 auto;
    padding: 0 16px;
    font-size: 14px;
}
/* Убираем стрелки-счётчики у числовых полей: суммы вводятся руками */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
/* ---------- Лента событий на сводке ---------- */

.block__title--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.badge--danger {
    background: #fbe4e1;
    color: #8c2f27;
    border: 1px solid #ecc4bf;
}

.timeline {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.event {
    display: grid;
    grid-template-columns: 74px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #f3f0e9;
    color: inherit;
}

.event:last-child {
    border-bottom: none;
}

.event:active {
    background: #f7f6f1;
}

.event__when {
    display: grid;
    gap: 1px;
    border-left: 3px solid var(--accent);
    padding-left: 8px;
}

.event--book .event__when {
    border-left-color: #d9a441;
}

.event--late .event__when {
    border-left-color: #a33b31;
}

.event__time {
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.event__hint {
    font-size: 10.5px;
    color: var(--muted);
    line-height: 1.2;
}

.event--late .event__hint {
    color: #a33b31;
}

.event__main {
    min-width: 0;
}

.event__vehicle {
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event__model {
    font-weight: 650;
}

.event__plate {
    font-weight: 700;
}

.event__client {
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event__side {
    display: grid;
    justify-items: end;
    gap: 2px;
}

.event__kind {
    font-size: 10.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.event--book .event__kind {
    color: #8a6a1f;
}

.event--late .event__kind {
    color: #a33b31;
}

.event__sum {
    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.hint--strong {
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
    margin: 0;
}
/* ---------- Установка приложения ---------- */

.cta--install {
    width: 100%;
    cursor: pointer;
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    font-size: 15px;
}

.cta--install:active {
    background: var(--accent-ink);
}

.hint--install {
    margin: 0;
    text-align: center;
    font-size: 12.5px;
    color: var(--muted);
}
/* ---------- Стрелки направления и группы по дням ---------- */

.event {
    grid-template-columns: 12px 70px 1fr auto;
    gap: 8px;
}

/* Узкая вертикальная стрелка: ↑ байк уходит, ↓ байк возвращается */
.event__dir {
    width: 12px;
    display: grid;
    place-items: center;
    font-size: 17px;
    line-height: 1;
    font-weight: 400;
    background: none;
    border: none;
}

.event__dir.dir-up {
    color: #b58a2f;
}

.event__dir.dir-down {
    color: #0f766e;
}

.event--late .event__dir {
    color: #a33b31;
}

/* у .event__when больше нет своей полоски — направление показывает стрелка */
.event__when {
    border-left: none;
    padding-left: 0;
}

.event__vehicle {
    font-size: 13.5px;
}

.daygroups {
    display: grid;
    gap: 14px;
}

.daygroup__head {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 2px 5px;
}

/* ---------- Деньги ---------- */

.metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.metric {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: grid;
    gap: 2px;
}

.metric--main {
    grid-column: 1 / -1;
    background: var(--accent-soft);
    border-color: #cbe8e1;
}

.metric--main .metric__value {
    font-size: 26px;
    color: var(--accent-ink);
}

.metric__label {
    font-size: 12px;
    color: var(--muted);
}

.metric__value {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}

.money-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.money-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.money-table th,
.money-table td {
    padding: 9px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.money-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.money-table tbody tr:last-child td {
    border-bottom: 0;
}

.money-table .num {
    text-align: right;
}
