.viber-package { padding: 16px; border: 1px solid #cfc3ef; border-radius: 10px; background: #f8f5ff; color: #302644; }
.viber-package h3 { margin: 0 0 8px; font-size: 16px; }
.viber-package ol { padding-left: 22px; line-height: 1.6; font-size: 13px; }
.viber-package .form-actions { flex-wrap: wrap; }
.viber-confirm-check { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; line-height: 1.5; font-size: 13px; }
.viber-confirm-check input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.email-signature-preview { padding: 14px; border: 1px solid #dfe6ef; border-radius: 8px; background: #fff; color: #1d2433; min-width: 0; }
.email-signature-caption { margin: 0 0 12px; font-size: 12px; color: #52657e; }
.email-signature-notice { margin: 0 0 16px; font-size: 13px; line-height: 1.5; font-weight: 700; overflow-wrap: anywhere; }
.email-signature-greeting { margin: 0 0 10px; font: 13px Arial, Helvetica, sans-serif; }
.email-signature-card { display: flex; align-items: flex-start; gap: 18px; font: 13px/1.35 Arial, Helvetica, sans-serif; }
.email-signature-logo { flex: 0 0 auto; padding-right: 18px; border-right: 2px solid #1565d8; }
.email-signature-logo img { display: block; width: 92px; height: 92px; object-fit: contain; }
.email-signature-info { min-width: 0; overflow-wrap: anywhere; }
.email-signature-name { font-size: 18px; font-weight: 700; color: #0f5bd7; margin-bottom: 2px; }
.email-signature-title { color: #4f5b6b; margin-bottom: 7px; }
.email-signature-company { font-weight: 700; margin-bottom: 8px; }
.email-signature-contact { color: #0f5bd7; margin-top: 2px; }
.email-signature-services { border-top: 1px solid #dfe6ef; padding-top: 8px; margin-top: 8px; font-size: 12px; color: #66717f; }
.email-signature-services > div { margin-bottom: 3px; }
.email-signature-services > div:first-child { color: #0f5bd7; font-weight: 700; }
@media (max-width: 600px) {
  .email-signature-card { gap: 10px; }
  .email-signature-logo { padding-right: 10px; }
  .email-signature-logo img { width: 60px; height: 60px; }
  .email-signature-name { font-size: 16px; }
}

:root {
  --page: #eef4fb;
  --surface: #ffffff;
  --surface-muted: #f4f8fe;
  --ink: #172f50;
  --muted: #52657e;
  --line: #d7e3f2;
  --line-strong: #b6cbe3;
  --accent: #0755c9;
  --accent-hover: #0345ab;
  --blue: #075bd8;
  --blue-soft: #e8f1ff;
  --cyan: #0798b5;
  --teal: #087b83;
  --teal-soft: #e8f8f8;
  --nav-ink: #dce8f8;
  --nav-muted: #acbfdc;
  --green: #16794c;
  --green-soft: #eaf8f1;
  --amber: #a76008;
  --amber-soft: #fff5e6;
  --red: #b53535;
  --red-soft: #fff0f0;
  --violet: #7351c6;
  --violet-soft: #f2effb;
  --shadow: 0 1px 3px rgba(21, 59, 110, .04), 0 7px 24px rgba(21, 59, 110, .05);
  --radius-control: 6px;
  --radius-card: 10px;
  --sidebar: 236px;
}

* { box-sizing: border-box; }

html { height: 100%; }

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

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background:
    radial-gradient(ellipse at 12% 18%, rgba(7, 85, 201, .16), transparent 48%),
    radial-gradient(ellipse at 90% 88%, rgba(0, 185, 219, .18), transparent 45%),
    #eef4fb;
}
.auth-screen .auth-card { width: min(440px, 100%); padding: 28px; border-top: 4px solid var(--accent); box-shadow: 0 18px 60px rgba(21, 59, 110, .12); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 34px; }
.auth-brand > div { display: flex; flex-direction: column; }
.auth-brand strong { color: var(--ink); font-size: 16px; letter-spacing: .02em; }
.auth-copy h1 { margin: 5px 0 9px; font-size: 24px; line-height: 1.2; letter-spacing: -.025em; }
.auth-copy > p:last-child { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.auth-form { display: grid; gap: 14px; }
.button-wide { width: 100%; min-height: 40px; margin-top: 3px; }
.auth-message { min-height: 20px; margin: 12px 0 0; color: var(--green); font-size: 11px; }
.auth-message.is-error { color: var(--red); }
.auth-note { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.clickable-table tbody tr:focus-visible {
  outline: 2px solid rgba(50, 103, 227, .65);
  outline-offset: -2px;
}

.attention-item:focus-visible,
.deal-card:focus-visible {
  outline: 2px solid rgba(50, 103, 227, .65);
  outline-offset: 2px;
}

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

.accounts-filters { display: grid; grid-template-columns: minmax(240px, 1fr) 230px; gap: 16px; }
.accounts-layout { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(320px, 1.2fr); gap: 20px; align-items: start; }
.accounts-list { display: grid; gap: 8px; max-height: 75vh; overflow-y: auto; padding: 2px; }
.account-list-item, .account-request-button { text-align: left; display: grid; gap: 7px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); overflow-wrap: anywhere; width: 100%; }
.account-list-item:hover, .account-request-button:hover { border-color: var(--line-strong); background: var(--surface-muted); }
.account-list-item.is-selected { border-color: var(--blue); background: var(--blue-soft); }
.account-contact-line { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; margin: 0; }
.account-detail { min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-card); padding: 22px; overflow-wrap: anywhere; }
.account-detail h2 { font-size: 22px; margin-top: 0; }
.account-detail h3 { margin: 26px 0 12px; font-size: 15px; }
.account-conversation { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.account-conversation > div { min-width: 0; }
.account-conversation > button { flex-shrink: 0; }
.account-opportunities { display: grid; gap: 8px; }
.account-history { border-top:1px solid var(--line); margin-top:22px; padding-top:22px; min-width:0; }
.account-history-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.account-history-heading h3 { margin:0; }
.account-history-filters { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0 12px; }
.account-history-filters .button { white-space:normal; }
.account-history-filters .is-active { color:#fff; background:var(--blue); border-color:var(--blue); }
.account-history-warning { padding:12px; border:1px solid #e2d9aa; border-radius:10px; background:#fffbed; color:#655314; font-size:12px; line-height:1.5; }
.account-history-status, .account-history-meta, .account-history-time { font-size:12px; color:var(--muted); line-height:1.5; }
.account-history-list { list-style:none; margin:14px 0; padding:0; display:grid; gap:12px; }
.account-history-item { padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--surface-muted); min-width:0; overflow-wrap:anywhere; }
.account-history-item-header { display:flex; gap:8px 14px; flex-wrap:wrap; justify-content:space-between; }
.account-history-workflow { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:stretch; gap:8px; margin:12px 0; }
.account-history-workflow-step { display:grid; align-content:start; gap:4px; min-width:0; padding:12px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.account-history-workflow-step small { color:var(--muted); font-size:11px; }
.account-history-workflow-arrow { align-self:center; color:var(--muted); }
.request-original-number { display:block; font-size:11px; font-weight:400; color:var(--muted); line-height:1.5; text-transform:none; letter-spacing:normal; }
.account-history-text summary { cursor:pointer; font-size:12px; color:var(--blue); }
.account-history-text .task-description { padding:12px 0; }
.account-history-file { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; border-top:1px solid var(--line); margin-top:12px; padding-top:10px; }
.account-history-file > span:first-child { min-width:0; overflow-wrap:anywhere; }
.account-history-file-actions, .account-history-item-actions { display:flex; flex-wrap:wrap; gap:8px; }
.account-history-item-actions { margin-top:12px; }
.account-history-item-actions .button { max-width:100%; white-space:normal; }
.account-history-empty { padding:18px 0; color:var(--muted); font-size:13px; }
.account-history-conversations > .button { margin-top:16px; max-width:100%; white-space:normal; }
.account-history [hidden] { display:none!important; }
.accounts-pagination { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding-top: 14px; font-size: 12px; }
.reply-file-zone { border: 1px dashed var(--line-strong); border-radius: var(--radius-control); padding: 14px; background: var(--surface-muted); }
.reply-file-zone.is-dragover { background: var(--blue-soft); border-color: var(--blue); }
.reply-file-picker { display: grid; gap: 9px; font-size: 13px; }
.reply-file-picker input { width: 100%; }
.reply-file-zone p { color: var(--muted); font-size: 11px; margin: 8px 0 0; }
.reply-files-list { list-style: none; margin: 0; padding: 0; }
.reply-file-item { display: flex; gap: 10px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.reply-file-item span { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 1100px) {
  .accounts-layout { grid-template-columns: 1fr; }
  .accounts-list { max-height: 360px; }
}
@media (max-width: 600px) {
  .accounts-filters { grid-template-columns: 1fr; }
  .account-conversation { align-items: flex-start; flex-direction: column; }
  .account-detail { padding: 16px; }
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  color: var(--nav-ink);
  background: linear-gradient(170deg, #102e59 0%, #0c2244 100%);
  border-right: 1px solid #214b75;
}

.brand { display: flex; flex: none; align-items: center; gap: 11px; padding: 0 6px 22px; }
.brand-logo {
  display: block;
  width: 52px;
  height: 52px;
  flex: none;
  object-fit: contain;
  padding: 2px;
  border: 1px solid #d7e3f2;
  border-radius: 10px;
  background: #fff;
}
.brand-copy { display: flex; min-width: 0; flex-direction: column; }
.brand-copy strong { color: #fff; letter-spacing: .015em; font-size: 13px; line-height: 1.5; }

.main-nav, .archive-nav { display: grid; gap: 4px; }
.main-nav { min-height: 0; flex: 1; align-content: start; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #466893 transparent; }
.archive-nav {
  flex: none;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #2a456a;
}
.nav-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}
.nav-item:hover { color: #fff; background: #1b3f6c; }
.nav-item.is-active { color: #fff; background: linear-gradient(105deg, #1759bd, #126b9f); box-shadow: inset 3px 0 #56d7ed; font-weight: 650; }
.nav-icon { width: 20px; color: #8fbffa; font-size: 17px; text-align: center; }
.nav-item.is-active .nav-icon { color: #fff; }
.nav-count {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  color: #dce8f8;
  background: #29486e;
  font-size: 11px;
  text-align: center;
}
.nav-item.is-active .nav-count { color: #fff; background: rgba(255, 255, 255, .18); }
.nav-item.has-unread { color: #fff; font-weight: 750; }
.nav-item.has-unread .nav-icon { color: #75e7ff; }
.nav-item.has-unread .nav-count { color: #102d52; background: #75e7ff; font-weight: 750; }
#telegram-unread-count[hidden] { display: none; }
.sidebar button:focus-visible { outline-color: #73ddec; outline-offset: -2px; }

.sidebar-status {
  display: grid;
  flex: none;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  align-items: start;
  padding: 14px 10px 4px;
}
.sidebar-status strong, .sidebar-status small { display: block; }
.sidebar-status strong { font-size: 12px; font-weight: 600; }
.sidebar-status small { margin-top: 2px; color: var(--nav-muted); font-size: 11px; }
.status-dot, .live-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #aaa; }
.status-dot.is-online, .live-dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.status-dot.is-offline { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.sidebar-status .status-dot.is-online { background: #42d7b1; box-shadow: 0 0 0 3px rgba(66, 215, 177, .14); }
.sidebar-status .status-dot.is-offline { background: #ff9b9b; box-shadow: 0 0 0 3px rgba(255, 155, 155, .14); }

.workspace { width: calc(100% - var(--sidebar)); min-width: 0; margin-left: var(--sidebar); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 18px;
  padding: 13px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 251, 255, .96);
  box-shadow: 0 2px 12px rgba(21, 59, 110, .035);
  backdrop-filter: blur(12px);
}
.topbar-title { min-width: 0; margin-right: auto; }
.topbar h1 { margin: 0; font-size: 20px; line-height: 1.25; letter-spacing: -.015em; }
.topbar p { overflow: hidden; margin: 3px 0 0; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.sync-time { margin-right: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.mobile-menu { display: none; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--radius-control); background: #fff; }
.mobile-menu-backdrop { display:none; }
.user-menu { display: flex; align-items: center; gap: 8px; margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--line-strong); }
.user-avatar { display: grid; width: 32px; height: 32px; flex: none; place-items: center; border-radius: 8px; color: #fff; background: var(--accent); font-size: 10px; font-weight: 720; }
.user-copy { display: flex; min-width: 92px; max-width: 160px; flex-direction: column; }
.user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 11px; }
.user-copy small { color: var(--muted); font-size: 9px; }

.content { width: min(1540px, 100%); margin: 0 auto; padding: 24px 28px 44px; }
footer { padding: 18px 28px 24px; color: var(--muted); font-size: 11px; text-align: center; }

.view { display: none; }
.view.is-active { display: block; animation: reveal .16s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(2px); } }

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

.button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.button:disabled { cursor: wait; opacity: .55; }
.button-primary { color: #fff; background: var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); }
.button-warning { color: #493200; background: #facc15; border-color: #d7a900; }
.button-warning:hover:not(:disabled) { background: #eab308; }
.deal-list-actions-cell { min-width: 170px; }
.deal-list-actions { display: flex; flex-direction: column; align-items: stretch; gap: 7px; }
.deal-schedule-placed { display: inline-block; padding: 7px 10px; border-radius: 8px; background: #e4f6ed; color: #126441; font-size: 13px; font-weight: 600; }
.deal-list-dialog, .desktop-excel-dialog { box-sizing: border-box; width: min(480px, calc(100vw - 28px)); max-height: calc(100vh - 32px); overflow-y: auto; border: 1px solid #c6d8ef; border-radius: 16px; padding: 24px; color: #183351; box-shadow: 0 20px 70px #071c3d40; }
.deal-list-dialog::backdrop, .desktop-excel-dialog::backdrop { background: #10233e66; }
.deal-list-dialog form { display: grid; gap: 18px; }
.deal-list-dialog h2, .deal-list-dialog p { margin: 0; }
.deal-list-dialog .field[hidden] { display: none; }
.deal-list-description { overflow-wrap: anywhere; }
.deal-list-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.desktop-excel-dialog h2 { margin-top: 0; }
.desktop-excel-dialog p { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.desktop-excel-dialog a[hidden] { display: none; }
.button-danger { color: #fff; background: #b91c1c; border-color: #b91c1c; }
.button-danger:hover:not(:disabled) { background: #991b1b; }
.workflow-action-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.refusal-editor { margin-top: 16px; padding: 16px; background: #fff7f7; border: 1px solid #f3b6b6; border-radius: 10px; }
.refusal-editor .workflow-action-buttons { margin-top: 12px; }
#requests-body [data-restore-opportunity-id] { display: block; margin-top: 8px; white-space: normal; }
.button-secondary { color: #24496e; border-color: var(--line-strong); background: #fff; }
.button-secondary:hover:not(:disabled), .button-ghost:hover:not(:disabled) { color: var(--accent); border-color: #83ace1; background: var(--blue-soft); }
.button-ghost { color: var(--muted); background: transparent; }
.button-small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.text-button { padding: 4px 0; border: 0; color: var(--accent); background: none; font-size: 12px; }
.text-button:hover { color: var(--accent-hover); }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 22px; line-height: 1; }
.icon-button:hover { background: #f3f3f3; }

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
}
.toolbar-note { display: flex; align-items: center; gap: 9px; margin: 0 4px 8px auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.toolbar-note .live-dot { margin: 0; }

.field { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.field > span { color: #666; font-size: 11px; font-weight: 560; }
.field input, .field select, .field textarea, .search-field {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: #fff;
}
.field input, .field select { height: 36px; padding: 6px 9px; }
.field textarea { min-height: 80px; padding: 8px 9px; resize: vertical; }
.field input::placeholder, .search-field input::placeholder { color: #a4a4a4; }
.compact-field { width: min(190px, 20vw); }
.search-field { display: flex; min-width: 240px; max-width: 440px; flex: 1; align-items: center; gap: 7px; height: 36px; padding: 0 9px; }
.search-field span { color: #777; font-size: 18px; }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; }
.check-field { display: flex; min-height: 36px; align-items: center; gap: 7px; margin-left: auto; color: #555; font-size: 12px; white-space: nowrap; }
.check-field input { accent-color: var(--accent); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi-card { min-height: 126px; padding: 17px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { color: #656565; font-size: 12px; }
.kpi-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 7px; color: var(--accent); background: var(--blue-soft); font-size: 13px; }
.kpi-value { display: block; overflow: hidden; margin-top: 13px; font-size: clamp(22px, 2.1vw, 30px); font-weight: 710; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.kpi-note { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.kpi-note.is-alert { color: var(--red); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(330px, .8fr); gap: 14px; }
.panel { min-height: 320px; padding: 18px; }
.panel-wide { min-width: 0; }
#customer-analytics { grid-column: 1 / -1; }
#customer-analytics table { min-width: 780px; }
#customer-analytics th { white-space: normal; }
#customer-analytics td { vertical-align: top; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.panel-heading h2 { margin: 2px 0 0; font-size: 16px; letter-spacing: -.01em; }
.eyebrow { margin: 0; color: #777; font-size: 9px; font-weight: 720; letter-spacing: .13em; text-transform: uppercase; }
.panel-meta { color: var(--muted); font-size: 11px; }

.funnel { display: grid; gap: 12px; }
.funnel-row { display: grid; grid-template-columns: minmax(105px, 1fr) minmax(150px, 3.2fr) auto; align-items: center; gap: 12px; }
.funnel-label { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.funnel-label strong { display: block; font-weight: 620; }
.funnel-label small { color: var(--muted); }
.funnel-track { height: 26px; overflow: hidden; border-radius: 5px; background: #edf3fb; }
.funnel-bar { display: flex; width: 0; height: 100%; min-width: 2px; align-items: center; justify-content: flex-end; padding: 0 7px; border-radius: 5px; color: #fff; background: #0755c9; font-size: 10px; transition: width .35s ease; }
.funnel-row:nth-child(2) .funnel-bar { background: #1966c2; }
.funnel-row:nth-child(3) .funnel-bar { background: #1775a9; }
.funnel-row:nth-child(4) .funnel-bar { background: #0d7d99; }
.funnel-row:nth-child(5) .funnel-bar { background: #087b83; }
.funnel-amount { color: #555; font-size: 11px; text-align: right; white-space: nowrap; }

.trend-chart { position: relative; min-height: 238px; }
.trend-chart svg { display: block; width: 100%; height: 238px; overflow: visible; }
.trend-grid-line { stroke: #e9e9e9; stroke-width: 1; }
.trend-area { fill: url(#trendFill); }
.trend-line { fill: none; stroke: var(--blue); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.trend-point { fill: #fff; stroke: var(--blue); stroke-width: 1.7; }
.trend-chart stop { stop-color: var(--blue); }
.trend-label { fill: var(--muted); font-size: 9px; }

.attention-list { display: grid; gap: 1px; }
.attention-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid #ededed; cursor: pointer; }
.attention-item:last-child { border-bottom: 0; }
.attention-item:hover strong { text-decoration: underline; }
.attention-badge { min-width: 34px; padding: 4px 6px; border-radius: 5px; color: var(--red); background: var(--red-soft); font-size: 10px; text-align: center; }
.attention-copy { min-width: 0; }
.attention-copy strong, .attention-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-copy strong { font-size: 12px; }
.attention-copy span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.attention-arrow { color: #999; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.section-heading h2 { margin: 0; font-size: 19px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.segmented button { min-height: 30px; padding: 5px 10px; border: 0; border-radius: 5px; color: #666; background: transparent; font-size: 12px; }
.segmented button.is-active { color: #fff; background: var(--accent); }
.segmented span { margin-left: 3px; opacity: .78; }

.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 14px; border-bottom: 1px solid var(--line); color: #49617f; background: #f0f6ff; font-size: 10px; font-weight: 680; letter-spacing: .035em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid #ececec; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.clickable-table tbody tr { cursor: pointer; }
.clickable-table tbody tr:not([class*="urgency-"]):hover td { background: #eef6ff; }
.cell-main { display: block; max-width: 340px; overflow: hidden; font-size: 12px; font-weight: 610; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { display: block; max-width: 340px; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub.is-alert { color: var(--red); }
.table-action { display: flex; width: max-content; margin-top: 8px; }
.opportunity-quick-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex-shrink: 0; }
.opportunity-quick-actions.table-action { width: auto; max-width: 100%; }
.numeric { text-align: right; }
.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; max-width: 220px; padding: 3px 8px; border-radius: 999px; color: #525252; background: #eee; font-size: 10px; line-height: 1.2; }
.pill-dot { width: 5px; height: 5px; flex: none; border-radius: 50%; background: currentColor; }
.pill-green { color: var(--green); background: var(--green-soft); }
.pill-blue { color: #315eaf; background: var(--blue-soft); }
.pill-amber { color: var(--amber); background: var(--amber-soft); }
.pill-red { color: var(--red); background: var(--red-soft); }
.pill-violet { color: var(--violet); background: var(--violet-soft); }

.review-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.review-card { display: flex; min-height: 220px; flex-direction: column; padding: 17px; }
.review-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.review-card h3 { overflow: hidden; margin: 13px 0 7px; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.review-card p { display: -webkit-box; overflow: hidden; margin: 0; color: #555; font-size: 12px; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.review-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.review-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: auto; padding-top: 16px; }
.review-counterparty-form { display: grid; width: 100%; grid-template-columns: minmax(150px, 1fr) auto; align-items: end; gap: 8px; }
.review-counterparty-field { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.review-counterparty-field > span { color: #666; font-size: 10px; font-weight: 560; }
.review-counterparty-field input { width: 100%; height: 34px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); color: var(--ink); background: #fff; }
.review-counterparty-field input::placeholder { color: #a4a4a4; }

.kanban { display: grid; grid-auto-columns: minmax(260px, 1fr); grid-auto-flow: column; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-column { min-height: 460px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-card); background: #f0f0f0; }
.kanban-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 1px 2px 11px; }
.kanban-heading strong { font-size: 12px; }
.kanban-heading span { min-width: 22px; padding: 2px 6px; border-radius: 999px; background: #ddd; font-size: 10px; text-align: center; }
.kanban-stack { display: grid; gap: 8px; }
.deal-card { padding: 12px; border: 1px solid #dedede; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); cursor: pointer; }
.deal-card:hover { border-color: #bbb; }
.deal-card-head { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.deal-card h3 { overflow: hidden; margin: 8px 0 3px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.deal-card p { overflow: hidden; margin: 0; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.deal-card-foot { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 9px; border-top: 1px solid #eee; }
.deal-card-foot span { color: #666; font-size: 10px; }
.deal-card-foot strong { font-size: 12px; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 360px); gap: 16px; align-items: start; }
.manager-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.manager-card { padding: 16px; }
.manager-head { display: flex; align-items: center; gap: 11px; }
.manager-statuses { display: grid; justify-items: end; gap: 5px; }
.avatar { display: grid; width: 38px; height: 38px; flex: none; place-items: center; border-radius: 10px; color: #fff; background: #484848; font-size: 12px; font-weight: 700; }
.manager-copy { min-width: 0; flex: 1; }
.manager-copy strong, .manager-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manager-copy strong { font-size: 13px; }
.manager-copy span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.manager-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 15px; }
.mini-metric { padding: 8px; border-radius: 7px; background: #f7f7f7; }
.mini-metric strong, .mini-metric span { display: block; }
.mini-metric strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.mini-metric span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.manager-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.manager-controls .field { min-width: 135px; flex: 1; }
.manager-controls .field select { height: 32px; }
.active-toggle { display: flex; align-items: center; gap: 5px; min-height: 32px; color: #666; font-size: 10px; white-space: nowrap; }
.active-toggle input { accent-color: var(--ink); }
.settings-column { display: grid; gap: 14px; }
.password-reset-form { display: grid; grid-template-columns: minmax(145px, 1fr) auto; align-items: end; gap: 8px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.password-reset-form .button { min-height: 36px; }
.form-card { padding: 17px; }
.form-card > .field { margin-bottom: 12px; }
.form-card .button { width: 100%; margin-top: 4px; }
.form-message { min-height: 18px; margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.form-message.is-error { color: var(--red); }
.form-message.is-success { color: var(--green); }
.manual-request-dialog { width: min(680px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); padding: 0; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px #153a5a40; overflow: auto; }
.manual-request-dialog::backdrop { background: #17283b85; }
.manual-request-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg,#eff8ff,#fff); }
.manual-request-heading h2 { margin: 3px 0 0; font-size: 22px; }
#manual-request-form { padding: 18px 24px; }
.manual-request-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px 16px; }
.manual-full-width { grid-column: 1 / -1; }
.manual-file-drop { margin-top: 16px; padding: 12px; border: 1px dashed #7ab4df; border-radius: 10px; background: #f6fbff; }
.manual-file-drop.is-dragover { border-color: #0071c9; background: #dfedff; }
.manual-file-drop input, .manual-contact input[type="file"] { height: auto; max-width: 100%; }
.manual-file-list { padding: 0; list-style: none; }
.manual-file-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; font-size: 12px; }
.manual-file-list span { min-width: 0; overflow-wrap: anywhere; }
.manual-request-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; padding: 0; border: 0; }
.manual-contact { margin: 12px 0; padding: 12px; border: 1px solid #cde2f3; border-radius: 10px; background: #f7fbff; }
.manual-email-row { display: flex; align-items: flex-end; gap: 10px; }
.manual-email-row .field { flex: 1; }
@media (max-width: 620px) { .manual-request-grid { grid-template-columns: 1fr; } .manual-request-heading, #manual-request-form { padding: 16px; } .manual-email-row { align-items: stretch; flex-direction: column; } }
.stage-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: stage; }
.stage-list li { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 7px; background: #f7f7f7; font-size: 11px; }
.stage-list li::before { counter-increment: stage; content: counter(stage); display: grid; width: 21px; height: 21px; place-items: center; border-radius: 6px; color: #fff; background: #555; font-size: 9px; }
.muted-note { margin: 12px 0 0; color: var(--muted); font-size: 10px; }

.empty-state { padding: 34px 18px; color: var(--muted); font-size: 12px; text-align: center; }
.alert { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; padding: 12px 14px; border-radius: var(--radius-card); }
.alert-error { border: 1px solid #efcece; color: #7e2929; background: var(--red-soft); }
.alert strong { display: block; font-size: 12px; }
.alert p { margin: 2px 0 0; font-size: 10px; }
.is-hidden { display: none !important; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .24); opacity: 1; }
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 60;
  width: min(720px, 94vw);
  background: #fff;
  box-shadow: -16px 0 50px rgba(0, 0, 0, .13);
  transform: translateX(102%);
  transition: transform .2s ease;
}
.drawer.is-open { transform: translateX(0); }
.drawer-header { display: flex; min-height: 86px; align-items: start; justify-content: space-between; gap: 18px; padding: 19px 22px; border-bottom: 1px solid var(--line); background: #f0f6ff; }
.drawer-header h2 { margin: 3px 0 2px; font-size: 19px; }
.drawer-header > div { min-width: 0; }
.drawer-header > div > p:last-child { overflow: hidden; margin: 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { height: calc(100vh - 86px); overflow-y: auto; padding: 20px 22px 34px; }
.drawer-body > section, .drawer-body > form { padding: 0 0 22px; margin: 0 0 21px; border-bottom: 1px solid var(--line); }
.drawer-body > section:last-child { border-bottom: 0; }
.section-label-row { display: flex; align-items: center; justify-content: space-between; }
.section-label { margin: 0 0 12px; font-size: 12px; letter-spacing: .015em; }
.section-label-row span { color: var(--muted); font-size: 10px; }
.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.fact { min-width: 0; padding: 10px; border-radius: 7px; background: #f1f6fc; }
.fact.wide { grid-column: 1 / -1; }
.fact dt { color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.fact dd { overflow-wrap: anywhere; margin: 4px 0 0; font-size: 11px; }
.request-message-block, .request-attachments-block { margin-top: 16px; }
.request-content-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.request-content-heading h4 { margin: 0; font-size: 11px; }
.request-content-heading span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.request-message-text {
  max-height: min(300px, 38vh);
  overflow: auto;
  overflow-wrap: anywhere;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #333;
  background: #fafafa;
  font-size: 13px;
  line-height: 1.42;
  white-space: pre-wrap;
  unicode-bidi: plaintext;
  user-select: text;
}
.request-content-status { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #fafafa; font-size: 11px; }
.request-content-status.is-warning { border-color: #efd9b7; color: #764506; background: var(--amber-soft); }
.request-content-status.is-error { border-color: #efcece; color: #7e2929; background: var(--red-soft); }
.correspondence-launch { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.correspondence-launch .section-label { margin-bottom: 3px; }
.correspondence-launch p { margin: 0; color: var(--muted); font-size: 10px; }
.correspondence-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .42); }
.correspondence-modal {
  position: fixed;
  top: 4vh;
  bottom: 4vh;
  left: 50%;
  z-index: 75;
  display: grid;
  width: min(980px, calc(100vw - 40px));
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .24);
  transform: translateX(-50%);
}
.correspondence-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.correspondence-modal-header h2 { margin: 2px 0 0; font-size: 18px; }
.correspondence-modal-header > div > p:last-child { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.correspondence-modal-body { min-height: 0; overflow-y: auto; padding: 17px 18px 22px; }
.correspondence-route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 10px; margin-bottom: 12px; }
.correspondence-route-grid .button { min-height: 44px; }
.correspondence-load-older { display: block; margin: 10px auto 0; }
.correspondence-list {
  display: grid;
  max-height: min(470px, 54vh);
  gap: 9px;
  overflow-y: auto;
  margin: 0;
  padding: 2px 3px 2px 0;
  list-style: none;
  scroll-behavior: smooth;
}
.correspondence-load-older + .correspondence-list { margin-top: 10px; }
.correspondence-thread { min-width: 0; }
.correspondence-thread-details { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.correspondence-thread-details[open] { border-color: #b9caea; box-shadow: 0 4px 16px rgba(30, 64, 120, .08); }
.correspondence-thread-summary {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  background: #f8f9fb;
}
.correspondence-thread-summary::-webkit-details-marker { display: none; }
.correspondence-thread-summary::marker { content: ''; }
.correspondence-thread-summary::after { flex: none; color: var(--blue); content: 'Показать'; font-size: 9px; font-weight: 700; }
.correspondence-thread-details[open] > .correspondence-thread-summary { border-bottom: 1px solid var(--line); background: var(--blue-soft); }
.correspondence-thread-details[open] > .correspondence-thread-summary::after { content: 'Свернуть'; }
.correspondence-thread-summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.correspondence-thread-copy { display: grid; min-width: 0; gap: 3px; }
.correspondence-thread-subject { overflow-wrap: anywhere; color: #222; font-size: 12px; line-height: 1.3; }
.correspondence-thread-meta { color: var(--muted); font-size: 9px; }
.correspondence-thread-messages {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 12px;
  list-style: none;
  background: #fff;
}
.correspondence-message {
  display: grid;
  width: min(91%, 590px);
  gap: 5px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #333;
  background: #fafafa;
}
.correspondence-message-incoming { justify-self: start; border-top-left-radius: 3px; }
.correspondence-message-outgoing { justify-self: end; border-color: #c7d8fa; border-top-right-radius: 3px; background: var(--blue-soft); }
.correspondence-message-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.correspondence-message-heading strong { font-size: 10px; }
.correspondence-message-heading time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.correspondence-message-subject { overflow-wrap: anywhere; font-size: 11px; font-weight: 650; }
.correspondence-message-addresses { overflow-wrap: anywhere; color: var(--muted); font-size: 9px; }
.correspondence-message-text { overflow-wrap: anywhere; font-size: 12px; line-height: 1.42; white-space: pre-wrap; unicode-bidi: plaintext; user-select: text; }
.correspondence-message-note { color: #855514; font-size: 9px; }
.correspondence-message-attachments { display: grid; gap: 6px; margin-top: 4px; padding-top: 7px; border-top: 1px solid rgba(148, 163, 184, .34); }
.correspondence-message-attachments-title { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .045em; }
.correspondence-attachment-item { gap: 8px; padding: 7px 8px; background: rgba(255, 255, 255, .78); }
.correspondence-attachment-item .attachment-actions { gap: 5px; }
.correspondence-attachment-item .button-small { min-height: 30px; padding: 5px 8px; font-size: 9px; }
.reply-form { display: grid; gap: 11px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.reply-form h3 { margin: 0; font-size: 12px; }
.reply-form textarea { min-height: 112px; }
.invoice-email-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .48); }
.invoice-email-modal {
  position: fixed;
  inset: 3vh 3vw;
  z-index: 90;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .24);
}
.invoice-email-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.invoice-email-header h2 { margin: 2px 0 0; font-size: 18px; }
.invoice-email-header > div > p:last-child { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.invoice-email-body { min-height: 0; overflow-y: auto; padding: 16px 18px 20px; }
.invoice-email-layout { display: grid; min-height: min(690px, calc(94vh - 150px)); grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 16px; margin-top: 12px; }
.invoice-preview-panel { display: grid; min-height: 0; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #f4f4f4; }
.invoice-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border-bottom: 1px solid var(--line); background: #fff; }
.invoice-preview-heading span, .invoice-preview-heading strong { display: block; }
.invoice-preview-heading span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .045em; }
.invoice-preview-heading strong { margin-top: 2px; overflow-wrap: anywhere; font-size: 11px; }
.invoice-email-preview { width: 100%; height: 100%; min-height: 62vh; border: 0; background: #fff; }
.invoice-email-form { display: grid; align-content: start; gap: 11px; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; }
.invoice-email-form textarea { min-height: 154px; resize: vertical; }
.invoice-email-recipient { background: #f0f1f3; font-weight: 650; }
.invoice-email-safety-note { margin: 0; padding: 9px 10px; border-radius: 7px; color: #5b6474; background: #eef3fb; font-size: 10px; line-height: 1.42; }
.invoice-email-form .form-actions { align-items: stretch; flex-direction: column; margin-top: 1px; }
.invoice-email-form .form-actions .form-message { width: 100%; margin: 0; }
.invoice-email-form .button[type="submit"] { width: 100%; }
.attachment-list { display: grid; gap: 8px; }
.attachment-item { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fafafa; }
.attachment-copy { display: grid; min-width: 0; gap: 3px; }
.attachment-name { overflow-wrap: anywhere; font-size: 11px; font-weight: 650; }
.attachment-meta { color: var(--muted); font-size: 9px; }
.attachment-download { text-decoration: none; }
.attachment-actions { display: flex; align-items: center; gap: 7px; }
.attachment-unavailable { color: var(--muted); font-size: 10px; white-space: nowrap; }
.drawer-inline-state { margin: 0; padding: 11px 12px; border-radius: 7px; color: var(--muted); background: #fafafa; font-size: 11px; }
.accept-action { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 14px; padding: 12px; border: 1px solid #c7d8fa; border-radius: 7px; background: var(--blue-soft); }
.accept-action strong, .accept-action span { display: block; }
.accept-action strong { color: #234d9d; font-size: 12px; }
.accept-action span { margin-top: 2px; color: #5470a4; font-size: 10px; }
.request-card-actions .accept-action { flex-direction: column; align-items: stretch; gap: 10px; }
.request-card-actions .opportunity-quick-actions { flex-shrink: 1; }
.request-task-actions { display: flex; align-items: stretch; gap: 8px; max-width: 100%; }
.request-task-actions .button { min-width: 0; white-space: normal; }
#request-review-message:empty { display: none; }
#request-review-form, #request-review-task { margin-bottom: 14px; }
.decision-action { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .9fr); align-items: end; gap: 14px; margin: 0 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #f7f7f7; }
.decision-action strong, .decision-action span { display: block; }
.decision-action strong { font-size: 12px; }
.decision-action span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.decision-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.decision-controls select { min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-span { grid-column: 1 / -1; }
.readonly-value { display: flex; min-height: 36px; align-items: center; padding: 6px 9px; border: 1px solid var(--line); border-radius: var(--radius-control); color: #333; background: #f7f7f7; font-size: 12px; overflow-wrap: anywhere; }
.stage-readonly { font-weight: 650; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 13px; }
.form-actions .form-message { margin-right: auto; }
.inline-form { display: grid; grid-template-columns: minmax(150px, 1fr) 118px 112px 132px auto; gap: 8px; align-items: end; margin-top: 12px; }
.manager-document-list { display: grid; gap: 7px; margin-top: 11px; }
.manager-document-item { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px; border-radius: 7px; background: #f7f7f7; }
.manager-document-item strong, .manager-document-item span { display: block; }
.manager-document-item strong { overflow-wrap: anywhere; font-size: 11px; }
.manager-document-item span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.manager-document-item .attachment-actions { flex-wrap: wrap; justify-content: flex-start; }
.document-upload-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 9px; margin-top: 12px; }
.file-drop-zone {
  display: grid;
  min-height: 88px;
  place-content: center;
  gap: 3px;
  padding: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: #fafafa;
  cursor: pointer;
  text-align: center;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.file-drop-zone:hover { border-color: #858585; background: #f6f6f6; }
.file-drop-zone:focus-within { outline: 2px solid rgba(50, 103, 227, .42); outline-offset: 2px; }
.file-drop-zone.is-dragover { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(50, 103, 227, .10); }
.file-drop-zone.is-selected { border-style: solid; border-color: #9ac9ad; background: #f3faf6; }
.file-drop-zone.is-disabled { opacity: .58; cursor: not-allowed; }
.file-drop-zone-title { font-size: 12px; font-weight: 650; }
.file-drop-zone-help { color: var(--muted); font-size: 10px; }
.file-drop-zone-name { margin-top: 3px; color: #2f6b43; font-size: 10px; font-weight: 600; overflow-wrap: anywhere; }
.file-drop-zone:not(.is-selected) .file-drop-zone-name { color: var(--muted); font-weight: 500; }
.file-drop-zone .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.file-preview-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .42); }
.file-preview-modal { position: fixed; inset: 4vh 4vw; z-index: 90; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 22px 70px rgba(0, 0, 0, .24); }
.file-preview-header, .file-preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.file-preview-header h2 { margin: 2px 0 0; font-size: 16px; }
.file-preview-footer { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; }
.file-preview-body { display: grid; min-height: 0; place-items: center; overflow: auto; padding: 14px; background: #f4f4f4; }
.file-preview-frame { width: 100%; height: 100%; min-height: 62vh; border: 0; border-radius: 7px; background: #fff; }
.file-preview-image { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 3px 16px rgba(0, 0, 0, .12); }
.file-preview-text { width: min(920px, 100%); min-height: 180px; max-height: 100%; overflow: auto; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 7px; color: #222; background: #fff; font: 13px/1.55 var(--font-mono, ui-monospace, SFMono-Regular, Consolas, monospace); white-space: pre-wrap; overflow-wrap: anywhere; }

.loading-layer { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; gap: 10px; color: #555; background: rgba(246, 246, 246, .86); font-size: 12px; backdrop-filter: blur(3px); }
.spinner { width: 18px; height: 18px; border: 2px solid #d1d1d1; border-top-color: var(--ink); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 110; max-width: min(390px, calc(100vw - 44px)); padding: 11px 14px; border-radius: 8px; color: #fff; background: #242424; box-shadow: 0 8px 25px rgba(0, 0, 0, .17); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .16s, transform .16s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: #9e3030; }

.lex-install-button { margin: 8px 0; }
.lex-install-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 24px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: white; box-shadow: 0 16px 60px #102e5930; }
.lex-install-dialog::backdrop { background: #102e5966; }
.lex-install-dialog h2 { margin: 4px 0; }
.lex-install-dialog p, .lex-install-dialog li { line-height: 1.55; }
.lex-install-dialog li { margin-bottom: 8px; }
.lex-install-dialog details { margin-top: 18px; }
.lex-install-dialog code { display: block; overflow-wrap: anywhere; padding-top: 8px; }
.mail-box-button { display: flex !important; gap: 6px; align-items: center; justify-content: space-between; }
.mail-box-name { min-width: 0; }
.mail-unread-count { flex: none; min-width: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.mail-unread-count.is-stale, #nav-mail-unread.is-stale { opacity: .65; text-decoration: underline dotted; }

@media (max-width: 1120px) {
  :root { --sidebar: 228px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-toolbar { flex-wrap: wrap; }
  .search-field { max-width: none; }
  .compact-field { width: min(210px, 31%); }
  .check-field { margin-left: 0; }
  .user-copy { display: none; }
  .invoice-email-layout { grid-template-columns: minmax(0, 1.15fr) minmax(290px, .85fr); }
}

@media (max-width: 820px) {
  :root { --sidebar: 228px; }
  .sidebar { transform: translateX(-102%); box-shadow: 12px 0 30px rgba(0, 0, 0, .1); transition: transform .18s ease; }
  body.menu-open .sidebar { transform: translateX(0); }
  body.menu-open { overflow:hidden; }
  body.menu-open .mobile-menu-backdrop:not([hidden]) { display:block; position:fixed; inset:0; z-index:25; width:100%; height:100%; margin:0; padding:0; border:0; border-radius:0; background:rgba(0,0,0,.2); cursor:pointer; touch-action:manipulation; }
  .workspace { width: 100%; margin-left: 0; }
  .mobile-menu { display: inline-grid; place-items: center; }
  .topbar { padding: 12px 18px; }
  .sync-time { display: none; }
  .content { padding: 20px 18px 40px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-form { grid-template-columns: 1fr 1fr; }
  .inline-form .grow, .inline-form .button { grid-column: 1 / -1; }
  .accept-action { align-items: stretch; flex-direction: column; }
  .decision-action { grid-template-columns: 1fr; }
  .correspondence-route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice-email-modal { inset: 2vh 2vw; }
  .invoice-email-layout { min-height: auto; grid-template-columns: 1fr; }
  .invoice-preview-panel { min-height: 58vh; }
}

@media (max-width: 620px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topbar-title { max-width: calc(100% - 54px); }
  .topbar-actions { width: 100%; flex-wrap: wrap; padding-left: 46px; }
  .topbar-actions .button { flex: 1; }
  .content { padding: 16px 12px 34px; }
  .filter-toolbar { align-items: stretch; gap: 9px; }
  .search-field, .compact-field { width: 100%; max-width: none; }
  .kpi-grid { grid-template-columns: 1fr; gap: 9px; }
  .kpi-card { min-height: 105px; }
  .dashboard-grid { gap: 10px; }
  .panel { min-height: auto; padding: 14px; }
  .funnel-row { grid-template-columns: 90px minmax(100px, 1fr); }
  .funnel-amount { display: none; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading .segmented { width: 100%; }
  .section-heading .segmented button { flex: 1; }
  .review-grid, .manager-grid, .settings-column { grid-template-columns: 1fr; }
  .drawer { width: 100vw; }
  .drawer-header { padding: 16px; }
  .drawer-body { padding: 17px 16px 30px; }
  .request-card-actions .button { min-height: 44px; }
  .fact-grid, .form-grid { grid-template-columns: 1fr; }
  .fact.wide, .form-span { grid-column: auto; }
  .request-message-text { max-height: 44vh; padding: 11px; font-size: 13px; }
  .request-content-status { align-items: stretch; flex-direction: column; }
  .request-content-status .button { width: 100%; min-height: 44px; }
  .correspondence-launch { align-items: stretch; flex-direction: column; gap: 10px; }
  .correspondence-launch .button { width: 100%; min-height: 44px; }
  .correspondence-modal { inset: 0; width: 100%; border: 0; border-radius: 0; transform: none; }
  .correspondence-modal-header { padding: 14px 16px; }
  .correspondence-modal-body { padding: 15px 16px 24px; }
  .correspondence-route-grid { grid-template-columns: 1fr; }
  .correspondence-route-grid .button { min-height: 44px; }
  .correspondence-thread-summary { align-items: flex-start; padding: 11px; }
  .correspondence-thread-summary::after { padding-top: 2px; }
  .correspondence-thread-messages { padding: 9px; }
  .correspondence-message { width: 96%; }
  .correspondence-message-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .reply-form .form-actions { align-items: stretch; flex-direction: column; }
  .reply-form .form-actions .button { width: 100%; min-height: 44px; }
  .invoice-email-modal { inset: 0; border: 0; border-radius: 0; }
  .invoice-email-header { padding: 14px 16px; }
  .invoice-email-body { padding: 14px 12px 22px; }
  .invoice-preview-heading { align-items: stretch; flex-direction: column; }
  .invoice-preview-heading .button { width: 100%; min-height: 44px; }
  .invoice-preview-panel { min-height: 54vh; }
  .invoice-email-preview { min-height: 54vh; }
  .invoice-email-form .button[type="submit"] { min-height: 44px; }
  .attachment-item { grid-template-columns: 1fr; }
  .attachment-download { width: 100%; min-height: 44px; }
  .attachment-actions { align-items: stretch; flex-direction: column; }
  .attachment-actions .button { width: 100%; min-height: 44px; }
  .inline-form { grid-template-columns: 1fr 1fr; }
  .inline-form .grow, .inline-form .button { grid-column: 1 / -1; }
  .auth-screen .auth-card { padding: 22px; }
  .auth-brand { margin-bottom: 27px; }
  .password-reset-form { grid-template-columns: 1fr; }
  .user-menu { width: 100%; margin-left: 0; padding: 8px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .user-copy { display: flex; max-width: none; flex: 1; }
  .user-menu .button { flex: none; }
  .decision-controls, .document-upload-form, .manager-document-item { grid-template-columns: 1fr; }
  .file-preview-modal { inset: 0; border: 0; border-radius: 0; }
  .file-preview-footer .button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.document-version-history { margin-top: 12px; padding: 12px; border: 1px solid var(--border, #ddd); border-radius: 8px; }
.document-version-history > summary { cursor: pointer; color: var(--muted, #666); }
.document-version-history .manager-document-item { margin-top: 10px; }
/* Mail reader: mailbox folders, message list, and a read-only Outlook pane. */
.mail-toolbar { display: flex; gap: 16px; align-items: end; padding: 16px; flex-wrap: wrap; }
.mail-toolbar > .field { min-width: 240px; flex: 1; }
.mail-search { display: flex; align-items: end; gap: 10px; flex: 2; min-width: 260px; }
.mail-search .field { flex: 1; }
.mail-layout { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(300px, 1.4fr); overflow: hidden; min-height: 530px; }
.mail-folders { padding: 12px 8px; border-right: 1px solid #e5e7eb; background: #fafafa; }
.mail-folder { width: 100%; display: flex; justify-content: space-between; gap: 6px; border: 0; border-radius: 7px; background: transparent; padding: 11px 9px; text-align: left; color: inherit; cursor: pointer; overflow-wrap: anywhere; }
.mail-folder[aria-current="true"] { background: #e9ecef; font-weight: 650; }
.mail-folder:hover, .mail-row:hover { background: #f1f4f6; }
.mail-unread-count { font-weight: 700; }
.mail-message-list { border-right: 1px solid #e5e7eb; min-width: 0; }
.mail-message-list > h2 { padding: 16px; font-size: 16px; margin: 0; border-bottom: 1px solid #e5e7eb; }
.mail-selection-toolbar { display: flex; align-items: center; gap: 9px 12px; flex-wrap: wrap; padding: 12px; border-bottom: 1px solid #e5e7eb; background: #f6f9fc; }
.mail-select-all { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.mail-selection-toolbar .muted-note { margin: 0; font-size: 12px; }
.mail-selection-toolbar .button { margin-left: auto; }
.mail-selectable-row { display: flex; align-items: stretch; border-bottom: 1px solid #e5e7eb; }
.mail-selectable-row .mail-row { flex: 1; min-width: 0; border-bottom: 0; }
.mail-row-select { display: flex; align-items: center; justify-content: center; padding: 10px; cursor: pointer; }
.mail-row-select input, .mail-select-all input { width: 17px; height: 17px; margin: 0; accent-color: #0763c9; cursor: pointer; }
.mail-row-select:has(input:checked) { background: #eaf1f6; }
.mail-selection-confirm { margin-bottom: 18px; }
.mail-selection-subjects { margin-bottom: 14px; }
.mail-selection-subjects summary { cursor: pointer; }
.mail-selection-subjects ul { max-height: 160px; overflow-y: auto; padding-left: 22px; }
.mail-row { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 15px; background: transparent; border: 0; border-bottom: 1px solid #e5e7eb; text-align: left; color: inherit; cursor: pointer; }
.mail-row > strong, .mail-row-top { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.mail-row strong { font-weight: 450; }
.mail-row.is-unread strong { font-weight: 750; }
.mail-row.is-selected { background: #eaf1f6; box-shadow: inset 3px 0 #334155; }
.mail-row-meta { font-size: 12px; color: #667085; }
.mail-pagination { padding: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.mail-pagination #mail-page { flex-basis: 100%; order: -1; text-align: center; }
.mail-pagination .button { flex: 1 1 100px; white-space: normal; }
.mail-reader { min-width: 0; padding: 22px; overflow-wrap: anywhere; }
.mail-reader > h2 { font-size: 21px; line-height: 1.4; margin: 0 0 20px; }
.mail-body { white-space: pre-wrap; line-height: 1.6; font-size: 14px; margin-top: 24px; }
.mail-files { display: grid; gap: 10px; margin-top: 18px; }
.mail-file { padding: 12px; border: 1px solid #e5e7eb; border-radius: 8px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.mail-file > strong { font-size: 13px; overflow-wrap: anywhere; }
@media (min-width: 1151px) { #mail-list, .mail-reader, .mail-folders { max-height: 72vh; overflow-y: auto; } }
@media (max-width: 1150px) { .mail-layout { grid-template-columns: 1fr; } .mail-reader { border-top: 1px solid #e5e7eb; } #mail-list { max-height: 420px; overflow-y: auto; } }
.mail-navigation { margin: 0 0 8px 20px; min-width: 0; }
.mail-box-button { display: block; width: 100%; padding: 9px 8px; background: none; border: 0; text-align: left; font: inherit; font-size: 12px; overflow-wrap: anywhere; cursor: pointer; border-radius: 6px; }
.mail-box-button:hover { color: #fff; background: #1b3f6c; }
.mail-box-button[aria-current="true"] { color: #fff; font-weight: 650; background: #254c7a; }
.mail-navigation .mail-folders { border: 0; padding: 4px 0 8px 9px; background: transparent; display: block; }
.mail-navigation .mail-folder { min-width: 0; padding: 8px; font-size: 12px; }
.mail-navigation .mail-folder:hover { color: #fff; background: #1b3f6c; }
.mail-navigation .mail-folder[aria-current="true"] { color: #fff; background: #254c7a; box-shadow: inset 2px 0 #56d7ed; }
.mail-reply-form { display: grid; gap: 12px; margin-top: 24px; padding-top: 22px; border-top: 1px solid #dce1e8; }
.mail-reply-form textarea { resize: vertical; min-height: 125px; }
.mail-drop-zone { display: grid; gap: 12px; padding: 18px; border: 1px dashed #aab4c2; border-radius: 10px; background: #f7f9fb; }
.mail-drop-zone.is-dragover { background: #eaf2fc; border-color: #2860ab; }
.mail-reply-history { margin-top: 22px; padding: 16px; border: 1px solid #dce1e8; border-radius: 10px; }
.account-requisites { margin: 18px 0; padding: 14px; border: 1px solid #dce1e8; border-radius: 8px; }
.account-requisites summary { cursor: pointer; font-size: 12px; overflow-wrap: anywhere; }
.tender-navigation { padding-left: 24px; }
.tender-navigation .nav-item { display: block; font-size: 11px; min-height: 30px; }
.tender-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(330px,1fr)); gap: 16px; }
.tender-card { padding: 20px; min-width: 0; }
.tender-card h2 { font-size: 17px; overflow-wrap: anywhere; }
.tender-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.tender-report { font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.tender-report summary { cursor: pointer; }
.tender-report .source-message-text { white-space: pre-wrap; margin-top: 12px; }
.tender-decision-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 16px 0; }
.tender-decision-form .field { flex: 1 1 220px; min-width: 0; }
.tender-decision-form select { width: 100%; max-width: 100%; }
.tender-decision-form .form-message { flex-basis: 100%; margin: 0; }
.tender-task-fields { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 10px; }
.tender-task-fields .muted-note { flex-basis: 100%; margin: 0; }
@media(max-width:600px) { .tender-list { grid-template-columns: minmax(0,1fr); } }
.account-requisites .drawer-facts { margin-top: 15px; }
@media (max-width: 600px) { .mail-layout { display: block; } .mail-folders { display: flex; gap: 6px; overflow-x: auto; } .mail-folder { min-width: 150px; } .mail-reader { padding: 15px; } .mail-toolbar > .field, .mail-search { min-width: 100%; } }
/* Operational attention: color is always accompanied by an explicit text label. */
.urgency-new_overdue { background: #fff6cd !important; }
.urgency-quote_warning { background: #ffead4 !important; }
.urgency-quote_critical { background: #ffe1e3 !important; }
.clickable-table tr.urgency-new_overdue td:first-child { border-left: 4px solid #ad8300; }
.clickable-table tr.urgency-quote_warning td:first-child { border-left: 4px solid #c86c1d; }
.clickable-table tr.urgency-quote_critical td:first-child { border-left: 4px solid #bf3c50; }
.urgency-label { display:block; margin-top:6px; font-size:11px; color:#5b3434; font-weight:600; }
.urgency-legend { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; font-size:11px; color:#5d6169; }
.urgency-key { border-radius:6px; padding:5px 8px; color:#4b4141; }
.tasks-layout { display:grid; grid-template-columns:minmax(340px, .95fr) minmax(340px, 1.15fr); gap:20px; align-items:start; }
#task-create-form { display:grid; gap:12px; margin-bottom:20px; }
#task-detail { position:sticky; top:20px; }
.task-list-item { display:grid; width:100%; text-align:left; padding:16px; gap:7px; margin-bottom:10px; cursor:pointer; color:inherit; }
.task-list-item.is-selected { outline:2px solid #9da9be; }
.task-list-item span, .task-list-item small { font-size:12px; color:#686e77; }
.task-overdue { border-left:4px solid #bf3c50; }
.task-description { white-space:pre-wrap; overflow-wrap:anywhere; font-size:13px; line-height:1.6; }
.task-request-dialog { box-sizing:border-box; width:min(820px,calc(100vw - 28px)); max-height:calc(100dvh - 32px); padding:0; overflow:auto; border:1px solid var(--line); border-radius:18px; color:var(--ink); background:#fff; box-shadow:0 24px 80px #153a5a40; }
.task-request-dialog::backdrop { background:#17283b85; }
.task-request-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:18px 20px; border-bottom:1px solid var(--line); background:#f0f6ff; }
.task-request-header h2, .task-request-header p { margin:0; }
.task-request-header h2 { margin-top:5px; font-size:20px; }
.task-request-body { padding:18px 20px 24px; overflow-wrap:anywhere; }
.task-request-body .task-description { padding:16px; border:1px solid var(--line); border-radius:10px; background:#f8fbff; }
.task-actions { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0; }
.task-comment { border-top:1px solid #e7e8eb; padding:12px 0; }
.task-comment time { display:block; margin-top:5px; }
.task-comment-form { display:grid; gap:10px; margin-top:14px; }
.notifications-panel { padding:20px; margin-bottom:20px; max-height:65vh; overflow:auto; }
.notification-item { display:grid; width:100%; text-align:left; padding:12px; gap:6px; background:white; border:0; border-bottom:1px solid #e4e6e9; cursor:pointer; color:inherit; }
.notification-item.is-unread { background:#eef3f9; border-left:3px solid #476784; }
.notification-item span { font-size:12px; }
.list-pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:15px; }
@media(max-width:900px) { .tasks-layout { grid-template-columns:1fr; } #task-detail { position:static; } }
/* Immutable task files are shared only with the task's participants. */
.task-file-drop { border: 1px dashed #c6cbd3; border-radius: 12px; padding: 14px; margin: 12px 0; }
.task-file-drop.is-dragging { border-color: #157e56; background: #edf8f2; }
.task-file-item { display: flex; flex-direction: column; gap: 5px; padding: 10px 0; border-bottom: 1px solid #edf0f2; overflow-wrap: anywhere; }
.task-attachments { margin: 18px 0; }
/* Only safe, recreated email nodes use these rules; sender CSS is never used. */
.email-content, .mail-body.email-content, .correspondence-message-text.email-content { min-width: 0; max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.email-content .email-plain-text, .email-content pre { white-space: pre-wrap; font: inherit; margin: 0; }
.email-content p { margin: .3em 0; }
.email-content h1, .email-content h2, .email-content h3, .email-content h4 { font-size: 1em; margin: .6em 0 .25em; }
.email-content blockquote { margin: .5em 0; padding-left: .8em; border-left: 2px solid #d8dce2; }
.email-content .email-table-scroll { max-width: 100%; overflow-x: auto; margin: .65em 0; overscroll-behavior-x: contain; }
.email-content table { width: max-content; min-width: min(100%, 280px); max-width: none; border-collapse: collapse; font: inherit; color: inherit; }
.email-content td, .email-content th { border: 1px solid #cdd2d8; padding: 7px 10px; min-width: 70px; max-width: 420px; vertical-align: top; text-align: left; white-space: normal; font-size: inherit; color: inherit; letter-spacing: normal; text-transform: none; }
.email-content tbody tr:last-child td { border-bottom: 1px solid #cdd2d8; }
.email-content th, .email-content thead td { font-weight: 600; background: #f3f4f6; }
.email-content td p, .email-content th p { margin: 0; }
.email-content caption { text-align: left; font-weight: 600; padding: 5px 0; }

/* Termolex identity: blue/cyan accents; warning colors keep their own semantics. */
.kpi-card { border-top: 3px solid var(--accent); }
.kpi-card:nth-child(2) { border-top-color: var(--teal); }
.kpi-card:nth-child(2) .kpi-icon { color: var(--teal); background: var(--teal-soft); }
.kpi-card:nth-child(3) { border-top-color: var(--violet); }
.kpi-card:nth-child(3) .kpi-icon { color: var(--violet); background: var(--violet-soft); }
.kpi-card:nth-child(4) { border-top-color: var(--green); }
.kpi-card:nth-child(4) .kpi-icon { color: var(--green); background: var(--green-soft); }
.kpi-card:nth-child(5) { border-top-color: var(--cyan); }
.kpi-card:nth-child(5) .kpi-icon { color: #086e86; background: #e5f8fc; }
.kpi-card:nth-child(6) { border-top-color: var(--amber); }
.kpi-card:nth-child(6) .kpi-icon { color: var(--amber); background: var(--amber-soft); }
.eyebrow { color: #466482; }
.section-label { color: #244e7a; }
.filter-toolbar, .mail-toolbar { border-top: 2px solid #a5c8f3; }
.avatar { background: #1966af; }
.mini-metric, .stage-list li { background: var(--surface-muted); }
.stage-list li::before { background: var(--accent); }
.active-toggle input { accent-color: var(--accent); }
.kanban-column { background: #e8eff8; }
.kanban-heading span { color: #385b87; background: #d5e4f6; }
.deal-card:hover { border-color: #7faee7; }
.correspondence-modal-header, .invoice-email-header, .file-preview-header { background: #f0f6ff; }
.correspondence-thread-summary { background: #f5f9fe; }
.file-drop-zone:hover { border-color: #83ace1; background: var(--blue-soft); }
.mail-row.is-selected { background: #e8f2ff; box-shadow: inset 3px 0 var(--accent); }
.mail-row:hover { background: #f0f7ff; }
.notification-item.is-unread { background: var(--blue-soft); border-left-color: var(--accent); }
.task-list-item.is-selected { outline-color: var(--accent); background: #f5f9ff; }
.toast:not(.is-error) { background: #153e73; }
.spinner { border-color: #cbdcf1; border-top-color: var(--accent); }
.loading-layer { background: rgba(238, 244, 251, .9); }
#ship-opportunity { background: var(--teal); }
#ship-opportunity:hover:not(:disabled) { background: #05646b; }
:root .score-detail { display:block; white-space:pre-line; font-size:12px; color:var(--text-muted,#586576); margin-top:6px; line-height:1.5; }
.score-table { min-width:860px; }
.score-direction + .score-direction { margin-top:28px; }
.score-direction > h3 { margin:16px 0 12px; }
.dashboard-grid > #manager-score { grid-column:1 / -1; }
.dashboard-grid > #workbook-analytics { grid-column:1 / -1; }
.workbook-analytics-section { min-width:0; margin-top:20px; }
.workbook-analytics-section h3 { margin:0 0 10px; font-size:16px; }
.workbook-analytics-section table { width:100%; }
.workbook-analytics-section th[scope="row"] { text-align:left; font-weight:600; text-transform:none; letter-spacing:normal; font-size:14px; }
.workbook-analytics-section td { font-variant-numeric:tabular-nums; }
.workbook-analytics-section td .text-button { min-width:44px; min-height:44px; text-align:left; }
.workbook-analytics-section tfoot { background:#f0f6ff; font-weight:600; }
.workbook-analytics-coverage { display:block; color:var(--muted); margin-top:4px; font-weight:400; }
.workbook-analytics-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.workbook-analytics-detail { margin-top:14px; padding:14px; border:1px solid #dce5ef; border-radius:8px; }
.workbook-analytics-detail h4 { margin:0 0 10px; }
.workbook-analytics-detail .text-button { white-space:normal; text-align:left; overflow-wrap:anywhere; }
@media (max-width:1100px) { .workbook-analytics-grid { grid-template-columns:minmax(0,1fr); gap:0; } }
@media (max-width:600px) {
  .workbook-analytics-section table { table-layout:fixed; }
  .workbook-analytics-section th, .workbook-analytics-section td { padding:10px 6px; white-space:normal; overflow-wrap:anywhere; }
  .workbook-analytics-section th { font-size:9px; }
  .workbook-analytics-section th[scope="row"], .workbook-analytics-section td { font-size:12px; }
  .workbook-analytics-section th:first-child { width:35%; }
  .workbook-analytics-section th:nth-child(2) { width:17%; }
  .workbook-analytics-section[data-dimension="schedule"] th:first-child { width:34%; }
  .workbook-analytics-section[data-dimension="schedule"] th:nth-child(3) { width:17%; }
}
.score-table tbody th { text-transform:none; font-size:14px; background:transparent; }
.score-table th, .score-table td { vertical-align:top; white-space:normal; max-width:220px; }
.score-methods, .score-manager-detail { border-top:1px solid #dce5ef; margin-top:16px; padding-top:14px; }
.score-methods summary, .score-manager-detail summary, .crm-guide summary { cursor:pointer; font-weight:600; padding:6px 0; }
.score-methods li { line-height:1.6; margin:10px 0; }
.score-plan-form { display:flex; flex-wrap:wrap; gap:12px; align-items:end; padding:16px 0; }
.score-plan-form input { max-width:230px; }
.score-record { padding:10px 0; border-top:1px solid #eef1f5; }
.score-record p { margin:4px 0; }
.score-record button { text-align:left; white-space:normal; }
.crm-guide { max-width:1000px; line-height:1.65; }
.crm-guide details { border-top:1px solid #dce5ef; padding:14px 0; }
.crm-guide li { margin:10px 0; }
.guide-quick { border-left:4px solid #137bd1; background:#edf6ff; padding:15px; border-radius:6px; margin:20px 0; }
.request-print-sheet { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body.printing-request { height: auto !important; overflow: visible !important; background: white !important; color: black !important; }
  body.printing-request > :not(#request-print-sheet) { display: none !important; }
  body.printing-request #request-print-sheet { display: block !important; font: 11pt/1.4 Arial, sans-serif; color: black; }
  #request-print-sheet h1 { font-size: 18pt; margin: 8pt 0; }
  #request-print-sheet h2 { font-size: 13pt; margin: 12pt 0 6pt; }
  #request-print-sheet h1, #request-print-sheet h2 { break-after: avoid; }
  #request-print-sheet .print-brand { font-size: 10pt; color: #444; }
  #request-print-sheet .fact-grid { display: block; }
  #request-print-sheet .fact { display: grid; grid-template-columns: 42mm 1fr; gap: 8pt; padding: 4pt 0; background: none; border-radius: 0; break-inside: avoid; }
  #request-print-sheet dt, #request-print-sheet dd { margin: 0; overflow-wrap: anywhere; font-size: 10pt; color: black; }
  #request-print-sheet dt { font-weight: bold; text-transform: none; letter-spacing: normal; }
  #request-print-sheet .email-content, #request-print-sheet .email-table-scroll { max-height: none !important; overflow: visible !important; }
  #request-print-sheet .email-plain-text { white-space: pre-wrap; overflow-wrap: anywhere; }
  #request-print-sheet table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 9pt; }
  #request-print-sheet td, #request-print-sheet th { border: 1px solid #888; padding: 4pt; overflow-wrap: anywhere; }
  #request-print-sheet tr { break-inside: avoid; }
  #request-print-sheet .print-note { font-size: 9pt; color: #555; }
  #request-print-sheet a { color: black; text-decoration: none; }
}
.mobile-install-dialog { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid #c8d9f0; border-radius: 20px; color: #16345a; box-shadow: 0 20px 70px #102e5940; overflow: auto; }
.mobile-install-dialog::backdrop { background: #091c38aa; }
.mobile-install-dialog h3 { margin: 24px 0 8px; font-size: 18px; }
.mobile-install-dialog p { line-height: 1.6; }
.mobile-install-brand { display: flex; align-items: center; gap: 14px; }
.mobile-install-brand img { border-radius: 14px; flex: 0 0 auto; }
.mobile-install-brand h2 { font-size: 23px; }
.mobile-install-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mobile-install-actions .button { white-space: normal; }
.mobile-install-button { flex-shrink: 0; }
.mobile-install-dialog [hidden] { display: none !important; }
@media (max-width: 480px) { .mobile-install-dialog { padding: 18px; } .mobile-install-brand { gap: 8px; } .mobile-install-brand h2 { font-size: 20px; } .mobile-install-actions .button { width: 100%; } }
/* Waiting quotes remain readable; month headings separate archive groups. */
.quote-archive-nav { padding-left: 24px; font-size: .88rem; }
.quote-archive-month th { padding: 14px 18px; background: #e7effb; color: #244d82; text-align: left; text-transform: capitalize; border-bottom: 1px solid #cbdcf1; }
