﻿:root {
  --bg: #eef3f8;
  --bg-strong: #e2ebf5;
  --card: #ffffff;
  --card-soft: #f8fbff;
  --text: #172435;
  --muted: #607089;
  --line: #d9e3ef;
  --line-strong: #c7d4e4;
  --primary: #2b63d9;
  --primary-hover: #214db0;
  --secondary: #4f657f;
  --success: #218657;
  --success-soft: #def5e8;
  --danger: #c54343;
  --danger-soft: #ffe8e8;
  --warning: #c98a1f;
  --warning-soft: #fff3df;
  --info-soft: #e6efff;
  --shadow: 0 14px 36px rgba(17, 34, 58, 0.09);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #f8fbff 0, transparent 28%),
    linear-gradient(180deg, #f4f8fc 0%, #eef3f8 48%, #e7edf5 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

a {
  color: inherit;
}

.container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 26px 20px 38px;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: linear-gradient(90deg, #111d31 0%, #163052 45%, #153660 100%);
  box-shadow: 0 8px 30px rgba(10, 19, 33, 0.12);
}

.top-nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 10px;
  transition: background 0.18s ease, color 0.18s ease;
}

.top-nav a.nav-link-with-badge {
  position: relative;
  padding-right: 34px;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #d92d20;
  color: #ffffff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  white-space: nowrap;
}

.top-nav a:hover,
.top-nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.top-nav .spacer {
  flex: 1;
}

.nav-user {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.1;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.page-head .muted {
  margin-top: 6px;
  max-width: 820px;
}

.page-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-pill {
  min-width: 128px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.stat-pill .label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-pill strong {
  font-size: 24px;
  line-height: 1;
}

.card,
.section-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.card + .card,
.section-card + .section-card {
  margin-top: 14px;
}

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

.card-title {
  font-size: 18px;
  line-height: 1.2;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.mono {
  font-family: Consolas, 'Courier New', monospace;
}

.grid {
  display: grid;
  gap: 12px;
}

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

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

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

.dashboard-grid {
  margin-bottom: 16px;
}

.dashboard-tile {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(43, 99, 217, 0.14), transparent 36%),
    #ffffff;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-tile:hover {
  transform: translateY(-2px);
  border-color: #b6c9e4;
  box-shadow: 0 18px 44px rgba(17, 34, 58, 0.13);
}

.dashboard-tile.warning {
  background:
    radial-gradient(circle at top right, rgba(201, 138, 31, 0.18), transparent 36%),
    #ffffff;
}

.dashboard-tile .label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dashboard-tile strong {
  font-size: 34px;
  line-height: 1;
}

.dashboard-tile small {
  color: var(--muted);
  line-height: 1.35;
}

.campaign-layout,
.details-layout {
  align-items: start;
}

.stack-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.campaign-flow-shell {
  gap: 16px;
}

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

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

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

.field-span-2 {
  grid-column: span 2;
}

.field .status {
  margin-bottom: 0;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

label {
  color: #30435d;
  font-size: 13px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.multi-dropdown {
  position: relative;
}

.multi-dropdown-trigger {
  width: 100%;
  justify-content: space-between;
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--text);
  font-weight: 500;
  box-shadow: none;
}

.multi-dropdown-trigger:hover {
  background: #ffffff;
  border-color: var(--primary);
  transform: none;
}

.multi-dropdown-trigger.has-value {
  color: var(--text);
}

.multi-dropdown-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.multi-dropdown-arrow {
  color: var(--muted);
  margin-left: 12px;
  font-size: 12px;
}

.multi-dropdown-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(17, 34, 58, 0.14);
}

.multi-dropdown-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid #edf2f9;
}

.multi-dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.multi-dropdown-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.16s ease;
}

.multi-dropdown-option:hover {
  background: #f4f8fd;
}

.multi-dropdown-option input {
  width: 16px;
  height: 16px;
  min-height: auto;
  margin: 0;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 99, 217, 0.16);
}

input[readonly],
.readonly-input {
  background: #f4f8fd;
  color: #4a5c74;
  border-color: #d8e2ef;
  cursor: default;
}

.actions,
.toolbar-actions,
.primary-actions,
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.toolbar-actions {
  margin-top: 14px;
}

.primary-actions {
  gap: 12px;
}

button,
.btn-link {
  appearance: none;
  border: none;
  border-radius: 11px;
  padding: 11px 15px;
  min-height: 42px;
  background: var(--primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.18s ease, box-shadow 0.18s ease;
}

button:hover,
.btn-link:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

button:disabled,
.btn-link:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

button.is-busy {
  position: relative;
}

button.secondary,
.btn-link.secondary {
  background: var(--secondary);
}

button.secondary:hover,
.btn-link.secondary:hover {
  background: #435972;
}

button.success {
  background: var(--success);
}

button.success:hover {
  background: #1b7249;
}

button.warning {
  background: var(--warning);
}

button.warning:hover {
  background: #b17719;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #aa3232;
}

button.ghost,
.btn-link.ghost {
  background: #edf4ff;
  color: #274a87;
}

button.ghost:hover,
.btn-link.ghost:hover {
  background: #dce8ff;
}

.btn-link.small,
button.small {
  min-height: 34px;
  padding: 8px 11px;
  font-size: 12px;
  border-radius: 9px;
}

.status {
  display: none;
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.status-row {
  margin-top: 12px;
}

.status-inline {
  margin-bottom: 0;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 10px;
  line-height: 1.35;
  width: fit-content;
  max-width: 100%;
}

.status-inline.ok,
.status-inline.error {
  display: inline-flex;
  align-items: center;
}

.status.ok {
  display: block;
  color: #0c6037;
  background: var(--success-soft);
  border: 1px solid #bfe7cf;
}

.status.error {
  display: block;
  color: #8e2424;
  background: var(--danger-soft);
  border: 1px solid #f0c4c4;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.compact-table table {
  min-width: 560px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #e9eff7;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #f4f8fd;
  color: #42566e;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr:hover td {
  background: #f9fbff;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.badge-default {
  color: #36495f;
  background: #e9eef6;
}

.badge-success {
  color: #1d7648;
  background: #daf3e6;
}

.badge-warning {
  color: #95630f;
  background: #fff0d8;
}

.badge-danger {
  color: #982a2a;
  background: #ffe3e3;
}

.badge-info {
  color: #1c4fa8;
  background: #dfeafe;
}

.loading-state,
.retry-state {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eef7;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  animation: shimmer 1.35s infinite;
}

.skeleton-title {
  width: 48%;
  height: 18px;
}

.skeleton-line {
  width: 100%;
  height: 12px;
}

.skeleton-line.short {
  width: 64%;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.toast-container {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
}

.toast {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(17, 34, 58, 0.18);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast-success {
  border-color: #bfe7cf;
  background: var(--success-soft);
  color: #0c6037;
}

.toast-error {
  border-color: #f0c4c4;
  background: var(--danger-soft);
  color: #8e2424;
}

.toast-warning {
  border-color: #f5d9a8;
  background: var(--warning-soft);
  color: #8a5b0d;
}

.toast-hide {
  opacity: 0;
  transform: translateY(8px);
}

.chips,
.chips-block {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editable-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eff5fd;
  border: 1px solid #d8e4f4;
  color: #355074;
  font-size: 12px;
  font-weight: 600;
}

.editable-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border-radius: 999px;
  background: #eff5fd;
  border: 1px solid #d8e4f4;
  color: #355074;
  font-size: 12px;
  font-weight: 600;
}

.editable-pill-remove {
  min-width: 24px;
  min-height: 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  background: #dce8ff;
  color: #284b82;
  box-shadow: none;
  font-size: 14px;
  line-height: 1;
}

.editable-pill-remove:hover {
  background: #c8dbff;
  transform: none;
}

.groupage-editor-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #dce6f5;
  background: #f7fbff;
}

.info-list,
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.info-item {
  padding: 12px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.info-item .label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.info-item .value {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.stacked-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.recipient-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.recipient-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 540px;
  overflow: auto;
  padding-right: 2px;
}

.recipient-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.recipient-card.included {
  border-color: #cfe1ff;
  background: #f8fbff;
}

.recipient-card.excluded {
  border-color: #ead9d9;
  background: #fff8f8;
  opacity: 0.9;
}

.recipient-card-main {
  flex: 1;
  min-width: 0;
}

.recipient-card-top {
  margin-bottom: 10px;
}

.recipient-data-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.recipient-data-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recipient-data-label {
  font-size: 12px;
  font-weight: 700;
  color: #55667f;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recipient-routes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recipient-route-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f3f8ff;
  border: 1px solid #dbe7f6;
  font-size: 13px;
  line-height: 1.45;
}

.recipient-bot-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

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

.recipient-card-actions {
  display: flex;
  align-items: center;
}

.recipient-card-toggle {
  min-width: 116px;
}

.recipient-state {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.recipient-state.included {
  background: #dff3e8;
  color: #1c7346;
}

.recipient-state.excluded {
  background: #f7e4e4;
  color: #9a2f2f;
}

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

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

.dispatch-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card-soft);
}

.dispatch-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.chip-muted {
  background: #f2f4f8;
  border-color: #d9e0ea;
  color: #5d6d81;
}

.agent-card,
.agent-inline-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card-soft);
}

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

.agent-link {
  display: block;
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: #eef5ff;
  color: #1456b8;
  font-size: 12px;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.agent-link:hover {
  background: #deebff;
}

.agent-journal-card {
  align-items: flex-start;
  flex-wrap: wrap;
}

.agent-journal-main {
  flex: 1 1 280px;
  min-width: 0;
}

.agent-journal-badge {
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  padding: 4px 9px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #dce5f2;
  margin-top: 10px;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2f72e8 0%, #2b9e6a 100%);
}

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

.route-edit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.route-action-cell {
  width: 146px;
  vertical-align: top;
}

.route-row-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 132px;
  align-content: start;
}

.route-action-cell {
  width: 132px;
}

.route-row-actions button {
  width: 100%;
  white-space: nowrap;
}

.chat-box {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f7fbff;
  padding: 12px;
  max-height: 430px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #dde7f3;
  background: #ffffff;
  line-height: 1.45;
  word-break: break-word;
}

.chat-message.out {
  align-self: flex-end;
  background: #e1ecff;
  border-color: #c4d8ff;
}

.chat-message.in {
  align-self: flex-start;
}

.chat-message-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.thread-card {
  cursor: pointer;
}

.thread-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.metric-card .value {
  font-size: 24px;
}

.button-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
  background: var(--primary);
  font-weight: 700;
}

.button-like.secondary {
  background: #64748b;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.chat-msg {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  line-height: 1.45;
  word-break: break-word;
}

.chat-msg.in {
  align-self: flex-start;
  background: #ffffff;
  border-color: #dde7f3;
}

.chat-msg.out {
  align-self: flex-end;
  background: #e1ecff;
  border-color: #c4d8ff;
}

.chat-msg.bot {
  align-self: flex-end;
  background: #e4f6ee;
  border-color: #bfe7d4;
}

.chat-msg.system {
  align-self: center;
  max-width: 94%;
  background: #f1f5fb;
  border-color: #dae4f0;
}

.chat-author {
  margin-bottom: 4px;
  color: #55667f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-meta {
  margin-top: 6px;
  color: #6f7d94;
  font-size: 11px;
}

.notification-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.notification-card.status-new {
  border-left: 5px solid #f0b429;
  background: #fff8de;
}

.notification-card.status-read {
  border-left: 5px solid #e5e7eb;
  background: #ffffff;
}

.notification-card.status-deferred {
  border-left: 5px solid #2563eb;
  background: #edf4ff;
}

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

.notification-head .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.notification-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.details-panel {
  position: sticky;
  top: 16px;
}

.details-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.timeline {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.timeline-item {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px #e7efff;
}

.timeline-item strong {
  color: var(--text);
}

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

.list-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.list-card-main {
  min-width: 0;
}

.list-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 8px;
}

.empty {
  padding: 22px 14px;
  border: 1px dashed #c6d5e9;
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.56);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  bottom: 5px;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 10px;
  background: #edf4ff;
  color: #34537f;
  box-shadow: none;
}

.password-toggle:hover {
  background: #dfeafe;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

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

.password-icon--open {
  display: none;
}

.password-toggle.is-visible .password-icon--closed {
  display: none;
}

.password-toggle.is-visible .password-icon--open {
  display: inline-flex;
}

.login-shell {
  max-width: 600px;
  margin: 82px auto 0;
}

.login-caption {
  margin: 10px 0 18px;
}

.login-card {
  padding: 24px;
}

.info-banner {
  margin-bottom: 14px;
  background: #f4f8fd;
  border-color: #d5e1f0;
  color: #30445f;
  line-height: 1.55;
}

body.modal-open {
  overflow: hidden;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-shell[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 23, 39, 0.48);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(17, 34, 58, 0.22);
}

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

.modal-close {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 10px;
  background: #edf4ff;
  color: #3b5477;
  box-shadow: none;
  font-size: 22px;
  line-height: 1;
}

.modal-close:hover {
  background: #dce8ff;
}

.modal-text {
  margin-bottom: 18px;
  line-height: 1.5;
  color: #33475f;
}

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

@media (max-width: 1100px) {
  .grid-2,
  .split-panels {
    grid-template-columns: 1fr;
  }

  .details-panel {
    position: static;
  }

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

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

@media (max-width: 820px) {
  .container {
    padding: 18px 14px 30px;
  }

  .field-span-2 {
    grid-column: auto;
  }

  .form-grid,
  .form-grid-wide,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .recipient-card,
  .recipient-card-head,
  .notification-head,
  .agent-inline-header {
    flex-direction: column;
    align-items: stretch;
  }

  .recipient-data-grid {
    grid-template-columns: 1fr;
  }

  .chat-msg {
    max-width: 96%;
  }

  table {
    min-width: 680px;
  }

  .route-action-cell {
    width: 188px;
  }

  .route-row-actions {
    grid-template-columns: 1fr 1fr;
    min-width: 168px;
  }
}

@media (max-width: 560px) {
  .top-nav {
    padding: 10px;
    gap: 6px;
  }

  .top-nav a {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
    padding: 9px 8px;
  }

  .top-nav .spacer,
  .top-nav .nav-user {
    flex-basis: 100%;
    text-align: center;
  }

  h1 {
    font-size: 25px;
  }

  .page-head,
  .section-head,
  .list-card,
  .notification-head {
    flex-direction: column;
    align-items: stretch;
  }

  .page-stats,
  .quick-actions,
  .toolbar-actions,
  .actions {
    width: 100%;
  }

  .stat-pill,
  button,
  .btn-link {
    width: 100%;
  }

  .toast-container {
    right: 14px;
    bottom: 14px;
  }
}

/* CRM polish */
.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 28px;
  border: 1px solid rgba(43, 99, 217, 0.2);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 10%, rgba(33, 134, 87, 0.16), transparent 28%),
    radial-gradient(circle at 86% 16%, rgba(43, 99, 217, 0.18), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f2f7ff 100%);
  box-shadow: 0 22px 52px rgba(17, 34, 58, 0.12);
}

.hero-copy h1 {
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}

.hero-copy p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.hero-actions,
.quick-actions-grid,
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 22px;
}

.hero-panel {
  min-height: 220px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(8px);
}

.hero-panel-title {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-focus-list,
.stack-list,
.stack-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.focus-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7fbff;
  border: 1px solid var(--line);
}

.focus-row span {
  color: var(--muted);
  font-size: 13px;
}

.focus-row strong {
  font-size: 24px;
}

.success-tile {
  background:
    radial-gradient(circle at top right, rgba(33, 134, 87, 0.18), transparent 38%),
    #ffffff;
}

.dashboard-panels {
  align-items: start;
  margin-bottom: 16px;
}

.panel-card {
  min-height: 320px;
}

.accent-panel {
  border-color: rgba(201, 138, 31, 0.3);
  background:
    radial-gradient(circle at top right, rgba(201, 138, 31, 0.14), transparent 36%),
    #ffffff;
}

.section-head.compact {
  margin-bottom: 12px;
}

.small-link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.list-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.list-card:hover {
  transform: translateY(-1px);
  border-color: #b9cbe4;
  box-shadow: 0 10px 24px rgba(17, 34, 58, 0.08);
}

.list-card-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.list-card-side {
  flex: none;
  align-self: flex-start;
}

.missing-inline {
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.empty-state.compact-empty,
.compact-empty {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: var(--card-soft);
  color: var(--muted);
}

.empty-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--info-soft);
  color: var(--primary);
  font-size: 24px;
  line-height: 1;
}

.quick-actions-card {
  margin-top: 16px;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-action {
  min-height: 76px;
  display: flex;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, #ffffff 0%, #f6faff 100%);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(17, 34, 58, 0.06);
}

.quick-action:hover {
  border-color: #b9cbe4;
}

.filters-card {
  margin-bottom: 14px;
}

.data-table.carriers-table td {
  vertical-align: top;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--info-soft);
  color: #24416b;
  font-size: 12px;
  font-weight: 700;
}

.muted-chip {
  background: #eef2f7;
  color: var(--muted);
}

.btn-link.primary,
button.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

button.success,
.btn-link.success,
.btn-link.primary.success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

button.secondary,
.btn-link.secondary {
  background: #eef3f8;
  color: var(--text);
  border-color: var(--line-strong);
}

button.danger,
.btn-link.danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.mini-skeleton {
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(90deg, #edf3fa, #f9fbfd, #edf3fa);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.2s linear infinite;
}

.mini-skeleton.short {
  width: 72%;
}

@keyframes skeleton-pulse {
  to { background-position: -200% 0; }
}

@media (max-width: 980px) {
  .hero-card,
  .grid-2,
  .grid-3,
  .grid-4,
  .quick-actions-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    padding: 22px;
  }

  .details-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 18px 12px 28px;
  }

  .top-nav {
    padding: 10px;
    gap: 6px;
  }

  .top-nav a {
    padding: 8px 9px;
    font-size: 13px;
  }

  .top-nav .spacer,
  .nav-user {
    display: none;
  }

  .hero-copy h1 {
    font-size: 34px;
  }

  .hero-copy p {
    font-size: 15px;
  }

  .section-card,
  .card,
  .hero-card {
    border-radius: 18px;
  }

  .responsive-table-wrap,
  .table-wrap {
    overflow-x: auto;
  }

  table {
    min-width: 760px;
  }

  .hero-actions,
  .toolbar-actions {
    flex-direction: column;
  }

  .hero-actions > *,
  .toolbar-actions > *,
  .quick-action {
    width: 100%;
    justify-content: center;
  }
}

.is-hidden {
  display: none !important;
}

.collapsible-card {
  scroll-margin-top: 18px;
}

.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.details-layout > *,
.table-wrap {
  min-width: 0;
}

/* CRM refinements */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-button {
  background: #eef3f8;
  color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}

.tab-button.active,
.tab-button:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.recipient-card-actions {
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

@media (max-width: 640px) {
  .recipient-card-actions {
    align-items: stretch;
    width: 100%;
  }
}

