:root {
  --bg: #f6f8f7;
  --bg-strong: #edf2ef;
  --surface: #ffffff;
  --surface-soft: #f9fbfa;
  --text: #202522;
  --muted: #68736e;
  --line: #dbe3df;
  --line-strong: #c4d0ca;
  --teal: #0f766e;
  --teal-dark: #0b5f59;
  --teal-soft: #dff3ef;
  --amber: #b7791f;
  --amber-soft: #fff2d5;
  --red: #b42318;
  --red-soft: #ffe4df;
  --green: #16794a;
  --green-soft: #def7e8;
  --violet: #6854a6;
  --violet-soft: #ebe7fb;
  --graphite: #252a28;
  --shadow: 0 18px 50px rgba(32, 37, 34, 0.08);
  --radius: 8px;
  --sidebar: 248px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

button {
  cursor: pointer;
}

.boot-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--graphite);
}

.boot-screen span {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-panel {
  width: min(100%, 430px);
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--text);
  padding: 0 0 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  background: linear-gradient(135deg, #0f766e, #26312e);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background: var(--graphite);
  color: #edf4f1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-head small {
  display: block;
  color: #9fb0aa;
  margin-top: 2px;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav-button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 10px 10px;
  background: transparent;
  color: #dce6e2;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.nav-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.sidebar-note {
  margin-top: auto;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #c8d6d1;
  font-size: 12px;
}

.content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
  padding: 12px 24px;
  background: rgba(246, 248, 247, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
}

.global-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 620px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.global-search svg,
.btn svg,
.operator-chip svg,
.mode-chip svg,
.status-chip svg,
.mini-chip svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.global-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.topbar-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.operator-chip,
.mode-chip,
.status-chip,
.tag,
.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 5px 9px;
  font-size: 12px;
  line-height: 1.1;
}

.operator-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 4px 8px;
  white-space: nowrap;
}

.operator-select svg {
  width: 16px;
  height: 16px;
}

.operator-select select {
  max-width: 250px;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
  font-size: 12px;
}

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

.password-inline input {
  width: 150px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--surface);
}

.mode-chip.demo {
  border-color: #e2c06d;
  background: var(--amber-soft);
  color: #694500;
}

.mode-chip.real {
  border-color: #9dd8c6;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.main {
  width: min(100%, 1560px);
  padding: 22px 24px 36px;
}

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

.page-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.page-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.grid.quick {
  grid-template-columns: minmax(460px, 1.15fr) minmax(360px, 0.85fr);
  align-items: start;
}

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

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel.tight {
  box-shadow: none;
}

.panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.panel-body {
  padding: 16px;
}

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

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

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

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

.field label {
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 10px;
  outline: 0;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #78bdb4;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
}

.check-pill input {
  width: 15px;
  height: 15px;
}

.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  min-height: 38px;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 650;
  text-decoration: none;
}

.btn:hover {
  border-color: #9ab0a8;
  background: var(--surface-soft);
}

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

.btn.primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.btn.warn {
  background: var(--amber-soft);
  color: #6f4a00;
  border-color: #e0bb64;
}

.btn.danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: #f1b5ae;
}

.btn.icon {
  width: 38px;
  padding: 0;
}

.btn.small {
  min-height: 32px;
  padding: 7px 9px;
  font-size: 12px;
}

.contract-list,
.queue-list,
.draft-list,
.chat-list,
.employee-list {
  display: grid;
  gap: 8px;
}

.contract-card,
.queue-row,
.draft-row,
.chat-row,
.employee-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

button.contract-card {
  width: 100%;
  color: inherit;
  text-align: left;
  font: inherit;
}

.contract-card.selected,
.draft-row.selected,
.chat-row.selected,
.employee-row.selected {
  border-color: #6db7ad;
  background: var(--teal-soft);
}

.contract-card.debt {
  border-color: #efb0a8;
  background: var(--red-soft);
}

.row-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  font-weight: 750;
}

.row-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.assignment-help {
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 7px 8px;
  border: 1px solid #cfc4f0;
  border-radius: 8px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 12px;
}

.assignment-help svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.money.positive {
  color: var(--green);
}

.money.negative {
  color: var(--red);
}

.alert {
  border: 1px solid #e6bd62;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--amber-soft);
  color: #6d4700;
}

.alert.danger {
  border-color: #f0aaa1;
  background: var(--red-soft);
  color: var(--red);
}

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

.queue-count {
  min-width: 32px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--graphite);
  color: #fff;
  font-weight: 800;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: var(--surface);
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-soft);
}

tbody tr:hover {
  background: #fbfcfb;
}

.ticket-row-clickable {
  cursor: pointer;
}

.status-chip.status-ai,
.status-chip.status-draft {
  background: var(--violet-soft);
  border-color: #cfc4f0;
  color: var(--violet);
}

.status-chip.status-work {
  background: var(--teal-soft);
  border-color: #a7dcd3;
  color: var(--teal-dark);
}

.status-chip.status-warn {
  background: var(--amber-soft);
  border-color: #e3c46f;
  color: #6c4800;
}

.status-chip.status-danger {
  background: var(--red-soft);
  border-color: #f2b8b0;
  color: var(--red);
}

.split-view {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.chat-view {
  display: grid;
  grid-template-columns: 310px minmax(360px, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

.message-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.message {
  max-width: 86%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.message.client {
  margin-right: auto;
}

.message.operator {
  margin-left: auto;
  background: var(--teal-soft);
  border-color: #b8dfd9;
}

.message.ai {
  margin-left: auto;
  background: var(--violet-soft);
  border-color: #d2c8ef;
}

.message.system {
  max-width: 100%;
  text-align: center;
  background: var(--bg-strong);
  color: var(--muted);
}

.message small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
}

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

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
  line-height: 1;
}

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

.dispatch-column {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  width: var(--value);
  background: var(--teal);
}

.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.toast {
  min-width: 280px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--graphite);
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--red);
}

.toast.success {
  background: var(--teal-dark);
}

.mobile-menu {
  display: none;
}

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

  .split-view {
    grid-template-columns: 1fr;
  }

  .metric-strip,
  .grid.three,
  .dispatch-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  :root {
    --sidebar: 0px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    z-index: 30;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
  }

  .topbar {
    padding: 10px 14px;
    flex-wrap: wrap;
  }

  .global-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .main {
    padding: 18px 14px 28px;
  }

  .page-head,
  .topbar-status {
    flex-direction: column;
    align-items: stretch;
  }

  .form-grid,
  .grid.two,
  .metric-strip,
  .dispatch-columns {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 680px;
  }
}

/* Calm, rounded workspace */
:root {
  --bg: #eef3f1;
  --bg-strong: #e5ece9;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-soft: #f5f8f7;
  --text: #17201c;
  --muted: #718078;
  --line: #dce6e1;
  --line-strong: #c8d7d0;
  --teal: #187d70;
  --teal-dark: #106458;
  --teal-soft: #e0f3ee;
  --amber: #9b6b1d;
  --amber-soft: #fff4dc;
  --red: #a84038;
  --red-soft: #fff0ed;
  --green: #267b54;
  --green-soft: #e3f5ea;
  --violet: #655a9a;
  --violet-soft: #f0edfb;
  --graphite: #1f2925;
  --shadow: 0 18px 45px rgba(37, 62, 51, 0.08);
  --shadow-hover: 0 22px 55px rgba(37, 62, 51, 0.13);
  --radius: 20px;
  --sidebar: 268px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  font-family: "Avenir Next", Avenir, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

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

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

.app-shell {
  min-height: 100dvh;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.sidebar {
  top: 14px;
  height: calc(100vh - 28px);
  padding: 18px 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 26px;
  background: rgba(27, 39, 34, 0.94);
  box-shadow: 0 24px 55px rgba(24, 45, 36, 0.2);
  backdrop-filter: blur(24px);
}

.sidebar-head {
  padding: 4px 6px 18px;
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

.sidebar-head strong {
  font-size: 16px;
  font-weight: 750;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: #f3fbf8;
  color: var(--teal-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.nav {
  gap: 18px;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group-label {
  padding: 0 12px 4px;
  color: #82938c;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-button {
  min-height: 44px;
  border-radius: 14px;
  padding: 10px 12px;
  color: #cbd7d2;
  font-weight: 600;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.nav-button.active {
  background: #f2faf7;
  color: var(--teal-dark);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.sidebar-note {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.055);
  color: #b8c8c1;
  line-height: 1.5;
}

.content {
  min-height: calc(100vh - 28px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 26px;
  background: rgba(248, 251, 250, 0.72);
  overflow: clip;
}

.topbar {
  position: sticky;
  min-height: 76px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(208, 222, 216, 0.72);
  background: rgba(248, 251, 250, 0.82);
  backdrop-filter: blur(22px);
}

.global-search {
  max-width: 520px;
  min-height: 46px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(34, 64, 52, 0.06);
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.global-search:focus-within {
  border-color: #94cfc3;
  box-shadow: 0 0 0 4px rgba(24, 125, 112, 0.1);
}

.topbar-status {
  gap: 8px;
}

.operator-select,
.mode-chip,
.operator-chip {
  min-height: 38px;
  border-color: transparent;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 15px rgba(34, 64, 52, 0.05);
}

.operator-select {
  padding: 5px 10px;
}

.operator-select select {
  max-width: 205px;
}

.password-inline {
  display: none;
}

.main {
  width: min(100%, 1500px);
  padding: 30px 30px 46px;
}

.page-head {
  margin-bottom: 24px;
}

.page-title {
  max-width: 780px;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: 0;
  text-wrap: balance;
}

.page-subtitle {
  max-width: 760px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  text-wrap: pretty;
}

.grid {
  gap: 18px;
}

.grid.quick {
  grid-template-columns: minmax(520px, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.grid.two {
  gap: 18px;
}

.panel {
  border: 1px solid rgba(211, 224, 218, 0.8);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.panel:hover {
  border-color: rgba(190, 211, 202, 0.9);
}

.panel.tight {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 28px rgba(37, 62, 51, 0.055);
}

.panel-head {
  min-height: 64px;
  padding: 17px 20px;
  border-bottom-color: rgba(220, 230, 225, 0.8);
}

.panel-head h2,
.panel-head h3 {
  font-size: 16px;
  font-weight: 740;
  letter-spacing: 0;
}

.panel-body {
  padding: 20px;
}

.metric-strip {
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  min-height: 106px;
  border: 1px solid rgba(211, 224, 218, 0.8);
  border-radius: 19px;
  padding: 17px 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 25px rgba(37, 62, 51, 0.055);
}

.metric span {
  font-size: 12px;
  font-weight: 620;
}

.metric strong {
  margin-top: 11px;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.form-grid {
  gap: 16px;
}

.field {
  gap: 7px;
}

.field label {
  color: #607068;
  font-size: 12px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea,
td select {
  min-height: 44px;
  border: 1px solid #d8e4df;
  border-radius: 13px;
  padding: 10px 12px;
  background: #fbfdfc;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

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

.field input:hover,
.field select:hover,
.field textarea:hover,
td select:hover {
  border-color: #bdcfc7;
  background: #fff;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
td select:focus {
  border-color: #76bbae;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(24, 125, 112, 0.1);
}

.check-grid {
  gap: 9px;
}

.check-pill {
  min-height: 40px;
  border-color: #d9e4df;
  border-radius: 13px;
  padding: 8px 11px;
  background: #f7faf8;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.check-pill:hover {
  border-color: #9bc8bd;
  background: var(--teal-soft);
  transform: translateY(-1px);
}

.check-pill.selected {
  border-color: #78bdb4;
  background: var(--teal-soft);
  box-shadow: 0 0 0 4px rgba(24, 125, 112, 0.1);
}

.btn {
  min-height: 42px;
  border-color: transparent;
  border-radius: 13px;
  padding: 10px 14px;
  background: #edf3f0;
  box-shadow: inset 0 0 0 1px rgba(197, 214, 206, 0.75);
  font-weight: 680;
  transition: transform 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

.btn:hover {
  border-color: transparent;
  background: #e4ede9;
  box-shadow: inset 0 0 0 1px rgba(176, 199, 188, 0.9), 0 8px 18px rgba(37, 62, 51, 0.08);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn:focus-visible,
.nav-button:focus-visible {
  outline: 3px solid rgba(24, 125, 112, 0.25);
  outline-offset: 2px;
}

.btn.primary {
  background: var(--teal);
  box-shadow: 0 9px 20px rgba(24, 125, 112, 0.2);
}

.btn.primary:hover {
  background: var(--teal-dark);
  box-shadow: 0 12px 25px rgba(16, 100, 88, 0.25);
}

.btn.small {
  min-height: 36px;
  border-radius: 11px;
  padding: 8px 11px;
}

.btn.icon {
  width: 42px;
  border-radius: 13px;
}

.contract-list,
.queue-list,
.draft-list,
.chat-list,
.employee-list {
  gap: 10px;
}

.contract-card,
.queue-row,
.draft-row,
.chat-row,
.employee-row {
  border-color: #dce7e2;
  border-radius: 15px;
  padding: 13px 14px;
  background: #f8fbfa;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease, box-shadow 170ms ease;
}

button.contract-card:hover,
.draft-row:hover,
.chat-row:hover,
.employee-row:hover {
  border-color: #a9cbbf;
  background: #fff;
  box-shadow: 0 9px 22px rgba(37, 62, 51, 0.07);
  transform: translateY(-1px);
}

.contract-card.selected,
.draft-row.selected,
.chat-row.selected,
.employee-row.selected {
  border-color: #8cc4b7;
  background: #eaf6f2;
  box-shadow: 0 8px 20px rgba(24, 125, 112, 0.1);
}

.contract-card.debt {
  border-color: #f0c7c0;
  background: #fff5f3;
}

.row-title {
  gap: 12px;
  font-weight: 720;
}

.row-meta {
  gap: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.operator-chip,
.mode-chip,
.status-chip,
.tag,
.mini-chip {
  border-radius: 10px;
  padding: 6px 9px;
  font-weight: 620;
}

.tag {
  background: #edf3f0;
}

.alert {
  border-radius: 15px;
  padding: 13px 15px;
}

.assignment-help {
  margin: 10px 0;
  border-color: #d8d0ef;
  border-radius: 14px;
  padding: 9px 10px;
  background: #f5f2fc;
}

.table-wrap {
  border-color: #e0e9e5;
  border-radius: 16px;
  background: #fff;
}

table {
  min-width: 820px;
}

th,
td {
  padding: 14px 15px;
  border-bottom-color: #e8eeeb;
}

th {
  padding-top: 12px;
  padding-bottom: 12px;
  background: #f4f8f6;
  color: #6e7c75;
  font-weight: 680;
}

tbody tr {
  transition: background 150ms ease;
}

tbody tr:hover {
  background: #f5faf8;
}

.split-view {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 18px;
}

.chat-view {
  grid-template-columns: 300px minmax(380px, 1fr) 340px;
  gap: 18px;
}

.message {
  border-radius: 15px;
  padding: 11px 13px;
}

.progress {
  height: 7px;
  border-radius: 99px;
  background: #e4ece8;
}

.empty {
  border-color: #ccd9d3;
  border-radius: 16px;
  padding: 28px;
  background: rgba(246, 250, 248, 0.8);
}

.toast {
  border-radius: 15px;
  box-shadow: 0 18px 40px rgba(24, 45, 36, 0.2);
}

.login-shell {
  background: var(--bg);
}

.login-panel {
  width: min(100%, 450px);
  gap: 22px;
  padding: 28px;
  border-color: rgba(255, 255, 255, 0.8);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 28px 65px rgba(37, 62, 51, 0.14);
  backdrop-filter: blur(24px);
}

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

  .main {
    padding: 26px 22px 40px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
    padding: 0;
  }

  .content {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .sidebar {
    top: 10px;
    left: 10px;
    height: calc(100dvh - 20px);
    border-radius: 22px;
  }

  .topbar {
    min-height: 68px;
    padding: 10px 12px;
  }

  .topbar-status {
    width: 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .mode-chip {
    display: none;
  }

  .main {
    padding: 22px 13px 32px;
  }

  .page-title {
    font-size: 30px;
  }

  .panel {
    border-radius: 18px;
  }

.panel-head,
.panel-body {
    padding-left: 15px;
    padding-right: 15px;
  }
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 28, 0.58);
  backdrop-filter: blur(8px);
}

.modal-panel {
  width: min(1120px, 100%);
  max-height: min(92vh, 960px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(17, 25, 21, 0.24);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(245, 248, 247, 0.95), rgba(255, 255, 255, 0.96));
}

.modal-head h2 {
  margin: 0;
}

.modal-body {
  padding: 18px 20px 20px;
  overflow: auto;
}

@media (max-width: 980px) {
  .modal-backdrop {
    padding: 10px;
  }

  .modal-panel {
    max-height: calc(100vh - 20px);
    border-radius: 18px;
  }

  .modal-head,
  .modal-body {
    padding-left: 14px;
    padding-right: 14px;
  }
}
