:root {
  --bg: #f6efe7;
  --bg-accent: #ead9c7;
  --card: rgba(255, 252, 248, 0.82);
  --text: #2e221c;
  --muted: #725f54;
  --line: rgba(84, 54, 37, 0.12);
  --primary: #8b5e3c;
  --primary-strong: #6e472a;
  --danger: #a34141;
  --success: #29694f;
  --shadow: 0 18px 45px rgba(81, 56, 36, 0.14);
  --radius: 24px;
  --button-fill: linear-gradient(135deg, #dfbf9c 0%, #c98a5e 52%, #a86d45 100%);
  --button-fill-hover: linear-gradient(135deg, #e8cfb3 0%, #d59669 52%, #8f5b39 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, Segoe UI, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 30%),
    linear-gradient(135deg, var(--bg) 0%, #f3e2d0 45%, #efe1d5 100%);
  min-height: 100vh;
}

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

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 28px;
  padding: 28px;
  border-radius: 32px;
  background: linear-gradient(140deg, rgba(255, 249, 242, 0.9), rgba(233, 210, 189, 0.88));
  box-shadow: var(--shadow);
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.hero.compact {
  align-items: center;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  font-size: 0.8rem;
}

h1,
h2 {
  margin: 0;
}

.hero-copy {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.6;
}

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

.full-width {
  grid-column: 1 / -1;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  padding: 24px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-button {
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff9f2;
  background: var(--button-fill);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.tab-button:hover {
  transform: translateY(-2px);
  background: var(--button-fill-hover);
  box-shadow: 0 12px 24px rgba(110, 71, 42, 0.18);
}

.tab-button.active {
  background: var(--button-fill-hover);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 12px 24px rgba(110, 71, 42, 0.18);
}

.appointments-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(139, 94, 60, 0.12);
  color: var(--primary-strong);
  font-size: 0.9rem;
}

.stack {
  display: grid;
  gap: 14px;
}

.service-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.service-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  flex: 1 1 170px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.service-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.service-option span {
  color: var(--text);
  text-align: center;
}

.service-option-name {
  font-weight: 700;
}

.service-option-price {
  color: var(--primary-strong);
  font-size: 0.92rem;
}

.service-option:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 94, 60, 0.22);
  box-shadow: 0 12px 24px rgba(110, 71, 42, 0.12);
}

.service-option:has(input:checked) {
  background: linear-gradient(135deg, rgba(223, 191, 156, 0.32), rgba(201, 138, 94, 0.18));
  border-color: rgba(139, 94, 60, 0.42);
  box-shadow: 0 14px 28px rgba(139, 94, 60, 0.14);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.78);
}

button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--primary);
  color: #fff9f2;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
  background: var(--button-fill-hover);
  box-shadow: 0 12px 24px rgba(110, 71, 42, 0.18);
}

.ghost-button {
  background: var(--button-fill);
  color: #fff9f2;
  border: 0;
}

#open-auth-modal {
  background: var(--button-fill);
  color: #fff9f2;
  border: 0;
}

#open-auth-modal:hover {
  background: var(--button-fill-hover);
  box-shadow: 0 14px 30px rgba(139, 94, 60, 0.28);
}

#logout-user:hover,
#admin-link:hover {
  background: var(--button-fill-hover);
  box-shadow: 0 12px 24px rgba(110, 71, 42, 0.16);
}

.notice {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
}

.list-empty,
.mini-list {
  display: grid;
  gap: 12px;
}

.appointment-item,
.inventory-item,
.holiday-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

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

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

.icon-button {
  min-width: 46px;
  padding: 12px;
  font-size: 1rem;
}

.danger-button {
  background: rgba(163, 65, 65, 0.14);
  color: var(--danger);
  border: 1px solid rgba(163, 65, 65, 0.2);
}

.danger-button:hover {
  background: rgba(163, 65, 65, 0.22);
  color: #7e2626;
  box-shadow: 0 12px 22px rgba(163, 65, 65, 0.12);
}

.service-usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.service-usage-item {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.service-usage-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.service-admin-layout {
  display: grid;
  gap: 18px;
}

.availability-layout {
  display: grid;
  gap: 18px;
}

.service-admin-card {
  display: grid;
  gap: 16px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}

.service-admin-head {
  display: grid;
  gap: 6px;
}

.service-admin-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.service-admin-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.availability-card {
  display: grid;
  gap: 16px;
}

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

.metric-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.metric-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.metric-card strong {
  font-size: 1.6rem;
}

.status {
  font-weight: 700;
  text-transform: capitalize;
}

.status.pending {
  color: #a46713;
}

.status.confirmed {
  color: var(--success);
}

.status.cancelled {
  color: var(--danger);
}

.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.chip.active {
  background: rgba(41, 105, 79, 0.18);
  color: var(--success);
  border-color: rgba(41, 105, 79, 0.25);
}

.chip.inactive {
  background: rgba(163, 65, 65, 0.12);
  color: var(--danger);
  border-color: rgba(163, 65, 65, 0.18);
}

.hidden {
  display: none !important;
}

.inline-form {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

.auth-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 30;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 30%),
    linear-gradient(135deg, var(--bg) 0%, #f3e2d0 45%, #efe1d5 100%);
  backdrop-filter: blur(8px);
}

.auth-panel {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 32px));
}

.auth-card {
  padding: 56px 42px 36px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 28px 70px rgba(111, 79, 52, 0.22);
  display: grid;
  gap: 24px;
  text-align: center;
}

.auth-card h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-close {
  position: absolute;
  top: -22px;
  right: -6px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  padding: 0;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 52px;
  background: rgba(255, 255, 255, 0.92);
  color: #1b1410;
  border: 1px solid rgba(139, 94, 60, 0.12);
  backdrop-filter: blur(6px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.auth-close:hover {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 12px 26px rgba(46, 34, 28, 0.16);
}

.auth-form {
  display: grid;
  gap: 22px;
}

.auth-label {
  text-align: left;
  color: #746f7d;
  font-size: 0.95rem;
  gap: 10px;
}

.auth-label input {
  border: 0;
  border-bottom: 2px solid rgba(119, 117, 135, 0.16);
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
  font-size: 0.98rem;
}

.auth-primary {
  width: 100%;
  margin-top: 8px;
  background: var(--button-fill);
  color: white;
  font-weight: 700;
  letter-spacing: 0.04em;
  min-height: 56px;
  border-radius: 999px;
}

.auth-primary:hover {
  background: var(--button-fill-hover);
}

.social-block {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.social-label {
  margin: 0;
  color: #8d8798;
  font-size: 0.9rem;
}

.auth-message {
  min-height: 22px;
  margin: 0;
  color: #7b7388;
  font-size: 0.92rem;
}

.auth-helper {
  margin: -8px 0 0;
  color: #8a7b74;
  font-size: 0.9rem;
  line-height: 1.5;
}

.auth-footer {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: 10px;
  color: #8d8798;
  font-size: 0.95rem;
}

.auth-link-button {
  background: rgba(201, 138, 94, 0.12);
  color: #8f5b39;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(201, 138, 94, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.auth-link-button:hover {
  background: linear-gradient(135deg, rgba(223, 191, 156, 0.38), rgba(201, 138, 94, 0.3));
  color: #73492d;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(139, 94, 60, 0.12);
}

.success-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 40;
}

.success-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(46, 34, 28, 0.38);
  backdrop-filter: blur(6px);
}

.success-card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 32px));
  padding: 30px;
  border-radius: 24px;
  background: rgba(255, 252, 248, 0.98);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  text-align: center;
}

.success-card h3 {
  margin: 0;
  font-size: 1.8rem;
}

.success-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.success-card button {
  width: 100%;
}

.search-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(143, 91, 57, 0.12);
}

.search-icon {
  font-size: 1.15rem;
  color: #8f5b39;
  line-height: 1;
}

.search-field input {
  border: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
}

.search-field input:focus {
  outline: none;
  box-shadow: none;
}

#appointment-form button[type="submit"] {
  width: 100%;
  min-height: 56px;
  border-radius: 999px;
  background: var(--button-fill);
  color: white;
  font-weight: 700;
  letter-spacing: 0.04em;
}

#appointment-form button[type="submit"]:hover {
  background: var(--button-fill-hover);
  box-shadow: 0 14px 28px rgba(139, 94, 60, 0.2);
}

@media (max-width: 820px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
  }

  .hero-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
