/* Eleven CRM Stylesheet */
.crm {
  min-height: 100vh;
  background: #fff;
  color: #222;
  font-family: Arial, Manrope, sans-serif;
}

.crm-shell {
  height: 100vh;
  min-height: 680px;
  display: grid;
  grid-template-columns: var(--sidebar-width, 252px) minmax(0, 1fr);
  grid-template-rows: 54px minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
  transition: grid-template-columns 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.crm-shell.sidebar-collapsed {
  --sidebar-width: 48px;
}

.crm-shell.sidebar-collapsed .crm-left {
  padding: 12px 6px;
  align-items: center;
  overflow: hidden;
}

/* Keep #sidebarSchedule container visible in collapsed state, only hide non-footer elements */
.crm-shell.sidebar-collapsed #sidebarSchedule {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  width: 100%;
  align-items: center;
}

.crm-shell.sidebar-collapsed #sidebarSchedule > :not(.crm-left-foot),
.crm-shell.sidebar-collapsed .sidebar-schedule-content > :not(.crm-left-foot) {
  display: none !important;
}

.crm-shell.sidebar-collapsed .crm-left-foot {
  border-top: none;
  padding-top: 0;
  width: 100%;
  display: flex !important;
  justify-content: center;
}

.crm-shell.view-clients {
  --sidebar-width: 86px;
}

.crm-shell.view-clients .crm-left {
  padding: 0;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  overflow: hidden;
}

.crm-shell.view-clients #sidebarSchedule,
.crm-shell.view-clients #sidebarStaffNav,
.crm-shell.view-clients #sidebarFinanceNav {
  display: none !important;
}

.crm-shell.view-clients #sidebarClientsNav {
  display: flex !important;
}

.crm-shell.view-staff {
  --sidebar-width: 86px;
}

.crm-shell.view-staff .crm-left {
  padding: 0;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  overflow: hidden;
}

.crm-shell.view-staff #sidebarSchedule,
.crm-shell.view-staff #sidebarClientsNav,
.crm-shell.view-staff #sidebarFinanceNav {
  display: none !important;
}

.crm-shell.view-staff #sidebarStaffNav {
  display: flex !important;
}

.crm-shell.view-finance {
  --sidebar-width: 86px;
}

.crm-shell.view-finance .crm-left {
  padding: 0;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  overflow: hidden;
}

.crm-shell.view-finance #sidebarSchedule,
.crm-shell.view-finance #sidebarClientsNav,
.crm-shell.view-finance #sidebarStaffNav {
  display: none !important;
}

.crm-shell.view-finance #sidebarFinanceNav {
  display: flex !important;
}

.crm-shell:not(.view-clients):not(.view-no-sidebar) #sidebarClientsNav {
  display: none !important;
}

.crm-shell:not(.view-staff) #sidebarStaffNav {
  display: none !important;
}

.crm-shell:not(.view-finance) #sidebarFinanceNav {
  display: none !important;
}

.crm-shell.view-no-sidebar {
  --sidebar-width: 0px;
}

.crm-shell.view-no-sidebar .crm-left,
.crm-shell.view-no-sidebar #sidebarSchedule,
.crm-shell.view-no-sidebar #sidebarClientsNav,
.crm-shell.view-no-sidebar #sidebarStaffNav,
.crm-shell.view-no-sidebar #sidebarFinanceNav {
  display: none !important;
}

/* Explicit visibility guarantees for Schedule view */
.crm-shell:not(.view-clients):not(.view-staff):not(.view-finance):not(.view-no-sidebar) .crm-left {
  display: flex !important;
}

.crm-shell:not(.view-clients):not(.view-staff):not(.view-finance):not(.view-no-sidebar) #sidebarSchedule {
  display: flex !important;
}



/* Calendar Toggle Button in Schedule Toolbar (Removed per user request) */
.crm-btn-calendar-toggle {
  display: none !important;
}


.crm-appbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  background: #202020;
  color: #eee;
  padding: 0 16px;
  gap: 22px;
  z-index: 5;
  position: relative;
}

.crm-brand {
  height: 100%;
  width: 90px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-brand img {
  width: 26px;
  height: 36px;
  object-fit: contain;
}

.crm-brand span {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .12em;
}

/* CRM Navigation Sections Dropdown */
.crm-nav-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.crm-nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: #f2f2f2;
  font-family: var(--sans, 'Manrope', -apple-system, sans-serif);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  white-space: nowrap;
}

.crm-nav-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(200, 169, 110, 0.45);
  color: #ffffff;
}

.crm-nav-wrapper.open .crm-nav-trigger {
  background: rgba(200, 169, 110, 0.12);
  border-color: var(--gold, #c8a96e);
  color: #e5c98d;
  box-shadow: 0 0 14px rgba(200, 169, 110, 0.18);
}

.crm-nav-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold, #c8a96e);
  flex-shrink: 0;
}

.crm-nav-trigger-icon svg {
  display: block;
}

.crm-nav-trigger-text {
  letter-spacing: 0.01em;
}

.crm-nav-trigger-chevron {
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s;
  flex-shrink: 0;
}

.crm-nav-wrapper.open .crm-nav-trigger-chevron {
  transform: rotate(180deg);
  color: var(--gold, #c8a96e);
}

/* Dropdown Backdrop */
.crm-nav-dropdown-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.crm-nav-wrapper.open .crm-nav-dropdown-backdrop {
  display: block;
  opacity: 1;
}

/* Dropdown Card */
.crm-nav.crm-nav-dropdown {
  display: none !important;
  position: absolute !important;
  top: calc(100% + 8px) !important;
  left: 0 !important;
  min-width: 236px !important;
  background: #18191b !important;
  background: linear-gradient(180deg, #1d1e22 0%, #151618 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 10px !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65), 0 4px 12px rgba(0, 0, 0, 0.35) !important;
  padding: 6px !important;
  flex-direction: column !important;
  gap: 2px !important;
  z-index: 1000 !important;
  transform-origin: top left;
  box-sizing: border-box !important;
}

.crm-nav-wrapper.open .crm-nav.crm-nav-dropdown {
  display: flex !important;
  animation: crmNavFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

@keyframes crmNavFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Links inside dropdown */
.crm-nav.crm-nav-dropdown .crm-link {
  height: 38px;
  padding: 0 12px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c4c6ca;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--sans, 'Manrope', -apple-system, sans-serif);
  transition: all 0.16s ease;
  white-space: nowrap;
  box-sizing: border-box;
  background: transparent;
}

.crm-nav.crm-nav-dropdown .crm-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.crm-nav.crm-nav-dropdown .crm-link.active {
  background: rgba(200, 169, 110, 0.12);
  color: #e5c98d;
  font-weight: 600;
}

.crm-nav.crm-nav-dropdown .crm-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
  transition: color 0.16s ease;
}

.crm-nav.crm-nav-dropdown .crm-link:hover .crm-link-icon {
  color: #ffffff;
}

.crm-nav.crm-nav-dropdown .crm-link.active .crm-link-icon {
  color: var(--gold, #c8a96e);
}

.crm-nav.crm-nav-dropdown .crm-link-label {
  flex: 1;
}

.crm-nav.crm-nav-dropdown .crm-link-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold, #c8a96e);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.16s ease, transform 0.16s ease;
  flex-shrink: 0;
}

.crm-nav.crm-nav-dropdown .crm-link.active .crm-link-check {
  opacity: 1;
  transform: scale(1);
}

.crm-apps, .crm-settings, .crm-user {
  border: 0;
  color: #ddd;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.crm-account {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.crm-branch {
  width: 240px;
  height: 36px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #2a2a2a;
  color: #f1f1f1;
  padding: 0 10px;
  font-size: 13px;
}

.crm-user {
  height: 32px;
  width: 32px;
  border-radius: 8px;
  background: #a896de;
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.crm-logout-btn {
  background: transparent;
  border: 1px solid #444;
  color: #ccc;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.crm-logout-btn:hover {
  background: #8b2b2b;
  border-color: #a33;
  color: #fff;
}

/* Left Sidebar */
.crm-left {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e7eb;
  padding: 16px 16px 14px 18px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fbfbfc;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.crm-left::-webkit-scrollbar {
  width: 4px;
}

.crm-left::-webkit-scrollbar-track {
  background: transparent;
}

.crm-left::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  transition: background 0.15s ease;
}

.crm-left::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.6);
}

.sidebar-schedule-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}

.sidebar-calendar-widget {
  display: flex;
  flex-direction: column;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}

.mini-month {
  padding-bottom: 6px;
}

.mini-month + .mini-month {
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  margin-top: 6px;
}

.mini-month-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  height: 28px;
  padding: 0 2px;
}

.mini-month-head strong {
  color: #0284c7;
  font-size: var(--font-base, 15px);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
}

.mini-month-head button {
  border: 0;
  background: none;
  color: #64748b;
  font-size: 18px;
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.mini-month-head button:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.mini-head-spacer {
  width: 26px;
  height: 26px;
  display: inline-block;
}

.mini-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: var(--font-xs, 12px);
  font-weight: 500;
  color: #64748b;
  margin-bottom: 8px;
  text-transform: lowercase;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
}

.mini-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 5px;
  text-align: center;
}

.mini-days button {
  border: 1.5px solid transparent;
  background: none;
  border-radius: 8px;
  height: 30px;
  width: 30px;
  justify-self: center;
  font-size: var(--font-sm, 13.5px);
  font-weight: 500;
  color: #1e293b;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
}

.mini-days button.is-past {
  color: #64748b;
}

.mini-days button.outside {
  visibility: hidden;
  pointer-events: none;
}

.mini-days button:hover {
  background: #f1f5f9;
  color: #0284c7;
}

.mini-days button.is-selected {
  border-color: #38bdf8;
  color: #0284c7;
  font-weight: 700;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.08);
}

.mini-calendar-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.mini-calendar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 18px;
  border-radius: 9px;
  background: #f1f3f5;
  border: 0;
  cursor: pointer;
  color: #64748b;
  transition: background 0.15s, color 0.15s;
}

.mini-calendar-toggle-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.second-month {
  margin-top: 14px;
}

.crm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 7px 11px;
  margin-top: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.crm-search:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.crm-search-icon {
  flex-shrink: 0;
  color: #64748b;
}

.crm-search input {
  width: 100%;
  border: 0;
  outline: 0;
  font-size: var(--font-sm, 13.5px);
  font-weight: 500;
  color: #1e293b;
  background: transparent;
  padding: 0;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  letter-spacing: 0.01em;
}

.crm-search input::placeholder {
  color: #64748b;
  font-weight: 400;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
}

[hidden] {
  display: none !important;
}

.crm-search-clear {
  border: 0;
  background: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.crm-search-clear[hidden],
.crm-search-clear.hidden {
  display: none !important;
}

.crm-search-clear:hover {
  color: #475569;
  background: #f1f5f9;
}

.booking-card.is-dimmed {
  opacity: 0.18;
  filter: grayscale(0.6);
  pointer-events: none;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.booking-card.is-matched {
  box-shadow: 0 0 0 2px #0284c7, 0 4px 12px rgba(2, 132, 199, 0.25);
  z-index: 10;
  transition: box-shadow 0.2s ease;
}

.crm-side-summary {
  margin-top: 18px;
  font-size: var(--font-sm, 13px);
  font-weight: 500;
  color: #374151;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
}

.crm-side-summary > small {
  display: block;
  color: #4b5563;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
}

.crm-side-summary > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #f3f4f6;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
}

.crm-side-summary b {
  font-weight: 700;
  color: #0284c7;
  font-size: var(--font-sm, 13.5px);
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
}

.crm-side-summary b i {
  font-size: 12px;
  font-style: normal;
}

.crm-side-summary .unconfirmed b {
  color: #dc2626;
  font-weight: 700;
}

.crm-left-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.crm-sidebar-toggle {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
}

.crm-sidebar-toggle:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #111827;
  transform: scale(1.04);
}

.toggle-arrow {
  display: inline-block;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Schedule Main View */
#schedule,
#schedule button,
#schedule input,
#schedule select,
#schedule textarea,
#sidebarSchedule,
#sidebarSchedule button,
#sidebarSchedule input,
.schedule-toolbar,
.schedule-board,
.schedule-scroll,
.schedule-legend,
.schedule-date,
.staff-head,
.time-rail,
.booking-card,
.two-panel-modal,
.two-panel-modal button,
.two-panel-modal input,
.two-panel-modal select,
.two-panel-modal textarea,
#newAppointmentModal,
#appointmentDetailsModal,
#appointmentDetailsModal button,
.crm-drawer-panel,
.crm-drawer-panel button,
.crm-drawer-panel input,
.crm-drawer-panel select {
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}

.crm-main {
  grid-column: 2;
  grid-row: 2;
  padding: 0;
  overflow: hidden;
  min-width: 0;
  background: #fff;
}

.crm-view {
  height: 100%;
  overflow: auto;
  display: none;
}

.crm-view.active {
  display: block;
}

.schedule-toolbar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 14px;
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
}

.schedule-date {
  display: flex;
  align-items: center;
  gap: 16px;
}

.schedule-date h1 {
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: var(--font-xl, 20px);
  font-weight: 600;
  margin: 0;
  color: #1e293b;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.crm-view-heading h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: #252525;
}

.toolbar-divider {
  display: inline-block;
  height: 18px;
  width: 1px;
  background: #d4d4d8;
  vertical-align: middle;
}

.cash-total {
  border: 0;
  background: none;
  color: #0073cc;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 6px;
  border-radius: 4px;
  line-height: 1;
  vertical-align: middle;
  transition: background 0.15s, color 0.15s;
}

.cash-total:hover {
  background: #f0f7fc;
  color: #0f68a3;
}

.cash-amount {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}

.cash-chevron {
  width: 10px;
  height: 6px;
  stroke: #71717a;
  stroke-width: 1.8;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  transition: transform 0.2s ease, stroke 0.15s;
}

.cash-total:hover .cash-chevron {
  stroke: #0073cc;
}

.cash-total.active .cash-chevron,
.cash-total[aria-expanded="true"] .cash-chevron {
  transform: rotate(180deg);
}

.schedule-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-schedule-sale {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  height: 32px !important;
  padding: 0 16px !important;
  background: #008be3 !important;
  background-color: #008be3 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 4px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  font-family: inherit !important;
  transition: background 0.15s ease, transform 0.05s ease !important;
  white-space: nowrap !important;
}

.btn-schedule-sale:hover {
  background: #0077c2 !important;
  background-color: #0077c2 !important;
}

.btn-schedule-sale:active {
  transform: translateY(1px) !important;
}

.btn-schedule-sale-plus {
  font-size: 16px !important;
  line-height: 1 !important;
  font-weight: 600 !important;
}

.schedule-view-mode-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  padding: 2px;
  height: 32px;
  box-sizing: border-box;
  margin-left: 8px;
}

.view-mode-btn {
  border: 0;
  background: transparent;
  color: #4b5563;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 13px;
  font-weight: 500;
  padding: 0 14px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.view-mode-btn:hover:not(.active) {
  background: #f3f4f6;
  color: #111827;
}

.view-mode-btn.active {
  background: #f4c301;
  color: #111827;
  font-weight: 600;
}

.crm-ghost {
  background: white;
  border: 1px solid #ddd;
  color: #555;
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: var(--font-sm, 13px);
  font-weight: 500;
  cursor: pointer;
}

.crm-ghost:hover {
  background: #f5f5f5;
}

.crm-add {
  background: #147bc0;
  border: 0;
  border-radius: 6px;
  color: white;
  padding: 9px 15px;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: var(--font-sm, 13.5px);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background .2s, transform .1s;
}

.crm-add:hover {
  background: #0f68a3;
  transform: translateY(-1px);
}

.schedule-scroll {
  height: 100%;
  overflow: auto;
  position: relative;
}

/* Schedule Content Layout with Right Sidebar for Day-Off Staff */
.schedule-content-wrap {
  display: flex;
  height: calc(100% - 102px);
  width: 100%;
  overflow: hidden;
  position: relative;
}

.schedule-content-wrap > .schedule-scroll,
.schedule-content-wrap > .schedule-week-scroll,
.schedule-content-wrap > .schedule-month-scroll {
  flex: 1 1 0%;
  min-width: 0;
  height: 100% !important;
  overflow: auto;
  position: relative;
}

/* Narrow Right Action & Staff Rail (Altegio style) */
.schedule-right-rail {
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  height: 100%;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 16px 0;
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 20;
  overflow-y: auto;
  overflow-x: hidden;
}

.rail-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.rail-btn-plus {
  width: 38px;
  height: 38px;
  background: #008be3;
  border-radius: 8px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 139, 227, 0.25);
  transition: background 0.15s ease, transform 0.1s ease;
  padding: 0;
}

.rail-btn-plus:hover {
  background: #007bc7;
  transform: translateY(-1px);
}

.rail-btn-plus:active {
  transform: translateY(0);
}

.rail-btn-action {
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  padding: 0;
  transition: background 0.15s ease;
}

.rail-btn-action:hover {
  background: #f1f5f9;
}

.rail-btn-action.is-active {
  background: #e0f2fe;
}

.rail-btn-action.is-active svg {
  stroke: #008be3;
}

.rail-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #008be3;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  padding: 0 3px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-sizing: border-box;
  line-height: 1;
}

.rail-bottom-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
}

.rail-divider {
  width: 34px;
  height: 1px;
  background: #e2e8f0;
  margin: 0 0 12px 0;
  flex-shrink: 0;
}

.rail-staff-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.rail-staff-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 52px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease;
  text-align: center;
}

.rail-staff-item:hover {
  transform: translateY(-1px);
}

.rail-staff-avatar {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  border: 1.5px solid #e2e8f0;
  background: #f1f5f9;
  margin-bottom: 3px;
}

.rail-staff-name {
  font-family: var(--font-primary, Arial, sans-serif);
  font-size: 10.5px;
  color: #334155;
  font-weight: 500;
  line-height: 1.2;
  max-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.rail-staff-role {
  font-size: 9.5px;
  color: #94a3b8;
  line-height: 1.1;
  max-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  font-weight: 400;
}

/* Cancelled Appointments Flyout Drawer */
.schedule-flyout-drawer {
  width: 270px;
  min-width: 270px;
  max-width: 270px;
  height: 100%;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 15;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.04);
}

.schedule-flyout-drawer[hidden] {
  display: none !important;
}

.flyout-drawer-header {
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid #f1f3f5;
  background: #ffffff;
}

.flyout-drawer-title-wrap {
  display: flex;
  flex-direction: column;
}

.flyout-drawer-title {
  font-family: var(--font-primary, Arial, sans-serif);
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  line-height: 1.2;
}

.flyout-drawer-subtitle {
  font-size: 12px;
  color: #64748b;
  font-weight: 400;
  margin-top: 3px;
}

.flyout-drawer-close {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #64748b;
  border-radius: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}

.flyout-drawer-close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.flyout-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fafbfc;
}

.cancelled-card {
  background: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.cancelled-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.cancelled-card-head {
  background: #f1f3f5;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
}

.cancelled-card-time {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
}

.cancelled-card-info-btn {
  background: transparent;
  border: none;
  padding: 0;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.cancelled-card-info-btn:hover {
  color: #1e293b;
}

.cancelled-card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cancelled-card-client {
  font-family: var(--font-primary, Arial, sans-serif);
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.25;
}

.cancelled-card-phone {
  font-size: 12px;
  color: #475569;
}

.cancelled-card-master {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
}

.cancelled-card-status {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.schedule-board {
  min-width: 1330px;
}

.staff-head {
  height: 70px;
  display: grid;
  grid-template-columns: 48px repeat(7, minmax(150px, 1fr)) 48px;
  position: sticky;
  top: 0;
  background: white;
  z-index: 3;
  border-bottom: 1px solid #ddd;
}

.time-head {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.time-head-right {
  border-left: 1px solid #eee;
}

.staff-head-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  min-width: 0;
  border-left: 1px solid #eee;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.staff-head-cell:hover {
  background: #f8fafc;
}

.staff-head-cell.is-active {
  background: #f0f7fc;
  box-shadow: inset 0 -3px 0 #008be3;
}

.staff-head-cell img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50% !important;
  transition: box-shadow 0.15s ease;
}

.staff-head-cell.is-active img {
  box-shadow: 0 0 0 2px #008be3 !important;
  border-radius: 50% !important;
}

.staff-head-cell strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: var(--font-sm, 13.5px);
  font-weight: 600;
  color: #1e293b;
  line-height: 1.25;
  transition: color 0.15s ease;
}

.staff-head-cell.is-active strong {
  color: #007ac7;
  font-weight: 700;
}

.staff-head-cell small {
  display: block;
  color: #64748b;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 11px;
  font-weight: 400;
  margin-top: 2px;
  line-height: 1.2;
}

.staff-head-edit-shift-btn {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

.staff-head-cell:hover .staff-head-edit-shift-btn {
  opacity: 1;
}

.staff-head-edit-shift-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.schedule-body {
  display: grid;
  grid-template-columns: 48px repeat(7, minmax(150px, 1fr)) 48px;
  position: relative;
  min-height: 720px;
}

/* Current Time Red Indicator (Image 1) */
.current-time-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  z-index: 25;
  pointer-events: none;
  display: flex;
  align-items: center;
  transition: top 0.3s ease;
  grid-column: 1 / -1;
  grid-row: 1;
}

.current-time-badge {
  position: absolute;
  left: 3px;
  width: 44px;
  height: 18px;
  background: #ff3b38;
  color: #ffffff;
  border-radius: 9px;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(255, 59, 56, 0.45);
  z-index: 2;
  letter-spacing: -0.01em;
}

.current-time-rule {
  position: absolute;
  left: 47px;
  right: 0;
  height: 1.5px;
  background: #ff3b38;
  box-shadow: 0 0 2px rgba(255, 59, 56, 0.4);
}

.time-rail {
  display: flex;
  flex-direction: column;
  user-select: none;
  background: #ffffff;
  border-right: 1px solid #ededed;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.time-rail .time-slot,
.time-rail div {
  height: 60px;
  flex: none;
  position: relative;
  box-sizing: border-box;
  border-bottom: 1px solid #e5e7eb;
}

.time-rail .time-hour {
  position: absolute;
  top: 1px;
  right: 8px;
  color: #64748b;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.time-rail .time-half {
  position: absolute;
  top: 30px;
  transform: translateY(-50%);
  right: 8px;
  color: #94a3b8;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: var(--font-2xs, 10px);
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* 30-minute tick on the right border */
.time-rail .time-slot::after,
.time-rail div::after {
  content: '';
  position: absolute;
  top: 30px;
  right: 0;
  width: 5px;
  height: 1px;
  background: #e2e8f0;
}

/* Hour tick at 0px on the right border */
.time-rail .time-slot::before,
.time-rail div::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 1px;
  background: #cbd5e1;
}

.schedule-column {
  position: relative;
  height: 720px;
  border-left: 1px solid #ededed;
  background-image: 
    linear-gradient(to bottom, transparent 29px, #f1f3f5 29px, #f1f3f5 30px, transparent 30px),
    linear-gradient(to bottom, transparent 59px, #e2e4e8 59px, #e2e4e8 60px);
  background-size: 100% 60px;
  background-repeat: repeat-y;
  cursor: pointer;
}

.slot-selection-indicator {
  position: absolute;
  left: 0;
  right: 0;
  height: 30px;
  background: #008be3;
  color: #ffffff;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: var(--font-xs, 12px);
  font-weight: 500;
  display: flex;
  align-items: center;
  padding-left: 8px;
  z-index: 10;
  pointer-events: none;
  box-sizing: border-box;
  animation: slotPulse 0.15s ease-out;
}

.slot-hover-indicator {
  position: absolute;
  left: 0;
  right: 0;
  height: 30px;
  background: rgba(0, 139, 227, 0.2);
  border: 1.5px solid #008be3;
  color: #007ac7;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  pointer-events: none;
  box-sizing: border-box;
  z-index: 2;
  box-shadow: 0 0 10px rgba(0, 139, 227, 0.22);
}

.slot-hover-indicator::after {
  content: '＋';
  font-size: 13px;
  font-weight: 800;
  color: #007ac7;
}

.slot-hover-indicator.is-unavailable {
  background: rgba(220, 38, 38, 0.12);
  border: 1.5px dashed #dc2626;
  color: #b91c1c;
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.2);
}

.slot-hover-indicator.is-unavailable::after {
  content: '⊘';
  color: #dc2626;
}

/* Unavailable / Non-working hours hatching pattern matching Altegio */
.schedule-unavailable-block {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  box-sizing: border-box;
  background-color: #efeae2;
  background-image: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 4px,
      rgba(168, 158, 142, 0.55) 4px,
      rgba(168, 158, 142, 0.55) 5.5px,
      transparent 5.5px,
      transparent 6px
    ),
    linear-gradient(to bottom, transparent 29px, #ded8ce 29px, #ded8ce 30px, transparent 30px),
    linear-gradient(to bottom, transparent 59px, #c8beaf 59px, #c8beaf 60px);
  background-size: auto, 100% 60px, 100% 60px;
  border-top: 1px solid #d5d0c7;
  border-bottom: 1px solid #d5d0c7;
  cursor: not-allowed;
  pointer-events: auto;
  transition: background-color 0.15s ease;
}

.schedule-unavailable-block:hover {
  background-color: #e8e2d8;
}

.time-rail .time-hour.is-time-slot-hovered,
.time-rail .time-half.is-time-slot-hovered,
.time-rail-right .time-hour.is-time-slot-hovered,
.time-rail-right .time-half.is-time-slot-hovered {
  color: #008be3 !important;
  font-weight: 800 !important;
}

@keyframes slotPulse {
  from { opacity: 0; transform: scaleY(0.9); }
  to { opacity: 1; transform: scaleY(1); }
}

.booking-card {
  position: absolute;
  left: 4px;
  right: 4px;
  top: var(--top);
  height: var(--duration);
  overflow: hidden;
  padding: 6px 10px;
  border-radius: 7px;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 11px;
  line-height: 1.35;
  z-index: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.booking-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  z-index: 4;
}

.booking-card.blue {
  background: #f0f7fc;
  border-left: 4px solid #1a82c4;
  color: #12344d;
}

.booking-card.green,
.booking-card.completed {
  background: #f0f9f1;
  border-left: 4px solid #2da44e;
  color: #143b1b;
}

.booking-card.red {
  background: #fdf2f2;
  border-left: 4px solid #cf222e;
  color: #4c1117;
}

.booking-card.gray,
.booking-card.expired {
  background: #f8fafc;
  border-left: 4px solid #94a3b8;
  color: #64748b;
  opacity: 0.88;
}

.booking-card.is-new {
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.booking-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  white-space: nowrap;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.booking-head-time-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.booking-badge-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #ffffff;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.45);
  flex-shrink: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.booking-card > strong {
  display: block;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: var(--font-xs, 12px);
  margin-top: 4px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.booking-card > span {
  display: block;
  margin-top: 2px;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 11px;
  font-weight: 400;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-legend {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  border-top: 1px solid #eee;
  color: #64748b;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 11.5px;
  font-weight: 500;
  background: #fafafa;
}

.schedule-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 11.5px;
}

.schedule-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-blue { background: #1a82c4; }
.legend-green { background: #2da44e; }
.legend-red { background: #cf222e; }
.legend-gray { background: #94a3b8; }

.crm-tools {
  display: none !important;
}

/* Week & Month Views in Schedule */
.schedule-week-scroll {
  height: calc(100% - 70px);
  overflow-y: auto;
  overflow-x: hidden !important;
  position: relative;
  background: #ffffff;
  width: 100%;
}

.schedule-month-scroll {
  height: calc(100% - 70px);
  overflow-y: auto;
  overflow-x: hidden !important;
  position: relative;
  background: #ffffff;
  width: 100%;
}

/* Time Rails (Left & Right) */
.time-rail-right {
  display: flex;
  flex-direction: column;
  user-select: none;
  background: #ffffff;
  border-left: 1px solid #ededed;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.time-rail-right .time-slot {
  height: 60px;
  flex: none;
  position: relative;
  box-sizing: border-box;
  border-bottom: 1px solid #e5e7eb;
}

.time-rail-right .time-hour {
  position: absolute;
  top: 1px;
  left: 8px;
  color: #64748b;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.time-rail-right .time-half {
  position: absolute;
  top: 30px;
  transform: translateY(-50%);
  left: 8px;
  color: #94a3b8;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.time-rail-right .time-slot::after {
  content: '';
  position: absolute;
  top: 30px;
  left: 0;
  width: 4px;
  height: 1px;
  background: #e2e8f0;
}

.time-rail-right .time-slot::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 1px;
  background: #cbd5e1;
}

/* Barbers Selector Bar (Shared across Week & Month) */
.schedule-barbers-bar {
  height: 64px;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 25;
  border-bottom: 1px solid #dcdcdc;
  width: 100%;
  box-sizing: border-box;
}

#weekBarbersBar {
  display: grid;
  grid-template-columns: 44px repeat(7, minmax(0, 1fr)) 44px;
}

#monthBarbersBar {
  display: grid;
  grid-template-columns: 36px repeat(7, minmax(0, 1fr)) 36px;
}

.barbers-bar-spacer {
  background: #ffffff;
}

.barber-select-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  min-width: 0;
  border-left: 1px solid #ededed;
  cursor: pointer;
  background: #ffffff;
  user-select: none;
  position: relative;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.barber-select-cell:hover {
  background: #f8fafc;
}

.barber-select-cell.is-active {
  background: #f0f7fc;
  box-shadow: inset 0 -3px 0 #008be3;
}

.barber-select-cell .barber-avatar-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50% !important;
  flex-shrink: 0;
  transition: box-shadow 0.15s ease;
}

.barber-select-cell.is-active .barber-avatar-img {
  box-shadow: 0 0 0 2px #008be3 !important;
  border-radius: 50% !important;
}

.barber-select-cell .barber-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.barber-select-cell strong,
.barber-select-cell .barber-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: var(--font-sm, 13.5px);
  font-weight: 600;
  color: #1e293b;
  line-height: 1.25;
  transition: color 0.15s ease;
}

.barber-select-cell.is-active strong,
.barber-select-cell.is-active .barber-name {
  color: #007ac7;
  font-weight: 700;
}

.barber-select-cell small,
.barber-select-cell .barber-role {
  display: block;
  color: #64748b;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 11px;
  font-weight: 400;
  margin-top: 2px;
  line-height: 1.2;
  white-space: nowrap;
}

/* Week Board (100% width, NO horizontal scroll) */
.schedule-week-board {
  width: 100%;
  min-width: 0 !important;
  position: relative;
}

.week-head {
  height: 50px;
  display: grid;
  grid-template-columns: 44px repeat(7, minmax(0, 1fr)) 44px;
  position: sticky;
  top: 64px;
  background: #ffffff;
  z-index: 20;
  border-bottom: 1px solid #dcdcdc;
  width: 100%;
  box-sizing: border-box;
}

.week-head-time {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", sans-serif);
  font-size: 11px;
  color: #888888;
  font-weight: 500;
  background: #ffffff;
}

.week-head-time:last-child {
  border-left: 1px solid #ededed;
}

.week-head-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 2px;
  border-left: 1px solid #ededed;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", sans-serif);
  cursor: pointer;
  user-select: none;
  min-width: 0;
  overflow: hidden;
  transition: background 0.15s ease;
}

.week-head-cell:hover {
  background: #f8fafc;
}

.week-head-cell .week-date-num {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.1;
  white-space: nowrap;
}

.week-head-cell .week-day-name {
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
  margin-top: 1px;
  white-space: nowrap;
}

.week-head-cell.is-weekend .week-date-num,
.week-head-cell.is-weekend .week-day-name {
  color: #ef4444;
}

.week-head-cell.is-today {
  background: #f0f7fc;
}

.week-head-cell.is-today .week-date-num {
  color: #0073cc;
}

.week-body {
  display: grid;
  grid-template-columns: 44px repeat(7, minmax(0, 1fr)) 44px;
  position: relative;
  min-height: 720px;
  width: 100%;
  box-sizing: border-box;
}

.week-column {
  position: relative;
  height: 720px;
  border-left: 1px solid #ededed;
  min-width: 0;
  box-sizing: border-box;
  background-image: 
    linear-gradient(to bottom, transparent 29px, #f1f3f5 29px, #f1f3f5 30px, transparent 30px),
    linear-gradient(to bottom, transparent 59px, #e2e4e8 59px, #e2e4e8 60px);
  background-size: 100% 60px;
  background-repeat: repeat-y;
}

.week-column.is-today {
  background-color: rgba(240, 247, 252, 0.45);
}

.week-column.is-hatched {
  background-color: #fafbfc;
  background-image: 
    repeating-linear-gradient(45deg, rgba(220, 226, 235, 0.45), rgba(220, 226, 235, 0.45) 4px, transparent 4px, transparent 8px),
    linear-gradient(to bottom, transparent 29px, #f1f3f5 29px, #f1f3f5 30px, transparent 30px),
    linear-gradient(to bottom, transparent 59px, #e2e4e8 59px, #e2e4e8 60px);
  background-size: auto, 100% 60px, 100% 60px;
}

/* Month Timeline Board (100% width, NO horizontal scroll) */
.schedule-month-board {
  width: 100%;
  min-width: 0 !important;
  position: relative;
}

.month-head {
  height: 48px;
  display: grid;
  grid-template-columns: 36px repeat(31, minmax(0, 1fr)) 36px;
  position: sticky;
  top: 64px;
  background: #ffffff;
  z-index: 20;
  border-bottom: 1px solid #dcdcdc;
  width: 100%;
  box-sizing: border-box;
}

.month-head-time {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", sans-serif);
  font-size: 10px;
  color: #888888;
  font-weight: 500;
  background: #ffffff;
}

.month-head-time:last-child {
  border-left: 1px solid #ededed;
}

.month-head-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
  border-left: 1px solid #ededed;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", sans-serif);
  cursor: pointer;
  user-select: none;
  min-width: 0;
  overflow: hidden;
  transition: background 0.15s ease;
}

.month-head-cell:hover {
  background: #f8fafc;
}

.month-head-cell .month-date-num {
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.1;
  white-space: nowrap;
}

.month-head-cell .month-day-name {
  font-size: 9px;
  font-weight: 500;
  color: #64748b;
  margin-top: 1px;
  white-space: nowrap;
}

.month-head-cell.is-weekend .month-date-num,
.month-head-cell.is-weekend .month-day-name {
  color: #ef4444;
}

.month-head-cell.is-today {
  background: #f0f7fc;
}

.month-head-cell.is-today .month-date-num {
  color: #0073cc;
  font-weight: 700;
}

.month-body {
  display: grid;
  grid-template-columns: 36px repeat(31, minmax(0, 1fr)) 36px;
  position: relative;
  min-height: 720px;
  width: 100%;
  box-sizing: border-box;
}

.month-body .time-rail .time-hour {
  font-size: 9px;
  top: 1px;
  right: 5px;
  left: auto;
  text-align: right;
}

.month-body .time-rail .time-half {
  font-size: 8px;
  top: 30px;
  transform: translateY(-50%);
  right: 5px;
  left: auto;
  text-align: right;
}

.month-body .time-rail-right .time-hour {
  font-size: 9px;
  top: 1px;
  left: 5px;
  right: auto;
  text-align: left;
}

.month-body .time-rail-right .time-half {
  font-size: 8px;
  top: 30px;
  transform: translateY(-50%);
  left: 5px;
  right: auto;
  text-align: left;
}

.month-body .time-rail .time-slot::before {
  width: 4px;
}
.month-body .time-rail .time-slot::after {
  width: 3px;
}
.month-body .time-rail-right .time-slot::before {
  width: 4px;
}
.month-body .time-rail-right .time-slot::after {
  width: 3px;
}

#weekCurrentTimeLine .current-time-badge {
  width: 40px;
  height: 16px;
  font-size: 10px;
  line-height: 16px;
  left: 2px;
}

#weekCurrentTimeLine .current-time-rule {
  left: 42px;
}

#monthCurrentTimeLine .current-time-badge {
  width: 32px;
  height: 15px;
  font-size: 9px;
  line-height: 15px;
  left: 2px;
  border-radius: 7px;
}

#monthCurrentTimeLine .current-time-rule {
  left: 34px;
}

.month-column {
  position: relative;
  height: 720px;
  border-left: 1px solid #ededed;
  min-width: 0;
  box-sizing: border-box;
  background-image: 
    linear-gradient(to bottom, transparent 29px, #f1f3f5 29px, #f1f3f5 30px, transparent 30px),
    linear-gradient(to bottom, transparent 59px, #e2e4e8 59px, #e2e4e8 60px);
  background-size: 100% 60px;
  background-repeat: repeat-y;
  cursor: pointer;
}

.month-column:hover {
  background-color: rgba(240, 247, 252, 0.35);
}

.month-column.is-today {
  background-color: rgba(240, 247, 252, 0.45);
}

.month-column.is-weekend,
.month-column.is-hatched {
  background-color: #fafbfc;
  background-image: 
    repeating-linear-gradient(45deg, rgba(220, 226, 235, 0.45), rgba(220, 226, 235, 0.45) 4px, transparent 4px, transparent 8px),
    linear-gradient(to bottom, transparent 29px, #f1f3f5 29px, #f1f3f5 30px, transparent 30px),
    linear-gradient(to bottom, transparent 59px, #e2e4e8 59px, #e2e4e8 60px);
  background-size: auto, 100% 60px, 100% 60px;
}

/* Compact Booking Blocks for Month View */
.month-booking-card {
  position: absolute;
  top: var(--top, 0);
  height: var(--duration, 60px);
  left: 1px;
  right: 1px;
  border-radius: 2px;
  padding: 1px;
  font-size: 8px;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  line-height: 1;
}

.month-booking-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 5;
}

.month-booking-card.green,
.month-booking-card.completed {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
}

.month-booking-card.blue {
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  color: #075985;
}

.month-booking-card.red {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.month-booking-card.gray,
.month-booking-card.expired {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
}

.month-booking-card.is-new {
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.25);
}

.month-new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  color: #ffffff;
  background: #ef4444;
  padding: 1px 3px;
  border-radius: 2px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.45);
}

.month-card-icons {
  display: flex;
  gap: 2px;
  font-size: 9px;
  opacity: 0.85;
}

/* Day Summary Modal (Image 3) */
.day-summary-panel {
  width: min(780px, 96vw);
  max-width: 800px;
  padding: 24px 28px;
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
}

.day-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.day-summary-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}

.day-summary-close {
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.day-summary-close:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.day-summary-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.summary-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}

.summary-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.summary-box-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.summary-box-title-text {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.income-icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-head-val {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.summary-head-val.large {
  font-size: 18px;
}

.summary-box-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: #374151;
}

.sum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  line-height: 1.35;
}

.sum-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sum-count {
  color: #94a3b8;
  font-size: 11.5px;
}

.sum-val {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sum-val.green {
  color: #16a34a;
  font-weight: 500;
}

.sum-val.red {
  color: #ef4444;
  font-weight: 500;
}

.sum-val.blue {
  color: #0284c7;
  font-weight: 700;
}

.sum-val.gray {
  color: #64748b;
}

.sum-val.dark {
  color: #111827;
  font-weight: 600;
}

.sum-row-bold {
  font-weight: 700;
  font-size: 13.5px;
  color: #111827;
  margin-top: 2px;
}

.sum-hr {
  border: 0;
  border-top: 1px solid #f1f5f9;
  margin: 6px 0;
}

/* Donut chart */
.donut-chart-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0 16px;
  height: 130px;
}

.donut-svg {
  transform: rotate(-90deg);
}

.donut-center-info {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.donut-number {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

.donut-label {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

/* Full width bottom chart */
.summary-box-full {
  width: 100%;
}

.utilization-chart-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 6px;
}

.util-chart-svg {
  width: 100%;
  height: 160px;
  display: block;
}

/* Toast */
.crm-toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  top: 68px;
  padding: 14px 20px;
  background: #202020;
  color: #fff;
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  font-size: 13px;
  animation: slideInRight .25s ease both;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* CRM Modal Dialogs — Clean White Luxury Studio Aesthetic */
.crm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  place-items: center;
  padding: 20px;
}

.crm-modal-backdrop.open {
  display: grid !important;
}

.crm-modal-panel {
  background: #ffffff;
  color: #1f2937;
  width: min(520px, 100%);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  padding: 28px 32px;
  position: relative;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  animation: modalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modalEnter {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.crm-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.crm-modal-header h2 {
  font-family: var(--body, 'Manrope', sans-serif);
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: #111827;
  letter-spacing: -0.01em;
}

.crm-modal-close {
  background: transparent;
  border: 0;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.18s, transform 0.18s;
  padding: 4px;
  line-height: 1;
}

.crm-modal-close:hover {
  color: #111827;
  transform: scale(1.1);
}

.crm-form-group {
  margin-bottom: 16px;
}

.crm-form-group label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #4b5563;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.crm-form-group input,
.crm-form-group select,
.crm-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f9fafb;
  font-size: 13.5px;
  color: #111827;
  font-family: var(--body, 'Manrope', sans-serif);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.crm-form-group input:focus,
.crm-form-group select:focus,
.crm-form-group textarea:focus {
  background: #ffffff;
  border-color: var(--gold, #c98f4a);
  box-shadow: 0 0 0 3px rgba(201, 143, 74, 0.16);
  outline: none;
}

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

.crm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #f3f4f6;
  padding-top: 20px;
  margin-top: 24px;
}

.crm-btn-secondary {
  padding: 10px 18px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.crm-btn-secondary:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.crm-btn-primary {
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--gold, #c98f4a), var(--gold-light, #d3a568));
  border: 0;
  border-radius: 6px;
  color: #111315;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(201, 143, 74, 0.25);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s;
}

.crm-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(201, 143, 74, 0.35);
}

.crm-btn-danger {
  padding: 10px 18px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
}

.crm-btn-danger:hover {
  background: #fecaca;
}

.crm-btn-success {
  padding: 10px 18px;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 6px;
  color: #15803d;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
}

.crm-btn-success:hover {
  background: #bbf7d0;
}

/* Appointment Details Modal specifics */
.appointment-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #f3f4f6;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: var(--font-sm, 13.5px);
}

.appointment-detail-row span {
  color: #6b7280;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 13px;
  font-weight: 500;
}

.appointment-detail-row strong {
  color: #111827;
  text-align: right;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-weight: 600;
  font-size: var(--font-sm, 13.5px);
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 5px;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Новая: синяя */
.status-badge.new,
.status-badge.pending,
.status-badge.blue { 
  background: #e0f2fe; 
  border: 1px solid #7dd3fc; 
  color: #0369a1; 
}

/* Подтвержденная / Завершена: зеленая */
.status-badge.confirmed,
.status-badge.completed,
.status-badge.green { 
  background: #dcfce7; 
  border: 1px solid #86efac; 
  color: #15803d; 
}

/* Отмененная: красная */
.status-badge.cancelled,
.status-badge.red { 
  background: #fee2e2; 
  border: 1px solid #fca5a5; 
  color: #b91c1c; 
}

/* Не подтвержденная но время вышло: серая */
.status-badge.expired,
.status-badge.gray { 
  background: #f1f5f9; 
  border: 1px solid #cbd5e1; 
  color: #64748b; 
}

/* Shift management in staff view */
.staff-shift-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.staff-shift-toggle button {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 5px;
  border: 1px solid #ccc;
  background: #fff;
}

.staff-shift-toggle button.active-work {
  background: #d3ebd3;
  color: #2b662d;
  border-color: #6fba72;
  font-weight: 600;
}

.staff-shift-toggle button.active-dayoff {
  background: #ffd4d4;
  color: #a94442;
  border-color: #ed8585;
  font-weight: 600;
}

/* ==========================================================================
   Two-Panel New Appointment Modal (Yclients Studio Style)
   ========================================================================== */

.crm-modal-panel.two-panel-modal {
  width: min(1120px, 96vw);
  max-width: 1140px;
  height: min(760px, 92vh);
  max-height: 92vh;
  padding: 0;
  background: #ffffff;
  border-radius: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28), 0 4px 16px rgba(0, 0, 0, 0.08);
}

.two-panel-col {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  min-width: 0;
}

.two-panel-col.left-col {
  border-right: 1px solid #e5e7eb;
  background: #ffffff;
  min-width: 0;
  overflow: hidden;
}

.two-panel-col.right-col {
  background: #ffffff;
  min-width: 0;
}

/* Modal Headers */
.modal-col-header {
  height: 54px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f0f1f3;
  background: #ffffff;
  flex: none;
}

.modal-col-header h2 {
  font-size: 16.5px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.two-panel-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.two-panel-close-btn:hover {
  color: #111827;
  background: #f3f4f6;
}

/* Scrollable Form Body */
.new-apt-form {
  display: flex;
  flex-direction: column;
  height: calc(100% - 52px);
  overflow: hidden;
  width: 100%;
}

.modal-col-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

/* Form Row Styles */
.form-section-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.row-label {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  width: 52px;
  flex: none;
}

/* Row 1: Визит */
.visit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.visit-time-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.time-prefix {
  font-size: 13.5px;
  color: #6b7280;
}

.time-input {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  height: 36px;
  padding: 0 8px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  font-weight: 500;
  width: 96px;
  min-width: 96px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
}

.time-input:focus {
  outline: none;
  border-color: #008be3;
  box-shadow: 0 0 0 2px rgba(0, 139, 227, 0.15);
}

.custom-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
}

.time-end-select {
  appearance: none;
  -webkit-appearance: none;
  background: #f0f7fc;
  border: 1px solid #cce5f7;
  border-radius: 6px;
  height: 36px;
  line-height: 34px;
  padding: 0 26px 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: #008be3;
  cursor: pointer;
  max-width: 145px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
}

.custom-select-wrap .select-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #008be3;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Master Chip */
.visit-master-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  height: 36px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  margin-left: auto;
  min-width: 0;
  max-width: 180px;
  flex-shrink: 1;
  box-sizing: border-box;
}

.visit-master-chip:hover {
  background: #f3f4f6;
}

.visit-master-chip img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  background: #e5e7eb;
  flex: none;
}

.master-chip-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
}

.master-chip-text strong {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.master-chip-text small {
  font-size: 11.5px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.master-hidden-select {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}

.chip-lock-icon {
  font-size: 13px;
  color: #008be3;
  margin-left: 2px;
  flex: none;
}

/* Row 2: Клиент */
.client-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.client-inputs-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}

.client-name-input {
  flex: 1 1 0%;
  min-width: 0;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  box-sizing: border-box;
}

.client-name-input:focus,
.client-phone-input:focus {
  outline: none;
  border-color: #008be3;
  box-shadow: 0 0 0 2px rgba(0, 139, 227, 0.15);
}

.client-phone-input {
  flex: 1.25 1 0%;
  min-width: 0;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  box-sizing: border-box;
}

.discount-input-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0 6px;
  height: 36px;
  background: #fff;
  flex: none;
  box-sizing: border-box;
}

.discount-input-wrap input {
  width: 28px;
  border: none;
  text-align: center;
  font-size: 14px;
  padding: 0;
  outline: none;
  color: #111827;
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
}

.discount-input-wrap input::-webkit-outer-spin-button,
.discount-input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.discount-input-wrap span {
  font-size: 13px;
  color: #6b7280;
  user-select: none;
}

.btn-client-card {
  width: 36px;
  height: 36px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #008be3;
  flex: none;
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s;
}

.btn-client-card:hover {
  background: #f0f7fc;
  border-color: #008be3;
}

/* Row 3: Услуги */
.services-section {
  border-top: 1px solid #f3f4f6;
  padding-top: 12px;
}

.services-empty-state {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-blue-link {
  background: none;
  border: none;
  color: #008be3;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.btn-blue-link:hover {
  text-decoration: underline;
  color: #0070b8;
}

.btn-blue-link-sm {
  background: none;
  border: none;
  color: #008be3;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.btn-blue-link-sm:hover {
  text-decoration: underline;
}

.services-table-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.services-table-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px 36px 44px 68px 40px;
  gap: 4px;
  align-items: center;
  font-size: 11px;
  color: #6b7280;
  padding-bottom: 4px;
  border-bottom: 1px solid #f3f4f6;
  min-width: 0;
}

.services-table-head .col-title {
  font-weight: 600;
  color: #111827;
  font-size: 13px;
  min-width: 0;
}

.services-table-head .col-action {
  text-align: right;
}

.services-table-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.service-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px 36px 44px 68px 40px;
  gap: 4px;
  align-items: center;
  font-size: 12px;
  min-width: 0;
}

.service-table-row .service-info {
  min-width: 0;
}

.service-table-row .service-info strong {
  display: block;
  font-size: 12px;
  color: #111827;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-table-row .service-info span {
  font-size: 10px;
  color: #6b7280;
}

.service-table-row input {
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 11px;
  text-align: right;
  width: 100%;
  box-sizing: border-box;
}

.service-table-row .row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.row-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  color: #9ca3af;
  font-size: 12px;
  border-radius: 4px;
}

.row-action-btn:hover {
  color: #dc2626;
}

/* Products Row */
.products-row {
  border-top: 1px solid #f3f4f6;
  padding-top: 14px;
  justify-content: space-between;
}

.btn-blue-link {
  background: none;
  border: none;
  color: #008be3;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.btn-blue-link:hover {
  text-decoration: underline;
  color: #0070b8;
}

.btn-blue-link-sm {
  background: none;
  border: none;
  color: #008be3;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.btn-blue-link-sm:hover {
  text-decoration: underline;
  color: #0070b8;
}

/* Reminders & Rebooking Sections */
.reminder-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid #f3f4f6;
  padding-top: 14px;
}

.reminder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reminder-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #111827;
}

.pills-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.extra-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
}

.extra-pills-row[hidden] {
  display: none !important;
}

.pill-btn {
  background: #f3f4f6;
  border: 1px solid transparent;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  border-radius: 16px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.pill-btn:hover {
  background: #e5e7eb;
}

.pill-btn.active {
  background: #f0f7fc;
  border-color: #008be3;
  color: #008be3;
  font-weight: 600;
}

/* Comment Section */
.comment-section {
  border-top: 1px solid #f3f4f6;
  padding-top: 14px;
}

.comment-textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: #111827;
  font-family: inherit;
  resize: none;
  min-height: 60px;
}

.comment-textarea:focus {
  outline: none;
  border-color: #008be3;
  box-shadow: 0 0 0 2px rgba(0, 139, 227, 0.15);
}

/* Left Bottom Footer */
.modal-col-footer {
  height: 60px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  border-top: 1px solid #f0f1f3;
  background: #ffffff;
  flex: none;
  box-sizing: border-box;
}

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

.total-price-display {
  font-size: 21px;
  font-weight: 700;
  color: #111827;
}

.btn-primary-blue {
  background: #008be3;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 10px 30px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary-blue:hover {
  background: #007ac7;
}

/* Right Panel: Service Catalog & Search */
.catalog-search-bar {
  display: flex;
  padding: 12px 22px;
  background: #ffffff;
  border-bottom: 1px solid #f0f1f3;
  flex: none;
  box-sizing: border-box;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  padding: 0 12px;
  width: 100%;
  box-sizing: border-box;
}

.search-input-wrap .search-icon {
  color: #9ca3af;
  font-size: 15px;
  margin-right: 8px;
}

.search-input-wrap input {
  border: none;
  padding: 9px 0;
  font-size: 14px;
  color: #111827;
  width: 100%;
  outline: none;
}

.barcode-scan-btn {
  background: none;
  border: none;
  color: #6b7280;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* Catalog Scrollable Accordion */
.catalog-accordion-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
}

.catalog-group {
  display: flex;
  flex-direction: column;
}

.catalog-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #374151;
  text-transform: uppercase;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.catalog-group-head:hover {
  color: #111827;
}

.catalog-group-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.catalog-subgroup {
  display: flex;
  flex-direction: column;
}

.catalog-subgroup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  font-weight: 600;
  color: #4b5563;
  padding: 9px 0;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.catalog-subgroup-head:hover {
  color: #111827;
}

.catalog-group-head .chevron,
.catalog-subgroup-head .chevron {
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.catalog-group.is-collapsed .catalog-group-head .chevron,
.catalog-subgroup.is-collapsed .catalog-subgroup-head .chevron {
  transform: rotate(180deg);
}

.catalog-group.is-collapsed .catalog-group-body {
  display: none;
}

.catalog-subgroup.is-collapsed .catalog-service-list {
  display: none;
}

.catalog-service-list {
  display: flex;
  flex-direction: column;
}

.catalog-service-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 12px;
  border-bottom: 1px solid #f3f4f6;
  border-radius: 6px;
  transition: background 0.15s;
}

.catalog-service-item:hover {
  background: #f9fafb;
}

.catalog-service-item.is-selected {
  background: #e6f4fc;
}

.service-item-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.service-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.catalog-service-item.is-selected .service-item-title {
  color: #008be3;
}

.service-item-details {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #6b7280;
}

.btn-add-service-circle {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #cce5f7;
  background: #fff;
  color: #008be3;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-add-service-circle:hover {
  background: #008be3;
  color: #fff;
}

/* Selected Service Qty Controls (Screenshot 4) */
.service-selected-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-trash-service {
  background: none;
  border: none;
  cursor: pointer;
  color: #008be3;
  font-size: 15px;
  padding: 2px 4px;
  border-radius: 4px;
}

.btn-trash-service:hover {
  color: #dc2626;
}

.service-selected-qty {
  font-size: 13.5px;
  font-weight: 600;
  color: #111827;
  min-width: 16px;
  text-align: center;
}

/* Right Bottom Footer */
.modal-col-footer.right-footer {
  justify-content: space-between;
  font-size: 13.5px;
  color: #6b7280;
}

.footer-metrics {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 600;
  font-size: 14px;
  color: #111827;
}

/* Responsive collapse for small screens */
@media (max-width: 860px) {
  .crm-modal-panel.two-panel-modal {
    grid-template-columns: 1fr;
    height: 94vh;
    overflow-y: auto;
  }
}

/* ==========================================================================
   Schedule & Clients Sub-Navbars in .crm-left
   ========================================================================== */
.sidebar-schedule-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-clients-nav {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #fff;
  border-right: 1px solid #e2e8f0;
}

.clients-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 18px 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #334155;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  text-decoration: none;
  outline: none;
}

.clients-nav-item:hover {
  background: #f8fafc;
}

.clients-nav-item.active {
  background: #eaf4fc;
  color: #008be3;
  border-top: 1px solid #cce5f7;
  border-bottom: 1px solid #cce5f7;
}

.clients-nav-icon {
  stroke: currentColor;
  flex-shrink: 0;
  transition: stroke 0.15s ease;
}

/* ==========================================================================
   Clients View Layout (Header, Search Bar, Table)
   ========================================================================== */
#clients {
  background: #fff;
}

.clients-view-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px 18px;
  background: #fff;
}

.clients-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.clients-subview[hidden] {
  display: none !important;
}

.clients-head-title-wrap {
  display: flex;
  flex-direction: column;
}

.clients-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 4px 0 0 0;
}

.clients-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-clients-report {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 4px;
  border: 1px solid #dcdfe4;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.3px;
}

.btn-clients-report:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.btn-clients-report:active {
  transform: scale(0.98);
}

.btn-clients-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 4px;
  border: 1px solid #dcdfe4;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clients-back:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-clients-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #22c55e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(34, 197, 94, 0.2);
}

.btn-clients-export:hover {
  background: #16a34a;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}

.btn-new-client {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #00a6ff;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 2px rgba(0, 166, 255, 0.2);
}

.btn-new-client:hover {
  background: #0093e2;
}

.btn-new-client:active {
  transform: scale(0.98);
}

.clients-search-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px 24px;
  background: #fff;
  flex-wrap: wrap;
}

.client-filter-input {
  height: 40px;
  width: 250px;
  border: 1px solid #dcdfe4;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 14px;
  color: #1e293b;
  outline: none;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.client-filter-input:focus {
  border-color: #00a6ff;
  box-shadow: 0 0 0 3px rgba(0, 166, 255, 0.15);
}

.client-filter-input::placeholder {
  color: #94a3b8;
}

.btn-clients-search {
  height: 40px;
  padding: 0 28px;
  background: #22c55e;
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn-clients-search:hover {
  background: #16a34a;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.btn-clients-search:active {
  transform: scale(0.98);
}

.clients-results-section {
  padding: 0 28px 28px;
}

.clients-results-section[hidden] {
  display: none !important;
}

.clients-results-header {
  margin-bottom: 14px;
}

.clients-results-count {
  font-size: 20px;
  font-weight: 500;
  color: #1e293b;
  margin: 0;
  letter-spacing: -0.2px;
}

.clients-table-card {
  margin: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.sonline-clients-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  color: #334155;
  background: #ffffff;
}

.sonline-clients-table thead th {
  background: #ffffff;
  color: #1e293b;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 12px 14px;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.sonline-clients-table thead th:last-child {
  border-right: none;
}

.sonline-clients-table tbody td {
  padding: 12px 14px;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  font-size: 13px;
  vertical-align: middle;
  white-space: nowrap;
}

.sonline-clients-table tbody td:last-child {
  border-right: none;
}

.sonline-clients-table tbody tr {
  transition: background 0.12s ease;
}

.sonline-clients-table tbody tr:hover {
  background: #f8fafc;
}

.sonline-clients-table .client-table-link {
  color: #0070ba;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.sonline-clients-table .client-table-link:hover {
  color: #004b7c;
}

.sonline-clients-table .text-center {
  text-align: center;
}

.sonline-clients-table .text-right {
  text-align: right;
}

/* ==========================================================================
   Clients Reports Sub-View
   ========================================================================== */
.clients-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 0 28px 24px;
}

@media (max-width: 1024px) {
  .clients-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.clients-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.clients-kpi-card .kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.clients-kpi-card .kpi-val {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 6px;
  letter-spacing: -0.5px;
}

.clients-kpi-card .kpi-val-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
}

.clients-kpi-card .kpi-badge {
  background: #e0f2fe;
  color: #0284c7;
  font-size: 12.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.clients-kpi-card .kpi-desc {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.clients-report-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 28px 28px;
}

.clients-report-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.report-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.report-card-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.report-card-hint {
  font-size: 12px;
  color: #94a3b8;
}

.segments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.segment-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.segment-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.segment-bullet {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bullet-vip { background: #8b5cf6; }
.bullet-regular { background: #00a6ff; }
.bullet-once { background: #22c55e; }
.bullet-none { background: #94a3b8; }

.segment-name {
  color: #1e293b;
  flex: 1;
  font-weight: 600;
}

.segment-count {
  font-weight: 700;
  color: #1e293b;
}

.segment-pct {
  color: #64748b;
  font-size: 12.5px;
  width: 48px;
  text-align: right;
  font-weight: 500;
}

.segment-bar-bg {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.segment-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.bar-vip { background: #8b5cf6; }
.bar-regular { background: #00a6ff; }
.bar-once { background: #22c55e; }
.bar-none { background: #cbd5e1; }

.clients-top-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.clients-top-table thead th {
  background: #f8fafc;
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #e2e8f0;
}

.clients-top-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.clients-top-table tbody tr:hover {
  background: #f8fafc;
}

.clients-top-table tbody tr:last-child td {
  border-bottom: none;
}

.client-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.rank-gold { background: #fef3c7; color: #b45309; }
.rank-silver { background: #f1f5f9; color: #475569; }
.rank-bronze { background: #ffedd5; color: #c2410c; }
.rank-default { background: transparent; color: #94a3b8; }

.client-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.client-table thead th {
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 14px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.client-table tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 14px;
  vertical-align: middle;
}

.client-table tbody tr {
  transition: background 0.12s ease;
}

.client-table tbody tr:hover {
  background: #f8fafc;
  cursor: pointer;
}

.client-table tbody tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   New Client Modal (Studio Matching Image 3)
   ========================================================================== */
.new-client-panel {
  width: 480px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border-radius: 8px;
  padding: 24px 28px 28px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
  border: 1px solid #e2e8f0;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.new-client-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.new-client-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.new-client-close-btn {
  background: none;
  border: none;
  color: #008be3;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  outline: none;
  transition: opacity 0.15s;
}

.new-client-close-btn:hover {
  opacity: 0.75;
}

.new-client-close-btn:focus,
.new-client-close-btn:focus-visible {
  outline: none;
}

.new-client-form-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}

.new-client-input {
  width: 100%;
  height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 15px;
  color: #1e293b;
  outline: none;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.new-client-input:focus {
  border-color: #008be3;
  box-shadow: 0 0 0 3px rgba(0, 139, 227, 0.15);
}

.new-client-input::placeholder {
  color: #94a3b8;
}

.new-client-form-footer {
  display: flex;
  justify-content: flex-start;
}

.btn-new-client-submit {
  height: 42px;
  padding: 0 30px;
  background: #22c55e;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn-new-client-submit:hover {
  background: #16a34a;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.btn-new-client-submit:active {
  transform: scale(0.98);
}

/* ==========================================================================
   Staff Navigation & Work Schedule (График работы)
   ========================================================================== */
.sidebar-staff-nav {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #fff;
  border-right: 1px solid #e2e8f0;
}

.staff-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 18px 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #334155;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  text-decoration: none;
  outline: none;
  text-align: center;
}

.staff-nav-item:hover {
  background: #f8fafc;
}

.staff-nav-item.active {
  background: #eaf4fc;
  color: #008be3;
  border-top: 1px solid #cce5f7;
  border-bottom: 1px solid #cce5f7;
}

.staff-nav-icon {
  stroke: currentColor;
  flex-shrink: 0;
  transition: stroke 0.15s ease;
}

/* Staff View Main Container */
#staff {
  background: #fff;
  overflow-y: auto;
}

.staff-view-container {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #fff;
}

.staff-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  background: #fff;
}

.staff-page-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.staff-page-title {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  letter-spacing: -0.3px;
}

.staff-help-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #008be3;
  background: transparent;
  color: #008be3;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

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

.staff-settings-btn {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.staff-settings-btn:hover {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
}

.btn-add-staff {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #008be3;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s;
  box-shadow: 0 1px 2px rgba(0, 139, 227, 0.2);
}

.btn-add-staff:hover {
  background: #007ac7;
}

.btn-add-staff:active {
  transform: scale(0.98);
}

/* Staff Filter Toolbar */
.staff-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.staff-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.staff-period-switcher {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 3px;
  gap: 2px;
}

.staff-period-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.staff-period-btn:hover {
  color: #0f172a;
}

.staff-period-btn.active {
  background: #facc15;
  color: #1e293b;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.staff-date-filter {
  display: flex;
  align-items: center;
  gap: 6px;
}

.staff-date-label {
  font-size: 13.5px;
  color: #64748b;
}

.staff-date-input-wrap {
  position: relative;
}

.staff-date-input {
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13.5px;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  outline: none;
  cursor: pointer;
}

.staff-date-input:focus {
  border-color: #008be3;
  box-shadow: 0 0 0 2px rgba(0, 139, 227, 0.15);
}

.staff-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.staff-search-icon {
  position: absolute;
  left: 10px;
  color: #94a3b8;
  pointer-events: none;
}

.staff-search-input {
  height: 36px;
  width: 190px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0 12px 0 32px;
  font-size: 13.5px;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, width 0.2s ease;
}

.staff-search-input:focus {
  border-color: #008be3;
  width: 220px;
  box-shadow: 0 0 0 2px rgba(0, 139, 227, 0.15);
}

.staff-search-input::placeholder {
  color: #94a3b8;
}

.btn-staff-show {
  height: 36px;
  padding: 0 18px;
  background: #008be3;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-staff-show:hover {
  background: #007ac7;
}

.staff-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.staff-sort-label {
  font-size: 13px;
  color: #64748b;
}

.staff-sort-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.staff-sort-select {
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0 32px 0 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  outline: none;
  line-height: 34px;
}

.staff-sort-select:focus {
  border-color: #008be3;
}

.staff-select-chevron {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 6px;
  color: #64748b;
}

.staff-select-chevron svg {
  display: block;
}

/* Schedule Matrix Layout */
.staff-schedule-matrix-wrapper {
  flex: 1 1 auto;
  padding: 0 24px;
  overflow: hidden;
}

.staff-schedule-matrix-scroll {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.staff-matrix-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: center;
  font-size: 13px;
}

/* Sticky column on left */
.staff-sticky-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 10;
  text-align: left;
  border-right: 1px solid #e2e8f0;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
  padding: 6px 14px;
}

/* Month header row */
.staff-month-cell {
  background: #f8fafc;
  color: #1e293b;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 8px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  text-align: left;
  padding-left: 14px;
}

/* Days header row */
.staff-day-cell {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  padding: 6px 2px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
  background: #fff;
}

.staff-day-cell.today-col {
  background: #eaf4fc;
}

.day-header-num {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.day-header-weekday {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
  margin-top: 2px;
}

/* Weekend red text (Saturday & Sunday)! */
.staff-day-cell.weekend .day-header-num,
.staff-day-cell.weekend .day-header-weekday {
  color: #ef4444 !important;
}

/* Count row */
.staff-count-row {
  background: #fff;
}

.staff-count-row .staff-sticky-col {
  font-weight: 600;
  font-size: 13px;
  color: #1e293b;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.staff-count-cell {
  padding: 10px 2px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.staff-count-cell.today-col {
  background: #f4f9fd;
}

/* Section Label */
.staff-section-row .staff-sticky-col {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #64748b;
  text-transform: uppercase;
  padding: 10px 14px;
  background: #fafafa;
  border-bottom: 1px solid #e2e8f0;
}

.staff-section-spacer {
  background: #fafafa;
  border-bottom: 1px solid #e2e8f0;
}

/* Master rows */
.staff-master-row:hover .staff-sticky-col,
.staff-master-row:hover td {
  background-color: #fafbfc;
}

.staff-master-row .staff-sticky-col {
  border-bottom: 1px solid #f1f5f9;
  padding: 8px 12px;
  background: #fff;
}

.master-info-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.master-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e2e8f0;
}

.master-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.master-name-text {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.master-role-text {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.2;
}

/* Shift cell */
.staff-shift-cell {
  padding: 4px 3px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f8fafc;
  vertical-align: middle;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.staff-shift-cell.today-col {
  background: rgba(234, 244, 252, 0.4);
}

.shift-pill-wrap {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.shift-pill {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  position: relative;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.shift-pill:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.shift-pill.pill-work {
  background: #22c55e;
  color: #ffffff;
}

.shift-subdash {
  font-size: 12px;
  line-height: 0.5;
  margin-top: 1px;
  font-weight: 800;
}

.shift-asterisk {
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 10px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 2px rgba(0,0,0,0.4);
}

.shift-empty-box {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-block;
  transition: background 0.15s ease;
}

.staff-shift-cell:hover .shift-empty-box {
  background: #f1f5f9;
}

.staff-shift-cell.force-tooltip,
.staff-shift-cell:hover {
  z-index: 50;
}

.staff-shift-cell.force-tooltip .shift-pill,
.staff-shift-cell:hover .shift-pill {
  box-shadow: 0 0 0 3px rgba(0, 139, 227, 0.4);
}

/* Tooltip popup */
.staff-shift-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #2b3544;
  color: #ffffff;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.staff-shift-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #2b3544;
}

.staff-shift-cell:hover .staff-shift-tooltip,
.staff-shift-cell.force-tooltip .staff-shift-tooltip {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(-50%) translateY(0) !important;
}

.tt-hours-text {
  font-weight: 600;
  letter-spacing: 0.3px;
  font-size: 13px;
}

.tt-bookings-text {
  font-size: 12px;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Footer & Legend */
.staff-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.staff-legend-list {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #475569;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-chip {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.chip-work { background: #22c55e; }
.chip-sick { background: #f87171; }
.chip-vacation { background: #38bdf8; }
.chip-business { background: #fbbf24; }
.chip-overtime { background: #fb923c; }
.chip-maternity { background: #f472b6; }
.chip-unpaid { background: #2dd4bf; }
.chip-absence { background: #475569; }

.legend-chip-symbol {
  font-weight: 800;
  font-size: 14px;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
}

.btn-staff-history {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #008be3;
  color: #008be3;
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-staff-history:hover {
  background: #eaf4fc;
}

/* ==========================================================================
   Staff Subviews (Кадры & Отчёты)
   ========================================================================== */
.staff-subview[hidden] {
  display: none !important;
}

.staff-subview.active {
  display: block;
}

/* --------------------------------------------------------------------------
   Кадры (Список сотрудников) Matching Screenshot 1
   -------------------------------------------------------------------------- */
.staff-roster-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px 16px;
  background: #fff;
}

.staff-roster-title {
  font-size: 20px;
  font-weight: 700;
  color: #2c5282;
  letter-spacing: 0.5px;
  margin: 0;
  text-transform: uppercase;
}

.btn-roster-add-staff {
  background: #5b9bd5;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s;
}

.btn-roster-add-staff:hover {
  background: #4a88c7;
}

.btn-roster-add-staff:active {
  transform: scale(0.98);
}

.staff-roster-toolbar {
  padding: 0 28px 18px;
  background: #fff;
}

.roster-radio-group {
  display: flex;
  align-items: center;
  gap: 20px;
}

.roster-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: #1e293b;
  cursor: pointer;
  user-select: none;
}

.roster-radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: #008be3;
  cursor: pointer;
}

.staff-roster-card {
  margin: 0 28px 28px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  overflow: hidden;
}

.staff-roster-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.staff-roster-table thead th {
  background: #eef2f6;
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid #cbd5e1;
  vertical-align: middle;
}

.roster-th-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roster-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.roster-th-select {
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0 22px 0 8px;
  font-size: 12.5px;
  color: #1e293b;
  background: #fff;
  appearance: none;
  cursor: pointer;
  outline: none;
}

.roster-th-select:focus {
  border-color: #008be3;
}

.roster-select-chevron {
  position: absolute;
  right: 6px;
  pointer-events: none;
  font-size: 10px;
  color: #64748b;
}

.staff-roster-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.staff-roster-table tbody tr:hover {
  background: #f8fafc;
}

.staff-name-link {
  color: #008be3;
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.staff-name-link:hover {
  color: #007ac7;
}

.roster-actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.roster-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.roster-action-btn:hover {
  background: #eaf4fc;
  border-color: #008be3;
  color: #008be3;
  transform: translateY(-1px);
}

.staff-roster-pagination {
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
  color: #64748b;
}

.roster-page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-weight: 700;
  color: #1e293b;
}

/* --------------------------------------------------------------------------
   Отчёты по сотрудникам Matching Screenshot 2
   -------------------------------------------------------------------------- */
.staff-report-toolbar-row1 {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 24px 14px;
  gap: 16px;
  flex-wrap: wrap;
}

.staff-report-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.staff-mode-switcher {
  display: inline-flex;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.staff-mode-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.staff-mode-btn.active {
  background: #facc15;
  color: #1e293b;
  font-weight: 700;
}

.staff-toggle-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.switch-label {
  font-size: 13px;
  color: #64748b;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .2s;
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #008be3;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

.staff-report-toolbar-row2 {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px 16px;
}

/* Report Financial Table */
.staff-report-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: right;
  font-size: 13px;
}

.staff-report-table thead th {
  background: #fff;
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.staff-report-table thead th.th-fio {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 10;
  border-right: 1px solid #e2e8f0;
  width: 220px;
  min-width: 220px;
}

.staff-report-table thead th.weekend {
  color: #ef4444 !important;
}

.staff-report-table thead th.today-col {
  background: #f0f9ff;
  border-top: 2px solid #008be3;
}

.staff-report-section-row td {
  background: #fafafa;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.staff-report-master-row td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
  white-space: nowrap;
}

.staff-report-master-row td.sticky-fio {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 5;
  border-right: 1px solid #e2e8f0;
}

.staff-report-master-row:hover td {
  background: #fafbfc;
}

.staff-report-master-row:hover td.sticky-fio {
  background: #fafbfc;
}

.staff-report-master-row td.today-col {
  background: rgba(240, 249, 255, 0.5);
}

.report-dash {
  color: #94a3b8;
  font-weight: 600;
}

.report-row-total {
  font-weight: 700;
  color: #0f172a;
}

/* Summary Row at bottom */
.staff-report-total-row td {
  background: #fefce8;
  font-weight: 700;
  font-size: 13.5px;
  color: #0f172a;
  padding: 14px;
  border-top: 2px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.staff-report-total-row td.sticky-fio {
  position: sticky;
  left: 0;
  background: #fefce8;
  z-index: 10;
  text-align: left;
  border-right: 1px solid #e2e8f0;
}

.staff-report-total-row td.today-col {
  background: #e0f2fe;
}

/* --------------------------------------------------------------------------
   Schedule Edit Slide-in Side Drawer (Matching Screenshot)
   -------------------------------------------------------------------------- */
html.no-transitions *,
html.no-transitions *::before,
html.no-transitions *::after {
  transition: none !important;
  animation: none !important;
}

.crm-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.crm-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.crm-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 90vw;
  background: #ffffff;
  z-index: 1050;
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.crm-drawer-panel.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.drawer-title {
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", sans-serif);
  font-size: var(--font-xl, 20px);
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  letter-spacing: -0.01em;
}

.drawer-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.drawer-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Selected Chips */
.sched-edit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sched-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f0f7ff;
  border: 1px solid #bae0fd;
  border-radius: 6px;
  padding: 6px 12px;
  color: #0284c7;
  font-size: 13px;
  font-weight: 600;
}

.chip-remove-btn {
  background: none;
  border: none;
  color: #0284c7;
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.chip-remove-btn:hover {
  opacity: 1;
}

/* Link Button */
.sched-link-btn {
  background: none;
  border: none;
  color: #008be3;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-align: left;
  align-self: flex-start;
  transition: color 0.15s ease;
}

.sched-link-btn:hover {
  color: #007ac7;
  text-decoration: underline;
}

/* Form Groups & Segmented Controls */
.sched-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sched-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 2px;
}

.sched-day-type-segmented {
  display: flex;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.sched-type-btn {
  flex: 1;
  padding: 9px 16px;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.sched-type-btn.active[data-type="work"] {
  background: #008be3;
  color: #ffffff;
  font-weight: 600;
}

.sched-type-btn.active[data-type="off"] {
  background: #dfb303;
  color: #111827;
  font-weight: 600;
}

/* Status Radio List for Day Off (Matching User Screenshot) */
.sched-status-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin: 24px 0 16px;
}

.sched-status-radio-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sched-status-radio-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: #374151;
  transition: color 0.15s ease;
}

.sched-status-radio-item input[type="radio"] {
  width: 22px;
  height: 22px;
  accent-color: #008be3;
  cursor: pointer;
  margin: 0;
}

.sched-status-radio-item:hover {
  color: #111827;
}

.sched-radio-text {
  font-size: 14px;
  font-weight: 400;
  color: inherit;
}

/* Matrix Pills for Non-Working Statuses */
.shift-pill.pill-off.pill-sick {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.shift-pill.pill-off.pill-vacation {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

.shift-pill.pill-off.pill-unpaid {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #b45309;
}

.shift-pill.pill-off.pill-trip {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #6d28d9;
}

.shift-pill.pill-off.pill-maternity {
  background: #fce7f3;
  border-color: #f472b6;
  color: #be185d;
}

.shift-pill.pill-off.pill-absent {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

/* Time Picker Row */
.sched-time-picker-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sched-time-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sched-time-select {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  height: 38px;
  min-width: 60px;
  padding: 0 24px 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: #0284c7;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.sched-time-select:focus {
  border-color: #008be3;
}

.sched-select-chevron {
  position: absolute;
  right: 8px;
  pointer-events: none;
  font-size: 10px;
  color: #0284c7;
}

.sched-time-colon {
  font-weight: 700;
  color: #64748b;
  font-size: 14px;
  margin: 0 1px;
}

.sched-time-dash {
  color: #64748b;
  font-size: 14px;
  margin: 0 6px;
  font-weight: 600;
}

/* Overtime switch */
.sched-overtime-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.sched-overtime-label {
  font-size: 13px;
  color: #334155;
  font-weight: 500;
}

.sched-add-interval-btn {
  margin-top: 10px;
}

/* Drawer Footer */
.drawer-footer {
  padding: 16px 28px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #fff;
}

.btn-drawer-cancel {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 9px 22px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-drawer-cancel:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-drawer-save {
  background: #008be3;
  border: none;
  color: #fff;
  padding: 9px 24px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-drawer-save:hover {
  background: #007ac7;
}

/* Selected Slot Highlight in Schedule Matrix */
.staff-shift-cell.is-editing-slot .shift-pill.pill-work,
.staff-shift-cell.is-editing-slot .shift-empty-box {
  background: #245e69 !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px #008be3;
  position: relative;
}

.staff-shift-cell.is-editing-slot .shift-pill.pill-work::after {
  content: '✓';
  position: absolute;
  right: 2px;
  bottom: 0px;
  font-size: 9px;
  color: #38bdf8;
  font-weight: 800;
}

/* ==========================================================================
   Appointments View (Записи) — Studio Analytics & Dashboard Matching Screenshot
   ========================================================================== */
.crm-view#appointments {
  background: #f8fafc;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.apts-view-container {
  padding: 20px 24px 40px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Header */
.apts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.apts-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.apts-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #008be3;
  letter-spacing: -0.2px;
}

.apts-help-btn {
  background: transparent;
  border: 1.5px solid #008be3;
  color: #008be3;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.apts-help-btn:hover {
  background: #008be3;
  color: #fff;
}

.apts-network-switch-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.apts-network-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

/* Clean Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #008be3;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

/* Toolbar */
.apts-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.apts-date-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.apts-date-prefix {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.apts-date-wrap {
  position: relative;
}

.apts-input-date {
  height: 36px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  color: #1e293b;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.apts-input-date:focus {
  border-color: #008be3;
  box-shadow: 0 0 0 2px rgba(0, 139, 227, 0.15);
}

.apts-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.apts-search-icon {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  pointer-events: none;
}

.apts-input-search {
  height: 36px;
  padding: 0 12px 0 34px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  color: #1e293b;
  min-width: 190px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.apts-input-search:focus {
  border-color: #008be3;
  box-shadow: 0 0 0 2px rgba(0, 139, 227, 0.15);
}

.apts-btn-refresh {
  height: 36px;
  width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.apts-btn-refresh:hover {
  background: #f1f5f9;
  color: #008be3;
  border-color: #94a3b8;
}

/* 4-Card Analytics Grid */
.apts-metrics-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .apts-metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .apts-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.apts-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eef2f6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}

.apts-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

/* Card 1: Total & Financial Breakdown */
.card-total-financial .apts-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.apts-card-big-num {
  font-size: 16px;
  font-weight: 700;
  color: #334155;
}

.apts-progress-bar-wrap {
  margin-bottom: 16px;
}

.apts-progress-bar {
  height: 10px;
  border-radius: 5px;
  background: #f1f5f9;
  display: flex;
  overflow: hidden;
  gap: 2px;
}

.p-seg {
  height: 100%;
  transition: width 0.3s ease;
}

.apts-progress-nums {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 0 2px;
}

.apts-fin-heading {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
}

.apts-fin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.apts-fin-row {
  display: flex;
  align-items: center;
  font-size: 12px;
  line-height: 1.35;
  color: #475569;
}

.apts-fin-row .fin-label {
  flex: 1;
  padding-right: 8px;
}

.apts-fin-row .fin-count {
  width: 44px;
  color: #94a3b8;
  text-align: right;
  padding-right: 12px;
}

.apts-fin-row .fin-val {
  font-weight: 700;
  color: #0f172a;
  text-align: right;
  min-width: 95px;
}

/* Donut Cards */
.card-donut {
  align-items: center;
}

.card-donut .apts-card-title {
  align-self: flex-start;
  margin-bottom: 0;
}

.apts-donut-wrap {
  position: relative;
  width: 136px;
  height: 136px;
  margin: 32px auto 16px;
  flex-shrink: 0;
}

.apts-donut-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.donut-segment {
  cursor: pointer;
  stroke-linecap: butt;
  transition: stroke-width 0.16s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.16s ease, filter 0.16s ease;
}

.donut-segment.is-hovered {
  stroke-width: 19px !important;
  opacity: 1 !important;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.16));
}

.donut-segment.is-dimmed {
  opacity: 0.82 !important;
}

.apts-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.apts-donut-center strong {
  display: block;
  font-size: 30px;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.05;
  letter-spacing: -0.5px;
  transition: all 0.15s ease;
}

.apts-donut-center small {
  display: block;
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
  max-width: 88px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}

.apts-donut-tooltip {
  position: absolute;
  pointer-events: none;
  background: #4a4a4a;
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
  z-index: 50;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity 0.15s ease;
}

.apts-donut-tooltip[hidden] {
  display: none !important;
}

.apts-donut-tooltip .tooltip-arrow {
  position: absolute;
  width: 0;
  height: 0;
}

.apts-donut-tooltip.placement-top {
  top: -28px;
  bottom: auto;
}

.apts-donut-tooltip.placement-top .tooltip-arrow {
  bottom: -6px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #4a4a4a;
}

.apts-donut-tooltip.placement-bottom {
  top: auto;
  bottom: -28px;
}

.apts-donut-tooltip.placement-bottom .tooltip-arrow {
  top: -6px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #4a4a4a;
}

.apts-donut-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.legend-item {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #475569;
}

.legend-bullet {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 8px;
  flex-shrink: 0;
}

.legend-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 6px;
}

.legend-count {
  color: #94a3b8;
  margin-right: 12px;
}

.legend-percent {
  font-weight: 700;
  color: #1e293b;
  min-width: 28px;
  text-align: right;
}

.apts-more-masters-btn {
  background: none;
  border: none;
  color: #008be3;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0 0;
  align-self: flex-start;
  transition: color 0.15s ease;
}

.apts-more-masters-btn:hover {
  text-decoration: underline;
  color: #007ac7;
}

/* Appointments Table Section */
.apts-table-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eef2f6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.apts-table-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 12px;
}

.apts-table-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.apts-table-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.apts-table-counter {
  font-size: 12px;
  color: #94a3b8;
}

.btn-apts-add-booking {
  background: #008be3;
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-apts-add-booking:hover {
  background: #007ac7;
}

.apts-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.apts-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 12px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.apts-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 13px;
  vertical-align: middle;
}

.apts-table tbody tr {
  transition: background 0.12s ease;
  cursor: default !important;
}

.apts-table tbody tr:hover {
  background: #f8fafc;
}

.th-apt-id,
.td-apt-id {
  white-space: nowrap;
  min-width: 90px;
}

.apt-id-pill {
  font-family: monospace;
  font-weight: 700;
  color: #008be3;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  display: inline-block;
}

.apt-dt-date {
  font-weight: 600;
  color: #1e293b;
}

.apt-dt-time {
  font-size: 11px;
  color: #94a3b8;
}

.apt-client-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.apt-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.apt-srv-tag {
  display: inline-block;
  background: #f1f5f9;
  color: #334155;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td-apt-amount,
.td-apt-datetime,
.td-apt-phone,
.td-apt-master {
  white-space: nowrap;
}

/* Status Badges */
.badge-completed {
  background: #dcfce7;
  color: #15803d;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-confirmed {
  background: #dcfce7;
  color: #15803d;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-cancelled {
  background: #fee2e2;
  color: #b91c1c;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-new {
  background: #e0f2fe;
  color: #0369a1;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-expired {
  background: #f1f5f9;
  color: #64748b;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-new-tag {
  display: inline-block;
  background: #ef4444;
  color: #ffffff;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  margin-right: 4px;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(239, 68, 68, 0.35);
}

.btn-apt-view {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-apt-view:hover {
  background: #f8fafc;
  border-color: #008be3;
  color: #008be3;
}

/* ========================================================
   SHOP / SALES (МАГАЗИН) STYLES
   Matching Studio Screenshot Layout
   ======================================================== */
.shop-view-container {
  padding: 16px 24px 40px;
  background: #ffffff;
  color: #262626;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
  width: 100%;
}

.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.shop-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #262626;
  letter-spacing: -0.2px;
}

.shop-help-btn {
  background: transparent;
  border: 1px solid #bfbfbf;
  color: #595959;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: all 0.15s ease;
}

.shop-help-btn:hover {
  border-color: #008be3;
  color: #008be3;
}

/* Filters Area */
.shop-filters-area {
  margin-bottom: 20px;
}

.shop-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.shop-date-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shop-date-prefix {
  font-size: 13px;
  color: #595959;
}

.shop-input-date {
  height: 32px;
  width: 125px;
  padding: 0 8px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
  color: #262626;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.shop-input-date:focus,
.shop-input-text:focus {
  border-color: #008be3;
}

.shop-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.shop-search-icon,
.shop-barcode-icon {
  position: absolute;
  left: 8px;
  color: #8c8c8c;
  pointer-events: none;
}

.shop-search-wrap .shop-input-text {
  height: 32px;
  padding: 0 10px 0 28px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
  color: #262626;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.shop-wrap-salenum .shop-input-text {
  width: 120px;
}

.shop-wrap-phone .shop-input-text {
  width: 150px;
}

.shop-product-query-wrap .shop-input-text {
  width: 290px;
}

.shop-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.shop-select {
  height: 32px;
  padding: 0 24px 0 10px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
  color: #262626;
  outline: none;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.shop-select:focus {
  border-color: #008be3;
}

.shop-select-chevron {
  position: absolute;
  right: 8px;
  color: #8c8c8c;
  pointer-events: none;
}

/* Altegio signature blue pill dropdowns */
.shop-select-blue .shop-select {
  background: #f0f8ff;
  border-color: #bce1fd;
  color: #0284c7;
}

.shop-select-blue .shop-select-chevron {
  color: #0284c7;
}

.shop-select-blue .shop-select:focus {
  border-color: #008be3;
  box-shadow: 0 0 0 2px rgba(0, 139, 227, 0.15);
}

.shop-filter-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.shop-btn-submit {
  height: 32px;
  padding: 0 20px;
  background: #008be3;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.shop-btn-submit:hover {
  background: #0077c2;
}

.shop-btn-reset {
  background: transparent;
  border: none;
  color: #008be3;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  font-family: inherit;
}

.shop-btn-reset:hover {
  text-decoration: underline;
}

/* Summary Area (Full width clean boxes, Top Sellers removed) */
.shop-summary-area {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  width: 100%;
}

.shop-summary-left {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-metrics-card {
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  background: #ffffff;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  box-sizing: border-box;
}

.shop-metric-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shop-metric-label {
  font-size: 12px;
  color: #595959;
}

.shop-metric-val {
  font-size: 22px;
  font-weight: 400;
  color: #262626;
  letter-spacing: -0.3px;
}

.shop-top-products-card {
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  background: #ffffff;
  padding: 12px 18px;
  min-height: 48px;
  box-sizing: border-box;
}

.shop-top-products-title {
  font-size: 13px;
  color: #262626;
  font-weight: 400;
}

.shop-top-products-content {
  padding-top: 6px;
}

.shop-top-prod-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.shop-top-prod-table th {
  text-align: left;
  padding: 6px 8px;
  color: #595959;
  font-weight: 500;
  font-size: 11px;
  border-bottom: 1px solid #f0f0f0;
}

.shop-top-prod-table td {
  padding: 6px 8px;
  color: #262626;
  border-bottom: 1px solid #f5f5f5;
}

/* Table Toolbar */
.shop-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.shop-table-count {
  font-size: 14px;
  color: #262626;
  font-weight: 400;
}

.shop-table-count .shop-count-num {
  color: #8c8c8c;
  margin-left: 2px;
}

.shop-table-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.shop-ctrl-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #595959;
}

.shop-select-small .shop-select {
  height: 28px;
  padding: 0 22px 0 8px;
  font-size: 12px;
}

/* Clean Altegio Sales Table */
.shop-table-wrapper {
  width: 100%;
  overflow-x: auto;
  background: #fff;
}

.shop-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.shop-table thead tr {
  border-bottom: 1px solid #e8e8e8;
}

.shop-table th {
  background: #ffffff;
  color: #262626;
  font-weight: 400;
  font-size: 12px;
  padding: 10px 8px;
  white-space: nowrap;
  border-bottom: 1px solid #e8e8e8;
}

.shop-table td {
  padding: 10px 8px;
  color: #262626;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
  font-size: 12px;
}

.shop-table tr:hover td {
  background: #fafafa;
}

.shop-table-empty-row td {
  text-align: center;
  padding: 36px 16px;
  color: #8c8c8c;
  font-size: 13px;
  background: #fff;
  border-bottom: none;
}

.shop-link-pill {
  display: inline-block;
  padding: 1px 6px;
  background: #f0f8ff;
  color: #0284c7;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}

.shop-link-pill:hover {
  text-decoration: underline;
}

.shop-row-cancelled td {
  opacity: 0.55;
  text-decoration: line-through;
}

/* Header Add Product Button */
.shop-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-btn-add-product {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 16px;
  background: #008be3;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.05s ease;
}

.shop-btn-add-product:hover {
  background: #0077c2;
}

.shop-btn-add-product:active {
  transform: translateY(1px);
}

.shop-btn-plus {
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
}

/* Add Product Modal Panel */
.add-product-panel {
  max-width: 520px;
  width: 95%;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.add-product-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid #f0f0f0;
}

.add-product-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #262626;
}

.add-product-form {
  display: flex;
  flex-direction: column;
}

.add-product-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-form-label {
  font-size: 12.5px;
  font-weight: 500;
  color: #475569;
}

.req-star {
  color: #ef4444;
}

.product-input-text {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
  color: #262626;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  width: 100%;
  transition: border-color 0.15s;
}

.product-input-text:focus {
  border-color: #008be3;
}

.brand-select-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-inline-add-brand {
  background: transparent;
  border: none;
  color: #008be3;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.btn-inline-add-brand:hover {
  text-decoration: underline;
}

.brand-modal-select-wrap {
  width: 100%;
}

.brand-modal-select {
  width: 100%;
  height: 36px;
  font-size: 13px;
}

/* Inline Brand Creator */
.inline-brand-creator {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

/* Brand header actions & Management */
.brand-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-inline-manage-brands {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  font-weight: 500;
  transition: color 0.15s ease;
}

.btn-inline-manage-brands:hover {
  color: #008be3;
  text-decoration: underline;
}

.brand-select-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.brand-modal-select-wrap {
  flex: 1;
}

.btn-delete-selected-brand {
  height: 36px;
  width: 36px;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-delete-selected-brand:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #ef4444;
}

.brands-management-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.brands-panel-header {
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 8px;
  font-weight: 500;
}

.brands-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12px;
  color: #1e293b;
}

.brand-chip-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-delete-chip {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s ease;
}

.btn-delete-chip:hover {
  color: #ef4444;
}

.inline-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-brand-text-input {
  flex: 1;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12.5px;
  color: #262626;
  outline: none;
  font-family: inherit;
  background: #fff;
}

.inline-brand-text-input:focus {
  border-color: #008be3;
}

.btn-brand-save-small {
  height: 30px;
  padding: 0 12px;
  background: #008be3;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.btn-brand-save-small:hover {
  background: #0077c2;
}

.btn-brand-cancel-small {
  height: 30px;
  width: 30px;
  background: transparent;
  color: #64748b;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-brand-cancel-small:hover {
  background: #f1f5f9;
  color: #1e293b;
}

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

.product-form-row-three {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 12px;
}

.add-product-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}

.btn-product-cancel {
  height: 34px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  color: #595959;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.btn-product-cancel:hover {
  background: #f5f5f5;
  color: #262626;
}

.btn-product-submit {
  height: 34px;
  padding: 0 20px;
  background: #008be3;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-product-submit:hover {
  background: #0077c2;
}

/* ========================================================
   STANDALONE PRODUCT SALE MODAL STYLES
   ======================================================== */
.create-sale-panel {
  width: 720px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.create-sale-form {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.create-sale-scroll {
  padding: 18px 24px;
  overflow-y: auto;
  max-height: calc(85vh - 120px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sale-form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 12px;
}

.sale-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sale-products-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px 16px;
}

.sale-section-header {
  margin-bottom: 10px;
}

.sale-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.sale-add-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sale-product-picker-wrap {
  flex: 1;
}

.btn-sale-add-item {
  height: 36px;
  padding: 0 16px;
  background: #008be3;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-sale-add-item:hover {
  background: #0077c2;
}

.sale-cart-table-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.sale-cart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sale-cart-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
}

.sale-cart-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.sale-cart-table tr:last-child td {
  border-bottom: none;
}

.sale-cart-empty-cell {
  text-align: center;
  color: #94a3b8;
  padding: 24px 12px !important;
  font-size: 13px;
}

.sale-qty-ctrl {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
}

.btn-qty-step {
  width: 26px;
  height: 26px;
  border: none;
  background: #f8fafc;
  color: #475569;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.1s;
}

.btn-qty-step:hover {
  background: #e2e8f0;
}

.sale-qty-input {
  width: 36px;
  height: 26px;
  border: none;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  color: #0f172a;
}

.btn-sale-cart-del {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 15px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.btn-sale-cart-del:hover {
  color: #ef4444;
  background: #fee2e2;
}

.sale-summary-section {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px 18px;
}

.sale-notes-textarea {
  resize: vertical;
  min-height: 72px;
}

.sale-sum-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: #475569;
}

.sale-sum-line.sale-sum-total {
  border-top: 1px solid #cbd5e1;
  padding-top: 10px;
  margin-top: 8px;
  font-size: 15px;
  color: #0f172a;
}

.sale-highlight-val {
  color: #008be3;
  font-size: 18px;
  font-weight: 700;
}

.sale-discount-control,
.sale-pay-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sale-mini-input {
  width: 90px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13px;
  text-align: right;
  font-weight: 600;
  color: #1e293b;
  outline: none;
  background: #fff;
}

.sale-mini-input:focus {
  border-color: #008be3;
}

.sale-curr-lbl {
  font-size: 12px;
  color: #64748b;
}

.sale-payment-breakdown {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sale-pay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
}






/* --------------------------------------------------------------------------
   Staff Employee Profile View (Matching User Screenshot)
   -------------------------------------------------------------------------- */
.staff-profile-view {
  min-height: calc(100vh - 60px);
  background: #f8fafc;
}

.staff-profile-topbar {
  padding: 20px 28px 6px;
  background: #fff;
}

.staff-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #008be3;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.staff-back-link:hover {
  color: #006eb5;
  text-decoration: underline;
}

.staff-profile-header {
  padding: 6px 28px 16px;
  background: #fff;
}

.staff-profile-title {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.staff-profile-tabs {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0;
  background: transparent;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.staff-profile-tab {
  padding: 10px 4px 12px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.staff-profile-tab:hover {
  color: #1e293b;
}

.staff-profile-tab.active {
  color: #008be3;
  font-weight: 600;
  border-bottom-color: #008be3;
}

.staff-profile-tab-content {
  padding: 0;
}

.staff-profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
  max-width: 1350px;
  padding: 24px 28px;
}

.staff-profile-main-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.staff-profile-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.staff-avatar-card {
  position: relative;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 24px 20px 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.staff-avatar-wrapper {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 6px auto 12px;
  display: block;
}

.staff-profile-avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #f8fafc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.staff-avatar-change-link {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 11.5px;
  line-height: 1.25;
  color: #008be3;
  text-decoration: underline;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-weight: 500;
  z-index: 2;
  transition: color 0.15s ease;
}

.staff-avatar-change-link:hover {
  color: #006eb5;
}

.staff-card-name {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}

.staff-card-role {
  font-size: 13px;
  color: #64748b;
}

/* Yellow status card matching screenshot */
.staff-status-box {
  background: #fee388;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.staff-status-box-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13.5px;
  font-weight: 500;
  color: #1e293b;
}

.staff-lux-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #008be3;
  cursor: pointer;
}

.staff-status-box-info {
  margin-left: auto;
  color: #b45309;
  display: inline-flex;
  align-items: center;
  cursor: help;
}

.btn-staff-profile-history {
  width: 100%;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-staff-profile-history:hover {
  border-color: #6b7280;
  color: #4b5563;
}

/* Right Column Contact Form */
.staff-form-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.staff-form-card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #1e293b;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.staff-form-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.staff-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

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

.staff-form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
}

.staff-form-input,
.staff-form-select {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13.5px;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.staff-form-input:focus,
.staff-form-select:focus {
  border-color: #008be3;
  box-shadow: 0 0 0 2px rgba(0, 139, 227, 0.15);
}

.staff-select-wrap {
  position: relative;
  width: 100%;
}

.staff-form-select {
  appearance: none;
  padding-right: 28px;
  cursor: pointer;
}

.staff-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #64748b;
  font-size: 13px;
}

.staff-form-footer {
  display: flex;
  justify-content: flex-start;
  padding-top: 12px;
}

.btn-save-staff-profile {
  padding: 10px 32px;
  background: #008be3;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s;
}

.btn-save-staff-profile:hover {
  background: #007ac7;
}

.btn-save-staff-profile:active {
  transform: scale(0.98);
}

.staff-tab-placeholder {
  padding: 60px 20px;
  text-align: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  max-width: 600px;
  margin: 20px auto;
}

.staff-placeholder-icon {
  font-size: 36px;
  margin-bottom: 12px;
  color: #008be3;
}

.staff-tab-placeholder h3 {
  font-size: 18px;
  color: #1e293b;
  margin: 0 0 8px;
}

.staff-tab-placeholder p {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
}


/* Staff Profile Change History Modal */
.staff-history-panel {
  max-width: 820px;
  width: 90%;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.staff-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.staff-history-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.staff-history-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.staff-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.staff-history-table thead th {
  background: #f8fafc;
  padding: 10px 14px;
  font-weight: 700;
  color: #334155;
  border-bottom: 1px solid #e2e8f0;
}

.staff-history-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.staff-history-table tbody tr:last-child td {
  border-bottom: none;
}

.staff-history-table tbody tr:hover {
  background: #f8fafc;
}

.staff-history-footer {
  padding: 14px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
}

.btn-staff-history-close {
  padding: 8px 20px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-staff-history-close:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
}

.btn-save-staff-profile.saved-success {
  background: #16a34a !important;
  color: #fff !important;
}

/* Schedule Change History Modal (Matching User Screenshot) */
.staff-sched-history-panel {
  max-width: 1160px;
  width: 95%;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  animation: schedHistModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes schedHistModalIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.staff-sched-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.staff-sched-history-header .new-client-close-btn {
  color: #475569;
  font-weight: 300;
  font-size: 20px;
  cursor: pointer;
}

.staff-sched-history-header .new-client-close-btn:hover {
  color: #0f172a;
}

.staff-sched-history-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.staff-sched-history-toolbar {
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
}

.sched-hist-filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sched-hist-select {
  height: 36px;
  min-width: 170px;
  padding: 0 32px 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13.5px;
  color: #334155;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat calc(100% - 10px) center;
  background-size: 12px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.sched-hist-select:focus {
  border-color: #008be3;
}

.sched-hist-date-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sched-hist-date-input {
  height: 36px;
  width: 145px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13.5px;
  font-family: inherit;
  color: #334155;
  background: #fff;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.sched-hist-date-input:focus {
  border-color: #008be3;
}

.sched-hist-date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.sched-hist-date-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.sched-hist-btn-submit {
  height: 36px;
  padding: 0 20px;
  background: #008be3;
  border: none;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sched-hist-btn-submit:hover {
  background: #007bc9;
}

.sched-hist-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #334155;
  cursor: pointer;
  user-select: none;
  margin-left: 6px;
}

.sched-hist-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #008be3;
  cursor: pointer;
}

.staff-sched-history-body {
  padding: 0 24px 20px;
  overflow-y: auto;
  flex: 1;
}

.staff-sched-history-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.staff-sched-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.staff-sched-history-table thead th {
  background: #ffffff;
  padding: 14px 12px;
  font-weight: 700;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.staff-sched-history-table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.staff-sched-history-table tbody tr:hover {
  background: #f8fafc;
}

.sched-hist-val-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.sched-hist-badge {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.sched-hist-badge.badge-p {
  background: #5cb85c;
  color: #ffffff;
}

.sched-hist-badge.badge-h {
  background: #cbd5e1;
  color: #475569;
}

.sched-hist-val-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sched-hist-val-date {
  font-size: 13px;
  color: #1e293b;
  font-weight: 500;
  line-height: 1.25;
}

.sched-hist-val-date.sched-hist-strikethrough {
  text-decoration: line-through;
  color: #475569;
}

.sched-hist-val-time {
  font-size: 12px;
  color: #64748b;
}


/* ==========================================================================
   Finance & Analytics Reporting (Вкладка Финансы)
   ========================================================================== */

.sidebar-finance-nav {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #fff;
  border-right: 1px solid #e2e8f0;
}

.finance-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 18px 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #334155;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  text-decoration: none;
  outline: none;
  text-align: center;
}

.finance-nav-item:hover {
  background: #f8fafc;
}

.finance-nav-item.active {
  background: #eaf4fc;
  color: #008be3;
  border-top: 1px solid #cce5f7;
  border-bottom: 1px solid #cce5f7;
}

.finance-nav-icon {
  stroke: currentColor;
  flex-shrink: 0;
  transition: stroke 0.15s ease;
}

#finance {
  background: #f8fafc;
  overflow-y: auto;
}

.finance-view-container {
  padding: 24px 32px 64px 32px;
  max-width: 1600px;
  margin: 0 auto;
}

.finance-subview-head {
  margin-bottom: 20px;
}

.fin-title {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 4px 0;
  letter-spacing: -0.2px;
  font-family: inherit;
}

.fin-subtitle {
  font-size: 13.5px;
  color: #64748b;
  font-family: inherit;
}

/* Years Navigation Bar (Image 1) */
.fin-years-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.fin-year-link {
  color: #0284c7;
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  transition: color 0.15s ease;
}

.fin-year-link:hover {
  color: #0369a1;
}

.fin-year-link.active {
  font-weight: 800;
  color: #0f172a;
  font-size: 16.5px;
  text-decoration: none;
  cursor: default;
}

/* KPI Summary Cards */
.fin-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.fin-metric-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.fin-metric-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
}

.fin-metric-val {
  font-size: 24px;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.fin-metric-val.highlight-blue {
  color: #0284c7;
}

.fin-metric-val.highlight-green {
  color: #16a34a;
}

.fin-metric-sub {
  font-size: 12.5px;
  color: #94a3b8;
}

/* Financial Cards & Tables */
.fin-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.fin-annual-table,
.fin-daily-matrix-table,
.fin-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-family: var(--font-primary, "Myriad Pro", "MyriadProRegular", "PT Sans", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.fin-annual-table th,
.fin-daily-matrix-table th,
.fin-compare-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid #cbd5e1;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.fin-annual-table th.th-fin-row-label,
.fin-daily-matrix-table th.th-fin-row-label,
.fin-compare-table th.th-comp-name {
  text-align: left;
}

.fin-annual-table td,
.fin-daily-matrix-table td,
.fin-compare-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.fin-annual-table td.td-label,
.fin-daily-matrix-table td.td-label,
.fin-compare-table td.td-comp-name {
  text-align: left;
  font-weight: 500;
}

.th-fin-total,
.td-fin-total {
  background: #f8fafc !important;
  font-weight: 700 !important;
  border-left: 2px solid #e2e8f0;
}

/* Light cyan highlight for ДОХОДЫ row matching Image 1 */
.row-total-income {
  background: #e0f2fe !important;
  border-top: 1px solid #bae6fd;
  border-bottom: 1px solid #bae6fd;
}

.row-total-income td {
  font-weight: 700 !important;
  color: #0369a1 !important;
}

.row-total-income td.td-label {
  color: #0369a1 !important;
  font-weight: 800 !important;
}

.row-services td.td-label,
.row-sales td.td-label {
  font-weight: 600;
  color: #334155;
}

.row-services {
  background: #ffffff;
}

.row-sales {
  background: #ffffff;
}

/* Compare Table Specifics (Image 3) */
.row-group-header {
  font-style: italic;
  font-weight: 700;
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a !important;
}

.row-group-header td {
  font-style: italic;
  font-weight: 700;
}

.row-group-total {
  font-style: italic;
  font-weight: 700;
  background: #f1f5f9 !important;
  border-top: 2px solid #cbd5e1;
  color: #0f172a !important;
}

.row-group-total td {
  font-style: italic;
  font-weight: 700;
}

.td-indent {
  padding-left: 28px !important;
  color: #334155;
}

.fin-pct-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  min-width: 58px;
}

.fin-pct-badge.pct-pos {
  background: #dcfce7;
  color: #15803d;
}

.fin-pct-badge.pct-neg {
  background: #fee2e2;
  color: #b91c1c;
}

.fin-pct-badge.pct-zero {
  color: #94a3b8;
}

/* Filter Toolbars */
.fin-filter-toolbar,
.fin-compare-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  background: #fff;
  padding: 14px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.fin-filter-group,
.fin-compare-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fin-label,
.fin-compare-label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.fin-date-range-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fin-input-date {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
}

.fin-date-sep {
  color: #94a3b8;
  font-weight: 500;
}

.fin-select-wrap {
  position: relative;
}

.fin-select {
  height: 34px;
  padding: 0 24px 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  cursor: pointer;
}

.fin-btn-show,
.fin-btn-compare {
  height: 34px;
  padding: 0 18px;
  background: #008be3;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.fin-btn-show:hover,
.fin-btn-compare:hover {
  background: #0077c2;
}

.fin-quick-presets {
  display: flex;
  gap: 6px;
  align-items: center;
}

.fin-preset-btn {
  height: 30px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fin-preset-btn:hover {
  background: #e2e8f0;
}

.fin-preset-btn.active {
  background: #008be3;
  color: #fff;
  border-color: #008be3;
}

/* ==============================================================================
   SERVICES & PRICING PAGE (Услуги и прайс)
   ============================================================================== */

.services-view-container,
.settings-view-container {
  padding: 24px 32px 48px;
  max-width: 1560px;
  margin: 0 auto;
}

.services-header,
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.services-title,
.settings-title {
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.4px;
  margin: 0 0 4px;
}

.services-subtitle,
.settings-subtitle {
  font-size: 13.5px;
  color: #64748b;
  display: block;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  background: #008be3;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}

.btn-primary-action:hover {
  background: #0077c5;
}

.btn-primary-action:active {
  transform: translateY(1px);
}

/* Services KPI Cards */
.services-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.services-metric-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.services-metric-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
}

.services-metric-val {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  line-height: 1.25;
}

.services-metric-val.highlight-gold {
  color: #b45309;
}

.services-metric-val.highlight-purple {
  color: #7c3aed;
}

.services-metric-sub {
  font-size: 12.5px;
  color: #94a3b8;
}

/* Services Toolbar */
.services-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.services-search-wrap {
  position: relative;
  width: 320px;
}

.services-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  stroke: #94a3b8;
  pointer-events: none;
}

.services-search-input {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 36px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13.5px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.services-search-input:focus {
  border-color: #008be3;
  box-shadow: 0 0 0 3px rgba(0, 139, 227, 0.15);
}

.services-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 13px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
}

.services-search-clear:hover {
  color: #475569;
}

.services-category-pills {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.services-cat-btn {
  height: 32px;
  padding: 0 16px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.services-cat-btn.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.services-status-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.services-filter-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.services-select {
  height: 38px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  cursor: pointer;
}

.services-select:focus {
  border-color: #008be3;
}

/* Services Table */
.services-card,
.settings-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.services-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.services-table thead {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.services-table th {
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.4px;
}

.services-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.services-table tbody tr:hover {
  background: #f8fafc;
}

.srv-name-cell {
  font-weight: 600;
  color: #0f172a;
}

.srv-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.srv-badge.badge-premium {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.srv-badge.badge-vip {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.srv-price-cell {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.srv-price-from {
  font-weight: 500;
  color: #64748b;
  font-size: 11.5px;
}

.srv-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 500;
}

.srv-status-chip.is-active {
  background: #dcfce7;
  color: #15803d;
}

.srv-status-chip.is-inactive {
  background: #f1f5f9;
  color: #94a3b8;
}

.srv-actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-srv-action {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 6px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-srv-action:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

.btn-srv-action.btn-del-srv:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* ==============================================================================
   SETTINGS PAGE (Филиалы и настройки)
   ============================================================================== */

.settings-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 24px;
}

.settings-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.settings-tab-btn:hover {
  color: #0f172a;
}

.settings-tab-btn.active {
  color: #008be3;
  border-bottom-color: #008be3;
  font-weight: 600;
}

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

.settings-panel-head h2 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

/* Branches List - Vertical Stack (друг за другом сверху вниз) */
.settings-branches-grid,
.settings-branches-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.branch-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.02);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.branch-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
}

.branch-card.branch-inactive {
  opacity: 0.75;
  background: #fafbfc;
}

/* Header */
.branch-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  gap: 16px;
  flex-wrap: wrap;
}

.branch-card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.branch-code-badge {
  background: #0f172a;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 6px;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.branch-name-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}

.branch-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.branch-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 9999px;
  line-height: 1;
}

.branch-status-pill .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.branch-status-pill.status-active {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.branch-status-pill.status-active .status-dot {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.branch-status-pill.status-inactive {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.branch-status-pill.status-inactive .status-dot {
  background: #94a3b8;
}

.btn-branch-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-branch-action:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.btn-branch-action:hover svg {
  stroke: #ffffff;
}

/* Card Body - 3 columns */
.branch-card-body {
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 24px;
  background: #ffffff;
}

@media (max-width: 900px) {
  .branch-card-body {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.branch-info-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.branch-col-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.branch-col-label svg {
  color: #94a3b8;
  flex-shrink: 0;
}

.branch-col-value {
  font-size: 14px;
  color: #1e293b;
  line-height: 1.4;
}

.branch-phone-link {
  color: #0284c7;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.branch-phone-link:hover {
  color: #0369a1;
  text-decoration: underline;
}

/* Footer - Team row */
.branch-card-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.branch-team-label-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.branch-team-heading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
}

.branch-team-heading svg {
  color: #64748b;
}

.branch-masters-count-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #334155;
}

.branch-masters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.branch-master-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.branch-master-pill .chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #0284c7;
}

.branch-no-masters-hint {
  font-size: 12.5px;
  color: #94a3b8;
  font-style: italic;
}

/* General Settings Form */
.settings-card-form {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 28px;
  max-width: 760px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.settings-card-form h2 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 20px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.settings-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
}

.settings-input,
.settings-select {
  height: 40px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13.5px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings-input:focus,
.settings-select:focus {
  border-color: #008be3;
  box-shadow: 0 0 0 3px rgba(0, 139, 227, 0.15);
}

.settings-form-toggles {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}

.settings-toggle-label {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.toggle-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch-visual {
  width: 44px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 12px;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.toggle-switch-visual::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.toggle-checkbox:checked + .toggle-switch-visual {
  background: #008be3;
}

.toggle-checkbox:checked + .toggle-switch-visual::after {
  transform: translateX(20px);
}

.toggle-text {
  display: flex;
  flex-direction: column;
}

.toggle-text strong {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
}

.toggle-text small {
  font-size: 12px;
  color: #64748b;
}

.settings-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn-save-settings {
  height: 40px;
  padding: 0 24px;
  background: #008be3;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 139, 227, 0.2);
}

.btn-save-settings:hover {
  background: #0077c5;
}

.btn-save-settings:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-save-settings.saved-success {
  background: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.5) !important;
  transform: translateY(-1px) scale(1.02);
}

.btn-save-settings.saved-success svg {
  animation: checkPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes checkPop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Settings Users Table */
.settings-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.settings-users-table thead {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.settings-users-table th {
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  text-align: left;
}

.settings-users-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.settings-users-table tbody tr:hover {
  background: #f8fafc;
}

.user-role-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
}

.user-role-badge.role-admin {
  background: #fee2e2;
  color: #b91c1c;
}

.user-role-badge.role-manager {
  background: #e0f2fe;
  color: #0369a1;
}

.user-role-badge.role-barber {
  background: #f1f5f9;
  color: #475569;
}

/* Modal form elements for Services, Branches, Users */
.service-modal-panel,
.branch-modal-panel,
.user-modal-panel {
  max-width: 560px;
  width: 92%;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  padding: 24px 28px;
  box-sizing: border-box;
}

.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.modal-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: end;
}

.modal-form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  line-height: 1.3;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.modal-label-hint {
  font-size: 11px;
  font-weight: 400;
  color: #64748b;
}

.modal-input-text,
.modal-select {
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13.5px;
  color: #0f172a;
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal-input-text:focus,
.modal-select:focus {
  border-color: #008be3;
  box-shadow: 0 0 0 3px rgba(0, 139, 227, 0.12);
}

.modal-input-text[readonly] {
  background-color: #f8fafc;
  color: #64748b;
  cursor: not-allowed;
  border-color: #e2e8f0;
}

.modal-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 10px) center;
  background-size: 12px;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.modal-input-text:-webkit-autofill,
.modal-input-text:-webkit-autofill:hover,
.modal-input-text:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
  -webkit-text-fill-color: #0f172a !important;
  transition: background-color 5000s ease-in-out 0s;
}

.modal-input-text[readonly]:-webkit-autofill,
.modal-input-text[readonly]:-webkit-autofill:hover,
.modal-input-text[readonly]:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #f8fafc inset !important;
  -webkit-text-fill-color: #64748b !important;
}

.modal-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

.crm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  margin: 16px -20px -20px;
}

.service-modal-panel .crm-modal-footer,
.branch-modal-panel .crm-modal-footer,
.user-modal-panel .crm-modal-footer {
  margin: 20px -28px -24px;
  padding: 16px 28px;
}

.btn-modal-cancel {
  height: 36px;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
}

.btn-modal-cancel:hover {
  background: #f1f5f9;
}

.btn-modal-save {
  height: 36px;
  padding: 0 18px;
  border: none;
  background: #008be3;
  color: #ffffff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-modal-save:hover {
  background: #0077c5;
}

/* ==========================================================================
   MASTER SERVICES & MASTER SCHEDULE (Staff Profile Subtabs)
   ========================================================================== */

.master-services-box,
.master-schedule-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.master-services-toolbar,
.master-schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.master-services-toolbar-left,
.master-schedule-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.master-services-title,
.master-schedule-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}

.master-services-hint,
.master-schedule-subtitle {
  font-size: 13px;
  color: #64748b;
  font-weight: 400;
}

.master-services-kpi-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

.btn-edit-master-services,
.btn-open-full-schedule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: #008be3;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 139, 227, 0.15);
}

.btn-edit-master-services:hover,
.btn-open-full-schedule:hover {
  background: #0077c5;
  transform: translateY(-1px);
}

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

.btn-master-services-quick {
  padding: 7px 14px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-master-services-quick:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-master-services-cancel {
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-master-services-cancel:hover {
  background: #f8fafc;
  color: #0f172a;
}

.btn-master-services-save {
  padding: 8px 20px;
  background: #008be3;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-master-services-save:hover {
  background: #0077c5;
}

.btn-master-services-save.btn-saved-success {
  background: #10b981 !important;
  color: #ffffff !important;
  transform: scale(1.02);
}

/* Services View Table */
.master-srv-category-block {
  margin-bottom: 28px;
}

.master-srv-category-block:last-child {
  margin-bottom: 0;
}

.master-srv-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}

.master-srv-category-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  margin: 0;
}

.master-srv-category-count {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.master-srv-table {
  width: 100%;
  border-collapse: collapse;
}

.master-srv-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.master-srv-table td {
  padding: 13px 14px;
  font-size: 13.5px;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.master-srv-table tr:hover td {
  background: #f8fafc;
}

.master-srv-name-cell {
  font-weight: 600;
  color: #0f172a;
}

.master-srv-badge-active {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
}

.master-srv-badge-disabled {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
}

/* Edit Mode Grid & Toggle Cards */
.master-services-edit-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.master-srv-edit-items-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.master-srv-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.master-srv-toggle-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.master-srv-toggle-card.active {
  background: #f0fdf4;
  border-color: #86efac;
}

.master-srv-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 12px;
}

.master-srv-toggle-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.master-srv-toggle-meta {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Switch UI */
.master-srv-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.master-srv-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.master-srv-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .2s ease;
  border-radius: 24px;
}

.master-srv-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.master-srv-switch input:checked + .master-srv-slider {
  background-color: #10b981;
}

.master-srv-switch input:checked + .master-srv-slider:before {
  transform: translateX(20px);
}

/* Master Personal Schedule View */
.master-schedule-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.master-schedule-stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.master-schedule-stat-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.master-schedule-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

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

.master-schedule-day-header {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  padding: 8px 0;
  text-transform: uppercase;
}

.master-schedule-day-cell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  min-height: 80px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.1s ease;
}

.master-schedule-day-cell:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.master-schedule-day-num {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.master-schedule-day-cell.is-today {
  border-color: #008be3;
  background: #f0f9ff;
}

.master-schedule-day-cell.is-today .master-schedule-day-num {
  color: #008be3;
  font-weight: 700;
}

.master-schedule-day-cell.is-work {
  border-left: 3.5px solid #10b981;
}

.master-schedule-day-cell.is-off {
  border-left: 3.5px solid #cbd5e1;
  background: #fcfcfd;
}

.master-schedule-day-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

.master-schedule-day-badge.work {
  background: #ecfdf5;
  color: #059669;
}

.master-schedule-day-badge.off {
  background: #f1f5f9;
  color: #64748b;
}

/* ==========================================================================
   WEEKLY SCHEDULE CONFIGURATION TABLE (Master Weekly Template)
   ========================================================================== */

.master-weekly-schedule-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  margin-bottom: 28px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
  overflow: hidden !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.master-weekly-card-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 16px 24px !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  flex-wrap: nowrap !important;
  gap: 16px !important;
  box-sizing: border-box !important;
}

.master-weekly-header-title {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

.master-weekly-card-heading {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
  line-height: 1.3 !important;
}

.master-weekly-card-sub {
  font-size: 12.5px !important;
  color: #64748b !important;
  line-height: 1.3 !important;
}

.btn-save-weekly-schedule {
  padding: 8px 22px !important;
  background: #008be3 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  box-shadow: 0 1px 2px rgba(0, 139, 227, 0.18) !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.btn-save-weekly-schedule:hover {
  background: #0077c5 !important;
}

.btn-save-weekly-schedule.btn-saved-success {
  background: #10b981 !important;
  color: #ffffff !important;
  transform: scale(1.02) !important;
}

.master-weekly-table-wrap {
  width: 100% !important;
  overflow-x: auto !important;
  box-sizing: border-box !important;
}

.master-weekly-table {
  width: 100% !important;
  min-width: 640px !important;
  border-collapse: collapse !important;
  table-layout: auto !important;
}

.master-weekly-table th {
  text-align: left !important;
  padding: 12px 24px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.master-weekly-table th.th-day {
  width: 25% !important;
}

.master-weekly-table th.th-hours {
  width: 63% !important;
}

.master-weekly-table th.th-actions {
  width: 12% !important;
  text-align: right !important;
  padding-right: 28px !important;
}

.master-weekly-table td {
  padding: 14px 24px !important;
  vertical-align: middle !important;
  border-bottom: 1px solid #f1f5f9 !important;
  background: #ffffff !important;
  transition: background 0.15s ease !important;
}

.master-weekly-row:hover td {
  background: #f8fafc !important;
}

.master-weekly-day-cell {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
}

.master-weekly-checkbox {
  width: 18px !important;
  height: 18px !important;
  accent-color: #008be3 !important;
  cursor: pointer !important;
  border-radius: 4px !important;
  border: 1.5px solid #cbd5e1 !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

.master-weekly-day-name {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  user-select: none !important;
  cursor: pointer !important;
}

.master-weekly-hours-wrap {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 24px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  transition: opacity 0.2s ease !important;
}

.master-weekly-time-group {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

.master-weekly-select {
  height: 38px !important;
  min-width: 66px !important;
  width: 66px !important;
  padding: 0 24px 0 10px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  background-color: #ffffff !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #0f172a !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2364748B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  transition: border-color 0.15s ease, background-color 0.2s ease, opacity 0.2s ease !important;
}

.master-weekly-select:focus {
  outline: none !important;
  border-color: #008be3 !important;
  box-shadow: 0 0 0 2px rgba(0, 139, 227, 0.15) !important;
}

.master-weekly-row.is-day-off .master-weekly-hours-wrap {
  opacity: 0.38 !important;
}

.master-weekly-row.is-day-off .master-weekly-select {
  background-color: #f8fafc !important;
  color: #94a3b8 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

.master-weekly-action-cell {
  text-align: right !important;
  padding-right: 28px !important;
}

.btn-weekly-add-interval {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  border-radius: 50% !important;
  background: #00a2ff !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 1px 3px rgba(0, 162, 255, 0.28) !important;
  transition: all 0.15s ease !important;
  padding: 0 !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

.btn-weekly-add-interval:hover {
  background: #008be3 !important;
  transform: scale(1.08) !important;
}

.btn-weekly-add-interval svg {
  width: 14px !important;
  height: 14px !important;
  stroke: #ffffff !important;
  stroke-width: 2.5 !important;
  display: block !important;
}

.master-calendar-section-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid #e2e8f0;
}

.master-calendar-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Phone Autocomplete Dropdown & Clear Button (Matches Screenshot)
   ========================================================================== */
.phone-autocomplete-wrapper {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  width: 100% !important;
}

.client-inputs-group .phone-autocomplete-wrapper {
  flex: 1.25 1 0% !important;
  min-width: 0 !important;
}

.phone-autocomplete-wrapper input {
  width: 100% !important;
  padding-right: 28px !important;
}

.phone-autocomplete-clear {
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 18px !important;
  height: 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  background: transparent !important;
  color: #94a3b8 !important;
  font-size: 16px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  border-radius: 50% !important;
  padding: 0 !important;
  transition: color 0.15s ease, background 0.15s ease !important;
  z-index: 5 !important;
}

.phone-autocomplete-clear:hover {
  color: #475569 !important;
  background: #f1f5f9 !important;
}

.phone-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  min-width: 220px;
  max-width: 320px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 260px;
  overflow-y: auto;
  z-index: 9999;
  display: none !important;
  flex-direction: column;
  padding: 4px 0;
}

.phone-autocomplete-dropdown.is-open {
  display: flex !important;
}

.phone-autocomplete-item {
  padding: 9px 14px !important;
  font-size: 13.5px !important;
  color: #334155 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  transition: background 0.1s ease, color 0.1s ease !important;
  white-space: nowrap !important;
  font-family: inherit !important;
}

.phone-autocomplete-item:hover,
.phone-autocomplete-item.is-selected {
  background: #e0f2fe !important;
  color: #0369a1 !important;
}

.phone-autocomplete-item .phone-item-num {
  font-weight: 500 !important;
  letter-spacing: 0.2px !important;
}

.phone-autocomplete-item .phone-item-name {
  font-size: 11.5px !important;
  color: #94a3b8 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 120px !important;
}

.phone-autocomplete-item:hover .phone-item-name,
.phone-autocomplete-item.is-selected .phone-item-name {
  color: #0284c7 !important;
}

.phone-autocomplete-empty {
  padding: 12px 16px !important;
  font-size: 12.5px !important;
  color: #94a3b8 !important;
  text-align: center !important;
}

/* ==========================================================================
   Studio Appointment Details / Edit Modal (Altegio Luxury Style)
   ========================================================================== */
#appointmentDetailsModal.crm-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000 !important;
  background: rgba(15, 23, 42, 0.55) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  box-sizing: border-box !important;
}

#appointmentDetailsModal.crm-modal-backdrop.open {
  display: flex !important;
}

.apt-workspace-container {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  justify-content: center !important;
  gap: 0 !important; /* Объединено в одно окно впритык */
  background: #ffffff !important;
  border-radius: 12px !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22) !important;
  border: 1px solid #e2e8f0 !important;
  overflow: hidden !important;
  max-width: 98vw !important;
  max-height: 94vh !important;
  margin: auto !important;
  box-sizing: border-box !important;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.apt-studio-card-modal {
  order: 1 !important;
  width: min(720px, 96vw) !important;
  max-width: 720px !important;
  max-height: 94vh !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-shadow: none !important;
  border: none !important;
  flex-shrink: 0 !important;
  transition: width 0.22s ease, max-width 0.22s ease !important;
}

.apt-workspace-container.has-client-open .apt-studio-card-modal {
  width: min(680px, 46vw) !important;
  max-width: 680px !important;
  border-right: 1px solid #e2e8f0 !important; /* Разделитель внутри объединенного окна */
}

.apt-studio-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 18px 24px 14px 24px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  background: #ffffff !important;
}

.apt-studio-title-group {
  display: flex !important;
  flex-direction: column !important;
}

.apt-studio-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #008be3 !important;
  margin: 0 !important;
  line-height: 1.25 !important;
}

.apt-studio-title.is-red {
  color: #ef4444 !important;
}

.apt-studio-subtitle {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12.5px !important;
  color: #64748b !important;
  margin-top: 4px !important;
}

.apt-studio-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.apt-status-pill-group {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.apt-status-pill {
  height: 32px !important;
  padding: 0 14px !important;
  border-radius: 6px !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  color: #475569 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.apt-status-pill:hover {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}

.apt-status-pill.active {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
  font-weight: 600 !important;
}

.apt-studio-btn-circle {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  color: #64748b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 14px !important;
  transition: all 0.15s ease !important;
}

.apt-studio-btn-circle:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.apt-studio-btn-close {
  font-size: 17px !important;
  line-height: 1 !important;
}

.apt-studio-body {
  padding: 20px 24px !important;
  max-height: calc(88vh - 160px) !important;
  overflow-y: auto !important;
}

.apt-studio-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 16px !important;
  gap: 16px !important;
}

.apt-row-label {
  width: 58px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  flex-shrink: 0 !important;
}

.apt-row-left {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.apt-time-group {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.apt-time-prefix {
  font-size: 13px !important;
  color: #64748b !important;
}

.apt-time-input {
  height: 36px !important;
  width: 95px !important;
  padding: 0 10px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #0f172a !important;
  outline: none !important;
}

.apt-time-input:focus {
  border-color: #008be3 !important;
  box-shadow: 0 0 0 3px rgba(0, 139, 227, 0.12) !important;
}

.apt-select-wrap {
  position: relative !important;
}

.apt-time-select {
  height: 36px !important;
  padding: 0 28px 0 12px !important;
  border: 1.5px solid #008be3 !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #0284c7 !important;
  background: #ffffff !important;
  appearance: none !important;
  cursor: pointer !important;
  outline: none !important;
}

.apt-chevron {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  pointer-events: none !important;
  color: #0284c7 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.apt-row-right {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.apt-master-card {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 4px 14px 4px 6px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
  cursor: pointer !important;
  position: relative !important;
  transition: all 0.15s ease !important;
}

.apt-master-card:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

.apt-master-avatar {
  width: 36px !important;
  height: 36px !important;
  border-radius: 6px !important;
  object-fit: cover !important;
}

.apt-master-info strong {
  display: block !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  line-height: 1.2 !important;
}

.apt-master-info small {
  display: block !important;
  font-size: 11.5px !important;
  color: #64748b !important;
  line-height: 1.2 !important;
}

.apt-master-hidden-select {
  position: absolute !important;
  inset: 0 !important;
  opacity: 0 !important;
  cursor: pointer !important;
  width: 100% !important;
  height: 100% !important;
}

.apt-btn-icon-blue {
  width: 38px !important;
  height: 38px !important;
  border-radius: 6px !important;
  border: 1px solid #bae6fd !important;
  background: #f0f9ff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.apt-btn-icon-blue:hover {
  background: #e0f2fe !important;
  border-color: #7dd3fc !important;
}

.apt-client-inputs-wrap {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.apt-client-name {
  flex: 1 !important;
  height: 36px !important;
  padding: 0 12px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  color: #0f172a !important;
  outline: none !important;
}

.apt-phone-wrap {
  flex: 1.2 !important;
}

.apt-client-phone {
  width: 100% !important;
  height: 36px !important;
  padding: 0 12px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  color: #0f172a !important;
  outline: none !important;
  box-sizing: border-box !important;
}

.apt-client-name:focus,
.apt-client-phone:focus {
  border-color: #008be3 !important;
  box-shadow: 0 0 0 3px rgba(0, 139, 227, 0.12) !important;
}

.apt-discount-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 0 8px !important;
  height: 36px !important;
  width: 60px !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.apt-discount-input {
  width: 30px !important;
  border: none !important;
  text-align: right !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  outline: none !important;
  color: #0f172a !important;
}

.apt-discount-wrap span {
  font-size: 13px !important;
  color: #64748b !important;
}

.apt-btn-icon-clear {
  width: 28px !important;
  height: 28px !important;
  border: none !important;
  background: transparent !important;
  color: #94a3b8 !important;
  font-size: 16px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.apt-btn-icon-clear:hover {
  color: #ef4444 !important;
}

.apt-btn-icon-client-card {
  width: 32px !important;
  height: 32px !important;
  border: none !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 16px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 4px !important;
}

.apt-btn-icon-client-card:hover {
  background: #f1f5f9 !important;
  color: #008be3 !important;
}

.apt-prev-visit-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 13px !important;
  margin: 2px 0 16px 74px !important;
  color: #64748b !important;
}

.apt-prev-visit-link {
  color: #008be3 !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  cursor: pointer !important;
}

.apt-prev-visit-link:hover {
  text-decoration: underline !important;
}

.apt-client-tabs-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 0 !important;
  border-top: 1px solid #f1f5f9 !important;
  border-bottom: 1px solid #f1f5f9 !important;
  margin-bottom: 20px !important;
  font-size: 13px !important;
}

.apt-client-tabs-links {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.apt-link-tab {
  color: #008be3 !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  cursor: pointer !important;
}

.apt-link-tab:hover {
  text-decoration: underline !important;
}

.apt-link-sep {
  color: #cbd5e1 !important;
}

.apt-btn-whatsapp {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  border: none !important;
  background: transparent !important;
  color: #16a34a !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}

.apt-btn-whatsapp:hover {
  opacity: 0.85 !important;
}

.apt-studio-section {
  margin-bottom: 20px !important;
}

.apt-section-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 12px !important;
  gap: 12px !important;
}

.apt-section-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  flex: 1 !important;
}

.apt-section-cols-head {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 12px !important;
  color: #64748b !important;
}

.col-head-price { width: 85px !important; text-align: center !important; }
.col-head-disc { width: 44px !important; text-align: center !important; }
.col-head-qty { width: 44px !important; text-align: center !important; }
.col-head-sum { width: 90px !important; text-align: center !important; }

.apt-link-blue {
  color: #008be3 !important;
  background: transparent !important;
  border: none !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  width: 72px !important;
  text-align: right !important;
  padding: 0 !important;
}

.apt-link-blue:hover {
  text-decoration: underline !important;
}

.apt-service-row-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 8px 0 !important;
  border-bottom: 1px dashed #e2e8f0 !important;
  gap: 12px !important;
}

.apt-service-name {
  flex: 1 !important;
  font-size: 13.5px !important;
  color: #1e293b !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
}

.apt-service-inputs {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.apt-service-input {
  height: 32px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  text-align: center !important;
  outline: none !important;
  color: #0f172a !important;
  box-sizing: border-box !important;
}

.apt-service-input.price-input { width: 85px !important; }
.apt-service-input.disc-input { width: 44px !important; }
.apt-service-input.qty-input { width: 44px !important; }
.apt-service-input.sum-input { width: 90px !important; background: #f8fafc !important; font-weight: 600 !important; }

.apt-btn-service-icon {
  width: 28px !important;
  height: 28px !important;
  border: none !important;
  background: transparent !important;
  color: #008be3 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 4px !important;
  padding: 0 !important;
}

.apt-btn-service-icon:hover {
  background: #f1f5f9 !important;
}

.apt-btn-service-delete {
  color: #94a3b8 !important;
}

.apt-btn-service-delete:hover {
  color: #ef4444 !important;
}

.apt-studio-reminder-section {
  margin-bottom: 18px !important;
}

.apt-reminder-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 10px !important;
}

.apt-reminder-title {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
}

.apt-link-blue-sm {
  border: none !important;
  background: transparent !important;
  color: #008be3 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}

.apt-pills-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.apt-pill {
  padding: 6px 14px !important;
  border-radius: 6px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  color: #334155 !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.apt-pill:hover {
  border-color: #cbd5e1 !important;
  background: #f1f5f9 !important;
}

.apt-pill.active {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
  font-weight: 600 !important;
}

.apt-comment-section {
  margin-bottom: 18px !important;
}

.apt-comment-textarea {
  width: 100% !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  font-size: 13.5px !important;
  outline: none !important;
  resize: vertical !important;
  box-sizing: border-box !important;
  color: #0f172a !important;
}

.apt-comment-textarea:focus {
  border-color: #008be3 !important;
  box-shadow: 0 0 0 3px rgba(0, 139, 227, 0.12) !important;
}

.apt-total-section {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 14px 24px 0 24px !important;
  border-top: 1px solid #f1f5f9 !important;
  background: #ffffff !important;
}

.apt-total-label {
  font-size: 16px !important;
  font-weight: 500 !important;
  color: #1e293b !important;
}

.apt-total-val {
  font-size: 26px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

.apt-studio-footer {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 12px !important;
  padding: 14px 24px 18px 24px !important;
  background: #ffffff !important;
}

.apt-action-btn {
  height: 48px !important;
  border-radius: 8px !important;
  border: 1.5px solid #38bdf8 !important;
  background: #ffffff !important;
  color: #0284c7 !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.apt-action-btn:hover {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
  transform: translateY(-1px) !important;
}

.btn-action-checkout {
  border-color: #008be3 !important;
  color: #008be3 !important;
}

/* ==========================================================================
   Global Number Input Spinners Reset
   ========================================================================== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button,
.apt-studio-card-modal input::-webkit-outer-spin-button,
.apt-studio-card-modal input::-webkit-inner-spin-button,
.client-studio-modal input::-webkit-outer-spin-button,
.client-studio-modal input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
  display: none !important;
}
input[type="number"],
.apt-studio-card-modal input[type="number"],
.client-studio-modal input[type="number"] {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

/* Confirmed Appointment Locked State */
.apt-studio-card-modal.is-confirmed-locked input:not([type="button"]):not([type="submit"]),
.apt-studio-card-modal.is-confirmed-locked textarea,
.apt-studio-card-modal.is-confirmed-locked select {
  background-color: #f8fafc !important;
  color: #64748b !important;
  cursor: not-allowed !important;
  border-color: #e2e8f0 !important;
}

/* ==========================================================================
   Studio Client Card / Profile Modal (Altegio Luxury Style)
   ========================================================================== */
.client-studio-modal {
  order: 2 !important;
  width: min(840px, 52vw) !important;
  max-width: 840px !important;
  max-height: 94vh !important;
  display: none !important;
  flex-direction: column !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-shadow: none !important;
  border: none !important;
  flex-shrink: 0 !important;
}

.client-studio-modal.open {
  display: flex !important;
  animation: clientSlideInFlush 0.22s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

@keyframes clientSlideInFlush {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.apt-client-action-btn.is-active {
  background: #e0f2fe !important;
  border-color: #008be3 !important;
  color: #008be3 !important;
}

@media (max-width: 1280px) {
  .apt-workspace-container.has-client-open .apt-studio-card-modal {
    width: 540px !important;
  }
  .client-studio-modal {
    width: 660px !important;
  }
}

.client-modal-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 20px 28px 12px 28px !important;
  background: #ffffff !important;
}

.client-modal-title {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 !important;
}

.client-modal-close-btn {
  width: 32px !important;
  height: 32px !important;
  border: none !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 24px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
}

.client-modal-close-btn:hover {
  color: #0f172a !important;
}

.client-modal-tabs {
  display: flex !important;
  align-items: center !important;
  gap: 24px !important;
  padding: 0 28px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
}

.client-tab-btn {
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  padding: 12px 4px !important;
  font-size: 14.5px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  position: relative !important;
}

.client-tab-btn:hover {
  color: #008be3 !important;
}

.client-tab-btn.active {
  color: #008be3 !important;
  border-bottom-color: #008be3 !important;
}

.client-modal-body {
  padding: 22px 28px !important;
  max-height: calc(86vh - 160px) !important;
  overflow-y: auto !important;
}

.client-profile-grid {
  display: grid !important;
  grid-template-columns: 1fr 310px !important;
  gap: 28px !important;
}

.client-profile-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

.client-form-row {
  display: flex !important;
  gap: 16px !important;
}

.client-field-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.client-field-group.flex-1 { flex: 1 !important; }
.client-field-group.flex-2 { flex: 2 !important; }
.client-field-group.full-width { width: 100% !important; }

.client-field-label {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #64748b !important;
  transition: color 0.15s ease !important;
}

.client-field-group:focus-within .client-field-label {
  color: #008be3 !important;
}

.client-form-input,
.client-form-select,
.client-form-textarea {
  width: 100% !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  font-size: 13.5px !important;
  color: #0f172a !important;
  outline: none !important;
  box-sizing: border-box !important;
  background: #ffffff !important;
}

.client-form-input:focus,
.client-form-select:focus,
.client-form-textarea:focus {
  border-color: #008be3 !important;
  box-shadow: 0 0 0 3px rgba(0, 139, 227, 0.12) !important;
}

.client-form-textarea {
  resize: vertical !important;
  min-height: 84px !important;
}

.client-toggles-wrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  margin-top: 4px !important;
}

.client-toggle-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  cursor: pointer !important;
  user-select: none !important;
}

.client-toggle-item input {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.client-switch-slider {
  width: 40px !important;
  height: 22px !important;
  background-color: #cbd5e1 !important;
  border-radius: 20px !important;
  position: relative !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
}

.client-switch-slider::before {
  content: "" !important;
  position: absolute !important;
  height: 18px !important;
  width: 18px !important;
  left: 2px !important;
  bottom: 2px !important;
  background-color: #ffffff !important;
  border-radius: 50% !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

.client-toggle-item input:checked + .client-switch-slider {
  background-color: #008be3 !important;
}

.client-toggle-item input:checked + .client-switch-slider::before {
  transform: translateX(18px) !important;
}

.client-toggle-text {
  font-size: 13.5px !important;
  color: #1e293b !important;
  font-weight: 500 !important;
}

.client-extra-info-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-top: 10px !important;
  border-top: 1px solid #f1f5f9 !important;
}

.client-extra-info-title {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
}

.client-extra-info-edit {
  border: none !important;
  background: transparent !important;
  color: #008be3 !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}

.client-extra-info-edit:hover {
  text-decoration: underline !important;
}

/* Right Stats Column */
.client-stats-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

.client-stat-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 12px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.client-stat-head {
  font-size: 12px !important;
  color: #64748b !important;
  font-weight: 500 !important;
}

.client-stat-progress-track {
  width: 100% !important;
  height: 6px !important;
  background: #e2e8f0 !important;
  border-radius: 3px !important;
  overflow: hidden !important;
  margin: 2px 0 !important;
}

.client-stat-progress-bar {
  height: 100% !important;
  background: #10b981 !important;
  border-radius: 3px !important;
}

.client-stat-ratio {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

.client-stat-date {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

.client-stat-metric-card {
  padding: 14px 16px !important;
  gap: 8px !important;
}

.client-stat-icon-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
}

.client-stat-big-val {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.2 !important;
}

.client-stat-sub-val {
  font-size: 12px !important;
  color: #64748b !important;
  line-height: 1.3 !important;
}

.client-stat-sub-val small {
  display: block !important;
  color: #94a3b8 !important;
  font-size: 11px !important;
}

/* Client Modal Footer */
.client-modal-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  padding: 16px 28px !important;
  border-top: 1px solid #f1f5f9 !important;
  background: #ffffff !important;
}

.btn-client-modal-save {
  height: 42px !important;
  padding: 0 28px !important;
  background: #008be3 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.btn-client-modal-save:hover {
  background: #007bc9 !important;
  transform: translateY(-1px) !important;
}





/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Architecture for Eleven CRM
   ========================================================================== */

/* Toggle Calendar Sidebar Button in Schedule Toolbar */
.btn-toggle-calendar-sidebar {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-toggle-calendar-sidebar:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-toggle-calendar-sidebar.is-active {
  background: #008be3;
  color: #ffffff;
  border-color: #008be3;
}

.crm-sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  /* Prevent any accidental horizontal overflow */
  html, body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
  }

  /* 1. Shell: Switch from 2-column grid to responsive vertical flex layout */
  .crm-shell {
    display: flex !important;
    flex-direction: column !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    width: 100% !important;
    overflow: hidden !important;
  }

  /* 2. Appbar: Clean responsive header with scrollable horizontal tab bar */
  .crm-appbar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: auto !important;
    min-height: 48px !important;
    padding: 6px 12px 4px 12px !important;
    gap: 8px !important;
    background: #1a1a1a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    flex-shrink: 0 !important;
    z-index: 100 !important;
  }

  .crm-brand {
    width: auto !important;
    gap: 6px !important;
    flex: none !important;
  }

  .crm-brand img {
    width: 22px !important;
    height: 30px !important;
  }

  .crm-brand span {
    font-size: 13px !important;
    letter-spacing: 0.08em !important;
  }

  .crm-account {
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .crm-branch {
    width: 135px !important;
    max-width: 150px !important;
    height: 30px !important;
    font-size: 11.5px !important;
    padding: 0 20px 0 8px !important;
    background-size: 9px !important;
    background-position: right 6px center !important;
  }

  .crm-user {
    width: 30px !important;
    height: 30px !important;
    font-size: 12.5px !important;
  }

  .crm-logout-btn {
    height: 28px !important;
    padding: 0 10px !important;
    font-size: 11.5px !important;
  }

  .crm-nav {
    order: 3 !important;
    width: 100% !important;
    height: 38px !important;
    margin: 2px 0 0 0 !important;
    padding: 2px 0 4px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  }

  .crm-nav::-webkit-scrollbar {
    display: none !important;
  }

  .crm-nav .crm-link {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    height: 28px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
    border-radius: 5px !important;
  }

  /* 3. Off-Canvas Sidebar Drawer for Schedule */
  .crm-sidebar-backdrop {
  display: none;
}

/* Universal rule for table wrappers to guarantee no horizontal viewport blowouts */
.overflow {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  box-sizing: border-box !important;
}

@media (max-width: 900px) {
  /* Prevent horizontal screen expansion at the root */
  html, body {
    overflow-x: hidden !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .crm {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* 1. Shell: Responsive vertical layout */
  .crm-shell {
    display: flex !important;
    flex-direction: column !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden !important;
    position: relative !important;
    box-sizing: border-box !important;
  }

  /* 2. Top Appbar: Clean responsive single-row header */
  .crm-appbar {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 10px !important;
    gap: 6px !important;
    background: #18191b !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    flex-shrink: 0 !important;
    z-index: 100 !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  .crm-brand {
    width: auto !important;
    gap: 6px !important;
    flex: 0 0 auto !important;
  }

  .crm-brand img {
    width: 20px !important;
    height: 28px !important;
  }

  .crm-brand span {
    font-size: 12px !important;
    letter-spacing: 0.08em !important;
  }

  .crm-nav-wrapper {
    flex: 0 1 auto !important;
    min-width: 0 !important;
  }

  .crm-nav-trigger {
    height: 30px !important;
    padding: 0 8px !important;
    gap: 5px !important;
    font-size: 11.5px !important;
    max-width: 140px !important;
  }

  .crm-nav-trigger-text {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .crm-nav.crm-nav-dropdown {
    top: calc(100% + 6px) !important;
    left: 8px !important;
    right: auto !important;
    min-width: 220px !important;
    max-width: calc(100vw - 16px) !important;
  }

  .crm-account {
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex: 0 0 auto !important;
  }

  .crm-branch {
    width: 105px !important;
    max-width: 115px !important;
    height: 28px !important;
    font-size: 11px !important;
    padding: 0 16px 0 6px !important;
    background-size: 8px !important;
    background-position: right 5px center !important;
    text-overflow: ellipsis !important;
  }

  .crm-user {
    width: 28px !important;
    height: 28px !important;
    font-size: 11.5px !important;
    flex-shrink: 0 !important;
  }

  .crm-logout-btn {
    height: 28px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
    flex-shrink: 0 !important;
  }

  /* 3. Off-Canvas Sidebar Drawer for Schedule */
  .crm-sidebar-backdrop {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    z-index: 1190 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .crm-sidebar-backdrop.is-active {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .crm-shell:not(.view-clients):not(.view-staff):not(.view-finance):not(.view-no-sidebar) .crm-left {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: min(300px, 86vw) !important;
    height: 100dvh !important;
    z-index: 1200 !important;
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.3) !important;
    background: #ffffff !important;
    transform: translateX(0) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 16px 14px !important;
  }

  .crm-shell.sidebar-collapsed:not(.view-clients):not(.view-staff):not(.view-finance) .crm-left {
    transform: translateX(-105%) !important;
    pointer-events: none !important;
    box-shadow: none !important;
  }

  /* 4. Sub-Navigation (Клиенты, Персонал, Финансы) as Compact Top Bar */
  .crm-shell.view-clients .crm-left,
  .crm-shell.view-staff .crm-left,
  .crm-shell.view-finance .crm-left {
    display: block !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: auto !important;
    min-height: auto !important;
    padding: 6px 10px !important;
    border-right: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
  }

  .crm-shell.view-clients .crm-left::-webkit-scrollbar,
  .crm-shell.view-staff .crm-left::-webkit-scrollbar,
  .crm-shell.view-finance .crm-left::-webkit-scrollbar {
    display: none !important;
  }

  .sidebar-clients-nav,
  .sidebar-staff-nav,
  .sidebar-finance-nav {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    width: max-content !important;
    min-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  .clients-nav-item,
  .staff-nav-item,
  .finance-nav-item {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    height: 36px !important;
    width: auto !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
    box-sizing: border-box !important;
    transition: all 0.15s ease !important;
  }

  .clients-nav-item:hover,
  .staff-nav-item:hover,
  .finance-nav-item:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
  }

  .clients-nav-item.active,
  .staff-nav-item.active,
  .finance-nav-item.active {
    background: #008be3 !important;
    color: #ffffff !important;
    border-color: #008be3 !important;
    box-shadow: 0 1px 3px rgba(0, 139, 227, 0.25) !important;
  }

  .clients-nav-icon,
  .staff-nav-icon,
  .finance-nav-icon {
    width: 16px !important;
    height: 16px !important;
    stroke: currentColor !important;
  }

  /* 5. Main Area & General View Wrapper */
  .crm-main {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  .crm-view {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  .crm-view#schedule {
    display: none;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .crm-view#schedule.active {
    display: flex !important;
  }

  /* 6. Schedule View */
  .btn-toggle-calendar-sidebar {
    display: inline-flex !important;
  }

  .schedule-toolbar {
    height: auto !important;
    min-height: auto !important;
    padding: 8px 12px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  .schedule-date {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .schedule-date h1 {
    font-size: 14px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
  }

  .toolbar-divider {
    height: 14px !important;
    margin: 0 2px !important;
  }

  .cash-total {
    font-size: 13px !important;
    padding: 2px 6px !important;
    flex-shrink: 0 !important;
  }

  .schedule-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100% !important;
    flex-shrink: 0 !important;
  }

  .btn-schedule-sale {
    height: 30px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
    flex-shrink: 0 !important;
  }

  .schedule-view-mode-toggle {
    margin-left: auto !important;
    height: 30px !important;
  }

  .view-mode-btn {
    padding: 0 10px !important;
    font-size: 12px !important;
    height: 28px !important;
  }

  .schedule-content-wrap {
    height: 100% !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .schedule-scroll,
  .schedule-week-scroll,
  .schedule-month-scroll {
    height: 100% !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .schedule-board {
    min-width: 980px !important;
  }

  .staff-head {
    height: 60px !important;
    grid-template-columns: 44px repeat(7, minmax(130px, 1fr)) 44px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
  }

  .staff-head-cell {
    padding: 6px 8px !important;
    gap: 8px !important;
  }

  .staff-head-cell img {
    width: 32px !important;
    height: 32px !important;
  }

  .staff-head-cell strong {
    font-size: 12px !important;
  }

  .staff-head-cell small {
    font-size: 10px !important;
  }

  .schedule-body {
    grid-template-columns: 44px repeat(7, minmax(130px, 1fr)) 44px !important;
  }

  .staff-head > .time-head:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 15 !important;
    background: #ffffff !important;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.05) !important;
  }

  .schedule-body > .time-rail:first-child,
  .schedule-body > .time-rail {
    position: sticky !important;
    left: 0 !important;
    z-index: 14 !important;
    background: #ffffff !important;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.05) !important;
  }

  .schedule-legend {
    padding: 6px 12px !important;
    font-size: 11px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  /* 7. Appointments View */
  .apts-view-container {
    padding: 12px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .apts-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding-bottom: 12px !important;
  }

  .apts-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .apts-date-group {
    width: 100% !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
  }

  .apts-search-wrap {
    width: 100% !important;
    min-width: 0 !important;
  }

  .apts-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* 8. РАЗДЕЛ: КЛИЕНТЫ */
  #clients {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    padding: 0 !important;
  }

  .clients-subview {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  .clients-view-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .clients-title {
    font-size: 18px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
  }

  .clients-subtitle {
    font-size: 12px !important;
    margin: 2px 0 0 0 !important;
  }

  .clients-head-actions {
    display: flex !important;
    width: 100% !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }

  .btn-clients-report,
  .btn-new-client,
  .btn-clients-back,
  .btn-clients-export {
    flex: 1 1 calc(50% - 4px) !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }

  .clients-search-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 0 14px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .client-filter-input {
    width: 100% !important;
    max-width: 100% !important;
    height: 40px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
  }

  .btn-clients-search {
    width: 100% !important;
    height: 40px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    box-sizing: border-box !important;
  }

  .clients-results-section {
    padding: 0 14px 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .clients-results-count {
    font-size: 16px !important;
  }

  .clients-table-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .sonline-clients-table {
    min-width: 680px !important;
    width: 100% !important;
  }

  .clients-kpi-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 0 14px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .clients-kpi-card {
    padding: 12px 14px !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
  }

  .clients-kpi-card .kpi-label {
    font-size: 10.5px !important;
  }

  .clients-kpi-card .kpi-val {
    font-size: 18px !important;
  }

  .clients-report-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    padding: 0 14px 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .clients-report-card {
    padding: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .clients-top-table {
    min-width: 640px !important;
    width: 100% !important;
  }

  /* 9. РАЗДЕЛ: ПЕРСОНАЛ */
  #staff {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    padding: 0 !important;
  }

  .staff-view-container {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .staff-subview {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  .staff-roster-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .staff-roster-title {
    font-size: 18px !important;
    margin: 0 !important;
  }

  .btn-roster-add-staff {
    width: 100% !important;
    height: 40px !important;
    justify-content: center !important;
    font-size: 13.5px !important;
    box-sizing: border-box !important;
  }

  .staff-roster-toolbar {
    padding: 0 14px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .roster-radio-group {
    display: flex !important;
    gap: 12px !important;
    width: max-content !important;
  }

  .staff-roster-card {
    margin: 0 14px 20px !important;
    width: calc(100% - 28px) !important;
    max-width: calc(100% - 28px) !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .staff-roster-table {
    min-width: 680px !important;
    width: 100% !important;
  }

  .staff-page-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .staff-page-title {
    font-size: 18px !important;
    margin: 0 !important;
  }

  .btn-add-staff {
    width: 100% !important;
    height: 40px !important;
    justify-content: center !important;
    font-size: 13.5px !important;
    box-sizing: border-box !important;
  }

  .staff-toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 0 14px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .staff-toolbar-left {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .staff-period-switcher {
    display: flex !important;
    width: 100% !important;
  }

  .staff-period-btn {
    flex: 1 1 33.3% !important;
    text-align: center !important;
    padding: 7px 4px !important;
    font-size: 12px !important;
  }

  .staff-date-filter {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .staff-date-input-wrap {
    flex: 1 !important;
  }

  .staff-date-input {
    width: 100% !important;
    height: 38px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
  }

  .staff-search-input-wrap {
    width: 100% !important;
  }

  .staff-search-input {
    width: 100% !important;
    height: 38px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
  }

  .btn-staff-show {
    width: 100% !important;
    height: 40px !important;
    font-size: 13.5px !important;
  }

  .staff-toolbar-right {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    gap: 10px !important;
  }

  .staff-sort-select-wrap {
    flex: 1 !important;
    max-width: 180px !important;
  }

  .staff-sort-select {
    width: 100% !important;
    font-size: 13px !important;
    height: 36px !important;
  }

  .staff-schedule-matrix-wrapper {
    padding: 0 14px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .staff-schedule-matrix-scroll {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
    border-radius: 8px !important;
  }

  .staff-matrix-table {
    min-width: 820px !important;
  }

  .staff-sticky-col {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    padding: 6px 8px !important;
  }

  .master-info-box {
    gap: 6px !important;
  }

  .master-avatar-img {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0 !important;
  }

  .master-name-text {
    font-size: 11.5px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .staff-day-cell {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    padding: 4px 1px !important;
  }

  .day-header-num {
    font-size: 12px !important;
  }

  .staff-footer {
    padding: 12px 14px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .staff-legend-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px 10px !important;
    font-size: 11px !important;
  }

  .btn-staff-history {
    width: 100% !important;
    justify-content: center !important;
    height: 38px !important;
  }

  .staff-profile-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    padding: 12px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .staff-profile-sidebar {
    width: 100% !important;
    max-width: 100% !important;
  }

  .staff-profile-main-col {
    width: 100% !important;
    min-width: 0 !important;
  }

  .staff-profile-tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
  }

  .staff-form-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .master-weekly-card-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px 14px !important;
  }

  .btn-save-weekly-schedule {
    width: 100% !important;
    height: 40px !important;
  }

  .master-weekly-table-wrap {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* 10. РАЗДЕЛ: ФИНАНСЫ */
  #finance {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    padding: 0 !important;
  }

  .finance-view-container {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 12px 14px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .finance-subview {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  .finance-subview-head {
    margin-bottom: 12px !important;
    width: 100% !important;
  }

  .fin-title-wrap {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    width: 100% !important;
  }

  .fin-title {
    font-size: 18px !important;
    line-height: 1.25 !important;
    margin: 0 !important;
  }

  .fin-subtitle {
    font-size: 12px !important;
    line-height: 1.3 !important;
  }

  .fin-years-bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 10px !important;
    padding-bottom: 8px !important;
    margin-bottom: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    scrollbar-width: none !important;
  }

  .fin-years-bar::-webkit-scrollbar {
    display: none !important;
  }

  .fin-year-link {
    font-size: 14px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 4px 8px !important;
  }

  .fin-year-link.active {
    font-size: 15px !important;
    background: #008be3 !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    padding: 4px 10px !important;
  }

  .fin-metrics-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .fin-metric-card {
    padding: 12px 14px !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
  }

  .fin-metric-label {
    font-size: 10px !important;
  }

  .fin-metric-val {
    font-size: 18px !important;
  }

  .fin-metric-sub {
    font-size: 11px !important;
  }

  .fin-card,
  .fin-table-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .fin-annual-table,
  .fin-daily-matrix-table,
  .fin-compare-table {
    min-width: 860px !important;
    font-size: 12.5px !important;
  }

  .fin-annual-table th,
  .fin-annual-table td,
  .fin-daily-matrix-table th,
  .fin-daily-matrix-table td,
  .fin-compare-table th,
  .fin-compare-table td {
    padding: 8px 10px !important;
  }

  .fin-annual-table th.th-fin-row-label,
  .fin-daily-matrix-table th.th-fin-row-label,
  .fin-compare-table th.th-comp-name {
    position: sticky !important;
    left: 0 !important;
    z-index: 5 !important;
    background: #f8fafc !important;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05) !important;
  }

  .fin-annual-table td:first-child,
  .fin-daily-matrix-table td:first-child,
  .fin-compare-table td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 4 !important;
    background: #ffffff !important;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05) !important;
  }

  .fin-daily-controls,
  .fin-filter-bar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
  }

  /* 11. Shop View */
  .shop-view-container {
    padding: 12px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .shop-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .shop-header-actions {
    width: 100% !important;
  }

  .shop-btn-add-product {
    width: 100% !important;
    justify-content: center !important;
    height: 38px !important;
  }

  .shop-filter-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  /* 12. Services & Settings View */
  .services-view-container,
  .settings-view-container {
    padding: 12px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .services-header,
  .settings-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .btn-primary-action {
    width: 100% !important;
    justify-content: center !important;
    height: 38px !important;
  }

  .services-metrics-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .settings-grid,
  .branch-card-body {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* 13. Responsive Modals & Drawers across the whole CRM */
  .crm-modal-backdrop {
    padding: 8px !important;
    align-items: flex-end !important;
  }

  .crm-modal-panel {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 20px) !important;
    margin: 0 !important;
    border-radius: 16px 16px 8px 8px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 16px !important;
    box-sizing: border-box !important;
  }

  .crm-modal-panel.two-panel-modal {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 0 !important;
  }

  .two-panel-col.left-col,
  .two-panel-col.right-col {
    width: 100% !important;
    border-left: none !important;
    padding: 16px !important;
    box-sizing: border-box !important;
  }

  .two-panel-col.right-col {
    border-top: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
  }

  .modal-col-scroll {
    max-height: none !important;
    overflow: visible !important;
  }

  .form-section-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .modal-form-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .modal-form-col {
    width: 100% !important;
  }

  /* 14. Prevent iOS Safari auto-zoom on form focus */
  input, select, textarea {
    font-size: 16px !important;
  }

  .time-input, .time-end-select, .custom-select-wrap select {
    font-size: 15px !important;
  }
}

@media (max-width: 520px) {
  .apts-metrics-grid,
  .services-metrics-row,
  .clients-kpi-grid,
  .fin-metrics-row {
    grid-template-columns: 1fr !important;
  }

  .crm-branch {
    width: 110px !important;
    font-size: 11px !important;
  }

  .schedule-date h1 {
    font-size: 13px !important;
  }

  .btn-clients-report,
  .btn-new-client,
  .btn-clients-back,
  .btn-clients-export {
    flex: 1 1 100% !important;
  }
}
