@charset "UTF-8";

:root {
    --admin-ink: #343331;
    --admin-muted: #77736e;
    --admin-dark: #454039;
    --admin-dark-2: #38342f;
    --admin-accent: #a89889;
    --admin-bg: #efede9;
    --admin-card: #fbfaf8;
    --admin-line: #d8d3cd;
    --admin-success: #e2ede2;
    --admin-danger: #f3e1df;
    --admin-serif: "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
    --admin-sans: "Yu Gothic", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--admin-ink); background: var(--admin-bg); font-family: var(--admin-sans); line-height: 1.6; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.admin-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 32px 18px 22px; color: #eee9e3; background: var(--admin-dark); }
.admin-brand { display: flex; flex-direction: column; padding: 0 16px 34px; border-bottom: 1px solid #ffffff1b; color: #fff; font-family: Georgia, serif; font-size: 1.8rem; line-height: 1; letter-spacing: .05em; text-decoration: none; }
.admin-brand span { margin-top: 8px; color: #bcb2a9; font-family: var(--admin-sans); font-size: .48rem; letter-spacing: .19em; }
.admin-sidebar nav { display: grid; gap: 3px; margin-top: 26px; }
.admin-sidebar nav a { position: relative; display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 10px 14px; color: #cec7c0; border-radius: 3px; font-size: .82rem; text-decoration: none; transition: .18s ease; }
.admin-sidebar nav a:hover { color: #fff; background: #ffffff0b; }
.admin-sidebar nav a.active { color: #fff; background: #ffffff12; }
.admin-sidebar nav a.active::before { content: ""; position: absolute; left: -18px; top: 8px; bottom: 8px; width: 3px; background: #c5b3a4; }
.admin-sidebar nav i { color: #a99d93; font-family: Georgia, serif; font-size: .6rem; font-style: normal; }
.admin-logout { margin: auto 0 0; padding-top: 20px; border-top: 1px solid #ffffff1b; }
.admin-logout button { width: 100%; padding: 10px; color: #cfc7c0; background: transparent; border: 1px solid #ffffff21; cursor: pointer; }
.admin-workspace { min-width: 0; }
.admin-topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 4vw, 50px); background: #f8f6f3; border-bottom: 1px solid var(--admin-line); }
.admin-topbar > div { display: flex; align-items: baseline; gap: 12px; }
.admin-topbar span { color: #9a9189; font-size: .57rem; letter-spacing: .18em; }
.admin-topbar strong { font-size: .82rem; }
.admin-topbar time { color: var(--admin-muted); font-size: .74rem; }
.admin-main { width: min(1280px, 100%); margin: 0 auto; padding: clamp(24px, 4vw, 48px); }
.admin-main > h1 { margin: 0 0 26px; font-family: var(--admin-serif); font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 500; letter-spacing: .04em; }
.admin-main > p:first-of-type { margin-top: -15px; }
.admin-main > p > a { display: inline-block; padding: 9px 17px; color: #fff; background: #655b53; text-decoration: none; font-size: .78rem; }
.card { max-width: 100%; margin-bottom: 20px; padding: clamp(18px, 2.4vw, 28px); overflow-x: auto; background: var(--admin-card); border: 1px solid var(--admin-line); border-radius: 4px; box-shadow: 0 8px 28px #51494108; }
.card h2 { margin: 0 0 20px; padding-bottom: 13px; border-bottom: 1px solid var(--admin-line); font-family: var(--admin-serif); font-size: 1.2rem; font-weight: 500; }
.admin-help { margin: -8px 0 20px; color: var(--admin-muted); font-size: .76rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stats .card, .stat { min-height: 120px; margin: 0; }
.stat strong { display: block; margin-top: 12px; color: #4a423b; font-family: Georgia, serif; font-size: 2rem; font-weight: 400; }
table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: .8rem; }
th, td { padding: 12px 10px; border-bottom: 1px solid #e2ded9; text-align: left; vertical-align: middle; }
th { color: var(--admin-muted); background: #f1efec; font-size: .69rem; font-weight: 700; letter-spacing: .03em; }
td a { color: #5e5147; }
td form { margin: 0; }
.menu-group-form { min-width: 190px; display: flex; align-items: center; gap: 6px; }
.menu-group-form input { min-height: 34px !important; padding: 6px 8px !important; }
td button { min-width: 62px; padding: 7px 9px; color: #514840; background: #eee9e3; border: 1px solid #d0c7be; border-radius: 2px; font-size: .7rem; cursor: pointer; }
label { display: block; margin: 16px 0 6px; font-size: .77rem; font-weight: 700; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--admin-ink); background: #fff; border: 1px solid #c5bfb9; border-radius: 2px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #74675d; box-shadow: 0 0 0 3px #695a4d16; }
select[multiple] { min-height: 120px; }
textarea { resize: vertical; }
button.primary { width: 100%; min-height: 44px; margin-top: 20px; padding: 10px 14px; color: #fff; background: #5b5752; border: 0; border-radius: 2px; font-weight: 700; cursor: pointer; }
.notice, .errors { margin: 0 0 20px; padding: 13px 17px; background: var(--admin-success); border: 1px solid #c6d5c6; }
.errors { background: var(--admin-danger); border-color: #ddc2be; }
.errors strong { display: block; margin-bottom: 5px; }
.errors ul { margin: 0; padding-left: 20px; }
.guest-shell { display: block; min-height: 100vh; background: linear-gradient(145deg, #eee9e2, #ddd4ca); }
.guest-shell .admin-workspace { min-height: 100vh; display: grid; place-items: center; }
.guest-shell .admin-main { width: min(440px, calc(100% - 32px)); padding: 32px 0; }
.guest-shell .card { padding: 32px; }
.admin-login-card { position: relative; max-width: 420px; margin: 0 auto; padding: 40px 36px 36px !important; }
.admin-login-brand { display: inline-flex; flex-direction: column; color: var(--admin-ink); font-family: Georgia, serif; font-size: 2rem; line-height: 1; letter-spacing: .04em; text-decoration: none; }
.admin-login-brand small { margin-top: 8px; color: #8c8279; font-family: var(--admin-sans); font-size: .48rem; letter-spacing: .2em; }
.admin-login-eyebrow { margin: 42px 0 5px !important; color: #9a8c80; font-family: Georgia, serif; font-size: .58rem; letter-spacing: .2em; }
.admin-login-card h1 { margin: 0 0 26px; font-family: var(--admin-serif); font-size: 1.8rem; font-weight: 500; }

.admin-page-heading { margin: 0 0 26px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.admin-page-heading h1 { margin: 0; font-family: var(--admin-serif); font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 500; letter-spacing: .04em; }
.admin-kicker { margin: 0 0 4px; color: #9a8c80; font-family: Georgia, serif; font-size: .58rem; letter-spacing: .2em; }
.treatment-heading > time { color: var(--admin-muted); font-family: Georgia, serif; font-size: .86rem; }
.treatment-layout { display: grid; grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); align-items: start; gap: 20px; }
.treatment-schedule { position: sticky; top: 90px; padding: 18px; }
.treatment-schedule h2 { margin-bottom: 12px; }
.treatment-schedule-help { margin: -4px 0 10px; color: var(--admin-muted); font-size: .68rem; }
.treatment-reservation { position: relative; display: grid; grid-template-columns: 46px 1fr; gap: 10px; padding: 12px 10px; color: inherit; border-bottom: 1px solid #e1dcd6; text-decoration: none; }
.treatment-reservation:hover, .treatment-reservation.is-selected { background: #eee8e1; }
.treatment-reservation.is-current { box-shadow: inset 3px 0 #78665a; }
.treatment-reservation time { font-family: Georgia, serif; font-size: .86rem; }
.treatment-reservation span { min-width: 0; }
.treatment-reservation strong, .treatment-reservation small { display: block; }
.treatment-reservation strong { font-size: .82rem; }
.treatment-reservation small { margin-top: 2px; overflow: hidden; color: var(--admin-muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.treatment-reservation > b { grid-column: 2; justify-self: start; padding: 2px 7px; color: #4d5c4e; background: #dce8dc; font-size: .58rem; }
.treatment-reservation > b.is-next { color: #675246; background: #e9ddd2; }
.treatment-detail { min-width: 0; }
.treatment-customer-switch { margin-bottom: 12px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #e7e1da; border: 1px solid #d0c8c0; }
.treatment-customer-switch > div { min-width: 0; }
.treatment-customer-switch small, .treatment-customer-switch strong { display: block; }
.treatment-customer-switch small { color: var(--admin-muted); font-size: .58rem; }
.treatment-customer-switch strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.treatment-customer-switch > span { display: flex; flex: 0 0 auto; gap: 6px; }
.treatment-customer-switch a { padding: 7px 9px; color: #5b5149; background: #fff; border: 1px solid #c4bbb2; font-size: .66rem; text-decoration: none; }
.treatment-customer-switch a.is-next { color: #fff; background: #65584e; border-color: #65584e; }
.treatment-customer-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.treatment-customer-head h2 { margin: 0; padding: 0; border: 0; font-size: clamp(1.45rem, 3vw, 2rem); }
.treatment-customer-head p:last-child { margin: 5px 0 0; color: var(--admin-muted); }
.treatment-customer-head > a { padding-bottom: 4px; border-bottom: 1px solid currentColor; font-size: .72rem; text-decoration: none; }
.treatment-current-info { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 24px 0 0; background: var(--admin-line); border: 1px solid var(--admin-line); }
.treatment-current-info div { padding: 15px; background: #f7f4f0; }
.treatment-current-info dt { color: var(--admin-muted); font-size: .64rem; }
.treatment-current-info dd { margin: 4px 0 0; font-size: .86rem; font-weight: 700; }
.treatment-note { margin-top: 16px; padding: 13px 15px; background: #eee9e3; }
.treatment-note strong { font-size: .7rem; }
.treatment-note p { margin: 5px 0 0; font-size: .8rem; white-space: pre-wrap; }
.treatment-cancel-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--admin-line); }
.treatment-cancel-form button { padding: 9px 13px; color: #744943; background: #fff7f5; border: 1px solid #cdaea9; cursor: pointer; }
.treatment-cancel-form small { display: block; margin-top: 6px; color: var(--admin-muted); font-size: .66rem; }
.treatment-photo-history-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.treatment-photo-history-heading h2 { margin-bottom: 0; }
.treatment-photo-history-heading > span { color: var(--admin-muted); font-size: .64rem; text-align: right; }
.treatment-photo-strip { max-width: 100%; margin-top: 15px; padding-bottom: 10px; display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scrollbar-color: #9e9185 #e4ddd6; }
.treatment-photo-strip:focus-visible { outline: 2px solid #766458; outline-offset: 3px; }
.treatment-photo-card { position: relative; flex: 0 0 clamp(260px, 48%, 380px); aspect-ratio: 4 / 5; margin: 0; overflow: hidden; background: #d8d0c8; scroll-snap-align: start; }
.treatment-photo-card > a { position: absolute; inset: 0; display: block; }
.treatment-photo-card img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 18%; transition: transform .25s ease; }
.treatment-photo-card > a:hover img { transform: scale(1.015); }
.treatment-photo-card figcaption { position: absolute; z-index: 2; right: 0; bottom: 0; left: 0; padding: 62px 15px 14px; color: #fff; background: linear-gradient(transparent, #201c19e8); pointer-events: none; }
.treatment-photo-card figcaption div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.treatment-photo-card figcaption time, .treatment-photo-card figcaption b { font-size: .65rem; }
.treatment-photo-card figcaption b { font-weight: 500; }
.treatment-photo-card figcaption strong { margin-top: 3px; display: block; font-size: .86rem; }
.treatment-photo-card figcaption p { margin: 4px 0 0; display: -webkit-box; overflow: hidden; font-size: .67rem; line-height: 1.45; white-space: pre-wrap; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.treatment-photo-latest-badge { position: absolute; z-index: 3; top: 10px; left: 10px; padding: 4px 9px; color: #554b43; background: #f8f4eef0; border: 1px solid #ffffff8f; font-size: .6rem; font-weight: 700; pointer-events: none; }
.medical-image-upload-actions { display: grid; grid-template-columns: minmax(210px, .8fr) minmax(260px, 1.2fr); gap: 12px; margin: 14px 0; }
.medical-camera-form, .medical-library-form { min-width: 0; padding: 14px; background: #f4f0eb; border: 1px solid var(--admin-line); }
.medical-camera-input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.medical-camera-button { width: 100%; min-height: 48px; padding: 10px 14px; color: #fff; background: #62554b; border: 0; border-radius: 2px; font-weight: 700; cursor: pointer; }
.medical-camera-button span { margin-right: 5px; }
.medical-uploading-label { display: none; margin-top: 8px; color: var(--admin-muted); font-size: .68rem; }
.medical-camera-form.is-uploading .medical-camera-button { opacity: .55; pointer-events: none; }
.medical-camera-form.is-uploading .medical-uploading-label { display: block; }
.medical-library-form label { margin: 0 0 6px; }
.medical-library-form input { min-height: auto !important; padding: 7px !important; font-size: .7rem; }
.medical-library-form button { width: 100%; min-height: 36px; margin-top: 8px; padding: 7px 10px; color: #554b43; background: #fff; border: 1px solid #bfb5ab; cursor: pointer; }
.medical-image-limit-note { margin: -6px 0 12px; color: var(--admin-muted); font-size: .65rem; }
.medical-record-images-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 10px; margin-top: 14px; }
.medical-record-images-grid figure { min-width: 0; margin: 0; padding: 6px; background: #eee9e3; border: 1px solid var(--admin-line); }
.medical-record-images-grid figure > a { aspect-ratio: 1; display: block; overflow: hidden; background: #ddd; }
.medical-record-images-grid img { width: 100%; height: 100%; display: block; object-fit: cover; }
.medical-record-images-grid form { margin-top: 5px; }
.medical-record-images-grid form button { width: 100%; padding: 5px; color: #754d47; background: #fff8f6; border: 1px solid #d3b9b4; font-size: .62rem; cursor: pointer; }
.medical-images-empty { margin: 10px 0 0; color: var(--admin-muted); font-size: .72rem; }
.empty-state { color: var(--admin-muted); font-size: .78rem; }
.customer-reservation-history-card { overflow: hidden; }
.customer-history-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.customer-history-heading h2 { margin-bottom: 5px; }
.customer-history-heading p { margin: 0 0 16px; color: var(--admin-muted); font-size: .7rem; }
.customer-history-heading > span { flex: 0 0 auto; padding: 4px 9px; color: #5d534b; background: #eee9e3; border: 1px solid var(--admin-line); font-size: .68rem; }
.customer-reservation-history { max-height: 330px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--admin-line); scrollbar-color: #9e9185 #e4ddd6; }
.customer-reservation-history:focus-visible { outline: 2px solid #766458; outline-offset: 2px; }
.customer-reservation-history table { margin: 0; }
.customer-reservation-history thead th { position: sticky; z-index: 2; top: 0; box-shadow: 0 1px #d8d3cd; }
.customer-reservation-history tbody tr:last-child td { border-bottom: 0; }
.customer-history-pagination { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--admin-muted); font-size: .68rem; }
.customer-history-pagination > div { display: flex; align-items: center; gap: 7px; }
.customer-history-pagination a, .customer-history-pagination > div > span { padding: 6px 9px; border: 1px solid var(--admin-line); text-decoration: none; }
.customer-history-pagination a { color: #fff; background: #746357; border-color: #746357; }
.customer-history-pagination > div > span { color: #99918a; background: #f0ede9; }
.customer-history-pagination strong { color: #5d534b; font-weight: 700; }
.treatment-empty { text-align: center; }
.admin-primary-link { display: inline-flex; align-items: center; min-height: 42px; padding: 9px 17px; color: #fff; background: #655b53; font-size: .76rem; text-decoration: none; }
.reservation-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.admin-secondary-link { display: inline-flex; align-items: center; min-height: 42px; padding: 9px 17px; color: #5d534b; background: #fbfaf8; border: 1px solid var(--admin-line); font-size: .76rem; text-decoration: none; }
.admin-phone-booking-card { max-width: 980px; }
.phone-customer-search-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.phone-customer-search-status { margin: 9px 0 !important; }
.phone-customer-search-status.is-error { color: #8b4d48; font-weight: 700; }
.phone-customer-search-results { margin-bottom: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.phone-customer-result { min-height: 52px; padding: 8px 11px; color: #4f4741; background: #fff; border: 1px solid #cfc7bf; text-align: left; cursor: pointer; }
.phone-customer-result:hover, .phone-customer-result:focus-visible { background: #eee7df; border-color: #766458; outline: 1px solid #766458; }
.phone-customer-result strong, .phone-customer-result span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-customer-result strong { font-size: .76rem; }
.phone-customer-result span { margin-top: 2px; color: var(--admin-muted); font-size: .66rem; }
.phone-selected-customer { margin: 2px 0 8px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #fff; background: #746357; }
.phone-selected-customer[hidden] { display: none !important; }
.phone-selected-customer span, .phone-selected-customer strong, .phone-selected-customer small { display: block; }
.phone-selected-customer span { font-size: .58rem; opacity: .8; }
.phone-selected-customer strong { font-size: .8rem; }
.phone-selected-customer small { font-size: .65rem; }
.phone-selected-customer button { width: auto; min-height: 34px; padding: 6px 10px; color: #fff; background: #ffffff18; border: 1px solid #ffffff80; font-size: .63rem; cursor: pointer; }
.customer-duplicate-warning { margin: 13px 0 4px; padding: 12px 14px; color: #684641; background: #f6e8e5; border: 1px solid #d8b8b1; }
.customer-duplicate-warning[hidden] { display: none; }
.customer-duplicate-warning strong { display: block; font-size: .76rem; }
.customer-duplicate-warning p { margin: 4px 0 7px; font-size: .7rem; }
.customer-duplicate-warning ul { margin: 0; padding-left: 19px; }
.customer-duplicate-warning li { margin-top: 3px; font-size: .7rem; }
.customer-duplicate-warning a { color: #66443e; font-weight: 700; }
.customer-duplicate-override { margin: 11px 0 4px; padding: 11px 13px; display: flex; align-items: start; gap: 9px; background: #f2efeb; border: 1px solid var(--admin-line); font-weight: 400; }
.customer-duplicate-override input { flex: 0 0 auto; margin-top: 4px; }
.customer-duplicate-override span, .customer-duplicate-override strong, .customer-duplicate-override small { display: block; }
.customer-duplicate-override strong { color: #5f5147; font-size: .72rem; }
.customer-duplicate-override small { margin-top: 2px; color: var(--admin-muted); font-size: .64rem; }
.sales-page-heading { align-items: center; }
.sales-heading-actions { display: flex; align-items: end; gap: 9px; }
.sales-view-switch { display: inline-flex; padding: 3px; background: #e3ded8; border: 1px solid #d0c9c2; }
.sales-view-switch a { min-width: 88px; padding: 8px 14px; color: #6c625a; font-size: .72rem; text-align: center; text-decoration: none; }
.sales-view-switch a.is-active { color: #fff; background: #655b53; box-shadow: 0 2px 7px #3e352d25; }
.sales-csv-form { display: grid; grid-template-columns: 74px auto; gap: 3px 5px; }
.sales-csv-form label { grid-column: 1 / -1; margin: 0; color: var(--admin-muted); font-size: .58rem; }
.sales-csv-form input { min-height: 35px !important; padding: 6px 8px !important; font-size: .7rem; }
.sales-csv-form button { min-height: 35px; padding: 6px 11px; color: #fff; background: #746357; border: 0; font-size: .68rem; cursor: pointer; }
.sales-period-toolbar { margin-bottom: 24px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 14px; }
.sales-period-toolbar > a { min-height: 40px; padding: 8px 13px; display: inline-flex; align-items: center; color: #5d534b; background: #fbfaf8; border: 1px solid var(--admin-line); font-size: .7rem; text-decoration: none; }
.sales-period-toolbar > a:first-child { justify-self: start; }
.sales-period-toolbar > a:last-child { justify-self: end; }
.sales-period-toolbar form { display: grid; grid-template-columns: minmax(150px, 190px) auto; align-items: end; gap: 6px; }
.sales-period-toolbar label { grid-column: 1 / -1; margin: 0; text-align: center; }
.sales-period-toolbar button { min-height: 42px; padding: 8px 13px; color: #fff; background: #655b53; border: 0; cursor: pointer; }
.sales-period-title { margin: 0 0 12px; font-family: var(--admin-serif); font-size: 1.25rem; font-weight: 500; }
.sales-summary-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sales-summary-grid article { min-width: 0; padding: 17px 18px; background: #fbfaf8; border: 1px solid var(--admin-line); box-shadow: 0 7px 22px #51494108; }
.sales-summary-grid span { display: block; color: var(--admin-muted); font-size: .66rem; }
.sales-summary-grid strong { display: block; margin-top: 7px; overflow: hidden; color: #4e453e; font-family: Georgia, serif; font-size: clamp(1.35rem, 2.5vw, 2rem); font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.sales-summary-grid small { margin-left: 3px; font-family: var(--admin-sans); font-size: .6rem; font-weight: 700; }
.sales-report-card { padding: 0; overflow: hidden; }
.sales-section-heading { padding: 20px 24px 15px; display: flex; align-items: end; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--admin-line); }
.sales-section-heading h2 { margin: 0; padding: 0; border: 0; }
.sales-section-heading > span { color: var(--admin-muted); font-size: .65rem; }
.sales-table-wrap { overflow-x: auto; }
.sales-report-card table { margin: 0; }
.sales-report-card th { background: #f3f0ec; }
.sales-report-card td { background: #fff; }
.sales-report-card tbody tr:hover td { background: #faf7f3; }
.sales-report-card td small { color: var(--admin-muted); font-size: .65rem; }
.sales-report-card td.is-amount { color: #51443a; font-weight: 700; }
.sales-summary-table td:last-child { text-align: right; }
.sales-summary-table td:last-child a { display: inline-block; padding: 6px 10px; color: #fff; background: #746357; font-size: .66rem; text-decoration: none; }
.sales-detail-table { min-width: 980px; }
.sales-empty { margin: 0; padding: 36px 24px; color: var(--admin-muted); text-align: center; }
.sale-correction { min-width: 64px; }
.sale-correction summary { color: #68584d; font-size: .68rem; cursor: pointer; }
.sale-correction form { width: 210px; margin-top: 8px; padding: 10px; display: grid; gap: 6px; background: #f1ece7; border: 1px solid #d6cec6; }
.sale-correction input { min-height: 34px !important; padding: 6px 8px !important; font-size: .68rem; }
.sale-correction button { min-height: 32px; color: #fff; background: #655b53; border: 0; }
.admin-phone-booking-basics { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-phone-calendar { margin: 25px 0; padding: 18px; background: #f4f0eb; border: 1px solid var(--admin-line); }
.admin-phone-calendar-heading { margin-bottom: 15px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.admin-phone-calendar-heading h2 { margin: 0; padding: 0; border: 0; }
.admin-phone-calendar-heading > span { color: var(--admin-muted); font-size: .66rem; }
.phone-availability-picker { max-width: 100%; min-width: 0; scroll-margin-top: 90px; }
.phone-availability-toolbar { margin-bottom: 10px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.phone-availability-toolbar strong { font-family: var(--admin-serif); font-size: .92rem; font-weight: 500; text-align: center; }
.phone-availability-toolbar button { width: auto; min-height: 38px; padding: 7px 11px; color: #5d534b; background: #fff; border: 1px solid #c9c0b8; font-size: .68rem; cursor: pointer; }
.phone-availability-toolbar button:first-child { justify-self: start; }
.phone-availability-toolbar button:last-child { justify-self: end; }
.phone-availability-toolbar button:disabled { color: #aaa39c; background: #e4e1dd; cursor: not-allowed; }
.phone-availability-legend { margin-bottom: 8px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; color: var(--admin-muted); font-size: .64rem; }
.phone-availability-legend span { display: inline-flex; align-items: center; gap: 5px; }
.phone-availability-legend i { width: 15px; height: 15px; border: 1px solid #c5bdb5; }
.phone-availability-legend i.is-open { background: #fff; }
.phone-availability-legend i.is-booked { background: #9a8170; }
.phone-availability-legend i.is-closed { background: #dedbd7; }
.phone-availability-legend i.is-selected { background: #746357; }
.phone-availability-status { margin: 7px 0 10px; color: var(--admin-muted); font-size: .7rem; }
.phone-availability-status.is-error { color: #8b4d48; font-weight: 700; }
.phone-selected-slot { margin: 0 0 10px; padding: 10px 12px; color: #fff; background: #746357; font-size: .78rem; font-weight: 700; }
.phone-availability-table-wrap { max-width: 100%; overflow: auto; background: #fff; border: 1px solid #aaa29a; border-radius: 3px; overscroll-behavior-inline: contain; }
.phone-availability-table { width: 100%; min-width: 800px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: .68rem; }
.phone-availability-table th, .phone-availability-table td { padding: 0; border-right: 1px solid #bab3ac; border-bottom: 1px solid #bab3ac; text-align: center; }
.phone-availability-table tr > *:last-child { border-right: 0; }
.phone-availability-table tbody tr:last-child > * { border-bottom: 0; }
.phone-availability-table thead th { position: sticky; z-index: 4; top: 0; height: 54px; color: #5f5750; background: #f4f0eb; }
.phone-availability-table thead th:first-child { width: 58px; z-index: 6; }
.phone-availability-table thead span, .phone-availability-table thead b, .phone-availability-table thead small { display: block; }
.phone-availability-table thead span { font-family: Georgia, serif; font-size: .78rem; }
.phone-availability-table thead b { font-size: .55rem; font-weight: 500; }
.phone-availability-table thead small { color: #9b5f56; font-size: .5rem; }
.phone-availability-table thead .is-today { background: #e8ddd2; box-shadow: inset 0 3px #766458; }
.phone-availability-table thead .is-sunday { color: #9b554e; }
.phone-availability-table thead .is-saturday { color: #506985; }
.phone-availability-table tbody th { position: sticky; z-index: 3; left: 0; width: 58px; height: 24px; color: #514a44; background: #f4f0eb; font-family: Georgia, serif; font-size: .58rem; font-weight: 500; }
.phone-availability-table tbody tr.is-hour > * { border-top: 1px solid #8e867e; }
.phone-availability-table tbody tr:first-child > * { border-top: 0; }
.phone-availability-cell { position: relative; height: 24px; }
.phone-availability-cell.is-available { background: #fff; }
.phone-availability-cell.is-unavailable { background: #dedbd7; }
.phone-availability-slot { position: relative; z-index: 1; width: 100%; height: 23px; min-height: 0; padding: 0; background: #fff; border: 0; cursor: pointer; }
.phone-availability-slot:hover, .phone-availability-slot:focus-visible { position: relative; z-index: 2; background: #eee7df; outline: 2px solid #7a685b; outline-offset: -2px; }
.phone-existing-reservation { position: absolute; z-index: 3; top: 1px; left: calc((100% / var(--reservation-count)) * var(--reservation-index) + 1px); width: calc(100% / var(--reservation-count) - 2px); height: calc(var(--reservation-slots) * 25px - 2px); min-height: 22px; padding: 4px 5px; overflow: hidden; color: #fff; background: #8d7463eF; border: 1px solid #fff8; text-align: left; box-shadow: 0 2px 7px #3329202b; pointer-events: none; }
.phone-existing-reservation strong, .phone-existing-reservation span, .phone-existing-reservation small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-existing-reservation strong { font-size: .58rem; }
.phone-existing-reservation span, .phone-existing-reservation small { font-size: .48rem; }
.phone-availability-slot.is-selected, .phone-availability-cell.is-selection-range, .phone-availability-cell.is-selection-range .phone-availability-slot { background: #746357; }
.phone-availability-cell.is-selection-range { border-color: #8b796c; }
.phone-availability-cell.is-selection-start { box-shadow: inset 2px 0 #fff, inset -2px 0 #fff, inset 0 2px #fff; }
.phone-availability-cell.is-selection-end { box-shadow: inset 2px 0 #fff, inset -2px 0 #fff, inset 0 -2px #fff; }
.phone-availability-empty { padding: 24px 14px !important; color: var(--admin-muted); background: #efedea; }
.admin-week-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px; margin-bottom: 12px; }
.admin-week-toolbar > a { min-height: 40px; padding: 9px 13px; display: inline-flex; align-items: center; color: #5d534b; background: #fbfaf8; border: 1px solid var(--admin-line); font-size: .7rem; text-decoration: none; }
.admin-week-toolbar > a:first-child { justify-self: start; }
.admin-week-toolbar > a:last-child { justify-self: end; }
.admin-week-toolbar form { display: flex; align-items: end; gap: 6px; }
.admin-week-toolbar label { margin: 0; }
.admin-week-toolbar input { min-height: 40px !important; }
.admin-week-toolbar button { min-height: 40px; padding: 8px 13px; color: #fff; background: #655b53; border: 0; cursor: pointer; }
.admin-calendar-legend { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 14px; margin-bottom: 9px; color: var(--admin-muted); font-size: .66rem; }
.admin-calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.admin-calendar-legend i { width: 15px; height: 15px; border: 1px solid #c8c1ba; }
.admin-calendar-legend .is-open { background: #fff; }
.admin-calendar-legend .is-booked { background: #746357; }
.admin-calendar-legend .is-closed { background: #dedbd7; }
.admin-week-calendar-wrap { max-width: 100%; overflow: auto; background: #fff; border: 1px solid #aaa29a; border-radius: 3px; box-shadow: 0 10px 30px #443b3409; }
.admin-week-calendar { min-width: 850px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: .7rem; }
.admin-week-calendar th, .admin-week-calendar td { padding: 0; border-right: 1px solid #bab3ac; border-bottom: 1px solid #bab3ac; text-align: center; }
.admin-week-calendar tr > *:last-child { border-right: 0; }
.admin-week-calendar tbody tr:last-child > * { border-bottom: 0; }
.admin-week-calendar thead th { position: sticky; z-index: 4; top: 0; height: 58px; color: #5f5750; background: #f4f0eb; }
.admin-week-calendar thead th:first-child { width: 58px; z-index: 6; }
.admin-week-calendar thead span, .admin-week-calendar thead b, .admin-week-calendar thead small { display: block; }
.admin-week-calendar thead span { font-family: Georgia, serif; font-size: .82rem; }
.admin-week-calendar thead b { font-size: .58rem; font-weight: 500; }
.admin-week-calendar thead small { color: #9b5f56; font-size: .53rem; }
.admin-week-calendar thead .is-today { background: #e8ddd2; box-shadow: inset 0 3px #766458; }
.admin-week-calendar thead .is-sunday { color: #9b554e; }
.admin-week-calendar thead .is-saturday { color: #506985; }
.admin-week-calendar tbody th { position: sticky; z-index: 3; left: 0; width: 58px; height: 25px; color: #514a44; background: #f4f0eb; font-family: Georgia, serif; font-size: .6rem; font-weight: 500; }
.admin-week-calendar tbody tr.is-hour > * { border-top: 1px solid #8e867e; }
.admin-week-calendar tbody tr:first-child > * { border-top: 0; }
.admin-calendar-cell { position: relative; height: 25px; vertical-align: top; }
.admin-calendar-cell.is-available { background: #fff; }
.admin-calendar-cell.is-unavailable { background: #dedbd7; }
.admin-calendar-cell.has-reservation { background: #746357; border-color: #8b796c; }
.admin-calendar-cell.has-inactive-reservation { background: #c9b8b3; }
.admin-empty-slot { position: absolute; inset: 0; display: block; }
.admin-empty-slot:hover, .admin-empty-slot:focus-visible { background: #eee7df; outline: 2px solid #7a685b; outline-offset: -2px; }
.admin-reservation-block { position: relative; z-index: 2; min-height: 50px; margin: 2px; padding: 5px 6px; display: block; overflow: visible; color: #fff; background: #65554a; border: 1px solid #ffffff48; text-align: left; text-decoration: none; box-shadow: 0 3px 10px #3329202d; }
.admin-reservation-block > a { display: block; min-width: 0; padding-right: 34px; color: inherit; text-decoration: none; }
.admin-reservation-block strong, .admin-reservation-block span, .admin-reservation-block small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-reservation-block strong { font-size: .7rem; }
.admin-reservation-block span, .admin-reservation-block small { font-size: .55rem; }
.admin-reservation-block form { position: absolute; z-index: 3; top: 3px; right: 3px; }
.admin-reservation-block form button { min-width: 0; height: 20px; padding: 1px 5px; color: #fff; background: #ffffff20; border: 1px solid #ffffff75; border-radius: 2px; font-size: .5rem; cursor: pointer; }
.admin-reservation-block form button:hover { background: #a45f58; }
.admin-reservation-block.status-cancelled { background: #9c7b75; text-decoration: line-through; }
.admin-reservation-block.status-completed { background: #687663; }
.walk-in-card { max-width: 760px; }
.walk-in-customer-choice { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 0 0 18px; padding: 0 0 18px; border: 0; border-bottom: 1px solid var(--admin-line); }
.walk-in-customer-choice legend { width: 100%; margin-bottom: 4px; font-family: var(--admin-serif); font-size: 1.15rem; }
.walk-in-customer-choice label { margin: 0; padding: 10px 14px; background: #f2eee9; border: 1px solid #d5cec7; cursor: pointer; }
.walk-in-customer-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; padding: 16px; background: #f5f1ec; border: 1px solid var(--admin-line); }
.walk-in-customer-fields[hidden], #existing-customer-fields[hidden], #walk-in-points[hidden] { display: none !important; }
.walk-in-customer-fields .is-wide { grid-column: 1 / -1; }
.walk-in-customer-fields .admin-help { margin: 8px 0 0; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: sticky; z-index: 40; height: auto; padding: 13px 16px 0; }
    .admin-brand { padding: 0 0 13px; border: 0; font-size: 1.45rem; }
    .admin-brand span { display: none; }
    .admin-sidebar nav { margin: 0 -16px; padding: 0 12px; display: flex; gap: 2px; overflow-x: auto; border-top: 1px solid #ffffff15; }
    .admin-sidebar nav a { flex: 0 0 auto; min-height: 44px; padding: 8px 12px; }
    .admin-sidebar nav a.active::before { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 2px; }
    .admin-sidebar nav i { display: none; }
    .admin-logout { position: absolute; top: 8px; right: 12px; margin: 0; padding: 0; border: 0; }
    .admin-logout button { padding: 7px 10px; font-size: .68rem; }
    .admin-topbar { height: 54px; }
    .treatment-layout { grid-template-columns: 1fr; }
    .treatment-schedule { position: static; }
    .treatment-schedule { display: flex; flex-wrap: wrap; gap: 8px; overflow-x: auto; }
    .treatment-schedule h2 { flex: 0 0 100%; }
    .treatment-schedule-help { flex: 0 0 100%; margin-bottom: 2px; }
    .treatment-reservation { flex: 0 0 220px; border: 1px solid var(--admin-line); }
    .admin-week-toolbar { grid-template-columns: 1fr 1fr; }
    .admin-week-toolbar form { grid-column: 1 / -1; grid-row: 1; }
    .admin-week-toolbar > a { grid-row: 2; }
}

@media (max-width: 560px) {
    .admin-topbar time { display: none; }
    .admin-main { padding: 24px 12px 50px; }
    .card { padding: 17px 14px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stats .card, .stat { min-height: 105px; }
    .stat strong { font-size: 1.55rem; }
    .admin-page-heading { align-items: start; }
    .treatment-heading > time { font-size: .7rem; }
    .treatment-customer-head { display: block; }
    .treatment-customer-head > a { display: inline-block; margin-top: 14px; }
    .treatment-customer-switch { align-items: stretch; flex-direction: column; }
    .treatment-customer-switch > span { width: 100%; }
    .treatment-customer-switch a { flex: 1; text-align: center; }
    .treatment-current-info { grid-template-columns: repeat(2, 1fr); }
    .treatment-photo-history-heading { align-items: start; flex-direction: column; gap: 5px; }
    .treatment-photo-history-heading > span { text-align: left; }
    .treatment-photo-strip { margin-right: -14px; }
    .treatment-photo-card { flex-basis: min(82vw, 340px); }
    .reservation-page-heading { align-items: center; }
    .reservation-actions { justify-content: flex-start; }
    .walk-in-customer-fields { grid-template-columns: 1fr; }
    .walk-in-customer-fields .is-wide { grid-column: auto; }
    .phone-customer-search-fields, .phone-customer-search-results { grid-template-columns: 1fr; gap: 5px; }
    .sales-page-heading { align-items: stretch; flex-direction: column; }
    .sales-heading-actions { align-items: stretch; flex-direction: column; }
    .sales-view-switch { align-self: stretch; }
    .sales-view-switch a { flex: 1; }
    .sales-csv-form { grid-template-columns: minmax(0, 1fr) auto; }
    .customer-history-pagination { align-items: stretch; flex-direction: column; }
    .customer-history-pagination > div { justify-content: space-between; }
    .sales-period-toolbar { grid-template-columns: 1fr 1fr; }
    .sales-period-toolbar form { grid-column: 1 / -1; grid-row: 1; grid-template-columns: minmax(0, 1fr) auto; }
    .sales-period-toolbar > a { grid-row: 2; }
    .sales-summary-grid { grid-template-columns: 1fr 1fr; }
    .sales-summary-grid article { padding: 13px 12px; }
    .sales-section-heading { padding: 16px; align-items: start; flex-direction: column; gap: 3px; }
    .medical-image-upload-actions { grid-template-columns: 1fr; }
    .admin-phone-booking-basics { grid-template-columns: 1fr; gap: 0; }
    .admin-phone-calendar { margin-right: -14px; margin-left: -14px; padding: 14px 8px; }
    .admin-phone-calendar-heading { align-items: start; flex-direction: column; gap: 5px; padding: 0 6px; }
    .phone-availability-toolbar { grid-template-columns: 1fr 1fr; gap: 7px; }
    .phone-availability-toolbar strong { grid-column: 1 / -1; grid-row: 1; }
    .phone-availability-toolbar button { grid-row: 2; }
    .phone-availability-legend { justify-content: flex-start; padding: 0 4px; }
    .phone-availability-table-wrap { overflow-x: hidden; }
    .phone-availability-table { min-width: 0; }
    .phone-availability-table thead th { height: 47px; }
    .phone-availability-table thead th:first-child, .phone-availability-table tbody th { width: 40px; }
    .phone-availability-table thead span { font-size: .62rem; letter-spacing: -.03em; }
    .phone-availability-table thead b { font-size: .48rem; }
    .phone-availability-table thead small { font-size: .42rem; line-height: 1.15; }
    .phone-availability-table tbody th { font-size: .5rem; letter-spacing: -.04em; }
    .phone-existing-reservation { padding: 3px 2px; }
    .phone-existing-reservation strong { font-size: .43rem; letter-spacing: -.04em; }
    .phone-existing-reservation span, .phone-existing-reservation small { font-size: .36rem; }
}
