:root {
    --pink: #e04b9a;
    --pink-dark: #c73582;
    --pink-soft: #fdeaf3;
    --pink-line: #f6bfd9;
    --ink: #33323a;
    --muted: #8c8a94;
    --line: #eeeeF2;
    --page: #f6f6f8;
    --card: #ffffff;
    --green: #32c46c;
    --shadow: 0 12px 30px rgba(51, 45, 62, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body.drawer-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.front-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% -80px, rgba(224, 75, 154, 0.22), transparent 260px),
        #f5f5f7;
    padding: 12px 12px 0;
}

.front-panel {
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;
    background: #f3f3f5;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.mini-titlebar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    height: 56px;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #ececf0;
    background: rgba(255, 255, 255, 0.96);
    padding: 0 14px;
    color: #22222a;
    font-size: 16px;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.booking-box {
    padding: 14px 12px 0;
}

.booking-section,
.setup-box,
.admin-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.warm-tip {
    border-radius: 8px;
    margin-bottom: 12px;
    background: var(--pink-soft);
    color: var(--pink-dark);
    padding: 11px 14px;
    font-size: 13px;
    line-height: 1.5;
}

.booking-section {
    margin-bottom: 12px;
    padding: 14px;
}

.section-title {
    margin-bottom: 12px;
    color: #64616c;
    font-size: 14px;
    font-weight: 700;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-title-row small {
    color: #aaa7b0;
    font-size: 12px;
    font-weight: 600;
}

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

.service-card {
    position: relative;
    display: flex;
    min-height: 118px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #ececf0;
    border-radius: 8px;
    background: #fff;
    padding: 10px 7px 9px;
    text-align: center;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.service-card input,
.choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.service-thumb {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    overflow: hidden;
    border-radius: 8px;
    background: #f7f3f4;
    color: var(--pink-dark);
    font-weight: 900;
    transition: background 160ms ease, color 160ms ease;
}

.service-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.service-card strong {
    color: #35323b;
    font-size: 15px;
    line-height: 1.2;
}

.service-card small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
}

.service-card i {
    position: absolute;
    top: 7px;
    right: 7px;
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: #fff;
    font-style: normal;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 160ms ease, transform 160ms ease;
}

.service-card i::before {
    content: "";
    width: 8px;
    height: 5px;
    border-bottom: 2px solid currentColor;
    border-left: 2px solid currentColor;
    transform: rotate(-45deg) translate(1px, -1px);
}

.service-card:has(input:checked) {
    border-color: var(--pink);
    background: #fff5fa;
    box-shadow: 0 8px 18px rgba(224, 75, 154, 0.12);
}

.service-card:has(input:checked) .service-thumb {
    box-shadow: inset 0 0 0 2px rgba(224, 75, 154, 0.18);
}

.service-card:has(input:checked) strong {
    color: var(--pink-dark);
}

.service-card:has(input:checked) i {
    background: var(--pink);
    opacity: 1;
    transform: scale(1);
}

.date-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.date-strip::-webkit-scrollbar {
    display: none;
}

.choice {
    position: relative;
}

.choice span {
    display: grid;
    min-height: 58px;
    place-items: center;
    border: 1px solid #ececf0;
    border-radius: 8px;
    background: #fff;
    color: #484550;
    font-size: 14px;
    font-weight: 800;
}

.choice input:checked + span {
    border-color: var(--pink);
    background: #fff5fa;
    color: var(--pink);
}

.date-chip {
    flex: 1 0 84px;
    min-width: 84px;
}

.date-chip span {
    padding: 8px 7px;
    text-align: center;
}

.date-chip strong,
.date-chip small {
    display: block;
    white-space: nowrap;
}

.date-chip small {
    margin-top: 3px;
    color: #aaa7b0;
    font-size: 12px;
    font-weight: 600;
}

.stylist-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 1px 0 3px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stylist-list::-webkit-scrollbar {
    display: none;
}

.stylist-option {
    position: relative;
    display: grid;
    flex: 0 0 210px;
    grid-template-columns: 48px 1fr;
    gap: 10px;
    align-items: center;
    border: 1px solid #ececf0;
    border-radius: 8px;
    background: #fff;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.stylist-avatar {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #2f3138, #6c5d73);
    color: #fff;
    font-weight: 900;
}

.stylist-option strong {
    display: block;
    color: #36333d;
    font-size: 15px;
    line-height: 1.3;
}

.stylist-option small {
    display: block;
    margin-top: 4px;
    color: #98959f;
    font-size: 12px;
    line-height: 1.35;
}

.stylist-option i {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: #fff;
    font-style: normal;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 160ms ease, transform 160ms ease;
}

.stylist-option i::before {
    content: "";
    width: 8px;
    height: 5px;
    border-bottom: 2px solid currentColor;
    border-left: 2px solid currentColor;
    transform: rotate(-45deg) translate(1px, -1px);
}

.stylist-option.active {
    border-color: var(--pink);
    background: #fff5fa;
    box-shadow: 0 8px 18px rgba(224, 75, 154, 0.12);
}

.stylist-option.active .stylist-avatar,
.stylist-option.active i {
    background: var(--pink);
}

.stylist-option.active strong {
    color: var(--pink-dark);
}

.stylist-option.active i {
    opacity: 1;
    transform: scale(1);
}

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

.slot-button {
    min-height: 42px;
    border: 1px solid #ececf0;
    border-radius: 8px;
    background: #fff;
    color: #4d4954;
    cursor: pointer;
    font-weight: 700;
}

.slot-button.active {
    border-color: var(--pink);
    background: var(--pink);
    color: #fff;
}

.slot-button:disabled {
    color: #bbb8c1;
    background: #f4f4f6;
    cursor: not-allowed;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.field:last-child {
    margin-bottom: 0;
}

.field label,
.field-title {
    color: #44414c;
    font-size: 14px;
    font-weight: 800;
}

.field input,
.field select,
.field textarea,
.admin-form input,
.admin-form select {
    width: 100%;
    min-height: 44px;
    border: 1px solid #ececf0;
    border-radius: 8px;
    background: #fff;
    color: #33323a;
    padding: 10px 12px;
    outline: none;
}

.field textarea {
    min-height: 78px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.admin-form input:focus,
.admin-form select:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(224, 75, 154, 0.12);
}

.primary-btn,
.secondary-btn,
.text-btn {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 0;
    padding: 0 16px;
    font-weight: 800;
    cursor: pointer;
}

.primary-btn {
    width: 100%;
    background: var(--pink);
    color: #fff;
}

.primary-btn:disabled {
    background: #d7d3da;
    cursor: wait;
}

.secondary-btn {
    border: 1px solid #e5e2e8;
    background: #fff;
    color: #4a4650;
}

.text-btn {
    background: transparent;
    color: var(--pink);
}

.booking-footer {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 148px;
    width: min(430px, 100%);
    transform: translateX(-50%);
    align-items: center;
    gap: 12px;
    border-top: 1px solid #eeeeF2;
    background: rgba(255, 255, 255, 0.98);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(51, 45, 62, 0.08);
}

.booking-footer span {
    display: block;
    margin-bottom: 3px;
    color: #7e7b85;
    font-size: 12px;
    line-height: 1.2;
}

.booking-footer strong {
    display: block;
    overflow: hidden;
    color: var(--pink);
    font-size: 14px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bottom-spacer {
    height: 86px;
}

.drawer-mask {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(25, 22, 29, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.drawer-mask.open {
    opacity: 1;
    pointer-events: auto;
}

.customer-drawer {
    position: relative;
    width: min(430px, 100%);
    max-height: min(82vh, 620px);
    overflow-y: auto;
    border-radius: 8px 8px 0 0;
    background: #fff;
    padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 220ms ease;
}

.drawer-mask.open .customer-drawer {
    transform: translateY(0);
}

.customer-drawer h2 {
    margin: 0 0 8px;
    color: #302c35;
    font-size: 20px;
    line-height: 1.3;
    letter-spacing: 0;
}

.customer-drawer p {
    margin: 0 0 20px;
    color: #817d88;
    font-size: 14px;
    line-height: 1.7;
}

.drawer-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f4f2f5;
    color: #7d7784;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.result-box {
    position: fixed;
    left: 50%;
    bottom: 76px;
    z-index: 9;
    display: none;
    width: min(390px, calc(100% - 32px));
    transform: translateX(-50%);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(51, 45, 62, 0.18);
    color: var(--pink-dark);
    padding: 14px 16px;
    text-align: center;
    font-weight: 800;
}

.result-box.error {
    color: #c63c36;
}

.hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.setup-box {
    max-width: 720px;
    margin: 60px auto;
    padding: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d2930;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 8px;
    background: var(--pink);
    color: #fff;
    font-size: 17px;
}

.admin-shell {
    min-height: 100vh;
    background: #f6f6f8;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    background:
        radial-gradient(circle at 50% -60px, rgba(224, 75, 154, 0.22), transparent 260px),
        #f6f6f8;
    padding: 24px;
}

.login-card {
    width: min(420px, 100%);
    border: 1px solid #eeeeF2;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 26px;
}

.login-card h1 {
    margin: 28px 0 8px;
    color: #2f2b34;
    font-size: 28px;
    letter-spacing: 0;
}

.login-card p {
    margin: 0 0 20px;
    color: #817d88;
    line-height: 1.7;
}

.admin-topbar {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e7e6eb;
    background: #fff;
    padding: 0 28px;
}

.admin-nav {
    display: flex;
    gap: 8px;
}

.admin-nav a {
    border-radius: 8px;
    color: #68636f;
    padding: 9px 12px;
    font-weight: 800;
}

.admin-nav a.active {
    background: var(--pink-soft);
    color: var(--pink-dark);
}

.admin-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
}

.admin-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-title h1 {
    margin: 0;
    color: #2f2b34;
    font-size: 26px;
    letter-spacing: 0;
}

.admin-title p {
    margin: 6px 0 0;
    color: #817d88;
}

.admin-card {
    padding: 18px;
    margin-bottom: 16px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.toolbar input,
.inline-form select,
.admin-card input,
.admin-card select {
    border: 1px solid #e7e6eb;
    border-radius: 8px;
    background: #fff;
    color: #33323a;
    min-height: 36px;
    padding: 6px 10px;
}

.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #eeeeF2;
    padding: 12px 10px;
    text-align: left;
    font-size: 14px;
}

.admin-table th {
    color: #77727f;
    font-weight: 800;
}

.status {
    display: inline-flex;
    min-width: 52px;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 800;
}

.status.booked {
    background: #fff0f7;
    color: var(--pink-dark);
}

.status.done {
    background: #e8f8ee;
    color: #1f8a4b;
}

.status.cancelled {
    background: #ececf0;
    color: #74707b;
}

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

.admin-form {
    display: grid;
    gap: 14px;
}

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

.inline-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.notice {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--pink-soft);
    color: var(--pink-dark);
}

.notice.error {
    background: #fbe7e1;
    color: #a83a28;
}

.empty {
    padding: 28px 0;
    color: #8b8791;
    text-align: center;
}

@media (max-width: 720px) {
    .front-shell {
        padding: 0;
    }

    .front-panel {
        max-width: none;
    }

    .admin-topbar,
    .admin-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-topbar {
        padding: 16px;
    }

    .admin-main {
        padding: 16px;
    }

    .admin-grid,
    .form-row {
        grid-template-columns: 1fr;
    }
}
