:root {
  --crm-canvas: #F4F7FB;
  --crm-surface: #FFFFFF;
  --crm-ink: #172033;
  --crm-muted: #667085;
  --crm-line: #E6EAF0;
  --crm-nav: #17212E;
  --crm-nav-text: #DCE3EB;
  --crm-nav-muted: #7F8C9C;
  --crm-accent: #0F766E;
  --crm-accent-soft: #E7F5F3;
  --crm-accent-pressed: #0C5F59;
  --crm-danger: #B42318;
  --crm-warning: #B54708;
  --crm-success: #067647;
  --crm-info: #175CD3;
  --crm-radius: 10px;
  --crm-control: 40px;
  --crm-sidebar: 236px;
  --crm-sidebar-collapsed: 76px;
  --crm-header: 64px;
  --crm-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --crm-font: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body.crm {
  margin: 0;
  background: var(--crm-canvas);
  color: var(--crm-ink);
  font-family: var(--crm-font);
  font-size: 14px;
  line-height: 1.45;
}

.crm-shell { display: flex; min-height: 100vh; }

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14, 28, 47, 0.45);
  z-index: 30;
}

.crm-nav {
  width: var(--crm-sidebar);
  flex: 0 0 var(--crm-sidebar);
  background: var(--crm-nav);
  color: var(--crm-nav-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.crm-nav a.crm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--crm-header);
  padding: 0 20px;
  margin: 0;
  border-radius: 0;
  color: white;
  text-decoration: none;
  flex: 0 0 auto;
}
.crm-nav a.crm-brand:hover { background: none; }

.brand-mark {
  color: #2BB3A3;
  font-size: 28px;
  line-height: 1;
}

.brand-text { color: #C9D3DE; font-size: 17px; font-weight: 400; white-space: nowrap; }
.brand-text strong { color: white; font-weight: 600; }

.nav-scroll { overflow-y: auto; padding: 4px 12px 20px; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-section {
  margin: 16px 10px 6px;
  color: var(--crm-nav-muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.crm-nav .nav-scroll a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  color: var(--crm-nav-text);
  text-decoration: none;
  border-radius: 6px;
  padding: 0 12px;
  margin-bottom: 1px;
  font-size: 13.5px;
  font-weight: 500;
}

.crm-nav .nav-scroll a i { width: 18px; text-align: center; font-size: 15px; color: #AEBBCB; }
.crm-nav .nav-scroll a:hover { background: rgba(255, 255, 255, 0.05); color: white; }
.crm-nav .nav-scroll a:hover i { color: white; }
.crm-nav .nav-scroll a.active {
  background: #1C5C59;
  color: white;
}
.crm-nav .nav-scroll a.active i { color: white; }

.crm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.crm-top {
  height: var(--crm-header);
  background: var(--crm-surface);
  border-bottom: 1px solid var(--crm-line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-toggle {
  border: 1px solid var(--crm-line);
  background: white;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--crm-ink);
}

.header-search {
  flex: 1;
  max-width: 560px;
  position: relative;
  margin: 0 auto;
}

.header-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--crm-muted);
}

.header-search input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--crm-line);
  border-radius: 10px;
  padding: 0 72px 0 36px;
  background: #F8FAFC;
}

.header-search input:focus {
  outline: none;
  border-color: var(--crm-accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
  background: white;
}

.header-search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--crm-line);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--crm-muted);
  background: white;
}

.header-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.notif-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--crm-line);
  background: white;
  border-radius: 8px;
  color: var(--crm-ink);
  padding: 0;
  line-height: 1;
}

.notif-btn:hover {
  background: #F8FAFC;
  border-color: #B8C0CC;
}

.notif-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
  border-color: var(--crm-accent);
}

.notif-btn > i { font-size: 16px; color: var(--crm-muted); }
.notif-btn:hover > i,
.notif-btn[aria-expanded="true"] > i { color: var(--crm-ink); }

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--crm-danger);
  color: white;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid white;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}

.notif-menu {
  width: min(340px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid var(--crm-line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.1);
  overflow: hidden;
}

.notif-menu__head {
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--crm-muted);
  background: #F8FAFC;
  border-bottom: 1px solid var(--crm-line);
}

.notif-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--crm-line);
}

.notif-item:last-child { border-bottom: none; }

.notif-item__body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  color: var(--crm-ink);
  font-size: 13.5px;
  line-height: 1.4;
}

.notif-item__body i {
  margin-top: 2px;
  color: var(--crm-danger);
  font-size: 14px;
  flex: 0 0 auto;
}

.notif-dismiss {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--crm-line);
  border-radius: 6px;
  background: white;
  color: var(--crm-muted);
  font-size: 12px;
  font-weight: 600;
}

.notif-dismiss:hover {
  background: #F8FAFC;
  color: var(--crm-ink);
  border-color: #B8C0CC;
}

.lang-select, .signout-btn {
  height: 36px;
  border: 1px solid var(--crm-line);
  background: white;
  border-radius: 8px;
  color: var(--crm-ink);
  padding: 0 10px;
}

.signout-btn { display: inline-flex; align-items: center; gap: 6px; }

.crm-content { padding: 24px 28px 40px; }

.page-head {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.page-head h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; color: var(--crm-muted); }
.page-head .page-actions { margin-left: auto; }
.page-back {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--crm-ink);
  text-decoration: none;
}
.page-back:hover { background: white; }

.section-card {
  background: var(--crm-surface);
  border: 1px solid var(--crm-line);
  border-radius: 14px;
  box-shadow: var(--crm-shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.section-card h2 { margin: 0 0 4px; font-size: 16px; font-weight: 650; }
.section-card .section-lead { color: var(--crm-muted); margin: 0 0 16px; }

.crm-card {
  background: var(--crm-surface);
  border: 1px solid var(--crm-line);
  border-radius: 14px;
  box-shadow: var(--crm-shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.crm-card > .h6,
.section-card > .h6 { margin-bottom: 14px; }

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.admin-panel-head .h6 { margin: 0; }
.admin-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--crm-muted);
  background: #F2F4F7;
  border-radius: 999px;
  padding: 4px 10px;
}

.product-name { font-weight: 650; color: var(--crm-ink); }
.product-code {
  display: inline-block;
  margin-top: 2px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--crm-muted);
  background: #F8FAFC;
  border: 1px solid var(--crm-line);
  border-radius: 6px;
  padding: 1px 6px;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 72px;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--crm-ink);
  background: #F8FAFC;
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  padding: 4px 10px;
}
.stat-pill i { color: var(--crm-muted); font-size: 13px; }
.crm-card .crm-table { margin: 0; border: 0; box-shadow: none; }

.admin-shell {
  background: var(--crm-surface);
  border: 1px solid var(--crm-line);
  border-radius: 14px;
  box-shadow: var(--crm-shadow);
  overflow: hidden;
  margin-bottom: 16px;
}
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--crm-line);
  background: #F8FAFC;
}
.admin-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  color: var(--crm-muted);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.admin-tabs .nav-link i { font-size: 15px; line-height: 1; width: 1em; margin-right: 4px; }
.admin-tabs .nav-link .bi-paperclip,
.org-history-tab .nav-link i { margin-right: 0; }
.admin-tabs .nav-link .admin-tab-count { margin-left: 6px; }
.admin-tabs .nav-link:hover { color: var(--crm-ink); background: rgba(255,255,255,.7); }
.admin-tabs .nav-link.active {
  color: var(--crm-accent);
  background: white;
  border-bottom-color: var(--crm-accent);
}
.admin-tab-count {
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #E8EEF4;
  color: var(--crm-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.admin-tabs .nav-link.active .admin-tab-count {
  background: var(--crm-accent-soft);
  color: var(--crm-accent);
}
.org-history-tab { margin-left: auto; }
.org-history-tab .nav-link { padding: 0 12px; }
.admin-tab-body { padding: 16px; }
.admin-products .admin-tabs { align-items: flex-end; }
.admin-products .admin-tab-action {
  margin-left: auto;
  margin-bottom: 8px;
  list-style: none;
}
.admin-products .admin-tab-body .dataTables_wrapper,
.admin-products .admin-tab-body .crm-table {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0;
  background: transparent;
}
.admin-tab-body .crm-card:last-child,
.admin-tab-body .section-card:last-child { margin-bottom: 0; }

@media (max-width: 640px) {
  .admin-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .admin-tabs .nav-link { white-space: nowrap; }
}

.admin-modal .modal-content {
  border: 1px solid var(--crm-line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.16);
  overflow: hidden;
}
.admin-modal .modal-header {
  border-bottom: 1px solid var(--crm-line);
  padding: 10px 16px;
  min-height: 0;
  background: #F8FAFC;
}
.admin-modal .modal-header .modal-title {
  margin: 0;
  line-height: 1.3;
  font-size: 14px;
}
.admin-modal .modal-header .btn-close {
  padding: 0.4rem;
  margin: -0.2rem -0.2rem -0.2rem auto;
}
.admin-modal .modal-body {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.admin-modal.role-history-dialog .modal-dialog {
  max-width: 520px;
}
.admin-modal.role-history-dialog .modal-body {
  display: block;
  padding: 0;
}
.admin-modal.role-history-dialog .crm-table {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.admin-modal.role-history-dialog .crm-table th,
.admin-modal.role-history-dialog .crm-table td {
  border-radius: 0;
}
.admin-modal.role-history-dialog .modal-body > .text-muted {
  padding: 20px;
}
.org-role-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.org-role-list .org-role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 0;
}
.admin-modal .modal-footer {
  border-top: 1px solid var(--crm-line);
  padding: 12px 20px;
  gap: 8px;
  background: white;
}
.admin-modal .crm-form { margin: 0; }
.admin-modal.status-dialog .modal-dialog { max-width: 440px; }
.admin-modal.status-dialog .modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-modal.status-dialog .crm-field { margin: 0; }
.admin-modal.status-dialog .form-label {
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.2;
}
.admin-modal.status-dialog .form-control,
.admin-modal.status-dialog .form-select {
  width: 100%;
  height: 34px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
}
.admin-modal.status-dialog .form-select {
  padding-right: 28px;
  background-position: right 8px center;
}
.admin-modal.contact-dialog .modal-body { align-items: start; gap: 12px 14px; padding: 16px 18px; }
.admin-modal.contact-dialog .form-label {
  display: block;
  height: 16px;
  margin: 0 0 4px;
  padding: 0;
  color: var(--crm-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0;
}
.admin-modal.contact-dialog .crm-field:not(.span-2):has(> .fact-value) > .form-label {
  transform: translateY(1px);
}
.admin-modal.contact-dialog .form-control,
.admin-modal.contact-dialog .form-select {
  height: 34px;
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 8px;
}
.admin-modal.contact-dialog .form-select {
  padding-right: 28px;
  background-position: right 8px center;
}
.admin-modal.contact-dialog .fact-value {
  height: 34px;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
}
.admin-panel-head .btn-sm {
  height: 34px;
  min-width: 0;
  padding: 0 12px;
}
.crm-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}

.crm-field label, .form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.span-2 { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.form-control, .form-select {
  height: var(--crm-control);
  border: 1px solid var(--crm-line);
  border-radius: 10px;
  box-shadow: none;
}

textarea.form-control { height: auto; min-height: 96px; }
input[type="file"].form-control { height: auto; padding: 8px 12px; }

.form-control:focus, .form-select:focus {
  border-color: var(--crm-accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.form-control.is-invalid,
.form-select.is-invalid,
.form-control.input-validation-error,
.form-select.input-validation-error,
.form-control:user-invalid,
.form-select:user-invalid {
  border-color: var(--crm-danger) !important;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12) !important;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus,
.form-control.input-validation-error:focus,
.form-select.input-validation-error:focus {
  border-color: var(--crm-danger) !important;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.18) !important;
}

.field-error,
span.field-validation-error {
  display: block;
  margin-top: 6px;
  color: var(--crm-danger);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
}

.field-error:empty,
span.field-validation-valid { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  min-width: 88px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.btn i { font-size: 15px; line-height: 1; }
.btn-sm { height: 32px; min-width: 0; padding: 0 12px; font-size: 13px; }
.btn-link { min-width: 0; padding: 0 6px; }
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2); }

.btn-accent {
  background: var(--crm-accent);
  color: white;
  border: 1px solid var(--crm-accent);
}
.btn-accent:hover, .btn-accent:focus, .btn-accent:active { background: var(--crm-accent-pressed); border-color: var(--crm-accent-pressed); color: white; }

.btn-outline-secondary {
  background: white;
  border: 1px solid #D0D5DD;
  color: var(--crm-ink);
}
.btn-outline-secondary:hover, .btn-outline-secondary:active { background: #F8FAFC; border-color: #B8C0CC; color: var(--crm-ink); }
.btn-outline-danger { background: white; }

h1 { font-size: 22px; font-weight: 650; margin-bottom: 16px; }
h2.h6 { font-weight: 650; color: var(--crm-ink); }

.crm-table, table.table {
  width: 100%;
  background: white;
  border: 1px solid var(--crm-line);
  border-radius: 14px;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}

.crm-table th, table.table th {
  background: #F8FAFC;
  color: var(--crm-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  padding: 12px 14px;
  border-bottom: 1px solid var(--crm-line);
}

.crm-table td, table.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--crm-line);
  vertical-align: middle;
}

.crm-table.crm-table-compact th,
.crm-table.crm-table-compact td {
  padding: 6px 10px;
}
.crm-table.crm-table-compact .org-role-list {
  gap: 2px;
}
.crm-table.crm-table-compact .org-role {
  margin: 0;
  gap: 4px 6px;
}
.crm-table.crm-table-compact .org-role .btn-link {
  padding: 0;
  font-size: 12px;
  line-height: 1.2;
  vertical-align: baseline;
}
.crm-table.crm-table-compact .badge {
  padding: 0.2em 0.55em;
  font-size: 11px;
  line-height: 1.2;
}

.crm-table tr:last-child td, table.table tr:last-child td { border-bottom: 0; }
.crm-table a, table.table a { color: var(--crm-ink); font-weight: 600; text-decoration: none; }
.crm-table a:hover, table.table a:hover { color: var(--crm-accent); }

.crm-table th.col-actions,
.crm-table td.col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: end;
}

.cell-wrap {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: white;
  border: 1px solid var(--crm-line);
  border-radius: 14px;
}

.table-scroll .crm-table {
  margin: 0;
  border: 0;
  border-radius: 0;
  min-width: 640px;
  width: 100%;
}

.status-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -6px 0 10px;
}
.table-scroll .status-table { min-width: 720px; table-layout: fixed; }
.status-table th:nth-child(1),
.status-table td:nth-child(1) { width: 14%; }
.status-table th:nth-child(2),
.status-table td:nth-child(2) { width: 16%; }
.status-table th:nth-child(3),
.status-table td:nth-child(3) { width: 16%; }
.status-table th:nth-child(4),
.status-table td:nth-child(4) { width: 22%; }
.status-table th.col-actions,
.status-table td.col-actions { width: 32%; white-space: nowrap; }
.status-table .form-select,
.status-table .form-control {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 2px 8px;
  font-size: 13px;
}
.status-table .status-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}
.status-table .status-current .badge { font-size: 11px; font-weight: 600; }
.status-table .status-actions {
  display: inline-flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: max-content;
  margin-left: auto;
}
.status-table .status-actions form {
  display: inline-flex;
  width: auto;
  margin: 0;
}
.status-table .status-actions .btn {
  width: auto;
  height: 28px;
  min-width: 0;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}
.status-table .status-save {
  width: 28px;
  min-width: 28px;
  padding: 0;
}

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

.instance-detail-actions__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.instance-detail-actions__btns form { display: inline; margin: 0; }

.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid var(--crm-line);
  border-radius: 6px;
  background: white;
  color: var(--crm-muted) !important;
  font-weight: 500 !important;
  text-decoration: none !important;
}

.row-action:hover {
  color: var(--crm-ink) !important;
  border-color: #B8C0CC;
  background: #F8FAFC;
}

.row-action i { font-size: 12px; line-height: 1; }

.dataTables_wrapper {
  background: var(--crm-surface);
  border: 1px solid var(--crm-line);
  border-radius: 12px;
  box-shadow: var(--crm-shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.dataTables_wrapper::after { content: ""; display: block; clear: both; }

.dataTables_wrapper table.crm-table,
.dataTables_wrapper table.dataTable {
  border: 0;
  border-radius: 0;
  margin: 0 !important;
  border-top: 1px solid var(--crm-line);
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  padding: 12px 16px;
  color: var(--crm-muted);
  font-size: 13px;
}

.dataTables_wrapper .dataTables_length select {
  height: 36px;
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  padding: 0 28px 0 10px;
  margin: 0 6px;
  background-color: white;
  color: var(--crm-ink);
}

.dataTables_wrapper .dataTables_filter label { margin: 0; }

.dataTables_wrapper .dataTables_filter input {
  width: 280px;
  height: 36px;
  margin: 0 !important;
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  padding: 0 12px 0 36px;
  background: #F8FAFC url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23667085' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E") no-repeat 12px center;
  color: var(--crm-ink);
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}

.dataTables_wrapper .dataTables_filter input::placeholder { color: #98A2B3; }

.dataTables_wrapper .dataTables_filter input:focus {
  outline: none;
  border-color: var(--crm-accent);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.dataTables_wrapper .dataTables_info {
  padding: 12px 16px !important;
  color: var(--crm-muted);
  font-size: 13px;
}

.dataTables_wrapper .dataTables_paginate {
  padding: 8px 12px !important;
  font-size: 13px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  min-width: 32px;
  height: 32px;
  padding: 0 10px !important;
  margin-left: 4px !important;
  border: 1px solid var(--crm-line) !important;
  border-radius: 8px !important;
  background: white !important;
  color: var(--crm-ink) !important;
  line-height: 30px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #F2F4F7 !important;
  color: var(--crm-ink) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--crm-accent) !important;
  border-color: var(--crm-accent) !important;
  color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  opacity: .5;
  background: white !important;
  color: var(--crm-muted) !important;
}

table.dataTable thead th { border-bottom: 1px solid var(--crm-line) !important; }
table.dataTable tbody tr:hover > td { background: #F9FAFB; }
table.dataTable.no-footer { border-bottom: 0 !important; }

.badge { border-radius: 999px; font-weight: 600; }
.badge-new { background: #EFF4FF; color: var(--crm-info); }
.badge-progress { background: #FFFAEB; color: var(--crm-warning); }
.badge-success { background: #ECFDF3; color: var(--crm-success); }
.badge-danger { background: #FEF3F2; color: var(--crm-danger); }
.badge-neutral { background: #F2F4F7; color: var(--crm-muted); }

.fact-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.fact-strip .crm-card { margin-bottom: 0; box-shadow: none; padding: 14px 16px; }
.fact-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--crm-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.fact-value { color: var(--crm-ink); font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
a.fact-value { text-decoration: none; }
a.fact-value:hover { color: var(--crm-accent); }
.org-details-form .form-actions { justify-content: flex-end; }
.org-panel-form {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--crm-line);
}
.org-merge { max-width: 440px; }
.org-role { display: inline-flex; align-items: center; gap: 4px; margin: 2px 8px 2px 0; }
.org-actions { white-space: nowrap; }
.org-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 0;
  padding: 0;
  border: 1px solid var(--crm-line);
  border-radius: 6px;
  background: white;
  color: var(--crm-muted);
  vertical-align: middle;
}
.org-icon-btn i { font-size: 12px; line-height: 1; }
a.org-icon-btn { color: var(--crm-muted); font-weight: 500; text-decoration: none; }
a.org-icon-btn:hover { color: var(--crm-accent); }
.org-icon-btn:hover { color: var(--crm-accent); border-color: var(--crm-accent); }

.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col {
  min-width: 260px;
  background: #F8FAFC;
  border: 1px solid var(--crm-line);
  border-radius: 14px;
  padding: 12px;
}

.alert { border-radius: 10px; padding: 8px 12px; }
.alert ul { margin: 0; padding-left: 1.1rem; }

.portal-body { background: var(--crm-canvas); }
.portal-brand { display: flex; align-items: center; gap: 10px; }
.portal-top .brand-text { color: var(--crm-muted); }
.portal-top .brand-text strong { color: var(--crm-ink); }
.portal-top {
  height: var(--crm-header);
  background: white;
  border-bottom: 1px solid var(--crm-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.portal-shell { max-width: 880px; margin: 24px auto; padding: 0 16px 40px; }
a.crm-card { color: var(--crm-ink); text-decoration: none; font-weight: 650; }
a.crm-card:hover { border-color: var(--crm-accent); color: var(--crm-accent); }

.crm-shell.is-collapsed .crm-nav { width: var(--crm-sidebar-collapsed); flex-basis: var(--crm-sidebar-collapsed); }
.crm-shell.is-collapsed .brand-text,
.crm-shell.is-collapsed .nav-section,
.crm-shell.is-collapsed .nav-label { display: none; }
.crm-shell.is-collapsed .crm-nav a.crm-brand { justify-content: center; padding: 0; }
.crm-shell.is-collapsed .crm-nav .nav-scroll a { justify-content: center; padding: 0; }
.crm-shell.is-collapsed .nav-scroll { padding-top: 16px; }

.nav-tooltip {
  position: fixed;
  z-index: 1080;
  transform: translate(-4px, -50%);
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--crm-ink);
  color: white;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.18);
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease, transform .12s ease;
}
.nav-tooltip::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 50%;
  width: 8px;
  height: 8px;
  background: var(--crm-ink);
  transform: translateY(-50%) rotate(45deg);
}
.nav-tooltip.is-visible { opacity: 1; transform: translate(0, -50%); }

@media (max-width: 991px) {
  .crm-nav {
    position: fixed;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .crm-shell.is-open .crm-nav { transform: none; }
  .crm-shell.is-open .nav-backdrop { display: block; }
  .crm-shell.is-collapsed .crm-nav { width: var(--crm-sidebar); flex-basis: var(--crm-sidebar); }
  .crm-shell.is-collapsed .brand-text,
  .crm-shell.is-collapsed .nav-label { display: inline; }
  .crm-shell.is-collapsed .nav-section { display: block; }
  .crm-shell.is-collapsed .crm-nav a.crm-brand { justify-content: flex-start; padding: 0 20px; }
  .crm-shell.is-collapsed .crm-nav .nav-scroll a { justify-content: flex-start; padding: 0 12px; }
  .header-search kbd { display: none; }
  .crm-form, .fact-strip, .fact-strip--3 { grid-template-columns: 1fr; }
  .crm-content { padding: 16px; }
  .page-head {
    flex-direction: column;
    align-items: stretch;
  }
  .page-head > div { min-width: 0; }
  .page-head h1 {
    font-size: 20px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .page-head p { overflow-wrap: anywhere; word-break: break-word; }
  .page-head .page-actions {
    margin-left: 0;
    width: 100%;
  }
  .page-head .page-actions .btn { flex: 1 1 auto; }
  .section-card { padding: 16px; }
  .form-actions {
    flex-wrap: wrap;
  }
  .form-actions .btn { flex: 1 1 auto; min-width: 120px; }
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    float: none;
    display: block;
    text-align: left;
    padding: 10px 12px;
  }
  .dataTables_wrapper .dataTables_filter input { width: 100%; max-width: 100%; }
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    float: none !important;
    text-align: left !important;
    width: 100% !important;
  }
  .dataTables_wrapper .dataTables_paginate { padding-bottom: 12px !important; }
}

@media (max-width: 640px) {
  .crm-top { padding: 0 12px; gap: 8px; }
  .header-search { max-width: none; min-width: 0; }
  .header-tools { gap: 6px; }
  .lang-select { max-width: 104px; }
  .signout-label { display: none; }
  .page-head .page-actions { margin-left: 0; }
  .crm-content { padding: 12px; }
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter { float: none; text-align: left; }
  .dataTables_wrapper .dataTables_filter input { width: 100%; }
  .instance-detail-actions__btns .btn {
    width: 100%;
  }
  .instance-detail-actions__btns form { width: 100%; }
}

/* Home — My tasks worklist */
.home-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.home-panel {
  background: var(--crm-surface);
  border: 1px solid var(--crm-line);
  border-radius: 14px;
  box-shadow: var(--crm-shadow);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.home-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--crm-line);
  background: #F8FAFC;
}

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

.home-panel__title h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--crm-ink);
}

.home-panel__icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 14px;
}

.home-panel--overdue .home-panel__icon { background: #FEF3F2; color: var(--crm-danger); }
.home-panel--today .home-panel__icon { background: #FFFAEB; color: var(--crm-warning); }
.home-panel--leads .home-panel__icon { background: var(--crm-accent-soft); color: var(--crm-accent); }
.home-panel--tickets .home-panel__icon { background: #EFF4FF; color: var(--crm-info); }

.home-panel__count {
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #EEF2F6;
  color: var(--crm-muted);
  font-size: 12px;
  font-weight: 700;
}

.home-panel__count.is-alert {
  background: #FEF3F2;
  color: var(--crm-danger);
}

.home-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  flex: 1;
}

.home-list li + li { margin-top: 2px; }

.home-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--crm-ink);
  text-decoration: none;
  transition: background-color .12s ease;
}

a.home-item:hover {
  background: #F2F4F7;
  color: var(--crm-ink);
}

.home-item__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.home-item__title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-item__sub,
.home-item__meta {
  font-size: 12px;
  color: var(--crm-muted);
  font-weight: 500;
  white-space: nowrap;
}

.home-item__meta--danger { color: var(--crm-danger); font-weight: 650; }

.home-empty {
  margin: 0;
  padding: 28px 20px;
  color: var(--crm-muted);
  font-size: 13px;
  text-align: center;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 991px) {
  .home-board { grid-template-columns: 1fr; }
}

/* Landing */
html:has(body.landing-body) {
  height: 100%;
  overflow: hidden;
}

.landing-body {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse 70% 55% at 88% 8%, rgba(43, 179, 163, 0.22), transparent 58%),
    radial-gradient(ellipse 55% 45% at 8% 18%, rgba(15, 118, 110, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 40% at 70% 92%, rgba(23, 33, 46, 0.1), transparent 55%),
    linear-gradient(165deg, #E8EEF6 0%, #F4F7FB 42%, #EEF5F3 100%);
}

.landing-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(23, 33, 46, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 46, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 35%, #000 20%, transparent 75%);
}

.landing-body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 78%, rgba(15, 118, 110, 0.08), transparent 28%),
    radial-gradient(circle at 92% 55%, rgba(43, 179, 163, 0.1), transparent 24%);
}

.landing-top {
  height: var(--crm-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(230, 234, 240, 0.9);
  backdrop-filter: blur(14px) saturate(1.2);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.landing-top .brand-text { color: var(--crm-muted); font-size: 17px; }
.landing-top .brand-text strong { color: var(--crm-ink); }

.landing-top__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.landing-top__signin {
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.22);
}

.landing-top__signin:hover {
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.3);
}

.landing-shell {
  flex: 1;
  min-height: 0;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 40px 28px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.landing-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 36px;
}

.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 14px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(231, 245, 243, 0.9);
  border: 1px solid rgba(197, 232, 227, 0.9);
  color: var(--crm-accent);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.landing-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 4.2vw, 42px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: var(--crm-ink);
}

.landing-lead {
  margin: 0 0 30px;
  max-width: 34em;
  color: var(--crm-muted);
  font-size: 16.5px;
  line-height: 1.6;
}

.landing-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.landing-signin {
  height: 46px;
  min-width: 148px;
  padding: 0 24px;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.landing-signin:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.32);
}

.landing-hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
  overflow: hidden;
  animation: landing-rise 0.7s ease both;
}

.landing-glow {
  position: absolute;
  width: 78%;
  height: 70%;
  top: 18%;
  left: 11%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 179, 163, 0.35), transparent 68%);
  filter: blur(28px);
  z-index: 0;
  pointer-events: none;
}

.landing-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(230, 234, 240, 0.95);
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.04),
    0 18px 40px rgba(23, 33, 46, 0.1),
    0 40px 80px rgba(15, 118, 110, 0.08);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.landing-panel__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 13px 16px;
  background: linear-gradient(180deg, #1B2736 0%, var(--crm-nav) 100%);
}

.landing-panel__bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  flex: 0 0 auto;
}

.landing-panel__bar span:nth-child(1) { background: #2BB3A3; }
.landing-panel__bar span:nth-child(2) { background: rgba(255, 255, 255, 0.35); }
.landing-panel__bar span:nth-child(3) { background: rgba(255, 255, 255, 0.22); }

.landing-panel__title {
  margin-left: 10px;
  color: rgba(220, 227, 235, 0.85);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.landing-panel__body {
  display: grid;
  grid-template-columns: 52px 1fr;
  min-height: 290px;
}

.landing-panel__side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 8px;
  background: #F1F4F8;
  border-right: 1px solid var(--crm-line);
}

.landing-side-item {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #7F8C9C;
  font-size: 14px;
}

.landing-side-item.is-active {
  background: #1C5C59;
  color: white;
}

.landing-panel__main { padding: 14px; }

.landing-panel__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.landing-tile {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--crm-line);
  border-radius: 10px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  color: var(--crm-ink);
  min-height: 64px;
}

.landing-tile i {
  grid-row: 1 / span 2;
  font-size: 16px;
  color: var(--crm-muted);
}

.landing-tile strong {
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.2;
}

.landing-tile em {
  font-style: normal;
  font-size: 11px;
  color: var(--crm-muted);
  font-weight: 500;
}

.landing-tile--accent {
  background: linear-gradient(180deg, #F3FBFA 0%, var(--crm-accent-soft) 100%);
  border-color: #C5E8E3;
}

.landing-tile--accent i { color: var(--crm-accent); }
.landing-tile--accent em { color: var(--crm-accent); }

.landing-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.landing-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  background: #FFFFFF;
}

.landing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crm-info);
  flex: 0 0 auto;
}

.landing-dot--teal { background: var(--crm-accent); }
.landing-dot--muted { background: #98A2B3; }

.landing-row__line {
  height: 7px;
  width: 42%;
  border-radius: 4px;
  background: linear-gradient(90deg, #E6EAF0, #F4F7FB);
}

.landing-row__line--long { width: 58%; }
.landing-row__line--mid { width: 48%; }

.landing-pill {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 650;
  color: var(--crm-accent);
  background: var(--crm-accent-soft);
}

.landing-pill--soft {
  color: var(--crm-muted);
  background: #F2F4F7;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  animation: landing-rise 0.75s ease 0.08s both;
}

.landing-feature {
  padding: 22px 20px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(230, 234, 240, 0.95);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px rgba(23, 33, 46, 0.04);
  backdrop-filter: blur(8px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.landing-feature:hover {
  transform: translateY(-2px);
  border-color: #C5E8E3;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 16px 36px rgba(15, 118, 110, 0.1);
}

.landing-feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #F3FBFA, var(--crm-accent-soft));
  border: 1px solid #C5E8E3;
  color: var(--crm-accent);
  font-size: 16px;
}

.landing-feature h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 650;
  color: var(--crm-ink);
}

.landing-feature p {
  margin: 0;
  color: var(--crm-muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.landing-footer {
  flex: 0 0 auto;
  padding: 12px 28px 18px;
  text-align: center;
  color: var(--crm-muted);
  font-size: 12.5px;
}

@keyframes landing-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  html:has(body.landing-body) { overflow: auto; }
  .landing-body {
    height: auto;
    max-height: none;
    min-height: 100dvh;
    overflow: visible;
  }
  .landing-hero { grid-template-columns: 1fr; gap: 28px; margin-bottom: 28px; }
  .landing-features { grid-template-columns: 1fr; }
  .landing-top { padding: 0 16px; }
  .landing-shell {
    padding: 28px 16px 24px;
    overflow: visible;
    justify-content: flex-start;
  }
  .landing-panel { max-width: 100%; }
  .landing-hero__visual { overflow: visible; }
}

.relationship-compose {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 16px;
}
.relationship-compose .form-select {
  width: auto;
  flex: 1 1 220px;
  min-width: 0;
  height: 34px;
  font-size: 13px;
  font-weight: 400;
}
.relationship-compose .btn { height: 34px; }

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--crm-accent-soft);
  color: var(--crm-accent);
  font-size: 12px;
  font-weight: 650;
}
.timeline-compose {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--crm-line);
}
.timeline-compose .form-label { margin: 0; font-size: 13px; }
.timeline-compose .form-control,
.timeline-compose .form-select {
  height: 34px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
}
.timeline-compose textarea.form-control {
  width: 100%;
  height: auto;
  min-height: 72px;
}
.timeline-compose .compose-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.timeline-compose .compose-row .form-control { flex: 1; min-width: 0; }
.timeline-compose .compose-row .form-select { width: 220px; max-width: 100%; }
.timeline-compose .btn { height: 34px; }

@media (max-width: 480px) {
  .landing-top__tools .lang-select { display: none; }
  .landing-panel__body { grid-template-columns: 1fr; }
  .landing-panel__side { display: none; }
}
