:root {
  --bg: #f3f5f8;
  --card: rgba(255, 255, 255, 0.9);
  --card-solid: #ffffff;
  --line: #d9e0ec;
  --line-strong: #c7d2e3;
  --text: #182338;
  --muted: #61718f;
  --muted-soft: #8b98b1;
  --primary: #1f6fd6;
  --primary-strong: #0f4fa8;
  --primary-soft: rgba(31, 111, 214, 0.08);
  --brand-coral: #ff6647;
  --brand-coral-strong: #e85a3d;
  --brand-coral-soft: rgba(255, 102, 71, 0.16);
  --green: #10a56d;
  --orange: #d38b1f;
  --red: #cf3f5b;
  --header-height: 56px;
  --header-offset: var(--header-height);
  --left-width: 236px;
  --left-collapsed-width: 76px;
  --right-width: 330px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  font-family: "Inter", "Segoe UI", -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
}

input,
select,
button {
  font: inherit;
}

.app-header {
  min-height: var(--header-height);
  flex: 0 0 var(--header-height);
  padding: 0 14px;
  display: flex;
  position: relative;
  z-index: 20;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  overflow: visible;
}

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

.header-left {
  align-self: stretch;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.header-right {
  justify-content: flex-end;
  flex: 0 0 auto;
}

.header-nav {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  align-self: stretch;
  height: 100%;
  position: relative;
  overflow: visible;
}

.header-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: stretch;
  height: 100%;
  padding: 0 2px;
  background: transparent;
  overflow: visible;
  color: #64748b;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.16s ease;
}

.header-tab:hover {
  color: #1e293b;
}

.header-tab.active {
  color: #0f172a;
  font-weight: 600;
}

.header-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  line-height: 1;
}

.header-tab-svg,
.header-control-svg {
  width: 18px;
  height: 18px;
}

.header-tab:not(.active) .header-tab-icon {
  color: #94a3b8;
}

.header-tab.active .header-tab-icon {
  color: var(--brand-coral);
}

.header-tab-underline {
  position: absolute;
  left: 50%;
  bottom: -1px;
  z-index: 3;
  width: calc(100% + 6px);
  height: 4px;
  background: var(--brand-coral);
  border-radius: 999px 999px 0 0;
  opacity: 0;
  transform: translateX(calc(-50% + 3px)) scaleX(0.8);
  transform-origin: center;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.header-tab.active .header-tab-underline {
  opacity: 1;
  transform: translateX(calc(-50% + 3px)) scaleX(1);
}

.header-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 13px;
  white-space: nowrap;
}

.header-meta-icon {
  font-size: 13px;
  line-height: 1;
}

.header-icon-btn,
.sidebar-pin-btn,
.sidebar-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.header-icon-btn,
.sidebar-pin-btn {
  width: 36px;
  height: 36px;
  font-size: 15px;
  border-radius: 999px;
}

.header-icon-btn:hover,
.sidebar-pin-btn:hover,
.sidebar-action-btn:hover {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text);
}

.header-icon-btn:active,
.sidebar-pin-btn:active {
  transform: translateY(1px);
}

.app-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
  position: relative;
}

.app-sidebar,
.app-content {
  min-height: 0;
}

.app-sidebar {
  background: #f4f5f7;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.right-sidebar {
  width: var(--right-width);
  flex: 0 0 var(--right-width);
  padding: 12px 12px 8px;
  border-left: 1px solid #e2e8f0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sidebar-header-minimal {
  justify-content: flex-end;
  margin-bottom: 6px;
}

.sidebar-kicker {
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.sidebar-pin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-pin-icon-overlay {
  display: none;
}

.shell-right-overlay .sidebar-pin-icon-open {
  display: none;
}

.shell-right-overlay .sidebar-pin-icon-overlay {
  display: inline-flex;
}

.app-content {
  flex: 1 1 auto;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.app-content > * {
  min-height: 0;
}

.app-content > [data-partial-content-root] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.right-sidebar {
  overflow: hidden;
  position: relative;
}

.right-sidebar .sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
}

.shell-right-overlay .right-sidebar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(var(--right-width), calc(100vw - 32px));
  z-index: 35;
}

.shell-right-closed .right-sidebar {
  display: none;
}

.shell-right-overlay .right-sidebar {
  display: flex;
}

.shell-right-overlay.shell-right-closed .right-sidebar {
  display: none;
}

.shell-backdrop {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 30;
  border: 0;
  background: rgba(15, 27, 51, 0.14);
}

.shell-right-overlay:not(.shell-right-closed) .shell-backdrop {
  display: block;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  padding: 16px 16px 0;
}

.section-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.section-note,
.sidebar-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  padding: 14px 16px;
}

.table-card {
  overflow: hidden;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: opacity 0.14s ease;
}

.table-card > .section-head,
.table-card > .pagination {
  flex: 0 0 auto;
}

.table-card.is-loading {
  opacity: 0.74;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  flex: 0 0 auto;
  padding: 16px;
}

.kpi {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
}

.kpi-title {
  color: #7a869f;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.kpi-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.05;
  margin-top: 6px;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-divider {
  height: 1px;
  margin: 16px 0;
  background: #e0e0e0;
}

.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-actions {
  display: inline-flex;
  gap: 8px;
}

.sidebar-action-btn {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(120deg, var(--brand-coral), var(--brand-coral-strong));
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-light {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.btn-block {
  width: 100%;
}

.sidebar-form,
.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-form-notice {
  border: 1px solid rgba(255, 102, 71, 0.22);
  border-radius: 12px;
  background: rgba(255, 102, 71, 0.08);
  color: #b63d27;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  padding: 10px 12px;
}

.sidebar-form-notice.is-hidden {
  display: none;
}

.sidebar-form-field {
  position: relative;
}

.sidebar-form-field-label {
  display: block;
}

.sidebar-form-field-note,
.sidebar-form-note-inline {
  color: #c04f3a;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.sidebar-form-field-note:empty {
  display: none;
}

.sidebar-form-note-inline {
  margin-bottom: 10px;
}

.sidebar-form-field.is-validation-error input[type="date"],
.sidebar-form-field.is-validation-error select,
.sidebar-form-field.is-validation-error .multi-select-trigger,
.sidebar-form-field.is-validation-error .single-select-trigger,
.sidebar-form-field.is-validation-error .records-client-filter-trigger,
.sidebar-form-field.is-validation-error .segmented-control {
  border-color: rgba(255, 102, 71, 0.55);
  box-shadow: 0 0 0 2px rgba(255, 102, 71, 0.14);
}

.sidebar-form-field.is-validation-error .toggle-switch {
  border-color: rgba(255, 102, 71, 0.4);
  box-shadow: 0 0 0 2px rgba(255, 102, 71, 0.12);
}

.sidebar-form-field.is-validation-error .multi-select-placeholder,
.sidebar-form-field.is-validation-error .toggle-text {
  color: #a7422d;
}

.toggle-field .sidebar-form-field-note {
  flex: 0 0 100%;
  margin-left: 58px;
}

.date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -2px;
}

.date-preset-chip {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #e9eef5;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.date-preset-chip:hover {
  background: #dfe7f1;
}

.date-preset-chip.is-active {
  background: rgba(31, 111, 214, 0.08);
  border-color: rgba(31, 111, 214, 0.18);
  color: #1f6fd6;
}

.segmented-control {
  display: inline-flex;
  width: 100%;
  padding: 4px;
  gap: 4px;
  border-radius: 10px;
  background: #e9eef5;
}

.segmented-control-option {
  flex: 1 1 0;
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.segmented-control-option:hover {
  background: rgba(255, 255, 255, 0.52);
  color: var(--text);
}

.segmented-control-option.is-active {
  background: #fff;
  color: var(--primary-strong);
  box-shadow: 0 1px 2px rgba(15, 27, 51, 0.08);
}

.segmented-control-option:focus-visible {
  outline: 2px solid rgba(31, 111, 214, 0.22);
  outline-offset: 1px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

input[type="date"],
select {
  width: 100%;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid #d8dee8;
  background: #fff;
  color: var(--text);
  padding: 6px 10px;
  transition: border-color 0.16s ease, background 0.16s ease;
}

input[type="date"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

select[multiple] {
  min-height: 42px;
}

.toggle-field {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  position: relative;
  cursor: pointer;
  color: var(--text);
}

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

.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #dbe4f2;
  border: 1px solid #c5d1e4;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(24, 35, 56, 0.14);
  transition: transform 0.16s ease;
}

.toggle-input:checked + .toggle-switch {
  background: linear-gradient(120deg, var(--brand-coral), var(--brand-coral-strong));
  border-color: transparent;
}

.toggle-input:checked + .toggle-switch .toggle-knob {
  transform: translateX(20px);
}

.toggle-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.column-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.column-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 2px 0;
  position: relative;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

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

.column-check-ui {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 4px;
  border: 2px solid #c8d1df;
  background: #fff;
  position: relative;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.column-check-ui::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.16s ease;
}

.column-toggle input:checked + .column-check-ui {
  background: linear-gradient(120deg, var(--brand-coral), var(--brand-coral-strong));
  border-color: transparent;
}

.column-toggle input:checked + .column-check-ui::after {
  transform: rotate(45deg) scale(1);
}

.column-toggle-label {
  color: var(--text);
  font-size: 13px;
}

.chat-cell {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
}

.chat-cell-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  min-height: 28px;
}

.chat-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  padding-left: 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  color: #0f62fe;
}

.chat-primary-link {
  color: #0f62fe;
}

.chat-primary-link.is-dialogs {
  color: #2563eb;
}

.chat-primary-link.is-manual {
  color: #0f766e;
}

.chat-primary-link:hover {
  color: #1d4ed8;
}

.chat-edit-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.chat-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 4px 6px;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.chat-input:hover {
  border-color: #d8dee8;
  background: #fff;
}

.chat-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.32);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.chat-input[data-state="saving"] {
  background: #f8fbff;
  border-color: #a9c4ee;
}

.chat-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1;
  cursor: default;
}

.chat-edit-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 0;
  background: transparent;
  color: #64748b;
  text-decoration: none;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  line-height: 1;
}

.chat-edit-toggle:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
}

.chat-cell-shell.has-target:not(.is-editing) .chat-edit-wrap {
  display: none;
}

.chat-cell-shell:not(.has-target) .chat-primary-link,
.chat-cell-shell.is-editing .chat-primary-link,
.chat-cell-shell.is-editing .chat-edit-toggle {
  display: none;
}

.comment-cell {
  max-width: 220px;
}

.comment-text {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: auto;
  min-width: 0;
  min-height: 0;
  overscroll-behavior: contain;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 0;
  font-size: 14px;
}

.table-compact {
  table-layout: auto;
}

.table-compact th,
.table-compact td {
  padding: 9px 8px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fafafa;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid #e2e8f0;
}

.table tbody tr:hover td {
  background: #f9f9f9;
}

.table th a {
  color: inherit;
  text-decoration: none;
}

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.column-help {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.column-help::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 40;
  width: min(320px, 42vw);
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.96);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 1.45;
  text-transform: none;
  white-space: normal;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  opacity: 0;
  visibility: hidden;
  display: none;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  pointer-events: none;
}

.column-help::before {
  content: "";
  position: absolute;
  left: 14px;
  top: calc(100% + 4px);
  width: 10px;
  height: 10px;
  background: rgba(15, 23, 42, 0.96);
  transform: rotate(45deg);
  opacity: 0;
  visibility: hidden;
  display: none;
  transition: opacity 0.14s ease, visibility 0.14s ease;
  pointer-events: none;
}

.column-help:hover::after,
.column-help:hover::before,
.sort-link:focus-visible .column-help::after,
.sort-link:focus-visible .column-help::before,
.column-help:focus-visible::after,
.column-help:focus-visible::before {
  opacity: 1;
  visibility: visible;
  display: block;
  transform: translateY(0);
}

.operations-table th.col-right .column-help,
.operations-table th[data-col="total_appointments"] .column-help,
.operations-table th[data-col="completed_appointments"] .column-help,
.operations-table th[data-col="arrived_appointments"] .column-help,
.operations-table th[data-col="arrived_new_count"] .column-help,
.operations-table th[data-col="arrived_old_count"] .column-help,
.operations-table th[data-col="income_total"] .column-help,
.operations-table th[data-col="visits_per_day"] .column-help,
.operations-table th[data-col="returning_clients_share"] .column-help,
.operations-table th[data-col="rebooked_share"] .column-help,
.operations-table th[data-col="avg_visits_returning"] .column-help,
.operations-table th[data-col="conversion_to_second_visit"] .column-help {
  justify-content: flex-end;
  white-space: normal;
  line-height: 1.2;
  text-align: right;
}

.operations-table th.col-right .column-help::after,
.operations-table th[data-col="total_appointments"] .column-help::after,
.operations-table th[data-col="completed_appointments"] .column-help::after,
.operations-table th[data-col="arrived_appointments"] .column-help::after,
.operations-table th[data-col="arrived_new_count"] .column-help::after,
.operations-table th[data-col="arrived_old_count"] .column-help::after,
.operations-table th[data-col="income_total"] .column-help::after,
.operations-table th[data-col="visits_per_day"] .column-help::after,
.operations-table th[data-col="returning_clients_share"] .column-help::after,
.operations-table th[data-col="rebooked_share"] .column-help::after,
.operations-table th[data-col="avg_visits_returning"] .column-help::after,
.operations-table th[data-col="conversion_to_second_visit"] .column-help::after {
  left: auto;
  right: 0;
}

.operations-table th.col-right .column-help::before,
.operations-table th[data-col="total_appointments"] .column-help::before,
.operations-table th[data-col="completed_appointments"] .column-help::before,
.operations-table th[data-col="arrived_appointments"] .column-help::before,
.operations-table th[data-col="arrived_new_count"] .column-help::before,
.operations-table th[data-col="arrived_old_count"] .column-help::before,
.operations-table th[data-col="income_total"] .column-help::before,
.operations-table th[data-col="visits_per_day"] .column-help::before,
.operations-table th[data-col="returning_clients_share"] .column-help::before,
.operations-table th[data-col="rebooked_share"] .column-help::before,
.operations-table th[data-col="avg_visits_returning"] .column-help::before,
.operations-table th[data-col="conversion_to_second_visit"] .column-help::before {
  left: auto;
  right: 14px;
}

.sort-link.is-active {
  color: var(--text);
}

.sort-indicator {
  color: var(--primary);
  font-size: 11px;
  line-height: 1;
}

.table td.ns-cell,
.table th.ns-cell {
  text-align: center;
  width: 50px;
}

.records-table th {
  position: relative;
}

.records-table .sort-link {
  display: inline-flex;
  align-items: center;
}

.records-table .stack-cell {
  align-items: flex-start;
  text-align: left;
}

.records-table .services-cell {
  text-align: left;
}

.records-table .services-text {
  text-align: left;
}

.ns-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 999px;
}

.ns-marker-new {
  background: rgba(16, 165, 109, 0.16);
  border: 1px solid rgba(16, 165, 109, 0.55);
}

.ns-marker-old {
  background: rgba(211, 139, 31, 0.16);
  border: 1px solid rgba(211, 139, 31, 0.55);
}

.ns-marker-unknown {
  background: rgba(97, 113, 143, 0.14);
  border: 1px solid rgba(97, 113, 143, 0.45);
}

.stack-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stack-primary {
  color: var(--text);
  font-weight: 600;
  line-height: 1.2;
}

.stack-secondary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.stack-phone-mask {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.records-table tbody tr:hover .stack-phone-mask,
.records-table tbody tr:focus-within .stack-phone-mask {
  color: transparent;
}

.records-table tbody tr:hover .stack-phone-mask::after,
.records-table tbody tr:focus-within .stack-phone-mask::after {
  content: attr(data-full-phone);
  position: absolute;
  inset: 0 auto auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.services-cell {
  max-width: 250px;
}

.services-text {
  display: block;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.badge-arrived {
  background: rgba(16, 165, 109, 0.13);
  color: #0a7f54;
}

.badge-no-show {
  background: rgba(207, 63, 91, 0.14);
  color: #a22642;
}

.badge-waiting {
  background: rgba(54, 111, 214, 0.12);
  color: #2254ab;
}

.badge-confirmed {
  background: rgba(211, 139, 31, 0.15);
  color: #915e10;
}

.badge-neutral {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.badge-deleted {
  background: rgba(207, 63, 91, 0.14);
  color: #a22642;
}

.col-money,
.table td.td-money,
.table td.td-right,
.table th.col-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table:not(.records-table) th[data-col="attendance"],
.table:not(.records-table) td[data-col="attendance"] {
  text-align: left;
}

.table td[data-col="id"] a {
  display: inline-block;
  text-align: left;
}

.operations-table th,
.operations-table td {
  padding: 14px 5px;
}

.operations-table th[data-col="employee_name"],
.operations-table th[data-col="location_name"],
.operations-table td[data-col="location_name"],
.operations-table td[data-col="employee_name"] {
  text-align: left;
}

.operations-table thead th {
  white-space: normal;
  line-height: 1.2;
  font-size: 11px;
  letter-spacing: 0.05em;
  vertical-align: bottom;
  padding-top: 12px;
  padding-bottom: 10px;
}

.operations-table thead th .column-help {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
}

.operations-table th.col-right,
.operations-table td.td-right,
.operations-table th[data-col="total_appointments"],
.operations-table th[data-col="completed_appointments"],
.operations-table th[data-col="arrived_appointments"],
.operations-table th[data-col="arrived_new_count"],
.operations-table th[data-col="arrived_old_count"],
.operations-table th[data-col="revenue_total"],
.operations-table th[data-col="avg_check"],
.operations-table th[data-col="income_total"],
.operations-table th[data-col="visits_per_day"],
.operations-table th[data-col="returning_clients_share"],
.operations-table th[data-col="rebooked_share"],
.operations-table th[data-col="avg_visits_returning"],
.operations-table th[data-col="conversion_to_second_visit"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.operations-table th.col-right .sort-link,
.operations-table th[data-col="total_appointments"] .sort-link,
.operations-table th[data-col="completed_appointments"] .sort-link,
.operations-table th[data-col="arrived_appointments"] .sort-link,
.operations-table th[data-col="arrived_new_count"] .sort-link,
.operations-table th[data-col="arrived_old_count"] .sort-link,
.operations-table th[data-col="revenue_total"] .sort-link,
.operations-table th[data-col="avg_check"] .sort-link,
.operations-table th[data-col="income_total"] .sort-link,
.operations-table th[data-col="visits_per_day"] .sort-link,
.operations-table th[data-col="returning_clients_share"] .sort-link,
.operations-table th[data-col="rebooked_share"] .sort-link,
.operations-table th[data-col="avg_visits_returning"] .sort-link,
.operations-table th[data-col="conversion_to_second_visit"] .sort-link {
  justify-content: flex-end;
  width: 100%;
  align-items: flex-end;
}

.operations-table td.td-right {
  font-variant-numeric: tabular-nums;
}

.operations-table th[data-col="location_name"] {
  width: 124px;
  min-width: 124px;
}

.operations-table th[data-col="employee_name"] {
  width: 176px;
  min-width: 176px;
}

.operations-table th[data-col="total_appointments"],
.operations-table th[data-col="completed_appointments"],
.operations-table th[data-col="arrived_appointments"],
.operations-table th[data-col="arrived_new_count"],
.operations-table th[data-col="arrived_old_count"],
.operations-table th[data-col="revenue_total"],
.operations-table th[data-col="avg_check"],
.operations-table th[data-col="income_total"],
.operations-table th[data-col="visits_per_day"] {
  width: 96px;
  min-width: 96px;
}

.operations-table th[data-col="returning_clients_share"],
.operations-table th[data-col="avg_visits_returning"] {
  width: 110px;
  min-width: 110px;
}

.operations-table th[data-col="conversion_to_second_visit"] {
  width: 100px;
  min-width: 100px;
}

.operations-table th[data-col="rebooked_share"] {
  width: 130px;
  min-width: 130px;
}

.operations-table th[data-col="returning_clients_share"] .column-help {
  max-width: 100px;
}

.operations-table th[data-col="rebooked_share"] .column-help {
  max-width: 130px;
}

.operations-table th[data-col="avg_visits_returning"] .column-help {
  max-width: 110px;
}

.operations-table th[data-col="conversion_to_second_visit"] .column-help {
  max-width: 100px;
}

.operations-location {
  color: #334155;
}

.operations-employee-cell {
  min-width: 0;
}

.operations-person {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.operations-employee {
  font-weight: 600;
  line-height: 1.2;
}

.operations-role {
  color: #64748b;
  font-size: 12px;
  line-height: 1.2;
}

.operations-metric-main {
  color: inherit;
  font-weight: 600;
}

.operations-submetric {
  margin-left: 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
}

.operations-submetric-line {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 6px;
  margin-top: 2px;
  white-space: nowrap;
}

.operations-submetric-line .operations-submetric {
  margin-left: 0;
}

.operations-submetric-divider {
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 500;
}

.results-calendar {
  padding: 14px;
  border: 1px solid #dbe4f2;
  border-radius: 18px;
  background: #fff;
}

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

.results-calendar-weekdays {
  margin-bottom: 10px;
}

.results-calendar-weekday {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.results-calendar-day {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  background: #f8fafc;
}

.results-calendar-day.is-padding {
  background: transparent;
  color: transparent;
}

.results-calendar-day.is-today {
  background: rgba(255, 102, 71, 0.12);
  color: #c74d34;
}

.results-calendar-nav {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.results-calendar-arrow {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe4f2;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.results-calendar-arrow:hover {
  border-color: rgba(255, 102, 71, 0.28);
  background: rgba(255, 102, 71, 0.08);
  color: #c74d34;
  transform: translateY(-1px);
}

.results-calendar-arrow.is-disabled {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #cbd5e1;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.results-calendar-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.results-calendar-current {
  color: #c74d34;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.results-table td[data-col="employee_name"] {
  min-width: 208px;
}

.results-table th.col-right,
.results-table td.td-right,
.results-table th[data-col="total_appointments"],
.results-table th[data-col="completed_appointments"],
.results-table th[data-col="arrived_appointments"],
.results-table th[data-col="arrived_new_count"],
.results-table th[data-col="arrived_old_count"],
.results-table th[data-col="visits_per_day"],
.results-table th[data-col="returning_clients_share"],
.results-table th[data-col="rebooked_share"],
.results-table th[data-col="conversion_to_second_visit"] {
  text-align: left;
}

.results-table th.col-right .sort-link,
.results-table th[data-col="total_appointments"] .sort-link,
.results-table th[data-col="completed_appointments"] .sort-link,
.results-table th[data-col="arrived_appointments"] .sort-link,
.results-table th[data-col="arrived_new_count"] .sort-link,
.results-table th[data-col="arrived_old_count"] .sort-link,
.results-table th[data-col="visits_per_day"] .sort-link,
.results-table th[data-col="returning_clients_share"] .sort-link,
.results-table th[data-col="rebooked_share"] .sort-link,
.results-table th[data-col="conversion_to_second_visit"] .sort-link {
  justify-content: flex-start;
  align-items: flex-start;
}

.results-person-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.leaderboard-rank {
  flex: 0 0 28px;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.leaderboard-rank.is-leader {
  color: #cf8b16;
}

.leaderboard-rank-icon {
  width: 16px;
  height: 16px;
}

.results-bar-cell {
  position: relative;
  overflow: hidden;
}

.results-bar {
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  z-index: 0;
  border-radius: 0 6px 6px 0;
  pointer-events: none;
}

.results-bar--primary {
  background: rgba(255, 102, 71, 0.16);
}

.results-bar--neutral {
  background: rgba(148, 163, 184, 0.14);
}

.results-bar-content,
.results-bar-stack {
  position: relative;
  z-index: 1;
  text-align: left;
}

.results-bar-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.results-table .operations-submetric-line {
  justify-content: flex-start;
  align-items: flex-start;
}

.metric-zero {
  color: #94a3b8;
}

.metric-na {
  color: #94a3b8;
  font-style: italic;
}

.money-zero {
  color: #9aa7bf;
}

.date-cell {
  font-variant-numeric: tabular-nums;
}

.date-cell-today {
  position: relative;
}

.date-cell-today::before {
  content: "";
  position: absolute;
  inset-block: 8px;
  left: 0;
  width: 4px;
  background: #f97316;
  border-radius: 0 3px 3px 0;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.empty-rich {
  padding: 24px 12px !important;
  color: #94a3b8;
  font-style: italic;
  text-align: center;
}

[data-col].column-hidden {
  display: none;
}

.records-table th[data-col="appointment"],
.records-table td[data-col="appointment"],
.records-table th[data-col="create_date"],
.records-table td[data-col="create_date"],
.records-table th[data-col="changed"],
.records-table td[data-col="changed"] {
  min-width: 140px;
}

.records-table th[data-col="duration"],
.records-table td[data-col="duration"] {
  min-width: 96px;
}

.duration-cell-alert {
  background: rgba(239, 68, 68, 0.08);
}

.duration-main,
.duration-break {
  font-variant-numeric: tabular-nums;
}

.duration-main.is-alert,
.duration-break.is-alert {
  color: #dc2626;
  font-weight: 700;
}

.records-table th[data-col="attendance"],
.records-table td[data-col="attendance"] {
  min-width: 120px;
}

.records-table th[data-col="cost"],
.records-table td[data-col="cost"] {
  min-width: 110px;
}

.records-table th[data-col="id"],
.records-table td[data-col="id"] {
  min-width: 80px;
}

.records-table th[data-col="executor_meta"],
.records-table td[data-col="executor_meta"],
.records-table th[data-col="client_contact"],
.records-table td[data-col="client_contact"] {
  min-width: 150px;
}

.records-table th[data-col="client_chat"],
.records-table td[data-col="client_chat"] {
  min-width: 160px;
}

.records-table th[data-col="comment"],
.records-table td[data-col="comment"] {
  min-width: 180px;
}

.pagination {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
  color: var(--muted);
  padding: 12px 16px 16px;
}

.pagination-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-size-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.page-size-form select {
  min-height: 34px;
  padding: 6px 10px;
}

.sidebar-pin-btn {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.js-ready .multi-select-source,
.js-ready .single-select-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}

.multi-select {
  position: relative;
}

.single-select {
  position: relative;
}

.multi-select-trigger {
  width: 100%;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid #d8dee8;
  background: #fff;
  color: var(--text);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.single-select-trigger {
  width: 100%;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid #d8dee8;
  background: #fff;
  color: var(--text);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.multi-select-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  max-width: calc(100% - 20px);
  min-height: 26px;
}

.multi-select-placeholder {
  color: var(--muted-soft);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.single-select-value {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text);
  font-weight: 600;
}

.multi-select-chip {
  display: inline-flex;
  max-width: 170px;
  align-items: center;
  gap: 6px;
  border: 1px solid #d7e2f4;
  border-radius: 999px;
  background: #f5f9ff;
  color: #1f4d97;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
}

.multi-select-chip-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multi-select-chip-remove {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(31, 77, 151, 0.1);
  color: #1f4d97;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.multi-select-chip-remove:hover {
  background: rgba(31, 77, 151, 0.16);
}

.multi-select-chip-remove:focus-visible {
  outline: 2px solid rgba(31, 111, 214, 0.32);
  outline-offset: 1px;
}

.multi-select-arrow {
  color: #8090ae;
  font-size: 13px;
}

.single-select-arrow {
  color: #8090ae;
  font-size: 13px;
}

.multi-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 25;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: none;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
}

.single-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 25;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: none;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
}

.multi-select.open .multi-select-menu {
  display: block;
}

.single-select.open .single-select-menu {
  display: block;
}

.multi-select.open .multi-select-trigger {
  border-color: #9ec0f2;
  box-shadow: 0 0 0 2px rgba(31, 111, 214, 0.09);
}

.single-select.open .single-select-trigger {
  border-color: #9ec0f2;
  box-shadow: 0 0 0 2px rgba(31, 111, 214, 0.09);
}

.records-client-filter {
  position: relative;
}

.records-client-filter-shell {
  position: relative;
}

.records-client-filter-trigger {
  position: relative;
  width: 100%;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid #d8dee8;
  background: #fff;
  color: var(--text);
  padding: 6px 34px 6px 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.records-client-filter[data-selected-client-id]:not([data-selected-client-id=""]) .records-client-filter-trigger {
  padding-right: 58px;
}

.records-client-filter.is-open .records-client-filter-trigger {
  border-color: #9ec0f2;
  box-shadow: 0 0 0 2px rgba(31, 111, 214, 0.09);
}

.records-client-filter-trigger-copy {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.records-client-filter-label {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: left;
  color: var(--text);
  font-weight: 600;
}

.records-client-filter-label.is-placeholder {
  color: var(--muted-soft);
  font-weight: 500;
}

.records-client-filter-arrow {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: #8090ae;
  font-size: 13px;
  flex: 0 0 auto;
  pointer-events: none;
}

.records-client-filter-clear {
  position: absolute;
  top: 50%;
  right: 32px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: #eef2f7;
  color: #7b879c;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.records-client-filter-clear:hover,
.records-client-filter-clear:focus-visible {
  background: #e2e8f0;
}

.records-client-filter-clear.is-hidden {
  display: none;
}

.records-client-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 26;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.records-client-filter-search-wrap {
  margin-bottom: 8px;
}

.records-client-filter-search {
  width: 100%;
  min-height: 34px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 6px 10px;
  outline: none;
}

.records-client-filter-search:focus {
  border-color: #9ec0f2;
  box-shadow: 0 0 0 2px rgba(31, 111, 214, 0.09);
}

.records-client-filter-feedback {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  padding: 2px 2px 8px;
}

.sidebar-form-field.is-validation-error .records-client-filter-feedback {
  color: #a7422d;
}

.records-client-filter-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
}

.records-client-filter-option {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  cursor: pointer;
  text-align: left;
}

.records-client-filter-option:hover,
.records-client-filter-option:focus-visible,
.records-client-filter-option.is-active {
  background: #f4f8ff;
}

.records-client-filter-option-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.records-client-filter-option-phone {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.multi-select-option {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.multi-select-option span {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.3;
}

.single-select-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.multi-select-option:hover {
  background: #f4f8ff;
}

.single-select-option:hover,
.single-select-option.is-active {
  background: #f4f8ff;
}

.multi-select-option input {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  margin: 0;
  flex: 0 0 18px;
  min-width: 18px;
  min-height: 18px;
  margin-top: 1px;
  border: 2px solid #8f9bb3;
  border-radius: 4px;
  background: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 10px;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.multi-select-option input:checked {
  border-color: transparent;
  background-color: var(--brand-coral);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4.64 8.63 1.93 5.92l-.9.9 3.61 3.61 6.33-6.33-.9-.9z' fill='white'/%3E%3C/svg%3E");
}

.multi-select-option input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-coral-soft);
}

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

.record-detail-card {
  padding-top: 16px;
}

.detail-page-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 32px;
}

.record-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.record-kicker {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.record-title {
  margin: 4px 0 0;
  font-size: 32px;
  line-height: 1.05;
  color: #0f172a;
}

.record-sections {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.record-section-span-3 {
  grid-column: span 3;
}

.record-section-span-6 {
  grid-column: span 6;
}

.record-section-panel {
  padding: 14px 16px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.record-section-heading {
  margin-bottom: 12px;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.record-detail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

.record-detail-list-stack {
  flex: 1 1 auto;
  justify-content: space-between;
  gap: 16px;
}

.record-detail-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
  align-content: start;
}

.record-detail-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.record-detail-item dt {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.record-detail-item dd {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  min-width: 0;
}

.record-detail-item .stack-primary {
  line-height: 1.2;
}

.record-detail-item .stack-secondary {
  margin-top: 1px;
  font-size: 13px;
  line-height: 1.2;
}

.record-external-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  color: #1f4d97;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.record-external-link:hover {
  color: #0f4fa8;
  text-decoration: underline;
}

.record-finance-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.record-finance-subvalue {
  margin-top: 3px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

.section-head-compact {
  align-items: center;
  margin-bottom: 10px;
  padding: 0 0 12px;
}

.section-head-compact .section-title {
  font-size: 18px;
}

.table-wrap-detail {
  max-height: 360px;
}

.table-fixed {
  table-layout: fixed;
}

.table-col-id {
  width: 120px;
}

.table-col-date {
  width: 150px;
}

.table-col-xs {
  width: 110px;
}

.table-col-money {
  width: 140px;
}

.table-col-meta {
  width: 180px;
}

.table-col-wide {
  width: auto;
}

.table-detail td:nth-child(2) {
  min-width: 0;
}

.table-detail td:nth-child(2),
.table-detail th:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.raw-json {
  margin: 0;
  max-height: 520px;
  overflow: auto;
  border-radius: 8px;
  padding: 14px;
  background: #1e293b;
  color: #dbe7ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
}

.raw-json code {
  font: inherit;
  color: inherit;
}

.code-copy-btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: #eef2f7;
  color: #334155;
}

.code-copy-btn.is-copied {
  background: rgba(16, 165, 109, 0.12);
  color: #0a7f54;
}

@media (max-width: 1320px) {
  .shell-right-overlay .right-sidebar,
  .right-sidebar {
    width: min(var(--right-width), calc(100vw - 32px));
  }
}

@media (max-width: 1080px) {
  .app-header {
    min-height: var(--header-height);
    flex-basis: var(--header-height);
    padding: 8px 12px;
    flex-wrap: wrap;
  }

  .header-left,
  .header-right {
    width: 100%;
  }

  .header-right {
    justify-content: space-between;
  }

  .right-sidebar {
    position: fixed;
    top: var(--header-offset);
    bottom: 0;
    z-index: 35;
    width: min(320px, 90vw);
    border-radius: 0;
    border-top: 0;
    right: 0;
    transform: translateX(120%);
    transition: transform 0.18s ease;
  }

  html:not(.shell-right-closed) .right-sidebar {
    transform: translateX(0);
  }

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

  .record-sections {
    grid-template-columns: 1fr;
  }

  .record-section-span-3,
  .record-section-span-6 {
    grid-column: span 1;
  }

  .record-detail-list-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-header {
    gap: 10px;
  }

  .header-nav {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .header-nav::-webkit-scrollbar {
    display: none;
  }

  .header-tab {
    flex: 0 0 auto;
  }

  .header-right {
    justify-content: space-between;
  }

  .pagination {
    align-items: stretch;
  }

  .pagination-right,
  .page-size-form {
    width: 100%;
  }

  .multi-select-chip {
    max-width: 130px;
  }

  .services-text {
    max-width: 180px;
  }
}

.header-user-item {
  max-width: 200px;
}

.header-user-menu {
  position: relative;
}

.header-user-trigger {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 4px 10px 4px 4px;
  border: 1px solid #dbe5f1;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.header-user-trigger::-webkit-details-marker {
  display: none;
}

.header-user-trigger:hover,
.header-user-menu[open] .header-user-trigger,
.header-user-menu.is-open .header-user-trigger {
  border-color: #c7d6e8;
  background: #fbfdff;
  box-shadow: 0 6px 18px -14px rgba(15, 23, 42, 0.45);
}

.header-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-coral), var(--brand-coral-strong));
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.header-user-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.1;
}

.header-user-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.header-user-handle {
  color: #64748b;
  font-size: 11px;
}

.header-user-caret {
  color: #64748b;
  font-size: 11px;
}

.header-user-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: 10px;
  border: 1px solid #dbe5f1;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 20px 40px -28px rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 25;
}

.header-user-menu[open] .header-user-panel,
.header-user-menu:focus-within .header-user-panel,
.header-user-menu.is-open .header-user-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.header-user-panel-head {
  padding: 4px 6px 10px;
  border-bottom: 1px solid #ecf1f7;
}

.header-user-panel-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.header-user-panel-handle {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
}

.header-user-logout-form {
  margin: 0;
  padding-top: 8px;
}

.header-user-action {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: #fff4f2;
  color: #c2412d;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.header-user-action:hover {
  background: #ffe8e3;
}

.header-user-action:active {
  transform: translateY(1px);
}

.login-page {
  min-height: 100vh;
  background: #ffffff;
  overflow: hidden;
}

.login-shell {
  width: 100vw;
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  background: #ffffff;
}

.login-brand-panel {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  width: 100vw;
  overflow: hidden;
  background: #ff6b57;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 20px 0 40px -10px rgba(0, 0, 0, 0.15);
  transition: width 1s cubic-bezier(0.76, 0, 0.24, 1);
}

.login-page.login-loaded .login-brand-panel {
  width: 66.666vw;
}

.login-brand-noise {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.9) 0.6px, transparent 0.7px),
    radial-gradient(circle at 78% 34%, rgba(255, 255, 255, 0.8) 0.7px, transparent 0.8px),
    radial-gradient(circle at 34% 76%, rgba(255, 255, 255, 0.85) 0.6px, transparent 0.7px),
    radial-gradient(circle at 65% 68%, rgba(255, 255, 255, 0.75) 0.6px, transparent 0.7px);
  background-size: 26px 26px, 32px 32px, 24px 24px, 30px 30px;
}

.login-brand-inner {
  position: relative;
  z-index: 1;
  width: min(90%, 980px);
}

.login-brand-logo {
  display: block;
  width: 100%;
  height: auto;
}

.login-form-panel {
  position: relative;
  z-index: 1;
  flex: 0 0 33.333vw;
  width: 33.333vw;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 40px;
  background: #ffffff;
}

.login-form-shell {
  width: min(380px, 100%);
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.4s;
}

.login-page.login-loaded .login-form-shell {
  opacity: 1;
  transform: translateX(0);
}

.login-title {
  margin: 10px 0 8px;
  font-size: 36px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.05;
}

.login-note,
.login-bootstrap-note,
.settings-sidebar-note,
.settings-user-meta {
  color: #64748b;
}

.login-bootstrap-note,
.settings-bootstrap-banner {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff7ed;
  color: #9a3412;
}

.login-form {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.login-field {
  position: relative;
  display: block;
}

.login-input {
  width: 100%;
  height: 52px;
  padding: 18px 16px 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 16px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.login-field.has-toggle .login-input {
  padding-right: 52px;
}

.login-input:focus {
  outline: none;
  border-color: #ff6b57;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 107, 87, 0.12);
}

.login-label {
  position: absolute;
  left: 16px;
  top: 16px;
  color: #64748b;
  font-size: 15px;
  pointer-events: none;
  transform-origin: left top;
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}

.login-input:focus + .login-label,
.login-input:not(:placeholder-shown) + .login-label {
  transform: translateY(-10px) scale(0.82);
  color: #ff6b57;
}

.login-password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.16s ease;
}

.login-password-toggle:hover {
  color: #334155;
}

.login-password-icon {
  width: 20px;
  height: 20px;
}

.login-password-icon-hide {
  display: none;
}

.login-password-toggle[aria-pressed="true"] .login-password-icon-show {
  display: none;
}

.login-password-toggle[aria-pressed="true"] .login-password-icon-hide {
  display: block;
}

.login-submit {
  min-height: 52px;
  border-radius: 12px;
  background: #ff6b57;
  border-color: transparent;
  box-shadow: 0 0 0 0 rgba(255, 107, 87, 0);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px rgba(255, 107, 87, 0.4);
  background: #ff715e;
}

.login-submit:active {
  transform: scale(0.98);
  box-shadow: none;
}

.login-stage {
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-page.login-loaded .login-stage {
  opacity: 1;
  transform: translateY(0);
}

.login-stage.delay-0 {
  transition-delay: 0ms;
}

.login-stage.delay-1 {
  transition-delay: 100ms;
}

.login-stage.delay-2 {
  transition-delay: 200ms;
}

.login-stage.delay-3 {
  transition-delay: 300ms;
}

.settings-page-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 18px 32px;
}

.settings-layout {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.settings-card {
  padding: 18px;
  border-radius: 18px;
  border-color: #dbe5f1;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-message-card {
  min-height: 180px;
}

.settings-nav-sidebar {
  display: grid;
  gap: 10px;
}

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

.settings-side-link {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid #dbe5f1;
  border-radius: 14px;
  color: #475569;
  background: #fff;
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.settings-side-link:hover {
  border-color: #cfdbea;
  background: #f8fbff;
  color: #0f172a;
}

.settings-side-link.is-active {
  border-color: rgba(255, 102, 71, 0.24);
  background: rgba(255, 102, 71, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 102, 71, 0.08);
  color: #0f172a;
}

.settings-side-link-title {
  font-size: 14px;
  font-weight: 700;
}

.settings-side-link-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-side-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
  flex: 0 0 auto;
}

.settings-side-status-dot.is-good {
  background: #10a56d;
  box-shadow: 0 0 0 4px rgba(16, 165, 109, 0.12);
}

.settings-side-status-dot.is-warning {
  background: #d38b1f;
  box-shadow: 0 0 0 4px rgba(211, 139, 31, 0.14);
}

.settings-side-status-dot.is-danger {
  background: #cf3f5b;
  box-shadow: 0 0 0 4px rgba(207, 63, 91, 0.14);
}

.settings-side-link-note {
  font-size: 12px;
  color: #64748b;
  text-decoration: none;
}

.settings-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-card-top-tight {
  align-items: center;
}

.settings-toolbar {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.settings-summary-strip {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.settings-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef4fb;
  border: 1px solid #d8e4f3;
  color: #4b5f7e;
  font-size: 12px;
  font-weight: 700;
}

.settings-summary-pill.settings-summary-pill-monitor {
  border-color: transparent;
}

.settings-summary-pill.settings-summary-pill-monitor.is-success,
.settings-summary-pill.settings-summary-pill-monitor.is-good {
  background: rgba(16, 165, 109, 0.12);
  color: #0f8e5d;
}

.settings-summary-pill.settings-summary-pill-monitor.is-warning {
  background: rgba(211, 139, 31, 0.14);
  color: #b77412;
}

.settings-summary-pill.settings-summary-pill-monitor.is-danger {
  background: rgba(207, 63, 91, 0.12);
  color: #be3652;
}

.settings-summary-pill.settings-summary-pill-monitor.is-neutral {
  background: rgba(31, 111, 214, 0.12);
  color: #1f6fd6;
}

.settings-summary-pill-meta {
  color: #c74d34;
  font-weight: 500;
}

.settings-add-btn {
  min-width: 228px;
}

.settings-users-card {
  gap: 16px;
}

.settings-users-table {
  display: grid;
  gap: 10px;
}

.settings-users-head {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(220px, 1.1fr) 150px 190px;
  gap: 12px;
  padding: 0 14px 8px;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.settings-user-item {
  display: grid;
  gap: 0;
  border: 1px solid #deebf7;
  border-radius: 16px;
  background: #f8fbff;
  overflow: hidden;
}

.settings-user-form-create {
  display: grid;
  gap: 16px;
}

.settings-user-row,
.settings-user-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-user-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(220px, 1.1fr) 150px 190px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
}

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

.settings-user-title {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.1;
}

.settings-state-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-state-badge.is-active {
  background: #eaf7ef;
  color: #0f7a43;
}

.settings-state-badge.is-inactive {
  background: #f1f5f9;
  color: #64748b;
}

.settings-user-main {
  min-width: 0;
}

.settings-user-access {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settings-access-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #dbe5f1;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}

.settings-access-empty {
  color: #94a3b8;
  font-size: 13px;
}

.settings-user-login {
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

.settings-user-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.settings-inline-activation-form {
  margin: 0;
}

.settings-inline-toggle-compact {
  align-self: center;
}

.settings-disclosure-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe4f2;
  border-radius: 12px;
  background: #fff;
  color: #64748b;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.settings-disclosure-btn:hover {
  border-color: rgba(255, 102, 71, 0.24);
  background: rgba(255, 102, 71, 0.08);
  color: #c74d34;
}

.settings-disclosure-btn[aria-expanded="true"] {
  border-color: rgba(255, 102, 71, 0.28);
  background: rgba(255, 102, 71, 0.1);
  color: #c74d34;
}

.settings-disclosure-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.settings-disclosure-btn[aria-expanded="true"] .settings-disclosure-icon {
  transform: rotate(90deg);
}

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

.settings-user-grid-create {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-create-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.settings-submit-btn {
  min-width: 220px;
}

.settings-permissions-group {
  display: grid;
  gap: 8px;
}

.settings-checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-checkbox-row .column-toggle {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #dbe5f1;
  border-radius: 999px;
  background: #ffffff;
  gap: 8px;
}

.settings-user-editor {
  padding: 0 16px 16px;
  border-top: 1px solid #e6eef8;
  background: rgba(255, 255, 255, 0.72);
}

.settings-user-editor-form {
  display: grid;
  gap: 14px;
  padding-top: 14px;
}

.settings-user-editor-form input[type="text"],
.settings-user-editor-form input[type="password"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.settings-user-editor-form input[type="text"]:focus,
.settings-user-editor-form input[type="password"]:focus {
  outline: none;
  border-color: var(--brand-coral);
  box-shadow: 0 0 0 2px rgba(255, 102, 71, 0.18);
  background: #fff;
}

.settings-user-editor-form input[type="text"]::placeholder,
.settings-user-editor-form input[type="password"]::placeholder {
  color: #9ca3af;
}

.settings-user-actions {
  padding-top: 4px;
}

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

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 24px;
}

.settings-modal[hidden] {
  display: none;
}

.settings-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
}

.settings-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid #dbe5f1;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 30px 80px -28px rgba(15, 23, 42, 0.4);
  display: grid;
  gap: 16px;
}

.settings-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid #dbe5f1;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.settings-modal-close:hover {
  background: #f8fafc;
  color: #0f172a;
}

.settings-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.settings-audit-card {
  gap: 16px;
}

.settings-audit-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.settings-audit-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.settings-audit-wrap {
  max-height: 560px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

.settings-audit-table {
  min-width: 1180px;
}

.settings-audit-table th,
.settings-audit-table td {
  padding: 11px 12px;
  vertical-align: top;
}

.settings-audit-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fbff;
}

.settings-audit-context {
  display: grid;
  gap: 4px;
  color: #334155;
}

.settings-audit-source {
  display: grid;
  gap: 4px;
  color: #334155;
}

.settings-audit-source-main {
  color: #0f172a;
  font-weight: 700;
}

.settings-audit-context-meta {
  color: #94a3b8;
  font-size: 12px;
}

.settings-audit-details {
  display: grid;
  gap: 8px;
}

.settings-audit-detail-summary {
  color: #334155;
  line-height: 1.5;
  word-break: break-word;
}

.settings-audit-details summary {
  cursor: pointer;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  list-style: none;
}

.settings-audit-details summary::-webkit-details-marker {
  display: none;
}

.settings-audit-payload {
  margin: 0;
  max-width: 360px;
  max-height: 180px;
  overflow: auto;
  padding: 10px 12px;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.settings-audit-empty {
  color: #94a3b8;
}

.settings-payroll-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.settings-payroll-card {
  border: 1px solid #dce6f4;
  border-radius: 18px;
  background: #fbfdff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-payroll-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-payroll-title {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
}

.settings-payroll-copy {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.settings-payroll-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 18px;
  margin-bottom: 2px;
  border-bottom: 1px solid #e6eef8;
}

.settings-payroll-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.settings-payroll-field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.settings-payroll-label {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.settings-payroll-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.settings-payroll-input-wrap input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 11px 78px 11px 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.settings-payroll-input-wrap input:focus {
  outline: none;
  border-color: var(--brand-coral);
  box-shadow: 0 0 0 2px rgba(255, 102, 71, 0.18);
  background: #fff;
}

.settings-payroll-suffix {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 52px;
  height: calc(100% - 10px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-left: 1px solid #e5e7eb;
  border-radius: 0 6px 6px 0;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.settings-payroll-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.settings-payroll-meta-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: #10b981;
}

.settings-payroll-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.settings-payroll-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-payroll-history-title {
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.settings-payroll-history-wrap {
  max-height: 280px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.settings-payroll-history-table {
  min-width: 100%;
}

.settings-payroll-history-table th,
.settings-payroll-history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e6edf6;
}

.settings-payroll-history-table thead th {
  position: sticky;
  top: 0;
  background: #fbfdff;
  z-index: 1;
  color: #6b7280;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.settings-payroll-history-table tbody tr:last-child td {
  border-bottom: 0;
}

.settings-monitoring-shell {
  gap: 18px;
}

.settings-monitoring-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.settings-monitor-kpi,
.settings-monitor-section,
.settings-server-monitor-card,
.settings-monitor-badge,
.settings-monitor-track-fill,
.settings-monitor-phase-row,
.settings-monitor-phase-segment,
.settings-monitor-sparkbar {
  --monitor-color: #5b6b86;
  --monitor-bg: rgba(91, 107, 134, 0.12);
}

.settings-monitor-kpi.is-success,
.settings-monitor-kpi.is-good,
.settings-monitor-section.is-good,
.settings-monitor-section.is-success,
.settings-server-monitor-card.is-good,
.settings-server-monitor-card.is-success,
.settings-monitor-badge.is-good,
.settings-monitor-badge.is-success,
.settings-monitor-track-fill.is-good,
.settings-monitor-track-fill.is-success,
.settings-monitor-phase-row.is-good,
.settings-monitor-phase-row.is-success,
.settings-monitor-phase-segment.is-good,
.settings-monitor-phase-segment.is-success,
.settings-monitor-sparkbar.is-good {
  --monitor-color: #10a56d;
  --monitor-bg: rgba(16, 165, 109, 0.14);
}

.settings-monitor-kpi.is-warning,
.settings-monitor-section.is-warning,
.settings-server-monitor-card.is-warning,
.settings-monitor-badge.is-warning,
.settings-monitor-track-fill.is-warning,
.settings-monitor-phase-row.is-warning,
.settings-monitor-phase-segment.is-warning,
.settings-monitor-sparkbar.is-warning {
  --monitor-color: #d38b1f;
  --monitor-bg: rgba(211, 139, 31, 0.16);
}

.settings-monitor-kpi.is-danger,
.settings-monitor-section.is-danger,
.settings-server-monitor-card.is-danger,
.settings-monitor-badge.is-danger,
.settings-monitor-track-fill.is-danger,
.settings-monitor-phase-row.is-danger,
.settings-monitor-phase-segment.is-danger,
.settings-monitor-sparkbar.is-danger {
  --monitor-color: #cf3f5b;
  --monitor-bg: rgba(207, 63, 91, 0.16);
}

.settings-monitor-kpi.is-neutral,
.settings-monitor-section.is-neutral,
.settings-server-monitor-card.is-neutral,
.settings-monitor-badge.is-neutral,
.settings-monitor-track-fill.is-neutral,
.settings-monitor-phase-row.is-neutral,
.settings-monitor-phase-segment.is-neutral,
.settings-monitor-sparkbar.is-neutral {
  --monitor-color: #1f6fd6;
  --monitor-bg: rgba(31, 111, 214, 0.12);
}

.settings-server-monitor-card.is-good,
.settings-server-monitor-card.is-success {
  --monitor-color: #10B981;
  --monitor-bg: rgba(16, 185, 129, 0.16);
}

.settings-server-monitor-card.is-warning {
  --monitor-color: #F59E0B;
  --monitor-bg: rgba(245, 158, 11, 0.18);
}

.settings-server-monitor-card.is-danger {
  --monitor-color: #EF4444;
  --monitor-bg: rgba(239, 68, 68, 0.18);
}

.settings-monitor-kpi {
  position: relative;
  overflow: hidden;
  min-height: 152px;
  padding: 18px;
  border: 1px solid #dce6f4;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  display: grid;
  gap: 8px;
  align-content: start;
  box-shadow: 0 18px 40px -34px rgba(15, 23, 42, 0.34);
}

.settings-monitor-kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--monitor-color);
}

.settings-monitor-kpi-eyebrow {
  color: var(--monitor-color);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.settings-monitor-kpi-title {
  color: #0f172a;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
}

.settings-monitor-kpi-value {
  color: #1e293b;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.settings-monitor-kpi-note {
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.settings-monitor-panel {
  padding: 18px;
  border: 1px solid #dce6f4;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  display: grid;
  gap: 16px;
}

.settings-monitor-sections {
  display: grid;
  gap: 14px;
}

.settings-monitor-section {
  position: relative;
  padding: 14px 16px;
  border: 1px solid #dce6f4;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  display: grid;
  gap: 12px;
  align-content: start;
  box-shadow: 0 16px 36px -34px rgba(15, 23, 42, 0.34);
}

.settings-monitor-section::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 20px 0 0 20px;
  background: var(--monitor-color);
}

.settings-monitor-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.settings-monitor-sync-panel {
  background:
    radial-gradient(circle at top right, rgba(31, 111, 214, 0.08), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.settings-monitor-panel-head,
.settings-monitor-subsection-head,
.settings-monitor-run-item,
.settings-monitor-event-item,
.settings-monitor-bar-label {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.settings-monitor-panel-title,
.settings-monitor-subsection-title {
  color: #0f172a;
  font-weight: 800;
  line-height: 1.2;
}

.settings-monitor-panel-title {
  font-size: 18px;
}

.settings-monitor-panel-copy,
.settings-monitor-subsection-note {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.settings-monitor-inline-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--monitor-bg);
  color: #475569;
  font-size: 12px;
  line-height: 1.55;
}

.settings-monitor-inline-note strong {
  color: var(--monitor-color);
}

.settings-monitor-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--monitor-bg);
  color: var(--monitor-color);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.settings-monitor-sync-grid,
.settings-monitor-audit-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(320px, 1fr);
  gap: 16px;
}

.settings-monitor-secondary-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "auth auth"
    "audit reporting";
  gap: 14px;
  align-items: start;
}

.settings-monitor-secondary-auth,
.settings-monitor-secondary-audit,
.settings-monitor-secondary-reporting {
  min-width: 0;
}

.settings-monitor-secondary-auth {
  grid-area: auth;
}

.settings-monitor-secondary-audit {
  grid-area: audit;
}

.settings-monitor-secondary-reporting {
  grid-area: reporting;
}

.settings-monitor-critical {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(280px, 1.05fr);
  gap: 16px;
  align-items: end;
}

.settings-monitor-critical-main,
.settings-monitor-critical-side {
  display: grid;
  gap: 10px;
}

.settings-monitor-critical-value {
  color: #0f172a;
  font-size: 42px;
  font-weight: 800;
  line-height: 0.95;
}

.settings-monitor-critical-copy {
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.settings-monitor-critical-meta {
  display: grid;
  gap: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.settings-monitor-freshness-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #dce6f4;
  background:
    linear-gradient(135deg, rgba(255, 102, 71, 0.06), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  display: grid;
  gap: 12px;
}

.settings-monitor-freshness-value {
  color: #0f172a;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}

.settings-monitor-freshness-copy {
  color: #475569;
  font-size: 14px;
  font-weight: 600;
}

.settings-monitor-freshness-meta {
  display: grid;
  gap: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.settings-monitor-track {
  height: 12px;
  padding: 2px;
  border-radius: 999px;
  background: #e8eef7;
  overflow: hidden;
}

.settings-monitor-track.is-muted {
  background: #edf2f8;
}

.settings-monitor-track-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--monitor-color);
}

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

.settings-monitor-metric-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.settings-monitor-metric-list.is-compact {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.settings-monitor-metric {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #dce6f4;
  border-radius: 14px;
  border-left: 3px solid var(--monitor-color);
  background: #ffffff;
  display: grid;
  gap: 5px;
}

.settings-monitor-metric-name {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-monitor-metric-value {
  color: #0f172a;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.05;
}

.settings-monitor-metric-meta {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.settings-monitor-mini-card,
.settings-monitor-phase-card {
  padding: 14px 15px;
  border: 1px solid #dce6f4;
  border-radius: 16px;
  background: #ffffff;
  display: grid;
  gap: 8px;
}

.settings-monitor-mini-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.settings-monitor-mini-value,
.settings-monitor-run-title,
.settings-monitor-event-title,
.settings-monitor-phase-title {
  color: #0f172a;
  font-weight: 800;
}

.settings-monitor-mini-value {
  font-size: 24px;
  line-height: 1.05;
}

.settings-monitor-mini-note,
.settings-monitor-run-meta,
.settings-monitor-event-meta,
.settings-monitor-phase-metrics,
.settings-monitor-event-submeta {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.settings-monitor-event-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-monitor-subsection,
.settings-monitor-ratio-card,
.settings-monitor-audit-bars,
.settings-monitor-event-list {
  display: grid;
  gap: 12px;
}

.settings-monitor-scroll-shell {
  min-width: 0;
  min-height: 0;
  max-height: clamp(300px, 40vh, 380px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.55) rgba(226, 232, 240, 0.42);
}

.settings-monitor-scroll-shell::-webkit-scrollbar {
  width: 8px;
}

.settings-monitor-scroll-shell::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.42);
}

.settings-monitor-scroll-shell::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
}

.settings-monitor-scroll-shell::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.68);
}

.settings-monitor-phase-stack {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: #eef3f9;
}

.settings-monitor-phase-segment {
  flex: var(--phase-flex) 1 0;
  height: 12px;
  border-radius: 999px;
  background: var(--monitor-color);
}

.settings-monitor-phase-top,
.settings-monitor-run-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-monitor-phase-list {
  display: grid;
  gap: 8px;
}

.settings-monitor-phase-row {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #dce6f4;
  border-radius: 14px;
  border-left: 3px solid var(--monitor-color);
  background: #ffffff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.settings-monitor-phase-row-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.settings-monitor-phase-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-monitor-phase-row-note,
.settings-monitor-phase-row-side {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.settings-monitor-phase-row-side {
  font-weight: 800;
  color: #334155;
  white-space: nowrap;
}

.settings-monitor-phase-issues,
.settings-monitor-run-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-monitor-issue-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 102, 71, 0.08);
  border: 1px solid rgba(255, 102, 71, 0.16);
  color: #c74d34;
  font-size: 11px;
  font-weight: 700;
}

.settings-monitor-run-list {
  display: grid;
  gap: 10px;
}

.settings-monitor-run-list.is-compact,
.settings-monitor-event-list.is-compact {
  gap: 8px;
}

.settings-monitor-run-list.is-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.settings-monitor-run-item,
.settings-monitor-event-item {
  padding: 13px 14px;
  border: 1px solid #dce6f4;
  border-radius: 16px;
  background: #ffffff;
}

.settings-monitor-run-list.is-compact .settings-monitor-run-item,
.settings-monitor-event-list.is-compact .settings-monitor-event-item {
  padding: 11px 12px;
  border-radius: 14px;
}

.settings-monitor-run-list.is-compact .settings-monitor-run-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-content: start;
}

.settings-monitor-run-main,
.settings-monitor-event-main {
  min-width: 0;
}

.settings-monitor-run-main {
  display: grid;
  gap: 6px;
}

.settings-monitor-run-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-monitor-run-stats {
  justify-content: flex-start;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

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

.settings-monitor-spark-head {
  display: grid;
  gap: 3px;
}

.settings-monitor-sparkline {
  min-height: 138px;
  padding: 14px;
  border: 1px solid #dce6f4;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(31, 111, 214, 0.03) 0%, rgba(31, 111, 214, 0) 100%),
    #ffffff;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.settings-monitor-sparkline.is-compact {
  min-height: 88px;
  padding: 10px 12px 8px;
  gap: 6px;
}

.settings-monitor-sparkbar {
  flex: 1 1 0;
  min-width: 12px;
  border-radius: 999px 999px 4px 4px;
  background: var(--monitor-color);
  opacity: 0.92;
}

.settings-monitor-empty-inline {
  color: #94a3b8;
  font-size: 13px;
  align-self: center;
}

.settings-monitor-empty-inline-left {
  justify-self: start;
  text-align: left;
}

.settings-monitor-event-list {
  min-width: 0;
}

.settings-server-monitor-subsection {
  gap: 14px;
}

.settings-server-monitor-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.settings-server-monitor-window {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #dce6f4;
  border-radius: 999px;
  background: #f8fbff;
}

.settings-server-monitor-window-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.settings-server-monitor-window-btn:hover {
  color: #0f172a;
}

.settings-server-monitor-window-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(31, 111, 214, 0.18);
}

.settings-server-monitor-window-btn.is-active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 10px 24px -20px rgba(15, 23, 42, 0.4);
}

.settings-server-monitor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.settings-server-monitor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-server-monitor-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #dce6f4;
  border-radius: 18px;
  border-left: 3px solid var(--monitor-color);
  background: #ffffff;
  display: grid;
  gap: 12px;
  box-shadow: 0 14px 30px -34px rgba(15, 23, 42, 0.34);
}

.settings-server-monitor-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-server-monitor-card-label-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-server-monitor-card-label {
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.settings-server-monitor-info {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.settings-server-monitor-info-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.settings-server-monitor-info:hover .settings-server-monitor-info-trigger,
.settings-server-monitor-info:focus-within .settings-server-monitor-info-trigger {
  color: #cbd5e1;
  background: rgba(71, 85, 105, 0.24);
  transform: translateY(-1px);
}

.settings-server-monitor-info-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

.settings-server-monitor-info-tooltip {
  position: absolute;
  z-index: 3;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  max-width: min(260px, calc(100vw - 48px));
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 18px 44px -24px rgba(2, 6, 23, 0.55);
  color: #f8fafc;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0s linear 0.16s;
}

.settings-server-monitor-info:hover .settings-server-monitor-info-tooltip,
.settings-server-monitor-info:focus-within .settings-server-monitor-info-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.settings-server-monitor-info-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.settings-server-monitor-info-row + .settings-server-monitor-info-row {
  margin-top: 8px;
}

.settings-server-monitor-info-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--server-monitor-legend-color, #10B981);
  box-shadow: 0 0 0 3px rgba(248, 250, 252, 0.06);
}

.settings-server-monitor-info-dot.is-good {
  --server-monitor-legend-color: #10B981;
}

.settings-server-monitor-info-dot.is-warning {
  --server-monitor-legend-color: #F59E0B;
}

.settings-server-monitor-info-dot.is-danger {
  --server-monitor-legend-color: #EF4444;
}

.settings-server-monitor-info-copy {
  display: grid;
  gap: 2px;
}

.settings-server-monitor-info-row-label {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.settings-server-monitor-info-row-range {
  color: rgba(226, 232, 240, 0.8);
  font-size: 11px;
  line-height: 1.35;
}

.settings-server-monitor-card-copy {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.settings-server-monitor-card-value {
  color: #0f172a;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.settings-server-monitor-card-meta {
  display: grid;
  gap: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.settings-server-monitor-chart-shell {
  position: relative;
  min-height: 146px;
  padding: 10px;
  border: 1px solid rgba(220, 230, 244, 0.72);
  border-radius: 16px;
  background:
    radial-gradient(circle at top, rgba(15, 23, 42, 0.022) 0%, rgba(15, 23, 42, 0.004) 72%),
    rgba(255, 255, 255, 0.96);
  display: grid;
  align-items: stretch;
  overflow: hidden;
}

.settings-server-monitor-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.settings-server-monitor-chart-guide {
  stroke: rgba(148, 163, 184, 0.34);
  stroke-width: 0.85;
  stroke-dasharray: 3 8;
  vector-effect: non-scaling-stroke;
}

.settings-server-monitor-chart-axis-label {
  fill: #98a2b3;
  font-size: 7.2px;
  font-weight: 500;
  letter-spacing: 0.01em;
  dominant-baseline: middle;
  user-select: none;
}

.settings-server-monitor-chart-gradient-stop {
  transition: stop-opacity 0.18s ease;
}

.settings-server-monitor-chart-area {
  opacity: 1;
  transition: opacity 0.36s ease-out;
}

.settings-server-monitor-chart-line {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: none;
}

.settings-server-monitor-chart-line.is-animating-in {
  transition: stroke-dashoffset 0.82s cubic-bezier(0.25, 1, 0.5, 1);
}

.settings-server-monitor-chart-point {
  fill: var(--server-monitor-point-color, var(--monitor-color));
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 1.35;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center;
  transition:
    opacity 0.16s ease,
    transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-server-monitor-chart-point.is-good,
.settings-server-monitor-chart-hover-point.is-good {
  --server-monitor-point-color: #10B981;
}

.settings-server-monitor-chart-point.is-warning,
.settings-server-monitor-chart-hover-point.is-warning {
  --server-monitor-point-color: #F59E0B;
}

.settings-server-monitor-chart-point.is-danger,
.settings-server-monitor-chart-hover-point.is-danger {
  --server-monitor-point-color: #EF4444;
}

.settings-server-monitor-chart-shell.is-all-points-visible .settings-server-monitor-chart-point,
.settings-server-monitor-chart-shell.is-latest-point-only .settings-server-monitor-chart-point.is-latest,
.settings-server-monitor-chart-point.is-active {
  opacity: 1;
  transform: scale(1);
}

.settings-server-monitor-chart-point.is-active {
  transform: scale(1.12);
}

.settings-server-monitor-chart-hover-guide {
  stroke: rgba(148, 163, 184, 0.85);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
}

.settings-server-monitor-chart-hover-guide.is-visible {
  opacity: 1;
  visibility: visible;
}

.settings-server-monitor-chart-hover-point {
  fill: var(--server-monitor-point-color, var(--monitor-color));
  stroke: #ffffff;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.18));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.88);
}

.settings-server-monitor-chart-hover-point.is-visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

[data-server-monitor-chart-hitbox] {
  cursor: crosshair;
}

.settings-server-monitor-tooltip {
  position: absolute;
  z-index: 1;
  min-width: 132px;
  max-width: min(220px, calc(100% - 16px));
  padding: 12px 16px;
  border: 1px solid rgba(220, 230, 244, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  color: #475569;
  pointer-events: none;
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0s linear 0.15s;
}

.settings-server-monitor-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.settings-server-monitor-tooltip-line {
  font-size: 11px;
  line-height: 1.4;
}

.settings-server-monitor-tooltip-line + .settings-server-monitor-tooltip-line {
  margin-top: 3px;
}

.settings-server-monitor-tooltip-line.is-time {
  color: #98a2b3;
  font-size: 10px;
  line-height: 1.35;
}

.settings-server-monitor-tooltip-line.is-strong {
  color: #0f172a;
  font-weight: 800;
}

.settings-server-monitor-tooltip-line.is-value {
  font-size: 13px;
  line-height: 1.3;
}

.settings-server-monitor-tooltip-line.is-detail {
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

.settings-server-monitor-chart-area.is-animating-in {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .settings-server-monitor-chart-area,
  .settings-server-monitor-chart-line,
  .settings-server-monitor-chart-point,
  .settings-server-monitor-chart-hover-guide,
  .settings-server-monitor-chart-hover-point,
  .settings-server-monitor-tooltip {
    transition: none !important;
  }
}

.settings-server-monitor-chart-empty {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.settings-server-monitor-card-foot {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.settings-monitor-event-side {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.settings-monitor-route {
  max-width: 260px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-monitor-bar-row {
  display: grid;
  gap: 8px;
}

.settings-monitor-bar-label {
  align-items: center;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.settings-placeholder-card {
  align-content: center;
}

.settings-placeholder-body {
  display: grid;
  gap: 8px;
  align-content: center;
  justify-items: start;
  min-height: 240px;
  padding: 8px 4px 4px;
}

.settings-placeholder-title {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
}

.settings-placeholder-copy {
  max-width: 520px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.6;
}

.settings-card .section-title {
  font-size: 19px;
}

.settings-card .section-note {
  max-width: 720px;
}

.settings-card .sidebar-kicker {
  margin-bottom: 6px;
}

.settings-dialogs-card .settings-dialogs-kicker {
  color: #279fef;
}

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

.settings-dialogs-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

.settings-dialogs-panel-head {
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-dialogs-panel-head .sidebar-section-title {
  margin: 0;
}

.settings-dialogs-panel-head-with-logo {
  gap: 8px;
}

.settings-dialogs-panel-logo {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #279fef;
  flex: 0 0 auto;
}

.settings-dialogs-panel-logo-svg {
  width: 22px;
  height: 22px;
  display: block;
}

.settings-dialogs-panel-logo.is-instagram {
  color: #e1306c;
}

.settings-dialogs-status-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(0, 1.15fr);
  gap: 8px 16px;
}

.settings-dialogs-status-label {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.settings-dialogs-status-value {
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.settings-dialogs-config-list {
  display: grid;
  gap: 8px;
}

.settings-dialogs-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.settings-dialogs-note {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.settings-dialogs-warning {
  margin-top: 2px;
}

.settings-dialogs-actions {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.settings-dialogs-channel-actions {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

.settings-dialogs-channel-actions .sidebar-section-title {
  margin: 0;
}

.settings-dialogs-inline-link {
  justify-self: start;
}

.settings-dialogs-auth-options {
  display: grid;
  gap: 12px;
}

.settings-dialogs-auth-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-dialogs-qr-option-copy {
  display: grid;
  gap: 4px;
  min-width: min(100%, 360px);
}

.settings-dialogs-qr-option-copy strong {
  color: #0f172a;
  font-size: 14px;
}

.settings-dialogs-qr-option-copy span {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.settings-dialogs-auth-form label {
  min-width: min(100%, 320px);
}

.settings-dialogs-auth-form input[type="text"],
.settings-dialogs-auth-form input[type="password"] {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid #d8dee8;
  background: #fff;
  color: var(--text);
  padding: 8px 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.settings-dialogs-auth-form input[type="text"]:focus,
.settings-dialogs-auth-form input[type="password"]:focus {
  outline: none;
  border-color: rgba(31, 111, 214, 0.48);
  box-shadow: 0 0 0 3px rgba(31, 111, 214, 0.08);
}

.settings-dialogs-inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-dialogs-caution-btn {
  border-color: rgba(207, 63, 91, 0.22);
  background: rgba(207, 63, 91, 0.08);
  color: #b23a53;
}

.settings-dialogs-caution-btn:hover,
.settings-dialogs-caution-btn:focus-visible {
  border-color: rgba(207, 63, 91, 0.34);
  background: rgba(207, 63, 91, 0.12);
  color: #9f334a;
}

.settings-dialogs-qr-shell {
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.94), rgba(255, 255, 255, 0.98));
}

.settings-dialogs-qr-card {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.settings-dialogs-qr-frame {
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #d8dee8;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.88);
}

.settings-dialogs-qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.settings-dialogs-qr-fallback {
  color: #94a3b8;
  font-size: 14px;
  text-align: center;
}

.settings-dialogs-qr-copy {
  display: grid;
  gap: 8px;
  max-width: 520px;
}

.settings-dialogs-qr-title {
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
}

.settings-dialogs-qr-note,
.settings-dialogs-qr-meta {
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
}

.dialogs-page {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px 16px;
}

.dialogs-workspace {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  gap: 14px;
  overflow: hidden;
}

.dialogs-placeholder-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.dialogs-placeholder-card {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  padding: 34px 30px;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  box-shadow: 0 18px 48px -30px rgba(15, 23, 42, 0.18);
}

.dialogs-placeholder-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: rgba(31, 111, 214, 0.08);
  font-size: 34px;
}

.dialogs-placeholder-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  color: #0f172a;
}

.dialogs-placeholder-copy {
  margin: 0;
  max-width: 460px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.65;
}

.dialogs-placeholder-cta {
  min-width: 220px;
}

.dialogs-inbox-column,
.dialogs-thread-column {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  overflow: hidden;
}

.dialogs-inbox-column {
  flex: 0 0 340px;
}

.dialogs-thread-column {
  flex: 1 1 auto;
  min-width: 0;
}

.dialogs-inbox-head {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
}

.dialogs-search-form input[type="text"] {
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid #d8dee8;
  background: #fff;
  color: var(--text);
  padding: 0 40px 0 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.dialogs-search-form input[type="text"]:focus {
  outline: none;
  border-color: rgba(31, 111, 214, 0.5);
  box-shadow: 0 0 0 3px rgba(31, 111, 214, 0.08);
}

.dialogs-inbox-results {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-top: 1px solid #e2e8f0;
}

.dialogs-filter-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  flex: 0 0 auto;
  padding: 10px 14px 8px;
  background: rgba(255, 255, 255, 0.95);
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.dialogs-filter-strip::-webkit-scrollbar {
  display: none;
}

.dialogs-filter-chip {
  --tag-chip-bg: #fff;
  --tag-chip-border: #d8dee8;
  --tag-chip-text: #475569;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--tag-chip-border);
  border-radius: 999px;
  background: var(--tag-chip-bg);
  color: var(--tag-chip-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.dialogs-filter-chip:hover {
  border-color: rgba(31, 111, 214, 0.24);
  color: #0f172a;
}

.dialogs-filter-chip.is-active {
  background: color-mix(in srgb, var(--tag-chip-bg) 72%, rgba(31, 111, 214, 0.08));
  border-color: color-mix(in srgb, var(--tag-chip-border) 80%, rgba(31, 111, 214, 0.22));
  color: color-mix(in srgb, var(--tag-chip-text) 82%, var(--primary));
  box-shadow: inset 0 0 0 1px rgba(31, 111, 214, 0.06);
}

.dialogs-filter-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.dialogs-inbox-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 8px 10px;
  scrollbar-width: thin;
}

.dialogs-chat-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.dialogs-chat-row:hover {
  background: rgba(31, 111, 214, 0.05);
}

.dialogs-chat-row.is-active {
  background: rgba(31, 111, 214, 0.1);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 214, 0.16);
}

.dialogs-chat-row.is-active:hover {
  background: rgba(31, 111, 214, 0.1);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 214, 0.16);
}

.dialogs-chat-row.is-pending-switch {
  background: rgba(31, 111, 214, 0.06);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 214, 0.1);
}

.dialogs-chat-row.is-pending-switch:hover {
  background: rgba(31, 111, 214, 0.08);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 214, 0.12);
}

.dialogs-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  background: var(--avatar-bg, var(--primary));
  box-shadow: inset 0 -6px 12px rgba(255, 255, 255, 0.12);
}

.dialogs-avatar.is-large {
  width: 52px;
  height: 52px;
  font-size: 17px;
}

.dialogs-chat-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.dialogs-chat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dialogs-chat-title {
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dialogs-chat-time {
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.dialogs-chat-meta,
.dialogs-chat-preview {
  min-width: 0;
  color: #64748b;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dialogs-chat-preview {
  color: #475569;
  line-height: 1.35;
}

.dialogs-chat-preview.is-match {
  color: #334155;
}

.dialogs-chat-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 20px;
}

.dialogs-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--brand-coral), var(--brand-coral-strong));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.dialogs-list-empty,
.dialogs-thread-empty {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
}

.dialogs-list-empty-emoji,
.dialogs-thread-empty-icon {
  font-size: 32px;
}

.dialogs-list-empty-title,
.dialogs-thread-empty-title {
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
}

.dialogs-list-empty-copy,
.dialogs-thread-empty-copy {
  max-width: 360px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.55;
}

.dialogs-thread-head {
  flex: 0 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.dialogs-thread-persona {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.dialogs-thread-persona-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dialogs-thread-title {
  min-width: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dialogs-thread-subtitle {
  color: #64748b;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dialogs-thread-head-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.dialogs-thread-statuses {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.dialogs-thread-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #d8e4f3;
  border-radius: 12px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.dialogs-thread-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}

.dialogs-thread-action-btn:hover,
.dialogs-thread-action-btn:focus-visible {
  border-color: rgba(31, 111, 214, 0.2);
  background: #f8fbff;
  color: #1f4f93;
}

.dialogs-thread-action-btn.is-pending,
.dialogs-thread-action-btn:disabled {
  cursor: wait;
  opacity: 0.72;
}

.dialogs-thread-action-btn.is-pending .dialogs-thread-action-icon {
  animation: dialogs-thread-action-spin 1.2s linear infinite;
}

@keyframes dialogs-thread-action-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.dialogs-connector-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.dialogs-connector-badge.is-success {
  background: rgba(16, 165, 109, 0.12);
  color: #0f9d67;
}

.dialogs-connector-badge.is-warning {
  background: rgba(211, 139, 31, 0.14);
  color: #b7791f;
}

.dialogs-connector-badge.is-danger {
  background: rgba(207, 63, 91, 0.12);
  color: #be3754;
}

.dialogs-thread-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 18px;
  background:
    radial-gradient(circle at top left, rgba(31, 111, 214, 0.04), transparent 28%),
    linear-gradient(180deg, #f8fafc, #f6f8fb);
  scrollbar-width: thin;
}

.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.delayed-tooltip {
  position: fixed;
  z-index: 1200;
  max-width: 220px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 16px 32px -24px rgba(15, 23, 42, 0.55);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.delayed-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dialogs-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dialogs-search-input-shell {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

.dialogs-search-row input {
  flex: 1 1 auto;
}

.dialogs-search-clear {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #64748b;
  cursor: pointer;
  padding: 0;
  transition: background 0.16s ease, color 0.16s ease;
}

.dialogs-search-clear:hover,
.dialogs-search-clear:focus-visible {
  background: rgba(100, 116, 139, 0.18);
  color: #334155;
}

.dialogs-search-clear-icon {
  width: 12px;
  height: 12px;
}

.dialogs-search-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.dialogs-search-mode-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #f8fafc;
  border: 1px solid #d8dee8;
  color: #64748b;
  line-height: 1;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.dialogs-search-mode-btn.is-active {
  background: #fff2ee;
  color: #8a4b3d;
  border-color: rgba(232, 126, 101, 0.28);
  box-shadow: 0 8px 18px -18px rgba(232, 126, 101, 0.28);
}

.dialogs-search-mode-btn:hover,
.dialogs-search-mode-btn:focus-visible {
  color: #0f172a;
  border-color: rgba(31, 111, 214, 0.2);
  transform: translateY(-1px);
}

.dialogs-search-mode-icon {
  width: 15px;
  height: 15px;
}

.dialogs-search-feedback {
  min-height: 16px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.dialogs-search-feedback.is-pending {
  color: #4b5563;
}

.dialogs-search-feedback.is-validation {
  color: #b7791f;
}

.dialogs-search-feedback-spinner {
  width: 10px;
  height: 10px;
  border: 1.6px solid rgba(100, 116, 139, 0.26);
  border-top-color: #64748b;
  border-radius: 999px;
  animation: dialogs-spin 0.8s linear infinite;
}

@keyframes dialogs-spin {
  to {
    transform: rotate(360deg);
  }
}

.dialogs-message {
  display: flex;
  margin-bottom: 16px;
}

.dialogs-thread-window-control {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.dialogs-thread-window-btn {
  border: 1px solid #d8e4f3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #1f4f93;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.dialogs-thread-window-btn:hover,
.dialogs-thread-window-btn:focus-visible {
  border-color: rgba(31, 111, 214, 0.24);
  background: rgba(239, 246, 255, 0.92);
}

.dialogs-day-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.dialogs-day-divider::before,
.dialogs-day-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(148, 163, 184, 0.22);
}

.dialogs-day-divider span {
  white-space: nowrap;
}

.dialogs-message:last-child {
  margin-bottom: 0;
}

.dialogs-message.is-highlighted .dialogs-message-bubble {
  box-shadow:
    0 0 0 3px rgba(255, 143, 128, 0.18),
    0 14px 30px -24px rgba(255, 143, 128, 0.45);
}

.dialogs-message-inbound {
  justify-content: flex-start;
}

.dialogs-message-outbound {
  justify-content: flex-end;
}

.dialogs-message-bubble {
  max-width: min(72%, 760px);
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  box-shadow: 0 8px 24px -24px rgba(15, 23, 42, 0.25);
}

.dialogs-message-reply-preview {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 0;
  border-left: 3px solid rgba(31, 111, 214, 0.22);
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.12);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.dialogs-message-reply-preview.is-unresolved,
.dialogs-message-reply-preview:disabled {
  opacity: 0.76;
  cursor: default;
}

.dialogs-message-reply-sender {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.dialogs-message-reply-excerpt {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  opacity: 0.86;
}

.dialogs-message-inbound .dialogs-message-bubble {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top-left-radius: 8px;
}

.dialogs-message-outbound .dialogs-message-bubble {
  color: #fff;
  background: linear-gradient(120deg, #ff8d77, #ffa08a);
  border-top-right-radius: 8px;
}

.dialogs-message-outbound .dialogs-message-reply-preview {
  background: rgba(255, 255, 255, 0.14);
  border-left-color: rgba(255, 255, 255, 0.34);
}

.dialogs-message-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.55;
}

.dialogs-message-tombstone {
  font-size: 14px;
  font-weight: 700;
  opacity: 0.8;
}

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

.dialogs-media-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  text-decoration: none;
}

.dialogs-message-outbound .dialogs-media-card {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.dialogs-media-card.is-pending,
.dialogs-media-card.is-failed {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.dialogs-media-card.is-failed {
  border-color: rgba(190, 55, 84, 0.22);
}

.dialogs-media-image-card {
  padding: 8px;
}

.dialogs-media-image-card img {
  display: block;
  width: auto;
  max-width: min(100%, 360px);
  max-height: 320px;
  border-radius: 12px;
  object-fit: cover;
}

.dialogs-media-video-card video,
.dialogs-media-audio-card audio {
  width: min(100%, 360px);
  max-width: min(100%, 360px);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.1);
}

.dialogs-media-audio-card {
  display: block;
  width: 420px;
  min-width: 420px;
  max-width: min(100%, 520px);
}

.dialogs-media-audio-card audio {
  display: block;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 720px) {
  .dialogs-media-audio-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}

.dialogs-media-file-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.dialogs-media-redownload-btn {
  margin-top: 6px;
  border: 1px solid rgba(31, 111, 214, 0.18);
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.92);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 6px 10px;
  cursor: pointer;
}

.dialogs-media-redownload-btn:hover,
.dialogs-media-redownload-btn:focus-visible {
  background: rgba(219, 234, 254, 0.96);
}

.dialogs-media-redownload-btn:disabled {
  cursor: wait;
  opacity: 0.72;
}

.dialogs-media-file-icon {
  font-size: 18px;
  line-height: 1;
}

.dialogs-media-file-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dialogs-media-file-copy strong,
.dialogs-media-card-meta {
  font-size: 13px;
  font-weight: 700;
}

.dialogs-media-file-copy small,
.dialogs-media-card-meta {
  color: inherit;
  opacity: 0.8;
}

.dialogs-media-card-meta {
  font-size: 12px;
  font-weight: 600;
}

.dialogs-message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dialogs-message-reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.dialogs-message-outbound .dialogs-message-reaction {
  background: rgba(255, 255, 255, 0.16);
}

.dialogs-message-reaction.is-external-selected {
  box-shadow: inset 0 0 0 1px rgba(31, 111, 214, 0.18);
}

.dialogs-message-reaction.is-operator-selected {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.dialogs-message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.88;
}

.dialogs-message-outbound .dialogs-message-meta {
  color: rgba(255, 255, 255, 0.82);
}

.dialogs-message-sender {
  font-weight: 600;
}

.dialogs-message-time {
  opacity: 0.88;
  cursor: help;
}

.dialogs-message-source,
.dialogs-message-edited {
  opacity: 0.84;
}

.dialogs-message-delivery-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  min-height: 14px;
  line-height: 1;
  color: #94a3b8;
  cursor: help;
}

.dialogs-message-outbound .dialogs-message-delivery-icon {
  color: rgba(255, 255, 255, 0.88);
}

.dialogs-message-action {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.82;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.dialogs-message-action:hover,
.dialogs-message-action:focus-visible {
  opacity: 1;
}

.dialogs-message-delivery-icon::before {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.dialogs-message-delivery-icon.is-clock::before {
  content: "◔";
}

.dialogs-message-delivery-icon.is-check::before {
  content: "✓";
}

.dialogs-message-delivery-icon.is-double-check::before {
  content: "✓✓";
  letter-spacing: -1px;
}

.dialogs-message-delivery-icon.is-warning::before {
  content: "!";
}

.dialogs-message-delivery-icon.is-state-failed {
  color: #be3754;
}

.dialogs-message-error {
  color: #7f1d1d;
  font-size: 12px;
  font-weight: 700;
}

.dialogs-composer-wrap {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  padding: 14px 18px 16px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.dialogs-composer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dialogs-composer-input-shell {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 56px;
  border: 1px solid #d7e0eb;
  border-radius: 20px;
  background: #fff;
  padding: 8px 52px 8px 18px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.dialogs-composer-input-shell:focus-within {
  border-color: rgba(31, 111, 214, 0.38);
  box-shadow: 0 0 0 3px rgba(31, 111, 214, 0.08);
}

.dialogs-composer-reply {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  margin-bottom: 4px;
  padding: 8px 10px;
  border-left: 3px solid rgba(255, 143, 128, 0.48);
  border-radius: 12px;
  background: #fff5f2;
}

.dialogs-composer-reply[hidden] {
  display: none;
}

.dialogs-composer-reply-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
}

.dialogs-composer-reply-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f97360;
}

.dialogs-composer-reply-copy strong,
.dialogs-composer-reply-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialogs-composer-reply-copy strong {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.dialogs-composer-reply-copy span {
  font-size: 12px;
  color: #64748b;
}

.dialogs-composer-reply-clear {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.dialogs-attachment-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: min(100%, 420px);
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid #d8dee8;
  background: #f8fafc;
  color: #334155;
}

.dialogs-attachment-chip[hidden] {
  display: none;
}

.dialogs-attachment-chip.is-pending {
  border-color: rgba(211, 139, 31, 0.24);
  background: rgba(252, 246, 229, 0.9);
}

.dialogs-attachment-chip.is-error {
  border-color: rgba(190, 24, 93, 0.24);
  background: rgba(255, 241, 242, 0.92);
  color: #9f1239;
}

.dialogs-attachment-chip.is-error .dialogs-attachment-chip-copy small,
.dialogs-attachment-chip.is-error .dialogs-attachment-chip-clear {
  color: #be123c;
}

.dialogs-attachment-chip-icon {
  font-size: 16px;
  line-height: 1;
}

.dialogs-attachment-chip-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dialogs-attachment-chip-copy strong,
.dialogs-attachment-chip-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialogs-attachment-chip-copy strong {
  font-size: 13px;
  font-weight: 700;
}

.dialogs-attachment-chip-copy small {
  color: #64748b;
  font-size: 12px;
}

.dialogs-attachment-chip-clear {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  min-width: 20px;
  min-height: 20px;
}

.dialogs-attachment-btn {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #d8dee8;
  background: #fff;
  color: #475569;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.dialogs-attachment-btn:hover {
  background: #f8fafc;
  border-color: #c8d4e3;
  color: #0f172a;
}

.dialogs-attachment-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dialogs-attachment-icon {
  width: 18px;
  height: 18px;
}

.dialogs-emoji-btn,
.dialogs-send-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.dialogs-emoji-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.dialogs-emoji-btn:hover,
.dialogs-emoji-btn:focus-visible {
  background: #f8fafc;
  color: #ff8f80;
}

.dialogs-emoji-icon,
.dialogs-send-icon {
  width: 20px;
  height: 20px;
}

.dialogs-emoji-picker {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 20;
  width: min(272px, calc(100vw - 48px));
  padding: 12px;
  border-radius: 18px;
  border: 1px solid #dde7f1;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(10px);
}

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

.dialogs-emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.dialogs-emoji-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 38px;
  border: none;
  border-radius: 12px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.dialogs-emoji-option:hover,
.dialogs-emoji-option:focus-visible {
  background: #f8fafc;
  transform: translateY(-1px);
}

.dialogs-composer textarea {
  flex: 1 1 auto;
  width: 100%;
  min-height: 44px;
  max-height: 220px;
  resize: none;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 8px 0;
  line-height: 1.5;
  transition: color 0.16s ease;
}

.dialogs-composer textarea:focus {
  outline: none;
}

.dialogs-send-btn {
  width: 46px;
  height: 46px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #ff8f80, #ff6b57);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(255, 107, 87, 0.18);
}

.dialogs-send-btn:hover,
.dialogs-send-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(255, 107, 87, 0.22);
}

.dialogs-send-btn:disabled {
  background: #edf2f7;
  color: #a0aec0;
  box-shadow: none;
  cursor: default;
  transform: none;
}

.dialogs-composer-note {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.dialogs-sidebar-section {
  gap: 12px;
}

.dialogs-sidebar-section + .dialogs-sidebar-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.dialogs-sidebar-card {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.dialogs-client-card {
  gap: 0;
}

.dialogs-client-summary {
  min-width: 0;
}

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

.dialogs-client-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dialogs-profile-label {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dialogs-profile-value {
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialogs-profile-value-notes {
  white-space: pre-line;
}

.dialogs-profile-edit-form {
  display: grid;
  gap: 14px;
}

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

.dialogs-profile-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.dialogs-profile-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.dialogs-profile-field-head > span:first-child {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.dialogs-profile-field-status {
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  color: #16a34a;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.dialogs-profile-field-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dialogs-profile-field-status.is-saving {
  color: #64748b;
}

.dialogs-profile-field-status.is-error {
  color: #c2410c;
}

.dialogs-profile-field input,
.dialogs-profile-field textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #e2e8f0;
  color: #0f172a;
  padding: 10px 12px;
  font: inherit;
  line-height: 1.5;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.dialogs-profile-field input[readonly] {
  background: #f1f5f9;
  color: #64748b;
}

.dialogs-profile-field textarea {
  resize: vertical;
  min-height: 128px;
}

.dialogs-profile-field input:focus,
.dialogs-profile-field textarea:focus {
  outline: none;
  background: #fff;
  border-color: rgba(31, 111, 214, 0.42);
  box-shadow: 0 0 0 3px rgba(31, 111, 214, 0.08);
}

.dialogs-client-tags-section {
  gap: 16px;
}

.dialogs-client-tags-head {
  display: block;
  margin-bottom: 12px;
}

.dialogs-client-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 8px;
  margin-bottom: 16px;
}

.dialogs-client-tags-empty {
  color: #64748b;
  font-size: 13px;
}

.dialogs-client-tag-chip {
  --tag-bg: #dff1ff;
  --tag-border: #b8ddf8;
  --tag-text: #215d86;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  max-width: 100%;
  padding: 6px 6px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  color: var(--tag-text);
}

button.dialogs-client-tag-chip {
  cursor: pointer;
}

.dialogs-client-tag-chip.is-system {
  padding-right: 10px;
}

.dialogs-client-tag-chip.is-addable {
  padding-right: 12px;
  border-style: dashed;
  background: color-mix(in srgb, var(--tag-bg) 62%, #ffffff);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.dialogs-client-tag-chip.is-addable:hover,
.dialogs-client-tag-chip.is-addable:focus-visible {
  border-color: color-mix(in srgb, var(--tag-border) 78%, #94a3b8);
  background: color-mix(in srgb, var(--tag-bg) 74%, #ffffff);
  transform: translateY(-1px);
}

.dialogs-client-tag-chip-label {
  font-size: 12px;
  font-weight: 700;
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialogs-client-tag-chip-add-mark {
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
}

.dialogs-client-tag-chip-action {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: inherit;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.72;
  transition: opacity 0.16s ease, background-color 0.16s ease;
}

.dialogs-client-tag-chip-action:hover,
.dialogs-client-tag-chip-action:focus-visible {
  background: rgba(255, 255, 255, 0.42);
  opacity: 1;
}

.dialogs-client-tag-chip-menu-toggle {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: inherit;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.72;
  transition: opacity 0.16s ease, background-color 0.16s ease;
}

.dialogs-client-tag-chip-menu-toggle:hover,
.dialogs-client-tag-chip-menu-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.42);
  opacity: 1;
}

.dialogs-tag-chip-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  display: grid;
  min-width: 140px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border: 1px solid #dbe5f0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(10px);
}

.dialogs-tag-chip-menu[data-placement="top"] {
  transform-origin: bottom right;
}

.dialogs-tag-chip-menu[data-placement="bottom"] {
  transform-origin: top right;
}

.dialogs-tag-chip-menu[hidden] {
  display: none;
}

.dialogs-tag-chip-menu-action {
  border: none;
  background: transparent;
  color: #0f172a;
  text-align: left;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.dialogs-tag-chip-menu-action:hover,
.dialogs-tag-chip-menu-action:focus-visible {
  background: #f8fafc;
}

.dialogs-tag-chip-menu-action.is-danger {
  color: #b45309;
}

.dialogs-tag-combobox {
  display: grid;
  gap: 14px;
  padding: 0;
}

.dialogs-tag-combobox-field {
  gap: 0;
}

.dialogs-tag-combobox-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 0 10px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.dialogs-tag-combobox-input-wrap:focus-within {
  border-color: rgba(31, 111, 214, 0.42);
  box-shadow: 0 0 0 3px rgba(31, 111, 214, 0.08);
}

.dialogs-tag-combobox-field input {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 10px 0;
}

.dialogs-tag-combobox-field input:focus {
  border: none;
  box-shadow: none;
}

.dialogs-tag-editor-close {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.dialogs-tag-editor-close[hidden] {
  display: none;
}

.dialogs-tag-editor-close:hover,
.dialogs-tag-editor-close:focus-visible {
  background: #eef2f7;
  color: #475569;
}

.dialogs-tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dialogs-tag-suggestions[hidden] {
  display: none;
}

.dialogs-tag-suggestion {
  display: inline-flex;
  align-items: center;
  border: none;
  border-radius: 999px;
  background: transparent;
  padding: 0;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.dialogs-tag-suggestion:hover,
.dialogs-tag-suggestion:focus-visible {
  background: transparent;
}

.dialogs-tag-suggestion-pill {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 12px;
  font-weight: 700;
}

.dialogs-tag-suggestion-empty,
.dialogs-tag-suggestion-hint {
  color: #94a3b8;
  font-size: 12px;
}

.dialogs-tag-combobox .dialogs-tag-color-group {
  display: grid;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 12px;
}

.dialogs-tag-color-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 0;
}

.dialogs-tag-color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dialogs-tag-color-option {
  --tag-bg: #dff1ff;
  --tag-border: #b8ddf8;
  --tag-text: #215d86;
  position: relative;
  display: inline-flex;
}

.dialogs-tag-color-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dialogs-tag-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1.5px solid var(--tag-border);
  background: var(--tag-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  cursor: pointer;
}

.dialogs-tag-color-option input:checked + .dialogs-tag-color-swatch {
  transform: scale(1.04);
  border-color: color-mix(in srgb, var(--tag-text) 56%, #ffffff);
  box-shadow: 0 0 0 1.5px rgba(15, 23, 42, 0.08);
}

.dialogs-tag-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.dialogs-tag-modal[hidden] {
  display: none;
}

.dialogs-tag-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
}

.dialogs-tag-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(360px, calc(100vw - 32px));
  margin: 12vh auto 0;
  padding: 22px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
}

.dialogs-tag-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.dialogs-tag-modal-title {
  color: #0f172a;
  font-size: 16px;
  font-weight: 700;
}

.dialogs-tag-modal-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
}

.dialogs-tag-modal-close:hover,
.dialogs-tag-modal-close:focus-visible {
  background: #eef2f7;
  color: #0f172a;
}

.dialogs-tag-modal-form,
.dialogs-tag-modal-confirm {
  display: grid;
  gap: 18px;
}

.dialogs-tag-modal-field {
  gap: 8px;
}

.dialogs-tag-modal-copy {
  color: #334155;
  font-size: 14px;
  line-height: 1.6;
}

.dialogs-tag-modal-copy strong {
  color: #0f172a;
  font-weight: 700;
}

.dialogs-tag-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  padding-top: 2px;
}

.dialogs-tag-modal-actions .btn {
  min-height: 40px;
  padding: 0 16px;
}

.dialogs-tag-modal-actions .btn-light {
  background: #f8fafc;
  border-color: #dbe5f0;
  color: #334155;
}

.dialogs-tag-modal-danger-btn {
  background: linear-gradient(120deg, #ef4444, #dc2626);
  border-color: transparent;
  color: #fff;
}

.dialogs-linked-client-card {
  padding: 14px;
  border-top: none;
  border-radius: 14px;
  background: #f5f9ff;
  box-shadow: inset 0 0 0 1px #d8e6fb;
}

.dialogs-linked-client-card .sidebar-section-title {
  color: #60748d;
}

.dialogs-linked-client-name {
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
}

.dialogs-linked-client-meta {
  color: #64748b;
  font-size: 13px;
}

.dialogs-linked-client-action {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.dialogs-linked-client-action:hover {
  color: var(--primary-strong);
}

.dialogs-sidebar-empty {
  min-height: 220px;
  justify-content: flex-start;
}

@media (max-width: 1240px) {
  .settings-card-top,
  .settings-create-footer,
  .settings-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-summary-strip {
    justify-content: flex-start;
  }

  .settings-users-head,
  .settings-user-row {
    grid-template-columns: minmax(220px, 1.4fr) minmax(160px, 1fr) 130px 170px;
  }

  .settings-audit-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .settings-payroll-grid {
    grid-template-columns: 1fr;
  }

  .settings-payroll-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .settings-monitoring-overview,
  .settings-monitor-phase-grid,
  .settings-monitor-metric-list,
  .settings-server-monitor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-monitor-run-list.is-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-monitor-sync-grid,
  .settings-monitor-audit-grid,
  .settings-monitor-duo,
  .settings-monitor-secondary-layout,
  .settings-monitor-critical {
    grid-template-columns: 1fr;
  }

  .settings-monitor-secondary-layout {
    grid-template-areas: none;
  }

  .settings-monitor-secondary-auth,
  .settings-monitor-secondary-audit,
  .settings-monitor-secondary-reporting {
    grid-area: auto;
  }

  .settings-dialogs-grid {
    grid-template-columns: 1fr;
  }

  .dialogs-inbox-column {
    flex-basis: 300px;
  }
}

@media (max-width: 960px) {
  .login-shell {
    flex-direction: column;
  }

  .login-brand-panel {
    width: 100vw;
    min-height: 34vh;
    box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.18);
  }

  .login-page.login-loaded .login-brand-panel {
    width: 100vw;
  }

  .login-form-panel {
    width: 100vw;
    flex: 1 1 auto;
    padding: 24px 18px 32px;
  }

  .login-brand-inner {
    width: min(88%, 520px);
  }

  .settings-page-scroll {
    padding-left: 14px;
    padding-right: 14px;
  }

  .settings-users-head {
    display: none;
  }

  .settings-user-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .settings-user-controls {
    justify-content: flex-start;
  }

  .settings-user-grid,
  .settings-user-grid-create {
    grid-template-columns: 1fr;
  }

  .settings-payroll-fields {
    grid-template-columns: 1fr;
  }

  .settings-monitoring-overview,
  .settings-monitor-mini-grid,
  .settings-monitor-phase-grid,
  .settings-monitor-metric-list,
  .settings-monitor-metric-list.is-compact,
  .settings-monitor-run-list.is-compact,
  .settings-server-monitor-grid {
    grid-template-columns: 1fr;
  }

  .settings-monitor-section-head,
  .settings-monitor-panel-head,
  .settings-monitor-subsection-head,
  .settings-server-monitor-card-head,
  .settings-monitor-run-item,
  .settings-monitor-event-item,
  .settings-monitor-bar-label {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-monitor-run-stats,
  .settings-monitor-event-side {
    justify-content: flex-start;
  }

  .settings-monitor-phase-row {
    grid-template-columns: 1fr;
  }

  .settings-monitor-phase-row-side {
    white-space: normal;
  }

  .settings-monitor-route {
    max-width: 100%;
  }

  .settings-server-monitor-toolbar,
  .settings-server-monitor-window {
    width: 100%;
  }

  .settings-server-monitor-window {
    justify-content: space-between;
  }

  .settings-monitor-sparkline {
    min-height: 116px;
    gap: 6px;
  }

  .settings-monitor-sparkline.is-compact {
    min-height: 84px;
  }

  .settings-user-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-modal {
    padding: 14px;
  }

  .settings-modal-dialog {
    width: min(100vw - 12px, 720px);
    padding: 18px;
  }

  .settings-audit-filters {
    grid-template-columns: 1fr;
  }

  .settings-audit-filter-actions {
    justify-content: stretch;
  }

  .settings-audit-filter-actions .btn {
    flex: 1 1 0;
  }

  .settings-submit-btn {
    width: 100%;
  }

  .settings-dialogs-status-grid,
  .dialogs-profile-grid {
    grid-template-columns: 1fr;
  }

  .settings-dialogs-auth-form {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-dialogs-auth-form label,
  .settings-dialogs-auth-form .btn {
    width: 100%;
  }

  .dialogs-page {
    padding: 10px;
  }

  .dialogs-workspace {
    flex-direction: column;
  }

  .dialogs-inbox-column,
  .dialogs-thread-column {
    flex-basis: auto;
  }

  .dialogs-inbox-column {
    min-height: 280px;
  }

  .dialogs-thread-column {
    min-height: 420px;
  }

  .dialogs-thread-head {
    flex-direction: column;
    align-items: stretch;
  }

  .dialogs-search-row,
  .dialogs-client-tags-head,
  .dialogs-tag-editor-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .dialogs-connector-badge {
    align-self: flex-start;
  }

  .dialogs-message-bubble {
    max-width: 100%;
  }

  .dialogs-composer {
    align-items: flex-end;
  }

  .dialogs-composer-input-shell {
    min-height: 52px;
  }

  .dialogs-attachment-btn,
  .dialogs-send-btn {
    width: 42px;
    height: 42px;
  }
}
