:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #62706a;
  --line: #d9e0dc;
  --paper: #f4f1ea;
  --panel: #ffffff;
  --soft: #f8faf8;
  --accent: #0c7a6f;
  --accent-dark: #07564f;
  --gold: #c28735;
  --warn: #b45309;
  --bad: #b42318;
  --good: #047857;
  --shadow: 0 18px 44px rgba(23, 33, 31, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(12, 122, 111, 0.12), rgba(244, 241, 234, 0) 340px),
    var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 20px 18px;
}

.brand-block {
  display: grid;
  gap: 8px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.25rem, 6.5vw, 4.8rem);
  line-height: 0.92;
  letter-spacing: 0;
  max-width: 12ch;
}

h2 {
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.intro-copy {
  color: #42504b;
  font-size: 1.02rem;
  max-width: 36rem;
}

.eyebrow,
.section-kicker {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: uppercase;
}

main {
  display: grid;
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 44px;
  min-width: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.booking-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.82fr) minmax(320px, 1.18fr);
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.booking-copy {
  display: grid;
  align-content: start;
  gap: 12px;
  background: #12312d;
  color: #fff;
  padding: 30px;
}

.booking-copy p {
  color: rgba(255, 255, 255, 0.78);
  max-width: 34rem;
}

.booking-copy .section-kicker {
  color: #f2c078;
  margin-bottom: 0;
}

.flow-steps {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.flow-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
}

.flow-steps span {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #f2c078;
  color: var(--ink);
  font-size: 0.84rem;
}

.booking-form,
.login-form,
.settings-grid {
  display: grid;
  gap: 16px;
}

.booking-form {
  padding: 30px;
}

label,
.label-text {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

label em {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 10px 12px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(12, 122, 111, 0.2);
  outline-offset: 2px;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 7px;
}

.slot {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.slot:hover:not([disabled]) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.slot[disabled] {
  background: #eef1ee;
  color: #87928d;
  cursor: not-allowed;
  text-decoration: line-through;
}

.slot.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(12, 122, 111, 0.2);
}

.primary-button,
.ghost-button,
.tab {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  box-shadow: 0 10px 20px rgba(12, 122, 111, 0.18);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(12, 122, 111, 0.16);
  color: var(--ink);
  padding: 10px 14px;
}

.ghost-button:hover {
  background: #fff;
  border-color: rgba(12, 122, 111, 0.32);
}

.message {
  min-height: 24px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.message.error {
  color: var(--bad);
}

.message.success {
  color: var(--good);
}

.admin-panel,
.public-schedule-panel {
  padding: 24px;
}

.public-schedule-panel {
  background: rgba(255, 255, 255, 0.92);
}

.section-heading,
.filters,
.record-header,
.record-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.section-heading {
  margin-bottom: 16px;
}

.login-form {
  max-width: 420px;
  margin-top: 18px;
}

.admin-workspace {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.overview-card {
  display: grid;
  gap: 8px;
  min-height: 104px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 16px;
}

.overview-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.overview-card strong {
  color: var(--ink);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  line-height: 1.1;
}

.admin-subsection {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.closure-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(160px, 0.9fr) minmax(180px, 1.2fr) auto;
  gap: 10px;
  align-items: end;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
}

.tab {
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  white-space: nowrap;
}

.tab.active {
  background: #e2f0ed;
  color: var(--accent-dark);
}

.filters {
  justify-content: flex-start;
  margin-bottom: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.filters label {
  min-width: 180px;
}

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

.schedule-summary {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 900;
}

.schedule-grid {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.schedule-table {
  display: grid;
  grid-template-columns: 96px repeat(var(--barber-columns), minmax(168px, 1fr));
  min-width: max(640px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.schedule-cell {
  min-height: 52px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.schedule-heading {
  min-height: 44px;
  background: #eaf3ef;
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.schedule-time {
  background: #f8f6f0;
  color: var(--muted);
  font-weight: 900;
}

.schedule-open {
  background: #f3fbf7;
  color: var(--good);
  font-weight: 800;
}

.schedule-closed {
  background: #f3f5f2;
  color: #7c8782;
  font-weight: 800;
}

.schedule-booked {
  display: grid;
  gap: 5px;
  align-content: start;
  border-left: 4px solid var(--accent);
  background: #f0faf7;
}

.schedule-booked.pending {
  border-left-color: var(--warn);
  background: #fff9ec;
  color: var(--warn);
  font-weight: 900;
}

.schedule-booked.booked,
.schedule-booked.approved {
  border-left-color: var(--accent);
  background: #f0faf7;
  color: var(--accent-dark);
  font-weight: 900;
}

.public-schedule-table .schedule-booked {
  align-content: center;
  font-weight: 900;
}

.schedule-booked strong {
  color: var(--ink);
}

.schedule-booked span:not(.status) {
  color: var(--muted);
  font-size: 0.88rem;
}

.record {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(23, 33, 31, 0.04);
}

.record-title {
  font-weight: 900;
}

.record-meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 4px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 3px 10px;
  background: #edf1ed;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status.pending {
  background: #fff4df;
  color: var(--warn);
}

.status.approved {
  background: #ddf5ec;
  color: var(--good);
}

.status.declined {
  background: #fde8e5;
  color: var(--bad);
}

.record-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.record-actions button,
.small-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  padding: 6px 10px;
}

.record-actions button:hover,
.small-button:hover {
  background: var(--soft);
}

.record-actions .danger-button {
  border-color: #f3c1bb;
  color: var(--bad);
}

.record-actions .danger-button:hover {
  background: #fde8e5;
}

.working-days,
.weekly-hours {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.working-days {
  grid-template-columns: repeat(auto-fit, minmax(74px, auto));
  justify-content: start;
}

.working-days .label-text {
  grid-column: 1 / -1;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 900;
  padding: 6px 10px;
}

.check-pill input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.weekly-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(130px, 1fr) minmax(130px, 1fr);
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

.settings-grid {
  max-width: 720px;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    max-width: 100%;
  }

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

  .booking-copy,
  .booking-form {
    padding: 20px;
  }

  .admin-panel,
  .public-schedule-panel {
    padding: 18px;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .closure-form {
    grid-template-columns: 1fr;
  }

  .weekly-row {
    grid-template-columns: 1fr;
  }
}
