/* Этот файл содержит все стили приложения: layout, карточки, формы и адаптивность. */
:root {
  --bg: #f4efe6;
  --paper: #fffdf8;
  --panel: #f8f2e7;
  --ink: #1f2521;
  --muted: #68736c;
  --accent: #17624c;
  --accent-soft: #dcefe6;
  --line: #d9d0c2;
  --warn: #9d4b2b;
  --shadow: 0 18px 40px rgba(38, 43, 33, 0.1);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: Bahnschrift, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(23, 98, 76, 0.16), transparent 30%),
    radial-gradient(circle at bottom right, rgba(197, 120, 58, 0.14), transparent 28%),
    linear-gradient(180deg, #f8f4ec 0%, #f2ebdf 100%);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(248, 244, 236, 0.82);
  backdrop-filter: blur(10px);
}

.loading-card {
  width: min(100%, 420px);
  padding: 28px 26px;
  text-align: center;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 4px solid rgba(23, 98, 76, 0.14);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.loading-eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  color: var(--muted);
}

.loading-title {
  margin-bottom: 10px;
}

.loading-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 37, 33, 0.18);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(100%, 860px);
  max-height: min(90vh, 900px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(31, 37, 33, 0.08);
}

.modal-header,
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.modal-actions {
  margin-top: 18px;
}

.edit-form {
  margin-top: 18px;
}

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

.field input[readonly],
.field textarea[readonly],
.field select[disabled] {
  background: #f2ede3;
  color: #61584d;
  cursor: default;
}

.field-wide {
  grid-column: 1 / -1;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--muted);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.05;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 2.2rem;
}

h3 {
  font-size: 1.45rem;
}

.helper-text,
.detail-placeholder p,
.empty-state p {
  color: var(--muted);
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 8px;
}

.field-inline {
  min-width: 180px;
  flex: 1 1 220px;
}

.actions,
.hero-actions,
.detail-fields-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.link-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.session-card {
  min-width: 220px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--panel);
  display: grid;
  gap: 4px;
}

.session-card strong {
  font-size: 1rem;
}

.session-meta,
.session-role {
  color: var(--muted);
  font-size: 0.9rem;
}

.toolbar-actions {
  align-self: end;
}

.checkbox-field {
  align-content: start;
}

.toggle-field {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
}

.toggle-field input {
  width: 18px;
  height: 18px;
}

.danger-button {
  min-height: 38px;
  padding: 10px 15px;
  border: 1px solid rgba(200, 66, 66, 0.26);
  border-radius: 7px;
  background: #fff;
  color: var(--warn);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.danger-button:hover {
  transform: translateY(-1px);
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 0.84rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
}

.user-badge.inactive {
  background: #f0dfd7;
  color: var(--warn);
}

.custom-period-range {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.cell-title {
  font-weight: 700;
}

.cell-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.complaint-snippet {
  max-width: 380px;
  color: var(--muted);
  line-height: 1.45;
}

.stage-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 7px;
  background: #e4f6ed;
  color: #0d6b39;
  font-size: 0.86rem;
  font-weight: 700;
}

.audit-card {
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

.audit-card.is-pinned {
  border: 1px solid rgba(23, 98, 76, 0.18);
  box-shadow: inset 0 0 0 1px rgba(23, 98, 76, 0.08);
}

.audit-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.audit-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.audit-pin-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(23, 98, 76, 0.12);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.audit-pin-button {
  padding: 8px 14px;
  font-size: 0.82rem;
}

.audit-summary {
  margin: 0;
  font-weight: 700;
  line-height: 1.45;
}

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

.audit-change {
  padding-top: 8px;
  border-top: 1px solid rgba(31, 37, 33, 0.08);
}

.audit-change:first-child {
  padding-top: 0;
  border-top: none;
}

.audit-change-before,
.audit-change-after {
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.audit-change-before {
  color: var(--muted);
}

.audit-change-after {
  font-weight: 700;
}

.audit-empty-state {
  padding: 20px;
}

.field-row {
  padding: 12px 14px;
}

.field-key {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-value {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.callback-alert-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.callback-alert-link.has-alerts {
  background: rgba(200, 66, 66, 0.14);
  color: var(--warn);
  border-color: rgba(200, 66, 66, 0.46);
  box-shadow: 0 0 0 3px rgba(200, 66, 66, 0.1);
  animation: callback-link-pulse 1.8s ease-in-out infinite;
}

.callback-alert-badge {
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 98, 76, 0.14);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.callback-alert-badge.has-alerts {
  background: var(--warn);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(200, 66, 66, 0.42);
  animation: callback-badge-pulse 1.2s ease-in-out infinite;
}

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

.callbacks-status {
  margin: 0;
}

.toast-container {
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 1200;
  display: grid;
  gap: 10px;
  width: min(440px, calc(100vw - 32px));
}

.toast-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.98);
  border: 1px solid rgba(31, 37, 33, 0.08);
  box-shadow: 0 18px 36px rgba(38, 43, 33, 0.16);
  display: grid;
  gap: 8px;
}

.toast-card-danger {
  border-color: rgba(200, 66, 66, 0.42);
  box-shadow: 0 22px 46px rgba(200, 66, 66, 0.22);
}

.toast-card-urgent {
  position: relative;
  border-left: 6px solid var(--warn);
  animation: toast-urgent-pop 0.24s ease-out, toast-urgent-pulse 1.6s ease-in-out 3;
}

.toast-card-urgent strong {
  color: var(--warn);
}

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

.toast-close-button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.toast-copy {
  margin: 0;
  line-height: 1.45;
}

.toast-link-button {
  justify-content: center;
}

.empty-state {
  padding: 42px 20px;
  text-align: center;
}

.hidden {
  display: none !important;
}

.hidden-config {
  display: none;
}

.status-error {
  color: var(--warn);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes callback-badge-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(200, 66, 66, 0.42);
  }

  70% {
    transform: scale(1.08);
    box-shadow: 0 0 0 9px rgba(200, 66, 66, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(200, 66, 66, 0);
  }
}

@keyframes callback-link-pulse {
  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.08);
  }
}

@keyframes toast-urgent-pop {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-urgent-pulse {
  0%,
  100% {
    box-shadow: 0 22px 46px rgba(200, 66, 66, 0.22);
  }

  50% {
    box-shadow: 0 22px 46px rgba(200, 66, 66, 0.36), 0 0 0 4px rgba(200, 66, 66, 0.12);
  }
}

@media (max-width: 1180px) {
  .stats-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 16px;
  }

  .hero-card {
    padding: 20px;
    flex-direction: column;
    align-items: stretch;
  }

  .edit-form-grid {
    grid-template-columns: 1fr;
  }

  .deals-table {
    min-width: 720px;
  }

  .toast-container {
    right: 16px;
    top: 16px;
    width: calc(100vw - 32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .callback-alert-link.has-alerts,
  .callback-alert-badge.has-alerts,
  .toast-card-urgent {
    animation: none;
  }
}

/* Compact sidebar layout */
:root {
  --bg: #f4f7fb;
  --paper: #ffffff;
  --panel: #f5f8fc;
  --ink: #172033;
  --muted: #667085;
  --accent: #0f7b3f;
  --accent-soft: #e9f7ef;
  --line: #dfe6f0;
  --warn: #c84242;
  --sidebar-bg: #08223d;
  --sidebar-bg-2: #0b2b4a;
  --sidebar-text: #d6e3f2;
  --sidebar-muted: #8aa2bd;
  --sidebar-active: #1683f3;
  --shadow: 0 10px 26px rgba(15, 35, 64, 0.07);
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

body {
  background: var(--bg);
  color: var(--ink);
}

.app-frame {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.2s ease;
}

.app-frame.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 18px 10px;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, #061b31 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
  z-index: 30;
}

.app-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px;
  min-height: 36px;
}

.app-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: #fff;
  font-weight: 800;
  font-size: 1.18rem;
  white-space: nowrap;
}

.app-logo-accent {
  color: #33a4ff;
}

.sidebar-toggle-button {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.sidebar-toggle-lines,
.sidebar-toggle-lines::before,
.sidebar-toggle-lines::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: #d8e5f5;
  content: "";
}

.sidebar-toggle-lines {
  position: relative;
}

.sidebar-toggle-lines::before,
.sidebar-toggle-lines::after {
  position: absolute;
  left: 0;
}

.sidebar-toggle-lines::before {
  top: -5px;
}

.sidebar-toggle-lines::after {
  top: 5px;
}

.app-nav {
  display: grid;
  gap: 7px;
}

.app-nav-link {
  position: relative;
  min-height: 44px;
  padding: 0 11px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--sidebar-text);
  font-weight: 700;
  transition: background 0.16s ease, color 0.16s ease;
}

.app-nav-link:hover,
.app-nav-link.is-active {
  background: var(--sidebar-active);
  color: #fff;
}

.app-nav-icon {
  position: relative;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: inherit;
}

.app-nav-icon-dashboard {
  border: 1px solid currentColor;
}

.app-nav-icon-dashboard::before {
  position: absolute;
  inset: 4px;
  content: "";
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  box-shadow: 6px 0 0 -5px currentColor, -6px 0 0 -5px currentColor;
}

.app-nav-icon-callbacks::before {
  position: absolute;
  inset: 4px 5px;
  content: "";
  border: 2px solid currentColor;
  border-left-width: 4px;
  border-radius: 9px 9px 9px 2px;
  transform: rotate(-35deg);
}

.app-nav-icon-visits::before {
  position: absolute;
  inset: 3px 5px;
  content: "";
  border: 2px solid currentColor;
  border-top: 5px solid currentColor;
  border-radius: 4px;
}

.app-nav-icon-visits::after {
  position: absolute;
  left: 9px;
  bottom: 3px;
  width: 4px;
  height: 4px;
  content: "";
  border-radius: 999px;
  background: currentColor;
}

.app-nav-icon-techpods::before {
  position: absolute;
  left: 4px;
  top: 3px;
  width: 14px;
  height: 16px;
  content: "";
  border: 2px solid currentColor;
  border-radius: 4px;
}

.app-nav-icon-techpods::after {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 8px;
  height: 2px;
  content: "";
  background: currentColor;
  box-shadow: 0 4px 0 currentColor;
}

.app-nav-icon-report::before {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 12px;
  content: "";
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  box-shadow: 6px -3px 0 -2px currentColor, 12px -7px 0 -2px currentColor;
}

.app-nav-icon-nab::before {
  position: absolute;
  inset: 3px;
  content: "";
  border: 2px solid currentColor;
  border-radius: 4px;
}

.app-nav-icon-nab::after {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 7px;
  height: 2px;
  content: "";
  background: currentColor;
  box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
}

.app-nav-icon-users::before,
.app-nav-icon-users::after {
  position: absolute;
  content: "";
  border: 2px solid currentColor;
}

.app-nav-icon-users::before {
  left: 7px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.app-nav-icon-users::after {
  left: 3px;
  bottom: 2px;
  width: 16px;
  height: 8px;
  border-radius: 10px 10px 4px 4px;
}

.app-nav-icon-instagram {
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  font-size: 0.68rem;
  font-weight: 900;
}

.app-nav-icon-ai {
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  font-size: 0.62rem;
  font-weight: 900;
}

.app-sidebar-user {
  margin-top: auto;
  padding: 12px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 32px;
  gap: 9px;
  align-items: center;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #12375d;
  color: #fff;
  font-weight: 800;
}

.sidebar-user-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sidebar-user-text strong,
.sidebar-user-text span,
.sidebar-user-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-text span,
.sidebar-user-text small {
  color: var(--sidebar-muted);
  font-size: 0.78rem;
}

.sidebar-logout-button {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.sidebar-logout-button span {
  width: 14px;
  height: 12px;
  border: 2px solid #d8e5f5;
  border-left: none;
  border-radius: 2px;
  position: relative;
}

.sidebar-logout-button span::before {
  position: absolute;
  left: -7px;
  top: 3px;
  width: 9px;
  height: 2px;
  content: "";
  background: #d8e5f5;
}

.app-frame.sidebar-collapsed .app-logo,
.app-frame.sidebar-collapsed .app-nav-label,
.app-frame.sidebar-collapsed .sidebar-user-text {
  display: none;
}

.app-frame.sidebar-collapsed .app-sidebar-head,
.app-frame.sidebar-collapsed .app-nav-link {
  justify-content: center;
}

.app-frame.sidebar-collapsed .app-nav-link {
  padding: 0;
}

.app-frame.sidebar-collapsed .app-sidebar-user {
  grid-template-columns: 1fr;
  justify-items: center;
  padding-inline: 0;
}

.app-frame.sidebar-collapsed .sidebar-logout-form {
  display: none;
}

.app-frame.sidebar-collapsed .app-nav .callback-alert-badge {
  position: absolute;
  top: 5px;
  right: 7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.68rem;
}

.page-shell {
  display: block;
  min-height: 100vh;
  min-width: 0;
  background: var(--bg);
}

.workspace {
  display: grid;
  margin: 0 auto;
  max-width: none;
  padding: 26px;
  gap: 16px;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 0 0 16px;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.hero-card h2 {
  font-family: Bahnschrift, "Segoe UI", sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 640px;
  margin: 8px 0 0;
  color: #536176;
  font-size: 0.94rem;
  line-height: 1.55;
}

.hero-actions {
  align-items: center;
  justify-content: flex-end;
}

.hero-actions .session-card,
.hero-actions a.secondary-button[href="/"],
.hero-actions a.secondary-button[href="/callbacks"],
.hero-actions a.secondary-button[href="/field-visits"],
.hero-actions a.secondary-button[href="/instagram"],
.hero-actions form[action="/logout"] {
  display: none;
}

.hero-card .eyebrow {
  display: none;
}

.hero-card,
.toolbar-card,
.table-card,
.stat-card {
  border: 1px solid var(--line);
}

.toolbar-card,
.table-card,
.stat-card,
.modal-card,
.loading-card {
  background: var(--paper);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.stat-card {
  min-height: 74px;
  padding: 16px 18px;
  display: grid;
  align-content: center;
}

.stat-label {
  margin-bottom: 6px;
  color: #667085;
  font-size: 0.86rem;
}

.stat-value {
  font-size: 1.42rem;
  color: var(--ink);
}

.toolbar-card {
  padding: 16px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.field span {
  color: #263449;
  font-size: 0.84rem;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  border-color: #d7dfeb;
  padding: 11px 12px;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.field textarea {
  min-height: 98px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #1683f3;
  box-shadow: 0 0 0 3px rgba(22, 131, 243, 0.12);
}

.primary-button,
.secondary-button,
.ghost-button,
.link-button {
  border: none;
  border-radius: 7px;
  min-height: 38px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary-button {
  background: #0f8a42;
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 138, 66, 0.16);
}

.secondary-button {
  background: #fff;
  color: #1f2b3d;
  border: 1px solid var(--line);
}

.ghost-button,
.link-button {
  color: #1168b3;
  border-color: #d3deeb;
  background: #fff;
}

.status-line {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #eef6ff;
  color: #263449;
  font-weight: 700;
  line-height: 1.55;
}

.status-line.callbacks-status {
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.75fr);
  gap: 14px;
  min-height: 480px;
  align-items: start;
}

.content-grid.content-grid-single,
.content-grid-single {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

.table-card {
  padding: 0;
  overflow: hidden;
  min-height: 0;
}

.table-wrap {
  overflow: auto;
  border-radius: 8px;
}

.content-grid .table-wrap {
  max-height: clamp(430px, calc(100vh - 350px), 720px);
}

.content-grid.content-grid-single .table-card,
.content-grid-single .table-card {
  width: 100%;
}

.content-grid.content-grid-single .table-wrap,
.content-grid-single .table-wrap {
  width: 100%;
  max-height: clamp(430px, calc(100vh - 350px), 720px);
}

.deals-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

.deals-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf4fb;
  color: #435064;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.84rem;
  font-weight: 800;
}

.deals-table th,
.deals-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #edf1f6;
  vertical-align: top;
  user-select: text;
}

.deals-table tbody tr {
  transition: background-color 0.16s ease;
  cursor: pointer;
}

.deals-table tbody tr:hover {
  background: #f6faff;
}

.deals-table tbody tr.is-active {
  background: #eef6ff;
}

.deals-table tbody td {
  cursor: text;
}

.callbacks-head h3 {
  font-family: Bahnschrift, "Segoe UI", sans-serif;
  font-size: 1.36rem;
}

.field-row,
.audit-card {
  border-radius: 8px;
  background: var(--panel);
}

.close-success-field {
  padding: 12px 14px;
  border: 1px solid rgba(15, 138, 66, 0.18);
  border-radius: 8px;
  background: #f7fbf8;
}

.close-success-field .toggle-field {
  width: 100%;
  min-height: 46px;
  padding: 0;
  border: none;
  background: transparent;
  color: #163827;
}

.close-success-field .toggle-field input {
  flex: 0 0 18px;
  width: 18px;
  min-width: 18px;
  height: 18px;
}

.close-success-hint {
  color: var(--muted);
  line-height: 1.4;
}

.app-nav .callback-alert-badge {
  margin-left: auto;
  background: #d74444;
  color: #fff;
}

@media (max-width: 1100px) {
  .app-frame,
  .app-frame.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    height: auto;
    padding: 10px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .app-sidebar-head {
    flex: 0 0 auto;
  }

  .app-nav {
    display: flex;
    flex: 1 1 auto;
    overflow-x: auto;
    gap: 8px;
  }

  .app-nav-link {
    flex: 0 0 auto;
    min-width: 48px;
  }

  .app-sidebar-user {
    display: none;
  }

  .app-frame.sidebar-collapsed .app-logo {
    display: inline-flex;
  }

}

@media (max-width: 720px) {
  .workspace {
    padding: 16px;
  }

  .hero-card {
    flex-direction: column;
    gap: 12px;
  }

  .hero-actions {
    justify-content: flex-start;
  }

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

}
