:root {
  --ink: #101114;
  --paper: #f5f2ec;
  --panel: #fffdf8;
  --panel-soft: #faf7f0;
  --muted: #62676f;
  --line: rgba(16, 17, 20, 0.12);
  --coral: #ff6b4a;
  --teal: #0f766e;
  --blue: #2d5f73;
  --amber: #d89d28;
  --danger: #b42318;
  --shadow: 0 22px 56px rgba(16, 17, 20, 0.12);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 26px 18px;
  background: #151619;
  color: #fffdf8;
}

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
}

.brand span span {
  color: var(--coral);
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 7px;
  color: rgba(255, 253, 248, 0.72);
  font-weight: 800;
}

.side-nav a.active,
.side-nav a:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fffdf8;
}

.sidebar-card {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-card span {
  display: block;
  color: rgba(255, 253, 248, 0.62);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sidebar-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.08rem;
}

.sidebar-card p {
  margin: 10px 0 0;
  color: rgba(255, 253, 248, 0.72);
  line-height: 1.45;
}

.workspace {
  min-width: 0;
  padding: 26px clamp(18px, 3vw, 36px) 44px;
}

.topbar,
.card-header,
.schedule-toolbar,
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.97;
  max-width: 760px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.05;
}

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

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 900;
  white-space: nowrap;
}

.primary-button {
  background: var(--coral);
  color: #170704;
}

.secondary-button {
  background: var(--ink);
  color: #fffdf8;
}

.ghost-button {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.full {
  width: 100%;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.status-grid article,
.panel-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(16, 17, 20, 0.04);
}

.status-grid article {
  min-height: 128px;
  padding: 18px;
}

.status-grid span,
.status-grid small,
.chart-head span,
.form-note {
  color: var(--muted);
  font-weight: 800;
}

.status-grid span,
.chart-head span {
  font-size: 0.83rem;
}

.status-grid strong {
  display: block;
  margin: 12px 0 4px;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.panel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 18px;
  align-items: start;
}

.main-column,
.right-column {
  display: grid;
  gap: 18px;
}

.right-column {
  position: sticky;
  top: 18px;
}

.panel-card {
  padding: 18px;
}

.card-header {
  margin-bottom: 16px;
}

.card-header.compact {
  align-items: start;
  margin-bottom: 14px;
}

.segmented {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  overflow-x: auto;
}

.segmented button {
  min-width: 62px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

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

.schedule-toolbar {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

input,
select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.14);
}

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

.slot-row {
  display: grid;
  grid-template-columns: 72px repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.slot-time {
  min-height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.slot-cell {
  position: relative;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  touch-action: manipulation;
}

.slot-cell:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 107, 74, 0.5);
  box-shadow: 0 10px 26px rgba(16, 17, 20, 0.1);
}

.slot-cell.selected {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.16);
}

.slot-cell.selected {
  padding-bottom: 16px;
}

.slot-cell.booked {
  background: #eaf5f1;
  border-color: rgba(15, 118, 110, 0.28);
}

.slot-cell.blocked {
  background: #f4eee6;
  color: rgba(16, 17, 20, 0.48);
}

.slot-cell.promo {
  background: #fff7dc;
  border-color: rgba(216, 157, 40, 0.45);
}

.slot-cell strong,
.slot-cell span {
  display: block;
}

.slot-cell strong {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.slot-cell span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.slot-cell em {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(16, 17, 20, 0.08);
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
}

.slot-resize-handle {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -5px;
  height: 12px;
  border-radius: 999px;
  background: var(--coral);
  cursor: ns-resize;
  opacity: 0.95;
  box-shadow: 0 5px 14px rgba(16, 17, 20, 0.18);
  touch-action: none;
}

.slot-resize-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 3px;
  border-radius: 999px;
  background: rgba(23, 7, 4, 0.55);
  transform: translate(-50%, -50%);
}

.is-dragging-time,
.is-dragging-time * {
  cursor: ns-resize !important;
  user-select: none;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 12px;
}

.chart-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.bar-chart,
.service-list,
.client-list {
  display: grid;
  gap: 10px;
}

.bar-item {
  display: grid;
  gap: 7px;
}

.bar-meta,
.service-item,
.client-item,
.recommendation-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bar-meta,
.service-item,
.client-item {
  font-size: 0.88rem;
  font-weight: 900;
}

.bar-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(16, 17, 20, 0.08);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.service-item,
.client-item {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.service-item span,
.client-item span {
  color: var(--muted);
  font-size: 0.78rem;
}

.form-card form {
  display: grid;
  gap: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-note {
  min-height: 1.35em;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.form-note[data-state="success"] {
  color: var(--teal);
}

.form-note[data-state="error"] {
  color: var(--danger);
}

.recommendations > div {
  display: grid;
  gap: 10px;
}

.recommendation-card {
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.recommendation-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.96rem;
}

.recommendation-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.4;
}

.recommendation-card button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: #fffdf8;
  font-size: 0.78rem;
  font-weight: 900;
}

.message-flow {
  display: grid;
  gap: 8px;
}

.message-flow p {
  margin: 0;
  padding: 11px;
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.42;
}

.message-flow strong {
  color: var(--ink);
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 17, 20, 0.72);
  backdrop-filter: blur(12px);
}

.login-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(16, 17, 20, 0.26);
}

.login-panel h2 {
  margin: 3px 0 0;
  font-size: 1.35rem;
}

.login-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.login-panel input {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

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

  .sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    padding: 16px 18px;
  }

  .side-nav {
    display: flex;
    justify-content: flex-end;
    overflow-x: auto;
  }

  .sidebar-card {
    display: none;
  }

  .right-column {
    position: static;
  }
}

@media (max-width: 980px) {
  .topbar,
  .card-header,
  .schedule-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .status-grid,
  .panel-layout,
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding-inline: 14px;
  }

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

  .side-nav {
    justify-content: flex-start;
  }

  .topbar-actions {
    display: grid;
  }

  .ghost-button,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

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

  .slot-row {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .slot-row .slot-cell[data-staff="alex"] {
    grid-column: 2;
  }

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