:root {
  color-scheme: dark;
  --ink: #f7efe0;
  --muted: #b7ad9d;
  --line: rgba(214, 174, 92, 0.28);
  --paper: #0f0d0b;
  --panel: rgba(31, 27, 23, 0.94);
  --field: #181512;
  --gold: #d6ae5c;
  --gold-bright: #f3d58a;
  --accent: #b51f29;
  --accent-dark: #811820;
  --navy: #1c365c;
  --green: #2f8f68;
  --amber: #d6ae5c;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(181, 31, 41, 0.24), transparent 16%, transparent 84%, rgba(28, 54, 92, 0.3)),
    radial-gradient(circle at 12% 0%, rgba(214, 174, 92, 0.16), transparent 32%),
    linear-gradient(180deg, #171310 0%, #0f0d0b 56%, #080706 100%),
    var(--paper);
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 7px;
  background: repeating-linear-gradient(
    135deg,
    #b51f29 0 18px,
    #f7efe0 18px 36px,
    #1c365c 36px 54px,
    #f7efe0 54px 72px
  );
  z-index: 10;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
  color: var(--gold-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  text-shadow: 0 2px 0 #4f3514, 0 12px 34px rgba(214, 174, 92, 0.18);
}

.page-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 560px;
  font-weight: 650;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.3rem;
}

h3 {
  margin: 28px 0 12px;
  font-size: 1rem;
}

.layout,
.admin {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 20px;
  align-items: start;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(12px);
}

.login-panel {
  max-width: 520px;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.summary-panel {
  min-height: 440px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(10, 8, 6, 0.08), rgba(10, 8, 6, 0.74)),
    linear-gradient(45deg, rgba(181, 31, 41, 0.22), rgba(28, 54, 92, 0.18)),
    url("/assets/barber-hero.jpg");
  background-size: cover;
  background-position: 42% center;
  color: white;
  border-color: rgba(214, 174, 92, 0.4);
  overflow: hidden;
  position: relative;
}

.summary-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: repeating-linear-gradient(
    135deg,
    #b51f29 0 18px,
    #f7efe0 18px 36px,
    #1c365c 36px 54px,
    #f7efe0 54px 72px
  );
}

.summary-panel > * {
  position: relative;
}

.brand-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(243, 213, 138, 0.7);
  border-radius: 50%;
  color: var(--gold-bright);
  background: rgba(12, 10, 8, 0.62);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.metric-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.metric-row span {
  padding: 7px 10px;
  border-radius: 999px;
  color: #15110e;
  background: rgba(243, 213, 138, 0.9);
  font-size: 0.82rem;
  font-weight: 750;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 230px;
  min-height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segmented button {
  min-height: 34px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  background: var(--ink);
  color: #fff;
}

.nav-link {
  display: inline-grid;
  min-height: 42px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(24, 21, 18, 0.92);
  font-weight: 850;
  text-decoration: none;
}

.nav-link:hover {
  border-color: var(--gold);
}

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

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

.admin-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tight {
  grid-template-columns: repeat(3, minmax(0, 220px));
}

label {
  display: grid;
  gap: 7px;
  color: var(--gold-bright);
  font-size: 0.84rem;
  font-weight: 800;
}

label small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--field);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(214, 174, 92, 0.16);
}

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

.section-row span,
.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.slot {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #181512;
  color: var(--ink);
  font-weight: 850;
}

.slot:hover:not(:disabled),
.slot.selected {
  border-color: var(--gold);
  background: rgba(214, 174, 92, 0.16);
  color: var(--gold-bright);
}

.slot:disabled {
  cursor: not-allowed;
  color: #a6aca8;
  background: #100e0c;
  text-decoration: line-through;
}

.primary,
.secondary {
  min-height: 46px;
  border-radius: 7px;
  padding: 0 16px;
  font-weight: 900;
}

.primary {
  color: #17110b;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.38);
}

.primary:hover {
  background: linear-gradient(180deg, #ffe6a3, #c7973c);
}

.secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(24, 21, 18, 0.92);
}

.compact {
  min-height: 38px;
}

.status {
  min-height: 22px;
  margin-bottom: 0;
  color: var(--green);
  font-weight: 800;
}

.status.error {
  color: var(--accent);
}

.confirmation {
  display: grid;
  gap: 16px;
  min-height: 360px;
  align-content: center;
  justify-items: start;
}

.success-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  font-size: 2rem;
  font-weight: 900;
}

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

.confirmation-grid span,
.notice {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #181512;
  color: var(--ink);
  font-weight: 800;
}

.notice {
  margin-bottom: 18px;
}

.notice.warning {
  border-color: rgba(154, 101, 0, 0.35);
  background: rgba(154, 101, 0, 0.1);
  color: #6f4900;
}

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

.day-row {
  display: grid;
  grid-template-columns: 120px 90px 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #181512;
}

.day-row strong {
  font-size: 0.92rem;
}

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.switch input {
  width: 18px;
  min-height: 18px;
}

.services-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.section-spaced {
  align-items: end;
  margin-top: 28px;
}

.breaks-editor,
.day-offs-editor,
.services-editor {
  display: grid;
  gap: 10px;
}

.service-row,
.break-row,
.day-off-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 120px 120px 44px;
  gap: 10px;
  align-items: end;
}

.break-row {
  grid-template-columns: 92px minmax(130px, 1fr) 140px 150px 150px 110px 110px 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #181512;
}

.break-row [hidden] {
  display: none;
}

.day-off-row {
  grid-template-columns: 170px minmax(180px, 1fr) 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #181512;
}

.day-off-notice {
  margin: 0;
  color: var(--gold-bright);
}

.icon-button {
  min-height: 44px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #181512;
  color: var(--gold-bright);
  font-size: 1.2rem;
  font-weight: 900;
}

.google-box {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #181512;
}

.google-box p {
  margin: 4px 0 0;
  color: var(--muted);
}

.google-help {
  max-width: 760px;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

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

.booking-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #181512;
}

.booking-item.cancelled {
  opacity: 0.62;
}

.booking-item h3 {
  margin: 0 0 4px;
}

.booking-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 20px, 720px);
    padding: 18px 0;
  }

  .topbar,
  .top-actions,
  .layout,
  .section-row,
  .google-box {
    display: grid;
  }

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

  .segmented {
    width: 100%;
  }

  .summary-panel {
    min-height: 300px;
  }

  .field-grid,
  .admin-grid,
  .tight,
  .confirmation-grid,
  .day-row,
  .break-row,
  .day-off-row,
  .service-row,
  .booking-item {
    grid-template-columns: 1fr;
  }
}
