:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #e1e7ef;
  --line-strong: #c6d0dc;
  --text: #101827;
  --muted: #647184;
  --muted-2: #a1adbb;
  --nav: #102535;
  --nav-2: #17344a;
  --accent: #2f80d8;
  --accent-dark: #2269b4;
  --green: #36b36a;
  --danger: #e25644;
  --warning: #d99922;
  --radius: 6px;
  --shadow: 0 14px 30px -24px rgba(16, 37, 53, 0.38);
  --font-ui: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-size-xxs: 10px;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-md: 13px;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-title: 20px;
  --line-tight: 1.15;
  --line-compact: 1.25;
  --line-normal: 1.4;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  font-family: var(--font-ui);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
}

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

button {
  cursor: pointer;
}

.boot-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: var(--nav);
}

.boot-mark {
  color: #fff;
  font-size: 24px;
  font-weight: var(--weight-bold);
  letter-spacing: 0;
}

.boot-line {
  position: fixed;
  inset: auto 40vw 42vh;
  height: 2px;
  background: linear-gradient(90deg, transparent, #5aa7e8, transparent);
  animation: loadingLine 1.2s ease-in-out infinite;
}

@keyframes loadingLine {
  0% { transform: scaleX(0.2); opacity: 0.45; }
  50% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(0.2); opacity: 0.45; }
}

.shell {
  isolation: isolate;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 216px minmax(720px, 1fr) 284px;
  grid-template-rows: 56px minmax(0, 1fr);
}

.system-admin-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  color: var(--text);
  background: var(--bg);
}

.system-admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 22px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.system-admin-brand {
  display: grid;
  gap: 6px;
}

.system-admin-brand strong {
  font-size: var(--font-size-title);
  font-weight: var(--weight-bold);
}

.system-admin-brand span,
.system-admin-header p,
.system-org-row span {
  color: var(--muted);
}

.system-admin-workspace {
  min-width: 0;
  padding: 28px;
  overflow-x: hidden;
}

.system-admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.system-admin-header h1,
.system-admin-card h2 {
  margin: 0;
}

.system-admin-header p {
  margin: 6px 0 0;
}

.system-admin-header > strong {
  min-width: 52px;
  padding: 10px 14px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.system-admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.system-admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.system-org-form {
  display: grid;
  gap: 13px;
  padding: 18px;
}

.system-org-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--font-size-sm);
  font-weight: var(--weight-semibold);
}

.system-org-form input,
.system-org-form select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.system-check-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.system-org-list {
  min-width: 0;
  padding: 18px;
}

.system-org-table {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.system-org-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.3fr) 72px repeat(3, minmax(54px, 0.32fr)) minmax(92px, 0.62fr) minmax(78px, auto);
  gap: 7px;
  align-items: center;
  min-height: 68px;
  min-width: 0;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.system-org-row.is-archived {
  opacity: 0.7;
}

.system-org-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.system-org-main strong,
.system-org-main span,
.system-org-row b,
.system-org-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-org-actions {
  justify-content: end;
}

.system-org-actions .btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: var(--font-size-sm);
}

@media (max-width: 1360px) {
  .system-admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}

.brand-title {
  font-size: 19px;
  font-weight: var(--weight-bold);
}

.brand-subtitle {
  max-width: 560px;
  overflow: hidden;
  color: #d8e3ee;
  font-size: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  font-weight: var(--weight-bold);
  background: var(--green);
  border-radius: 50%;
}

.sidebar {
  padding: 10px 0;
  color: #93a3b4;
  background: var(--nav);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.nav-item.is-active {
  color: #fff;
  background: var(--nav-2);
}

.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: currentColor;
  opacity: 0.75;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.is-active .nav-icon {
  opacity: 1;
}

.sidebar-subnav {
  display: grid;
  gap: 2px;
  padding: 3px 12px 8px 56px;
}

.sidebar-subnav button {
  width: 100%;
  padding: 7px 9px;
  color: #aebdcc;
  font-size: 13px;
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
}

.sidebar-subnav button.is-active {
  color: #fff;
  border-left-color: var(--accent);
}

.sidebar-subnav button:disabled {
  cursor: default;
  opacity: 0.48;
}

.workspace {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #fff;
}

.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 7px 18px;
  background: #fbf9f8;
  border-bottom: 1px solid var(--line);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: #eaf0f6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.segmented button {
  min-width: 34px;
  padding: 6px 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.segmented button.is-active {
  color: var(--text);
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 37, 53, 0.12);
}

.select,
.input,
.textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--text);
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.textarea {
  min-height: 92px;
  resize: vertical;
}

.select:focus,
.input:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 128, 216, 0.14);
}

.time-select {
  font-family: var(--font-ui);
  font-size: 15px;
}

.date-control {
  display: grid;
  grid-template-columns: 32px 150px 32px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.date-control button,
.date-control input {
  min-height: 34px;
  background: #fff;
  border: 0;
}

.date-control input {
  text-align: center;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.primary-outline {
  color: var(--accent-dark) !important;
  background: #fff !important;
  border-color: var(--accent) !important;
}

.link-button {
  padding: 0;
  color: var(--accent-dark);
  font: inherit;
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.link-button.danger {
  color: #ff5b1f;
}

.icon-plus {
  position: relative;
  width: 16px;
  height: 16px;
}

.icon-plus::before,
.icon-plus::after {
  position: absolute;
  content: "";
  background: currentColor;
  border-radius: 2px;
}

.icon-plus::before {
  inset: 7px 1px;
}

.icon-plus::after {
  inset: 1px 7px;
}

.journal {
  display: grid;
  grid-template-columns: 90px repeat(var(--master-count), minmax(210px, 1fr));
  min-height: calc(100dvh - 124px);
  overflow: auto;
}

.journal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: contents;
}

.time-head,
.master-head {
  min-height: 60px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.time-head {
  position: sticky;
  left: 0;
  z-index: 3;
  color: var(--muted);
  border-right: 1px solid var(--line);
}

.master-head {
  display: flex;
  align-items: center;
  gap: 12px;
  border-right: 1px solid var(--line);
}

.master-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: var(--weight-bold);
  background: #6bc9c2;
  border-radius: 50%;
}

.master-name {
  font-weight: var(--weight-semibold);
}

.master-hours {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.time-col {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  border-right: 1px solid var(--line);
}

.time-slot {
  height: 72px;
  padding: 10px 12px;
  color: #7f8d9e;
  font-weight: var(--weight-semibold);
  text-align: right;
  border-bottom: 1px solid #e8edf3;
}

.master-column {
  position: relative;
  min-width: 210px;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 17px,
      rgba(216, 224, 234, 0.58) 18px
    ),
    repeating-linear-gradient(
      to bottom,
      #fff 0,
      #fff 71px,
      #e8edf3 72px
    );
  border-right: 1px solid var(--line);
}

.slot-button {
  position: absolute;
  left: 0;
  width: 100%;
  height: 29.5px;
  background: transparent;
  border: 0;
  color: var(--accent-dark);
}

.slot-button::after {
  position: absolute;
  inset: 3px 8px;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 12px;
  font-weight: var(--weight-bold);
  line-height: 1;
  content: attr(data-new-time);
  border-radius: 8px;
  pointer-events: none;
}

.slot-button:hover,
.slot-button:focus-visible {
  z-index: 3;
  background: rgba(24, 184, 166, 0.08);
  outline: 1px solid rgba(24, 184, 166, 0.22);
  outline-offset: -1px;
}

.slot-button:hover::after,
.slot-button:focus-visible::after {
  color: var(--accent-dark);
  background: rgba(230, 248, 246, 0.92);
}

.appointment-card {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 8px 12px;
  overflow: hidden;
  color: rgba(23, 32, 42, 0.72);
  font: inherit;
  text-align: left;
  background: var(--event-color);
  border: 1px solid rgba(47, 128, 216, 0.35);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
  cursor: pointer;
}

.appointment-card:hover,
.appointment-card:focus-visible {
  border-color: rgba(47, 128, 216, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  outline: 2px solid rgba(47, 128, 216, 0.16);
  outline-offset: 0;
}

.appointment-card.is-blocked {
  color: #475569;
  background: repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.24) 0,
      rgba(255, 255, 255, 0.24) 8px,
      transparent 8px,
      transparent 16px
    ),
    var(--event-color);
}

.appointment-time {
  font-size: 12px;
  font-weight: var(--weight-semibold);
}

.appointment-client {
  margin-top: 3px;
  font-weight: var(--weight-bold);
}

.appointment-meta {
  margin-top: 4px;
  color: rgba(23, 32, 42, 0.58);
  font-size: 13px;
  line-height: 1.35;
}

.slot-action-popover {
  position: absolute;
  left: 50%;
  z-index: 6;
  display: grid;
  width: min(240px, calc(100% - 24px));
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 18px 36px rgba(15, 35, 55, 0.22);
  transform: translateX(-50%);
}

.slot-action-popover::before {
  position: absolute;
  top: -8px;
  left: calc(50% - 8px);
  width: 14px;
  height: 14px;
  content: "";
  background: #fff;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  transform: rotate(45deg);
}

.slot-action-time {
  text-align: center;
  color: var(--muted);
  font-size: 18px;
  font-weight: var(--weight-bold);
}

.slot-action-popover .btn {
  width: 100%;
}

.right-panel {
  min-width: 0;
  overflow: auto;
  background: #f8fafc;
}

.panel-section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: var(--weight-bold);
}

.client-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 14px;
}

.clients-workspace {
  padding: 0;
  overflow: hidden;
}

.client-base-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 8px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.client-base-search {
  display: grid;
  grid-template-columns: 18px minmax(220px, 420px);
  align-items: center;
  gap: 10px;
  width: min(480px, 48vw);
  min-height: 38px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.client-base-search svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
}

.client-base-search input {
  width: 100%;
  min-height: 36px;
  color: var(--text);
  font-size: 12.5px;
  background: transparent;
  border: 0;
  outline: 0;
}

.settings-page {
  padding: 0;
  background: #fff;
}

.settings-service-filters {
  display: grid;
  grid-template-columns: 180px 180px 180px minmax(220px, 1fr) auto;
  gap: 10px;
  padding: 12px 18px;
  background: #fbf9f8;
  border-bottom: 1px solid var(--line);
}

.employees-filters {
  grid-template-columns: minmax(190px, 260px) minmax(260px, 1fr) auto auto;
  align-items: center;
}

.settings-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}

.settings-search {
  width: 100%;
  min-width: 0;
}

.settings-table {
  width: 100%;
  background: #fff;
}

.settings-table-head,
.settings-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}

.employees-table .settings-table-head,
.employees-table .settings-row {
  grid-template-columns: minmax(230px, 1.45fr) minmax(130px, 0.85fr) 90px minmax(190px, 1fr) 86px;
}

.services-table .settings-table-head,
.services-table .settings-row {
  grid-template-columns: minmax(230px, 1.55fr) minmax(130px, 0.85fr) 92px 120px 120px 86px;
}

.settings-table-head {
  min-height: 40px;
  color: #8a95a3;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #f3f6f9;
  border-bottom: 1px solid var(--line);
}

.settings-row {
  width: 100%;
  min-height: 64px;
  color: var(--text);
  font-weight: var(--weight-regular);
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.settings-row:hover {
  background: #f4f9ff;
}

.settings-row > span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.settings-person {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.settings-person strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.settings-service-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: var(--weight-semibold);
}

.settings-service-name i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.settings-status {
  display: inline-flex;
  padding: 2px 7px;
  color: #7a8795;
  font-size: 11px;
  font-style: normal;
  font-weight: var(--weight-semibold);
  background: #eef1f4;
  border-radius: 999px;
}

.settings-status.is-active {
  color: var(--accent-dark);
  background: #eef6ff;
}

.settings-placeholder {
  margin: 18px;
  padding: 18px;
  max-width: 620px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-placeholder h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
}

.settings-placeholder p {
  margin: 0;
  line-height: 1.5;
}

.settings-side-panel .note-box {
  margin-top: 12px;
}

.dictionary-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.dictionary-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dictionary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.dictionary-row:last-child {
  border-bottom: 0;
}

.dictionary-row strong,
.dictionary-row small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dictionary-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-section {
  padding-top: 16px;
}

.calendar-head {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  text-align: center;
}

.calendar-title {
  font-size: 18px;
  font-weight: var(--weight-bold);
}

.calendar-year {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-nav,
.calendar-day {
  display: grid;
  place-items: center;
  color: var(--text);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 6px;
}

.calendar-nav {
  color: var(--primary);
  border-color: var(--border-light);
}

.calendar-nav:hover,
.calendar-day:hover {
  background: #eef6ff;
  border-color: #bdd7f2;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-weekdays {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--weight-bold);
  text-align: center;
}

.calendar-day {
  min-height: 34px;
  font-size: 14px;
}

.calendar-day.is-muted {
  color: var(--muted-2);
}

.calendar-day.is-today {
  border-color: #9ec8ef;
}

.calendar-day.is-selected {
  color: #fff;
  font-weight: var(--weight-bold);
  background: var(--accent);
  border-color: var(--accent-dark);
}

.client-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.client-list.is-full {
  max-height: calc(100dvh - 196px);
}

.client-register {
  width: 100%;
  min-width: 0;
  background: #fff;
}

.client-register-head,
.client-register-row {
  display: grid;
  grid-template-columns: 38px minmax(180px, 1.35fr) minmax(122px, 0.75fr) 92px 58px 112px 100px 112px;
  align-items: center;
}

.client-register-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 42px;
  color: #5f6b7a;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: #f3f6f9;
  border-bottom: 1px solid var(--line);
}

.client-register-head span {
  text-align: center;
}

.client-register-head span:nth-child(2) {
  text-align: left;
}

.client-register-head span,
.client-register-row > span,
.client-register-cell {
  padding: 0 6px;
}

.client-register-head input,
.client-register-row input {
  width: 16px;
  height: 16px;
}

.client-register-row {
  min-height: 54px;
  border-bottom: 1px solid var(--line);
}

.client-register-row:hover,
.client-register-row.is-active {
  background: #f4f9ff;
}

.client-register-person,
.client-register-cell {
  min-width: 0;
  min-height: 54px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
}

.client-register-person {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 8px;
}

.client-register-person strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.client-register-person strong {
  font-size: 13.5px;
  font-weight: var(--weight-semibold);
}

.client-register-cell {
  display: grid;
  align-items: center;
  justify-items: center;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 12px;
  white-space: nowrap;
}

.client-phone-cell {
  color: var(--muted);
}

.client-status-dot {
  display: inline-flex;
  width: max-content;
  padding: 2px 7px;
  color: var(--accent-dark);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  background: #eef6ff;
  border: 1px solid #cfe3f7;
  border-radius: 999px;
}

.client-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.client-row.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 128, 216, 0.11);
}

.client-title {
  display: block;
  overflow: hidden;
  font-weight: var(--weight-bold);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.client-phone,
.client-note,
.muted {
  color: var(--muted);
}

.client-phone,
.client-note {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.client-row-side {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.client-kpi {
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: var(--weight-bold);
}

.client-status {
  padding: 3px 7px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: var(--weight-bold);
  background: #eef6ff;
  border: 1px solid #cfe3f7;
  border-radius: 999px;
}

.client-filter-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.clients-filter-panel .section-title {
  margin-bottom: 10px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.client-filter-list button {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
}

.client-filter-list button.is-active {
  color: var(--accent-dark);
  background: #eef6ff;
  border-color: #9ec8ef;
}

.client-filter-list span,
.client-filter-list strong,
.client-filter-list small {
  display: block;
}

.client-filter-list strong {
  font-size: 13px;
}

.client-filter-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.client-filter-list b {
  color: #506070;
  font-family: var(--font-ui);
  font-size: 11px;
}

.client-card-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.1;
}

.client-card-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.client-card-page {
  min-height: calc(100dvh - 108px);
  padding: 14px 20px 28px;
  background: #fff;
}

.client-card-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.client-card-main {
  min-width: 0;
}

.client-card-main h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.client-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.client-card-meta span {
  padding: 4px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.client-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 96px);
  gap: 6px;
}

.client-card-metrics div {
  padding: 8px 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.client-card-metrics strong,
.client-card-metrics span {
  display: block;
}

.client-card-metrics strong {
  font-family: var(--font-ui);
  font-size: 16px;
}

.client-card-metrics span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.client-tab-panel {
  padding-top: 18px;
}

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

.client-section-card,
.info-item {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.client-section-card h3,
.client-tab-head h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.client-section-card p,
.client-tab-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.info-item span,
.info-item strong {
  display: block;
}

.info-item span {
  color: var(--muted);
  font-size: 13px;
}

.info-item strong {
  margin-top: 5px;
  font-weight: var(--weight-bold);
}

.client-tab-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.client-wide-list {
  max-width: 760px;
}

.client-form-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.control-grid .medical-field.wide {
  grid-column: span 2;
}

.control-red-zone {
  align-self: end;
  min-height: 40px;
  padding: 8px 10px;
  background: #fff7f7;
  border: 1px solid #f2c9c4;
  border-radius: 6px;
}

.visit-list,
.recommendation-list {
  display: grid;
  gap: 8px;
}

.visit-card,
.recommendation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: start;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.visit-card strong,
.visit-card span,
.visit-card p,
.recommendation-card strong,
.recommendation-card span,
.recommendation-card p,
.recommendation-card em {
  display: block;
}

.visit-card strong,
.recommendation-card strong {
  font-weight: var(--weight-semibold);
}

.visit-card span,
.visit-card p,
.recommendation-card span,
.recommendation-card p,
.recommendation-card em {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.visit-card p,
.recommendation-card p,
.recommendation-card em {
  grid-column: 1 / -1;
  margin: 0;
}

.recommendation-card em {
  font-style: normal;
}

.visit-card-side {
  display: grid;
  justify-items: end;
  gap: 3px;
  white-space: nowrap;
}

.visit-card-side b {
  font-family: var(--font-ui);
  font-size: 13px;
}

.visit-card-side em {
  color: var(--accent-dark);
  font-size: 11px;
  font-style: normal;
  font-weight: var(--weight-semibold);
}

.medical-form {
  display: grid;
  gap: 12px;
  font-family: var(--font-ui);
}

.medical-card {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.medical-card h3,
.medical-card p {
  margin: 0;
}

.medical-card h3 {
  font-size: 17px;
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  letter-spacing: 0;
}

.medical-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.medical-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.medical-card-head .btn {
  flex: 0 0 auto;
}

.medical-history-card {
  background: #fbfcfd;
}

.medical-exam-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

.medical-exam-list button {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  color: var(--text);
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.medical-exam-list button:hover,
.medical-exam-list button.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(47, 128, 216, 0.12);
}

.medical-exam-list strong,
.medical-exam-list span,
.medical-exam-list em {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.medical-exam-list strong {
  font-size: 13px;
  font-weight: var(--weight-semibold);
}

.medical-exam-list span,
.medical-exam-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

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

.medical-subsection {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.medical-subsection h4 {
  margin: 0;
  color: #253246;
  font-size: 14px;
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  letter-spacing: 0;
}

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

.medical-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.medical-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.medical-field.wide {
  grid-column: span 2;
}

.medical-grid.compact .medical-field.wide {
  grid-column: 1 / -1;
}

.medical-field span,
.medical-specialists > span,
.medical-side-grid strong,
.medical-nail-side > strong {
  color: var(--text);
  font-size: 12.5px;
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  letter-spacing: 0;
}

.medical-field input,
.medical-field select,
.medical-field textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.medical-field textarea {
  min-height: 70px;
  resize: vertical;
}

.medical-side-grid,
.medical-nails {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.medical-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.medical-check-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 6px 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.medical-check-grid input {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.medical-check-grid span {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.medical-nail-side {
  min-width: 0;
}

.medical-nail-grid {
  display: grid;
  grid-template-columns: minmax(116px, 1fr) repeat(5, 32px);
  align-items: center;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.medical-nail-grid > * {
  display: grid;
  min-height: 30px;
  place-items: center;
  padding: 4px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.medical-nail-grid span {
  justify-content: start;
  color: var(--text);
  font-size: 11px;
  text-align: left;
}

.medical-nail-grid b {
  color: var(--muted);
  font-size: 11px;
}

.medical-nail-grid input {
  width: 14px;
  height: 14px;
}

.medical-specialists {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.medical-specialists .medical-check-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0;
}

.client-context-panel {
  display: grid;
  gap: 12px;
}

.panel-back {
  justify-self: start;
}

.context-status-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.context-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.context-row strong {
  color: var(--text);
  text-align: right;
}

.profile-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.profile-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.profile-name {
  margin: 0 0 4px;
  font-size: 18px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.profile-metric {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.profile-metric:last-child {
  border-right: 0;
}

.metric-value {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: var(--weight-bold);
}

.metric-label {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.profile-body {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.schedule-heading {
  min-width: 170px;
  margin: 0;
  text-align: center;
}

.schedule-layout {
  overflow: auto;
  min-height: calc(100dvh - 116px);
  background: #fff;
}

.schedule-matrix {
  display: grid;
  grid-template-columns: 74px repeat(var(--day-count), 74px);
  align-content: start;
  min-width: max-content;
  user-select: none;
}

.schedule-corner,
.schedule-date-head,
.schedule-master-cell,
.schedule-cell {
  min-height: 58px;
  background: #fff;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.schedule-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 5;
  display: grid;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  background: #f8fafc;
}

.schedule-date-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 6px 4px;
  color: var(--text);
  text-align: center;
}

.schedule-date-head strong {
  font-size: 19px;
  line-height: 1;
}

.schedule-date-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--weight-bold);
}

.schedule-master-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 66px;
  padding: 8px;
  background: #fff;
}

.schedule-master-cell .client-initial {
  width: 42px;
  height: 42px;
  font-size: 13px;
}

.schedule-cell {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 66px;
  padding: 6px 4px;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}

.schedule-cell strong,
.schedule-cell span {
  font-family: var(--font-ui);
}

.schedule-cell strong {
  color: var(--text);
  font-size: 13px;
}

.schedule-cell span {
  margin-top: 2px;
  font-size: 12px;
}

.schedule-cell em {
  margin-top: 3px;
  padding: 2px 5px;
  color: #8a5a00;
  font-size: 10px;
  font-style: normal;
  background: #fff3cf;
  border: 1px solid #f0d48a;
  border-radius: 999px;
}

.schedule-cell.is-working {
  color: var(--accent-dark);
  background: #f4f9ff;
}

.schedule-cell.is-working:hover,
.schedule-date-head:hover,
.schedule-cell.is-off:hover {
  background: #e8f3ff;
}

.schedule-cell.is-off {
  background: #fbfcfd;
}

.schedule-cell.is-weekend,
.schedule-date-head.is-weekend {
  background: #fff7f7;
}

.schedule-cell.is-selected,
.schedule-date-head.is-selected {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.schedule-cell.is-current-day,
.schedule-date-head.is-current-day {
  box-shadow: inset 0 0 0 2px rgba(47, 128, 216, 0.4);
}

.schedule-tools-panel {
  min-height: calc(100dvh - 56px);
  background: #f8fafc;
}

.schedule-tools-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.schedule-tools-head .section-title {
  margin-bottom: 4px;
}

.schedule-tools-head .muted {
  overflow: hidden;
  max-width: 170px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.schedule-edit-box {
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.schedule-edit-box > label {
  color: var(--text);
  font-weight: var(--weight-semibold);
}

.schedule-time-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.schedule-break-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #fff8e6;
  border: 1px solid #efd799;
  border-radius: 6px;
}

.schedule-break-box label {
  color: #8a5a00;
  font-weight: var(--weight-bold);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text);
  line-height: 1.35;
}

.check-row.wide {
  grid-column: 1 / -1;
}

.check-row input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
}

.schedule-panel-action {
  width: 100%;
}

.schedule-panel-or {
  color: var(--muted);
  text-align: center;
}

.schedule-empty-panel {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 328px;
  margin: 0 auto;
  padding-top: 6px;
  text-align: left;
}

.regular-schedule-head {
  padding-bottom: 0;
}

.regular-schedule-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}

.regular-schedule-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.regular-schedule-box {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 0 0 16px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.regular-schedule-box > label {
  color: var(--text);
  font-size: 14px;
  font-weight: var(--weight-bold);
}

.weekday-pills {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.weekday-pill {
  position: relative;
}

.weekday-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekday-pill span {
  display: grid;
  min-height: 30px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--weight-bold);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.weekday-pill input:checked + span {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent-dark);
}

.schedule-mini-demo {
  display: grid;
  grid-template-columns: 34px repeat(3, 54px);
  gap: 0;
  justify-content: center;
  margin: 6px auto 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.schedule-mini-demo > * {
  display: grid;
  min-height: 42px;
  place-items: center;
  background: #fff;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.schedule-mini-demo button {
  border: 0;
}

.schedule-mini-demo .is-on {
  background: var(--accent);
}

.note-box {
  padding: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  line-height: 1.45;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.photo-tile {
  aspect-ratio: 1;
  overflow: hidden;
  background: #eef3f7;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.photo-card div {
  display: grid;
  gap: 3px;
  padding: 10px;
}

.photo-card strong,
.photo-card span,
.photo-card em {
  display: block;
}

.photo-card strong {
  font-size: 13px;
  font-weight: var(--weight-semibold);
}

.photo-card span,
.photo-card em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.photo-card em {
  font-style: normal;
}

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

.timeline-item {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.timeline-title {
  font-weight: var(--weight-semibold);
}

.timeline-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  z-index: 1000;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background: rgba(16, 37, 53, 0.48);
}

.modal {
  position: relative;
  z-index: 1001;
  width: min(1040px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(184, 196, 210, 0.7);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px -40px rgba(16, 37, 53, 0.7);
}

.modal.sm {
  width: min(760px, calc(100vw - 48px));
}

.master-modal {
  width: min(1060px, calc(100vw - 48px));
}

.service-modal {
  width: min(760px, calc(100vw - 48px));
}

.master-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 26px;
  border-bottom: 1px solid var(--line);
}

.master-modal-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.master-modal-title h2 {
  margin: 0;
  font-size: 24px;
  font-weight: var(--weight-semibold);
  line-height: 1.1;
}

.master-modal-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.modal-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.master-modal-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: var(--weight-bold);
  border-radius: 50%;
  object-fit: cover;
}

.master-modal-tabs {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 26px;
  background: #f7f8fa;
  border-bottom: 1px solid var(--line);
}

.master-modal-tabs button {
  min-height: 44px;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
}

.master-modal-tabs button.is-active {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
}

.master-modal-body {
  min-height: 420px;
  padding: 28px 32px;
}

.master-profile-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 32px;
}

.master-avatar-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.master-avatar-upload {
  position: relative;
  display: grid;
  place-items: center;
  height: 230px;
  cursor: pointer;
  background: #eef4fa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.master-avatar-preview {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 30px;
  font-weight: var(--weight-bold);
  border-radius: 50%;
  object-fit: cover;
}

.master-avatar-upload span:last-child {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 7px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: var(--weight-semibold);
  background: var(--accent);
  border-radius: 999px;
}

.master-status-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.master-status-toggle label {
  display: grid;
  min-height: 38px;
  place-items: center;
  cursor: pointer;
  background: #fff;
}

.master-status-toggle label.is-active,
.master-status-toggle label:has(input:checked) {
  color: #fff;
  background: #35a853;
}

.master-status-toggle label:has(input[value="0"]:checked) {
  background: #7a8795;
}

.master-status-toggle input {
  position: absolute;
  opacity: 0;
}

.master-profile-form {
  align-content: start;
}

.color-dot-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 36px;
  align-items: center;
}

.color-dot-picker label {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 50%;
}

.color-dot-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.color-dot-picker span {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(16, 37, 53, 0.18);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.color-dot-picker label.is-selected,
.color-dot-picker label:has(input:checked) {
  border-color: var(--accent);
  background: #eef6ff;
}

.master-schedule-calendar {
  display: grid;
  grid-template-columns: 250px minmax(520px, 1fr);
  gap: 28px;
  align-items: start;
}

.master-schedule-controls {
  display: grid;
  gap: 24px;
}

.master-schedule-controls h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: var(--weight-semibold);
}

.schedule-preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.master-schedule-timebox {
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.master-schedule-timebox:not(:has(#master-calendar-break-toggle:checked)) .master-calendar-break-row {
  display: none;
}

.master-schedule-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.master-schedule-actions .btn:first-child {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.master-schedule-actions .btn:last-child {
  grid-column: 1 / -1;
}

.master-calendar-panel {
  min-width: 0;
}

.master-calendar-head {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: #5d7898;
  text-align: center;
}

.master-calendar-head strong {
  font-size: 15px;
}

.master-calendar-weekdays,
.master-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(72px, 1fr));
}

.master-calendar-weekdays {
  color: #9aa3ad;
  font-size: 13px;
  text-align: center;
}

.master-calendar-weekdays span {
  padding: 7px 0;
}

.master-calendar-grid {
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.master-calendar-day {
  display: grid;
  align-content: start;
  justify-items: start;
  min-height: 74px;
  padding: 8px;
  color: #5d7898;
  text-align: left;
  background: #fff;
  border: 0;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.master-calendar-day strong {
  font-size: 15px;
  font-weight: var(--weight-semibold);
}

.master-calendar-day small {
  margin-top: 9px;
  color: var(--accent-dark);
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1.35;
}

.master-calendar-day.is-muted {
  color: #c4cbd4;
  background: #fbfcfd;
}

.master-calendar-day.is-off {
  background: #fcfbfa;
}

.master-calendar-day.is-today {
  background: #eef6ff;
}

.master-calendar-day.is-selected {
  background: #dfeafe;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.master-placeholder {
  margin: 0;
}

.service-settings-form {
  max-width: 760px;
}

.service-master-table {
  overflow: hidden;
  margin: -12px -18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.service-master-head,
.service-master-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 140px 160px 36px;
  gap: 12px;
  align-items: center;
  padding: 7px 18px;
}

.service-master-head {
  min-height: 38px;
  color: #9aa3ad;
  font-size: 12px;
  font-weight: var(--weight-semibold);
  background: #f7f8fa;
}

.service-master-row {
  min-height: 54px;
  border-top: 1px solid var(--line);
}

.service-master-row:hover {
  background: #f4f9ff;
}

.service-master-row .select,
.service-price-input {
  height: 34px;
}

.service-price-input {
  text-align: right;
}

.service-mini-toggle,
.service-mini-toggle input {
  position: absolute;
  opacity: 0;
}

.service-mini-toggle span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #b6c2cf;
  border-radius: 8px;
}

.service-mini-toggle span::before {
  content: "●";
  font-size: 12px;
}

.service-mini-toggle input:checked + span {
  background: var(--accent);
}

.service-remove-master {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  background: #aebccc;
  border: 0;
  border-radius: 50%;
}

.service-remove-master:hover {
  background: #e85d5d;
}

.service-add-master-wrap {
  position: relative;
  border-top: 1px solid var(--line);
}

.service-add-master-row {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: #35a853;
  text-align: left;
  background: #fff;
  border: 0;
  cursor: pointer;
  padding: 10px 18px;
}

.service-add-master-row:hover {
  background: #f4fbf6;
}

.service-add-master-row:disabled {
  cursor: default;
  opacity: 0.55;
}

.service-add-master-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #35a853;
  font-size: 26px;
  font-weight: var(--weight-bold);
  background: #dff4e6;
  border-radius: 50%;
}

.service-master-empty {
  border-top: 1px solid var(--line);
}

.service-master-popover {
  position: absolute;
  left: 54px;
  bottom: calc(100% - 4px);
  z-index: 40;
  width: min(360px, calc(100% - 72px));
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(15, 35, 55, 0.22);
}

.service-master-popover-title {
  padding: 9px 12px 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.service-master-popover-list {
  max-height: 260px;
  overflow-y: auto;
}

.service-master-popover button {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 18px;
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.service-master-popover button:last-child {
  border-bottom: 0;
}

.service-master-popover button:hover {
  background: #f4f9ff;
}

.service-master-popover strong,
.service-master-popover small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.service-master-popover small {
  color: var(--muted);
  font-size: 12px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  margin: 0;
  font-size: 24px;
  line-height: 1;
}

.modal-body {
  padding: 16px 20px;
}

.appointment-modal {
  width: min(980px, calc(100vw - 48px));
}

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

.appointment-section {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.appointment-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.appointment-section h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.appointment-time-grid {
  grid-template-columns: minmax(260px, 1fr) 170px 170px;
}

.appointment-service-grid {
  grid-template-columns: minmax(280px, 1fr) 130px 140px 130px;
}

.appointment-client-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 170px 260px;
  gap: 14px;
  align-items: start;
}

.appointment-client-search-field {
  position: relative;
}

.appointment-client-search-field .input {
  padding-right: 40px;
}

.client-info-button {
  position: absolute;
  top: 29px;
  right: 8px;
  width: 24px;
  height: 24px;
  color: var(--accent-dark);
  font-weight: var(--weight-bold);
  font-style: italic;
  background: #dff0ff;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.client-info-button:hover {
  background: #cbe5ff;
}

.appointment-client-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 45;
  width: min(420px, 100%);
  max-height: 250px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 18px 36px rgba(15, 35, 55, 0.22);
}

.appointment-client-results:empty {
  display: none;
}

.appointment-client-results button {
  width: 100%;
  display: block;
  padding: 8px 12px;
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.appointment-client-results button:hover {
  background: #f4f9ff;
}

.appointment-client-results strong,
.appointment-client-results small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.appointment-client-results small {
  margin-top: 2px;
  color: var(--muted);
}

.appointment-client-empty {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.appointment-client-create {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #35a853;
  font-weight: var(--weight-semibold);
  background: #fbfdfb !important;
}

.appointment-client-create span {
  font-size: 22px;
  line-height: 1;
}

.appointment-confirm-row {
  height: 42px;
  margin-top: 24px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0;
  line-height: 1;
}

.appointment-confirm-row input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 0;
}

.visit-status-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 42px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.visit-status-toggle label {
  display: grid;
  place-items: center;
  cursor: pointer;
  background: #fff;
}

.visit-status-toggle label + label {
  border-left: 1px solid var(--line-strong);
}

.visit-status-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.visit-status-toggle label.is-active,
.visit-status-toggle label:has(input:checked) {
  color: #fff;
  background: var(--accent);
}

.appointment-anonymous-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 10px;
}

.appointment-note-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1.8fr);
  gap: 16px;
  align-items: start;
}

.appointment-note-grid .field.wide {
  grid-column: auto;
}

.appointment-color-picker {
  flex-wrap: nowrap;
  gap: 8px;
}

.appointment-color-picker label {
  width: 28px;
  height: 28px;
}

.appointment-color-picker span {
  width: 19px;
  height: 19px;
}

.appointment-note-grid .textarea {
  min-height: 70px;
}

.appointment-history-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.appointment-change-history {
  position: absolute;
  left: 0;
  bottom: calc(100% + 14px);
  z-index: 7;
  width: 320px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 18px 38px rgba(14, 31, 46, 0.18);
}

.appointment-change-history::after {
  position: absolute;
  bottom: -7px;
  left: 58px;
  width: 12px;
  height: 12px;
  content: "";
  background: #fff;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  transform: rotate(45deg);
}

.appointment-change-history div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
}

.appointment-change-history b {
  font-size: 13px;
}

.appointment-change-history span,
.appointment-change-history p {
  color: var(--muted);
  font-size: 12px;
}

.appointment-change-history p {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  line-height: 1.35;
}

.appointment-client-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  background: rgba(12, 28, 41, 0.2);
}

.appointment-client-card {
  width: min(620px, calc(100vw - 48px));
  max-height: min(720px, calc(100vh - 70px));
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 24px 54px rgba(11, 28, 43, 0.28);
}

.appointment-client-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.appointment-client-card-title {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.appointment-client-card-title h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.appointment-client-card-title p {
  margin: 0;
  color: var(--muted);
}

.client-preview-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px 20px;
}

.client-preview-metrics div,
.client-preview-note,
.client-preview-visit {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
}

.client-preview-metrics div {
  padding: 10px 12px;
}

.client-preview-metrics b,
.client-preview-metrics span {
  display: block;
}

.client-preview-metrics b {
  font-size: 20px;
}

.client-preview-metrics span,
.client-preview-visit small {
  color: var(--muted);
}

.client-preview-note {
  margin: 0 20px 16px;
  padding: 12px;
  color: var(--muted);
}

.appointment-client-card h4 {
  margin: 0 20px 10px;
  font-size: 16px;
}

.client-preview-history {
  display: grid;
  gap: 8px;
  padding: 0 20px 20px;
}

.client-preview-visit {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.quick-client-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  background: rgba(12, 28, 41, 0.18);
}

.quick-client-card {
  width: min(560px, calc(100vw - 48px));
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 24px 54px rgba(11, 28, 43, 0.28);
}

.quick-client-head,
.quick-client-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quick-client-head {
  margin-bottom: 18px;
}

.quick-client-head h2 {
  margin: 0;
}

.quick-client-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 16px;
}

.form-grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.field {
  display: grid;
  gap: 6px;
}

.field.wide {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: var(--weight-semibold);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
}

.appointment-modal .modal-footer {
  justify-content: space-between;
}

.modal-footer-left,
.modal-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-footer-left:empty {
  display: none;
}

.inline-error {
  margin-top: 14px;
  padding: 10px 12px;
  color: #8d2f24;
  background: #fff4f1;
  border: 1px solid #f2c7bf;
  border-radius: 6px;
}

.empty {
  padding: 18px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }

  .sidebar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 0;
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
    padding: 10px 6px;
    font-size: 12px;
  }

  .workspace {
    border-right: 0;
  }

  .right-panel {
    border-top: 1px solid var(--line);
  }

  .view-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .journal {
    grid-template-columns: 70px repeat(var(--master-count), minmax(190px, 1fr));
    min-height: 720px;
  }

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

  .modal {
    width: calc(100vw - 24px);
  }
}

/* Premium SaaS redesign layer */
:root {
  --bg-main: #f6f8fb;
  --bg-page: #ffffff;
  --bg-card: #ffffff;
  --bg-soft: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-light: #e7ecf3;
  --border-soft: #eef2f6;
  --primary: #14b8a6;
  --primary-hover: #12a594;
  --primary-soft: #eaf8f6;
  --blue: #3b82f6;
  --blue-soft: #eff6ff;
  --success: #22c55e;
  --success-soft: #ecfdf3;
  --warning: #f59e0b;
  --warning-soft: #fff7e6;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --purple: #8b5cf6;
  --purple-soft: #f3e8ff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
  --bg: var(--bg-main);
  --surface: var(--bg-card);
  --surface-soft: var(--bg-soft);
  --line: var(--border-light);
  --line-strong: #d8e1ec;
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --muted-2: var(--text-muted);
  --accent: var(--primary);
  --accent-dark: var(--primary-hover);
  --green: var(--primary);
  --radius: var(--radius-md);
  --shadow: var(--shadow-card);
}

html {
  background: var(--bg-main);
}

body {
  min-width: 1180px;
  color: var(--text-primary);
  background: var(--bg-main);
  font-family: var(--font-ui);
  font-size: 14px;
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

.shell {
  grid-template-columns: 216px minmax(0, 1fr) 288px;
  grid-template-rows: 32px minmax(0, 1fr);
  background: var(--bg-main);
}

.shell.is-sidebar-collapsed {
  grid-template-columns: 68px minmax(0, 1fr) 288px;
}

.icon-btn svg,
.chevron svg,
.collapse-link svg,
.appointment-dots svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-name strong {
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: var(--weight-semibold);
}

.topbar-avatar {
  width: 20px;
  height: 20px;
  font-size: 9.5px;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.76);
}

.icon-btn {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: 12px;
  transition: all 180ms ease;
}

.icon-btn:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.notify-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  background: var(--primary);
  border: 2px solid #fff;
  border-radius: 999px;
}

.avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #5ed5ca, var(--primary));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.profile-copy {
  display: grid;
  gap: 1px;
  color: var(--text-primary);
}

.profile-copy strong {
  font-size: 12.5px;
  font-weight: var(--weight-semibold);
}

.profile-copy small {
  color: var(--text-secondary);
  font-size: 11px;
}

.chevron {
  display: grid;
  color: var(--text-secondary);
}

.sidebar {
  grid-row: 1 / -1;
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  width: 216px;
  height: 100dvh;
  max-height: 100dvh;
  overflow-y: auto;
  padding: 18px 10px 14px;
  color: var(--text-secondary);
  background: #fff;
  border-top: 0;
  border-right: 1px solid var(--border-light);
}

.sidebar-logo {
  padding: 0 10px 18px;
}

.brand-title {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: var(--weight-medium);
  letter-spacing: 0;
}

.brand-subtitle {
  max-width: none;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.nav-item {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 9px;
  min-height: 38px;
  padding: 0 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: var(--weight-medium);
  border-radius: 12px;
  transition: all 180ms ease;
}

.nav-chevron {
  display: grid;
  place-items: center;
  width: 16px;
  color: #94a3b8;
  opacity: 0.72;
  transition: transform 180ms ease;
}

.nav-chevron svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.is-open .nav-chevron {
  transform: rotate(180deg);
}

.nav-item:hover .nav-chevron,
.nav-item.is-active .nav-chevron {
  color: var(--text-muted);
  opacity: 0.9;
}

.nav-item:hover {
  color: var(--primary);
  background: #f7fbfb;
}

.nav-item.is-active {
  color: var(--primary);
  font-weight: var(--weight-semibold);
  background: var(--primary-soft);
}

.nav-icon {
  width: 18px;
  height: 18px;
  opacity: 1;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.55;
}

.sidebar-subnav {
  display: grid;
  gap: 2px;
  padding: 2px 4px 8px 38px;
}

.sidebar-subnav button {
  min-height: 32px;
  padding: 0 0 0 12px;
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 12.5px;
}

.sidebar-subnav button.is-active {
  color: var(--primary);
  border-left-color: var(--primary);
}

.collapse-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 12px;
  transition: all 180ms ease;
}

.collapse-link:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.shell.is-sidebar-collapsed .sidebar {
  width: 68px;
  padding: 14px 8px;
}

.shell.is-sidebar-collapsed .sidebar-logo,
.shell.is-sidebar-collapsed .sidebar-subnav,
.shell.is-sidebar-collapsed .nav-item span:last-child,
.shell.is-sidebar-collapsed .nav-chevron,
.shell.is-sidebar-collapsed .collapse-link span {
  display: none;
}

.shell.is-sidebar-collapsed .sidebar-nav {
  align-content: start;
  gap: 8px;
}

.shell.is-sidebar-collapsed .nav-item {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 42px;
  padding: 0;
}

.shell.is-sidebar-collapsed .collapse-link {
  justify-content: center;
}

.workspace {
  min-width: 0;
  overflow: auto;
  background: var(--bg-main);
  border-right: 0;
}

.right-panel {
  grid-column: 3;
  grid-row: 2;
  padding: 18px 16px 18px 0;
  font-size: 13px;
  background: var(--bg-main);
}

.view-toolbar,
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 12px 16px;
  background: transparent;
  border-bottom: 0;
}

.page-header {
  padding-bottom: 12px;
}

.page-header p {
  margin: 6px 0 0;
  color: var(--text-secondary);
}

.toolbar-title-group {
  min-width: 0;
  gap: 10px;
}

.page-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 22px;
  font-weight: var(--weight-semibold);
  line-height: 1.15;
}

.journal-title {
  max-width: 250px;
  font-size: 15px;
  line-height: 1.18;
  white-space: nowrap;
  font-weight: var(--weight-semibold);
}

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

.date-inline {
  position: relative;
  height: 38px;
  width: 38px;
  padding: 0;
  color: transparent;
  background: #fff;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 2v4M16 2v4M4 9h16M6 4h12a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  text-align: center;
}

.date-inline::-webkit-datetime-edit,
.date-inline::-webkit-datetime-edit-fields-wrapper {
  display: none;
}

.date-inline::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}

.select,
.input,
.textarea,
.medical-field input,
.medical-field select,
.medical-field textarea {
  min-height: 38px;
  color: var(--text-primary);
  background: #fff;
  border-color: var(--border-light);
  border-radius: 12px;
}

.select,
.medical-field select,
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}

.select:disabled,
.medical-field select:disabled,
select:disabled {
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.select:focus,
.input:focus,
.textarea:focus,
.medical-field input:focus,
.medical-field select:focus,
.medical-field textarea:focus {
  border-color: rgba(24, 184, 166, 0.62);
  box-shadow: 0 0 0 4px rgba(24, 184, 166, 0.12);
}

.journal {
  grid-template-columns: 72px repeat(var(--master-count), minmax(260px, 1fr));
  min-height: calc(100dvh - 148px);
  margin: 0 16px 18px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.time-head,
.master-head {
  min-height: 64px;
  background: #fff;
  border-bottom-color: var(--border-light);
}

.time-head {
  color: var(--text-muted);
}

.master-head {
  gap: 12px;
  border-right-color: var(--border-soft);
}

.master-avatar,
.client-initial {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: var(--weight-bold);
  background: linear-gradient(135deg, #5bd5ca, var(--primary));
  border-radius: 50%;
  object-fit: cover;
}

.master-avatar {
  width: 38px;
  height: 38px;
  font-size: 12px;
}

.master-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: var(--weight-semibold);
}

.master-hours {
  color: var(--text-secondary);
  font-size: 11.5px;
}

.time-slot {
  height: 118px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: var(--weight-medium);
  border-bottom-color: var(--border-soft);
}

.master-column {
  min-width: 260px;
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 28.5px, rgba(226, 232, 240, 0.42) 29.5px),
    repeating-linear-gradient(to bottom, #fff 0, #fff 117px, var(--border-soft) 118px);
  border-right-color: var(--border-soft);
}

.appointment-card {
  left: 0.5px;
  right: 0.5px;
  padding: 10px 12px;
  color: var(--text-primary);
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.appointment-card.tone-blue {
  background: var(--blue-soft);
  border-color: #bfdbfe;
  border-left-color: var(--blue);
}

.appointment-card.tone-danger {
  background: var(--danger-soft);
  border-color: #fecaca;
  border-left-color: var(--danger);
}

.appointment-card.tone-success {
  background: var(--success-soft);
  border-color: #bbf7d0;
  border-left-color: var(--success);
}

.appointment-card.tone-muted {
  background: #f8fafc;
  border-color: #e2e8f0;
  border-left-color: #94a3b8;
}

.appointment-card:hover,
.appointment-card:focus-visible {
  border-color: #99f6e4;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.appointment-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.appointment-time {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.appointment-client {
  display: block;
  overflow: hidden;
  margin-top: 7px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointment-meta {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointment-dots {
  position: absolute;
  right: 10px;
  bottom: 7px;
  color: var(--text-muted);
}

.status-badge,
.client-status,
.client-status-dot,
.settings-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 20px;
  padding: 2px 7px;
  color: var(--primary);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-style: normal;
  font-weight: var(--weight-semibold);
  background: var(--primary-soft);
  border: 0;
  border-radius: 999px;
}

.badge-active {
  color: var(--primary);
  background: var(--primary-soft);
}

.badge-control {
  color: var(--warning);
  background: var(--warning-soft);
}

.badge-new {
  color: var(--blue);
  background: var(--blue-soft);
}

.badge-lost {
  color: var(--text-secondary);
  background: #f1f5f9;
}

.clients-page,
.analytics-page,
.settings-page {
  padding: 0 28px 28px;
  background: var(--bg-main);
}

.client-base-toolbar {
  min-height: auto;
  padding: 0 0 14px;
  background: transparent;
  border-bottom: 0;
}

.client-base-search {
  width: min(520px, 100%);
  min-height: 44px;
  border-color: var(--border-light);
  border-radius: 14px;
}

.table-card,
.settings-table,
.chart-card,
.stat-card,
.context-status-card,
.note-box,
.panel-section {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.panel-section {
  margin-bottom: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border-light);
}

.calendar-section {
  padding: 12px 14px 14px;
}

.client-register {
  min-width: 0;
  background: #fff;
}

.client-register-head,
.client-register-row {
  grid-template-columns: 38px minmax(190px, 1.35fr) minmax(126px, 0.75fr) 96px 60px 116px 104px 118px;
}

.client-register-head {
  min-height: 48px;
  color: var(--text-secondary);
  background: var(--bg-soft);
  border-bottom-color: var(--border-soft);
}

.client-register-row {
  min-height: 62px;
  border-bottom-color: var(--border-soft);
}

.client-register-row:hover,
.client-register-row.is-active,
.settings-row:hover {
  background: #fafcfd;
}

.client-register-person,
.client-register-cell {
  min-height: 62px;
}

.client-register-person {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.client-register-person strong,
.client-title {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.client-phone-cell,
.client-note,
.client-phone {
  color: var(--text-secondary);
}

.client-register-cell {
  font-family: var(--font-ui);
  font-size: 13px;
}

.client-row {
  border-color: var(--border-light);
  border-radius: 14px;
}

.client-filter-list {
  gap: 8px;
}

.clients-filter-panel .section-title,
.section-title {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
  text-transform: none;
}

.client-filter-list button {
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 14px;
}

.client-filter-list button.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: transparent;
}

.client-card-page {
  min-height: calc(100dvh - 72px);
  padding: 24px 28px 32px;
  background: var(--bg-main);
}

.client-card-hero {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px;
  background: #fff;
  border-color: var(--border-light);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

.client-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.client-card-main h1 {
  font-size: 28px;
  font-weight: var(--weight-semibold);
}

.client-card-meta {
  gap: 8px;
}

.client-card-meta span {
  border-color: var(--border-soft);
  border-radius: 999px;
}

.client-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-card-metrics,
.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.client-card-metrics div,
.stat-card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.client-card-metrics strong,
.stat-card strong {
  display: block;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 22px;
  font-weight: var(--weight-semibold);
}

.client-card-metrics span,
.stat-card span,
.stat-card small {
  color: var(--text-secondary);
  font-size: 13px;
}

.stat-card small {
  display: block;
  margin-top: 8px;
  color: var(--primary);
  font-weight: var(--weight-semibold);
}

.client-section-card,
.info-item,
.client-form-card,
.medical-card,
.medical-subsection,
.visit-card,
.recommendation-card,
.timeline-item,
.profile-card {
  border-color: var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  margin-top: 18px;
}

.chart-card {
  min-height: 280px;
  padding: 20px;
}

.chart-card h2 {
  margin: 0 0 18px;
  font-size: 16px;
}

.line-chart {
  height: 190px;
  background:
    linear-gradient(to bottom, transparent 0 24%, var(--border-soft) 25%, transparent 26% 49%, var(--border-soft) 50%, transparent 51% 74%, var(--border-soft) 75%, transparent 76%),
    linear-gradient(135deg, transparent 0 13%, rgba(24,184,166,.2) 14% 29%, transparent 30% 43%, rgba(24,184,166,.26) 44% 62%, transparent 63%);
  border-radius: 14px;
  position: relative;
}

.line-chart::after {
  position: absolute;
  inset: 40px 18px 35px;
  content: "";
  border-bottom: 4px solid var(--primary);
  border-radius: 50%;
  transform: skew(-26deg) rotate(-5deg);
}

.donut-chart {
  width: 160px;
  height: 160px;
  margin: 20px auto 0;
  background: conic-gradient(var(--primary) 0 40%, var(--blue) 40% 70%, var(--warning) 70% 90%, var(--purple) 90% 100%);
  border-radius: 50%;
  box-shadow: inset 0 0 0 36px #fff;
}

.bar-list,
.top-services {
  display: grid;
  gap: 14px;
}

.bar-list span,
.top-services span {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
}

.bar-list i {
  display: block;
  height: 12px;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 999px;
}

.top-services span {
  grid-template-columns: 24px 1fr auto;
  min-height: 34px;
}

.schedule-layout {
  margin: 0 28px 28px;
  min-height: calc(100dvh - 128px);
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.schedule-corner,
.schedule-date-head,
.schedule-master-cell,
.schedule-cell {
  border-right-color: var(--border-soft);
  border-bottom-color: var(--border-soft);
}

.schedule-cell.is-working {
  color: var(--primary);
  background: var(--primary-soft);
}

.schedule-cell.is-weekend,
.schedule-date-head.is-weekend {
  background: #fff8f8;
}

.schedule-cell.is-selected,
.schedule-date-head.is-selected,
.schedule-cell.is-current-day,
.schedule-date-head.is-current-day {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.regular-schedule-box {
  padding: 0;
  border: 0;
}

.weekday-pill span {
  min-height: 34px;
  border-radius: 10px;
}

.weekday-pill input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
}

.modal {
  border-color: var(--border-light);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
}

.appointment-modal {
  width: min(920px, calc(100vw - 48px));
}

.modal-header,
.modal-footer {
  border-color: var(--border-soft);
}

.modal-title {
  font-size: 24px;
  font-weight: var(--weight-semibold);
}

.field label,
.medical-field span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: var(--weight-semibold);
}

.note-box {
  color: var(--text-secondary);
  background: var(--bg-soft);
  box-shadow: none;
}

.context-status-card {
  gap: 12px;
  padding: 14px;
  box-shadow: none;
}

.today-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.today-stats-grid div {
  display: grid;
  gap: 5px;
  min-height: 70px;
  padding: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}

.today-stats-grid b {
  color: var(--text-primary);
  font-size: 18px;
}

.today-stats-grid span,
.upcoming-list small {
  color: var(--text-secondary);
}

.panel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-card-head .section-title {
  margin: 0;
}

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

.upcoming-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}

.upcoming-list strong,
.upcoming-list small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.upcoming-list b {
  color: var(--text-primary);
}

.calendar-title {
  font-size: 16px;
}

.calendar-day {
  min-height: 28px;
  font-size: 13px;
}

.calendar-weekdays {
  margin-bottom: 3px;
  font-size: 10.5px;
}

.calendar-head {
  grid-template-columns: 32px 1fr 32px;
  gap: 6px;
  margin-bottom: 8px;
}

.calendar-year {
  margin-top: 0;
  font-size: 11px;
}

.calendar-grid {
  gap: 2px 4px;
}

.clients-filter-panel .section-title,
.section-title {
  font-size: 15px;
}

.today-stats-grid {
  gap: 8px;
}

.today-stats-grid div {
  min-height: 58px;
  padding: 10px;
}

.today-stats-grid b {
  font-size: 16px;
}

.upcoming-list button {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 52px;
  gap: 8px;
}

.client-filter-list button {
  min-height: 50px;
  padding: 8px 10px;
}

.client-filter-list strong {
  font-size: 12.5px;
}

.client-filter-list small {
  font-size: 10.5px;
}

.status-badge {
  flex: 0 0 auto;
}

@media (max-width: 1200px) {
  body {
    min-width: 0;
  }

  .shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .right-panel {
    display: none;
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 78px minmax(0, 1fr);
    grid-template-rows: 72px minmax(0, 1fr);
  }

  .sidebar {
    width: 78px;
    padding: 14px 10px;
  }

  .sidebar-logo,
  .collapse-link span,
  .nav-item span:last-child,
  .sidebar-subnav {
    display: none;
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .profile-copy,
  .chevron {
    display: none;
  }

  .view-toolbar,
  .page-header {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .journal,
  .schedule-layout,
  .clients-page,
  .analytics-page,
  .client-card-page {
    margin: 0 16px 16px;
    padding: 0;
  }

  .analytics-kpis,
  .client-card-metrics,
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* Shared compact clinical rhythm for every screen */
:root {
  --page-x: 10px;
  --page-y: 10px;
  --toolbar-y: 8px;
  --card-radius: 16px;
  --control-h: 38px;
  --row-h: 64px;
}

.workspace > .clients-page,
.workspace > .analytics-page,
.workspace > .settings-page,
.workspace > .client-card-page {
  min-height: calc(100dvh - 32px);
  padding: var(--page-y) var(--page-x) 14px;
}

.workspace > .settings-page {
  padding-top: 0;
}

.page-header,
.view-toolbar {
  min-height: 54px;
  padding: var(--toolbar-y) var(--page-x);
}

.page-title {
  font-size: 18px;
  line-height: 1.2;
}

.page-header p {
  margin-top: 4px;
  font-size: 12px;
}

.page-actions,
.toolbar-group,
.modal-footer-left,
.modal-footer-right,
.quick-client-actions {
  gap: 8px;
}

.select,
.input,
.textarea,
.medical-field input,
.medical-field select,
.medical-field textarea,
.date-control button,
.date-control input {
  min-height: var(--control-h);
  font-size: 12.5px;
  border-radius: 10px;
}

.client-base-toolbar,
.settings-service-filters {
  min-height: auto;
  padding: 0 0 12px;
  background: transparent;
  border-bottom: 0;
}

.settings-service-filters {
  grid-template-columns: minmax(150px, 180px) minmax(150px, 180px) minmax(130px, 160px) minmax(220px, 1fr) auto;
}

.employees-filters {
  grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr) auto auto;
}

.table-card,
.settings-table,
.chart-card,
.stat-card,
.client-card-hero,
.client-card-metrics div,
.client-section-card,
.info-item,
.client-form-card,
.medical-card,
.medical-subsection,
.visit-card,
.recommendation-card,
.timeline-item,
.profile-card,
.schedule-layout,
.modal,
.quick-client-card,
.appointment-client-card {
  border-radius: var(--card-radius);
}

.client-register-head,
.settings-table-head {
  min-height: 42px;
  font-size: 10.5px;
}

.client-register-row,
.client-register-person,
.client-register-cell,
.settings-row {
  min-height: var(--row-h);
}

.settings-table-head,
.settings-row {
  padding-inline: 14px;
}

.settings-row {
  font-size: 13px;
}

.settings-person {
  grid-template-columns: 34px minmax(0, 1fr);
}

.settings-person strong {
  font-size: 13px;
}

.dictionary-row small,
.client-register-person small,
.client-register-person em {
  font-size: 11px;
}

.schedule-layout {
  margin: 0 var(--page-x) 18px;
  min-height: calc(100dvh - 112px);
}

.schedule-heading {
  min-width: 130px;
  font-size: 18px;
}

.schedule-corner,
.schedule-date-head,
.schedule-master-cell,
.schedule-cell {
  min-height: 54px;
}

.schedule-date-head strong {
  font-size: 16px;
}

.schedule-date-head span,
.schedule-cell span,
.schedule-cell em {
  font-size: 11px;
}

.schedule-cell strong {
  font-size: 12px;
}

.schedule-master-cell:hover {
  z-index: 12;
}

.schedule-master-tooltip {
  position: absolute;
  left: calc(100% - 6px);
  top: 50%;
  z-index: 20;
  max-width: 220px;
  padding: 8px 11px;
  color: #fff;
  font-size: 12px;
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: none;
  background: rgba(42, 54, 71, 0.94);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translate(-4px, -50%);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.schedule-master-tooltip::before {
  position: absolute;
  top: 50%;
  left: -5px;
  width: 10px;
  height: 10px;
  content: "";
  background: rgba(42, 54, 71, 0.94);
  transform: translateY(-50%) rotate(45deg);
}

.schedule-master-cell:hover .schedule-master-tooltip {
  opacity: 1;
  transform: translate(0, -50%);
}

.client-card-page {
  padding-top: var(--page-y);
}

.client-card-hero {
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 14px;
}

.client-card-main h1 {
  font-size: 22px;
}

.client-card-meta {
  margin-top: 5px;
}

.client-card-meta span {
  padding: 3px 7px;
  font-size: 11px;
}

.client-card-metrics,
.analytics-kpis {
  gap: 10px;
  margin-top: 12px;
}

.client-card-metrics div,
.stat-card {
  padding: 14px;
}

.client-card-metrics strong,
.stat-card strong {
  font-size: 18px;
}

.client-card-metrics span,
.stat-card span,
.stat-card small {
  font-size: 12px;
}

.client-tabs {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  overflow-x: auto;
  padding: 0 12px 1px;
  background: transparent;
  border-bottom: 1px solid var(--border-light);
  scrollbar-width: thin;
}

.client-tabs button {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: var(--weight-semibold);
  line-height: 1.1;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-tabs button.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.client-tab-panel {
  padding-top: 14px;
}

.client-overview-grid,
.client-info-grid,
.medical-section-grid {
  gap: 10px;
}

.client-section-card,
.info-item,
.client-form-card,
.medical-card,
.medical-subsection {
  padding: 12px;
}

.client-section-card h3,
.client-tab-head h3,
.medical-card h3,
.settings-placeholder h3 {
  font-size: 15px;
}

.client-section-card p,
.client-tab-head p,
.medical-card p {
  font-size: 12px;
}

.form-grid,
.appointment-form-layout,
.medical-form,
.control-grid,
.medical-grid {
  gap: 10px;
}

.field,
.medical-field {
  gap: 5px;
}

.modal-backdrop {
  padding: 18px;
}

.modal,
.appointment-modal,
.master-modal,
.service-modal {
  width: min(900px, calc(100vw - 36px));
  max-height: calc(100dvh - 36px);
}

.modal.sm,
.service-modal {
  width: min(680px, calc(100vw - 36px));
}

.master-modal {
  width: min(980px, calc(100vw - 36px));
}

.modal-header,
.modal-footer,
.master-modal-head {
  padding: 12px 16px;
}

.modal-body,
.master-modal-body {
  padding: 14px 16px;
}

.modal-title,
.master-modal-title h2,
.quick-client-head h2 {
  font-size: 20px;
}

.appointment-section h3 {
  margin-bottom: 8px;
  font-size: 12px;
}

.appointment-time-grid {
  grid-template-columns: minmax(220px, 1fr) 140px 140px;
}

.appointment-service-grid {
  grid-template-columns: minmax(220px, 1fr) 110px 120px 110px;
}

.appointment-client-layout {
  grid-template-columns: minmax(280px, 1fr) 140px 220px;
  gap: 10px;
}

.appointment-note-grid {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 1.6fr);
  gap: 12px;
}

.analytics-grid {
  gap: 14px;
  margin-top: 14px;
}

.chart-card {
  min-height: 240px;
  padding: 16px;
}

.chart-card h2 {
  margin-bottom: 12px;
  font-size: 15px;
}

.right-panel .panel-section {
  padding: 14px;
}

.workspace > .clients-page {
  padding-top: 0;
}

.clients-page > .client-base-toolbar.view-toolbar {
  min-height: 54px;
  padding: var(--toolbar-y) 0;
}

.clients-page > .clients-workspace {
  margin-top: 0;
}

.shell {
  grid-template-rows: minmax(0, 1fr);
}

.workspace {
  grid-column: 2;
  grid-row: 1;
}

.right-panel {
  grid-column: 3;
  grid-row: 1;
  padding: var(--toolbar-y) var(--page-x) 14px 0;
}

.journal {
  margin: 0 var(--page-x) 14px;
}

.account-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: var(--control-h);
  min-height: var(--control-h);
  margin-bottom: 8px;
  padding: 0 10px;
  border-radius: 12px;
}

.account-actions,
.account-profile {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.account-profile-button {
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.account-profile-button:hover .topbar-avatar {
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.76), 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.account-actions .icon-btn {
  width: 26px;
  height: 26px;
}

.account-actions .icon-btn svg {
  width: 16px;
  height: 16px;
}

.account-actions .messages-icon-btn svg {
  transform: translateY(-1.5px);
}

.account-actions .notify-dot {
  top: -1px;
  right: -1px;
  min-width: 14px;
  height: 14px;
  font-size: 9px;
  border-width: 1px;
}

.account-panel .topbar-avatar {
  width: 26px;
  height: 26px;
  min-width: 26px;
  font-size: 11px;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.76);
}

.account-panel .profile-copy {
  overflow: hidden;
}

.account-panel .profile-copy strong,
.account-panel .profile-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-panel .profile-copy strong {
  display: block;
  line-height: 1;
}

.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 0, rgba(20, 184, 166, 0.08), transparent 34%),
    var(--bg);
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px -36px rgba(15, 23, 42, 0.38);
}

.login-brand {
  display: grid;
  gap: 6px;
  margin-bottom: 24px;
}

.login-brand strong {
  color: var(--text);
  font-size: 24px;
  font-weight: var(--weight-bold);
  letter-spacing: 0;
}

.login-brand span,
.login-form label span,
.login-hint {
  color: var(--muted);
  font-size: var(--font-size-md);
}

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

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
}

.login-form input:focus {
  border-color: rgba(20, 184, 166, 0.48);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.login-form .btn {
  width: 100%;
  justify-content: center;
}

.login-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  line-height: var(--line-normal);
}

.login-hint code {
  padding: 2px 6px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.staff-filter {
  position: relative;
  flex: 0 0 220px;
  min-width: 220px;
  z-index: 30;
}

.staff-filter-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: var(--control-h);
  padding: 0 12px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: var(--weight-medium);
  text-align: left;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.staff-filter-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-filter-trigger svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
  stroke-width: 1.8;
}

.staff-filter.is-open .staff-filter-trigger {
  border-color: rgba(24, 184, 166, 0.42);
  box-shadow: 0 0 0 3px rgba(24, 184, 166, 0.12);
}

.staff-filter.is-open .staff-filter-trigger svg {
  transform: rotate(180deg);
}

.staff-filter-menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  width: 278px;
  max-height: min(430px, calc(100dvh - 130px));
  overflow: auto;
  padding: 6px 0;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.staff-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 6px 10px 6px 14px;
  color: var(--text-secondary);
  text-align: left;
  background: #fff;
  border: 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.72);
}

.staff-filter-row:last-child {
  border-bottom: 0;
}

.staff-filter-row:hover {
  background: #f8fbfd;
}

.staff-filter-row-group {
  min-height: 36px;
  font-weight: var(--weight-semibold);
}

.staff-filter-title,
.staff-filter-person-copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-filter-count {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: var(--weight-semibold);
}

.staff-filter-person {
  grid-template-columns: 26px minmax(0, 1fr) 24px;
  padding-left: 18px;
}

.staff-filter-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  color: #fff;
  font-size: 11px;
}

.staff-filter-person-copy {
  display: flex;
  align-items: center;
  min-width: 0;
}

.staff-filter-check {
  position: relative;
  width: 18px;
  height: 18px;
  margin-left: auto;
  background: #eef3f8;
  border: 1px solid #d6e0ea;
  border-radius: 5px;
}

.staff-filter-row.is-selected .staff-filter-check {
  background: var(--primary);
  border-color: var(--primary);
}

.sidebar {
  color: #64748b;
  background: #ffffff;
  border-right-color: #e7ecf3;
  box-shadow: none;
}

.sidebar-logo {
  position: relative;
  min-height: 64px;
}

.brand-title {
  color: #0f172a;
}

.brand-subtitle {
  color: #94a3b8;
}

.nav-item {
  color: #64748b;
}

.nav-item:hover {
  color: #334155;
  background: #f5f8fc;
}

.nav-item.is-active {
  color: #14b8a6;
  background: #eaf8f6;
}

.nav-chevron {
  color: #94a3b8;
}

.nav-item:hover .nav-chevron,
.nav-item.is-active .nav-chevron {
  color: #64748b;
}

.sidebar-subnav button {
  color: #94a3b8;
  border-left-color: #e7ecf3;
}

.sidebar-subnav button.is-active {
  color: #14b8a6;
  border-left-color: #14b8a6;
}

.collapse-link {
  color: #64748b;
}

.collapse-link:hover {
  color: #14b8a6;
  background: #eaf8f6;
}

.shell.is-sidebar-collapsed .sidebar {
  width: 68px;
  padding: 18px 8px 14px;
  overflow-x: hidden;
}

.shell.is-sidebar-collapsed .sidebar-logo {
  display: grid;
  min-height: 64px;
  padding: 0 0 18px;
  place-items: center;
}

.shell.is-sidebar-collapsed .sidebar-logo::before {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #ffffff;
  font-size: 14px;
  font-weight: var(--weight-bold);
  content: "P";
  background: #14b8a6;
  border-radius: 50%;
  box-shadow: none;
}

.shell.is-sidebar-collapsed .sidebar-logo > * {
  display: none;
}

.shell.is-sidebar-collapsed .sidebar-nav {
  align-content: start;
  gap: 6px;
}

.shell.is-sidebar-collapsed .nav-item {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 38px;
  padding: 0;
}

.shell.is-sidebar-collapsed .nav-item > span:not(.nav-icon),
.shell.is-sidebar-collapsed .sidebar-subnav,
.shell.is-sidebar-collapsed .nav-chevron,
.shell.is-sidebar-collapsed .collapse-link span {
  display: none;
}

.shell.is-sidebar-collapsed .collapse-link {
  justify-content: center;
  min-height: 38px;
  padding: 0;
}

/* Typography system */
:root {
  --type-body-size: var(--font-size-base);
  --type-body-line: var(--line-normal);
  --type-caption-size: var(--font-size-xs);
  --type-label-size: var(--font-size-sm);
  --type-control-size: var(--font-size-md);
  --type-menu-size: var(--font-size-md);
  --type-card-title-size: 15px;
  --type-page-title-size: var(--font-size-title);
  --type-section-title-size: var(--font-size-lg);
  --type-number-size: var(--font-size-xl);
  --button-h: 38px;
  --button-icon-size: 38px;
  --calendar-nav-size: 32px;
  --button-radius: 12px;
  --button-icon-radius: 10px;
  --button-padding-x: 12px;
  --button-gap: 8px;
  --button-font-size: var(--type-control-size);
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--font-ui);
}

body {
  font-size: var(--type-body-size);
  font-weight: var(--weight-regular);
  line-height: var(--type-body-line);
  font-variant-numeric: tabular-nums;
}

button,
input,
select,
textarea {
  font-size: var(--type-control-size);
  font-weight: var(--weight-regular);
  line-height: var(--line-compact);
  letter-spacing: 0;
}

strong,
b {
  font-weight: var(--weight-semibold);
}

.brand-title {
  font-size: var(--font-size-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--line-tight);
}

.brand-subtitle,
.profile-copy small,
.muted,
.empty,
.page-header p,
.client-section-card p,
.client-tab-head p,
.medical-card p,
.appointment-meta,
.master-hours,
.staff-filter-count,
.staff-filter-person-copy small {
  font-size: var(--type-label-size);
  font-weight: var(--weight-regular);
  line-height: var(--line-normal);
}

.topbar-name strong,
.profile-copy strong {
  font-size: var(--type-label-size);
  font-weight: var(--weight-semibold);
  line-height: var(--line-compact);
}

.nav-item {
  font-size: var(--type-menu-size);
  font-weight: var(--weight-medium);
  line-height: var(--line-compact);
}

.nav-item.is-active {
  font-weight: var(--weight-semibold);
}

.sidebar-subnav button {
  font-size: 12.5px;
  font-weight: var(--weight-medium);
  line-height: var(--line-compact);
}

.sidebar-subnav button.is-active {
  font-weight: var(--weight-semibold);
}

.page-title {
  font-size: var(--type-page-title-size);
  font-weight: var(--weight-semibold);
  line-height: var(--line-tight);
}

.journal-title {
  font-size: 16px;
  font-weight: var(--weight-semibold);
  line-height: var(--line-compact);
}

.schedule-heading,
.calendar-title,
.master-calendar-head strong,
.section-title,
.chart-card h2,
.client-section-card h3,
.client-tab-head h3,
.medical-card h3,
.settings-placeholder h3,
.regular-schedule-head h2,
.modal-header h2,
.master-modal-title h2,
.client-card-main h1 {
  font-weight: var(--weight-semibold);
  line-height: var(--line-tight);
}

.schedule-heading,
.calendar-title,
.master-calendar-head strong {
  font-size: var(--font-size-xl);
}

.schedule-corner {
  color: var(--text-secondary);
  font-size: var(--type-label-size);
  font-weight: var(--weight-semibold);
  line-height: var(--line-compact);
  text-transform: none;
  letter-spacing: 0;
}

.section-title,
.chart-card h2,
.client-section-card h3,
.client-tab-head h3,
.medical-card h3,
.settings-placeholder h3,
.regular-schedule-head h2 {
  font-size: var(--type-section-title-size);
}

.modal-header h2,
.master-modal-title h2,
.client-card-main h1 {
  font-size: var(--type-page-title-size);
}

.btn,
.compact-primary,
.client-tabs button,
.master-modal-tabs button,
.segmented button {
  font-size: var(--button-font-size);
  font-weight: var(--weight-semibold);
  line-height: var(--line-compact);
}

/* Button system */
.btn,
.compact-primary,
.calendar-nav,
.day-nav-btn,
.schedule-nav-btn,
.icon-only,
.date-inline,
.staff-filter-trigger,
.client-info-button,
.link-button {
  min-height: var(--button-h);
  border-radius: var(--button-radius);
}

.btn,
.compact-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--button-gap);
  min-width: auto;
  padding: 0 var(--button-padding-x);
  color: var(--text-primary);
  font-size: var(--button-font-size);
  font-weight: var(--weight-semibold);
  line-height: var(--line-compact);
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--border-light);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  border-color: #d8e1ec;
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary,
.btn.success {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(24, 184, 166, 0.14);
}

.btn.primary:hover,
.btn.success:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn.ghost {
  color: var(--text-secondary);
  background: transparent;
  border-color: transparent;
}

.btn.danger {
  color: var(--danger);
  background: #fff4f1;
  border-color: #f2c7bf;
}

.btn.primary,
.btn.success,
.compact-primary {
  min-width: auto;
}

.icon-only,
.day-nav-btn,
.schedule-nav-btn,
.date-inline {
  width: var(--button-icon-size) !important;
  min-width: var(--button-icon-size) !important;
  height: var(--button-icon-size);
  min-height: var(--button-icon-size);
  flex: 0 0 var(--button-icon-size);
  padding: 0;
  border-radius: var(--button-icon-radius);
}

.calendar-nav {
  width: var(--calendar-nav-size) !important;
  min-width: var(--calendar-nav-size) !important;
  height: var(--calendar-nav-size);
  min-height: var(--calendar-nav-size);
  flex: 0 0 var(--calendar-nav-size);
  padding: 0;
  border-radius: var(--button-icon-radius);
}

.btn svg,
.icon-only svg,
.day-nav-btn svg,
.schedule-nav-btn svg,
.calendar-nav svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.view-toolbar .toolbar-group,
.page-actions,
.client-base-toolbar,
.settings-service-filters,
.employees-filters {
  gap: var(--button-gap);
}

.toolbar-group .btn,
.view-toolbar .btn {
  min-width: auto;
}

.staff-filter {
  flex-basis: 200px;
  min-width: 200px;
}

.staff-filter-trigger {
  min-width: 0;
}

.select,
.input,
.textarea,
.medical-field input,
.medical-field select,
.medical-field textarea,
.staff-filter-trigger {
  font-size: var(--type-control-size);
  font-weight: var(--weight-regular);
  line-height: var(--line-compact);
}

.field label,
.medical-field label,
.schedule-edit-box > label,
.regular-schedule-box > label,
.master-schedule-timebox label,
.client-register-head,
.settings-table-head,
.service-master-head,
.status-badge {
  font-size: var(--type-caption-size);
  font-weight: var(--weight-semibold);
  line-height: var(--line-compact);
  letter-spacing: 0;
}

.master-name,
.appointment-client,
.client-register-person strong,
.settings-person strong,
.staff-filter-person-copy strong,
.service-master-row strong,
.timeline-title,
.client-filter-list strong,
.schedule-master-tooltip {
  font-size: var(--type-control-size);
  font-weight: var(--weight-semibold);
  line-height: var(--line-compact);
}

.time-head,
.time-slot,
.appointment-time,
.metric-value,
.schedule-cell strong,
.schedule-cell span,
.schedule-cell em,
.master-calendar-day small,
.calendar-day,
.client-card-metrics strong,
.stat-card strong {
  font-variant-numeric: tabular-nums;
}

.time-head,
.time-slot {
  font-size: var(--type-control-size);
  font-weight: var(--weight-medium);
  line-height: var(--line-compact);
}

.appointment-time,
.schedule-date-head span,
.schedule-cell span,
.schedule-cell em,
.master-calendar-day small {
  font-size: var(--type-caption-size);
  font-weight: var(--weight-regular);
}

.schedule-date-head strong {
  font-size: var(--font-size-lg);
  font-weight: var(--weight-semibold);
}

.schedule-cell strong {
  font-size: var(--font-size-sm);
  font-weight: var(--weight-semibold);
}

.calendar-day {
  font-size: var(--font-size-base);
  font-weight: var(--weight-regular);
}

.calendar-day.is-selected,
.calendar-day.is-today {
  font-weight: var(--weight-semibold);
}

.client-card-metrics strong,
.stat-card strong,
.metric-value {
  font-size: var(--type-number-size);
  font-weight: var(--weight-semibold);
  line-height: var(--line-tight);
}

.client-card-metrics span,
.stat-card span,
.stat-card small,
.dictionary-row small {
  font-size: var(--type-label-size);
  font-weight: var(--weight-regular);
  line-height: var(--line-normal);
}

.staff-filter-row-group {
  font-size: var(--type-control-size);
  font-weight: var(--weight-semibold);
}
