:root {
  --ink: #272323;
  --muted: #716a65;
  --line: #e7ddd5;
  --paper: #fffaf6;
  --surface: #ffffff;
  --rose: #c76c86;
  --rose-dark: #9f3f60;
  --sage: #738b78;
  --mint: #dce8dd;
  --gold: #b58a54;
  --shadow: 0 20px 60px rgba(62, 47, 39, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(110deg, rgba(220, 232, 221, 0.7), transparent 38%),
    linear-gradient(180deg, #fffaf6 0%, #f4ece4 100%);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1.25fr) minmax(240px, 0.65fr);
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
}

body:not(.is-admin) .workspace {
  grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.15fr);
  max-width: 1120px;
}

body:not(.is-admin) .admin-only {
  display: none;
}

.is-hidden {
  display: none !important;
}

.brand-panel,
.booking-panel,
.activity-panel {
  min-width: 0;
}

.brand-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 48px);
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 0;
}

.mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  border: 1px solid rgba(181, 138, 84, 0.35);
  border-radius: 8px;
  object-fit: cover;
  background: #fff5e8;
  box-shadow: 0 10px 24px rgba(181, 138, 84, 0.18);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--sage);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.45rem;
}

h3 {
  font-size: 1.08rem;
}

.hero-image {
  flex: 1;
  min-height: 320px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(39, 35, 35, 0.02), rgba(39, 35, 35, 0.12)),
    url("assets/nail-hero.png") center / cover;
  box-shadow: var(--shadow);
}

.info-gallery {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.info-frame {
  display: grid;
  place-items: center;
  min-height: 180px;
  max-height: 280px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
}

.info-frame img {
  width: 100%;
  height: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
}

.info-image-button {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.info-frame p {
  margin: 0;
  padding: 16px;
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.45;
}

.gallery-controls,
.gallery-admin-actions,
.title-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery-controls {
  justify-content: flex-end;
}

.language-toggle {
  min-height: 42px;
  border: 1px solid rgba(181, 138, 84, 0.45);
  border-radius: 8px;
  background: #fff7ec;
  color: var(--rose-dark);
  cursor: pointer;
  font-weight: 900;
}

.studio-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.92rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4f9d67;
  box-shadow: 0 0 0 5px rgba(79, 157, 103, 0.16);
}

.contact-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  line-height: 1.45;
}

.contact-card strong {
  color: var(--ink);
  font-size: 1rem;
}

.contact-card p {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.contact-card a {
  color: var(--rose-dark);
  font-weight: 900;
  text-decoration: none;
}

.contact-card a.is-disabled {
  color: var(--muted);
  pointer-events: none;
}

.admin-gate {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.admin-login {
  display: grid;
  gap: 10px;
}

.admin-login p {
  margin: 0;
  color: #9a342e;
  font-size: 0.84rem;
  font-weight: 800;
}

.booking-panel,
.activity-panel {
  align-self: start;
  border: 1px solid rgba(231, 221, 213, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.booking-panel {
  padding: 22px;
}

.panel-header,
.activity-header,
.section-title,
.summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icon-button,
.text-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.icon-button {
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
}

.text-button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--rose-dark);
  font-size: 0.88rem;
  font-weight: 700;
}

.booking-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.section-block {
  display: grid;
  gap: 12px;
}

.section-block.compact {
  gap: 10px;
}

.section-title span {
  font-weight: 800;
}

.section-title strong {
  color: var(--muted);
  font-size: 0.85rem;
}

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

.service-grid.is-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-card {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.service-card:hover {
  transform: translateY(-2px);
}

.service-card.is-selected {
  border-color: var(--rose);
  box-shadow: inset 0 0 0 1px var(--rose), 0 12px 30px rgba(199, 108, 134, 0.16);
}

.service-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

.service-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.service-grid.is-compact .service-card {
  min-height: 82px;
  padding: 11px;
}

.service-grid.is-compact .service-card p {
  display: none;
}

.service-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--rose-dark);
  font-size: 0.85rem;
  font-weight: 800;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 88px;
  padding: 12px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(199, 108, 134, 0.16);
}

.field small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.reference-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.reference-preview img,
.booking-reference {
  width: 86px;
  height: 86px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--paper);
}

.booking-reference {
  width: 100%;
  height: auto;
  max-height: 220px;
}

.booking-reference.small {
  width: 74px;
  height: 74px;
  margin-top: 8px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.time-slot {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.time-slot strong {
  font-size: 0.98rem;
}

.time-slot span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.time-slot.is-available {
  border-color: rgba(115, 139, 120, 0.45);
  background: #f5fbf5;
}

.time-slot.is-selected {
  border-color: var(--sage);
  box-shadow: inset 0 0 0 1px var(--sage);
}

.time-slot.is-booked {
  border-color: rgba(154, 52, 46, 0.25);
  background: #f8eceb;
  color: #8e625f;
  cursor: not-allowed;
}

.time-slot.is-booked span {
  color: #9a342e;
}

.shape-chip {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.shape-chip.is-selected {
  border-color: var(--sage);
  background: var(--mint);
  color: var(--ink);
  font-weight: 800;
}

.summary {
  padding: 14px;
  border-radius: 8px;
  background: #f6f0e9;
}

.summary div {
  min-width: 0;
}

.summary p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.summary strong {
  font-size: 1.05rem;
}

.primary-button {
  height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--rose-dark);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

.primary-button:hover {
  background: #87334f;
}

.compact-toggle {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 900;
}

.activity-panel {
  padding: 18px;
  display: grid;
  gap: 20px;
}

.booking-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.empty-state {
  min-height: 140px;
  display: grid;
  place-items: center;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
}

.booking-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.booking-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.booking-card span {
  color: var(--rose-dark);
  font-weight: 900;
  white-space: nowrap;
}

.booking-card.is-completed {
  border-color: rgba(79, 142, 184, 0.32);
  background: #eef8ff;
}

.schedule-block,
.records-block,
.settings-block,
.service-editor,
.brand-editor,
.business-editor,
.gallery-editor,
.option-editor {
  display: grid;
  gap: 12px;
}

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

.gallery-thumb-list img {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--paper);
}

.admin-collapsible.is-collapsed {
  gap: 0;
}

.admin-collapsible.is-collapsed > :not(.collapsible-header) {
  display: none !important;
}

.collapsible-header {
  margin: 0;
}

.collapse-toggle {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(39, 35, 35, 0.36);
}

.modal-card {
  display: grid;
  gap: 16px;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.booking-confirm-details {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.booking-confirm-details p,
.success-message p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.booking-confirm-details strong {
  color: var(--ink);
}

.modal-actions {
  justify-content: flex-end;
}

.modal-actions .primary-button,
.modal-card > .primary-button {
  min-width: 140px;
  padding: 0 18px;
}

.image-modal-card {
  width: min(860px, 100%);
}

.image-modal-card img {
  width: 100%;
  max-height: calc(100vh - 140px);
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: var(--paper);
}

.schedule-block {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.schedule-summary {
  padding: 11px 12px;
  border: 1px solid rgba(115, 139, 120, 0.35);
  border-radius: 8px;
  background: #f5fbf5;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

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

.day-pill {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.day-pill strong {
  font-size: 0.88rem;
}

.day-pill span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.day-pill.is-selected {
  border-color: var(--gold);
  background: #fff7ec;
  box-shadow: inset 0 0 0 1px rgba(181, 138, 84, 0.35);
}

.day-pill.is-closed {
  border-color: #d7d0ca;
  background: #f3f0ed;
}

.schedule-list {
  display: grid;
  gap: 8px;
}

.schedule-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.schedule-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.schedule-row-top strong {
  font-size: 1rem;
}

.schedule-badge {
  min-width: 64px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
  text-align: center;
}

.schedule-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.schedule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schedule-row.is-free {
  border-color: rgba(79, 157, 103, 0.28);
  background: #f7fcf7;
}

.schedule-row.is-free .schedule-badge {
  background: #dce8dd;
  color: #2f6f46;
}

.schedule-row.is-booked {
  border-color: rgba(154, 52, 46, 0.26);
  background: #fff4f3;
}

.schedule-row.is-booked .schedule-badge {
  background: #f1d7d4;
  color: #9a342e;
}

.schedule-row.is-completed {
  border-color: rgba(79, 142, 184, 0.32);
  background: #eef8ff;
}

.schedule-row.is-completed .schedule-badge {
  background: #cfe9fb;
  color: #2c6487;
}

.schedule-row.is-closed,
.closed-notice {
  padding: 14px;
  border: 1px solid #d7d0ca;
  border-radius: 8px;
  background: #f3f0ed;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.text-button.success {
  color: #2f6f46;
}

.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.settings-block {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.service-editor,
.brand-editor,
.business-editor,
.built-in-editor,
.notification-editor,
.password-editor,
.sync-editor {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 246, 0.72);
}

.sync-editor {
  display: grid;
  gap: 12px;
}

.password-editor {
  display: grid;
  gap: 12px;
}

.built-in-editor {
  display: grid;
  gap: 12px;
}

.notification-editor {
  display: grid;
  gap: 12px;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.eye-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--rose-dark);
  cursor: pointer;
  font-size: 1rem;
}

#syncStatus {
  color: var(--sage);
}

#syncStatus.is-error,
#passwordStatus.is-error {
  color: #9a342e;
}

.sync-detail {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.check-field input {
  width: auto;
  height: auto;
}

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

.date-range-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.date-range-grid input[type="date"] {
  min-width: 0;
  padding-right: 8px;
  font-size: 0.95rem;
}

.secondary-button {
  min-height: 44px;
  border: 1px solid var(--rose);
  border-radius: 8px;
  background: #fff7f9;
  color: var(--rose-dark);
  cursor: pointer;
  font-weight: 900;
}

.settings-list {
  display: grid;
  gap: 8px;
}

.settings-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.settings-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.text-button.danger {
  color: #9a342e;
}

.inline-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

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

.schedule-choice-grid {
  grid-template-columns: 1fr;
}

.closed-days label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.closed-days input {
  width: auto;
  height: auto;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editable-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  max-width: 100%;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.editable-tag span {
  overflow-wrap: anywhere;
}

.editable-tag button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #f1e6df;
  color: var(--rose-dark);
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 0.75fr 1.25fr;
  }

  .activity-panel {
    grid-column: 1 / -1;
  }

  .brand-panel {
    min-height: auto;
  }

  .hero-image {
    min-height: 360px;
  }
}

@media (max-width: 780px) {
  .app-shell {
    padding: 14px;
  }

  .workspace,
  .form-grid,
  .service-grid,
  .service-grid.is-compact,
  .time-slot-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .brand-top {
    align-items: flex-start;
  }

  .hero-image {
    min-height: 250px;
  }

  .summary {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal-actions,
  .gallery-admin-actions {
    display: grid;
  }
}
