* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


:root {

    color-scheme: dark;

    --background: #000;

    --surface: #0d0d0d;

    --surface-2: #151515;

    --surface-3: #1b1b1b;

    --border: #292929;

    --border-light: #3a3a3a;

    --text: #fff;

    --text-secondary: #8e8e8e;

    --radius: 18px;

}


body {

    min-height: 100vh;

    background: var(--background);

    color: var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    -webkit-font-smoothing:
        antialiased;

    /* Убирает масштабирование интерфейса двойным тапом на мобильных. */
    touch-action: manipulation;

    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;

}


button,
input,
select {

    font: inherit;

}


button {

    cursor: pointer;

}


button:disabled {

    opacity: .35;

    cursor: not-allowed;

}


.app {

    min-height: 100vh;

}


.header {

    position: sticky;

    top: 0;

    z-index: 50;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding:
        calc(
            16px +
            env(safe-area-inset-top)
        )
        18px
        16px;

    background:
        rgba(0, 0, 0, .92);

    border-bottom:
        1px solid var(--border);

    backdrop-filter:
        blur(18px);

}


.header-left {

    display: flex;

    align-items: center;

    gap: 11px;

}


.header-icon {

    width: 40px;

    height: 40px;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        var(--surface-2);

    border:
        1px solid var(--border);

    border-radius: 12px;

}


.header-icon svg {

    width: 22px;

    height: 22px;

}


.header-title {

    max-width: min(310px, 42vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 16px;

    font-weight: 700;

    letter-spacing: -.4px;

}


.header-date {

    margin-top: 3px;

    color: var(--text-secondary);

    font-size: 12px;

}


.status {

    padding: 8px 11px;

    border:
        1px solid var(--border);

    border-radius: 999px;

    color: var(--text-secondary);

    font-size: 11px;

    font-weight: 650;

}


.content {

    width: 100%;

    max-width: 720px;

    margin: 0 auto;

    padding:
        16px
        16px
        calc(
            35px +
            env(safe-area-inset-bottom)
        );

}


.stats {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 10px;

    margin-bottom: 12px;

}


.stat-card {

    position: relative;

    padding: 17px;

    overflow: hidden;

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

}


.stat-icon {

    position: absolute;

    right: 14px;

    top: 14px;

    width: 20px;

    height: 20px;

    color: #555;

}


.stat-icon svg {

    width: 100%;

    height: 100%;

}


.stat-label {

    color: var(--text-secondary);

    font-size: 12px;

}


.stat-value {

    margin-top: 9px;

    font-size: 24px;

    font-weight: 750;

    letter-spacing: -.7px;

}


.stat-sub {

    margin-top: 5px;

    color: var(--text-secondary);

    font-size: 12px;

}


.card {

    margin-bottom: 12px;

    padding: 17px;

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius);

}


.card-title-row {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 10px;

    margin-bottom: 15px;

}


.card-title {

    display: flex;

    align-items: center;

    gap: 8px;

    font-size: 17px;

    font-weight: 720;

    letter-spacing: -.2px;

}


.title-icon {

    width: 20px;

    height: 20px;

    display: flex;

    color: #aaa;

}


.title-icon svg {

    width: 100%;

    height: 100%;

}


.counter {

    min-width: 30px;

    height: 30px;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 0 8px;

    background:
        var(--surface-2);

    border:
        1px solid var(--border);

    border-radius: 9px;

    font-size: 12px;

    font-weight: 700;

}


.shift-info {

    padding: 13px;

    background:
        var(--surface-2);

    border:
        1px solid var(--border);

    border-radius: 13px;

    color: var(--text-secondary);

    font-size: 13px;

}


.shift-buttons {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 8px;

    margin-top: 9px;

}


.button {

    min-height: 50px;

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    border-radius: 13px;

    border:
        1px solid var(--border);

    font-weight: 650;

    transition:
        transform .12s ease,
        opacity .12s ease;

}


.button:active {

    transform: scale(.98);

}


.button-primary {

    background: #fff;

    color: #000;

    border-color: #fff;

}


.button-secondary {

    background:
        var(--surface-2);

    color: #fff;

}


.button-icon {

    width: 19px;

    height: 19px;

}


.label {

    display: block;

    margin-bottom: 7px;

    color: var(--text-secondary);

    font-size: 12px;

    font-weight: 650;

}


.input {

    width: 100%;

    height: 51px;

    padding: 0 14px;

    margin-bottom: 16px;

    background:
        var(--surface-2);

    color: var(--text);

    border:
        1px solid var(--border);

    border-radius: 13px;

    outline: none;

}


.input:focus {

    border-color:
        var(--border-light);

}


.plate-input-single {

    width: 100%;

    height: 54px;

    padding: 0 15px;

    background:
        var(--surface-2);

    color: #fff;

    border:
        1px solid var(--border);

    border-radius: 13px;

    outline: none;

    text-align: center;

    font-size: 20px;

    font-weight: 700;

    letter-spacing: 1px;

    text-transform: uppercase;

}


.plate-input-single:focus {

    border-color:
        var(--border-light);

}


.plate-preview {

    margin:
        8px 0 16px;

    color: var(--text-secondary);

    text-align: center;

    font-size: 12px;

}


.cleaning-box {

    padding: 14px;

    margin-bottom: 13px;

    background:
        var(--surface-2);

    border:
        1px solid var(--border);

    border-radius: 15px;

}


.cleaning-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

}


.cleaning-title {

    display: flex;

    align-items: center;

    gap: 8px;

    font-size: 14px;

    font-weight: 700;

}


.cleaning-icon {

    width: 20px;

    height: 20px;

    color: #aaa;

}


.cleaning-icon svg {

    width: 100%;

    height: 100%;

}


.cleaning-price {

    font-size: 14px;

    font-weight: 700;

}


.cleaning-subtitle {

    margin-top: 5px;

    color: var(--text-secondary);

    font-size: 11px;

}


.counter-control {

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 10px;

    margin-top: 14px;

}


.counter-button {

    width: 42px;

    height: 42px;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        var(--surface-3);

    color: #fff;

    border:
        1px solid var(--border);

    border-radius: 12px;

}


.counter-button svg {

    width: 18px;

    height: 18px;

}


.elements-input {

    width: 80px;

    height: 42px;

    background: transparent;

    color: #fff;

    border: 0;

    outline: 0;

    text-align: center;

    font-size: 20px;

    font-weight: 700;

}


.elements-input::-webkit-inner-spin-button,
.elements-input::-webkit-outer-spin-button {

    appearance: none;

}


.cleaning-total {

    display: flex;

    justify-content: space-between;

    margin-top: 14px;

    padding-top: 12px;

    border-top:
        1px solid var(--border);

    color: var(--text-secondary);

    font-size: 13px;

}


.cleaning-total strong {

    color: #fff;

    font-size: 15px;

}


.target-shift {

    margin-bottom: 15px;

    padding: 11px 12px;

    background:
        #181818;

    border:
        1px solid #363636;

    border-radius: 12px;

    color: #cfcfcf;

    font-size: 12px;

}


.hidden {

    display: none !important;

}


.icon-button,
.small-icon-button {

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        var(--surface-2);

    color: #aaa;

    border:
        1px solid var(--border);

}


.icon-button {

    width: 36px;

    height: 36px;

    border-radius: 10px;

}


.small-icon-button {

    width: 32px;

    height: 32px;

    flex-shrink: 0;

    border-radius: 9px;

}


.icon-button svg,
.small-icon-button svg {

    width: 17px;

    height: 17px;

}


.message {

    min-height: 20px;

    margin-top: 10px;

    color: #ff5f5f;

    text-align: center;

    font-size: 16px;

}


.cars-list,
.history-list {

    display: flex;

    flex-direction: column;

    gap: 8px;

}


.empty {

    padding: 25px 10px;

    color: var(--text-secondary);

    text-align: center;

    font-size: 13px;

}


.car-item {

    display: flex;

    align-items: stretch;

    gap: 11px;

    padding: 14px;

    background:
        var(--surface-2);

    border:
        1px solid var(--border);

    border-radius: 14px;

}


.car-icon {

    width: 38px;

    height: 38px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        var(--surface-3);

    border-radius: 11px;

    color: #aaa;

}


.car-icon svg {

    width: 21px;

    height: 21px;

}


.car-main {

    flex: 1;

    min-width: 0;

}


.car-model {

    color: #fff;

    font-size: 17px;

    font-weight: 780;

    letter-spacing: -.25px;

}


.car-plate {

    display: inline-flex;

    margin-top: 8px;

    padding: 5px 8px;

    color: #d7d7d7;

    background: var(--surface-3);

    border: 1px solid var(--border);

    border-radius: 7px;

    font-size: 12px;

    font-weight: 650;

}


.car-cleaning {

    display: flex;

    align-items: center;

    gap: 6px;

    width: fit-content;

    margin-top: 7px;

    padding: 5px 8px;

    color: #999;

    background: #111;

    border-radius: 7px;

    font-size: 11px;

}

.car-cleaning strong {
    color: #ddd;
    font-weight: 650;
}

.car-time {
    margin-top: 9px;
    color: #666;
    font-size: 10px;
    line-height: 1;
}

.add-car-card {
    position: relative;
    transition: opacity .2s ease, filter .2s ease;
}

.add-car-disabled {
    opacity: .72;
}

.add-car-disabled::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, .28);
    backdrop-filter: blur(5px) saturate(.65);
    -webkit-backdrop-filter: blur(5px) saturate(.65);
    pointer-events: auto;
}

.add-car-disabled-message {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    transform: translate(-50%, -50%);
    width: calc(100% - 34px);
    padding: 13px 15px;
    color: #ff6f6f;
    background: rgba(35, 35, 35, .72);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 14px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .42);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}


.car-actions {

    display: flex;

    flex-direction: column;

    align-items: flex-end;

    justify-content: space-between;

    gap: 10px;

}

.car-action-buttons {
    display: flex;
    align-items: center;
    gap: 7px;
}


.car-price {

    font-size: 15px;

    font-weight: 750;

    white-space: nowrap;

}


.history-item {

    overflow: hidden;

    background:
        var(--surface-2);

    border:
        1px solid var(--border);

    border-radius: 14px;

}


.history-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    padding: 13px;

}


.history-main {

    flex: 1;

    min-width: 0;

    padding: 0;

    background: transparent;

    color: #fff;

    border: 0;

    text-align: left;

}


.history-date {

    font-size: 14px;

    font-weight: 700;

}


.history-info {

    margin-top: 4px;

    color: var(--text-secondary);

    font-size: 12px;

}


.history-total {

    display: flex;

    align-items: center;

    gap: 8px;

}


.history-total strong {

    font-size: 14px;

    white-space: nowrap;

}


.history-details {

    max-height: 0;

    overflow: hidden;

    opacity: 0;

    border-top:
        0 solid var(--border);

    transition:
        max-height .3s ease,
        opacity .2s ease,
        border-top-width .2s ease;

}


.history-details.open {

    max-height: 5000px;

    opacity: 1;

    border-top-width: 1px;

}


.history-details > * {

    padding: 12px;

}


.history-cars {

    display: flex;

    flex-direction: column;

    gap: 8px;

}


.history-actions {

    display: flex;

    flex-direction: column;

    gap: 8px;

    padding-top: 0 !important;

}


.history-add {

    min-height: 45px;

}


.history-delete-button {

    width: 100%;

    min-height: 43px;

    background: transparent;

    color: #999;

    border:
        1px solid var(--border);

    border-radius: 12px;

}


.history-loading {

    padding: 20px;

    color: var(--text-secondary);

    text-align: center;

    font-size: 12px;

}


.modal-overlay {

    position: fixed;

    inset: 0;

    z-index: 100;

    display: flex;

    align-items: flex-end;

    background:
        rgba(0, 0, 0, .7);

    backdrop-filter:
        blur(6px);

}


.modal {

    width: 100%;

    max-width: 700px;

    margin: 0 auto;

    padding:
        20px
        16px
        calc(
            20px +
            env(safe-area-inset-bottom)
        );

    background: #101010;

    border:
        1px solid var(--border);

    border-bottom: 0;

    border-radius:
        22px 22px 0 0;

    max-height: calc(100vh - env(safe-area-inset-top));

    overflow-y: auto;

}


.modal-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 18px;

}


.modal-title {

    font-size: 18px;

    font-weight: 750;

}


.modal-actions {

    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 8px;

    margin-top: 6px;

}


@media (max-width: 430px) {

    .header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-left {
        min-width: 0;
        flex: 1 1 auto;
    }

    .header-title {
        max-width: 38vw;
        font-size: 14px;
    }

    .status {
        order: 3;
    }

    .header-actions {
        margin-left: auto;
    }

    .content {

        padding-left: 12px;

        padding-right: 12px;

    }


    .card {

        padding: 15px;

    }


    .stat-card {

        padding: 15px;

    }


    .stat-value {

        font-size: 21px;

    }


    .header {

        padding-left: 14px;

        padding-right: 14px;

    }

}


@media (
    min-width: 701px
) {

    .content {

        padding-top: 24px;

    }

}

.delete-button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    color: #777;
    border: 1px solid var(--border);
    border-radius: 9px;
    transition: color .15s ease, background .15s ease, border-color .15s ease, transform .12s ease;
}

.delete-button svg {
    width: 16px;
    height: 16px;
}

.delete-button:hover {
    color: #fff;
    background: #242424;
    border-color: #555;
}

.delete-button:active {
    transform: scale(.94);
}

.edit-button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--surface-3);
    color: #bcbcbc;
    border: 1px solid var(--border);
    border-radius: 9px;
    transition: color .15s ease, background .15s ease, border-color .15s ease, transform .12s ease;
}

.edit-button svg {
    width: 16px;
    height: 16px;
}

.edit-button:hover {
    color: #fff;
    background: #282828;
    border-color: #555;
}

.edit-button:active {
    transform: scale(.94);
}

.edit-cleaning {
    padding: 14px;
    margin-top: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 15px;
}

.login-screen {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--background);
}

.login-card,
.admin-card {
    width: 100%;
    max-width: 390px;
    padding: 26px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
}

.login-card h1 {
    font-size: 24px;
    letter-spacing: -.5px;
}

.login-mark {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: #fff;
    color: #000;
    border-radius: 13px;
    font-size: 25px;
    font-weight: 800;
}

.login-powered {
    margin-top: 7px;
    margin-bottom: 28px;
    color: var(--text-secondary);
    font-size: 12px;
}

.login-input {
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.small-header-button {
    min-height: 32px;
    padding: 0 9px;
    background: var(--surface-2);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 11px;
}

.admin-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(6px);
}

.admin-card {
    max-width: 520px;
    max-height: calc(100vh - 32px);
    overflow: auto;
}

.admin-users {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 20px;
}

.admin-user {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 11px;
    font-size: 13px;
}

.admin-user-code {
    color: var(--text-secondary);
}

.cache-reset-button {
    position: fixed;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 90;
    min-height: 38px;
    padding: 0 13px;
    color: #aaa;
    background: rgba(20, 20, 20, .88);
    border: 1px solid var(--border-light);
    border-radius: 11px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .32);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 11px;
    font-weight: 650;
}

.cache-reset-button:active {
    transform: scale(.97);
}

/* История должна оставаться набором карточек, а не сливаться в текст. */
.history-item {
    background: var(--surface);
    border-color: var(--border);
}

.history-header {
    min-height: 68px;
    cursor: pointer;
    user-select: none;
    transition: background .15s ease;
}

.history-header:hover,
.history-header:active {
    background: var(--surface-2);
}

.history-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.history-salary {
    font-size: 14px;
    font-weight: 750;
    white-space: nowrap;
}

.history-arrow {
    width: 27px;
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 22px;
    line-height: 1;
    transition: transform .2s ease, color .2s ease;
}

.history-arrow.open {
    color: #fff;
    transform: rotate(90deg);
}

.history-details.open {
    padding: 12px;
    background: #101010;
}

.history-details > * {
    padding: 0;
}

.history-details .history-loading {
    padding: 18px 0;
}

.history-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 11px;
    font-size: 12px;
}

.history-summary > :last-child {
    color: #fff;
    font-weight: 700;
}

.history-cars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-car {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 11px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 11px;
}

.history-car-model {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.history-car-plate {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.history-car-price {
    flex-shrink: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.history-delete-button {
    margin-top: 10px;
    color: #aaa;
}

.edit-button,
.delete-button {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.car-actions {
    min-width: 98px;
}

@media (max-width: 430px) {
    .car-item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        padding: 13px;
    }

    .car-model {
        font-size: 16px;
    }

    .car-actions {
        min-width: 95px;
    }

    .car-price {
        font-size: 14px;
    }

    .car-action-buttons {
        gap: 7px;
    }

    .edit-button,
    .delete-button {
        width: 44px;
        height: 44px;
    }

    .history-header {
        padding: 11px;
    }

    .history-right {
        gap: 6px;
    }

    .history-salary {
        font-size: 12px;
    }

    .history-arrow {
        width: 25px;
        height: 25px;
    }

    .history-details.open {
        padding: 10px;
    }

    .history-car {
        align-items: flex-start;
    }

    .history-car-price {
        font-size: 12px;
    }
}
