:root {
  --bg: #f4f6f8;
  --bg-strong: #edf0f4;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #153243;
  --muted: #627381;
  --line: #e0e6eb;
  --line-strong: #c8d2db;
  --teal: #c72c35;
  --teal-dark: #a41f28;
  --teal-soft: #fcecef;
  --amber: #b7791f;
  --amber-soft: #fff2d5;
  --red: #b42318;
  --red-soft: #ffe4df;
  --green: #16794a;
  --green-soft: #def7e8;
  --violet: #6854a6;
  --violet-soft: #ebe7fb;
  --graphite: #123244;
  --shadow: 0 2px 6px rgba(18, 50, 68, 0.035);
  --radius: 12px;
  --sidebar: 236px;
}

* {
  box-sizing: border-box;
}

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

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

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

button {
  cursor: pointer;
}

.boot-screen {
  min-height: 100dvh;
  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: 100dvh;
  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: var(--teal);
  flex-shrink: 0;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 24px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.sidebar-head small {
  display: block;
  color: var(--muted);
  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: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

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

.nav-button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-button.active {
  background: var(--teal-soft);
  color: var(--teal-dark);
  box-shadow: inset 3px 0 var(--teal);
  font-weight: 650;
}

.sidebar-note {
  margin-top: auto;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  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: var(--surface);
  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;
  min-width: 0;
  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: 6px;
  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: 6px;
  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: 30px;
  font-weight: 650;
  line-height: 1.2;
  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(0, 1.6fr) minmax(280px, 0.9fr);
  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,
.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: var(--text);
  box-shadow: 0 0 0 3px rgba(18, 50, 68, 0.1);
}

.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: var(--line-strong);
  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: var(--teal);
  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: #eaf3fb;
  border-color: #c6ddef;
  color: #245c88;
}

.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: minmax(220px, 0.8fr) minmax(300px, 1.2fr) minmax(240px, 1fr);
  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: #edf4fa;
  border-color: #c6ddef;
}

.message.ai {
  margin-left: auto;
  background: var(--violet-soft);
  border-color: #d2c8ef;
}
.message.note { align-self: center; max-width: 90%; background: #fff7e0; border: 1px dashed #e0b84a; color: #6b5310; font-size: 13px; }

.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);
}

.company-hub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.company-feed-panel,
.company-chat-panel {
  overflow: hidden;
}

.company-section-panel {
  width: min(100%, 980px);
}

.company-feed-body,
.company-chat-body {
  display: grid;
  gap: 16px;
}

.company-composer {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.company-composer-top {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
}

.company-composer input,
.company-composer select,
.company-composer textarea,
.company-message-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.company-composer textarea {
  min-height: 90px;
  resize: vertical;
}

.company-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.company-feed {
  display: grid;
  gap: 10px;
}

.company-post {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 3px solid #9bb4c4;
  border-radius: 10px;
  background: var(--surface);
}

.company-post.important {
  border-left-color: var(--amber);
  background: #fffaf0;
}

.company-post.outage {
  border-left-color: var(--red);
  background: #fff8f7;
}

.company-post.announcement {
  border-left-color: var(--teal);
}

.company-post-head,
.company-post-meta-line,
.company-message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.company-post-head {
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.company-post-kind {
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.company-post h3 {
  margin: 10px 0 6px;
  font-size: 17px;
}

.company-post > p,
.company-message-bubble p {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.company-post-meta-line {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.company-post-author {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.company-post-author > span:last-child {
  display: grid;
  gap: 2px;
}

.company-post-author strong {
  font-size: 12px;
}

.company-post-author small {
  color: var(--muted);
  font-size: 10px;
}

.company-avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: var(--bg-strong);
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 700;
}

.company-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px #35a26418;
}

.company-message-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 420px;
  max-height: 620px;
  overflow-y: auto;
  padding-right: 4px;
}

.company-message-list-page {
  min-height: 520px;
  max-height: calc(100vh - 330px);
}

.company-message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 92%;
}

.company-message.own {
  margin-left: auto;
}

.company-message-bubble {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px 10px 10px 3px;
  background: var(--surface-soft);
}

.company-message.own .company-message-bubble {
  border-color: #c6ddef;
  border-radius: 10px 10px 3px 10px;
  background: #edf4fa;
}

.company-message-meta {
  justify-content: space-between;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
}

.company-message-meta strong {
  color: var(--text);
  font-size: 11px;
}

.company-message-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 8px;
  align-items: end;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.company-message-form textarea {
  min-height: 46px;
  max-height: 130px;
  resize: vertical;
}

.company-message-form .btn {
  width: 46px;
  min-width: 46px;
  padding-inline: 0;
}

.company-message-form .btn svg {
  margin: auto;
}

.company-chat-workspace {
  overflow: hidden;
}

.company-chat-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 650px;
}

.company-conversation-sidebar {
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.company-conversation-sidebar-head,
.company-conversation-create-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.company-conversation-sidebar-head {
  margin-bottom: 12px;
}

.company-conversation-sidebar-head > div {
  display: grid;
  gap: 2px;
}

.company-conversation-sidebar-head small,
.company-conversation-create p,
.company-conversation-copy small,
.company-member-option small {
  color: var(--muted);
  font-size: 10px;
}

.company-conversation-create {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.company-conversation-create > p {
  margin: -3px 0 0;
  line-height: 1.4;
}

.company-conversation-create > input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 10px;
  font: inherit;
  font-size: 12px;
}

.company-member-list {
  display: grid;
  gap: 4px;
  max-height: 250px;
  overflow-y: auto;
}

.company-member-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.company-member-option:hover {
  background: var(--surface-soft);
}

.company-member-option > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.company-member-option strong {
  font-size: 11px;
}

.company-conversation-list {
  display: grid;
  gap: 4px;
}

.company-conversation-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.company-conversation-row:hover {
  background: var(--surface);
}

.company-conversation-row.selected {
  border-color: #c6ddef;
  background: #edf4fa;
}

.company-conversation-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  background: var(--bg-strong);
  color: var(--teal-dark);
}

.company-conversation-icon svg {
  width: 16px;
  height: 16px;
}

.company-conversation-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.company-conversation-copy strong,
.company-conversation-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-conversation-copy strong {
  font-size: 12px;
}

.company-chat-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.company-chat-header {
  border-bottom: 1px solid var(--line);
}

.company-chat-main .company-chat-body {
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.company-chat-main .company-message-list-page {
  min-height: 0;
  max-height: none;
  height: 520px;
}

.outage-smart-hint {
  padding: 10px 12px;
  border: 1px solid #c8d9e5;
  border-radius: 8px;
  background: #f4f9fc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.outage-smart-hint strong {
  color: var(--text);
}

.ktv-network-panel {
  margin-top: 16px;
  overflow: hidden;
}

.ktv-network-head {
  align-items: center;
}

.ktv-network-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.ktv-network-stats {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ktv-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.ktv-search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: var(--muted);
}

.ktv-search input {
  width: 100%;
  min-height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.ktv-node-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-items: start;
}

.ktv-node {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  overflow: hidden;
}

.ktv-node[hidden] {
  display: none;
}

.ktv-node.has-outage {
  border-color: #e4aaa6;
}

.ktv-node.all-outage {
  box-shadow: inset 3px 0 0 var(--red);
}

.ktv-node > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.ktv-node > summary::-webkit-details-marker {
  display: none;
}

.ktv-node > summary::before {
  content: "›";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: transform .15s ease;
}

.ktv-node[open] > summary::before {
  transform: rotate(90deg);
}

.ktv-node.has-outage > summary {
  background: #fff8f7;
}

.ktv-node-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 650;
}

.ktv-node-summary {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.ktv-node-summary strong {
  color: var(--red);
}

.ktv-node-body {
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
}

.ktv-node-actions {
  padding: 10px 0;
}

.ktv-address-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
}

.ktv-node-actions + .ktv-address-grid {
  padding-top: 0;
}

.ktv-address {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  line-height: 1.3;
  text-align: left;
}

button.ktv-address {
  cursor: pointer;
}

button.ktv-address:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.ktv-address {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.ktv-address-hint {
  color: var(--red);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}

.ktv-address.affected,
button.ktv-address.affected:hover {
  border-color: #e3a39e;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 650;
}

.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: 6px;
  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.three,
  .grid.two,
  .metric-strip,
  .dispatch-columns {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 680px;
  }
}

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(1000px, 100%);
  max-height: min(92vh, 960px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 14px;
  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: var(--surface-soft);
}

.modal-head h2 {
  margin: 0;
}

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

.contract-picker { width: min(560px, 100%); }
.contract-picker h2 { font-size: 22px; }
.contract-choice { width: 100%; text-align: left; color: var(--text); }
.contract-choice .row-title { align-items: center; }
.contract-choice .row-title > span { flex-shrink: 0; color: var(--teal); }
.contract-choice:hover { border-color: var(--teal); background: var(--teal-soft); }

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

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

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

/* Shared workspace components. */
:focus-visible { outline: 3px solid #245c88; outline-offset: 3px; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { transition: background 150ms ease, border-color 150ms ease, color 150ms ease; }
button:disabled { cursor: wait; opacity: 0.55; }
button:active:not(:disabled) { transform: translateY(1px); }
input[type="checkbox"] { accent-color: var(--teal); }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.btn { font-weight: 600; min-height: 40px; }
.btn.icon { flex: 0 0 38px; }
.btn.small { min-height: 34px; }
.btn:focus-visible, .nav-button:focus-visible { outline-offset: 2px; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 60; padding: 12px; background: white; color: var(--text); }
.skip-link:focus { top: 12px; }
.brand-caption { margin-left: 4px; font-size: 10px; font-weight: 600; color: var(--muted); }
.sidebar-head strong { font-size: 20px; letter-spacing: -0.5px; }
.sidebar-head small { font-size: 11px; }
.nav { gap: 24px; min-height: 0; overflow-y: auto; }
.nav-group { display: grid; gap: 4px; }
.nav-group-label { padding: 0 10px 7px; color: var(--muted); font-size: 11px; font-weight: 650; }
.nav-button { min-height: 42px; font-size: 13px; }
.sidebar-note { line-height: 1.7; font-size: 11px; }
.nav-backdrop { display: none; }
.topbar { min-height: 72px; }
.global-search { background: var(--surface-soft); }
.global-search:focus-within { outline: 2px solid #245c88; outline-offset: 1px; }
.operator-select { max-width: 240px; border: 0; padding: 4px; }
.operator-select select { width: 100%; min-width: 0; max-width: 205px; min-height: 34px; }
.workspace-label { color: var(--muted); font-size: 13px; }
.workspace-label span { color: var(--text); }
.main { padding: 30px 28px 40px; margin-inline: auto; }
.page-head { align-items: center; margin-bottom: 24px; }
.page-head > div:first-child { min-width: 0; }
.page-head .actions { flex-shrink: 0; }
.page-subtitle { line-height: 1.6; font-size: 13px; max-width: 70ch; }
.panel, .panel-body, .grid > *, .split-view > *, .chat-view > * { min-width: 0; }
.panel-head { min-height: 58px; padding: 16px 18px; flex-wrap: wrap; }
.panel-body { padding: 18px; }
.form-grid { gap: 16px; }
.field { min-width: 0; }
.field-label, .field > label { font-size: 12px; font-weight: 600; color: #526572; }
.field input, .field select, .field textarea { min-height: 42px; }
.field textarea { line-height: 1.55; }
.field .check-pill input { min-height: auto; }
.form-section { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 4px; }
.form-section:first-child { border: 0; padding-top: 0; margin-top: 0; }
.form-section span { color: var(--teal); font-size: 11px; font-weight: 700; }
.form-section h3 { margin: 0; font-size: 14px; font-weight: 650; }
.form-actions { grid-column: 1 / -1; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; }
.check-pill:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.metric-strip { gap: 14px; margin-bottom: 24px; }
.metric { padding: 18px 20px; border-radius: var(--radius); }
.metric strong { font-size: 30px; font-weight: 650; margin-top: 12px; }
.metric:first-child { border-top: 3px solid var(--teal); padding-top: 16px; }
.ticket-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-button { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 8px 10px; min-height: 36px; font-size: 12px; font-weight: 600; }
.filter-button span { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--bg-strong); }
.filter-button:hover { background: var(--surface-soft); color: var(--text); }
.filter-button.active { color: var(--teal-dark); background: var(--teal-soft); }
.filter-button.active span { background: white; }
.table-wrap { max-width: 100%; }
th, td { padding: 14px 12px; }
th { white-space: nowrap; font-weight: 600; }
td { font-size: 13px; }
td strong { font-weight: 600; }
td select { width: 100%; max-width: 230px; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: white; color: var(--text); margin-top: 8px; font-size: 12px; }
tbody tr:hover { background: var(--surface-soft); }
tbody tr:last-child td { border-bottom: 0; }
.ticket-link { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: #245c88; font-weight: 650; text-align: left; white-space: nowrap; min-height: 30px; }
.ticket-link svg { width: 14px; height: 14px; opacity: 0.6; }
.ticket-link:hover { text-decoration: underline; }
.assignment-help { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; margin-top: 8px; background: var(--surface-soft); border-color: var(--line); }
.assignment-help svg { width: 14px; height: 14px; flex-shrink: 0; }
.status-chip { line-height: 1.4; max-width: 190px; border-color: transparent; }
.row-meta { line-height: 1.5; }
.tag { font-size: 10px; padding: 4px 6px; color: var(--muted); background: var(--surface-soft); }
.draft-row, .chat-row, .employee-row { text-align: left; color: var(--text); }
.draft-row:hover, .chat-row:hover, .employee-row:hover { border-color: var(--line-strong); }
.message, .row-meta, .alert { overflow-wrap: anywhere; }
.queue-count { color: var(--text); background: var(--bg-strong); font-size: 12px; }
.empty { padding: 36px 20px; background: var(--surface-soft); line-height: 1.6; }
.empty strong { display: block; color: var(--text); font-size: 16px; }
.empty p { margin: 6px 0 16px; }
.account-menu { position: relative; }
.account-menu summary { list-style: none; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-panel { position: absolute; right: 0; top: calc(100% + 10px); width: min(300px, calc(100vw - 28px)); padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 12px 32px #12324420; white-space: normal; z-index: 12; }
.account-menu svg { width: 18px; height: 18px; }
.login-panel { padding: 32px; border-top: 3px solid var(--teal); border-radius: 14px; }
.login-brand { border-bottom-color: var(--line); }
.modal-backdrop { backdrop-filter: blur(3px); }
.toast.success { background: var(--green); }
@media (min-width: 1181px) and (max-width: 1360px) {
  .chat-view { grid-template-columns: minmax(230px, 0.8fr) minmax(0, 1.2fr); }
  .chat-view > :last-child { grid-column: 2; }
}
@media (max-width: 1180px) {
  .grid.quick, .chat-view, .company-hub-grid { grid-template-columns: 1fr; }
  .ktv-node-list { grid-template-columns: 1fr; }
  .main { padding: 24px 20px; }
  .topbar { padding: 12px 20px; gap: 10px; }
  .operator-select { max-width: 170px; }
}
@media (max-width: 820px) {
  .sidebar { width: min(280px, 85vw); height: 100dvh; visibility: hidden; }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { visibility: visible; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 29; background: #12324480; border: 0; width: 100%; height: 100%; }
  .topbar { gap: 8px; padding: 10px 14px; }
  .topbar-status { flex-direction: row; align-items: center; gap: 6px; min-width: 0; }
  .operator-select { max-width: clamp(90px, 29vw, 200px); }
  .operator-select select { font-size: 11px; }
  .workspace-label { display: none; }
  .main { padding: 22px 14px 30px; }
  .page-head { align-items: stretch; gap: 14px; }
  .page-title { font-size: 26px; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
  .metric { padding: 14px; }
  .metric:first-child { padding-top: 12px; }
  .metric strong { font-size: 26px; }
  .panel-head, .panel-body { padding: 14px; }
  .company-composer-top { grid-template-columns: 1fr; }
  .company-composer-actions { align-items: stretch; flex-direction: column; }
  .company-composer-actions .btn { width: 100%; }
  .company-message-list { min-height: 320px; max-height: 52vh; }
  .company-message-list-page { min-height: 360px; max-height: 58vh; }
  .company-chat-layout { grid-template-columns: 1fr; min-height: 0; }
  .company-conversation-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .company-conversation-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .company-chat-main .company-message-list-page { height: 50vh; min-height: 320px; }
  .ktv-network-head { align-items: stretch; }
  .ktv-network-stats { justify-content: flex-start; }
  .ticket-filters { gap: 3px; }
  .filter-button { padding: 8px; }
  .table-wrap:has(.tickets-table) { border: 0; overflow: visible; }
  .tickets-table, .tickets-table tbody { display: block; min-width: 0; }
  .tickets-table thead { display: none; }
  .tickets-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
  .tickets-table tr:last-child { margin-bottom: 0; }
  .tickets-table td { min-width: 0; padding: 10px 12px; border: 0; }
  .tickets-table td:nth-child(1), .tickets-table td:nth-child(2), .tickets-table td:nth-child(3), .tickets-table td:last-child { grid-column: 1 / -1; }
  .tickets-table td:first-child { background: var(--surface-soft); border-bottom: 1px solid var(--line); }
  .tickets-table td:first-child .row-meta { display: inline-flex; margin-left: 10px; }
  .tickets-table td:not(:first-child)::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
  .tickets-table td select { max-width: 100%; }
  .form-actions .btn { flex: 1 1 180px; }
  .toast-stack { left: 14px; right: 14px; bottom: 14px; }
  .toast { min-width: 0; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
/* Task-oriented workspace: inbox, short forms and a request drawer. */
:root { --bg: #f5f6f4; --text: #263a45; --muted: #718089; --line: #e3e8e8; --sidebar: 244px; --shadow: none; }
[hidden] { display: none !important; }
body { font-family: "Avenir Next", "Segoe UI", -apple-system, sans-serif; }
.sidebar { padding: 28px 16px 18px; background: #203640; border-right: 0; color: #fff; gap: 28px; }
.sidebar-head { border: 0; padding: 0 10px; gap: 12px; }
.sidebar-head strong { color: #fff; font-size: 23px; font-weight: 700; letter-spacing: -0.7px; }
.sidebar-head small { color: #9cacb3; font-size: 11px; margin-top: 0; }
.sidebar .brand-mark { width: 38px; height: 38px; background: #d33f49; font-size: 25px; border-radius: 10px; }
.sidebar-create { min-height: 44px; justify-content: flex-start; padding-left: 16px; background: #d33f49 !important; border-color: #d33f49 !important; }
.sidebar-create.current { outline: 2px solid #ffffff60; outline-offset: 3px; }
.sidebar .nav { gap: 30px; }
.sidebar .nav-group-label { color: #81959e; font-size: 10px; letter-spacing: 0.6px; padding-left: 14px; }
.sidebar .nav-button { min-height: 43px; color: #b8c6cc; padding: 10px 14px; font-size: 13px; gap: 12px; }
.sidebar .nav-button:hover { color: #fff; background: #ffffff09; }
.sidebar .nav-button.active { background: #354b55; color: #fff; box-shadow: none; }
.nav-count { margin-left: auto; padding: 2px 7px; border-radius: 5px; background: #ffffff15; font-size: 11px; }
.sidebar-note { padding: 12px 10px; background: none; color: #c0cdd2; font-size: 11px; }
.sidebar-note > span:last-child { color: #8299a4; margin-left: 13px; }
.sidebar-dot { width: 5px; height: 5px; display: inline-block; margin-right: 5px; border-radius: 50%; background: #82baa5; vertical-align: middle; }
.nav-more summary { display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; font-size: 13px; color: #b8c6cc; list-style: none; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary svg { width: 18px; height: 18px; }
.nav-more summary > span { margin-left: auto; }
.nav-more[open] summary > span { transform: rotate(180deg); }
.nav-more .nav-group { margin-top: 8px; }
.topbar { min-height: 80px; padding: 16px 40px; gap: 24px; background: #fff; }
.breadcrumb { display: flex; gap: 12px; align-items: center; color: #91a0a7; font-size: 12px; white-space: nowrap; }
.breadcrumb strong { color: #465d68; font-weight: 500; }
.topbar .global-search { max-width: 440px; }
.toolbar-refresh { border: 0; background: transparent; color: var(--muted); padding: 8px; font-weight: 500; font-size: 12px; }
.account-trigger { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.account-trigger::-webkit-details-marker { display: none; }
.user-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #e7eeee; color: #4e707c; font-size: 11px; font-weight: 700; }
.user-name { display: grid; gap: 2px; font-size: 12px; color: var(--text); }
.user-name small { color: var(--muted); font-size: 10px; }
.account-panel { top: calc(100% + 18px); width: min(320px, calc(100vw - 28px)); }
.account-panel input, .account-panel select { max-width: 100%; }
.main { padding: 38px 40px 48px; width: min(100%, 1600px); }
.page-title { font-size: 32px; font-weight: 650; letter-spacing: -0.9px; line-height: 1.15; }
.page-subtitle { color: #829097; font-size: 13px; }
.panel { box-shadow: none; border-radius: 12px; }
.panel-head h2, .panel-head h3 { font-weight: 600; }
.btn { font-size: 13px; font-weight: 600; border-radius: 7px; min-height: 40px; }
.btn.primary { background: #c93542; border-color: #c93542; }
.work-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 28px; gap: 16px; }
.eyebrow { display: block; font-size: 11px; color: #819097; margin-bottom: 10px; }
.workspace-date { font-size: 12px; color: #7e8e96; padding-bottom: 3px; }
.text-divider { margin: 0 9px; color: #b2bec4; }
.inbox-surface { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.inbox-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 0 22px 16px; border-bottom: 1px solid var(--line); }
.inbox-toolbar .ticket-filters { gap: 20px; }
.inbox-toolbar .filter-button { border-radius: 0; padding: 22px 0 16px; border-bottom: 2px solid transparent; background: transparent; font-weight: 500; color: #7e8b94; gap: 7px; }
.inbox-toolbar .filter-button.active { color: #bf3040; border-bottom-color: #bf3040; font-weight: 650; }
.inbox-toolbar .filter-button span { font-size: 10px; padding: 1px 5px; color: #778a94; background: #f0f3f4; }
.inbox-toolbar .filter-button.active span { color: #bf3040; background: #fcecef; }
.inbox-search { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px; width: 100%; max-width: 340px; background: #fbfcfc; }
.inbox-search svg { width: 16px; height: 16px; color: #87989f; flex-shrink: 0; }
.inbox-search input { border: 0; background: transparent; width: 100%; min-width: 0; outline: none; font-size: 12px; }
.inbox-search:focus-within { outline: 2px solid #577b90; outline-offset: 2px; }
.inbox-table-wrap { border: 0; border-radius: 0; }
.request-table { min-width: 800px; table-layout: fixed; }
.request-table th { background: #fafbfb; padding: 13px 22px; font-size: 11px; font-weight: 500; color: #83919a; }
.request-table th:nth-child(1) { width: 29%; }
.request-table th:nth-child(2) { width: 27%; }
.request-table th:nth-child(3) { width: 17%; }
.request-table th:nth-child(4) { width: 16%; }
.request-table th:nth-child(5) { width: 11%; }
.request-table td { padding: 20px 22px; vertical-align: middle; border-bottom: 1px solid #edf0f0; }
.request-table tbody tr:hover { background: #f7faf9; }
.request-title { display: block; text-align: left; border: 0; background: transparent; color: #284550; font-size: 13px; font-weight: 650; padding: 0; line-height: 1.5; }
.request-title:hover { color: #bd2c3d; }
.request-table .row-meta { font-size: 11px; gap: 5px; margin-top: 6px; }
.request-table td strong { display: block; font-size: 12px; font-weight: 550; }
.request-table .status-chip { font-size: 10px; padding: 5px 7px; border-radius: 5px; font-weight: 550; }
.priority-mark { color: #c3444a; }
.unassigned { font-size: 11px; color: #9d793c; }
.assignee-name { font-size: 12px; color: #566e78; }
.date-cell { font-size: 10px; color: #87969d; white-space: nowrap; padding-left: 10px !important; }
.inbox-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 22px; font-size: 10px; color: #8f9ca3; background: #fff; }
.inbox-empty { border: 0; padding: 65px 24px; background: #fff; }
.inbox-empty > svg { width: 32px; height: 32px; margin-bottom: 16px; color: #b2c0c6; }
.creation-heading { max-width: 1120px; margin: 0 auto 22px; }
.creation-heading .page-head { margin-bottom: 18px; }
.back-link { color: #788d96; background: none; border: 0; padding: 0; font-size: 12px; margin-bottom: 12px; }
.back-link:hover { color: var(--text); }
.creation-tabs { display: inline-flex; padding: 4px; gap: 4px; background: #e9edeb; border-radius: 9px; }
.creation-tabs button { display: flex; align-items: center; justify-content: center; gap: 8px; background: none; color: #7b898c; border: 0; padding: 10px 16px; font-size: 12px; border-radius: 6px; }
.creation-tabs button.active { background: #fff; color: #2f4b56; box-shadow: 0 1px 4px #20364009; }
.creation-tabs svg { width: 16px; height: 16px; }
.request-compose { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; max-width: 1120px; margin: auto; }
.compose-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.compose-section { padding: 22px 28px; border-bottom: 1px solid #edf0f0; }
.contact-fields { grid-template-columns: 3fr 2fr; }
.section-heading { display: flex; align-items: start; gap: 12px; margin-bottom: 16px; }
.section-heading > span { display: grid; place-items: center; width: 23px; height: 23px; background: #eff3f1; color: #597365; border-radius: 50%; font-size: 11px; font-weight: 650; flex-shrink: 0; }
.section-heading h2 { margin: 0; font-size: 15px; font-weight: 650; }
.section-heading p { margin: 4px 0 0; font-size: 11px; color: #93a0a5; }
.compose-card .field-label { font-size: 12px; font-weight: 550; color: #647a85; }
.compose-card .field input, .compose-card .field select, .compose-card .field textarea { font-size: 13px; min-height: 43px; border-radius: 7px; padding: 10px 12px; }
.compose-card .field textarea { min-height: 80px; }
.compose-card .check-pill { font-size: 12px; min-height: 36px; border-radius: 6px; padding: 7px 10px; background: #fff; }
.compose-card .check-pill input { min-height: auto; padding: 0; }
.compose-card .check-pill:has(input:checked) { background: #fbeef0; border-color: #d5a5ac; }
.form-disclosure { min-width: 0; grid-column: 1 / -1; }
.form-disclosure > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 28px; cursor: pointer; font-size: 12px; color: #71868f; list-style: none; }
.form-disclosure > summary::-webkit-details-marker { display: none; }
.form-disclosure > summary > span { font-size: 18px; color: #95a5ac; }
.form-disclosure[open] > summary > span { transform: rotate(45deg); }
.compose-section > .form-disclosure { margin: 12px -28px -15px; }
.disclosure-body { padding: 0 28px 22px; }
.compose-section > .form-disclosure .disclosure-body { padding-bottom: 16px; }
.visit-toggle { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.visit-toggle input { width: 18px; height: 18px; flex-shrink: 0; }
.visit-toggle strong { display: block; font-size: 13px; font-weight: 600; }
.visit-toggle small { display: block; font-size: 11px; color: #8c9ca3; margin-top: 3px; }
.visit-fields { padding-top: 22px; }
.compose-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 28px; background: #fafcfb; border-top: 1px solid #edf0f0; border-radius: 0 0 12px 12px; position: sticky; bottom: 0; z-index: 2; }
.compose-footer .compose-error { width: 100%; margin: 0; }
.toast-stack { top: 94px; bottom: auto; }
.toast { display: flex; align-items: center; gap: 14px; color: var(--text); background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 22px #20364018; }
.toast.success { background: #f4faf6; border-left: 3px solid #268053; }
.toast.error { background: #fff7f7; border-left: 3px solid #c93542; }
.toast button { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; padding: 4px; border: 0; background: transparent; color: inherit; }
.toast button svg { width: 16px; height: 16px; }
.text-button { border: 0; background: transparent; color: #607e8b; padding: 5px 0; font-size: 12px; text-align: left; }
.text-button:hover { color: #bd2c3d; text-decoration: underline; }
.form-hint { color: #91a0a6; font-size: 11px; }
.compose-error { margin: 16px 28px; }
.customer-context { min-width: 0; position: sticky; top: 104px; }
.context-heading { font-size: 9px; color: #94a3a8; letter-spacing: 1px; padding: 2px 0 14px; }
.customer-context .panel { background: #fdfefd; }
.customer-context .panel-head { padding: 16px; min-height: 0; }
.customer-context .panel-head h3 { font-size: 12px; }
.customer-context .panel-body { padding: 16px; }
.customer-context .empty { border: 0; padding: 26px 6px; font-size: 12px; color: #94a3a8; background: none; }
.customer-context .form-disclosure { margin-top: 16px; border: 1px solid var(--line); background: #fff; border-radius: 10px; }
.customer-context .form-disclosure summary { padding: 14px 16px; }
.customer-context .disclosure-body { display: block; padding: 0 16px 16px; }
.customer-context .contract-card { margin-bottom: 8px; }
.context-note { font-size: 11px; color: #99a6aa; line-height: 1.7; padding: 4px 4px 0; }
.customer-card { padding: 22px; border: 1px solid #dfe7e2; border-radius: 12px; background: #fff; }
.verified-label { display: inline-flex; gap: 5px; align-items: center; font-size: 10px; color: #5d8770; }
.verified-label svg { width: 13px; height: 13px; }
.customer-card h3 { font-size: 16px; margin: 18px 0 5px; font-weight: 650; }
.customer-address { font-size: 12px; color: #879aa3; margin: 0 0 18px; }
.customer-facts { margin: 0; display: grid; gap: 14px; }
.customer-facts dt { font-size: 10px; color: #98a5aa; margin-bottom: 4px; }
.customer-facts dd { margin: 0; font-size: 12px; color: #465f6a; overflow-wrap: anywhere; }
.customer-card .alert { font-size: 11px; margin-top: 20px; }
.linked-customer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; font-size: 11px; color: #61836d; }
.linked-customer > span { display: flex; align-items: center; gap: 6px; }
.linked-customer svg { width: 14px; height: 14px; }
.ticket-backdrop { justify-items: end; padding: 0; backdrop-filter: blur(2px); background: #14273055; }
.ticket-drawer { width: min(680px, 100%); height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; box-shadow: -15px 0 70px #1c313b22; }
.ticket-drawer .modal-head { padding: 26px 30px; background: #fff; }
.ticket-drawer .modal-head h2 { font-size: 22px; font-weight: 650; line-height: 1.35; }
.ticket-drawer .modal-body { padding: 0 30px 28px; flex: 1; min-height: 0; }
.ticket-drawer .modal-body > form { padding-top: 26px; }
.drawer-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--line); padding: 18px 30px; background: #fff; }
.detail-section { padding: 25px 0; border-bottom: 1px solid var(--line); }
.detail-section h3 { font-size: 12px; font-weight: 650; margin: 0 0 18px; color: #8497a0; }
.request-description { font-size: 15px; line-height: 1.7; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 0; }
.detail-grid dt { font-size: 10px; color: #8e9da5; margin-bottom: 5px; }
.detail-grid dd { font-size: 13px; color: #3c5866; margin: 0; overflow-wrap: anywhere; }
.detail-grid .span-2 { grid-column: 1 / -1; }
.detail-section > .field { margin-top: 22px; }
.internal-note { background: #f7f7f1; border-radius: 8px; padding: 14px 16px; margin-top: 18px; font-size: 12px; color: #8b896c; }
.internal-note strong { font-size: 10px; font-weight: 600; }
.internal-note p { margin: 7px 0 0; line-height: 1.6; white-space: pre-wrap; }
.attachment-text { font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 1180px) {
  .main { padding: 28px 24px 40px; }
  .topbar { padding: 14px 24px; }
  .user-name { display: none; }
  .request-compose { grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; }
  .inbox-toolbar .ticket-filters { gap: 15px; }
  .inbox-search { max-width: none; }
  .compose-section { padding: 22px; }
  .compose-section > .form-disclosure { margin-inline: -22px; }
}
@media (max-width: 960px) {
  .request-compose { grid-template-columns: 1fr; }
  .customer-context { position: static; }
  .customer-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .breadcrumb { font-size: 11px; gap: 7px; }
  .toolbar-refresh span { display: none; }
}
@media (max-width: 820px) {
  .sidebar { padding-top: 26px; }
  .topbar { min-height: 62px; padding: 10px 14px; gap: 12px; flex-wrap: nowrap; }
  .topbar .global-search { display: none; }
  .topbar:has(.global-search) { flex-wrap: wrap; }
  .topbar:has(.global-search) .global-search { display: flex; order: 4; flex-basis: 100%; }
  .breadcrumb { color: transparent; font-size: 0; gap: 0; }
  .breadcrumb > span { display: none; }
  .breadcrumb strong { font-size: 12px; }
  .topbar-status { gap: 8px; }
  .main { padding: 24px 14px 36px; }
  .page-title { font-size: 29px; }
  .work-heading { align-items: start; margin-bottom: 22px; }
  .workspace-date { font-size: 10px; padding-top: 27px; }
  .work-heading .page-subtitle { font-size: 11px; }
  .inbox-toolbar { padding: 0 14px 14px; gap: 14px; }
  .inbox-toolbar .ticket-filters { flex-wrap: nowrap; gap: 18px; width: 100%; overflow-x: auto; }
  .inbox-toolbar .filter-button { white-space: nowrap; padding-top: 17px; padding-bottom: 13px; font-size: 11px; }
  .inbox-footer { padding: 14px; font-size: 10px; }
  .inbox-footer > span:last-child { display: none; }
  .request-table, .request-table tbody { display: block; min-width: 0; width: 100%; }
  .request-table thead { display: none; }
  .request-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--line); padding: 18px; gap: 10px; }
  .request-table td { border: 0; padding: 0; min-width: 0; }
  .request-table td:nth-child(1), .request-table td:nth-child(2) { grid-column: 1 / -1; }
  .request-table td:nth-child(3) { grid-column: 1; }
  .request-table td:nth-child(4) { grid-column: 2; text-align: right; }
  .request-table td:nth-child(5) { display: none; }
  .request-table .row-meta { margin-top: 4px; }
  .request-title { font-size: 14px; }
  .creation-tabs { display: flex; width: 100%; }
  .creation-tabs button { flex: 1; font-size: 11px; padding: 10px; }
  .creation-heading { margin-bottom: 18px; }
  .creation-heading .page-head { margin-bottom: 20px; }
  .compose-section { padding: 22px 18px; }
  .compose-section > .form-disclosure { margin-inline: -18px; }
  .form-disclosure > summary { padding: 18px; }
  .disclosure-body { padding: 0 18px 18px; }
  .compose-footer { padding: 18px; gap: 12px; flex-wrap: wrap; }
  .compose-footer .btn.primary { margin-left: auto; }
  .compose-footer .form-hint { width: 100%; }
  .compose-error { margin-inline: 18px; }
  .toast-stack { top: 74px; bottom: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .ticket-drawer .modal-head { padding: 20px; }
  .ticket-drawer .modal-head h2 { font-size: 20px; }
  .ticket-drawer .modal-body { padding: 0 20px 24px; }
  .drawer-footer { padding: 16px 20px; }
  .drawer-footer .btn { flex: 1; }
}

/* Услуги дома в списке узлов (по «Адреске»). */
.ktv-svc { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; font-size: 10px; font-weight: 600; line-height: 16px; vertical-align: middle; }
.ktv-svc.both { background: #e3f4e8; color: #1f7a3a; }
.ktv-svc.tv { background: #e8eefb; color: #2f55a4; }
.ktv-svc.inet { background: #f3e8fb; color: #7a3aa4; }
.ktv-svc.none { background: #f1f1f1; color: #888; }
.ktv-svc-legend { margin-top: 6px; font-size: 12px; color: #7b878b; }

a.nav-button { text-decoration: none; }

/* Карта сети */
.network-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.network-map-panel {
  overflow: hidden;
}

.network-map-slot {
  height: calc(100vh - 230px);
  min-height: 420px;
  background: var(--bg-strong);
  position: relative;
}

.network-map-slot.adding .leaflet-container {
  cursor: crosshair;
}

.network-map-canvas {
  position: absolute;
  inset: 0;
}

.network-map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.network-map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.network-filter {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 4px 10px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.network-filter.off {
  opacity: 0.45;
  text-decoration: line-through;
}

.net-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  flex: none;
}

.net-pin {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.net-pin.selected {
  outline: 3px solid var(--c);
  outline-offset: 2px;
}

.network-map-side {
  display: grid;
  gap: 16px;
}

.network-map-search {
  width: 100%;
  margin-bottom: 10px;
}

.network-map-list {
  display: grid;
  gap: 4px;
  max-height: 420px;
  overflow-y: auto;
}

.network-map-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 8px;
  cursor: pointer;
}

.network-map-item .net-dot {
  margin-top: 4px;
}

.network-map-item:hover,
.network-map-item.active {
  background: var(--surface-soft);
  border-color: var(--line);
}

.network-map-item small,
.network-map-file small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.network-map-files {
  display: grid;
  gap: 10px;
}

.network-map-file {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.network-map-desc {
  white-space: pre-line;
}

.network-map-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1100px) {
  .network-map-layout {
    grid-template-columns: 1fr;
  }

  .network-map-slot {
    height: 60vh;
  }
}

/* Подпись OSM обязательна по лицензии — оставляем, но едва заметной. */
.network-map-canvas .leaflet-control-attribution {
  background: transparent;
  font-size: 9px;
  opacity: 0.55;
}

.network-map-canvas .leaflet-control-attribution a {
  color: inherit;
}

/* История абонента */
.subscriber-query {
  padding-top: 0;
  margin: 0;
}

.subscriber-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.subscriber-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.subscriber-tickets {
  display: grid;
  gap: 10px;
}

.subscriber-ticket {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.subscriber-ticket-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.subscriber-ticket-head small,
.subscriber-note small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.subscriber-desc {
  margin: 0;
  white-space: pre-line;
}

.subscriber-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 12px;
  border-left: 2px solid var(--line);
  display: grid;
  gap: 6px;
}

.subscriber-timeline li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
  font-size: 13px;
}

.subscriber-timeline time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.subscriber-timeline .kind-status b {
  color: var(--teal);
}

.subscriber-timeline .kind-comment span {
  font-style: italic;
}

.subscriber-note-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.subscriber-note-form textarea {
  width: 100%;
}

.subscriber-notes {
  display: grid;
  gap: 10px;
}

.subscriber-note {
  background: var(--amber-soft);
  border-radius: 8px;
  padding: 8px 10px;
}

.subscriber-note p {
  margin: 0;
  white-space: pre-line;
}

@media (max-width: 1100px) {
  .subscriber-layout,
  .subscriber-search {
    grid-template-columns: 1fr;
  }

  .subscriber-timeline li {
    grid-template-columns: 1fr;
  }
}

/* База адресов */
.address-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.address-search input,
.address-new input {
  width: 100%;
}

.address-list {
  max-height: 60vh;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.address-item {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 10px 16px;
  cursor: pointer;
}

.address-item[hidden] {
  display: none;
}

.address-item small {
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.address-item span {
  font-size: 12px;
}

.address-item:hover,
.address-item.active {
  background: var(--amber-soft);
}

.address-new {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.address-card h3 {
  margin: 16px 0 8px;
  font-size: 15px;
}

.address-card h3:first-child {
  margin-top: 0;
}

.address-note-form {
  margin-top: 12px;
}

.address-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.address-photos figure {
  margin: 0;
}

.address-photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: var(--line);
}

.address-photos figcaption {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.address-photo-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  aspect-ratio: 4 / 3;
  border: 2px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}

.address-photo-add:hover {
  border-color: var(--teal);
  color: var(--teal);
}

@media (max-width: 1100px) {
  .address-layout {
    grid-template-columns: 1fr;
  }
}

.address-photo-add svg {
  width: 28px;
  height: 28px;
}

/* Дежурные в субботу */
.duty-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.duty-dates {
  padding: 6px;
}

.duty-date {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease-out;
}

.duty-date:hover {
  background: var(--surface-soft);
}

.duty-date strong {
  display: block;
  font-weight: 600;
}

.duty-date strong::first-letter {
  text-transform: uppercase;
}

.duty-date span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duty-date.selected {
  background: var(--teal-soft);
}

.duty-date.selected strong {
  color: var(--teal-dark);
}

.duty-roster .panel-head h2::first-letter {
  text-transform: uppercase;
}

.duty-count {
  color: var(--muted);
  font-size: 13px;
}

.duty-group + .duty-group {
  margin-top: 20px;
}

.duty-group h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.duty-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}

.duty-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
}

button.duty-person {
  cursor: pointer;
  transition: border-color 120ms ease-out, background-color 120ms ease-out;
}

button.duty-person:hover {
  border-color: var(--line-strong);
}

.duty-person.selected {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.duty-check {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.duty-person.selected .duty-check {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.duty-check svg {
  width: 14px;
  height: 14px;
}

.duty-name {
  min-width: 0;
  font-weight: 500;
}

@media (max-width: 960px) {
  .duty-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .duty-dates {
    display: flex;
    gap: 4px;
    overflow-x: auto;
  }

  .duty-date {
    flex: 0 0 180px;
  }
}
