:root {
  color-scheme: light;
  --bg: #ffffff;
  --sidebar: #f7f7f5;
  --sidebar-hover: rgba(55, 53, 47, 0.08);
  --sidebar-active: rgba(55, 53, 47, 0.11);
  --panel: #ffffff;
  --panel-muted: #fbfbfa;
  --border: #e8e8e6;
  --border-strong: #d9d9d6;
  --text: #37352f;
  --muted: #787774;
  --muted-2: #9b9a97;
  --accent: #2f6feb;
  --accent-soft: #edf4ff;
  --green: #2f7d4f;
  --green-soft: #edf7f1;
  --red: #d44c47;
  --red-soft: #fff1f0;
  --yellow: #a66f00;
  --yellow-soft: #fff7e6;
  --radius: 6px;
  --sidebar-width: 252px;
  --shadow-soft: 0 16px 40px rgba(15, 15, 15, 0.08);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

code {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  background: rgba(55, 53, 47, 0.08);
  border-radius: 4px;
  padding: 1px 4px;
}

i[data-lucide] {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
  flex: 0 0 auto;
}

.hidden {
  display: none !important;
}

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

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #ffffff;
}

.auth-panel {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

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

.brand-large {
  margin-bottom: 24px;
  align-items: flex-start;
}

.brand-mark,
.session-avatar,
.page-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-weight: 700;
}

.brand-mark {
  width: 28px;
  height: 28px;
  font-size: 0.88rem;
}

.brand-large .brand-mark {
  width: 34px;
  height: 34px;
}

.brand h1,
.card-header h2,
.card-header h3,
.page-heading h3,
.topbar h2 {
  margin: 0;
  font-weight: 650;
  letter-spacing: 0;
}

.brand h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
}

.brand-large h1 {
  font-size: 1.45rem;
}

.workspace-label,
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-header {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.card-header p,
.hint,
.setup-list {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 14px;
}

.row {
  display: flex;
  align-items: center;
}

.gap-sm {
  gap: 8px;
}

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

.fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.field > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.field input,
.field select,
.field textarea,
.search input,
.select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

.field input,
.field select,
.select {
  height: 34px;
  padding: 6px 10px;
}

.field textarea {
  min-height: 160px;
  resize: vertical;
  padding: 9px 10px;
  line-height: 1.45;
}

.field input::placeholder,
.field textarea::placeholder,
.search input::placeholder {
  color: var(--muted-2);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search input:focus,
.select:focus {
  border-color: rgba(47, 111, 235, 0.55);
  box-shadow: 0 0 0 2px rgba(47, 111, 235, 0.12);
}

.button,
.icon-button,
.nav-item,
.tab,
.view-chip {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius);
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.88rem;
  transition:
    background 120ms ease,
    color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.button:hover,
.button:focus-visible {
  background: var(--sidebar-hover);
  outline: none;
}

.primary {
  background: var(--text);
  color: #ffffff;
}

.primary:hover,
.primary:focus-visible {
  background: #1f1e1a;
}

.ghost,
.subtle {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}

.subtle {
  color: var(--muted);
}

.danger {
  color: var(--red);
  border: 1px solid transparent;
  background: var(--red-soft);
}

.danger:hover,
.danger:focus-visible,
.button-danger-soft:hover,
.button-danger-soft:focus-visible {
  color: var(--red);
  background: #ffe6e4;
}

.auth-actions {
  justify-content: flex-end;
  margin-top: 4px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 10px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 2px 4px 8px;
}

.brand-copy {
  min-width: 0;
}

.icon-button {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius);
  color: var(--muted);
}

.icon-button:hover,
.icon-button:focus-visible {
  background: var(--sidebar-hover);
  color: var(--text);
  outline: none;
}

.sidebar-section {
  padding: 8px;
  border-radius: var(--radius);
}

.auth-state {
  display: grid;
  gap: 8px;
}

.session-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.session-avatar {
  width: 26px;
  height: 26px;
  font-size: 0.78rem;
  background: #f0f0ef;
}

.session-meta {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.session-meta strong,
.session-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-meta strong {
  font-size: 0.86rem;
  font-weight: 600;
}

.session-meta span {
  color: var(--muted);
  font-size: 0.74rem;
}

.profile-chip {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(55, 53, 47, 0.06);
  font-size: 0.72rem;
  font-weight: 600;
}

.profile-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.nav-item {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 8px;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: left;
  font-size: 0.88rem;
  transition:
    background 120ms ease,
    color 120ms ease;
}

.nav-item span:not(.badge) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item:hover,
.nav-item:focus-visible {
  background: var(--sidebar-hover);
  color: var(--text);
  outline: none;
}

.nav-item.active {
  color: var(--text);
  background: var(--sidebar-active);
}

.button-badge {
  position: relative;
}

#setup-card {
  margin-top: auto;
  border: 1px solid var(--border);
  background: #ffffff;
}

.setup-list {
  margin: 0;
  padding-left: 20px;
  font-size: 0.82rem;
  line-height: 1.55;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px 22px 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 4px 0 8px;
}

.topbar-title {
  min-width: 0;
  flex: 1 1 auto;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  color: var(--muted);
  font-size: 0.82rem;
}

.breadcrumbs i[data-lucide] {
  width: 14px;
  height: 14px;
}

.topbar-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.topbar h2 {
  margin-top: 0;
  font-size: 2rem;
  line-height: 1.15;
}

.topbar-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.topbar-title p:empty {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 1 560px;
  justify-content: flex-end;
  min-width: 0;
  margin-left: auto;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 240px;
  flex: 1 1 320px;
  color: var(--muted);
}

.client-sort-menu {
  position: relative;
  flex: 1 0 100%;
  display: flex;
  justify-content: flex-end;
}

.client-sort-button {
  min-height: 32px;
}

.client-sort-button.active {
  color: var(--text);
  background: var(--sidebar-hover);
  border-color: var(--border);
}

.client-sort-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(360px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

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

.client-sort-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.client-sort-grid input,
.client-sort-grid select {
  height: 32px;
  padding: 5px 8px;
  background: var(--panel-muted);
  font-size: 0.86rem;
}

.date-filter-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 6px;
}

.date-filter-clear {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: #ffffff;
}

.date-filter-clear:hover,
.date-filter-clear:focus-visible {
  color: var(--text);
  background: var(--sidebar-hover);
  outline: none;
}

.date-filter-clear i[data-lucide] {
  width: 14px;
  height: 14px;
}

.client-sort-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.search i[data-lucide] {
  position: absolute;
  left: 9px;
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.search input {
  height: 32px;
  padding: 5px 10px 5px 31px;
  background: var(--panel-muted);
  font-size: 0.88rem;
}

.tab-shell {
  min-width: 0;
  border-bottom: 1px solid var(--border);
}

.tab-strip {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  overflow-x: auto;
  padding: 0 0 0;
}

.tab {
  min-width: 0;
  max-width: 240px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  user-select: none;
  white-space: nowrap;
}

.tab .tab-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab:hover,
.tab:focus-visible {
  background: var(--sidebar-hover);
  outline: none;
}

.tab.active {
  color: var(--text);
  background: #ffffff;
  box-shadow: inset 0 -2px 0 var(--text);
}

.tab.dragging {
  opacity: 0.5;
}

.tab.drop-before {
  box-shadow: inset 2px 0 0 var(--accent);
}

.tab.drop-after {
  box-shadow: inset -2px 0 0 var(--accent);
}

.tab-close {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 4px;
  color: var(--muted-2);
  font-size: 1rem;
  line-height: 1;
}

.tab-close:hover {
  color: var(--text);
  background: rgba(55, 53, 47, 0.08);
}

.tab-dirty {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent);
}

.view-panel {
  min-width: 0;
}

#list-view {
  overflow-x: auto;
}

.database-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 10px;
}

.view-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.view-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.84rem;
}

.view-chip.active,
.view-chip:hover,
.view-chip:focus-visible {
  color: var(--text);
  background: var(--sidebar-hover);
  outline: none;
}

.view-chip.active {
  background: var(--panel);
  border: 1px solid var(--border);
}

.database-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.database-pagination {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}

.pagination-button {
  width: 28px;
  height: 28px;
}

.pagination-button:disabled {
  opacity: 0.38;
  pointer-events: none;
}

.pagination-text {
  min-width: 38px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.table-card {
  position: relative;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  border-radius: 0;
  border-right: 0;
  border-left: 0;
}

.database-list {
  display: grid;
  gap: 0;
  padding: 4px 0 0;
}

.database-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  transition: background 120ms ease;
  cursor: pointer;
}

.database-list-item:hover {
  background: rgba(55, 53, 47, 0.035);
}

.database-list-item.selected {
  background: rgba(47, 111, 235, 0.05);
}

.database-list-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.database-list-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.database-list-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.database-list-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.92rem;
  font-weight: 600;
}

.database-list-title span {
  color: var(--muted);
  font-size: 0.82rem;
}

.database-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.database-list-meta span {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--panel-muted);
}

.database-list-note {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.45;
  max-width: 72ch;
}

.database-list-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-top: 2px;
}

.list-call-button {
  width: 28px;
  height: 28px;
}

.list-call-button.is-disabled {
  pointer-events: none;
  opacity: 0.4;
}

.database-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding: 8px 2px 2px;
}

.board-column {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-muted);
  padding: 10px;
  min-height: 260px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.board-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.board-column-header strong {
  color: var(--muted);
  font-size: 0.9rem;
}

.board-column-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.board-card {
  border: 1px solid var(--border-strong);
  background: #ffffff;
  border-radius: 10px;
  min-height: 44px;
  padding: 10px 12px;
  text-align: left;
  font-size: 0.95rem;
  color: var(--text);
}

.board-card:hover,
.board-card:focus-visible {
  outline: none;
  border-color: #b8bcc6;
  background: #fcfcfc;
}

.board-empty {
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 0.82rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #ffffff;
}

.table-wrap {
  max-height: calc(100vh - 190px);
  overflow: auto;
}

.table-card.is-custom-sized .table-wrap {
  height: 100%;
  max-height: none;
  padding-bottom: 16px;
}

.table-size-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 4px 0 0 0;
  background:
    linear-gradient(135deg, transparent 0 45%, rgba(120, 119, 116, 0.7) 45% 52%, transparent 52%),
    linear-gradient(135deg, transparent 0 63%, rgba(120, 119, 116, 0.7) 63% 70%, transparent 70%);
  cursor: nwse-resize;
}

.table-size-handle:hover,
.table-size-handle:focus-visible {
  background-color: rgba(47, 111, 235, 0.08);
  outline: none;
}

body.table-resizing {
  cursor: nwse-resize !important;
  user-select: none;
}

.crm-table {
  width: 100%;
  min-width: 920px;
  table-layout: fixed;
  border-collapse: collapse;
  background: #ffffff;
}

.crm-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 34px;
  padding: 7px 28px 7px 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border-strong);
  background: var(--panel-muted);
  color: var(--muted);
  text-align: left;
  font-size: 0.76rem;
  font-weight: 550;
  white-space: normal;
  overflow-wrap: anywhere;
  position: relative;
}

.crm-table thead th:last-child,
.crm-table tbody td:last-child {
  border-right: 0;
}

.date-sort-toggle {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
}

.date-sort-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  color: var(--muted);
  font-size: 0.86rem;
  flex: 0 0 auto;
}

.date-sort-toggle:focus-visible {
  outline: 2px solid rgba(47, 111, 235, 0.22);
  outline-offset: 2px;
  border-radius: 4px;
}

.crm-table thead th.column-draggable {
  cursor: grab;
  user-select: none;
}

.crm-table thead th.column-draggable:active {
  cursor: grabbing;
}

.crm-table thead th.dragging {
  opacity: 0.55;
}

.crm-table thead th.drop-before {
  box-shadow: inset 3px 0 0 var(--accent);
}

.crm-table thead th.drop-after {
  box-shadow: inset -3px 0 0 var(--accent);
}

.crm-table tbody tr {
  transition: background 100ms ease;
}

.crm-table tbody tr:hover {
  background: rgba(55, 53, 47, 0.04);
}

.crm-table tbody tr.selected {
  background: rgba(47, 111, 235, 0.06);
}

.crm-table tbody td {
  height: 40px;
  padding: 8px 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  font-size: 0.88rem;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.crm-table.writer-hidden .writer-column {
  display: none;
}

.crm-table.writer-hidden col.writer-column {
  width: 0 !important;
}

.crm-table .column-hidden,
.crm-table col.column-hidden {
  display: none;
}

.crm-table col[data-column-key="note"] {
  width: auto;
}

.crm-table col[data-column-key="call"] {
  width: 52px;
}

.name-cell {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.name-cell strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 550;
}

.name-cell small,
.note-preview {
  color: var(--muted);
}

.note-preview {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.empty-row-message {
  display: table-cell;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  text-align: center;
}

.call-cell {
  text-align: center;
  white-space: nowrap;
}

.call-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
}

.call-button:hover,
.call-button:focus-visible {
  background: var(--sidebar-hover);
  color: var(--text);
  outline: none;
}

.call-button.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

.call-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge.ok {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(47, 125, 79, 0.16);
}

.badge.alert {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(212, 76, 71, 0.18);
}

.badge.mix {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(47, 111, 235, 0.16);
}

.badge.status-lead {
  color: #2d2d2d;
  background: #d9d9d9;
  border-color: #b8b8b8;
}

.badge.status-poszukiwanie {
  color: #6e5a2a;
  background: #efe1c3;
  border-color: #decc9f;
}

.badge.status-propozycja_powazna {
  color: #5f2a8e;
  background: #efe1ff;
  border-color: #dabef7;
}

.badge.status-propozycja {
  color: #2358c5;
  background: #e8f0ff;
  border-color: #c7dbff;
}

.badge.status-depozyt {
  color: #9a2d6c;
  background: #ffe3f2;
  border-color: #f7bddc;
}

.badge.status-sprzedane {
  color: #1f6b3f;
  background: #e7f7ec;
  border-color: #bfebcd;
}

.badge.status-stracone {
  color: #b3261e;
  background: #ffe8e7;
  border-color: #f6b8b5;
}

.badge.interest-bardzo_wysokie {
  color: #0f5f34;
  background: #dff7e8;
  border-color: #abe3bf;
}

.badge.interest-wysokie {
  color: #1f6b3f;
  background: #e7f7ec;
  border-color: #bfebcd;
}

.badge.interest-srednie {
  color: #6e5a2a;
  background: #fff3cf;
  border-color: #ead088;
}

.badge.interest-niskie {
  color: #955b12;
  background: #fff0dc;
  border-color: #efc38f;
}

.badge.interest-bardzo_niskie {
  color: #9f3a25;
  background: #ffe6dd;
  border-color: #f0b29e;
}

.badge.interest-zerowe {
  color: #6f2723;
  background: #ffe8e7;
  border-color: #f6b8b5;
}

.badge.permission-status-pending {
  color: #6e5a2a;
  background: #fff3cf;
  border-color: #ead088;
}

.badge.permission-status-approved {
  color: #1f6b3f;
  background: #e7f7ec;
  border-color: #bfebcd;
}

.badge.permission-status-rejected {
  color: #b3261e;
  background: #ffe8e7;
  border-color: #f6b8b5;
}

.badge-count {
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  color: #ffffff;
  background: var(--red);
  border-color: var(--red);
  font-size: 0.68rem;
}

.column-resizing,
.column-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.column-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.column-resizer::after {
  content: "";
  position: absolute;
  top: 20%;
  left: 50%;
  width: 1px;
  height: 60%;
  background: var(--border-strong);
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 120ms ease;
}

.crm-table thead th:hover .column-resizer::after,
.crm-table thead th:focus-within .column-resizer::after {
  opacity: 1;
}

.detail-card {
  width: min(100%, 940px);
  margin: 34px auto 0;
  padding: 0 0 40px;
  border: 0;
  background: transparent;
}

.settings-card {
  width: min(100%, 720px);
}

.notifications-card {
  width: min(100%, 860px);
}

.permissions-card {
  width: min(100%, 980px);
}

.ads-card {
  width: min(100%, 1080px);
}

.page-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.page-heading h3 {
  font-size: 1.8rem;
  line-height: 1.15;
}

.page-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-icon {
  width: 42px;
  height: 42px;
  background: var(--panel-muted);
}

.page-icon i[data-lucide] {
  width: 21px;
  height: 21px;
}

.client-form,
.settings-form {
  display: grid;
  gap: 18px;
}

.settings-section {
  display: grid;
  gap: 14px;
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.settings-section h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.settings-section p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.mfa-enroll-panel {
  display: grid;
  gap: 14px;
}

.mfa-qr-code {
  width: 180px;
  height: 180px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

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

.client-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.86fr);
  gap: 18px;
  align-items: start;
}

.client-main-column,
.client-side-column {
  min-width: 0;
}

.budget-delivery-row {
  display: flex;
  align-items: end;
  gap: 10px;
  min-width: 0;
}

.budget-field {
  flex: 0 0 150px;
}

.offer-check-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.6fr);
  gap: 10px;
  align-items: end;
}

.scheduled-contact-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.scheduled-contact-status.pending {
  border-color: #c9d8ff;
  background: var(--accent-soft);
  color: var(--accent);
}

.scheduled-contact-status.done {
  border-color: #c8e5d3;
  background: var(--green-soft);
  color: var(--green);
}

.scheduled-contact-status.due {
  border-color: #f0d6a2;
  background: var(--yellow-soft);
  color: var(--yellow);
}

.status-field {
  flex: 0 0 190px;
}

.delivery-field {
  flex: 1 1 auto;
  min-width: 0;
}

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

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

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

.check {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  font-size: 0.86rem;
}

.check:hover {
  background: var(--panel-muted);
}

.check input {
  width: 14px;
  height: 14px;
  accent-color: var(--text);
}

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

.delivery-grid {
  display: inline-grid;
  grid-template-columns: repeat(2, max-content);
  gap: 2px;
  width: fit-content;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
}

.delivery-grid .check {
  min-height: 28px;
  border: 0;
  background: transparent;
  padding: 4px 8px;
}

.delivery-grid .check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.delivery-grid .check.selected {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 15, 15, 0.08);
}

.sold-fields,
.auction-fields {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
}

.auction-fields-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.auction-fields-head .button {
  width: auto;
}

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

.auction-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.85fr) minmax(110px, 0.55fr) minmax(0, 1.2fr) 36px;
  gap: 10px;
  align-items: end;
}

.auction-remove-button {
  width: 36px;
  height: 36px;
  align-self: end;
}

.phone-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.phone-prefix-toggle {
  flex: 0 0 auto;
  min-width: 48px;
}

.phone-prefix-toggle[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(47, 111, 235, 0.22);
}

.phone-prefix {
  flex: 0 0 72px;
  width: 72px;
  min-width: 72px;
  text-align: center;
}

#phone-number {
  flex: 1 1 180px;
}

.phone-row.phone-row-other #phone-number {
  flex-basis: 220px;
}

.duplicate-warning,
.phone-incomplete-warning {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(212, 76, 71, 0.24);
  background: var(--red-soft);
  color: var(--red);
  font-size: 0.86rem;
}

.duplicate-warning strong,
.phone-incomplete-warning strong {
  color: #9f2d2a;
}

.duplicate-warning span,
.phone-incomplete-warning span {
  color: #9f2d2a;
  line-height: 1.42;
}

.form-actions {
  justify-content: flex-start;
  padding-top: 4px;
}

.notifications-heading {
  align-items: flex-start;
}

.ads-heading {
  align-items: flex-start;
}

.notifications-heading .button {
  margin-left: auto;
}

.ads-heading .button {
  margin-left: auto;
  width: auto;
}

.ad-form-panel {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
}

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

.ads-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ads-meta {
  justify-content: flex-end;
  margin-top: 12px;
}

.ads-table {
  min-width: 860px;
}

.table-action-button {
  width: auto;
  min-height: 30px;
  padding: 6px 10px;
}

.ad-row-actions {
  flex-wrap: nowrap;
}

.ad-delete-button {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  border: 1px solid #dc2626;
  color: #dc2626;
  background: #ffffff;
}

.ad-delete-button svg,
.ad-delete-button i[data-lucide] {
  width: 16px;
  height: 16px;
  display: block;
}

.ad-delete-button:hover,
.ad-delete-button:focus-visible {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #b91c1c;
}

.ad-delete-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background: #ffffff;
  color: #dc2626;
  border-color: #fecaca;
}

.notifications-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 250px);
  overflow: auto;
  padding-right: 4px;
}

.notification-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.notification-item.unread {
  border-color: rgba(47, 111, 235, 0.26);
  background: var(--accent-soft);
}

.notification-item[data-kind="duplicate_phone"] {
  border-color: rgba(212, 76, 71, 0.24);
  background: var(--red-soft);
}

.notification-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.notification-head strong {
  font-size: 0.94rem;
}

.notification-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.notification-kind {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(55, 53, 47, 0.07);
  font-size: 0.68rem;
  font-weight: 600;
}

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

.permissions-meta {
  margin-top: 4px;
}

.permission-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.permission-item.pending {
  border-color: rgba(47, 111, 235, 0.24);
  background: var(--accent-soft);
}

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

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

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

.permission-head-actions .icon-button.danger {
  position: relative;
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: inline-flex;
  flex: 0 0 28px;
  padding: 0;
  border-color: rgba(212, 76, 71, 0.28);
  background: var(--red-soft);
  line-height: 1;
}

.permission-head-actions .icon-button.danger svg,
.permission-head-actions .icon-button.danger i[data-lucide] {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  display: block;
  transform: translate(-50%, -50%);
}

.permission-head strong {
  font-size: 1rem;
}

.permission-head span:not(.badge) {
  color: var(--muted);
  font-size: 0.84rem;
}

.permission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.permission-preview {
  display: grid;
  gap: 10px;
}

.permission-preview-grid {
  display: grid;
  grid-template-columns: minmax(110px, 0.45fr) minmax(180px, 1fr);
  gap: 8px 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.78);
}

.permission-preview-grid span {
  color: var(--muted);
  font-size: 0.78rem;
}

.permission-preview-grid strong {
  font-size: 0.84rem;
}

.permission-preview-button {
  justify-self: start;
}

.permission-change-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.permission-change-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.permission-change-table th,
.permission-change-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 0.82rem;
}

.permission-change-table thead th {
  color: var(--muted);
  background: var(--panel-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.permission-change-table tbody tr:last-child th,
.permission-change-table tbody tr:last-child td {
  border-bottom: 0;
}

.permission-actions {
  justify-content: flex-end;
}

.notification-delete-button {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 0;
  border-radius: var(--radius);
  color: var(--red);
  background: rgba(212, 76, 71, 0.08);
  font-weight: 600;
  font-size: 0.74rem;
}

.notification-delete-button:hover,
.notification-delete-button:focus-visible {
  outline: none;
  background: rgba(212, 76, 71, 0.14);
}

.button-danger-soft {
  color: var(--red);
  border-color: rgba(212, 76, 71, 0.2);
  background: rgba(212, 76, 71, 0.06);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 20, 18, 0.28);
}

.modal-card {
  width: min(100%, 660px);
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.modal-card h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.25;
}

.modal-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

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

.modal-actions .button {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.modal-actions .button span {
  min-width: 0;
  text-align: center;
  white-space: normal;
}

.notification-item p {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
  font-size: 0.88rem;
}

.notification-meta,
.notification-foot {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.notification-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.notification-meta span {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(55, 53, 47, 0.06);
}

.notification-foot strong {
  color: var(--text);
}

.notification-foot-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notification-client-preview-button {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 0.76rem;
}

.notification-client-preview-button i,
.notification-client-preview-button svg {
  width: 14px;
  height: 14px;
}

.empty-state {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--panel-muted);
}

.empty-state strong {
  color: var(--text);
}

.employee-crm-card,
.employee-dashboard-card,
.org-permissions-card {
  display: grid;
  gap: 18px;
}

.org-structure-toolbar {
  display: flex;
  justify-content: flex-end;
}

.employee-crm-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.employee-crm-list {
  display: grid;
  gap: 8px;
}

.employee-crm-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.employee-crm-avatar,
.org-node-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--panel-muted);
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
}

.employee-crm-meta,
.org-node-main > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.employee-crm-meta strong,
.org-node-main strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.94rem;
}

.employee-crm-meta span,
.org-node-main span,
.org-permissions-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.employee-dashboard-heading {
  margin-bottom: 18px;
}

.employee-dashboard-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--panel-muted);
  color: var(--text);
  font-weight: 800;
  font-size: 0.95rem;
}

.employee-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.employee-dashboard-stat {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.employee-dashboard-stat i {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.employee-dashboard-stat span {
  color: var(--muted);
  font-size: 0.78rem;
}

.employee-dashboard-stat strong {
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1;
}

.employee-dashboard-stat small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.company-dashboard-card {
  display: grid;
  gap: 18px;
}

.company-dashboard-heading {
  margin-bottom: 0;
}

.company-dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.company-dashboard-section {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.company-leads-daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}

.company-lead-day {
  display: grid;
  gap: 6px;
  min-height: 94px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.company-lead-day.today {
  border-color: rgba(47, 111, 235, 0.28);
  background: var(--accent-soft);
}

.company-lead-day span {
  color: var(--muted);
  font-size: 0.78rem;
}

.company-lead-day strong {
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1;
}

.company-lead-day small {
  color: var(--muted);
  font-size: 0.76rem;
}

.company-auctions-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.company-auctions-table {
  min-width: 760px;
}

.company-birthdays-table {
  min-width: 680px;
}

.calendar-card {
  display: grid;
  gap: 18px;
}

.calendar-heading {
  margin-bottom: 0;
}

.calendar-reminder-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(140px, 0.8fr) minmax(120px, 0.6fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.calendar-reminder-form .button {
  min-height: 40px;
  justify-content: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.calendar-day {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 220px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
}

.calendar-day.today {
  border-color: rgba(47, 111, 235, 0.35);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 235, 0.14);
}

.calendar-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-muted);
}

.calendar-day header span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.calendar-day header strong {
  color: var(--text);
  font-size: 0.86rem;
}

.calendar-day-list {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 8px;
}

.calendar-entry {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 7px;
  background: #ffffff;
  color: inherit;
  text-align: left;
  cursor: default;
}

.calendar-entry[data-calendar-client-id] {
  cursor: pointer;
}

.calendar-entry[data-calendar-client-id]:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.calendar-entry.contact {
  border-left-color: var(--accent);
}

.calendar-entry.past {
  border-left-color: #8a8a8a;
  background: #f7f7f7;
}

.calendar-entry.auction {
  border-left-color: #7c3aed;
}

.calendar-entry.ad-expiry {
  border-left-color: #d4a017;
  background: #fffaf0;
}

.calendar-entry.disposition {
  border-left-color: #d97706;
}

.calendar-entry.custom {
  border-left-color: #2f7d4f;
}

.calendar-entry-time,
.calendar-entry-meta,
.calendar-empty-day {
  color: var(--muted);
  font-size: 0.72rem;
}

.calendar-entry strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.18;
}

.calendar-entry small {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.76rem;
  line-height: 1.25;
}

.calendar-entry-link {
  display: block;
  margin-top: 2px;
  color: var(--accent);
}

.calendar-empty-day {
  padding: 8px 2px;
}

.hr-card {
  display: grid;
  gap: 18px;
}

.hr-heading {
  margin-bottom: 0;
}

.hr-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.hr-layout-single {
  grid-template-columns: minmax(0, 1fr);
}

.hr-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

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

.hr-panel-head h4 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 1rem;
}

.hr-panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.hr-month-field {
  width: 180px;
  min-width: 180px;
}

.hr-summary-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
}

.hr-summary-row strong {
  color: var(--text);
  font-size: 1.2rem;
}

.hr-summary-row .badge,
.work-hour-history-item .badge {
  line-height: 1.15;
  white-space: normal;
  text-align: center;
}

.hr-days-table-wrap {
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hr-days-table {
  min-width: 560px;
}

.hr-days-table td:first-child strong,
.hr-days-table small {
  display: block;
}

.hr-days-table small {
  color: var(--muted);
  font-size: 0.76rem;
}

.hr-days-table tr.work-hour-disposition-approved td {
  background: #f6f7fb;
}

.hr-days-table tr.work-hour-disposition-pending td {
  background: #fff7d6;
}

.hr-days-table tr.work-hour-disposition-blocked td {
  background: #f1edff;
}

.hr-days-table .work-hour-disposition-label {
  margin-top: 2px;
  color: #5c4f92;
  font-weight: 700;
}

.hr-days-table tr.work-hour-disposition-approved .work-hour-disposition-label {
  color: #697083;
}

.hr-days-table tr.work-hour-disposition-pending .work-hour-disposition-label {
  color: #7a5d18;
}

.hr-days-table tr.work-hour-disposition-blocked .work-hour-disposition-label {
  color: #5c4f92;
}

.hr-days-table input {
  width: 118px;
}

.hr-actions,
.work-hour-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.disposition-request-panel {
  margin-top: 14px;
}

.disposition-request-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr);
  gap: 10px;
  align-items: end;
}

.disposition-days-table-wrap {
  grid-column: 1 / -1;
  max-height: 420px;
}

.disposition-days-table input[type="time"] {
  width: 118px;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.checkbox-inline input {
  width: 18px;
  height: 18px;
}

.disposition-note-field {
  min-width: 0;
}

.disposition-history-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.disposition-history-item small {
  white-space: normal;
}

.disposition-preview-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.disposition-preview-grid {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 8px 12px;
}

.disposition-preview-grid span {
  color: var(--muted);
  font-size: 0.8rem;
}

.disposition-preview-grid strong {
  min-width: 0;
  white-space: normal;
}

.disposition-edit-form {
  padding-top: 4px;
}

.work-hour-history-actions .icon-button.danger {
  position: relative;
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: inline-flex;
  flex: 0 0 28px;
  padding: 0;
  border-color: rgba(212, 76, 71, 0.28);
  background: var(--red-soft);
  line-height: 1;
}

.work-hour-history-actions .icon-button.danger svg,
.work-hour-history-actions .icon-button.danger i[data-lucide] {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  display: block;
  margin: 0;
  transform: translate(-50%, -50%);
}

.work-hour-history-actions .icon-button.danger:hover,
.work-hour-history-actions .icon-button.danger:focus-visible {
  color: var(--red);
  border-color: rgba(212, 76, 71, 0.42);
  background: #ffe6e4;
}

.hr-document-preview {
  align-content: start;
  color: var(--text);
  line-height: 1.5;
}

.hr-document-preview h1 {
  margin: 0;
  font-size: 1.18rem;
}

.hr-document-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.hr-document-preview .company-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, 34%);
  gap: 10px;
  align-items: stretch;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
  font-size: 0.82rem;
}

.hr-document-preview .company-details-main strong,
.hr-document-preview .company-details-main span {
  display: block;
}

.hr-document-preview .company-stamp-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 8px;
  border: 1px dashed var(--muted);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
}

@media (max-width: 720px) {
  .hr-document-preview .company-details {
    grid-template-columns: 1fr;
  }
}

.hr-document-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.hr-document-preview th,
.hr-document-preview td {
  padding: 6px 8px;
  border: 1px solid var(--border);
  text-align: left;
}

.hr-document-preview .total {
  color: var(--text);
  font-weight: 700;
}

.hr-document-preview .signatures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 26px;
}

.hr-document-preview .signatures div {
  padding-top: 8px;
  border-top: 1px solid var(--border-strong);
  color: var(--muted);
  text-align: center;
  font-size: 0.78rem;
}

.hr-history-panel {
  margin-top: 14px;
}

.work-hour-history-list {
  display: grid;
  gap: 8px;
}

.hr-history-meta {
  margin-top: 6px;
}

.hr-history-count {
  color: var(--muted);
  font-size: 0.84rem;
}

.work-hour-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
}

.work-hour-history-item > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.work-hour-history-item strong,
.work-hour-history-item span,
.work-hour-history-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-hour-history-item span,
.work-hour-history-item small {
  color: var(--muted);
  font-size: 0.8rem;
}

.badge.work-status-draft {
  color: #5f6470;
  background: #eef0f3;
  border-color: #d8dce2;
}

.badge.work-status-submitted {
  color: #6e5a2a;
  background: #fff3cf;
  border-color: #ead088;
}

.badge.work-status-approved {
  color: #1f6b3f;
  background: #e7f7ec;
  border-color: #bfebcd;
}

.badge.disposition-status-pending {
  color: #6e5a2a;
  background: #fff3cf;
  border-color: #ead088;
}

.badge.disposition-status-approved {
  color: #1f6b3f;
  background: #e7f7ec;
  border-color: #bfebcd;
}

.badge.disposition-status-partial {
  color: #5f2a8e;
  background: #efe1ff;
  border-color: #dabef7;
}

.badge.disposition-status-rejected {
  color: #8e2f2b;
  background: #ffe6e4;
  border-color: #f3b7b2;
}

.employee-work-section {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.employee-work-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.employee-work-section-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
}

.employee-work-section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.employee-period-card,
.employee-month-button {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.employee-period-card:hover,
.employee-month-button:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.employee-period-card i {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.employee-period-card span,
.employee-month-button span,
.employee-history-panel summary {
  color: var(--text);
  font-weight: 700;
}

.employee-period-card strong,
.employee-month-button strong {
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
}

.employee-period-card small,
.employee-month-button small {
  color: var(--muted);
  font-size: 0.78rem;
}

.employee-history-panel {
  display: grid;
  gap: 12px;
}

.employee-history-panel summary {
  cursor: pointer;
  font-size: 0.95rem;
}

.employee-month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.employee-custom-range {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.employee-custom-range label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.employee-custom-range input {
  width: 100%;
}

.org-permissions-tree {
  overflow-x: auto;
}

.org-tree-root,
.org-node ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.org-node ul {
  margin-top: 8px;
  padding-left: 30px;
  border-left: 1px solid var(--border);
}

.org-node-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 170px) minmax(220px, 320px);
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.org-node-main {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.org-manager-field {
  gap: 4px;
}

.org-role-field {
  gap: 4px;
}

.org-top-label {
  display: grid;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem;
}

.org-chart {
  display: grid;
  gap: 26px;
  min-width: 720px;
}

.org-admin-branch {
  display: grid;
  justify-items: center;
  gap: 0;
}

.org-admin-top {
  width: min(520px, 100%);
}

.org-admin-card {
  border-color: rgba(47, 111, 235, 0.26);
  background: rgba(47, 111, 235, 0.05);
}

.org-manager-card {
  border-color: rgba(47, 125, 79, 0.24);
  background: rgba(47, 125, 79, 0.05);
}

.org-sales-card {
  background: #ffffff;
}

.org-admin-trunk {
  width: 1px;
  height: 34px;
  background: var(--border-strong);
  justify-self: center;
}

.org-manager-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
  align-items: start;
  padding-top: 16px;
  border-top: 1px solid var(--border-strong);
}

.org-manager-branch {
  position: relative;
  display: grid;
  gap: 10px;
  align-content: start;
}

.org-branch-line {
  position: absolute;
  top: -24px;
  left: 50%;
  width: 1px;
  height: 24px;
  background: var(--border-strong);
}

.org-sales-branch,
.org-direct-sales,
.org-unassigned-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed var(--border);
  background: var(--panel-muted);
}

.org-direct-sales,
.org-unassigned-panel {
  width: 100%;
  margin-top: 14px;
}

.org-branch-title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.org-sales-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.org-sales-node .org-node-card {
  grid-template-columns: minmax(0, 1fr);
}

.org-sales-node .org-manager-field {
  display: none;
}

.org-assign-slot {
  padding-top: 4px;
}

.org-empty-slot {
  display: grid;
  place-items: center;
  min-height: 58px;
  padding: 12px;
  border: 1px dashed var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  font-size: 0.86rem;
  text-align: center;
}

.org-nested-managers {
  display: grid;
  gap: 12px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.org-map {
  display: grid;
  gap: 18px;
  min-width: 820px;
  padding: 16px;
  border: 1px solid var(--border);
  background:
    linear-gradient(rgba(55, 53, 47, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55, 53, 47, 0.04) 1px, transparent 1px),
    #ffffff;
  background-size: 28px 28px;
}

.org-map-admin {
  display: grid;
  justify-items: center;
}

.org-person-chip {
  --org-chip-size: 118px;
  --org-tool-size: 28px;
  --org-tool-left: calc(var(--org-chip-size) * 0.068);
  --org-tool-left-settings: calc(var(--org-chip-size) * -0.06);
  --org-tool-top-crm: calc(var(--org-chip-size) * 0.068);
  --org-tool-top-settings: calc(var(--org-chip-size) * 0.339);
  display: grid;
  position: relative;
  justify-items: center;
  gap: 4px;
  width: var(--org-chip-size);
  height: var(--org-chip-size);
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow-soft);
  cursor: grab;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.org-person-chip:hover,
.org-person-chip:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(47, 111, 235, 0.45);
  outline: none;
}

.org-person-chip.dragging {
  animation-play-state: paused;
  opacity: 0.55;
  transform: translateY(-2px);
}

.org-person-chip.locked {
  cursor: not-allowed;
}

.org-person-settings,
.org-person-crm {
  position: absolute;
  display: grid;
  place-items: center;
  width: var(--org-tool-size);
  height: var(--org-tool-size);
  padding: 0;
  border: 1px solid rgba(55, 53, 47, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--muted);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  z-index: 2;
  transition: transform 140ms ease, border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.org-person-settings {
  left: var(--org-tool-left-settings);
  top: var(--org-tool-top-settings);
}

.org-person-crm {
  left: var(--org-tool-left);
  top: var(--org-tool-top-crm);
}

.org-person-settings:hover,
.org-person-settings:focus-visible,
.org-person-crm:hover,
.org-person-crm:focus-visible {
  color: var(--accent);
  border-color: rgba(47, 111, 235, 0.32);
  background: #ffffff;
  transform: scale(1.05);
  outline: none;
}

.org-person-settings:disabled,
.org-person-crm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.org-person-settings svg,
.org-person-crm svg {
  width: 14px;
  height: 14px;
}

.org-person-chip.admin {
  --org-chip-size: 138px;
  width: var(--org-chip-size);
  height: var(--org-chip-size);
  border-color: rgba(47, 111, 235, 0.45);
  background: rgba(47, 111, 235, 0.07);
}

.org-person-chip.manager {
  border-color: rgba(47, 125, 79, 0.38);
  background: rgba(47, 125, 79, 0.06);
}

.org-person-chip.connect-target {
  position: relative;
}

.org-person-chip.connect-target::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px dashed transparent;
  border-radius: 999px;
  pointer-events: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.org-permissions-tree.is-connecting .org-person-chip.connect-target::after {
  border-color: rgba(47, 111, 235, 0.35);
}

.org-person-chip.connect-over {
  transform: translateY(-4px);
  border-color: rgba(47, 111, 235, 0.78);
  background: rgba(47, 111, 235, 0.1);
}

.org-person-chip.connect-over::after {
  border-color: rgba(47, 111, 235, 0.78);
  background: rgba(47, 111, 235, 0.08);
  box-shadow: 0 0 0 2px rgba(47, 111, 235, 0.12);
}

.org-person-chip.unassigned {
  border-color: rgba(212, 76, 71, 0.4);
  background: rgba(212, 76, 71, 0.06);
  transform-origin: 50% 50%;
  animation: none;
}

.org-person-chip.terminated {
  border-color: rgba(15, 23, 42, 0.46);
  background: rgba(15, 23, 42, 0.095);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.org-person-chip.terminated .org-person-role {
  color: var(--muted);
}

.org-person-chip.terminated .org-person-avatar {
  background: rgba(15, 23, 42, 0.14);
  color: var(--text);
}

.org-person-chip.terminated .org-person-settings,
.org-person-chip.terminated .org-person-crm {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.96);
  color: var(--muted);
}

.org-person-chip.terminated .org-person-settings:hover,
.org-person-chip.terminated .org-person-settings:focus-visible,
.org-person-chip.terminated .org-person-crm:hover,
.org-person-chip.terminated .org-person-crm:focus-visible {
  background: #ffffff;
  color: var(--accent);
}

.org-person-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.org-person-avatar:hover,
.org-person-avatar:focus-visible {
  color: var(--accent);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(47, 111, 235, 0.24);
}

.org-person-avatar:disabled {
  color: var(--text);
  cursor: not-allowed;
  opacity: 0.62;
  box-shadow: none;
}

.org-person-avatar:disabled:hover {
  color: var(--text);
  box-shadow: none;
}

.org-person-name {
  max-width: calc(100% - 12px);
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.1;
}

.org-person-role {
  color: var(--muted);
  font-size: 0.74rem;
}

.org-junction-deposit {
  --junction-foreground: var(--text);
  --junction-background: rgba(255, 255, 255, 0.98);
  --junction-border: rgba(47, 111, 235, 0.72);
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 1px 7px;
  border: 1px solid var(--junction-border);
  border-radius: 999px;
  background: var(--junction-background);
  color: var(--junction-foreground);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.14);
}

.org-junction-deposit.manager-own,
.org-junction-deposit.manager-children,
.org-junction-deposit.admin-total,
.org-junction-deposit.admin-total-top {
  --junction-foreground: #0f172a;
  --junction-background: rgba(255, 255, 255, 0.98);
  --junction-border: rgba(47, 125, 79, 0.72);
}

.org-person-placeholder {
  cursor: default;
  border-style: dashed;
  border-color: rgba(55, 53, 47, 0.28);
  background: rgba(55, 53, 47, 0.04);
  box-shadow: none;
}

.org-person-placeholder:hover,
.org-person-placeholder:focus-visible {
  transform: none;
  border-color: rgba(55, 53, 47, 0.28);
  background: rgba(55, 53, 47, 0.04);
}

.org-person-name-multiline {
  max-width: 100px;
  white-space: normal;
  line-height: 1.2;
}

.org-drop-zone {
  display: grid;
  gap: 12px;
  min-height: 150px;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.74);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.org-drop-zone.drag-over {
  border-color: rgba(47, 111, 235, 0.7);
  background: rgba(47, 111, 235, 0.08);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 235, 0.24);
}

.org-permissions-tree.is-connecting .org-drop-zone {
  border-color: rgba(47, 111, 235, 0.38);
}

.org-permissions-tree.is-connecting .org-drop-zone::before {
  content: "";
  width: 22px;
  height: 22px;
  margin-top: -26px;
  justify-self: center;
  border-radius: 999px;
  border: 2px solid rgba(47, 111, 235, 0.5);
  background: rgba(47, 111, 235, 0.08);
}

.org-zone-header {
  display: grid;
  gap: 2px;
}

.org-zone-header strong {
  color: var(--text);
  font-size: 0.9rem;
}

.org-zone-header span {
  color: var(--muted);
  font-size: 0.78rem;
}

.org-zone-people {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.org-network-scroll {
  overflow: auto;
  padding-bottom: 4px;
}

.org-network-scene {
  position: relative;
  min-width: 980px;
  margin-top: 6px;
}

.org-network-scene-empty {
  min-height: 360px;
}

.org-network-svg,
.org-network-layer {
  position: absolute;
  inset: 0;
}

.org-network-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.org-network-layer {
  position: relative;
}

.org-network-node {
  position: absolute;
  width: 138px;
}

.org-network-link {
  stroke: rgba(55, 53, 47, 0.22);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.org-network-link.admin-link {
  stroke: rgba(47, 111, 235, 0.42);
  stroke-width: 2.6;
}

.org-network-link.sales-link {
  stroke: rgba(47, 125, 79, 0.34);
}

.org-branch-hint {
  position: absolute;
  width: 220px;
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.4;
}

.org-unassigned-island {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px dashed rgba(212, 76, 71, 0.42);
  background: rgba(212, 76, 71, 0.045);
  box-shadow: inset 0 0 0 1px rgba(212, 76, 71, 0.08);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.org-unassigned-island.connect-over {
  border-color: rgba(212, 76, 71, 0.8);
  background: rgba(212, 76, 71, 0.1);
  box-shadow: inset 0 0 0 1px rgba(212, 76, 71, 0.18);
}

.org-terminated-island {
  border-color: rgba(15, 23, 42, 0.72);
  background: rgba(15, 23, 42, 0.12);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.org-terminated-island.connect-over {
  border-color: rgba(15, 23, 42, 0.9);
  background: rgba(15, 23, 42, 0.18);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.28);
}

.org-terminated-island .org-zone-header strong {
  color: var(--text);
}

.org-terminated-island .org-zone-header span {
  color: var(--muted);
}

.org-terminated-island .org-empty-slot {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
}

.floating-people {
  min-height: 132px;
}

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: grid;
  gap: 8px;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.toast[data-tone="warn"] {
  border-color: rgba(212, 76, 71, 0.28);
  background: var(--red-soft);
}

.toast[data-tone="success"] {
  border-color: rgba(47, 125, 79, 0.28);
  background: var(--green-soft);
}

.toast strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.9rem;
}

.toast div {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

@media (max-width: 1040px) {
  :root {
    --sidebar-width: 224px;
  }

  .workspace {
    padding-inline: 16px;
  }

  .client-top-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .auth-screen {
    align-items: start;
    padding: 14px;
  }

  .auth-panel {
    margin-top: 24px;
    padding: 20px;
  }

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

  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

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

  .workspace {
    padding: 12px 14px 24px;
  }

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

  .topbar-heading-row {
    margin-top: 10px;
  }

  .topbar h2 {
    font-size: 1.65rem;
  }

  .topbar-actions {
    width: 100%;
    flex: none;
    flex-wrap: wrap;
  }

  .search {
    min-width: 0;
  }

  .client-sort-panel {
    right: auto;
    left: 0;
  }

  .topbar-actions .button {
    flex: 0 0 auto;
  }

  .database-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-wrap {
    max-height: none;
  }

  .detail-card {
    margin-top: 18px;
  }

  .page-heading {
    align-items: flex-start;
    margin-bottom: 20px;
  }

  .page-heading h3 {
    font-size: 1.45rem;
  }

  .budget-delivery-row,
  .phone-row,
  .auction-row,
  .employee-crm-toolbar,
  .employee-crm-item,
  .org-node-card,
  .ads-heading,
  .notifications-heading,
  .notification-head {
    flex-direction: column;
    align-items: stretch;
  }

  .employee-crm-toolbar,
  .employee-crm-item,
  .employee-dashboard-grid,
  .company-dashboard-grid,
  .calendar-reminder-form,
  .hr-layout,
  .disposition-request-form,
  .work-hour-history-item,
  .employee-period-grid,
  .employee-month-grid,
  .employee-custom-range,
  .org-node-card {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .org-node ul {
    padding-left: 14px;
  }

  .org-map {
    min-width: 680px;
    padding: 12px;
  }

  .org-network-scene {
    min-width: 760px;
  }

  .org-person-chip {
    --org-chip-size: 104px;
    width: var(--org-chip-size);
    height: var(--org-chip-size);
  }

  .org-person-chip.admin {
    --org-chip-size: 118px;
    width: var(--org-chip-size);
    height: var(--org-chip-size);
  }

  .org-network-node {
    width: 118px;
  }

  .auction-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .budget-field,
  .offer-check-field,
  .status-field,
  .phone-prefix,
  #phone-number {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
  }

  .checkbox-grid,
  .contact-grid,
  .car-status-grid,
  .ad-form-grid,
  .settings-checkbox-list {
    grid-template-columns: 1fr;
  }

  .delivery-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .delivery-grid .check {
    justify-content: center;
  }

  .notifications-heading .button,
  .ads-heading .button {
    margin-left: 0;
  }

  .hr-panel-head,
  .hr-actions,
  .hr-history-meta,
  .work-hour-history-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hr-month-field {
    width: 100%;
    min-width: 0;
  }

  .form-actions,
  .auth-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }
}
