:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #eef4f8;
  --ink: #061d42;
  --muted: #657383;
  --line: #d9e2ea;
  --brand: #1f6f8b;
  --brand-dark: #14506a;
  --ok: #1f8a5b;
  --warn: #b26b00;
  --danger: #b84545;
  --shadow: 0 16px 40px rgba(23, 32, 42, 0.08);
}

@media (max-width: 720px) {
  .calendar-panel {
    padding: 12px 10px 14px;
  }

  .calendar-grid {
    grid-template-rows: repeat(6, 66px);
    gap: 6px;
  }

  .day-cell {
    min-height: 66px;
    padding: 4px 3px;
    display: grid;
    grid-template-rows: 26px minmax(0, 1fr);
    align-items: stretch;
    justify-items: center;
    gap: 2px;
    overflow: hidden;
    text-align: center;
  }

  .day-number,
  .day-cell .day-number,
  .day-cell.is-selected .day-number {
    align-self: start;
    color: #078be2;
    font-size: 21px;
    font-weight: 820;
    line-height: 24px;
  }

  .day-cell:has(.has-bookings) .day-number {
    color: #c54545;
  }

  .day-cell.is-muted .day-number {
    color: #b8c1cd;
  }

  .day-cell.is-selected .day-number {
    color: #fff;
  }

  .day-badges {
    align-self: end;
    width: 100%;
    display: grid;
    grid-auto-rows: 13px;
    gap: 2px;
    min-height: 13px;
  }

  .booking-count,
  .day-cell .booking-count,
  .day-cell .booking-count.has-bookings,
  .day-cell .booking-count.rental-count {
    min-height: 13px;
    height: 13px;
    padding: 0 3px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 820;
    line-height: 13px;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .day-cell.is-selected .booking-count,
  .day-cell.is-selected .booking-count.has-bookings {
    background: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.78);
  }

  .day-cell.is-selected .rental-count {
    background: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.9);
  }
}

@media (max-width: 820px) {
  #adminDialog .dialog-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  #adminDialog .admin-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #adminDialog .admin-head-actions > button {
    width: 100%;
    min-width: 0;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #adminDialog .admin-database-nav {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-columns: initial;
    overflow-x: hidden;
  }

  #adminDialog .admin-database-nav button {
    width: 100%;
    min-width: 0;
  }

  #adminDialog .admin-db-table {
    overflow-x: hidden;
  }

  #adminDialog .admin-db-head-row {
    display: none;
  }

  #adminDialog .admin-db-row {
    width: 100%;
    min-width: 0 !important;
    grid-template-columns: 1fr !important;
    gap: 6px;
    padding-block: 10px;
  }

  #adminDialog .admin-db-row > span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 380px) {
  .calendar-grid {
    grid-template-rows: repeat(6, 58px);
    gap: 5px;
  }

  .day-cell {
    min-height: 58px;
    grid-template-rows: 23px minmax(0, 1fr);
    padding: 3px 2px;
  }

  .day-number,
  .day-cell .day-number,
  .day-cell.is-selected .day-number {
    font-size: 19px;
    line-height: 22px;
  }

  .day-badges {
    grid-auto-rows: 12px;
    gap: 1px;
  }

  .booking-count,
  .day-cell .booking-count,
  .day-cell .booking-count.has-bookings,
  .day-cell .booking-count.rental-count {
    min-height: 12px;
    height: 12px;
    padding: 0 2px;
    font-size: 7px;
    line-height: 12px;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

option {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.auth-screen {
  min-height: 100vh;
  padding: 20px;
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 12px;
}

.auth-logo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 4px 14px rgba(6, 29, 66, 0.14);
}

.auth-card h1 {
  font-size: 30px;
  line-height: 1.08;
  white-space: normal;
}

.auth-card p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.2;
}

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

.form-error {
  color: var(--danger);
  font-weight: 700;
}

.app-shell {
  height: 100vh;
  padding: 10px 14px 8px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  overflow: hidden;
}

.topbar,
.stats-row,
.workspace,
.month-tabs {
  width: min(1500px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-block {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 2px 8px rgba(6, 29, 66, 0.12);
}

.brand-block > div {
  min-width: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

.topbar p,
.stat span,
.eyebrow,
.booking-meta,
.empty-state {
  color: var(--muted);
}

.topbar p {
  margin-top: 4px;
  font-size: 15px;
}

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

.user-badge {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.mobile-new-booking-button {
  display: none;
}

.icon-button,
.primary-button,
.secondary-button,
.danger-button,
.nav-button {
  border: 0;
  border-radius: 10px;
  min-height: 42px;
  padding: 0 16px;
  color: var(--ink);
  font-size: 16px;
}

.icon-button,
.secondary-button {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 6px 14px rgba(6, 29, 66, 0.035);
}

.primary-button {
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

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

.danger-button {
  background: #fff1f1;
  color: var(--danger);
  border: 1px solid #f0c5c5;
}

.nav-button {
  width: 46px;
  padding: 0;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 30px;
  font-weight: 800;
}

.topbar .icon-button {
  min-height: 40px;
  border-radius: 10px;
  padding: 0 14px;
  color: #081b3d;
  font-size: 15px;
  font-weight: 720;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #dfe8f4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 8px 20px rgba(10, 29, 66, 0.06);
}

.topbar .icon-button:hover,
.month-tab:hover,
.calendar-head .nav-button:hover {
  border-color: #bfcfde;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 10px 22px rgba(6, 29, 66, 0.07);
}

.topbar .message-button {
  position: relative;
  padding-right: 18px;
}

.topbar #topTasksBtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.crm-task-counters {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.crm-task-counter {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.crm-task-counter.is-overdue {
  background: #fff1f1;
  color: #c54545;
}

.crm-task-counter.is-today {
  background: #eaf8f0;
  color: #16834d;
}

.crm-task-counter[hidden] {
  display: none;
}

.message-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(239, 68, 68, 0.28);
}

.message-badge[hidden] {
  display: none;
}

.calendar-head .nav-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border: 1px solid #e3ebf5;
  border-radius: 10px;
  background: linear-gradient(180deg, #f4f8fe 0%, #edf3fa 100%);
  color: #185cff;
  font-size: 26px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 7px 18px rgba(10, 29, 66, 0.05);
}

.day-panel-head .primary-button {
  min-height: 40px;
  border-radius: 10px;
  padding: 0 16px;
  background: linear-gradient(135deg, #316fff 0%, #1857f1 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 820;
  border: 1px solid rgba(24, 87, 241, 0.34);
  box-shadow: 0 10px 22px rgba(31, 96, 255, 0.22);
}

.day-panel-head .primary-button:hover {
  background: linear-gradient(135deg, #245fff 0%, #154de1 100%);
}

#addCrmClientBtn,
#addClientMessageBtn {
  background: linear-gradient(135deg, #316fff 0%, #1857f1 100%);
  border: 1px solid rgba(24, 87, 241, 0.34);
  box-shadow: 0 10px 22px rgba(31, 96, 255, 0.22);
}

#addCrmClientBtn:hover,
#addClientMessageBtn:hover {
  background: linear-gradient(135deg, #245fff 0%, #154de1 100%);
}

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

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 60px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.stat.is-clickable {
  cursor: pointer;
}

.stat.is-clickable:hover,
.stat.is-clickable:focus-visible {
  border-color: #9bb7d6;
  box-shadow: 0 2px 8px rgba(6, 29, 66, 0.1);
  outline: none;
}

.stat strong {
  color: #061d42;
  font-size: 18px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.stat-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.stat-copy > span {
  color: #5f6d7c;
  font-size: 16px;
  font-weight: 520;
  line-height: 1.1;
}

.stat-copy small {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 620;
  line-height: 1.05;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-repeat .stat-icon {
  color: #1d63ff;
  background: linear-gradient(135deg, #eef4ff 0%, #e4edff 100%);
}

.stat-new .stat-icon {
  color: #168a55;
  background: linear-gradient(135deg, #edf9f2 0%, #def3e7 100%);
}

.stat-lost .stat-icon {
  color: #d94b45;
  background: linear-gradient(135deg, #fff0f0 0%, #ffe4e4 100%);
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(660px, 1.28fr);
  gap: 10px;
  overflow: hidden;
}

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

.calendar-panel {
  min-height: 0;
  overflow: hidden;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.calendar-head,
.day-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calendar-head h2,
.day-panel h2 {
  font-size: 18px;
}

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

.weekdays {
  margin-top: 6px;
}

.weekdays span {
  min-height: 18px;
  font-size: 13px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.calendar-grid {
  margin-top: 5px;
  flex: 0 0 auto;
  min-height: 0;
  grid-template-rows: repeat(6, minmax(58px, 68px));
}

.day-cell {
  position: relative;
  aspect-ratio: auto;
  min-height: 0;
  min-width: 0;
  border: 1px solid #e2e9f1;
  border-radius: 8px;
  background: #fff;
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  overflow: hidden;
}

.pending-day-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 1px 4px rgba(178, 107, 0, 0.28);
  pointer-events: none;
}

.day-cell.is-muted .pending-day-dot {
  opacity: 0.75;
}

.day-cell.is-selected .pending-day-dot {
  border-color: rgba(255, 255, 255, 0.92);
}

.day-cell:hover {
  border-color: var(--brand);
}

.day-cell.is-muted {
  background: #f8fafc;
  color: #a2adba;
}

.day-cell.is-selected {
  outline: 3px solid rgba(31, 111, 139, 0.2);
  border-color: var(--brand);
}

.day-number {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.day-badges {
  width: 100%;
  display: grid;
  gap: 3px;
}

.booking-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 17px;
  width: 100%;
  max-width: 100%;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--brand-dark);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
}

.booking-count.has-bookings {
  background: #fff1f1;
  color: #b84545;
}

.rental-count {
  background: #e8f6eb;
  color: #29983d;
}

.day-panel {
  min-height: 0;
  overflow: hidden;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fbfcfe;
}

.eyebrow {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 800;
}

.schedule-list {
  flex: 1;
  display: grid;
  grid-template-rows: 14px;
  grid-auto-rows: minmax(24px, auto);
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 6px 1px 1px;
  scrollbar-gutter: stable;
}

.schedule-list .schedule-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 14px;
  background: #fbfcfe;
}

.schedule-header {
  display: grid;
  grid-template-columns: minmax(68px, 0.55fr) minmax(0, 3.45fr);
  gap: 4px;
  align-items: center;
}

.quarter-headings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.quarter-headings span {
  color: #061d42;
  font-size: 13px;
  font-weight: 780;
  text-align: center;
}

.schedule-hour,
.schedule-grid {
  display: grid;
  grid-template-columns: minmax(68px, 0.55fr) minmax(0, 3.45fr);
  gap: 3px;
  min-height: 24px;
  align-items: stretch;
}

.schedule-grid {
  grid-template-columns: minmax(68px, 0.55fr) repeat(4, minmax(0, 1fr));
  grid-auto-rows: 22px;
  min-height: 0;
}

.schedule-hour-label {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(216, 224, 234, 0.58);
  border-radius: 6px;
  background: rgba(245, 249, 253, 0.78);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: none;
  font-size: clamp(9px, 0.62vw, 11px);
  font-weight: 900;
  line-height: 1;
}

.schedule-hour-label::before,
.schedule-hour-label::after {
  content: none;
}

.schedule-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  min-height: 0;
}

.time-slot {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(214, 231, 222, 0.42);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(248, 254, 250, 0.78), rgba(250, 255, 252, 0.86)),
    #fbfffc;
  padding: 1px 4px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  color: #2d9b41;
  text-align: center;
  box-shadow: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.time-slot:hover {
  border-color: rgba(190, 219, 201, 0.64);
  background:
    linear-gradient(180deg, rgba(243, 253, 247, 0.9), rgba(249, 255, 251, 0.96)),
    #f8fdf9;
  transform: translateY(-1px);
}

.time-slot strong,
.time-slot span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-slot strong {
  color: #14863d;
  font-size: clamp(7px, 0.48vw, 9px);
  font-weight: 720;
  line-height: 1.05;
}

.time-slot:not(.is-booked) strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.time-slot:not(.is-booked) strong::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #15944a;
  box-shadow: none;
}

.time-slot.is-booked {
  place-items: stretch;
  justify-items: stretch;
  align-content: stretch;
  padding: 5px 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.06)),
    var(--booking-color, #e8eef8);
  border-color: var(--booking-border, #d5dfef);
  color: var(--booking-text, #0b1f4d);
  text-align: left;
  box-shadow: none;
}

.time-slot.is-booked.has-booking-content {
  z-index: 3;
  min-height: 0;
  padding: 6px 8px 4px;
}

.time-slot.is-booked:hover {
  border-color: var(--booking-border, #d5dfef);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04)),
    var(--booking-color, #e8eef8);
}

.time-slot.is-booked.has-booking-content {
  border-color: var(--booking-border, #d5dfef);
}

.time-slot .booked-cell {
  min-width: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: start;
  gap: 2px;
  overflow: hidden;
  white-space: normal;
}

.time-slot .booked-cell strong,
.time-slot .booked-cell small,
.time-slot .booked-cell em {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-slot .booked-cell strong {
  color: var(--booking-text, #0b1f4d);
  font-size: clamp(8px, 0.52vw, 10px);
  font-weight: 850;
  line-height: 1;
}

.time-slot .booked-cell small {
  margin-top: 0;
  color: var(--booking-text, #0b1f4d);
  font-size: clamp(7px, 0.46vw, 9px);
  font-weight: 760;
  line-height: 1;
}

.time-slot .booking-badge {
  flex: 0 0 auto;
  min-width: 0;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 5px;
  border: 1px solid var(--booking-border, #d5dfef);
  background: color-mix(in srgb, var(--booking-color, #e8eef8) 64%, white);
  color: var(--booking-text, #0b1f4d);
  font-size: clamp(6px, 0.38vw, 8px);
  font-style: normal;
  font-weight: 820;
  line-height: 1;
  box-shadow: none;
}

.time-slot.is-short-booking.has-booking-content {
  padding: 3px 6px 2px;
}

.time-slot.is-short-booking .booked-cell {
  display: grid;
  grid-template-columns: minmax(0, auto) auto minmax(0, auto);
  align-items: center;
  align-content: center;
  justify-items: start;
  gap: 3px;
}

.time-slot.is-short-booking .booked-cell strong {
  font-size: clamp(8px, 0.48vw, 10px);
}

.time-slot.is-short-booking .booked-cell small {
  margin: 0;
  font-size: clamp(7px, 0.42vw, 9px);
}

.time-slot.is-short-booking .booking-badge {
  height: 10px;
  padding: 0 4px;
  font-size: clamp(6px, 0.34vw, 7px);
}

.time-slot .booking-badge.is-custom_rental,
.time-slot .booking-badge.is-own {
  background: #dbe8ff;
  border-color: #a7c5ff;
  color: #1258d6;
}

.time-slot .booking-badge.is-paid,
.time-slot .booking-badge.is-new {
  background: #ffe1bf;
  border-color: #ffb56c;
  color: #df6200;
}

.time-slot .booking-badge.is-ended,
.time-slot .booking-badge.is-repeat {
  background: #e8dcff;
  border-color: #c6adff;
  color: #6536d7;
}

.time-slot .booking-badge.is-pending {
  background: #fff7e6;
  border-color: #edbd58;
  color: #a76300;
}

.time-slot .booking-badge.is-refused,
.time-slot .booking-badge.is-unpaid {
  background: #ffe0df;
  border-color: #ffaaa6;
  color: #ca3232;
}

.time-slot .booking-continuation {
  width: 100%;
  height: 100%;
  min-height: 1px;
}

.slot-detail {
  max-width: 100%;
  color: var(--muted);
  font-size: clamp(7px, 0.48vw, 9px);
  font-weight: 600;
  line-height: 1.05;
  text-align: center;
}

.slot-time {
  color: var(--ink);
  font-size: clamp(10px, 0.76vw, 13px);
  font-weight: 800;
  line-height: 1;
}

.time-slot span:not(.slot-time):not(.slot-detail):not(.booked-cell):not(.booking-continuation) {
  color: #2d9b41;
  font-size: clamp(9px, 0.64vw, 11px);
  line-height: 1;
  text-align: right;
}

.time-slot .slot-detail {
  color: #657383 !important;
  text-align: center !important;
}

.unscheduled-group {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.unscheduled-booking {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.unscheduled-booking span,
.unscheduled-booking small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.status.paid {
  background: #e7f6ee;
  color: var(--ok);
}

.status.confirmed {
  background: #e6f8f0;
  color: #17835d;
}

.status.ended {
  background: #eaf1ff;
  color: #315f9b;
}

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

.status.custom_rental {
  background: #eef4f8;
  color: var(--brand-dark);
}

.status.refused {
  background: #fff1f1;
  color: var(--danger);
}

.booking-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 14px;
}

.booking-note {
  color: #384656;
  word-break: break-word;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  min-height: 120px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
}

.month-tabs {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  bottom: 0;
  background: rgba(244, 247, 251, 0.92);
  padding: 0;
  backdrop-filter: blur(10px);
}

.month-tab {
  border: 1px solid #dfe8f4;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border-radius: 10px;
  min-height: 31px;
  color: #24272d;
  font-weight: 820;
  font-size: 13px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 7px 18px rgba(10, 29, 66, 0.05);
}

.month-tab.is-active {
  background: linear-gradient(135deg, #316fff 0%, #1857f1 100%);
  color: #fff;
  border-color: rgba(24, 87, 241, 0.45);
  box-shadow: 0 10px 22px rgba(31, 96, 255, 0.24);
}

.booking-dialog {
  width: min(1060px, calc(100% - 28px));
  max-height: calc(100vh - 32px);
  border: 0;
  border-radius: 18px;
  padding: 0;
  overflow: auto;
  box-shadow: 0 30px 90px rgba(23, 32, 42, 0.22);
}

.history-dialog {
  width: min(1240px, calc(100% - 120px));
  max-height: calc(100vh - 110px);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 78px rgba(6, 29, 66, 0.2);
}

#adminDialog {
  width: min(1380px, calc(100% - 24px));
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
}

#adminDialog form {
  padding: 34px 38px 32px;
}

.history-dialog form {
  padding: 28px 34px 26px;
}

.crm-dialog {
  width: min(1360px, calc(100% - 24px));
}

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

.booking-dialog::backdrop {
  background: rgba(23, 32, 42, 0.38);
  backdrop-filter: blur(8px);
}

.booking-dialog form {
  padding: 34px 36px 28px;
}

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

.dialog-head h2 {
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.08;
}

.dialog-title-stack {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.dialog-kicker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

#adminDialog .dialog-head h2 {
  font-size: 34px;
  font-weight: 750;
  letter-spacing: 0;
}

.history-dialog .dialog-head h2 {
  font-size: 38px;
  font-weight: 850;
  letter-spacing: 0;
}

.close-button {
  width: 48px;
  height: 48px;
  border: 1px solid #e0e8f2;
  border-radius: 10px;
  background: var(--surface-2);
  color: #1f2933;
  font-size: 28px;
  line-height: 1;
}

#adminDialog .close-button {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #eef3f8;
  color: #1f2933;
}

.history-dialog .close-button {
  width: 48px;
  height: 48px;
  border: 1px solid #d9e4f0;
  border-radius: 13px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  color: #061d42;
  font-size: 26px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 10px 26px rgba(6, 29, 66, 0.08);
}

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

label {
  display: grid;
  gap: 6px;
  color: #314052;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

.booking-field {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 255, 255, 0.9), transparent 38%),
    #fff;
  min-height: 82px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 20px;
  grid-template-areas:
    "icon label affordance"
    "icon control affordance";
  gap: 4px 18px;
  align-items: center;
  box-shadow: 0 10px 26px rgba(6, 29, 66, 0.035);
}

.booking-field-icon {
  grid-area: icon;
  width: 50px;
  height: 50px;
  border: 1px solid #d5e2f0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f3f8ff 0%, #edf5ff 100%);
  color: #526e91;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.booking-field-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.45;
}

.booking-field-label {
  grid-area: label;
  overflow: hidden;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-field > input,
.booking-field > select,
.booking-field > textarea {
  grid-area: control;
  border: 0;
  border-radius: 0;
  min-height: 34px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.2;
}

.booking-field > input::placeholder,
.booking-field > textarea::placeholder {
  color: #a8adb5;
  font-weight: 650;
  opacity: 1;
}

.booking-field > select {
  appearance: none;
  padding-right: 24px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.custom-select-native {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

.custom-select {
  grid-area: control;
  position: relative;
  min-width: 0;
}

.custom-select-trigger {
  width: 100%;
  min-height: 34px;
  border: 0;
  padding: 0 28px 0 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  font-size: 20px;
  font-weight: 650;
}

.custom-select-value {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 12px);
  left: -10px;
  width: min(360px, calc(100vw - 56px));
  max-height: 360px;
  overflow: auto;
  display: none;
  padding: 8px;
  border: 1px solid rgba(6, 29, 66, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 48px rgba(6, 29, 66, 0.18);
}

.custom-select.is-open .custom-select-menu {
  display: grid;
  gap: 2px;
}

.custom-select-option {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  background: transparent;
  color: #20242a;
  text-align: left;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.15;
}

.custom-select-option:hover,
.custom-select-option.is-selected {
  background: #eef4ff;
  color: var(--ink);
}

.custom-select.is-disabled,
.custom-select-option.is-disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.custom-select.is-disabled .custom-select-trigger,
.custom-select-option.is-disabled {
  pointer-events: none;
}

.custom-select-option.is-selected::before {
  content: "✓";
  margin-right: 10px;
  color: var(--ink);
  font-weight: 800;
}

.booking-field:has(select)::after {
  content: "";
  grid-area: affordance;
  width: 10px;
  height: 10px;
  justify-self: end;
  border-right: 2px solid #5f7694;
  border-bottom: 2px solid #5f7694;
  transform: rotate(45deg) translateY(-2px);
}

.booking-field:has(#bookingDate) input::-webkit-calendar-picker-indicator {
  opacity: 0.55;
}

.booking-field:has(#bookingStatus) {
  border-color: #f4d8a7;
  background:
    linear-gradient(135deg, rgba(255, 247, 232, 0.95), rgba(255, 255, 255, 0.98)),
    #fff;
}

.booking-field:has(#bookingStatus) .booking-field-icon {
  border-color: #ffe0a3;
  background: #fff2cf;
  color: #f59e0b;
}

.booking-field[data-status="pending"] > select {
  color: #c47a00;
}

.booking-field[data-status="pending"] .custom-select-trigger {
  color: #c47a00;
}

.booking-field[data-status="paid"] {
  border-color: #b9e8cb;
  background:
    linear-gradient(135deg, rgba(237, 252, 243, 0.95), rgba(255, 255, 255, 0.98)),
    #fff;
}

.booking-field[data-status="paid"] .booking-field-icon,
.booking-field[data-status="paid"] > select,
.booking-field[data-status="paid"] .custom-select-trigger {
  color: var(--ok);
}

.booking-field[data-status="custom_rental"] {
  border-color: #c9deef;
}

.booking-field[data-status="custom_rental"] .booking-field-icon,
.booking-field[data-status="custom_rental"] > select,
.booking-field[data-status="custom_rental"] .custom-select-trigger {
  color: var(--brand);
}

.booking-field[data-status="ended"] {
  border-color: #c9dcff;
}

.booking-field[data-status="ended"] .booking-field-icon,
.booking-field[data-status="ended"] > select,
.booking-field[data-status="ended"] .custom-select-trigger {
  color: #3867c8;
}

.booking-field[data-status="refused"] {
  border-color: #f0b6b6;
  background:
    linear-gradient(135deg, rgba(255, 242, 242, 0.95), rgba(255, 255, 255, 0.98)),
    #fff;
}

.booking-field[data-status="refused"] .booking-field-icon,
.booking-field[data-status="refused"] > select,
.booking-field[data-status="refused"] .custom-select-trigger {
  color: var(--danger);
}

.booking-field > textarea {
  min-height: 92px;
  padding-top: 4px;
  font-size: 18px;
  font-weight: 500;
}

.booking-field:focus-within {
  border-color: #92b4ff;
  box-shadow:
    0 0 0 4px rgba(112, 157, 255, 0.18),
    0 10px 24px rgba(6, 29, 66, 0.06);
}

.booking-field.is-role-locked {
  background:
    linear-gradient(135deg, rgba(247, 250, 255, 0.92), rgba(255, 255, 255, 0.98)),
    #fff;
}

.booking-field.is-role-locked > input:disabled {
  color: #a8adb5;
  -webkit-text-fill-color: #a8adb5;
}

.phone-field-wrapper {
  position: relative;
  min-width: 0;
}

.phone-field-wrapper > .booking-field {
  height: 100%;
}

.existing-client-panel {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 8px;
  border: 1px solid #ffd08a;
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 32px rgba(11, 31, 77, 0.12);
}

.existing-client-panel-title {
  color: #b26b00;
  font-size: 13px;
  font-weight: 800;
}

.existing-client-card {
  width: 100%;
  min-height: 72px;
  border: 1px solid #ffe2b8;
  border-radius: 12px;
  padding: 10px 11px;
  background: #fff9ef;
  color: var(--ink);
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  box-shadow: none;
}

.existing-client-card:hover,
.existing-client-card:focus-visible {
  border-color: #ffd08a;
  background: #fff2d8;
  box-shadow: 0 0 0 3px rgba(242, 185, 75, 0.14);
  outline: 0;
}

.existing-client-card.is-selected {
  border-color: #a9dfb8;
  background: #f4fff7;
}

.existing-client-card-number {
  color: #b26b00;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.existing-client-card-body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.existing-client-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.existing-client-card-body > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.existing-client-card-action {
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff2cf;
  color: #b26b00;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .existing-client-panel {
    position: static;
    margin-top: 8px;
  }
}

.full-field {
  margin-top: 12px;
}

.booking-field-note {
  margin-top: 14px;
  min-height: 130px;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon control";
  align-items: start;
}

.dialog-actions {
  margin-top: 24px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
}

.booking-dialog #saveBookingBtn {
  background: #2862ff;
  min-width: 130px;
  min-height: 42px;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(40, 98, 255, 0.24);
}

.booking-dialog #saveBookingBtn:hover {
  background: #1f55e5;
}

.booking-dialog #cancelBookingBtn,
.booking-dialog #deleteBookingBtn {
  min-height: 42px;
  border-radius: 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}

#adminDialog .admin-field {
  min-width: 0;
  min-height: 102px;
  padding: 18px 20px;
  border: 1px solid #d8e3ef;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  color: #637181;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 24px;
  grid-template-areas:
    "icon label affordance"
    "icon control affordance";
  column-gap: 18px;
  align-items: center;
  box-shadow: 0 18px 42px rgba(6, 29, 66, 0.06);
}

#adminDialog .admin-field:focus-within {
  border-color: #92b4ff;
  box-shadow:
    0 0 0 4px rgba(112, 157, 255, 0.16),
    0 18px 42px rgba(6, 29, 66, 0.06);
}

.admin-field-icon {
  grid-area: icon;
  width: 54px;
  height: 54px;
  border: 1px solid #d5e2f0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #2d6cff;
  background: linear-gradient(180deg, #f4f8ff 0%, #edf5ff 100%);
}

.admin-field-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-field-label {
  grid-area: label;
  align-self: end;
  color: #344155;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.1;
}

#adminDialog .admin-field input,
#adminDialog .admin-field select {
  grid-area: control;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.15;
}

#adminDialog .admin-field select {
  appearance: none;
  padding-right: 28px;
}

#adminDialog .admin-field .custom-select-trigger {
  min-height: 34px;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.15;
}

#adminDialog .admin-field .custom-select-menu {
  left: -12px;
  width: min(420px, calc(100vw - 72px));
  padding: 10px;
  border-radius: 18px;
}

#adminDialog .admin-field .custom-select-option {
  min-height: 48px;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 20px;
  font-weight: 500;
}

#adminDialog .admin-field:has(select)::after {
  content: "";
  grid-area: affordance;
  width: 12px;
  height: 12px;
  border-right: 3px solid #5f7694;
  border-bottom: 3px solid #5f7694;
  transform: rotate(45deg) translateY(-2px);
  justify-self: end;
  align-self: center;
  pointer-events: none;
}

#adminDialog .admin-field input::placeholder {
  color: #a8adb5;
  font-weight: 650;
  opacity: 1;
}

.full-button {
  width: 100%;
  min-height: 56px;
  margin-top: 18px;
  border-radius: 14px;
  font-size: 18px;
  box-shadow: 0 14px 30px rgba(35, 126, 151, 0.18);
}

.admin-add-button {
  min-height: 64px;
  margin-top: 22px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  background: linear-gradient(135deg, #2d7da0 0%, #0d64ff 100%);
  box-shadow: 0 18px 44px rgba(13, 100, 255, 0.22);
  font-size: 20px;
  font-weight: 750;
}

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

.admin-history-button,
.admin-database-button,
.admin-integration-button {
  min-height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
}

.admin-database-button {
  min-width: 190px;
  justify-content: center;
  border-color: #b8ccff;
  color: #11315f;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7ff 100%);
}

.admin-database-button:hover,
.admin-database-button:focus-visible {
  border-color: #7ea1ff;
  box-shadow: 0 0 0 4px rgba(112, 157, 255, 0.16);
}

.admin-integration-button {
  border-color: #d8e3f4;
  color: #11315f;
  background: #fff;
}

.admin-integration-button:hover,
.admin-integration-button:focus-visible {
  border-color: #9fb8ff;
  box-shadow: 0 0 0 4px rgba(112, 157, 255, 0.12);
}

.button-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-list {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.admin-database {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-database-nav {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #f8fbff;
}

.admin-database-nav button {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #4f5f75;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.admin-database-nav button:hover,
.admin-database-nav button.is-active {
  border-color: #c8d8ec;
  background: #fff;
  color: var(--ink);
}

.admin-database-nav strong {
  min-width: 30px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eaf1fb;
  color: #42516a;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
}

.admin-database-content {
  min-width: 0;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.admin-database-head {
  padding: 16px 18px;
  border-bottom: 1px solid #e3ebf4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-database-head span {
  color: #68788d;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.admin-database-head h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.admin-database-head > strong {
  min-width: 44px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef4ff;
  color: #265fd9;
  display: inline-grid;
  place-items: center;
}

.admin-db-table {
  overflow-x: auto;
}

.admin-db-row {
  min-width: 960px;
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  border-bottom: 1px solid #edf2f7;
}

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

.admin-db-row > span {
  min-width: 0;
  padding: 12px 14px;
  color: #536276;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.admin-db-row > span:first-child {
  color: var(--ink);
  font-weight: 750;
}

.admin-db-head-row {
  background: #f6f9fd;
}

.admin-db-head-row > span {
  color: #68788d;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-db-danger {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #f0c9c9;
  border-radius: 8px;
  background: #fff8f8;
  color: #b23b3b;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.admin-db-danger:hover,
.admin-db-danger:focus-visible {
  border-color: #e29a9a;
  background: #fff1f1;
}

.admin-db-empty {
  padding: 22px;
  color: #68788d;
  font-size: 14px;
  font-weight: 650;
}

.user-row {
  min-height: 96px;
  border: 1px solid #d8e3ef;
  border-radius: 18px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 38px rgba(6, 29, 66, 0.055);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.user-row:hover,
.user-row:focus-visible {
  border-color: #8fb5ff;
  box-shadow: 0 18px 42px rgba(13, 100, 255, 0.12);
  outline: none;
}

.user-row.is-editing {
  border-color: #2f6cff;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
  box-shadow: 0 18px 48px rgba(13, 100, 255, 0.16);
}

.user-row-icon {
  width: 52px;
  height: 52px;
  border: 1px solid #d5e2f0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #2d6cff;
  background: linear-gradient(180deg, #f4f8ff 0%, #edf5ff 100%);
}

.user-row-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-row-body {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.user-row-body span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 17px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-row strong {
  color: #000;
  font-size: 20px;
  font-weight: 750;
}

.user-row .user-delete-button {
  min-height: 46px;
  border-radius: 14px;
  padding-inline: 18px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.user-delete-button .button-icon,
.user-delete-button .button-icon svg {
  width: 20px;
  height: 20px;
}

.audit-dialog {
  width: min(1360px, calc(100vw - 64px));
  max-height: calc(100vh - 88px);
  overflow: hidden;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
}

.audit-dialog form {
  width: 100%;
  padding: 30px 34px 30px;
}

.audit-dialog .dialog-head {
  align-items: flex-start;
  margin-bottom: 20px;
}

.audit-dialog .eyebrow {
  color: #647184;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.audit-dialog .dialog-head h2 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.02;
}

.audit-dialog .close-button {
  width: 52px;
  height: 52px;
  border: 2px solid #8fb0ff;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #102247;
  font-size: 0;
  box-shadow: 0 0 0 4px rgba(49, 111, 255, 0.18);
}

.audit-dialog .close-button::before {
  content: "×";
  display: block;
  color: currentColor;
  font-size: 30px;
  font-weight: 450;
  line-height: 1;
}

.audit-content {
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.audit-dashboard {
  border: 1px solid #d8e3ef;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
  box-shadow: none;
}

.audit-sidebar {
  border-right: 1px solid #d8e3ef;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.audit-sidebar h3 {
  margin: 0;
  padding: 20px 18px;
  border-bottom: 1px solid #d8e3ef;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.audit-role-section header {
  min-height: 48px;
  padding: 0 18px;
  border-bottom: 1px solid #e6edf5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #4d5d72;
}

.audit-role-section header strong {
  font-size: 15px;
  font-weight: 750;
}

.audit-role-section header span {
  min-width: 27px;
  min-height: 21px;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: #f4f8ff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.audit-account {
  width: 100%;
  min-height: 70px;
  border: 0;
  border-bottom: 1px solid #e6edf5;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.audit-account.is-active {
  border-left: 4px solid #316fff;
  background: linear-gradient(90deg, #eef5ff 0%, #ffffff 100%);
  padding-left: 14px;
}

.audit-account strong {
  display: block;
  overflow: hidden;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-account small,
.audit-role-chip,
.audit-table-row small {
  width: fit-content;
  border: 1px solid #bdd2ff;
  border-radius: 6px;
  padding: 3px 8px;
  display: inline-block;
  background: #eef5ff;
  color: #155de5;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.audit-role-coach {
  border-color: #9fe2c1;
  background: #e8fff2;
  color: #098557;
}

.audit-role-user {
  border-color: #d8e3ef;
  background: #f4f8ff;
  color: #42536a;
}

.audit-account em {
  color: #53637a;
  font-size: 13px;
  font-style: normal;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.audit-online-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  background: #20bd75;
  -webkit-mask: url("./assets/icons/history/online-dot.svg") center / contain no-repeat;
  mask: url("./assets/icons/history/online-dot.svg") center / contain no-repeat;
}

.audit-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #edf2f8;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.audit-avatar.is-large {
  width: 54px;
  height: 54px;
  font-size: 18px;
}

.audit-profile {
  min-width: 0;
  padding: 16px 18px 20px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.audit-profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.audit-profile-head div {
  min-width: 0;
}

.audit-profile-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.05;
}

.audit-profile-head h3 span {
  color: var(--muted);
  font-weight: 650;
}

.audit-profile-head h3 .audit-role-chip {
  vertical-align: middle;
  transform: translateY(-2px);
}

.audit-profile-head small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

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

.audit-kpi-grid article,
.audit-alert-grid article {
  min-height: 82px;
  border: 1px solid #d8e3ef;
  border-radius: 10px;
  padding: 13px 15px;
  background: #fff;
}

.audit-kpi-grid span,
.audit-alert-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.18;
}

.audit-kpi-grid strong,
.audit-alert-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
}

.audit-kpi-grid small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

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

.audit-alert-grid article {
  position: relative;
  min-height: 82px;
  padding-right: 58px;
}

.audit-alert-grid .is-warn {
  border-color: #ffc48b;
  color: #ff6b00;
}

.audit-alert-grid .is-info {
  border-color: #b8cdfd;
  color: #155de5;
}

.audit-alert-grid .is-danger {
  border-color: #ffc3c3;
  color: #f04444;
}

.audit-alert-grid article strong,
.audit-alert-grid article span {
  color: currentColor;
}

.audit-alert-icon {
  position: absolute;
  right: 16px;
  bottom: 18px;
  width: 25px;
  height: 25px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.audit-alert-icon.is-history {
  background-image: url("./assets/icons/history/history.svg");
}

.audit-alert-icon.is-calendar {
  background-image: url("./assets/icons/history/calendar.svg");
}

.audit-alert-icon.is-overdue {
  background-image: url("./assets/icons/history/overdue.svg");
}

.audit-section-title {
  margin: 2px 0 -4px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.audit-table {
  border: 1px solid #d8e3ef;
  border-radius: 10px;
  overflow: hidden;
}

.audit-table-head,
.audit-table-row {
  display: grid;
  grid-template-columns: 38px minmax(260px, 1.45fr) minmax(120px, 0.7fr) minmax(120px, 0.65fr) 70px;
  gap: 10px;
  align-items: center;
}

.audit-table-head {
  min-height: 36px;
  padding: 0 14px;
  background: #fbfdff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.audit-table-row {
  min-height: 32px;
  padding: 0 14px;
  border-top: 1px solid #e6edf5;
  color: var(--ink);
}

.audit-table-row > span {
  min-width: 24px;
  min-height: 22px;
  border: 1px solid #d8e3ef;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  background: #f4f8ff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.audit-table-row strong,
.audit-table-row em,
.audit-table-row time {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-table-row strong {
  font-weight: 500;
}

.audit-table-row em {
  font-weight: 500;
}

.audit-table-row time {
  text-align: right;
}

.audit-table h4 {
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid #e6edf5;
  color: var(--ink);
  font-size: 15px;
}

.audit-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 18px;
  font-weight: 650;
}

@media (max-width: 1180px) {
  .audit-dialog {
    width: calc(100vw - 24px);
  }

  .audit-dialog form {
    padding: 22px;
  }

  .audit-dashboard {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .audit-kpi-grid,
  .audit-alert-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-table-head,
  .audit-table-row {
    grid-template-columns: 36px minmax(150px, 1fr) minmax(100px, 0.7fr) 92px 58px;
    gap: 8px;
  }
}

@media (max-width: 860px) {
  .audit-dashboard {
    grid-template-columns: 1fr;
  }

  .audit-sidebar {
    max-height: 280px;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid #d8e3ef;
  }

  .audit-kpi-grid,
  .audit-alert-grid {
    grid-template-columns: 1fr;
  }
}

.history-list {
  max-height: min(68vh, 640px);
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.history-item {
  position: relative;
  border: 1px solid #dbe5ef;
  border-radius: 12px;
  padding: 16px 20px;
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 8px 22px rgba(6, 29, 66, 0.035);
}

.history-main {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.history-main strong {
  min-width: 0;
  overflow: hidden;
  color: #061d42;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-main .status {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 13px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.history-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 56px;
  color: #3c4757;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}

.history-detail-group {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.history-detail-group span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #52627a;
  font-size: 15px;
  font-weight: 500;
}

.history-note span,
.history-note svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.history-note svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-item .status.paid {
  background: #e2f8eb;
  color: #149b3a;
}

.history-item .status.ended {
  background: #eaf3ff;
  color: #2865d8;
}

.history-item .status.pending {
  background: #fff4e3;
  color: #d88500;
}

.history-item .status.custom_rental {
  background: #edf6fb;
  color: #2d5870;
}

.history-item .status.refused {
  background: #fff0f0;
  color: #d83b3b;
}

.crm-board {
  min-height: min(68vh, 680px);
  max-height: min(68vh, 680px);
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 12px;
}

.crm-column {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.crm-column.is-over {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px rgba(31, 111, 139, 0.16);
}

.crm-column-head {
  border-bottom: 3px solid var(--line);
  padding: 12px;
  display: grid;
  gap: 4px;
  text-align: center;
}

.crm-column[data-status="custom_rental"] .crm-column-head {
  border-bottom-color: #aac7d7;
}

.crm-column[data-status="pending"] .crm-column-head {
  border-bottom-color: #f1cd88;
}

.crm-column[data-status="confirmed"] .crm-column-head {
  border-bottom-color: #78d6b4;
}

.crm-column[data-status="paid"] .crm-column-head {
  border-bottom-color: #94d7ac;
}

.crm-column[data-status="ended"] .crm-column-head {
  border-bottom-color: #8fb7ef;
}

.crm-column[data-status="refused"] .crm-column-head {
  border-bottom-color: #ef9f9f;
}

.crm-column-title {
  color: #314052;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.crm-column-total {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.crm-cards {
  min-height: 180px;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.crm-card {
  width: 100%;
  border: 1px solid #c3c9d0;
  border-radius: 4px;
  background: var(--surface);
  padding: 7px 9px;
  display: grid;
  gap: 3px;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

.crm-card:hover,
.crm-card:focus-visible {
  border-color: #9bb7d6;
  box-shadow: 0 1px 4px rgba(6, 29, 66, 0.12);
  outline: none;
}

.crm-card:active {
  cursor: grabbing;
}

.crm-card.is-dragging {
  opacity: 0.55;
}

.crm-card.is-metric-highlight {
  border-color: #f59e0b;
  background: #fff7e8;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.28), 0 8px 20px rgba(178, 107, 0, 0.14);
}

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

.crm-card-contact {
  min-width: 0;
  overflow: hidden;
  color: #303946;
  font-size: 13px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-card-date {
  flex: 0 0 auto;
  color: #939da8;
  font-size: 12px;
  font-weight: 500;
}

.crm-card-link {
  min-width: 0;
  overflow: hidden;
  color: #0057b8;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-card-name-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.crm-card-name-line .crm-card-link {
  flex: 1 1 auto;
}

.crm-card-booking-count {
  flex: 0 0 auto;
  border: 1px solid #c8d7ea;
  border-radius: 999px;
  background: #eef5ff;
  color: #235d9f;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.crm-card-pill {
  justify-self: start;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d8dee5;
  border-radius: 4px;
  padding: 1px 5px;
  color: #8b949e;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-card-meta-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.crm-card-meta-line .crm-card-pill {
  flex: 0 1 auto;
}

.crm-card-source {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.crm-card-source-icon {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.crm-card-source.is-mail {
  border: 1px solid #ffd59d;
  background: #fff6ea;
  color: #b85b00;
}

.crm-card-bottom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}

.crm-card-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #b3b7bd;
}

.crm-card-payment {
  min-width: 0;
  overflow: hidden;
  color: #2b5368;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-card-task {
  color: #d8a234;
  font-size: 12px;
  white-space: nowrap;
}

.crm-detail-dialog {
  width: min(1420px, calc(100% - 16px));
  max-height: calc(100vh - 16px);
  padding: 18px 20px;
}

.crm-detail-dialog form {
  padding: 22px 24px 20px;
}

.crm-detail-dialog .dialog-head {
  margin-bottom: 14px;
}

.crm-detail-dialog .dialog-head h2 {
  font-size: 26px;
}

.tasks-dialog {
  width: min(1180px, calc(100% - 24px));
}

.tasks-board {
  min-height: min(62vh, 620px);
  max-height: min(62vh, 620px);
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.task-column {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.task-column-head {
  border-bottom: 3px solid #cbd5e1;
  padding: 12px;
  display: grid;
  gap: 4px;
  text-align: center;
}

.task-column[data-task-status="overdue"] .task-column-head {
  border-bottom-color: #ef9f9f;
}

.task-column[data-task-status="today"] .task-column-head {
  border-bottom-color: #8fc9a7;
}

.task-column[data-task-status="tomorrow"] .task-column-head {
  border-bottom-color: #b6bdc8;
}

.task-column-head strong {
  color: #314052;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.task-column-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.task-cards {
  min-height: 180px;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.task-card {
  width: 100%;
  border: 1px solid #c3c9d0;
  border-radius: 4px;
  background: var(--surface);
  padding: 8px 10px;
  display: grid;
  gap: 4px;
  text-align: left;
  cursor: pointer;
}

.task-card:hover,
.task-card:focus-visible {
  border-color: #9bb7d6;
  box-shadow: 0 1px 4px rgba(6, 29, 66, 0.12);
  outline: none;
}

.task-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-card-head strong {
  min-width: 0;
  overflow: hidden;
  color: #0057b8;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card-head span {
  flex: 0 0 auto;
  color: #939da8;
  font-size: 12px;
  font-weight: 600;
}

.task-card > span,
.task-card > em {
  min-width: 0;
  overflow: hidden;
  color: #405064;
  font-size: 13px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card > em {
  color: #2b5368;
  font-weight: 800;
}

.crm-detail {
  display: grid;
  gap: 12px;
}

.crm-mobile-detail {
  display: none;
}

.crm-detail-layout {
  max-height: calc(100vh - 106px);
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.72fr);
  gap: 18px;
  overflow: hidden;
}

.crm-detail-main {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding-right: 2px;
}

.crm-detail-grid {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(6, 29, 66, 0.04);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(190px, 0.36fr) minmax(0, 1fr);
}

.crm-detail-row {
  display: contents;
}

.crm-detail-row > .detail-label,
.crm-detail-row > strong {
  min-width: 0;
  border-bottom: 1px solid var(--line);
  min-height: 62px;
  padding: 10px 14px;
  word-break: break-word;
}

.crm-detail-row > .detail-label {
  background: #f7faff;
  color: var(--muted);
  font-weight: 650;
}

.crm-detail-row > strong {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.crm-detail-row:last-child > .detail-label,
.crm-detail-row:last-child > strong {
  border-bottom: 0;
}

.detail-inline-value,
.detail-inline-select,
.detail-inline-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.detail-inline-value {
  max-width: 100%;
  min-width: 0;
  padding: 7px 10px;
  display: block;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
  cursor: text;
}

.crm-detail-row[data-detail-field="comment"] > strong {
  align-items: flex-start;
}

.detail-inline-value:hover,
.detail-inline-value:focus-visible {
  border-color: #d6e3f2;
  background: #f7faff;
  outline: 0;
}

.detail-inline-input {
  padding: 7px 10px;
  border-color: #93b4dd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.12);
  outline: 0;
}

.detail-inline-select {
  appearance: none;
  cursor: pointer;
  padding: 7px 42px 7px 10px;
  border-color: #d6e3f2;
  background:
    linear-gradient(45deg, transparent 50%, #55708f 50%) right 18px center / 8px 8px no-repeat,
    linear-gradient(135deg, #55708f 50%, transparent 50%) right 12px center / 8px 8px no-repeat,
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.detail-inline-select:hover,
.detail-inline-select:focus {
  border-color: #93b4dd;
  box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.1);
  outline: 0;
}

.detail-custom-select {
  width: 100%;
}

.detail-custom-select .custom-select-trigger {
  min-height: 40px;
  padding: 7px 42px 7px 10px;
  border: 1px solid #d6e3f2;
  border-radius: 10px;
  background:
    linear-gradient(45deg, transparent 50%, #55708f 50%) right 18px center / 8px 8px no-repeat,
    linear-gradient(135deg, #55708f 50%, transparent 50%) right 12px center / 8px 8px no-repeat,
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.detail-custom-select .custom-select-menu {
  top: calc(100% + 8px);
  left: 0;
  width: min(520px, calc(100vw - 96px));
  max-height: 330px;
  padding: 10px;
  border-color: #dbe5f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(6, 29, 66, 0.14);
}

.detail-custom-select .custom-select-option {
  min-height: 44px;
  border-radius: 10px;
  padding: 0 14px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 500;
  color: #20242a;
}

.detail-custom-select .custom-select-option:hover,
.detail-custom-select .custom-select-option.is-selected {
  background: #eef4ff;
  color: var(--ink);
}

.detail-datetime-editor {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(96px, 0.55fr) minmax(96px, 0.55fr) auto;
  gap: 10px;
  align-items: center;
}

.detail-datetime-editor .detail-inline-input,
.detail-datetime-editor .detail-inline-select {
  min-height: 44px;
  background-color: #fff;
}

.detail-datetime-save {
  min-height: 44px;
  border-radius: 10px;
  padding-inline: 16px;
  font: inherit;
  font-weight: 750;
}

.detail-inline-select[data-field="status"] {
  background:
    linear-gradient(45deg, transparent 50%, #8a5a00 50%) right 18px center / 8px 8px no-repeat,
    linear-gradient(135deg, #8a5a00 50%, transparent 50%) right 12px center / 8px 8px no-repeat,
    #fff4df;
  border-color: #f4d28f;
  color: #b26b00;
}

@media (min-width: 721px) {
  .crm-detail-row[data-detail-field^="status"] {
    grid-column: 1 / -1;
    min-height: 72px;
    margin: 0;
    border-top: 1px solid #f2d28d;
    border-bottom: 1px solid #f2d28d;
    border-radius: 0;
    background: linear-gradient(105deg, #fff7e6 0%, #fffdf8 62%, #fff8e9 100%);
    display: grid;
    grid-template-columns: minmax(190px, 0.36fr) minmax(0, 1fr);
    overflow: hidden;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.82),
      inset 0 -1px 0 rgba(255, 255, 255, 0.6);
  }

  .crm-detail-row[data-detail-field^="status"] > .detail-label,
  .crm-detail-row[data-detail-field^="status"] > strong {
    min-height: 72px;
    border-bottom: 0;
    background: transparent;
    padding: 10px 14px;
  }

  .crm-detail-row[data-detail-field^="status"] > .detail-label {
    color: #69778a;
    font-size: 17px;
    font-weight: 800;
  }

  .crm-detail-row[data-detail-field^="status"] .detail-row-icon {
    width: 38px;
    height: 38px;
    border-color: #f0cf85;
    background: #fff2cf;
    color: #f29b00;
  }

  .crm-detail-row[data-detail-field^="status"] .detail-row-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.6;
  }

  .crm-detail-row[data-detail-field^="status"] .detail-inline-select[data-field="status"] {
    min-height: 48px;
    border: 0;
    border-radius: 0;
    padding-left: 0;
    padding-right: 50px;
    background:
      linear-gradient(45deg, transparent 50%, #8a5a00 50%) right 22px center / 10px 10px no-repeat,
      linear-gradient(135deg, #8a5a00 50%, transparent 50%) right 15px center / 10px 10px no-repeat;
    color: #b26b00;
    font-size: 21px;
    font-weight: 900;
    box-shadow: none;
  }

  .crm-detail-row[data-detail-field^="status"] .detail-custom-select[data-custom-field="status"] .custom-select-trigger {
    min-height: 48px;
    border: 0;
    border-radius: 0;
    padding-left: 0;
    padding-right: 50px;
    background:
      linear-gradient(45deg, transparent 50%, #8a5a00 50%) right 22px center / 10px 10px no-repeat,
      linear-gradient(135deg, #8a5a00 50%, transparent 50%) right 15px center / 10px 10px no-repeat;
    color: #b26b00;
    font-size: 21px;
    font-weight: 900;
    box-shadow: none;
  }

  .crm-detail-row[data-detail-field^="status"] .detail-custom-select[data-custom-field="status"] .custom-select-menu {
    left: -4px;
    width: min(720px, calc(100vw - 160px));
  }

  .crm-detail-row[data-detail-field^="status"] .detail-custom-select[data-custom-field="status"] .custom-select-option {
    min-height: 46px;
    font-size: 19px;
    font-weight: 500;
  }

  .crm-detail-row[data-detail-field^="status"] .detail-inline-select[data-field="status"]:hover,
  .crm-detail-row[data-detail-field^="status"] .detail-inline-select[data-field="status"]:focus {
    box-shadow: none;
  }

  .crm-detail-row[data-detail-field="status status-paid"],
  .crm-detail-row[data-detail-field="status status-ended"] {
    border-color: #bfe8cf;
    background: linear-gradient(105deg, #f1fbf5 0%, #ffffff 62%, #effaf4 100%);
  }

  .crm-detail-row[data-detail-field="status status-paid"] .detail-row-icon,
  .crm-detail-row[data-detail-field="status status-ended"] .detail-row-icon {
    border-color: #bfe8cf;
    background: #dff6e8;
    color: #16834d;
  }

  .crm-detail-row[data-detail-field="status status-paid"] .detail-inline-select[data-field="status"],
  .crm-detail-row[data-detail-field="status status-ended"] .detail-inline-select[data-field="status"] {
    background:
      linear-gradient(45deg, transparent 50%, #16834d 50%) right 22px center / 10px 10px no-repeat,
      linear-gradient(135deg, #16834d 50%, transparent 50%) right 15px center / 10px 10px no-repeat;
    color: #16834d;
  }

  .crm-detail-row[data-detail-field="status status-paid"] .detail-custom-select[data-custom-field="status"] .custom-select-trigger,
  .crm-detail-row[data-detail-field="status status-ended"] .detail-custom-select[data-custom-field="status"] .custom-select-trigger {
    background:
      linear-gradient(45deg, transparent 50%, #16834d 50%) right 22px center / 10px 10px no-repeat,
      linear-gradient(135deg, #16834d 50%, transparent 50%) right 15px center / 10px 10px no-repeat;
    color: #16834d;
  }

  .crm-detail-row[data-detail-field="status status-refused"] {
    border-color: #f1caca;
    background: linear-gradient(105deg, #fff5f5 0%, #ffffff 62%, #fff1f1 100%);
  }

  .crm-detail-row[data-detail-field="status status-refused"] .detail-row-icon {
    border-color: #f1caca;
    background: #ffe2e2;
    color: #c54545;
  }

  .crm-detail-row[data-detail-field="status status-refused"] .detail-inline-select[data-field="status"] {
    background:
      linear-gradient(45deg, transparent 50%, #c54545 50%) right 22px center / 10px 10px no-repeat,
      linear-gradient(135deg, #c54545 50%, transparent 50%) right 15px center / 10px 10px no-repeat;
    color: #c54545;
  }

  .crm-detail-row[data-detail-field="status status-refused"] .detail-custom-select[data-custom-field="status"] .custom-select-trigger {
    background:
      linear-gradient(45deg, transparent 50%, #c54545 50%) right 22px center / 10px 10px no-repeat,
      linear-gradient(135deg, #c54545 50%, transparent 50%) right 15px center / 10px 10px no-repeat;
    color: #c54545;
  }
}

.detail-label {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-label span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-row-icon {
  width: 38px;
  height: 38px;
  border: 1px solid #d5e2f0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f3f8ff 0%, #edf5ff 100%);
  color: #526e91;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.detail-row-icon svg,
.contact-button-icon svg,
.detail-status-badge svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.45;
}

.detail-status-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 7px 14px 7px 9px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 650;
}

.detail-status-badge span {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.detail-status-badge span svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}

.detail-status-badge.pending {
  background: #fff0ca;
  color: #b47300;
  box-shadow: inset 0 0 0 1px rgba(244, 181, 54, 0.18);
}

.detail-status-badge.pending span {
  background: #ffd372;
  color: #a96700;
}

.detail-status-badge.confirmed,
.detail-status-badge.paid,
.detail-status-badge.ended {
  background: #e5f8ed;
  color: #198144;
  box-shadow: inset 0 0 0 1px rgba(31, 151, 78, 0.14);
}

.detail-status-badge.confirmed span,
.detail-status-badge.paid span,
.detail-status-badge.ended span {
  background: #bcecca;
  color: #13753a;
}

.detail-status-badge.custom_rental {
  background: #e4f3fb;
  color: #1b5b76;
  box-shadow: inset 0 0 0 1px rgba(27, 91, 118, 0.12);
}

.detail-status-badge.custom_rental span {
  background: #c4e4f5;
  color: #1b5b76;
}

.detail-status-badge.refused {
  background: #fff0f0;
  color: #ba4747;
  box-shadow: inset 0 0 0 1px rgba(186, 71, 71, 0.15);
}

.detail-status-badge.refused span {
  background: #ffc9c9;
  color: #a53434;
}

.task-create {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.booking-task-create {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(6, 29, 66, 0.035);
}

.booking-client-hero {
  margin: -4px 0 18px;
  display: grid;
  gap: 18px;
}

.booking-client-phone-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  color: #6c788d;
  font-size: 22px;
  font-weight: 850;
  line-height: 1.1;
}

.booking-client-phone-line > span {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: inline-flex;
  color: #6c788d;
}

.booking-client-phone-line svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.45;
}

.booking-client-phone-line a {
  min-width: 0;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.booking-copy-phone {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #6c788d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.booking-copy-phone svg {
  width: 22px;
  height: 22px;
}

.booking-copy-phone.is-copied {
  background: #eef7ff;
  color: var(--brand);
}

.booking-client-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.booking-client-actions .contact-button {
  min-width: 0;
  min-height: 56px;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  gap: 12px;
  padding-inline: 14px;
  font-size: 18px;
  box-shadow: 0 14px 26px rgba(6, 29, 66, 0.12);
}

.booking-client-actions .contact-call {
  background: linear-gradient(135deg, #064f68 0%, #00758e 100%);
}

.booking-client-actions .contact-telegram {
  background: linear-gradient(135deg, #1265e9 0%, #014cff 100%);
}

.booking-client-actions .contact-button-icon {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.14);
}

.booking-client-actions .contact-button-icon svg {
  width: 18px;
  height: 18px;
}

.task-add-button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 11px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  color: #8b949e;
  cursor: pointer;
  text-align: left;
}

.task-add-button span {
  width: 36px;
  height: 36px;
  border: 1.5px dashed #8b949e;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b949e;
  font-size: 27px;
  font-weight: 300;
  line-height: 0;
  padding-bottom: 3px;
}

.task-add-button strong {
  color: #8b949e;
  font-size: 17px;
  font-weight: 450;
}

.task-add-button small {
  color: #8b949e;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
}

.task-create-form {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.task-create-form[hidden] {
  display: none;
}

.task-create-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.client-history {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  box-shadow: 0 10px 28px rgba(6, 29, 66, 0.04);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

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

.client-history-head strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
}

.client-history-list {
  min-height: 0;
  overflow: auto;
  padding: 14px 14px 14px 42px;
  display: grid;
  align-content: start;
  gap: 11px;
}

.client-history-item {
  position: relative;
  border: 1px solid #e3ebf3;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(6, 29, 66, 0.06);
  padding: 11px 13px;
  display: grid;
  gap: 6px;
}

.client-history-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 20px;
  width: 10px;
  height: 10px;
  border: 3px solid #cfe0ff;
  border-radius: 999px;
  background: #1f67ff;
  z-index: 1;
}

.client-history-item::after {
  content: "";
  position: absolute;
  left: -23px;
  top: 34px;
  bottom: -27px;
  width: 2px;
  background: #dbe4ee;
}

.client-history-item:last-of-type::after {
  display: none;
}

.client-history-item div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  color: #6f7782;
}

.client-history-item strong {
  border-radius: 999px;
  background: #edf4ff;
  color: #2260d7;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 900;
}

.client-history-item span,
.client-history-item small {
  color: #6f7782;
  font-size: 12px;
}

.client-history-item p {
  margin: 0;
  color: #303946;
  font-size: 15px;
  line-height: 1.3;
}

.history-load-more {
  justify-self: start;
  border: 0;
  background: transparent;
  color: #6f7782;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 0 0;
}

.client-message-form {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.client-message-form input {
  min-width: 0;
}

.messages-dialog {
  width: min(1180px, calc(100vw - 96px));
  height: min(660px, calc(100dvh - 84px));
  padding: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 22px;
}

.messages-shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: 62px minmax(0, 1fr);
}

.messages-appbar {
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
}

.messages-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.messages-brand span:not(.messages-brand-mark) {
  width: 1px;
  height: 24px;
  background: #cfd8e4;
}

.messages-brand-mark {
  width: 24px;
  height: 24px;
  color: #1689ff;
  display: inline-flex;
  transform: rotate(12deg);
}

.messages-brand-mark svg,
.messages-round-button svg,
.messages-connected svg,
.messages-head-actions svg,
.messages-chat-avatar i svg,
.messages-input-icon svg,
.messages-reply-form button svg,
.message-status svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.messages-app-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.messages-round-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messages-round-button svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}

.messages-connected {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  background: #fff;
}

.messages-connected span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #1689ff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messages-connected span svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}

.messages-connected i,
.messages-conversation-head i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #34c987;
}

.messages-close-window {
  min-height: 40px;
  border: 1px solid #d9e4f0;
  border-radius: 13px;
  padding: 0 13px 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  color: #1f2933;
  font-size: 14px;
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.messages-close-window span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef3f8;
  color: #1f2933;
  font-size: 22px;
  line-height: 1;
}

.messages-window {
  height: auto;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 326px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: #f7faff;
}

.messages-sidebar {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.messages-sidebar-head,
.messages-conversation-head {
  min-height: 66px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.messages-sidebar-head {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.messages-sidebar-head h2 {
  margin: 0;
  font-size: 20px;
}

.messages-sidebar-head .close-button {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #eef3f8;
  color: #1f2933;
  font-size: 24px;
  font-weight: 700;
}

.messages-sidebar-head .messages-round-button {
  width: 36px;
  height: 36px;
  border: 1px solid #e0e8f2;
  background: #f6f9fd;
}

.messages-sidebar-head .messages-round-button svg {
  width: 18px;
  height: 18px;
}

.messages-search {
  padding: 12px 16px 8px;
}

.messages-search input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 13px;
  background: #fbfdff;
  font-size: 14px;
}

.messages-tabs {
  padding: 8px 16px 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.messages-tabs button {
  min-height: 36px;
  border: 1px solid #e3ebf5;
  border-right: 0;
  background: #fff;
  color: #607084;
  font-size: 13px;
  font-weight: 800;
}

.messages-tabs button:first-child {
  border-radius: 12px 0 0 12px;
}

.messages-tabs button:last-child {
  border-right: 1px solid #e3ebf5;
  border-radius: 0 12px 12px 0;
}

.messages-tabs button.is-active {
  border-color: #1689ff;
  background: #1689ff;
  color: #fff;
}

.messages-tabs span {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 27, 61, 0.1);
}

.messages-chat-list {
  min-height: 0;
  overflow: auto;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.messages-chat {
  width: 100%;
  border: 1px solid #e5ecf4;
  border-radius: 11px;
  background: #fff;
  padding: 10px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.messages-chat.is-active {
  border-color: #91c7ff;
  background: #f0f8ff;
  box-shadow: inset 4px 0 0 #1689ff;
}

.messages-chat-avatar,
.messages-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5a3, #07896f);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  font-weight: 800;
}

.messages-chat-avatar i {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #1689ff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-style: normal;
}

.messages-chat-avatar i svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}

.messages-chat-avatar img,
.messages-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}

.messages-chat-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.messages-chat-main strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-chat-main em {
  justify-self: start;
  border-radius: 5px;
  padding: 2px 7px;
  background: #e5d4ff;
  color: #7b3fc7;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.messages-chat-main small,
.messages-chat-meta {
  color: #6d7887;
  font-size: 12px;
}

.messages-chat-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-chat-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  white-space: nowrap;
}

.messages-conversation {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr) 72px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #07111c;
}

.messages-conversation-head {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.messages-conversation-head > div:not(.messages-avatar):not(.messages-head-actions) {
  display: grid;
  gap: 4px;
}

.messages-conversation-head strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.messages-conversation-head span {
  color: #6f7782;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.messages-head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.messages-head-actions button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messages-head-actions svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.35;
}

.messages-conversation-list {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 22px 18px;
  display: grid;
  align-content: start;
  gap: 12px;
  background:
    linear-gradient(rgba(7, 17, 28, 0.86), rgba(7, 17, 28, 0.86)),
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.08), transparent 20%),
    radial-gradient(circle at 75% 55%, rgba(255, 255, 255, 0.06), transparent 24%),
    #07111c;
}

.messages-date-chip {
  justify-self: center;
  border-radius: 10px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.messages-conversation-list .messenger-message {
  width: min(64%, 500px);
  min-width: 0;
  border: 0;
  border-radius: 11px;
  padding: 12px 14px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18);
}

.messages-conversation-list .messenger-message div {
  align-items: flex-start;
  gap: 12px;
}

.messages-conversation-list .messenger-message.inbound {
  background: rgba(255, 255, 255, 0.94);
}

.messages-conversation-list .messenger-message.outbound {
  justify-self: end;
  background: linear-gradient(135deg, #536dff 0%, #9340c9 100%);
  color: #fff;
}

.messages-conversation-list .messenger-message.inbound {
  justify-self: start;
}

.messages-conversation-list .messenger-message.outbound strong,
.messages-conversation-list .messenger-message.outbound span,
.messages-conversation-list .messenger-message.outbound p,
.messages-conversation-list .messenger-message.outbound .message-status {
  color: #fff;
}

.messages-conversation-list .messenger-message p {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.42;
}

.messages-conversation-list .messenger-message span {
  flex: 0 0 auto;
  text-align: right;
}

.message-status {
  justify-self: end;
  color: #7a8592;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  margin-top: 2px;
}

.message-status svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}

.messages-dialog .messages-reply-form {
  border-top: 1px solid var(--line);
  min-height: 72px;
  padding: 9px 14px 11px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  gap: 10px;
  align-items: center;
}

.messages-input-wrap {
  position: relative;
  min-width: 0;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 10px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  background: #fff;
}

.messages-dialog .messages-reply-form input {
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0 8px;
  font-size: 15px;
}

.messages-input-icon {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #0b1b36;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messages-input-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.35;
}

.messages-emoji-picker {
  position: absolute;
  right: 4px;
  bottom: calc(100% + 8px);
  z-index: 12;
  padding: 7px;
  border: 1px solid #d9e2ea;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(6, 29, 66, 0.14);
  display: grid;
  grid-template-columns: repeat(5, 36px);
  gap: 5px;
}

.messages-emoji-picker[hidden] {
  display: none;
}

.messages-emoji-picker button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: #f4f8fe;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
}

.messages-emoji-picker button:hover,
.messages-emoji-picker button:focus-visible {
  background: #e8f1ff;
  outline: none;
}

.messages-dialog .messages-reply-form .primary-button {
  width: 48px;
  min-height: 48px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messages-dialog .messages-reply-form .primary-button svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

.messages-empty,
.messages-error {
  align-self: center;
  justify-self: center;
  color: #7a8592;
  font-size: 15px;
}

.messages-error {
  border: 1px solid #f3b4b4;
  border-radius: 10px;
  background: #fff1f1;
  color: #b42318;
  padding: 10px 12px;
}

.messages-dialog {
  width: min(1380px, calc(100vw - 48px));
  height: min(760px, calc(100dvh - 48px));
  border: 1px solid #dce5f0;
  border-radius: 16px;
  box-shadow: 0 26px 70px rgba(16, 32, 56, 0.22);
}

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

.messages-appbar {
  min-height: 72px;
  padding: 0 24px;
  border-bottom-color: #e1e8f1;
}

.messages-brand {
  min-width: 0;
  gap: 20px;
  font-size: 22px;
  letter-spacing: 0;
}

.messages-brand strong {
  min-width: 0;
  white-space: nowrap;
}

.messages-brand span:not(.messages-brand-mark) {
  height: 28px;
  background: #cfd8e4;
}

.messages-brand-mark {
  width: 28px;
  height: 28px;
  color: #118cff;
  transform: none;
}

.messages-brand-mark svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: none;
}

.messages-app-actions {
  flex: 0 0 auto;
  gap: 18px;
}

.messages-round-button,
.messages-head-actions button,
.messages-back-button,
.messages-input-icon {
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.messages-round-button {
  width: 42px;
  height: 42px;
  color: #111d32;
  background: transparent;
  border: 0;
}

.messages-round-button:hover,
.messages-head-actions button:hover,
.messages-back-button:hover,
.messages-input-icon:hover {
  background: rgba(22, 141, 255, 0.08);
  color: #118cff;
}

.messages-round-button svg {
  width: 25px;
  height: 25px;
  stroke-width: 2.1;
}

.messages-connected {
  min-height: 48px;
  border: 1px solid #dce5f0;
  border-radius: 16px;
  padding: 0 16px 0 14px;
  gap: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 750;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(18, 39, 64, 0.04);
}

.messages-connected:hover {
  border-color: #bcd7f8;
  background: #f7fbff;
}

.messages-connected strong {
  font-size: inherit;
  font-weight: inherit;
}

.messages-connected span {
  width: 34px;
  height: 34px;
  background: #168dff;
}

.messages-connected.is-ready span {
  background: #168dff;
}

.messages-connected.is-warning {
  border-color: #ffd1d1;
  background: #fff7f7;
}

.messages-connected.is-warning span {
  background: #f04438;
}

.messages-connected.is-warning i {
  background: #f04438;
}

.messages-connected span svg {
  display: none;
}

.messages-connected i,
.messages-conversation-head i,
.messages-sync-card i {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #56ca83;
}

.messages-close-window.messages-user-menu {
  width: 48px;
  height: 48px;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 0;
  background: transparent;
  color: #111d32;
  font-size: 15px;
  font-weight: 800;
  box-shadow: none;
}

.messages-close-window.messages-user-menu > span {
  position: relative;
  width: 26px;
  height: 26px;
  background: transparent;
  color: #111d32;
}

.messages-close-window.messages-user-menu > span::before,
.messages-close-window.messages-user-menu > span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 25px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}

.messages-close-window.messages-user-menu > span::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.messages-close-window.messages-user-menu > span::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.messages-close-window.messages-user-menu > svg {
  display: none;
}

.messages-window {
  grid-template-columns: minmax(330px, 456px) minmax(0, 1fr);
  gap: 14px;
  padding: 14px 16px;
  background: #f5f8fc;
}

.messages-sidebar,
.messages-conversation {
  border-color: #dce5f0;
  border-radius: 14px;
  box-shadow: 0 16px 34px rgba(17, 31, 52, 0.045);
}

.messages-sidebar {
  grid-template-rows: 72px auto auto minmax(0, 1fr) auto;
}

.messages-sidebar-head,
.messages-conversation-head {
  min-height: 72px;
  padding: 14px 20px;
}

.messages-sidebar-head h2 {
  font-size: 22px;
}

.messages-sidebar-head .messages-round-button {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
}

.messages-search {
  padding: 14px 16px 10px;
}

.messages-search input {
  min-height: 48px;
  border-color: #dce5f0;
  border-radius: 14px;
  padding: 0 16px 0 46px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23728295' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.8' cy='10.8' r='5.8'/%3E%3Cpath d='m15.2 15.2 4 4'/%3E%3C/svg%3E") 16px center / 20px 20px no-repeat,
    #fff;
  color: #13213a;
  font-size: 16px;
}

.messages-tabs {
  padding: 6px 16px 14px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.messages-tabs button {
  min-width: 0;
  min-height: 38px;
  border: 1px solid #e0e7f0;
  border-radius: 12px;
  padding: 0 10px;
  background: #fff;
  color: #657287;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.messages-tabs button:first-child,
.messages-tabs button:last-child {
  border-radius: 12px;
}

.messages-tabs button.is-active {
  border-color: #168dff;
  background: #168dff;
  color: #fff;
}

.messages-tabs span {
  min-width: 22px;
  height: 22px;
  background: #edf1f6;
  color: #647287;
  font-size: 13px;
}

.messages-tabs button.is-active span {
  background: rgba(255, 255, 255, 0.92);
  color: #168dff;
}

.messages-chat-list {
  padding: 2px 16px 14px;
  gap: 12px;
}

.messages-chat {
  min-height: 100px;
  border-color: #e0e7f0;
  border-radius: 12px;
  grid-template-columns: 58px minmax(0, 1fr) minmax(68px, auto);
  gap: 14px;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(17, 31, 52, 0.025);
}

.messages-chat.is-active {
  border-color: #b9ddff;
  background: #f0f8ff;
  box-shadow:
    inset 4px 0 0 #168dff,
    0 10px 28px rgba(22, 141, 255, 0.08);
}

.messages-chat-avatar,
.messages-avatar {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #0cb2a1, #038d77);
  font-size: 28px;
  font-weight: 700;
}

.messages-chat-avatar i {
  right: -1px;
  bottom: -1px;
  width: 25px;
  height: 25px;
  border-width: 3px;
  background: #168dff;
}

.messages-chat-avatar i svg {
  width: 14px;
  height: 14px;
}

.messages-chat-main {
  align-content: center;
  gap: 6px;
}

.messages-chat-main strong {
  font-size: 17px;
  line-height: 1.15;
}

.messages-chat-main em {
  max-width: 100%;
  border-radius: 6px;
  padding: 3px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-status-badge.status-pending {
  background: #fff2cf;
  color: #b87500;
}

.messages-status-badge.status-paid {
  background: #dff7e8;
  color: #18764c;
}

.messages-status-badge.status-confirmed {
  background: #e1f7ef;
  color: #167457;
}

.messages-status-badge.status-custom_rental {
  background: #e1f2ff;
  color: #176b9a;
}

.messages-status-badge.status-ended {
  background: #eef2f7;
  color: #566274;
}

.messages-status-badge.status-refused {
  background: #ffe4e2;
  color: #b42318;
}

.messages-chat-main small {
  color: #657287;
  font-size: 14px;
  line-height: 1.45;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.messages-chat-meta {
  align-content: start;
  gap: 8px;
  padding-top: 2px;
  color: #657287;
  font-size: 13px;
}

.messages-chat-meta time,
.messages-chat-meta small {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messages-sync-card {
  margin: 0 16px 14px;
  min-height: 62px;
  border: 1px solid #e0e7f0;
  border-radius: 12px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 12px;
  background: #fff;
  color: #657287;
}

.messages-sync-card > span {
  width: 26px;
  height: 26px;
  color: #111d32;
}

.messages-sync-card svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.messages-sync-card strong,
.messages-sync-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-sync-card strong {
  font-size: 13px;
  font-weight: 700;
}

.messages-sync-card small {
  margin-top: 3px;
  font-size: 13px;
}

.messages-conversation {
  grid-template-rows: 74px minmax(0, 1fr) 84px;
  background: #fff;
}

.messages-conversation-head {
  border-bottom-color: #e1e8f1;
}

.messages-back-button {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #111d32;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messages-back-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.messages-conversation-head > div:not(.messages-avatar):not(.messages-head-actions) {
  min-width: 0;
}

.messages-client-link {
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.messages-client-link > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.messages-conversation-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
}

.messages-conversation-head span,
.messages-client-link em {
  font-size: 14px;
}

.messages-client-link em {
  color: #6b7686;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.messages-head-actions {
  gap: 16px;
}

.messages-head-actions button {
  width: 34px;
  height: 34px;
  color: #111d32;
}

.messages-head-actions svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
}

.messages-conversation-list {
  padding: 54px 30px 28px;
  gap: 16px;
  background:
    linear-gradient(rgba(6, 15, 27, 0.88), rgba(6, 15, 27, 0.88)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='180' viewBox='0 0 240 180'%3E%3Cg fill='none' stroke='%23000000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' opacity='.34'%3E%3Cpath d='M31 37c19-16 45-11 53 10 10 25-18 50-42 35-16-10-17-32-4-43 10-9 26-7 33 4'/%3E%3Cpath d='M160 24l8 15 17 2-12 12 3 17-16-8-15 8 3-17-12-12 17-2 7-15Z'/%3E%3Cpath d='M190 117c14-22 39-21 44-2 4 16-12 32-29 25-12-5-15-20-7-29'/%3E%3Cpath d='M42 141l41-20-23 37-3-18-15 1Z'/%3E%3Ccircle cx='116' cy='96' r='22'/%3E%3Cpath d='M96 96h40M116 74c9 13 9 31 0 44M116 74c-9 13-9 31 0 44'/%3E%3Cpath d='M208 49h22M219 38v22M14 95h18M23 86v18'/%3E%3C/g%3E%3C/svg%3E"),
    #07111c;
  background-size: auto, 240px 180px, auto;
}

.messages-date-chip {
  border-radius: 12px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 14px;
}

.messages-conversation-list .messenger-message {
  width: min(62%, 560px);
  border-radius: 14px;
  padding: 16px 18px;
}

.messages-conversation-list .messenger-message div {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 14px;
}

.messages-conversation-list .messenger-message strong,
.messages-conversation-list .messenger-message span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.messages-conversation-list .messenger-message p {
  margin-top: 8px;
  font-size: 17px;
  line-height: 1.5;
}

.messages-conversation-list .messenger-message.outbound {
  background: linear-gradient(135deg, #526cf7 0%, #9646d2 100%);
}

.message-status {
  font-size: 15px;
}

.message-status svg {
  width: 17px;
  height: 17px;
}

.messages-dialog .messages-reply-form {
  min-height: 84px;
  padding: 14px 18px;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 14px;
}

.messages-input-wrap {
  height: 56px;
  border-color: #dce5f0;
  border-radius: 18px;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  padding: 0 12px;
}

.messages-dialog .messages-reply-form input {
  font-size: 16px;
}

.messages-input-icon {
  width: 38px;
  height: 38px;
  color: #111d32;
}

.messages-input-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.15;
}

.messages-dialog .messages-reply-form .primary-button {
  width: 56px;
  min-height: 56px;
  background: #168dff;
  box-shadow: 0 10px 24px rgba(22, 141, 255, 0.24);
}

.messages-dialog .messages-reply-form .primary-button:hover {
  background: #0d7ee8;
}

.messages-dialog .messages-reply-form .primary-button svg {
  width: 26px;
  height: 26px;
}

.messages-round-button:focus,
.messages-head-actions button:focus,
.messages-back-button:focus,
.messages-input-icon:focus,
.messages-close-window:focus {
  outline: none;
}

.messages-round-button:focus-visible,
.messages-head-actions button:focus-visible,
.messages-back-button:focus-visible,
.messages-input-icon:focus-visible,
.messages-close-window:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(22, 141, 255, 0.34);
}

.messages-round-button svg,
.messages-head-actions svg,
.messages-back-button svg,
.messages-input-icon svg,
.messages-sync-card svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.messages-round-button svg {
  width: 26px;
  height: 26px;
}

.messages-sidebar-head .messages-round-button svg {
  width: 24px;
  height: 24px;
}

.messages-head-actions svg,
.messages-back-button svg {
  width: 23px;
  height: 23px;
}

.messages-connected span svg,
.messages-chat-avatar i svg,
.messages-dialog .messages-reply-form .primary-button svg {
  display: none;
}

.messages-connected span svg {
  display: none;
}

.messages-chat-avatar i {
  width: 24px;
  height: 24px;
  border-width: 2px;
  background: #168dff;
  box-shadow: 0 2px 8px rgba(22, 141, 255, 0.24);
}

.messages-chat-avatar i svg {
  width: 15px;
  height: 15px;
}

.messages-dialog .messages-reply-form .primary-button svg {
  width: 25px;
  height: 25px;
}

.messages-connected span {
  box-shadow: 0 4px 10px rgba(22, 141, 255, 0.2);
}

.messages-connected.is-warning span {
  box-shadow: 0 4px 10px rgba(240, 68, 56, 0.2);
}

.messages-icon-more svg circle {
  fill: currentColor;
  stroke: none;
}

.messages-sidebar {
  grid-template-rows: 72px auto auto minmax(0, 1fr) 66px;
}

.messages-tabs {
  max-width: 100%;
  padding: 6px 16px 12px;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.messages-tabs::-webkit-scrollbar {
  display: none;
}

.messages-tabs button {
  flex: 0 0 auto;
  min-height: 32px;
  max-width: 138px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
}

.messages-tabs button:first-child,
.messages-tabs button:last-child {
  border-radius: 999px;
}

.messages-tabs span {
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  font-size: 11px;
}

.messages-chat-list {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 16px 8px;
  align-content: start;
  gap: 8px;
}

.messages-chat {
  height: 86px;
  min-height: 86px;
  grid-template-columns: 48px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  overflow: hidden;
}

.messages-chat-avatar {
  width: 48px;
  height: 48px;
  font-size: 23px;
}

.messages-chat-avatar i {
  width: 21px;
  height: 21px;
}

.messages-chat-avatar i svg {
  width: 13px;
  height: 13px;
}

.messages-chat-main {
  min-height: 0;
  align-content: center;
}

.messages-status-badge {
  justify-self: start;
  max-width: 128px;
  padding: 3px 7px;
  font-size: 11px;
  line-height: 1;
}

.messages-chat-main small {
  font-size: 13px;
  line-height: 1.22;
  -webkit-line-clamp: 1;
}

.messages-chat-meta {
  min-width: 0;
  align-content: center;
  justify-items: end;
  gap: 7px;
  padding-top: 0;
  font-size: 12px;
}

.messages-chat-meta time,
.messages-chat-meta small {
  max-width: 72px;
}

.messages-sync-card {
  height: 56px;
  min-height: 56px;
  margin: 0 16px 10px;
  padding: 8px 12px;
}

.messages-sync-card > span {
  width: 23px;
  height: 23px;
}

.messages-sync-card strong,
.messages-sync-card small {
  font-size: 12px;
}

@media (max-width: 1120px) {
  .messages-sidebar {
    grid-template-rows: 62px auto auto minmax(0, 1fr);
  }

  .messages-chat-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(300px, 46%);
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
  }

  .messages-chat {
    height: 102px;
    min-height: 102px;
  }
}

@media (max-width: 720px) {
  .messages-tabs button {
    max-width: 124px;
    min-height: 30px;
    font-size: 11px;
  }

  .messages-chat-list {
    grid-auto-columns: minmax(260px, 84%);
  }

  .messages-chat {
    height: 82px;
    min-height: 82px;
    grid-template-columns: 44px minmax(0, 1fr) 58px;
  }

  .messages-chat-avatar {
    width: 44px;
    height: 44px;
    font-size: 21px;
  }

  .messages-status-badge {
    max-width: 104px;
    font-size: 11px;
  }
}

.integration-dialog {
  width: min(820px, calc(100vw - 80px));
  max-height: calc(100dvh - 80px);
  border-radius: 22px;
  background: #f8fbff;
}

.integration-dialog form {
  padding: 24px 28px 28px;
}

.integration-dialog .dialog-head {
  margin-bottom: 16px;
}

.integration-dialog .dialog-head h2 {
  font-size: 26px;
  font-weight: 900;
}

.integration-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.integration-choice-card {
  min-height: 154px;
  border: 1px solid #cfe0ff;
  border-radius: 16px;
  padding: 18px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 20px;
  gap: 14px;
  align-items: center;
  text-align: left;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0%, rgba(49, 111, 255, 0.12), transparent 34%),
    #fff;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(6, 29, 66, 0.05);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.integration-choice-card:hover,
.integration-choice-card:focus-visible {
  border-color: #83a7ff;
  box-shadow: 0 18px 42px rgba(6, 29, 66, 0.1);
  transform: translateY(-1px);
}

.integration-choice-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.integration-choice-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.integration-choice-icon.is-wazzup {
  color: #1678c9;
  background: #eaf4ff;
}

.integration-choice-icon.is-mail {
  color: #ea7a46;
  background: #fff1e8;
}

.integration-choice-card strong {
  display: block;
  margin-bottom: 7px;
  font-size: 20px;
  font-weight: 900;
}

.integration-choice-card small {
  display: block;
  color: #667487;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.integration-choice-card i {
  color: #8ea0ba;
  font-size: 28px;
  font-style: normal;
  font-weight: 800;
}

.integration-detail-toolbar {
  margin-bottom: 12px;
}

.integration-status-card {
  border: 1px solid #dbe7f3;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  background: #fff;
  box-shadow: 0 12px 32px rgba(6, 29, 66, 0.05);
}

.integration-status-card.is-ready {
  border-color: #bfe8d0;
  background: #f4fff8;
}

.integration-status-card.is-warning {
  border-color: #f4d8a7;
  background: #fffaf0;
}

.integration-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 4px;
  background: #f2b94b;
  box-shadow: 0 0 0 5px rgba(242, 185, 75, 0.16);
}

.integration-status-card.is-ready .integration-status-dot {
  background: #34c987;
  box-shadow: 0 0 0 5px rgba(52, 201, 135, 0.16);
}

.integration-status-card strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.integration-status-card p {
  margin: 4px 0 0;
  color: #667487;
  font-size: 13px;
  line-height: 1.35;
}

.integration-key-card {
  border: 1px solid #cfe0ff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  background:
    radial-gradient(circle at 98% 0%, rgba(49, 111, 255, 0.12), transparent 28%),
    #fff;
}

.integration-key-card h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.integration-key-card p {
  margin: 0;
  color: #667487;
  font-size: 13px;
  line-height: 1.35;
}

.integration-key-card label {
  grid-column: 1 / 2;
  gap: 5px;
}

.integration-key-card label span {
  color: #748296;
  font-size: 12px;
  font-weight: 850;
}

.integration-key-card input {
  min-height: 40px;
  border-radius: 10px;
  font-size: 14px;
}

.integration-key-card .primary-button {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  min-height: 40px;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 13px;
}

.mail-integration-card {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.7fr);
}

.mail-integration-card label {
  grid-column: 1 / -1;
}

.mail-integration-card .primary-button {
  grid-column: auto;
  grid-row: auto;
}

.mail-integration-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mail-integration-actions .primary-button,
.mail-integration-actions .secondary-button {
  min-height: 40px;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 13px;
}

.integration-simple-help {
  display: grid;
  gap: 12px;
}

.integration-simple-help section {
  border: 1px solid #dfe8f2;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(6, 29, 66, 0.045);
}

.integration-simple-help h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.integration-simple-help ol {
  margin: 0;
  padding-left: 22px;
  color: #667487;
  font-size: 14px;
  line-height: 1.55;
}

.integration-simple-help li + li {
  margin-top: 5px;
}

.integration-simple-help p {
  margin: 0;
  color: #667487;
  font-size: 14px;
  line-height: 1.5;
}

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

.integration-card {
  position: relative;
  border: 1px solid #dfe8f2;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(6, 29, 66, 0.045);
}

.integration-card-accent {
  background:
    radial-gradient(circle at 96% 0%, rgba(49, 111, 255, 0.12), transparent 28%),
    #fff;
}

.integration-step {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef4ff;
  color: #316fff;
  font-size: 14px;
  font-weight: 900;
}

.integration-card h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.integration-card p {
  margin: 0;
  color: #667487;
  font-size: 13px;
  line-height: 1.45;
}

.integration-copy-field {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.integration-copy-field span {
  grid-column: 1 / -1;
  color: #748296;
  font-size: 12px;
  font-weight: 850;
}

.integration-copy-field input {
  min-width: 0;
  min-height: 38px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.integration-copy-field .secondary-button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
}

.integration-events {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.integration-events span {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef4ff;
  color: #316fff;
  font-size: 12px;
  font-weight: 900;
}

.integration-vars {
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.integration-vars div {
  border: 1px solid #e3ebf5;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fbfdff;
}

.integration-vars dt {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.integration-vars dd {
  margin: 0;
  color: #708093;
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.integration-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.integration-actions .primary-button,
.integration-actions .secondary-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
  text-decoration: none;
}

@media (max-width: 760px) {
  .integration-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .integration-dialog form {
    padding: 20px;
  }

  .integration-picker {
    grid-template-columns: 1fr;
  }

  .integration-choice-card {
    min-height: 126px;
    grid-template-columns: 48px minmax(0, 1fr) 18px;
  }

  .integration-choice-icon {
    width: 48px;
    height: 48px;
  }

  .integration-key-card {
    grid-template-columns: 1fr;
  }

  .integration-key-card label,
  .integration-key-card .primary-button {
    grid-column: auto;
    grid-row: auto;
  }
}

.crm-detail-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.crm-detail-bottom-actions,
.crm-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crm-contact-actions {
  justify-content: flex-end;
}

.crm-detail-delete-button {
  min-height: 40px;
  border: 1px solid rgba(214, 75, 75, 0.28);
  border-radius: 10px;
  padding: 8px 14px;
  background: #fff6f6;
  color: #c94a4a;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.crm-detail-delete-button:hover,
.crm-detail-delete-button:focus-visible {
  border-color: rgba(214, 75, 75, 0.46);
  background: #fff0f0;
  outline: 0;
}

.crm-detail-delete-button span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(214, 75, 75, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.crm-detail-delete-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.client-messenger {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  box-shadow: 0 10px 28px rgba(6, 29, 66, 0.04);
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto;
  overflow: hidden;
}

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

.client-messenger-head div {
  display: grid;
  gap: 3px;
}

.client-messenger-head strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.client-messenger-head span {
  color: var(--muted);
  font-size: 13px;
}

.client-messenger-list {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.client-messenger-empty {
  align-self: center;
  justify-self: center;
  color: #8b949e;
  font-size: 14px;
}

.messenger-message {
  width: min(82%, 520px);
  border: 1px solid #dfe8f1;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.messenger-message.outbound {
  justify-self: end;
  border-color: #cfe0ff;
  background: #eef5ff;
}

.messenger-message div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.messenger-message strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.messenger-message span {
  color: #7a8592;
  font-size: 12px;
}

.messenger-message p {
  margin: 0;
  color: #303946;
  font-size: 15px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.message-attachment {
  margin: 4px 0 0;
  display: grid;
  gap: 6px;
}

.message-attachment img {
  display: block;
  max-width: min(100%, 320px);
  max-height: 240px;
  border-radius: 10px;
  object-fit: cover;
}

.message-attachment figcaption,
.message-attachment-link {
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.78;
}

.message-attachment-link {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(56, 126, 255, 0.12);
  text-decoration: none;
}

.message-audio {
  margin-top: 6px;
  min-width: min(100%, 260px);
  border-radius: 14px;
  padding: 10px;
  background: rgba(56, 126, 255, 0.1);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.messenger-message.outbound .message-audio {
  background: rgba(255, 255, 255, 0.16);
}

.message-audio > span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #168dff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message-audio svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.message-audio strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.message-audio audio {
  width: 100%;
  max-width: 260px;
  height: 34px;
  display: block;
}

.client-messenger-form {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
}

.client-messenger-form input {
  min-width: 0;
}

.client-messenger-attach {
  width: 42px;
  min-height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.client-messenger-attach svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.contact-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.contact-button-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.contact-button-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}

.contact-call {
  background: #10b981;
}

.contact-telegram {
  background: #2474d8;
}

.contact-button:hover {
  background: var(--brand-dark);
}

.contact-button.is-disabled {
  background: #edf2f6;
  color: #98a4b2;
  cursor: not-allowed;
}

.contact-button.is-disabled .contact-button-icon {
  background: #dce4ec;
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    padding: 12px;
    overflow: visible;
    grid-template-rows: auto auto auto auto;
  }

  .topbar,
  .workspace,
  .day-panel-head {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  h1 {
    white-space: normal;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

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

  .month-tabs {
    grid-template-columns: repeat(4, 1fr);
  }

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

  .admin-database {
    grid-template-columns: 1fr;
  }

  .admin-database-nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(140px, 1fr);
    overflow-x: auto;
  }

  .user-row {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
  }

  .user-row .user-delete-button {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .history-main {
    display: grid;
  }

  .history-details {
    grid-template-columns: 1fr;
  }

  .history-dialog {
    width: min(920px, calc(100% - 24px));
  }

  .messages-dialog {
    width: min(980px, calc(100% - 24px));
    height: min(860px, calc(100vh - 24px));
  }

  .messages-window {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 36%) minmax(0, 1fr);
  }

  .messages-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .messages-chat-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 80%);
    overflow-x: auto;
  }

  .crm-detail-layout {
    max-height: none;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .crm-detail-main {
    overflow: visible;
    padding-right: 0;
  }

  .history-main .status {
    justify-self: start;
  }

  .crm-board {
    grid-template-columns: 1fr;
  }

  .calendar-panel,
  .day-panel {
    overflow: visible;
  }

  .calendar-grid {
    min-height: 390px;
    flex: 0 0 auto;
  }

  .day-cell {
    min-height: 68px;
    padding: 6px 4px;
  }

  .booking-count {
    padding: 0 2px;
    font-size: 8px;
  }

  .day-panel {
    min-height: auto;
  }

  .schedule-list {
    flex: 0 0 auto;
    grid-template-rows: auto;
    overflow: visible;
    gap: 3px;
  }

  .schedule-hour {
    grid-template-columns: 1fr;
  }

  .schedule-header {
    grid-template-columns: 1fr;
  }

  .schedule-header > span {
    display: none;
  }

  .schedule-hour-label {
    min-height: 22px;
  }

  .schedule-slots,
  .quarter-headings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .time-slot,
  .schedule-hour-label {
    min-height: 24px;
  }

  .month-tabs {
    padding-top: 6px;
  }
}

@media (max-width: 540px) {
  .booking-dialog {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 16px;
  }

  .history-dialog {
    width: calc(100% - 16px);
    border-radius: 18px;
  }

  .booking-dialog form,
  #adminDialog form,
  .history-dialog form,
  .crm-detail-dialog form {
    padding: 20px 18px 18px;
  }

  .dialog-head {
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .dialog-head h2,
  #adminDialog .dialog-head h2,
  .history-dialog .dialog-head h2 {
    font-size: 28px;
  }

  .close-button,
  #adminDialog .close-button,
  .history-dialog .close-button {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .history-list {
    max-height: calc(100vh - 146px);
    gap: 10px;
  }

  .history-item {
    padding: 16px;
    border-radius: 12px;
    gap: 12px;
  }

  .history-main strong {
    white-space: normal;
    font-size: 20px;
  }

  .history-main .status {
    min-height: 32px;
    padding: 7px 13px;
    font-size: 14px;
  }

  .history-details {
    gap: 8px;
    font-size: 16px;
  }

  .history-note {
    font-size: 15px;
  }

  .booking-field {
    min-height: 84px;
    padding: 14px 12px;
    grid-template-columns: 46px minmax(0, 1fr) 16px;
    gap: 3px 12px;
  }

  .booking-field-note {
    min-height: 124px;
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .booking-field-icon {
    width: 42px;
    height: 42px;
  }

  .booking-field-icon svg {
    width: 21px;
    height: 21px;
  }

  .booking-field-label {
    font-size: 14px;
  }

  .booking-field > input,
  .booking-field > select,
  .booking-field > textarea,
  .custom-select-trigger {
    min-width: 0;
    font-size: 18px;
  }

  .booking-field:has(select)::after {
    width: 9px;
    height: 9px;
  }

  .dialog-actions {
    grid-template-columns: 1fr 1fr;
  }

  .dialog-actions span {
    display: none;
  }

  .dialog-actions .danger-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1120px) {
  .messages-dialog {
    width: min(980px, calc(100% - 24px));
    height: min(860px, calc(100dvh - 24px));
  }

  .messages-appbar {
    gap: 12px;
    padding: 0 16px;
  }

  .messages-brand {
    gap: 12px;
    font-size: 18px;
  }

  .messages-app-actions {
    gap: 10px;
  }

  .messages-connected {
    min-height: 42px;
    font-size: 14px;
  }

  .messages-window {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(240px, 38%) minmax(0, 1fr);
  }

  .messages-chat-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(290px, 52%);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .messages-sync-card {
    display: none;
  }
}

@media (max-width: 720px) {
  .messages-dialog {
    width: calc(100% - 12px);
    height: calc(100dvh - 12px);
    border-radius: 14px;
  }

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

  .messages-appbar {
    min-height: 62px;
  }

  .messages-brand {
    font-size: 16px;
  }

  .messages-brand span:not(.messages-brand-mark),
  .messages-brand strong:first-of-type {
    display: none;
  }

  .messages-connected {
    min-height: 40px;
    padding: 0 10px;
    gap: 8px;
  }

  .messages-connected strong {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .messages-connected span {
    width: 30px;
    height: 30px;
  }

  .messages-window {
    padding: 8px;
    gap: 8px;
    grid-template-rows: minmax(210px, 34%) minmax(0, 1fr);
  }

  .messages-sidebar-head,
  .messages-conversation-head {
    min-height: 62px;
    padding: 10px 12px;
  }

  .messages-search {
    padding: 10px 12px 8px;
  }

  .messages-tabs {
    padding: 4px 12px 10px;
    overflow-x: auto;
  }

  .messages-chat-list {
    padding: 0 12px 12px;
    grid-auto-columns: minmax(260px, 86%);
  }

  .messages-chat {
    grid-template-columns: 50px minmax(0, 1fr) minmax(54px, auto);
    min-height: 88px;
    gap: 10px;
    padding: 12px;
  }

  .messages-chat-avatar,
  .messages-avatar {
    width: 48px;
    height: 48px;
    font-size: 23px;
  }

  .messages-chat-main strong,
  .messages-conversation-head strong {
    font-size: 16px;
  }

  .messages-chat-main small {
    font-size: 13px;
  }

  .messages-head-actions {
    gap: 6px;
  }

  .messages-head-actions button {
    width: 30px;
    height: 30px;
  }

  .messages-head-actions svg {
    width: 20px;
    height: 20px;
  }

  .messages-conversation {
    grid-template-rows: 62px minmax(0, 1fr) 72px;
  }

  .messages-conversation-list {
    padding: 34px 14px 18px;
  }

  .messages-conversation-list .messenger-message {
    width: min(86%, 520px);
    padding: 13px 14px;
  }

  .messages-conversation-list .messenger-message p {
    font-size: 15px;
  }

  .messages-dialog .messages-reply-form {
    min-height: 72px;
    padding: 10px 12px;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 10px;
  }

  .messages-input-wrap {
    height: 50px;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
  }

  .messages-dialog .messages-reply-form .primary-button {
    width: 48px;
    min-height: 48px;
  }
}

.messages-connected span::before,
.messages-chat-avatar i::before,
.messages-dialog .messages-reply-form .primary-button::before {
  content: "";
  width: 58%;
  height: 58%;
  display: block;
  background: #fff;
  -webkit-mask: url("./assets/icons/telegram-mask.svg") center / contain no-repeat;
  mask: url("./assets/icons/telegram-mask.svg") center / contain no-repeat;
}

.messages-dialog .messages-reply-form .primary-button::before {
  width: 30px;
  height: 30px;
}

.messages-icon-phone svg {
  display: none;
}

.messages-icon-phone::before {
  content: "";
  width: 23px;
  height: 23px;
  display: block;
  background: currentColor;
  -webkit-mask: url("./assets/icons/phone.svg") center / contain no-repeat;
  mask: url("./assets/icons/phone.svg") center / contain no-repeat;
}

@media (max-width: 720px) {
  .crm-detail-dialog {
    width: calc(100vw - 14px);
    height: calc(100dvh - 14px);
    max-height: calc(100dvh - 14px);
    border-radius: 14px;
  }

  .crm-detail-dialog form {
    height: 100%;
    max-height: none;
    padding: 14px 12px 12px;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .crm-detail-dialog .dialog-head {
    margin-bottom: 10px;
    align-items: center;
  }

  .crm-detail-dialog .dialog-head div {
    min-width: 0;
  }

  .crm-detail-dialog .dialog-head h2 {
    max-width: calc(100vw - 120px);
    overflow: hidden;
    font-size: 28px;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .crm-detail-dialog .close-button {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    flex: 0 0 auto;
  }

  .crm-detail-layout {
    max-height: none;
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 2px calc(24px + env(safe-area-inset-bottom));
    scrollbar-width: none;
  }

  .crm-detail-layout::-webkit-scrollbar {
    display: none;
  }

  .crm-detail-main {
    overflow: visible;
    padding-right: 0;
    gap: 10px;
  }

  .crm-detail-grid {
    border-radius: 0;
    grid-template-columns: 1fr;
    overflow: visible;
    gap: 12px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .crm-detail-row {
    position: relative;
    min-height: 92px;
    padding: 16px 14px 14px 80px;
    border: 1px solid #dce5f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(6, 29, 66, 0.035);
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 8px;
  }

  .crm-detail-row > .detail-label,
  .crm-detail-row > strong,
  .crm-detail-row:last-child > .detail-label,
  .crm-detail-row:last-child > strong {
    min-height: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
  }

  .crm-detail-row > .detail-label,
  .crm-detail-row:last-child > .detail-label {
    border: 0;
    background: transparent;
    color: #657383;
    font-size: 15px;
    font-weight: 760;
    line-height: 1.1;
  }

  .crm-detail-row > strong,
  .crm-detail-row:last-child > strong {
    border: 0;
    color: #061d42;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.22;
    word-break: break-word;
  }

  .detail-label {
    gap: 10px;
  }

  .detail-row-icon {
    position: absolute;
    left: 16px;
    top: 16px;
    width: 40px;
    height: 40px;
  }

  .detail-inline-value,
  .detail-inline-select,
  .detail-inline-input {
    min-height: 42px;
    padding: 8px 10px;
    font-size: 18px;
    line-height: 1.16;
  }

  .detail-inline-select {
    max-width: 100%;
    padding-right: 38px;
  }

  .detail-datetime-editor {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .detail-datetime-save {
    width: 100%;
  }

  .crm-detail-row .detail-inline-value {
    padding-left: 0;
    padding-right: 0;
  }

  .detail-inline-select[data-field="status"] {
    border-color: #f4d28f;
    background:
      linear-gradient(45deg, transparent 50%, #8a5a00 50%) right 18px center / 8px 8px no-repeat,
      linear-gradient(135deg, #8a5a00 50%, transparent 50%) right 12px center / 8px 8px no-repeat,
      #fff4df;
    color: #b26b00;
  }

  .crm-detail-row[data-detail-field^="status"] {
    border-color: #f2dcae;
    background: #fff8e9;
  }

  .crm-detail-row[data-detail-field^="status"] .detail-row-icon {
    border-color: #f2dcae;
    background: #fff1c7;
    color: #b26b00;
  }

  .crm-detail-row[data-detail-field^="status"] .detail-label {
    color: #8a6a2f;
  }

  .crm-detail-row[data-detail-field="status status-custom_rental"],
  .crm-detail-row[data-detail-field="status status-pending"] {
    border-color: #f2dcae;
    background: #fff8e9;
  }

  .crm-detail-row[data-detail-field="status status-custom_rental"] .detail-row-icon,
  .crm-detail-row[data-detail-field="status status-pending"] .detail-row-icon {
    border-color: #f2dcae;
    background: #fff1c7;
    color: #b26b00;
  }

  .crm-detail-row[data-detail-field="status status-paid"],
  .crm-detail-row[data-detail-field="status status-ended"] {
    border-color: #bfe8cf;
    background: #f0fbf5;
  }

  .crm-detail-row[data-detail-field="status status-paid"] .detail-row-icon,
  .crm-detail-row[data-detail-field="status status-ended"] .detail-row-icon {
    border-color: #bfe8cf;
    background: #dff6e8;
    color: #16834d;
  }

  .crm-detail-row[data-detail-field="status status-paid"] .detail-inline-select[data-field="status"],
  .crm-detail-row[data-detail-field="status status-ended"] .detail-inline-select[data-field="status"] {
    border-color: #bfe8cf;
    background:
      linear-gradient(45deg, transparent 50%, #16834d 50%) right 18px center / 8px 8px no-repeat,
      linear-gradient(135deg, #16834d 50%, transparent 50%) right 12px center / 8px 8px no-repeat,
      #e8f8ef;
    color: #16834d;
  }

  .crm-detail-row[data-detail-field="status status-refused"] {
    border-color: #f1caca;
    background: #fff5f5;
  }

  .crm-detail-row[data-detail-field="status status-refused"] .detail-row-icon {
    border-color: #f1caca;
    background: #ffe2e2;
    color: #c54545;
  }

  .crm-detail-row[data-detail-field="status status-refused"] .detail-inline-select[data-field="status"] {
    border-color: #f1caca;
    background:
      linear-gradient(45deg, transparent 50%, #c54545 50%) right 18px center / 8px 8px no-repeat,
      linear-gradient(135deg, #c54545 50%, transparent 50%) right 12px center / 8px 8px no-repeat,
      #fff1f1;
    color: #c54545;
  }

  .task-create {
    margin-top: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .task-add-button {
    min-width: 0;
    min-height: 52px;
    border-radius: 12px;
    padding: 0 12px;
    grid-template-columns: 40px minmax(0, 1fr) 22px;
    gap: 10px;
  }

  .task-add-button strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .task-add-button small {
    justify-self: end;
  }

  .task-create-form {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: 1fr;
    padding: 12px;
    overflow: visible;
  }

  .task-create-form label,
  .task-create-form input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .task-create-form input[type="date"],
  .task-create-form input[type="time"] {
    text-align: center;
  }

  .task-create-form input[type="date"]::-webkit-date-and-time-value,
  .task-create-form input[type="time"]::-webkit-date-and-time-value {
    min-width: 0;
    text-align: center;
  }

  .task-create-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    justify-content: stretch;
    width: 100%;
    min-width: 0;
  }

  .task-create-actions button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding-inline: 10px;
    line-height: 1.1;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .task-create-actions #saveTaskFormBtn {
    grid-column: 1 / -1;
  }

  .crm-detail-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .crm-detail-bottom-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .crm-contact-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .contact-button {
    min-width: 0;
    min-height: 46px;
    border-radius: 12px;
    justify-content: center;
    padding: 8px 10px;
    font-size: 14px;
  }

  .contact-button-icon {
    width: 22px;
    height: 22px;
  }

  .client-history {
    display: none;
  }
}

@media (max-width: 720px) {
  .messages-dialog {
    width: calc(100vw - 14px);
    height: calc(100dvh - 14px);
    max-height: calc(100dvh - 14px);
    border-radius: 14px;
  }

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

  .messages-appbar {
    min-height: 54px;
    padding: 0 8px;
    gap: 8px;
  }

  .messages-brand {
    flex: 0 1 auto;
    gap: 8px;
    font-size: 15px;
  }

  .messages-brand-mark {
    width: 24px;
    height: 24px;
  }

  .messages-brand strong:first-of-type,
  .messages-brand span:not(.messages-brand-mark) {
    display: none;
  }

  .messages-app-actions {
    min-width: 0;
    gap: 6px;
  }

  .messages-connected {
    min-height: 38px;
    max-width: 210px;
    border-radius: 14px;
    padding: 0 9px;
    gap: 7px;
    font-size: 13px;
  }

  .messages-connected strong {
    min-width: 0;
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .messages-connected span {
    width: 28px;
    height: 28px;
  }

  .messages-connected i {
    width: 7px;
    height: 7px;
  }

  .messages-close-window.messages-user-menu {
    width: 36px;
    height: 36px;
    min-height: 36px;
    border-radius: 12px;
  }

  .messages-close-window.messages-user-menu > span {
    width: 22px;
    height: 22px;
  }

  .messages-close-window.messages-user-menu > span::before,
  .messages-close-window.messages-user-menu > span::after {
    width: 20px;
    height: 2.5px;
  }

  .messages-window {
    grid-template-columns: 1fr;
    grid-template-rows: 218px minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
    overflow: hidden;
  }

  .messages-sidebar,
  .messages-conversation {
    border-radius: 12px;
  }

  .messages-sidebar {
    grid-template-rows: 46px 46px 38px minmax(0, 1fr);
  }

  .messages-sidebar-head,
  .messages-conversation-head {
    min-height: 46px;
    padding: 8px 12px;
  }

  .messages-sidebar-head h2 {
    font-size: 22px;
  }

  .messages-search {
    padding: 0 10px 6px;
  }

  .messages-search input {
    min-height: 40px;
    border-radius: 12px;
    padding-left: 40px;
    font-size: 14px;
  }

  .messages-tabs {
    padding: 0 10px 6px;
    gap: 5px;
  }

  .messages-tabs button {
    min-height: 30px;
    max-width: 116px;
    padding: 0 8px;
    font-size: 11px;
  }

  .messages-tabs span {
    min-width: 17px;
    height: 17px;
    font-size: 10px;
  }

  .messages-chat-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 88%);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 10px 8px;
    gap: 8px;
  }

  .messages-chat {
    height: 72px;
    min-height: 72px;
    grid-template-columns: 42px minmax(0, 1fr) 58px;
    gap: 9px;
    padding: 9px 10px;
  }

  .messages-chat-avatar {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .messages-chat-avatar i {
    width: 18px;
    height: 18px;
    border-width: 2px;
  }

  .messages-chat-main {
    gap: 3px;
  }

  .messages-chat-main strong {
    font-size: 15px;
    line-height: 1.05;
  }

  .messages-status-badge {
    max-width: 96px;
    padding: 2px 7px;
    font-size: 10px;
  }

  .messages-chat-main small {
    font-size: 12px;
    line-height: 1.15;
    -webkit-line-clamp: 1;
  }

  .messages-chat-meta {
    gap: 4px;
    font-size: 11px;
  }

  .messages-chat-meta time,
  .messages-chat-meta small {
    max-width: 58px;
  }

  .messages-conversation {
    grid-template-rows: 58px minmax(0, 1fr) 62px;
    min-width: 0;
  }

  .messages-back-button {
    width: 34px;
    height: 34px;
  }

  .messages-avatar {
    width: 44px;
    height: 44px;
    font-size: 21px;
  }

  .messages-conversation-head {
    gap: 8px;
  }

  .messages-conversation-head strong {
    font-size: 15px;
  }

  .messages-conversation-head span {
    font-size: 12px;
  }

  .messages-head-actions {
    gap: 4px;
  }

  .messages-head-actions button {
    width: 28px;
    height: 28px;
  }

  .messages-head-actions button:not(:first-child) {
    display: none;
  }

  .messages-conversation-list {
    padding: 20px 12px 14px;
    gap: 10px;
    overflow-x: hidden;
  }

  .messages-date-chip {
    padding: 6px 10px;
    font-size: 12px;
  }

  .messages-conversation-list .messenger-message {
    width: min(88%, 360px);
    max-width: calc(100% - 10px);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
  }

  .messages-conversation-list .messenger-message p {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.35;
  }

  .messages-conversation-list .messenger-message div {
    gap: 8px;
  }

  .messages-conversation-list .messenger-message strong,
  .messages-conversation-list .messenger-message span,
  .message-status {
    font-size: 12px;
  }

  .messages-dialog .messages-reply-form {
    min-height: 62px;
    padding: 8px 10px;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
  }

  .messages-input-wrap {
    height: 46px;
    border-radius: 16px;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    padding: 0 8px;
  }

  .messages-dialog .messages-reply-form input {
    font-size: 14px;
  }

  .messages-input-icon {
    width: 32px;
    height: 32px;
  }

  .messages-input-icon svg {
    width: 21px;
    height: 21px;
  }

  .messages-dialog .messages-reply-form .primary-button {
    width: 44px;
    min-height: 44px;
  }

  .messages-dialog:not(.is-conversation-open) .messages-window {
    grid-template-rows: minmax(0, 1fr);
  }

  .messages-dialog:not(.is-conversation-open) .messages-sidebar {
    min-height: 0;
    grid-template-rows: 46px 46px 38px minmax(0, 1fr);
  }

  .messages-dialog:not(.is-conversation-open) .messages-conversation {
    display: none;
  }

  .messages-dialog:not(.is-conversation-open) .messages-chat-list {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .messages-dialog:not(.is-conversation-open) .messages-chat {
    width: 100%;
    height: 78px;
    min-height: 78px;
  }

  .messages-dialog.is-conversation-open .messages-window {
    grid-template-rows: minmax(0, 1fr);
  }

  .messages-dialog.is-conversation-open .messages-sidebar {
    display: none;
  }

  .messages-dialog.is-conversation-open .messages-conversation {
    display: grid;
    min-height: 0;
  }
}

.messages-connected span,
.messages-connected.is-ready span,
.messages-connected.is-warning span,
.messages-chat-avatar i,
.messages-dialog .messages-reply-form .primary-button,
.messages-dialog .messages-reply-form .primary-button:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M20.7 4.4c.5-.2.9.2.8.7l-3.2 14.8c-.1.6-.8.8-1.3.5l-4.6-3.3-2.3 2.2c-.4.4-1.1.2-1.2-.4l-.6-3.6-4.1-1.3c-.6-.2-.6-1 .1-1.3l16.4-8.8ZM9.2 14.7l.4 2.8 1.5-1.5 5.5-6.8-7.4 5.5Z'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 58%;
}

.messages-connected span,
.messages-connected.is-ready span,
.messages-chat-avatar i,
.messages-dialog .messages-reply-form .primary-button {
  background-color: #168dff;
}

.messages-connected.is-warning span {
  background-color: #f04438;
}

.messages-dialog .messages-reply-form .primary-button:hover {
  background-color: #0d7ee8;
}

.messages-connected span::before,
.messages-chat-avatar i::before,
.messages-dialog .messages-reply-form .primary-button::before {
  display: none;
}

@media (max-width: 720px) {
  body {
    overflow: auto;
    background: #f7f9fc;
  }

  .app-shell {
    width: 100%;
    min-height: 100dvh;
    height: auto;
    padding: 22px 14px 24px;
    display: grid;
    grid-template-rows: auto auto auto auto;
    gap: 14px;
    overflow: visible;
  }

  .topbar,
  .stats-row,
  .workspace,
  .month-tabs {
    width: 100%;
    max-width: 100%;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 14px;
  }

  .brand-block {
    gap: 14px;
    align-items: center;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
    box-shadow: 0 10px 22px rgba(6, 29, 66, 0.12);
  }

  .brand-block h1 {
    max-width: 100%;
    font-size: clamp(28px, 8vw, 34px);
    line-height: 1.06;
    white-space: normal;
  }

  .topbar p {
    margin-top: 5px;
    font-size: 17px;
    line-height: 1.22;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
  }

  .topbar #historyBtn,
  .topbar #adminBtn,
  .topbar #logoutBtn {
    display: none;
  }

  .user-badge,
  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    width: 100%;
    min-height: 58px;
    border-radius: 14px;
  }

  .user-badge {
    min-width: 0;
    padding: 8px 12px 8px 58px;
    display: grid;
    align-content: center;
    position: relative;
    overflow: hidden;
    border: 1px solid #e2eaf4;
    background: #fff;
    color: #657383;
    font-size: 16px;
    font-weight: 760;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 10px 22px rgba(6, 29, 66, 0.045);
  }

  .user-badge::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 32px;
    height: 32px;
    transform: translateY(-50%);
    border-radius: 10px;
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23185cff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.2'/%3E%3Cpath d='M5.5 20c.8-3.9 3-5.8 6.5-5.8s5.7 1.9 6.5 5.8'/%3E%3C/svg%3E")
        center / 20px 20px no-repeat,
      #eef5ff;
  }

  .mobile-new-booking-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 14px;
    background: linear-gradient(135deg, #316fff 0%, #1458ff 100%);
    font-size: 15px;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 14px 28px rgba(24, 87, 241, 0.24);
  }

  .mobile-new-booking-button::before {
    content: "+";
    width: 22px;
    height: 22px;
    border-radius: 8px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 23px;
    line-height: 1;
  }

  .topbar .message-button,
  .topbar #topTasksBtn,
  .topbar #crmBtn {
    padding: 0 14px;
    justify-content: center;
    color: #185cff;
    font-size: 17px;
    font-weight: 820;
    background: #fff;
    border-color: #e0e8f2;
  }

  .message-badge {
    top: 8px;
    right: 10px;
  }

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

  .stats-row .stat {
    position: relative;
    min-height: 92px;
    padding: 14px 9px 12px 42px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    gap: 4px;
    border-radius: 14px;
    background: #fff;
    text-align: right;
    box-shadow: 0 10px 22px rgba(6, 29, 66, 0.04);
  }

  .stats-row .stat:nth-child(3) {
    order: 1;
  }

  .stats-row .stat:nth-child(2) {
    order: 2;
  }

  .stats-row .stat:nth-child(1) {
    order: 3;
  }

  .stats-row .stat::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 16px;
    width: 28px;
    height: 28px;
    border-radius: 12px;
    background: #eef5ff;
  }

  .stats-row .stat:nth-child(1)::before {
    background: #fff0f0;
  }

  .stats-row .stat:nth-child(2)::before {
    background: #eaf8f0;
  }

  .stat span {
    min-width: 0;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.15;
  }

  .stat strong {
    min-width: 0;
    font-size: clamp(20px, 5.4vw, 23px);
    line-height: 1.05;
    white-space: nowrap;
  }

  .workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    overflow: visible;
  }

  .calendar-panel,
  .day-panel {
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(6, 29, 66, 0.07);
  }

  .calendar-panel {
    padding: 16px 14px 18px;
  }

  .calendar-head {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 10px;
    align-items: center;
  }

  .calendar-head h2 {
    font-size: 28px;
    text-align: center;
  }

  .calendar-head .nav-button {
    width: 48px;
    height: 48px;
    min-height: 48px;
    border-radius: 13px;
    font-size: 34px;
  }

  .weekdays {
    margin-top: 18px;
  }

  .weekdays span {
    min-height: 22px;
    font-size: 14px;
  }

  .calendar-grid {
    min-height: 0;
    grid-template-rows: repeat(6, 72px);
    gap: 7px;
    margin-top: 8px;
  }

  .day-cell {
    min-height: 72px;
    padding: 9px 5px 7px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    text-align: center;
  }

  .day-cell.is-selected {
    background: linear-gradient(135deg, #316fff 0%, #1857f1 100%);
    color: #fff;
    border-color: rgba(24, 87, 241, 0.45);
    outline: none;
    box-shadow: 0 12px 24px rgba(31, 96, 255, 0.22);
  }

  .day-cell.is-selected .booking-count,
  .day-cell.is-selected .rental-count {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
  }

  .day-number {
    font-size: 23px;
  }

  .day-badges {
    gap: 4px;
  }

  .booking-count {
    min-height: 18px;
    padding: 0 5px;
    font-size: 10px;
  }

  .day-panel {
    padding: 16px 14px;
    gap: 14px;
  }

  .day-panel-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }

  .day-panel .eyebrow {
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
  }

  .day-panel h2 {
    font-size: 28px;
    line-height: 1.1;
  }

  .day-panel-head .primary-button {
    width: 100%;
    min-height: 58px;
    border-radius: 14px;
    font-size: 18px;
  }

  .schedule-list {
    gap: 12px;
    padding: 0;
  }

  .schedule-header {
    margin-bottom: -2px;
  }

  .quarter-headings {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid #dfe7f1;
    border-radius: 13px;
    background: #fff;
  }

  .quarter-headings span {
    position: relative;
    min-height: 46px;
    display: grid;
    place-items: center;
    border-left: 1px solid #eef2f6;
    color: transparent;
    font-size: 14px;
  }

  .quarter-headings span::after {
    content: "1/4 поля";
    color: #657383;
  }

  .quarter-headings span:first-child {
    border-left: 0;
    box-shadow: inset 0 0 0 1px rgba(24, 92, 255, 0.35);
  }

  .quarter-headings span:first-child::after {
    color: #185cff;
  }

  .quarter-headings span:nth-child(2)::after {
    content: "1/2 поля";
  }

  .quarter-headings span:nth-child(3)::after {
    content: "Все поле";
  }

  .quarter-headings span:nth-child(4) {
    display: none;
  }

  .schedule-hour {
    gap: 8px;
    padding: 0;
    border-radius: 15px;
    background: #fff;
  }

  .schedule-grid {
    grid-template-columns: minmax(64px, 0.8fr) repeat(4, minmax(0, 1fr));
    grid-auto-rows: 24px;
    gap: 4px;
  }

  .schedule-hour-label {
    min-height: 24px;
    border-radius: 8px;
    font-size: 14px;
  }

  .schedule-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .time-slot {
    min-height: 24px;
    border-radius: 8px;
    padding: 2px 5px;
  }

  .time-slot strong {
    font-size: 9px;
  }

  .slot-detail {
    font-size: 10px;
  }

  .time-slot span:not(.slot-time):not(.slot-detail):not(.booked-cell):not(.booking-continuation) {
    font-size: 12px;
  }

  .month-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border: 1px solid #e1e8f1;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(6, 29, 66, 0.055);
  }

  .month-tabs::before {
    content: "Выбор месяца";
    grid-column: 1 / -1;
    color: #061d42;
    font-size: 18px;
    font-weight: 860;
  }

  .month-tab {
    min-height: 42px;
    border-radius: 11px;
    font-size: 16px;
  }

  .app-shell {
    padding: 16px 12px 20px;
    gap: 11px;
  }

  .topbar {
    gap: 11px;
  }

  .brand-block {
    gap: 11px;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand-block h1 {
    font-size: clamp(24px, 6.9vw, 30px);
  }

  .topbar p {
    font-size: 15px;
  }

  .top-actions {
    gap: 8px;
  }

  .user-badge,
  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    min-height: 50px;
    border-radius: 12px;
  }

  .user-badge {
    padding-left: 50px;
    font-size: 14px;
  }

  .user-badge::before {
    left: 12px;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: #eef5ff;
  }

  .user-badge::after {
    content: "";
    position: absolute;
    left: 18px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    background: #185cff;
    -webkit-mask: url("./assets/icons/user.svg") center / contain no-repeat;
    mask: url("./assets/icons/user.svg") center / contain no-repeat;
  }

  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 15px;
  }

  .mobile-new-booking-button::before,
  .topbar #topTasksBtn::before,
  .topbar .message-button::before,
  .topbar #crmBtn::before {
    content: "";
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    background: currentColor;
  }

  .mobile-new-booking-button::before {
    border-radius: 0;
    background: #fff;
    -webkit-mask: url("./assets/icons/calendar-plus.svg") center / contain no-repeat;
    mask: url("./assets/icons/calendar-plus.svg") center / contain no-repeat;
  }

  .topbar .message-button::before {
    -webkit-mask: url("./assets/icons/messages.svg") center / contain no-repeat;
    mask: url("./assets/icons/messages.svg") center / contain no-repeat;
  }

  .topbar #topTasksBtn::before {
    -webkit-mask: url("./assets/icons/calendar.svg") center / contain no-repeat;
    mask: url("./assets/icons/calendar.svg") center / contain no-repeat;
  }

  .topbar #crmBtn::before {
    -webkit-mask: url("./assets/icons/crm.svg") center / contain no-repeat;
    mask: url("./assets/icons/crm.svg") center / contain no-repeat;
  }

  .topbar #topTasksBtn {
    position: relative;
  }

  .topbar #topTasksBtn .crm-task-counters {
    position: absolute;
    top: 5px;
    right: 7px;
    gap: 3px;
  }

  .topbar #topTasksBtn .crm-task-counter {
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    font-size: 10px;
    box-shadow: 0 5px 12px rgba(6, 29, 66, 0.08);
  }

  .stats-row {
    gap: 8px;
  }

  .stats-row .stat {
    min-height: 78px;
    padding: 11px 8px 10px 38px;
    border-radius: 12px;
  }

  .stats-row .stat::before {
    left: 8px;
    top: 13px;
    width: 26px;
    height: 26px;
    border-radius: 10px;
  }

  .stats-row .stat::after {
    content: "";
    position: absolute;
    left: 14px;
    top: 19px;
    width: 14px;
    height: 14px;
    background: #185cff;
  }

  .stats-row .stat:nth-child(1)::after {
    background: #d64b4b;
    -webkit-mask: url("./assets/icons/users.svg") center / contain no-repeat;
    mask: url("./assets/icons/users.svg") center / contain no-repeat;
  }

  .stats-row .stat:nth-child(2)::after {
    background: #1f8a5b;
    -webkit-mask: url("./assets/icons/shield.svg") center / contain no-repeat;
    mask: url("./assets/icons/shield.svg") center / contain no-repeat;
  }

  .stats-row .stat:nth-child(3)::after {
    -webkit-mask: url("./assets/icons/calendar.svg") center / contain no-repeat;
    mask: url("./assets/icons/calendar.svg") center / contain no-repeat;
  }

  .stat span {
    font-size: 11px;
  }

  .stat strong {
    font-size: clamp(18px, 4.8vw, 21px);
  }

  .workspace {
    gap: 11px;
  }

  .calendar-panel,
  .day-panel {
    border-radius: 15px;
  }

  .calendar-panel {
    padding: 13px 11px 14px;
  }

  .calendar-head {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 8px;
  }

  .calendar-head h2 {
    font-size: 24px;
  }

  .calendar-head .nav-button {
    position: relative;
    width: 42px;
    height: 42px;
    min-height: 42px;
    border-radius: 12px;
    color: transparent;
    font-size: 0;
  }

  .calendar-head .nav-button::before {
    content: "";
    position: absolute;
    inset: 11px;
    background: #185cff;
  }

  #prevMonth::before {
    -webkit-mask: url("./assets/icons/chevron-left.svg") center / contain no-repeat;
    mask: url("./assets/icons/chevron-left.svg") center / contain no-repeat;
  }

  #nextMonth::before {
    -webkit-mask: url("./assets/icons/chevron-right.svg") center / contain no-repeat;
    mask: url("./assets/icons/chevron-right.svg") center / contain no-repeat;
  }

  .weekdays {
    margin-top: 13px;
  }

  .weekdays span {
    min-height: 20px;
    font-size: 12px;
  }

  .calendar-grid {
    grid-template-rows: repeat(6, 60px);
    gap: 6px;
    margin-top: 6px;
  }

  .day-cell {
    min-height: 60px;
    padding: 7px 4px 6px;
    gap: 4px;
    border-radius: 9px;
  }

  .day-number {
    font-size: 20px;
  }

  .booking-count {
    min-height: 16px;
    font-size: 9px;
  }

  .day-panel {
    padding: 13px 11px;
    gap: 11px;
  }

  .day-panel h2 {
    font-size: 24px;
  }

  .day-panel-head .primary-button {
    min-height: 50px;
    border-radius: 12px;
    font-size: 16px;
  }

  .app-shell {
    padding: 12px 12px 18px;
    gap: 10px;
  }

  .topbar {
    gap: 10px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-block {
    gap: 10px;
  }

  .brand-block h1 {
    font-size: clamp(23px, 6.1vw, 27px);
    line-height: 1.02;
    white-space: nowrap;
  }

  .topbar p {
    margin-top: 4px;
    font-size: 14px;
  }

  .user-badge,
  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    min-height: 48px;
  }

  .stats-row .stat {
    min-height: 72px;
    padding-top: 10px;
    padding-bottom: 9px;
  }

  .calendar-panel {
    padding: 12px 10px 13px;
  }

  .calendar-head {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .calendar-head h2 {
    font-size: 23px;
  }

  .calendar-head .nav-button {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .weekdays {
    margin-top: 12px;
  }

  .calendar-grid {
    grid-template-rows: repeat(6, 57px);
    gap: 5px;
  }

  .day-cell {
    min-height: 57px;
    border-radius: 8px;
  }

  .day-number {
    font-size: 19px;
  }

  .booking-count {
    font-size: 8px;
  }

  .day-cell .day-number {
    color: #078be2;
    font-size: 20px;
    font-weight: 860;
  }

  .day-cell:has(.has-bookings) .day-number {
    color: #c54545;
  }

  .day-cell.is-muted .day-number {
    color: #b8c1cd;
  }

  .day-cell.is-selected .day-number {
    color: #fff;
    font-size: 22px;
  }

  .day-cell .booking-count {
    color: #286f82;
    font-size: 8px;
    font-weight: 850;
  }

  .day-cell .booking-count.has-bookings {
    color: #c54545;
  }

  .day-cell.is-muted .booking-count {
    color: #8da0ad;
  }

  .brand-block {
    width: 100%;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
  }

  .brand-block > div {
    min-width: 0;
    overflow: hidden;
  }

  .brand-block h1 {
    max-width: 100%;
    overflow: visible;
    font-size: 25px;
    line-height: 1.06;
    white-space: normal;
    overflow-wrap: break-word;
  }

  .topbar p {
    max-width: 100%;
    overflow: hidden;
    color: #657383;
    font-size: 14px;
    line-height: 1.18;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .schedule-header {
    display: none;
  }

  .month-tabs {
    display: none;
  }

  .stats-row {
    gap: 8px;
  }

  .stats-row .stat {
    min-height: 76px;
    padding: 12px 7px 12px 57px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: start;
    align-content: center;
    gap: 2px;
    border-radius: 12px;
    text-align: left;
  }

  .stats-row .stat::before {
    left: 11px;
    top: 50%;
    width: 40px;
    height: 40px;
    transform: translateY(-50%);
    border-radius: 12px;
  }

  .stats-row .stat::after {
    left: 20px;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
  }

  .stat span {
    color: #5f6d7c;
    font-size: 13px;
    font-weight: 620;
    line-height: 1.12;
  }

  .stat strong {
    color: #061d42;
    font-size: 22px;
    font-weight: 860;
    line-height: 1.05;
  }

  #busyDays {
    font-size: 18px;
    white-space: nowrap;
  }

  .day-panel {
    padding: 10px 10px;
    gap: 9px;
  }

  .day-panel-head {
    gap: 8px;
  }

  .day-panel .eyebrow {
    font-size: 11px;
  }

  .day-panel h2 {
    font-size: 21px;
  }

  .day-panel-head .primary-button {
    min-height: 44px;
    border-radius: 11px;
    font-size: 15px;
  }

  .schedule-list {
    gap: 7px;
  }

  .schedule-hour {
    gap: 6px;
  }

  .schedule-grid {
    grid-auto-rows: 22px;
    gap: 4px;
  }

  .schedule-hour-label {
    min-height: 22px;
    border-radius: 8px;
    font-size: 13px;
  }

  .schedule-slots {
    gap: 6px;
  }

  .time-slot {
    min-height: 22px;
    border-radius: 8px;
    padding: 2px 5px;
  }

  .time-slot strong {
    font-size: 9px;
    line-height: 1;
  }

  .slot-detail {
    font-size: 9px;
    line-height: 1;
  }

  .time-slot span:not(.slot-time):not(.slot-detail):not(.booked-cell):not(.booking-continuation) {
    font-size: 10px;
  }

  #bookingDialog {
    width: calc(100vw - 20px);
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    margin: max(10px, env(safe-area-inset-top)) auto 10px;
    overflow: hidden;
    border-radius: 16px;
  }

  #bookingDialog form {
    height: 100%;
    max-height: none;
    overflow-y: auto;
    padding: 0 14px calc(156px + env(safe-area-inset-bottom));
    display: block;
  }

  #bookingDialog .dialog-head {
    position: sticky;
    top: 0;
    z-index: 30;
    margin: 0 0 12px;
    padding: 14px 0 12px;
    align-items: center;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1px 0 rgba(217, 226, 234, 0.92);
  }

  #bookingDialog .dialog-head h2 {
    overflow: hidden;
    max-width: calc(100vw - 118px);
    font-size: 24px;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #bookingDialog .dialog-kicker {
    font-size: 12px;
    letter-spacing: 0.075em;
  }

  #bookingDialog .close-button {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 12px;
  }

  #bookingDialog .booking-client-hero {
    margin: 2px 0 18px;
    gap: 16px;
  }

  #bookingDialog .booking-client-phone-line {
    gap: 12px;
    padding-inline: 2px;
    font-size: 20px;
  }

  #bookingDialog .booking-client-actions {
    gap: 12px;
  }

  #bookingDialog .booking-client-actions .contact-button {
    min-height: 62px;
    border-radius: 10px;
    font-size: 18px;
  }

  #bookingDialog #bookingDate {
    text-align: left;
    font-size: 20px;
  }

  #bookingDialog .booking-field:has(#bookingDate) {
    grid-template-columns: 46px minmax(0, 1fr) 28px;
  }

  #bookingDialog .booking-field:has(#bookingDate) input::-webkit-calendar-picker-indicator {
    justify-self: end;
    width: 22px;
    height: 22px;
    margin: 0;
  }

  #bookingDialog .dialog-actions {
    position: fixed;
    left: 24px;
    right: 24px;
    bottom: calc(26px + env(safe-area-inset-bottom));
    z-index: 25;
    margin: 0;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    border: 1px solid rgba(217, 226, 234, 0.92);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -1px 0 rgba(217, 226, 234, 0.92), 0 16px 42px rgba(6, 29, 66, 0.18);
  }

  #bookingDialog .dialog-actions span {
    display: none;
  }

  #bookingDialog #deleteBookingBtn[style*="visibility: hidden"] {
    display: none;
  }

  #bookingDialog .dialog-actions .danger-button {
    grid-column: 1 / -1;
  }

  #bookingDialog .dialog-actions .secondary-button,
  #bookingDialog .dialog-actions .primary-button,
  #bookingDialog .dialog-actions .danger-button {
    min-height: 46px;
    border-radius: 12px;
  }

  #bookingDialog .booking-task-create {
    margin-top: 12px;
    border-radius: 16px;
  }

  #bookingDialog .booking-task-create .task-add-button {
    min-height: 58px;
  }

  #bookingDialog .booking-task-create .task-create-form {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .messages-dialog .messages-connected {
    display: none;
  }

  .messages-dialog .messages-appbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    padding: 0 10px;
  }

  .messages-dialog .messages-brand {
    display: contents;
  }

  .messages-dialog .messages-brand-mark {
    grid-column: 1;
    justify-self: center;
    width: 28px;
    height: 28px;
  }

  .messages-dialog .messages-brand strong:last-of-type {
    grid-column: 2;
    justify-self: center;
    color: #061d42;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
  }

  .messages-dialog .messages-app-actions {
    grid-column: 3;
    justify-self: end;
    margin-left: 0;
  }

  .messages-dialog .messages-close-window.messages-user-menu {
    width: 38px;
    height: 38px;
    min-height: 38px;
    border: 1px solid #d8e3ef;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #fff;
    box-shadow: 0 8px 18px rgba(6, 29, 66, 0.06);
  }

  .messages-dialog .messages-close-window.messages-user-menu > span {
    position: relative;
    width: 22px;
    height: 22px;
    display: block;
    background: transparent;
  }

  .messages-dialog .messages-close-window.messages-user-menu > span::before,
  .messages-dialog .messages-close-window.messages-user-menu > span::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2.25px;
    border-radius: 999px;
    background: #061d42;
    transform-origin: center;
  }

  .messages-dialog .messages-close-window.messages-user-menu > span::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .messages-dialog .messages-close-window.messages-user-menu > span::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .messages-dialog .messages-search {
    display: none;
  }

  .messages-dialog .messages-sidebar,
  .messages-dialog:not(.is-conversation-open) .messages-sidebar {
    grid-template-rows: 50px 44px minmax(0, 1fr);
  }

  .messages-dialog .messages-tabs {
    padding-top: 6px;
  }

  input,
  select,
  textarea,
  .messages-dialog .messages-reply-form input,
  .messages-search input,
  .client-message-form input,
  .client-messenger-form input,
  .integration-key-card input,
  .integration-copy-field input,
  .detail-inline-input,
  .detail-inline-select {
    font-size: 16px;
  }

  #bookingDialog .booking-field > input,
  #bookingDialog .booking-field > select,
  #bookingDialog .booking-field > textarea,
  #bookingDialog .custom-select-trigger {
    font-size: 18px;
  }

  #bookingDialog #bookingDate {
    font-size: 20px;
  }
}

@media (max-width: 720px) {
  .top-actions {
    grid-template-columns: 1.18fr repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .top-actions .user-badge {
    display: none;
  }

  .user-badge,
  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    min-width: 0;
    min-height: 48px;
    padding-right: 10px;
    padding-left: 10px;
    overflow: hidden;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.05;
    white-space: nowrap;
  }

  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    min-height: 104px;
    padding: 12px 5px 13px;
    display: grid;
    grid-template-rows: 42px auto;
    justify-items: center;
    align-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 900;
  }

  .mobile-new-booking-button {
    order: 1;
  }

  .topbar #topTasksBtn {
    order: 2;
  }

  .topbar .message-button {
    order: 3;
  }

  .topbar #crmBtn {
    order: 4;
  }

  .user-badge {
    padding-left: 48px;
    justify-content: start;
    text-overflow: ellipsis;
  }

  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn,
  .mobile-new-booking-button {
    gap: 8px;
  }

  .topbar #topTasksBtn::before,
  .topbar .message-button::before,
  .topbar #crmBtn::before,
  .mobile-new-booking-button::before {
    width: 38px;
    height: 38px;
  }

  .mobile-new-booking-button {
    color: transparent;
  }

  .mobile-new-booking-button::after {
    content: "Бронь";
    color: #fff;
  }

  .topbar .message-button {
    color: transparent;
  }

  .topbar .message-button::after {
    content: "Чат";
    color: #185cff;
  }

  .topbar .message-button::before {
    color: #185cff;
  }

  .topbar #topTasksBtn,
  .topbar #crmBtn {
    color: #185cff;
  }

  .message-badge {
    top: 8px;
    right: 8px;
    min-width: 24px;
    height: 24px;
    font-size: 13px;
  }

  .stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .stats-row .stat {
    min-width: 0;
    min-height: 150px;
    padding: 18px 8px 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    align-content: start;
    gap: 9px;
    overflow: hidden;
    border-radius: 12px;
    text-align: center;
  }

  .stats-row .stat::before,
  .stats-row .stat::after {
    content: none;
    display: none;
  }

  .stats-row .stat-icon {
    width: 50px;
    height: 50px;
    margin: 0;
    border-radius: 14px;
  }

  .stats-row .stat-icon svg {
    width: 28px;
    height: 28px;
  }

  .stats-row .stat-copy {
    min-width: 0;
    width: 100%;
    display: grid;
    justify-items: center;
    gap: 1px;
  }

  .stats-row .stat-copy small {
    display: none;
  }

  .stats-row .stat-copy > span {
    max-width: 100%;
    color: #5f6d7c;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
  }

  .stats-row .stat-copy > span {
    color: transparent;
    font-size: 0;
  }

  .stats-row .stat-copy > span::after {
    color: #5f6d7c;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.1;
  }

  .stats-row .stat-lost .stat-copy > span::after {
    content: "Не оплатили";
  }

  .stats-row .stat-new .stat-copy > span::after {
    content: "Новые";
  }

  .stats-row .stat-repeat .stat-copy > span::after {
    content: "Повторы";
  }

  .stats-row .stat strong {
    max-width: 100%;
    color: #061d42;
    font-size: 0;
    font-weight: 900;
    line-height: 1.05;
    text-align: center;
    white-space: normal;
  }

  .stats-row .stat strong::before {
    content: attr(data-count);
    display: block;
    color: #061d42;
    font-size: 38px;
    font-weight: 920;
    line-height: 0.95;
  }

  .stats-row .stat strong::after {
    content: attr(data-unit);
    display: block;
    margin-top: 4px;
    color: #5f6d7c;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
    text-transform: uppercase;
  }
}

@media (max-width: 380px) {
  .stats-row {
    gap: 6px;
  }

  .stats-row .stat {
    min-height: 138px;
    padding-right: 5px;
    padding-left: 5px;
  }

  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    min-height: 96px;
    font-size: 14px;
  }

  .topbar #topTasksBtn::before,
  .topbar .message-button::before,
  .topbar #crmBtn::before,
  .mobile-new-booking-button::before {
    width: 32px;
    height: 32px;
  }

  .stats-row .stat-icon {
    width: 44px;
    height: 44px;
  }

  .stats-row .stat-icon svg {
    width: 24px;
    height: 24px;
  }

  .stats-row .stat-copy > span::after {
    font-size: 13px;
  }

  .stats-row .stat strong::before {
    font-size: 32px;
  }

  .stats-row .stat strong::after {
    font-size: 10px;
  }
}

@media (max-width: 720px) {
  .top-actions {
    align-items: stretch;
  }

  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    min-height: 106px;
    grid-template-rows: 42px 22px;
    gap: 9px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
  }

  .topbar #topTasksBtn::before,
  .topbar .message-button::before,
  .topbar #crmBtn::before,
  .mobile-new-booking-button::before {
    width: 40px;
    height: 40px;
  }

  .mobile-new-booking-button::after,
  .topbar .message-button::after,
  .topbar #topTasksBtn .tasks-button-label,
  .topbar #crmBtn .crm-button-label {
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
  }

  .stats-row {
    align-items: stretch;
  }

  .stats-row .stat {
    min-height: 154px;
    padding: 18px 7px 15px;
    align-content: start;
    gap: 9px;
  }

  .stats-row .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
  }

  .stats-row .stat-icon svg {
    width: 27px;
    height: 27px;
  }

  .stats-row .stat-copy {
    min-height: 18px;
  }

  .stats-row .stat-copy > span {
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }

  .stats-row .stat-copy > span::after {
    display: block;
    color: #5f6d7c;
    font-size: 15px;
    font-weight: 760;
    line-height: 1.12;
  }

  .stats-row .stat strong,
  .stats-row #busyDays,
  .stats-row #totalBookings,
  .stats-row #todayLabel {
    display: grid;
    justify-items: center;
    gap: 4px;
    color: transparent !important;
    font-size: 0 !important;
    font-weight: 800 !important;
    line-height: 0 !important;
    white-space: normal !important;
  }

  .stats-row .stat strong::before,
  .stats-row #busyDays::before,
  .stats-row #totalBookings::before,
  .stats-row #todayLabel::before {
    content: attr(data-count);
    display: block;
    color: #061d42;
    font-size: 38px;
    font-weight: 800;
    line-height: 0.94;
  }

  .stats-row .stat strong::after,
  .stats-row #busyDays::after,
  .stats-row #totalBookings::after,
  .stats-row #todayLabel::after {
    content: attr(data-unit);
    display: block;
    margin-top: 0;
    color: #5f6d7c;
    font-size: 12px;
    font-weight: 760;
    letter-spacing: 0;
    line-height: 1;
    text-transform: uppercase;
  }
}

@media (max-width: 380px) {
  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    min-height: 98px;
  }

  .topbar #topTasksBtn::before,
  .topbar .message-button::before,
  .topbar #crmBtn::before,
  .mobile-new-booking-button::before {
    width: 34px;
    height: 34px;
  }

  .stats-row .stat {
    min-height: 142px;
  }

  .stats-row .stat-icon {
    width: 44px;
    height: 44px;
  }

  .stats-row .stat-icon svg {
    width: 24px;
    height: 24px;
  }

  .stats-row .stat-copy > span::after {
    font-size: 13px;
  }

  .stats-row .stat strong::before,
  .stats-row #busyDays::before,
  .stats-row #totalBookings::before,
  .stats-row #todayLabel::before {
    font-size: 32px;
  }

  .stats-row .stat strong::after,
  .stats-row #busyDays::after,
  .stats-row #totalBookings::after,
  .stats-row #todayLabel::after {
    font-size: 10px;
  }
}

@media (max-width: 720px) {
  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    height: 106px;
    min-height: 106px;
    padding: 15px 6px 16px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 0 !important;
    line-height: 1;
  }

  .topbar #topTasksBtn::before,
  .topbar .message-button::before,
  .topbar #crmBtn::before,
  .mobile-new-booking-button::before {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    margin: 0;
  }

  .mobile-new-booking-button::after,
  .topbar .message-button::after,
  .topbar #topTasksBtn .tasks-button-label,
  .topbar #crmBtn .crm-button-label {
    display: block;
    height: 18px;
    color: #185cff;
    font-size: 16px !important;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    white-space: nowrap;
  }

  .mobile-new-booking-button::after {
    color: #fff;
  }

  .topbar .message-button::after {
    content: "Чат";
  }

  .topbar #topTasksBtn .crm-task-counters {
    top: 8px;
    right: 8px;
  }

  .message-badge {
    top: 8px;
    right: 8px;
  }
}

@media (max-width: 380px) {
  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    height: 98px;
    min-height: 98px;
    gap: 13px;
    padding-top: 13px;
    padding-bottom: 14px;
  }

  .topbar #topTasksBtn::before,
  .topbar .message-button::before,
  .topbar #crmBtn::before,
  .mobile-new-booking-button::before {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .mobile-new-booking-button::after,
  .topbar .message-button::after,
  .topbar #topTasksBtn .tasks-button-label,
  .topbar #crmBtn .crm-button-label {
    height: 16px;
    font-size: 14px !important;
    line-height: 16px;
  }
}

@media (max-width: 720px) {
  .topbar #crmBtn::before {
    content: "";
    display: block;
    background: #185cff;
    -webkit-mask: url("./assets/icons/crm.svg") center / contain no-repeat;
    mask: url("./assets/icons/crm.svg") center / contain no-repeat;
  }
}

@media (max-width: 720px) {
  .topbar #crmBtn::before {
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23185cff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16'/%3E%3Cpath d='M7 20v-7'/%3E%3Cpath d='M12 20V9'/%3E%3Cpath d='M17 20V5'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask-image: none;
    mask-image: none;
  }

  #prevMonth::before,
  #nextMonth::before {
    background-color: transparent;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

@media (max-width: 720px) {
  .topbar #crmBtn::before {
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23185cff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16'/%3E%3Cpath d='M7 20v-7'/%3E%3Cpath d='M12 20V9'/%3E%3Cpath d='M17 20V5'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    -webkit-mask: none;
    mask: none;
  }
}

@media (max-width: 720px) {
  .topbar #crmBtn::before {
    content: "";
    display: block;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23185cff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16'/%3E%3Cpath d='M7 20v-7'/%3E%3Cpath d='M12 20V9'/%3E%3Cpath d='M17 20V5'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    -webkit-mask: none;
    mask: none;
  }

  .calendar-head .nav-button {
    position: relative;
    display: grid;
    place-items: center;
    color: transparent;
    touch-action: manipulation;
  }

  .calendar-head .nav-button::before {
    content: "";
    position: absolute;
    inset: 9px;
    display: block;
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    -webkit-mask: none;
    mask: none;
  }

  #prevMonth::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23185cff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18 9 12l6-6'/%3E%3C/svg%3E");
  }

  #nextMonth::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23185cff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E");
  }
}

@media (max-width: 720px) {
  #bookingDialog .phone-field-wrapper {
    display: grid;
    gap: 6px;
  }

  #bookingDialog .existing-client-panel {
    position: static;
    z-index: 1;
    max-height: 128px;
    margin-top: 0;
    padding: 7px;
    gap: 6px;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(11, 31, 77, 0.08);
    -webkit-overflow-scrolling: touch;
  }

  #bookingDialog .existing-client-panel-title {
    font-size: 11px;
    line-height: 1.15;
  }

  #bookingDialog .existing-client-card {
    min-height: 48px;
    padding: 7px 8px;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 7px;
    border-radius: 10px;
  }

  #bookingDialog .existing-client-card-number {
    font-size: 12px;
  }

  #bookingDialog .existing-client-card-body {
    gap: 1px;
  }

  #bookingDialog .existing-client-card strong {
    font-size: 14px;
    line-height: 1.08;
  }

  #bookingDialog .existing-client-card-body > span {
    font-size: 11px;
    line-height: 1.08;
  }

  #bookingDialog .existing-client-card-body > span:nth-of-type(n + 2),
  #bookingDialog .existing-client-card-action {
    display: none;
  }
}

@media (max-width: 380px) {
  #bookingDialog .existing-client-panel {
    max-height: 112px;
  }

  #bookingDialog .existing-client-card {
    min-height: 44px;
    padding: 6px 7px;
  }
}

@media (max-width: 720px) {
  .calendar-panel {
    padding: 12px 10px 14px;
  }

  .calendar-grid {
    grid-template-rows: repeat(6, 66px);
    gap: 6px;
  }

  .day-cell {
    min-height: 66px;
    padding: 4px 3px;
    display: grid;
    grid-template-rows: 26px minmax(0, 1fr);
    align-items: stretch;
    justify-items: center;
    gap: 2px;
    overflow: hidden;
    text-align: center;
  }

  .day-number,
  .day-cell .day-number,
  .day-cell.is-selected .day-number {
    align-self: start;
    color: #078be2;
    font-size: 21px;
    font-weight: 820;
    line-height: 24px;
  }

  .day-cell:has(.has-bookings) .day-number {
    color: #c54545;
  }

  .day-cell.is-muted .day-number {
    color: #b8c1cd;
  }

  .day-cell.is-selected .day-number {
    color: #fff;
  }

  .day-badges {
    align-self: end;
    width: 100%;
    display: grid;
    grid-auto-rows: 13px;
    gap: 2px;
    min-height: 13px;
  }

  .booking-count,
  .day-cell .booking-count,
  .day-cell .booking-count.has-bookings,
  .day-cell .booking-count.rental-count {
    min-height: 13px;
    height: 13px;
    padding: 0 3px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 820;
    line-height: 13px;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .day-cell.is-selected .booking-count,
  .day-cell.is-selected .booking-count.has-bookings {
    background: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.78);
  }

  .day-cell.is-selected .rental-count {
    background: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.9);
  }
}

@media (max-width: 380px) {
  .calendar-grid {
    grid-template-rows: repeat(6, 58px);
    gap: 5px;
  }

  .day-cell {
    min-height: 58px;
    grid-template-rows: 23px minmax(0, 1fr);
    padding: 3px 2px;
  }

  .day-number,
  .day-cell .day-number,
  .day-cell.is-selected .day-number {
    font-size: 19px;
    line-height: 22px;
  }

  .day-badges {
    grid-auto-rows: 12px;
    gap: 1px;
  }

  .booking-count,
  .day-cell .booking-count,
  .day-cell .booking-count.has-bookings,
  .day-cell .booking-count.rental-count {
    min-height: 12px;
    height: 12px;
    padding: 0 2px;
    font-size: 7px;
    line-height: 12px;
  }
}

@media (max-width: 720px) {
  .stats-row .stat {
    height: 218px;
    min-height: 218px;
    padding: 26px 8px 22px;
    display: grid;
    grid-template-rows: 62px 25px 48px 16px;
    justify-items: center;
    align-content: start;
    row-gap: 11px;
    overflow: visible;
    border-radius: 14px;
  }

  .stats-row .stat-icon {
    grid-row: 1;
    align-self: start;
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }

  .stats-row .stat-icon svg {
    width: 31px;
    height: 31px;
  }

  .stats-row .stat-copy {
    grid-row: 2;
    min-height: 25px;
    align-self: center;
    display: grid;
    place-items: center;
  }

  .stats-row .stat-copy > span::after {
    font-size: 20px;
    font-weight: 760;
    line-height: 25px;
  }

  .stats-row .stat strong,
  .stats-row #busyDays,
  .stats-row #totalBookings,
  .stats-row #todayLabel {
    grid-row: 3 / span 2;
    align-self: start;
    display: grid;
    grid-template-rows: 48px 16px;
    justify-items: center;
    row-gap: 5px;
  }

  .stats-row .stat strong::before,
  .stats-row #busyDays::before,
  .stats-row #totalBookings::before,
  .stats-row #todayLabel::before {
    font-size: 54px;
    font-weight: 800;
    line-height: 48px;
  }

  .stats-row .stat strong::after,
  .stats-row #busyDays::after,
  .stats-row #totalBookings::after,
  .stats-row #todayLabel::after {
    font-size: 13px;
    font-weight: 760;
    line-height: 16px;
  }
}

@media (max-width: 380px) {
  .stats-row .stat {
    height: 186px;
    min-height: 186px;
    padding: 21px 6px 18px;
    grid-template-rows: 52px 21px 40px 14px;
    row-gap: 9px;
  }

  .stats-row .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
  }

  .stats-row .stat-icon svg {
    width: 27px;
    height: 27px;
  }

  .stats-row .stat-copy > span::after {
    font-size: 16px;
    line-height: 21px;
  }

  .stats-row .stat strong,
  .stats-row #busyDays,
  .stats-row #totalBookings,
  .stats-row #todayLabel {
    grid-template-rows: 40px 14px;
    row-gap: 4px;
  }

  .stats-row .stat strong::before,
  .stats-row #busyDays::before,
  .stats-row #totalBookings::before,
  .stats-row #todayLabel::before {
    font-size: 43px;
    line-height: 40px;
  }

  .stats-row .stat strong::after,
  .stats-row #busyDays::after,
  .stats-row #totalBookings::after,
  .stats-row #todayLabel::after {
    font-size: 10px;
    line-height: 14px;
  }
}

@media (max-width: 720px) {
  .stats-row .stat {
    height: 206px;
    min-height: 206px;
    padding: 20px 6px 18px;
    display: grid;
    grid-template-rows: 58px 23px 48px 16px;
    justify-items: center;
    align-content: start;
    row-gap: 9px;
    overflow: hidden;
    border-radius: 14px;
  }

  .stats-row .stat-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }

  .stats-row .stat-icon svg {
    width: 31px;
    height: 31px;
  }

  .stats-row .stat-copy {
    width: 100%;
    min-height: 23px;
    display: grid;
    place-items: center;
  }

  .stats-row .stat-copy > span::after {
    max-width: 100%;
    overflow: hidden;
    color: #5f6d7c;
    font-size: 17px;
    font-weight: 760;
    line-height: 23px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stats-row .stat strong,
  .stats-row #busyDays,
  .stats-row #totalBookings,
  .stats-row #todayLabel {
    display: grid;
    grid-template-rows: 48px 16px;
    justify-items: center;
    row-gap: 5px;
  }

  .stats-row .stat strong::before,
  .stats-row #busyDays::before,
  .stats-row #totalBookings::before,
  .stats-row #todayLabel::before {
    font-size: 52px;
    font-weight: 800;
    line-height: 48px;
  }

  .stats-row .stat strong::after,
  .stats-row #busyDays::after,
  .stats-row #totalBookings::after,
  .stats-row #todayLabel::after {
    font-size: 12px;
    font-weight: 760;
    line-height: 16px;
  }
}

@media (max-width: 380px) {
  .stats-row .stat {
    height: 180px;
    min-height: 180px;
    padding: 17px 5px 15px;
    grid-template-rows: 50px 21px 42px 14px;
    row-gap: 8px;
  }

  .stats-row .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
  }

  .stats-row .stat-icon svg {
    width: 27px;
    height: 27px;
  }

  .stats-row .stat-copy > span::after {
    font-size: 14px;
    line-height: 21px;
  }

  .stats-row .stat strong,
  .stats-row #busyDays,
  .stats-row #totalBookings,
  .stats-row #todayLabel {
    grid-template-rows: 42px 14px;
    row-gap: 4px;
  }

  .stats-row .stat strong::before,
  .stats-row #busyDays::before,
  .stats-row #totalBookings::before,
  .stats-row #todayLabel::before {
    font-size: 44px;
    line-height: 42px;
  }

  .stats-row .stat strong::after,
  .stats-row #busyDays::after,
  .stats-row #totalBookings::after,
  .stats-row #todayLabel::after {
    font-size: 10px;
    line-height: 14px;
  }
}

@media (max-width: 720px) {
  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    height: 128px;
    min-height: 128px;
    border-radius: 14px;
  }

  .topbar #topTasksBtn::before,
  .topbar .message-button::before,
  .topbar #crmBtn::before,
  .mobile-new-booking-button::before {
    top: 31px;
    width: 48px;
    height: 48px;
  }

  .mobile-new-booking-button::before {
    background: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5.5' width='17' height='15' rx='2.4'/%3E%3Cpath d='M8 3.8v4M16 3.8v4M3.5 10h17M12 13.2v4.2M9.9 15.3h4.2'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    -webkit-mask: none;
    mask: none;
  }

  .mobile-new-booking-button::after,
  .topbar .message-button::after,
  .topbar #topTasksBtn .tasks-button-label,
  .topbar #crmBtn .crm-button-label {
    bottom: 30px;
    height: 22px;
    font-size: 20px !important;
    font-weight: 760;
    line-height: 22px;
  }

  .stats-row .stat {
    height: 224px;
    min-height: 224px;
    padding: 22px 7px 20px;
    grid-template-rows: 66px 28px 54px 18px;
    row-gap: 10px;
    overflow: hidden;
    border-radius: 14px;
  }

  .stats-row .stat-icon {
    width: 66px;
    height: 66px;
    border-radius: 18px;
  }

  .stats-row .stat-icon svg {
    width: 36px;
    height: 36px;
  }

  .stats-row .stat-copy {
    width: 100%;
    min-width: 0;
    min-height: 28px;
  }

  .stats-row .stat-copy > span::after {
    width: 100%;
    max-width: none;
    overflow: visible;
    font-size: 17px;
    font-weight: 760;
    line-height: 28px;
    text-overflow: clip;
    white-space: nowrap;
  }

  .stats-row .stat strong,
  .stats-row #busyDays,
  .stats-row #totalBookings,
  .stats-row #todayLabel {
    grid-template-rows: 54px 18px;
    row-gap: 6px;
  }

  .stats-row .stat strong::before,
  .stats-row #busyDays::before,
  .stats-row #totalBookings::before,
  .stats-row #todayLabel::before {
    font-size: 58px;
    font-weight: 800;
    line-height: 54px;
  }

  .stats-row .stat strong::after,
  .stats-row #busyDays::after,
  .stats-row #totalBookings::after,
  .stats-row #todayLabel::after {
    font-size: 13px;
    font-weight: 760;
    line-height: 18px;
  }
}

@media (max-width: 380px) {
  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    height: 106px;
    min-height: 106px;
  }

  .topbar #topTasksBtn::before,
  .topbar .message-button::before,
  .topbar #crmBtn::before,
  .mobile-new-booking-button::before {
    top: 26px;
    width: 38px;
    height: 38px;
  }

  .mobile-new-booking-button::after,
  .topbar .message-button::after,
  .topbar #topTasksBtn .tasks-button-label,
  .topbar #crmBtn .crm-button-label {
    bottom: 26px;
    height: 18px;
    font-size: 16px !important;
    line-height: 18px;
  }

  .stats-row .stat {
    height: 192px;
    min-height: 192px;
    padding: 18px 4px 16px;
    grid-template-rows: 54px 23px 44px 14px;
    row-gap: 8px;
  }

  .stats-row .stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
  }

  .stats-row .stat-icon svg {
    width: 30px;
    height: 30px;
  }

  .stats-row .stat-copy > span::after {
    font-size: 13px;
    line-height: 23px;
  }

  .stats-row .stat strong,
  .stats-row #busyDays,
  .stats-row #totalBookings,
  .stats-row #todayLabel {
    grid-template-rows: 44px 14px;
    row-gap: 5px;
  }

  .stats-row .stat strong::before,
  .stats-row #busyDays::before,
  .stats-row #totalBookings::before,
  .stats-row #todayLabel::before {
    font-size: 46px;
    line-height: 44px;
  }

  .stats-row .stat strong::after,
  .stats-row #busyDays::after,
  .stats-row #totalBookings::after,
  .stats-row #todayLabel::after {
    font-size: 10px;
    line-height: 14px;
  }
}

@media (max-width: 720px) {
  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    position: relative;
    height: 106px;
    min-height: 106px;
    padding: 0;
    display: block !important;
    overflow: hidden;
    font-size: 0 !important;
    line-height: 0 !important;
  }

  .topbar #topTasksBtn::before,
  .topbar .message-button::before,
  .topbar #crmBtn::before,
  .mobile-new-booking-button::before {
    position: absolute;
    left: 50%;
    top: 25px;
    width: 40px;
    height: 40px;
    margin: 0;
    transform: translateX(-50%);
  }

  .mobile-new-booking-button::after,
  .topbar .message-button::after,
  .topbar #topTasksBtn .tasks-button-label,
  .topbar #crmBtn .crm-button-label {
    position: absolute;
    left: 50%;
    bottom: 26px;
    width: calc(100% - 12px);
    height: 18px;
    transform: translateX(-50%);
    display: block;
    font-size: 16px !important;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    white-space: nowrap;
  }

  .mobile-new-booking-button::after {
    color: #fff;
  }

  .topbar .message-button::after,
  .topbar #topTasksBtn .tasks-button-label,
  .topbar #crmBtn .crm-button-label {
    color: #185cff;
  }
}

@media (max-width: 380px) {
  .mobile-new-booking-button,
  .topbar #topTasksBtn,
  .topbar .message-button,
  .topbar #crmBtn {
    height: 98px;
    min-height: 98px;
  }

  .topbar #topTasksBtn::before,
  .topbar .message-button::before,
  .topbar #crmBtn::before,
  .mobile-new-booking-button::before {
    top: 23px;
    width: 34px;
    height: 34px;
  }

  .mobile-new-booking-button::after,
  .topbar .message-button::after,
  .topbar #topTasksBtn .tasks-button-label,
  .topbar #crmBtn .crm-button-label {
    bottom: 23px;
    height: 16px;
    font-size: 14px !important;
    line-height: 16px;
  }
}

@media (max-width: 720px) {
  .topbar #crmBtn::before {
    content: "";
    display: block;
    background: #185cff;
    -webkit-mask: url("./assets/icons/crm.svg") center / contain no-repeat;
    mask: url("./assets/icons/crm.svg") center / contain no-repeat;
  }
}

@media (max-width: 720px) {
  .topbar #crmBtn::before {
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23185cff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16'/%3E%3Cpath d='M7 20v-7'/%3E%3Cpath d='M12 20V9'/%3E%3Cpath d='M17 20V5'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

@media (max-width: 720px) {
  .mobile-new-booking-button::before,
  .topbar #topTasksBtn::before,
  .topbar .message-button::before,
  .topbar #crmBtn::before {
    content: "";
    display: block;
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    -webkit-mask: none;
    mask: none;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .mobile-new-booking-button::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5.5' width='17' height='15' rx='2.4'/%3E%3Cpath d='M8 3.8v4M16 3.8v4M3.5 10h17M12 13.2v4.2M9.9 15.3h4.2'/%3E%3C/svg%3E");
  }

  .topbar #topTasksBtn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23185cff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M3 10h18'/%3E%3C/svg%3E");
  }

  .topbar .message-button::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23185cff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 17H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3Cpath d='M8 17l-3 3v-3'/%3E%3Cpath d='M10 13a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-4l-3 3v-3'/%3E%3C/svg%3E");
  }

  .topbar #crmBtn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23185cff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16'/%3E%3Cpath d='M7 20v-7'/%3E%3Cpath d='M12 20V9'/%3E%3Cpath d='M17 20V5'/%3E%3C/svg%3E");
  }
}

@media (max-width: 720px) {
  #scheduleList.schedule-list {
    grid-template-rows: 22px auto;
    gap: 7px;
    padding-top: 14px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .schedule-list .schedule-header {
    height: 22px;
    min-height: 22px;
    margin-top: 0;
    margin-bottom: 0;
  }

  .schedule-header {
    display: grid;
    grid-template-columns: minmax(64px, 0.8fr) minmax(0, 4fr);
    gap: 4px;
    align-items: stretch;
  }

  .schedule-header > span {
    display: block;
  }

  .quarter-headings {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .quarter-headings span,
  .quarter-headings span:first-child,
  .quarter-headings span:nth-child(4) {
    height: 20px;
    min-height: 20px;
    max-height: 20px;
    display: grid;
    place-items: center;
    border: 1px solid #e2eaf4;
    border-radius: 8px;
    background: #f8fbff;
    box-shadow: none;
    color: #5f6d7c;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
  }

  .quarter-headings span::after,
  .quarter-headings span:first-child::after,
  .quarter-headings span:nth-child(2)::after,
  .quarter-headings span:nth-child(3)::after {
    content: none;
  }
}

@media (max-width: 720px) {
  #scheduleList.schedule-list {
    grid-template-rows: 22px auto;
    gap: 7px;
    padding-top: 14px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .schedule-list .schedule-header {
    height: 22px;
    min-height: 22px;
    margin-top: 0;
    margin-bottom: 0;
  }

  .schedule-header {
    grid-template-columns: minmax(64px, 0.8fr) minmax(0, 4fr);
    gap: 4px;
    align-items: stretch;
  }

  .quarter-headings span,
  .quarter-headings span:first-child,
  .quarter-headings span:nth-child(4) {
    height: 20px;
    min-height: 20px;
    max-height: 20px;
  }
}

@media (max-width: 720px) {
  #scheduleList.schedule-list {
    padding-top: 10px;
  }

  .schedule-list .schedule-header {
    height: 20px;
    min-height: 20px;
    margin-top: 0;
    margin-bottom: 5px;
  }

  .quarter-headings span,
  .quarter-headings span:first-child,
  .quarter-headings span:nth-child(4) {
    height: 20px;
    min-height: 20px;
    max-height: 20px;
    border-radius: 8px;
    font-size: 10px;
  }
}

@media (max-width: 720px) {
  .tasks-board {
    grid-template-columns: 1fr;
    max-height: calc(100dvh - 190px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .task-column {
    min-width: 0;
  }

  .task-cards {
    min-height: auto;
  }

  .task-card-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .task-card-head span {
    white-space: normal;
  }

  .crm-detail-dialog .client-history {
    display: grid;
    min-height: 320px;
    max-height: min(420px, 56dvh);
    grid-template-rows: auto minmax(180px, 1fr) auto;
  }

  .crm-detail-dialog .client-history-list {
    min-height: 180px;
    max-height: 300px;
    padding-left: 34px;
  }

  .top-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #adminDialog .dialog-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  #adminDialog .admin-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #adminDialog .admin-head-actions > button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding-inline: 10px;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #adminDialog .admin-head-actions .close-button {
    font-size: 24px;
  }

  #adminDialog .admin-database-nav {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-columns: initial;
    overflow-x: hidden;
  }

  #adminDialog .admin-database-nav button {
    width: 100%;
    min-width: 0;
  }

  #adminDialog .admin-db-head-row {
    display: none;
  }

  #adminDialog .admin-db-row {
    width: 100%;
    min-width: 0 !important;
    grid-template-columns: 1fr !important;
    gap: 6px;
    padding-block: 10px;
  }

  #adminDialog .admin-db-row > span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .messages-dialog .messages-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow-x: hidden;
  }

  .messages-dialog .messages-tabs button {
    min-width: 0;
    border: 1px solid #e3ebf5;
    border-radius: 10px;
  }
}

@media (max-width: 720px) {
  .crm-detail-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    padding: 0;
    border-radius: 14px;
    background: #fff;
  }

  .crm-detail-dialog form {
    padding: 26px 20px 0;
    background: #fff;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .crm-detail-dialog .dialog-head {
    margin-bottom: 22px;
    align-items: start;
  }

  .crm-detail-dialog .dialog-head h2 {
    max-width: calc(100vw - 128px);
    color: #061d42;
    font-size: 34px;
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: 0;
  }

  .crm-detail-dialog .dialog-head .eyebrow {
    color: #7b8798;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
  }

  .crm-detail-dialog .close-button {
    width: 58px;
    height: 58px;
    border-radius: 12px;
    background: #fbfcfe;
    box-shadow:
      0 12px 24px rgba(6, 29, 66, 0.08),
      inset 0 0 0 1px #e8edf4;
    color: #0b1020;
    font-size: 34px;
    font-weight: 350;
  }

  .crm-detail {
    min-height: 0;
    overflow: hidden;
  }

  .crm-detail-layout {
    display: none;
  }

  .crm-mobile-detail {
    min-height: 0;
    padding: 0 0 calc(18px + env(safe-area-inset-bottom));
    display: grid;
    align-content: start;
    gap: 22px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
  }

  .crm-mobile-detail::-webkit-scrollbar {
    display: none;
  }

  .mobile-phone-line {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #6f7d92;
    font-size: 17px;
    font-weight: 760;
  }

  .mobile-phone-line > span,
  .mobile-copy-phone {
    width: 22px;
    height: 22px;
    color: #6c7b90;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }

  .mobile-phone-line svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.45;
  }

  .mobile-phone-line a {
    min-width: 0;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
  }

  .mobile-copy-phone {
    border: 0;
    padding: 0;
    background: transparent;
  }

  .mobile-copy-phone.is-copied {
    color: #16a061;
  }

  .mobile-primary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .mobile-primary-actions .contact-button {
    min-width: 0;
    min-height: 58px;
    border: 0;
    border-radius: 10px;
    justify-content: center;
    gap: 12px;
    padding-inline: 12px;
    font-size: 17px;
    box-shadow: 0 12px 22px rgba(19, 110, 162, 0.14);
  }

  .mobile-primary-actions .contact-call {
    background: linear-gradient(135deg, #064f68 0%, #00758e 100%);
  }

  .mobile-primary-actions .contact-telegram {
    background: linear-gradient(135deg, #1265e9 0%, #014cff 100%);
  }

  .mobile-primary-actions .contact-button-icon {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.14);
  }

  .mobile-primary-actions .contact-button-icon svg {
    width: 18px;
    height: 18px;
  }

  .crm-mobile-detail h3 {
    margin: 14px 0 -4px;
    color: #061d42;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0;
  }

  .mobile-booking-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
  }

  .mobile-detail-card {
    position: relative;
    min-width: 0;
    aspect-ratio: 1 / 1;
    min-height: 0;
    border: 1px solid #e3e9f1;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(6, 29, 66, 0.035);
    display: block;
    overflow: visible;
    transition:
      border-color 0.22s ease,
      box-shadow 0.22s ease;
  }

  .mobile-detail-card.is-open {
    z-index: 35;
    border-color: #86c9ff;
    box-shadow:
      0 12px 24px rgba(6, 29, 66, 0.05),
      0 0 0 3px rgba(35, 119, 216, 0.12);
  }

  .mobile-detail-card-toggle {
    appearance: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: transparent;
    padding: 13px 12px 11px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .mobile-detail-card-toggle:focus {
    outline: 0;
  }

  .mobile-detail-card-toggle:focus-visible {
    box-shadow: inset 0 0 0 3px rgba(35, 119, 216, 0.12);
  }

  .mobile-detail-icon,
  .mobile-summary-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #eef5ff;
    color: #2377d8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-detail-card-field .mobile-detail-icon,
  .mobile-stat-row span:nth-child(2) svg {
    background: #e2f8ef;
    color: #19a978;
  }

  .mobile-detail-card-payment .mobile-detail-icon,
  .mobile-stat-row span:nth-child(3) svg {
    background: #e8fbf5;
    color: #0c9872;
  }

  .mobile-detail-card-status .mobile-detail-icon {
    background: #fff2c8;
    color: #d69417;
  }

  .mobile-detail-icon svg,
  .mobile-summary-icon svg,
  .mobile-detail-actions svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.45;
  }

  .mobile-detail-copy {
    min-width: 0;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 5px;
  }

  .mobile-detail-label {
    color: #778397;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.15;
  }

  .mobile-detail-copy strong {
    min-width: 0;
    color: #061d42;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.13;
    overflow-wrap: anywhere;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .mobile-card-chevron {
    width: 24px;
    height: 24px;
    color: #071c3f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    font-size: 22px;
    font-weight: 850;
    line-height: 1;
    transition: transform 0.22s ease;
  }

  .mobile-detail-card.is-open .mobile-card-chevron {
    transform: rotate(180deg);
  }

  .mobile-sections-stack {
    min-width: 0;
    display: grid;
    gap: 0;
  }

  .mobile-card-expand {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    border: 0 solid transparent;
    border-radius: 20px;
    background: #fff;
    box-shadow: none;
    padding: 0 14px;
    transition:
      max-height 0.24s ease,
      opacity 0.2s ease,
      border-width 0.24s ease,
      padding-bottom 0.24s ease,
      padding-top 0.24s ease,
      visibility 0s linear 0.24s;
  }

  .mobile-card-expand.is-open {
    max-height: 620px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    border-width: 1px;
    border-color: #86c9ff;
    box-shadow:
      0 12px 24px rgba(6, 29, 66, 0.05),
      0 0 0 3px rgba(35, 119, 216, 0.1);
    padding-top: 14px;
    padding-bottom: 14px;
    transition-delay: 0s;
  }

  .mobile-date-popover {
    position: absolute;
    left: 0;
    top: calc(100% - 10px);
    z-index: 40;
    width: min(268px, calc(200% + 14px));
    transform: translateY(-4px);
  }

  .mobile-date-popover.is-open {
    transform: translateY(0);
  }

  .mobile-date-popover::before {
    content: "";
    position: absolute;
    left: 28px;
    top: -9px;
    width: 18px;
    height: 18px;
    border-left: 1px solid #e4edf8;
    border-top: 1px solid #e4edf8;
    background: #fff;
    transform: rotate(45deg);
  }

  .mobile-date-popover-inner {
    min-width: 0;
    position: relative;
    z-index: 1;
    border-radius: 20px;
    background: #fff;
    display: grid;
    gap: 10px;
  }

  .mobile-popover-field {
    position: relative;
    min-width: 0;
    min-height: 46px;
    padding: 0;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  .mobile-time-field {
    align-items: start;
  }

  .mobile-time-field > span {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .mobile-time-field .mobile-time-trigger,
  .mobile-time-field .mobile-time-menu {
    grid-column: 2;
  }

  .mobile-popover-field span {
    color: #6f7d92;
    font-size: 14px;
    font-weight: 850;
  }

  .mobile-popover-field input,
  .mobile-time-trigger {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    border: 1px solid #e1e9f3;
    border-radius: 14px;
    background: #fbfdff;
    color: #061d42;
    padding: 0 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 850;
  }

  .mobile-popover-field input:focus,
  .mobile-time-trigger:focus {
    border-color: #86c9ff;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(35, 119, 216, 0.12);
  }

  .mobile-time-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }

  .mobile-time-trigger::after {
    content: "⌄";
    color: #071c3f;
    font-size: 17px;
    font-weight: 950;
    line-height: 1;
  }

  .mobile-time-menu {
    position: static;
    z-index: 45;
    width: 100%;
    max-height: 176px;
    margin-top: 6px;
    border: 1px solid #e3ebf5;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 36px rgba(6, 29, 66, 0.16);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-time-menu[hidden] {
    display: none;
  }

  .mobile-time-option {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
    color: #061d42;
    padding: 0 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 850;
    text-align: left;
  }

  .mobile-time-option:last-child {
    border-bottom: 0;
  }

  .mobile-time-option.is-selected {
    background: #edf5ff;
    color: #1f66c9;
  }

  .mobile-section-error {
    min-height: 0;
    padding: 0;
    color: #d04456;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
  }

  .mobile-section-error:empty {
    display: none;
  }

  .mobile-popover-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-top: 2px;
  }

  .mobile-popover-cancel,
  .mobile-popover-save {
    min-width: 0;
    min-height: 46px;
    border-radius: 14px;
    font: inherit;
    font-size: 14px;
    font-weight: 900;
  }

  .mobile-popover-cancel {
    border: 1px solid #e1e8f2;
    background: #fbfdff;
    color: #657386;
  }

  .mobile-popover-save {
    border: 1px solid #2377d8;
    background: #2377d8;
    color: #fff;
    box-shadow: 0 10px 18px rgba(35, 119, 216, 0.22);
  }

  .mobile-status-pill {
    width: fit-content;
    border-radius: 10px;
    max-width: 100%;
    padding: 6px 8px;
    display: inline-flex;
    background: #fff0c2;
    color: #b26b00;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.1;
    white-space: normal;
  }

  .mobile-status-paid,
  .mobile-status-confirmed,
  .mobile-status-ended {
    background: #ddf7e7;
    color: #16834d;
  }

  .mobile-status-refused {
    background: #ffe3e3;
    color: #ba4747;
  }

  .mobile-summary-row {
    appearance: none;
    min-width: 0;
    min-height: 86px;
    border: 1px solid #e4eaf2;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(6, 29, 66, 0.035);
    padding: 16px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .mobile-summary-row.is-open {
    border-color: #c8d8ec;
    box-shadow:
      0 12px 24px rgba(6, 29, 66, 0.05),
      0 0 0 3px rgba(35, 119, 216, 0.07);
  }

  .mobile-summary-row span:nth-child(2) {
    min-width: 0;
    display: grid;
    gap: 4px;
  }

  .mobile-summary-row strong {
    color: #061d42;
    font-size: 17px;
    font-weight: 900;
  }

  .mobile-summary-row small {
    min-width: 0;
    color: #061d42;
    font-size: 16px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-row-chevron {
    color: #7a8494;
    font-size: 34px;
    font-weight: 280;
    transition: transform 0.16s ease;
  }

  .mobile-summary-row.is-open .mobile-row-chevron {
    transform: rotate(90deg);
  }

  .mobile-stat-row {
    margin-top: -1px;
    min-height: 76px;
    border: 1px solid #e4eaf2;
    border-top: 0;
    border-radius: 0 0 12px 12px;
    background: #fff;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
  }

  .mobile-detail-panel {
    margin-top: -12px;
    border: 1px solid #e4eaf2;
    border-radius: 12px;
    background: #fbfdff;
    padding: 12px;
    display: grid;
    gap: 9px;
  }

  .mobile-detail-panel[hidden] {
    display: none;
  }

  .mobile-panel-current,
  .mobile-panel-item {
    min-width: 0;
    border: 1px solid #e7edf5;
    border-radius: 10px;
    background: #fff;
    padding: 11px 12px;
    display: grid;
    gap: 4px;
  }

  .mobile-panel-current span,
  .mobile-panel-item span {
    color: #778397;
    font-size: 12px;
    font-weight: 850;
  }

  .mobile-panel-current strong,
  .mobile-panel-item strong {
    color: #061d42;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.2;
  }

  .mobile-panel-item p {
    margin: 0;
    color: #223450;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .mobile-panel-item small,
  .mobile-empty-panel {
    color: #7b8798;
    font-size: 12px;
    font-weight: 750;
  }

  .mobile-option-list {
    display: grid;
    gap: 8px;
  }

  .mobile-option-button,
  .mobile-panel-action {
    min-height: 44px;
    border: 1px solid #dce8f7;
    border-radius: 10px;
    background: #fff;
    color: #061d42;
    font: inherit;
    font-size: 15px;
    font-weight: 850;
    padding: 0 13px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    text-align: left;
  }

  .mobile-option-button.is-selected {
    border-color: #97b9e8;
    background: #edf5ff;
    color: #1f66c9;
  }

  .mobile-option-button.is-selected::after {
    content: "✓";
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #dbeeff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1f66c9;
    font-size: 15px;
    font-weight: 950;
  }

  .mobile-panel-action {
    background: #f7fbff;
    color: #1f66c9;
  }

  .mobile-stat-row > span {
    min-width: 0;
    min-height: 76px;
    padding: 12px 8px;
    border-left: 1px solid #edf1f6;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 6px;
    text-align: center;
  }

  .mobile-stat-row > span:first-child {
    border-left: 0;
  }

  .mobile-stat-row svg {
    width: 18px;
    height: 18px;
    color: #2377d8;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.45;
  }

  .mobile-stat-row strong {
    min-width: 0;
    color: #061d42;
    font-size: 16px;
    font-weight: 950;
    line-height: 1.1;
  }

  .mobile-stat-row small {
    display: block;
    margin-top: 4px;
    color: #6b7687;
    font-size: 10px;
    font-weight: 800;
  }

  .mobile-detail-actions {
    margin: 6px 0 0;
    padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid #edf1f6;
    background: #fff;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .mobile-edit-button,
  .mobile-delete-button {
    min-width: 0;
    min-height: 58px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 900;
  }

  .mobile-edit-button {
    border: 1px solid #dce8f7;
    background: #fbfdff;
    color: #1f66c9;
  }

  .mobile-delete-button {
    border: 1px solid #f0d8dd;
    background: #fff6f7;
    color: #d04456;
  }
}

@media (max-width: 720px) {
  #scheduleList.schedule-list {
    grid-template-rows: 22px auto;
    gap: 7px;
    padding-top: 14px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .schedule-list .schedule-header {
    height: 22px;
    min-height: 22px;
    margin-top: 0;
    margin-bottom: 0;
  }

  .schedule-header {
    display: grid;
    grid-template-columns: minmax(64px, 0.8fr) minmax(0, 4fr);
    gap: 4px;
    align-items: stretch;
  }

  .schedule-header > span {
    display: block;
  }

  .quarter-headings {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .quarter-headings span,
  .quarter-headings span:first-child,
  .quarter-headings span:nth-child(4) {
    height: 20px;
    min-height: 20px;
    max-height: 20px;
    display: grid;
    place-items: center;
    border: 1px solid #e2eaf4;
    border-radius: 8px;
    background: #f8fbff;
    box-shadow: none;
    color: #5f6d7c;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
  }

  .quarter-headings span::after,
  .quarter-headings span:first-child::after,
  .quarter-headings span:nth-child(2)::after,
  .quarter-headings span:nth-child(3)::after {
    content: none;
  }
}
