:root {
  color-scheme: light;
  --ink: #2b202e;
  --muted: #685c6d;
  --plum: #643c72;
  --plum-hover: #51305e;
  --line: #e9e1eb;
  --canvas: #f7f4f7;
  --side: #211824;
  --white: #fff;
  --shadow: 0 2px 6px #37213d06, 0 10px 24px #37213d06;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box }
body, h1, h2, h3, p { margin: 0 }
button, input, select { font: inherit }
a { color: inherit; text-decoration: none }
button { cursor: pointer }
:focus-visible { outline: 2px solid #9a65ae; outline-offset: 3px }
svg { width: 20px; height: 20px; display: block; flex: none }
[data-icon] { display: inline-grid; place-items: center; flex: none }

.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh }
.sidebar {
  height: 100dvh;
  min-height: 0;
  position: sticky;
  top: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 27px 15px 15px;
  color: #e8deeb;
  background: linear-gradient(160deg, #302036 0, var(--side) 47%);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 6px 31px;
  color: white;
  font: 1.65rem/1 Georgia, serif;
  letter-spacing: -.05em;
}
.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #e8cfea;
  color: #41274b;
}
.brand-icon svg { width: 19px; height: 19px }
.workspace, .profile { display: flex; align-items: center; gap: 10px; font-size: .875rem; font-weight: 650 }
.workspace {
  padding: 10px;
  border: 1px solid #ffffff21;
  background: #ffffff0b;
  border-radius: 12px;
  margin-bottom: 20px;
}
.workspace small, .profile small { display: block; color: #c5b6ca; font-size: .75rem; font-weight: 450; margin-top: 3px }
.workspace-icon, .profile-icon {
  width: 33px;
  height: 33px;
  border-radius: 9px;
  background: #503955;
  color: #eed8f0;
}
.workspace-icon svg, .profile-icon svg { width: 16px; height: 16px }
nav { display: grid; gap: 4px }
nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 45px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 550;
  white-space: nowrap;
}
nav a svg { width: 18px; height: 18px; color: #c8b3cf }
nav a:hover { background: #ffffff13 }
nav a[aria-current] { background: #ead4ee; color: #392341 }
nav a[aria-current] svg { color: #623e70 }
.side-bottom { margin-top: auto; padding-top: 22px }
.device { display: flex; align-items: center; gap: 8px; padding: 12px 9px; color: #c5b6ca; font-size: .75rem }
.device svg { width: 14px; height: 14px }
.profile { padding: 14px 7px 4px; border-top: 1px solid #ffffff24 }

.surface { min-width: 0 }
.topbar {
  height: 61px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 2.4vw, 36px);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #fffcff;
  color: var(--muted);
  font-size: .85rem;
}
.breadcrumb, .top-date { display: flex; align-items: center; gap: 9px }
.breadcrumb svg, .top-date svg { width: 15px; height: 15px; color: var(--plum) }
.breadcrumb strong { color: var(--ink) }
.top-date { padding: 6px 10px; border-radius: 8px; background: #f5eef6 }

main { max-width: 1720px; margin: auto; padding: 24px clamp(16px, 2.4vw, 36px) 36px }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 20px; padding: 9px 0 }
h1 { font: 400 clamp(2.05rem, 3.3vw, 3.1rem)/1.07 Georgia, serif; letter-spacing: -.055em }
h2 { font-size: 1.05rem; letter-spacing: -.025em }
.subtitle { margin-top: 8px; color: var(--muted); line-height: 1.45 }
.calendar-hero {
  isolation: isolate;
  position: relative;
  min-height: 150px;
  padding: 25px clamp(20px, 3vw, 36px);
  border: 1px solid #422a47;
  border-radius: 18px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(102deg, #281b2d, #402648 68%, #603d62);
  box-shadow: var(--shadow);
}
.calendar-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, #281b2d 3%, #281b2df0 30%, #281b2d26 72%, #281b2d65),
    url("salon-editorial.webp") right 42% / cover no-repeat;
}
.calendar-hero .subtitle { color: #efe1ed }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 0 13px;
  border: 1px solid #e5dbe8;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font-size: .875rem;
  line-height: 1.2;
  font-weight: 660;
  white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: #f6eef8; border-color: #d9c6df }
.btn svg { width: 16px; height: 16px }
.btn.primary { background: var(--plum); border-color: var(--plum); color: #fff; box-shadow: 0 4px 10px #38214124 }
.btn.primary:hover { background: var(--plum-hover); border-color: var(--plum-hover) }
.calendar-hero .btn.primary { color: #34223a; background: #f1dcf0; border-color: #f1dcf0 }
.calendar-hero .btn.primary:hover { background: #fff0ff; border-color: #fff0ff }
.btn.icon { width: 38px; padding: 0 }
.btn.danger { color: #a12743 }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px }
.stat, .panel, .person-card { border: 1px solid var(--line); background: #fff; border-radius: 14px; box-shadow: var(--shadow) }
.stat { display: flex; align-items: center; gap: 12px; min-height: 86px; padding: 13px 15px }
.stat-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--accent, #643c72);
  background: var(--tint, #f3e8f4);
}
.stat-icon svg { width: 20px; height: 20px }
.stat strong { display: block; font-size: clamp(1.13rem, 1.85vw, 1.48rem); line-height: 1.2; letter-spacing: -.045em; font-variant-numeric: tabular-nums }
.stat small { display: block; color: var(--muted); font-size: .82rem; margin-top: 4px }
.panel { min-width: 0; overflow: hidden }
.panel :focus-visible { outline-offset: -2px }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 67px; padding: 12px 15px }
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap }
.toolbar h2 { margin-left: 6px }
.week-arrows { display: flex }
.week-arrows .btn:first-child { border-radius: 9px 0 0 9px }
.week-arrows .btn:last-child { border-left: 0; border-radius: 0 9px 9px 0 }
select, input {
  min-height: 41px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid #ddd0e1;
  border-radius: 9px;
  color: var(--ink);
  background: #fffcff;
}
select {
  appearance: none;
  padding-right: 30px;
  background: #fffcff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23685c6d' stroke-width='1.8'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") right 8px center no-repeat;
}
.toolbar select { min-height: 39px; font-size: .875rem }
.scroll { overflow: auto; scrollbar-color: #c8b1ce #f6f0f7 }
.calendar { --hours: 10; --hour: 62px; min-width: 760px }
.week-head, .week-body { display: grid; grid-template-columns: 61px repeat(7, minmax(0, 1fr)) }
.week-head { border-block: 1px solid var(--line); background: #faf6fa }
.day-head {
  min-height: 63px;
  padding: 7px;
  border-left: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  color: var(--muted);
  font-size: .83rem;
  font-weight: 600;
}
.day-head strong { min-width: 29px; text-align: center; line-height: 29px; border-radius: 50%; color: var(--ink); font-size: 1rem }
.day-head.current { background: #f1e4f1; color: #643c72 }
.day-head.current strong { background: var(--plum); color: white }
.week-body { height: calc(var(--hours) * var(--hour)) }
.day-column, .times {
  position: relative;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--line) calc(var(--hour) - 1px), var(--line) var(--hour));
}
.times { background-color: #fcfafc }
.timezone, .times { position: sticky; left: 0; z-index: 4 }
.timezone { display: grid; place-items: center; background: #faf6fa; color: var(--muted); font-size: .73rem; font-weight: 650 }
.day-column { border-left: 1px solid var(--line); display: flex; flex-direction: column; background-color: #fff }
.day-column.weekend { background-color: #fcf9fc }
.day-column.current { background-color: #fbf5fc }
.slot { flex: 1; background: transparent; border: 0; min-height: 0 }
.slot:hover, .slot:focus-visible { background: #eee0f1 }
.time-line { height: var(--hour); padding: 6px 9px 0 0; text-align: right; color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums }
.appointment {
  position: absolute;
  z-index: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 5px 6px;
  border: 0;
  border-left: 3px solid var(--stripe, var(--accent));
  border-radius: 7px;
  box-shadow: 0 2px 4px #30203613;
  color: var(--accent);
  background: var(--tint);
  text-align: left;
  font-size: .75rem;
  line-height: 1.17;
}
.appointment:hover, .appointment:focus-visible { z-index: 3; box-shadow: 0 0 0 2px var(--stripe), 0 4px 9px #30203629 }
.appointment strong, .appointment span { display: block; overflow: hidden; min-height: 0; flex: none; text-overflow: ellipsis; white-space: nowrap }
.appointment strong { font-size: .82rem; margin: 1px 0 2px }
.appointment span:first-child { font-size: .69rem; font-variant-numeric: tabular-nums }
.appointment.cancelled { text-decoration: line-through; opacity: .73 }
.appointment.compact { padding-block: 1px }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 18px; padding: 13px 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem }
.legend > span, .chip { display: inline-flex; gap: 7px; align-items: center }
.dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--stripe) }
.demo { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin-top: 13px; color: var(--muted); font-size: .875rem }
.demo .btn { min-height: 34px }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 14px }
.person-card { padding: 19px }
.person-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px }
.avatar { display: grid; place-items: center; width: 49px; height: 49px; border-radius: 14px; background: var(--tint); color: var(--accent); font-weight: 750; flex: none }
.person-card p { color: var(--muted); font-size: .9rem; margin: 4px 0 14px }
.person-top p { margin: 4px 0 0 }
.table { border-collapse: collapse; width: 100%; text-align: left; white-space: nowrap }
.table th, .table td { padding: 13px 15px; border-top: 1px solid var(--line); font-size: .9rem }
.table th { background: #faf6fa; color: var(--muted); font-weight: 650 }
.table tbody tr:hover { background: #fdfafe }
.table td:last-child, .table th:last-child { text-align: right }
.empty { padding: 30px 16px; color: var(--muted); text-align: center }
.pill { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 20px; background: #f4eaf5; color: #633d6e; font-size: .79rem; font-weight: 550 }
.bar-row { display: grid; grid-template-columns: minmax(65px, 1fr) 24px; align-items: center; gap: 10px; font-size: .86rem }
.track { height: 8px; background: #efe7f1; border-radius: 8px; overflow: hidden }
.track i { display: block; height: 100%; border-radius: 8px }
.help { margin-top: 12px; color: var(--muted); font-size: .875rem; line-height: 1.6 }

dialog { border: 1px solid var(--line); border-radius: 18px; width: min(515px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 22px; color: var(--ink); box-shadow: 0 24px 80px #23152866 }
dialog::backdrop { background: #2618299c; backdrop-filter: blur(3px) }
.dialog-head, .dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.dialog-head { margin-bottom: 18px }
.dialog-head h2 { font: 400 1.75rem/1.1 Georgia, serif; letter-spacing: -.045em }
.dialog-foot { margin-top: 16px }
.dialog-foot .primary { margin-left: auto }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px }
.field { display: grid; gap: 6px; min-width: 0; font-size: .875rem; font-weight: 650 }
.field.full { grid-column: 1 / -1 }
.field input, .field select { width: 100%; font-size: 1rem; font-weight: 400 }
.form-error { margin-top: 9px; color: #9e2541; font-size: .85rem }
#toast { position: fixed; bottom: 15px; right: 15px; padding: 11px 15px; border-radius: 10px; background: var(--side); color: white; z-index: 10; box-shadow: 0 4px 22px #241a3e40 }
#toast:empty { display: none }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 188px minmax(0, 1fr) }
  .stat { gap: 8px; padding-inline: 10px }
  .stat-icon { width: 36px; height: 36px }
  .stats { gap: 8px }
}

@media (max-width: 820px) {
  .layout { display: block }
  .sidebar { position: static; height: auto; padding: 11px 12px 9px }
  .brand { margin: 0 0 10px; font-size: 1.37rem }
  .brand-icon { width: 30px; height: 30px; border-radius: 9px }
  .brand-icon svg { width: 16px; height: 16px }
  .workspace, .side-bottom { display: none }
  nav { display: flex; overflow: auto; gap: 5px; padding: 3px }
  nav a { min-height: 36px; padding: 6px 9px; gap: 6px; font-size: .81rem }
  nav a svg { width: 15px; height: 15px }
  .topbar { height: 45px }
  main { padding: 17px 12px 26px }
  .page-head { padding-block: 3px; margin-bottom: 15px }
  .calendar-hero { padding: 20px 17px; min-height: 129px }
  .calendar { min-width: 700px }
}

@media (max-width: 560px) {
  .top-date { display: none }
  .page-head { flex-wrap: wrap; align-items: flex-start; gap: 12px }
  .calendar-hero::before {
    background-image: linear-gradient(90deg, #281b2d 0%, #281b2de8 53%, #281b2d79), url("salon-editorial.webp");
  }
  .subtitle { font-size: .9rem }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 15px }
  .stat { min-height: 68px }
  .toolbar { flex-wrap: wrap }
  .toolbar h2 { font-size: .93rem }
  .toolbar .btn { min-height: 35px }
  .demo { flex-wrap: wrap }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none }
}

.availability { grid-column: 1 / -1; margin: 4px 0 0; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px }
.availability legend { padding: 0 6px; font-size: .95rem; font-weight: 650 }
.check-label { display: flex; align-items: center; gap: 8px; font-size: .875rem; cursor: pointer }
.check-label input { width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: var(--plum); flex: none }
.availability .help { margin-top: 8px; font-size: .82rem }
.availability-days { margin-top: 12px }
.availability-day { display: grid; grid-template-columns: minmax(100px, 1fr) 100px 100px; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line) }
.availability-time { display: grid; gap: 3px; font-size: .75rem; color: var(--muted) }
.availability-time input { width: 100%; padding: 6px; min-height: 36px; font-size: .875rem }
.availability-time input:disabled { opacity: .45 }
.person-card .availability-summary { font-size: .85rem; line-height: 1.65 }
@media (max-width: 420px) {
  .availability { padding: 10px }
  .availability-day { grid-template-columns: 1fr 1fr; gap: 6px }
  .availability-day .check-label { grid-column: 1 / -1 }
}
