:root {
  color-scheme: light;
  --canvas: #f4f7f8;
  --surface: #fff;
  --ink: #18272c;
  --muted: #5f6e73;
  --subtle: #758287;
  --line: #dfe6e8;
  --line-strong: #cad5d8;
  --accent: #0f766e;
  --accent-dark: #0b625b;
  --accent-soft: #e8f4f2;
  --amber: #84500c;
  --amber-soft: #fff4da;
  --blue: #315d87;
  --blue-soft: #eaf2fb;
  --red: #a53832;
  --red-soft: #fff0ed;
  --radius: 8px;
  --shadow: 0 18px 55px rgba(19, 39, 43, .18);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); overflow-x: clip; }
body { margin: 0; min-height: 100vh; overflow-x: clip; background: var(--canvas); color: var(--ink); font-size: 14px; line-height: 1.5; }
body.drawer-open { overflow: hidden; }
body, button, input, textarea, select { font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-size: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgba(15, 118, 110, .34); outline-offset: 2px; }
button { color: inherit; }
.app-shell { width: 100%; min-height: 100vh; overflow-x: clip; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 216px; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; padding: 17px 12px 12px; border-right: 1px solid var(--line); background: #fff; }
.brand { display: inline-flex; align-items: center; gap: 9px; padding: 0 8px; color: var(--ink); font-size: 20px; font-weight: 760; letter-spacing: -.7px; }
.brand-mark { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 8px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; }
.workspace-label { display: flex; align-items: center; gap: 10px; margin: 23px 3px 20px; padding: 11px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfc; }
.workspace-mark { display: grid; width: 30px; height: 30px; flex: none; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.workspace-label strong, .workspace-label small { display: block; }
.workspace-label strong { font-size: 12px; font-weight: 650; }
.workspace-label small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.sidebar-nav, .sidebar-tags, .sidebar-bottom { display: grid; gap: 3px; }
.sidebar-fold { flex: none; min-width: 0; }
.funnel-fold { margin-top: 12px; }
.sidebar-fold-summary { display: flex; min-height: 34px; align-items: center; justify-content: space-between; gap: 8px; margin: 0 3px 4px; padding: 0 7px; border-radius: 5px; color: #68777c; cursor: pointer; font-size: 10px; font-weight: 700; letter-spacing: .8px; list-style: none; user-select: none; }
.sidebar-fold-summary::-webkit-details-marker, .sidebar-more-tags summary::-webkit-details-marker { display: none; }
.sidebar-fold-summary:hover { background: #f5f8f8; color: #425158; }
.fold-chevron { width: 7px; height: 7px; flex: none; transform: rotate(45deg); border-right: 1.5px solid #718084; border-bottom: 1.5px solid #718084; transition: transform .14s; }
.sidebar-fold[open] > .sidebar-fold-summary .fold-chevron { transform: rotate(225deg); }
.sidebar-statuses { display: grid; gap: 1px; }
.status-nav-item { min-height: 30px; gap: 8px; padding-inline: 9px 5px; font-size: 11px; }
.status-nav-item .nav-count { min-width: 20px; padding-inline: 5px; font-size: 10px; line-height: 17px; }
.nav-item { display: flex; min-height: 38px; align-items: center; gap: 10px; padding: 0 9px; border-radius: 6px; color: #425158; font-size: 13px; transition: background .14s, color .14s; }
.nav-item:hover, .tag-nav:hover { background: #f3f7f7; color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: #0c5f58; font-weight: 650; }
.nav-symbol { display: grid; width: 17px; flex: none; place-items: center; color: #66777b; font-size: 17px; }
.nav-symbol-small { font-size: 15px; }
.nav-count { min-width: 22px; margin-left: auto; padding: 1px 6px; border-radius: 10px; background: #edf1f2; color: #4d5c61; font-size: 11px; line-height: 18px; text-align: center; }
.nav-item.active .nav-count { background: #d4eae6; color: #155f58; }
.status-mark, .channel-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #bd8b32; }
.status-mark.status-progress { background: #5484a7; }
.status-mark.status-closed { background: #7c898c; }
.status-mark.status-qualified, .status-mark.status-proposal_sent, .status-mark.status-negotiation, .status-mark.status-in_progress { background: #5484a7; }
.status-mark.status-briefing, .status-mark.status-waiting { background: #bd8b32; }
.status-mark.status-lost { background: #a53832; }
.tags-fold { margin-top: 12px; }
.sidebar-tags { gap: 3px; }
.sidebar-more-tags { margin: 5px 7px 0; }
.sidebar-more-tags summary { min-height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--accent-dark); cursor: pointer; font-size: 11px; list-style: none; }
.sidebar-more-tags summary::after { width: 6px; height: 6px; transform: rotate(45deg); border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; content: ""; }
.sidebar-more-tags[open] summary::after { transform: rotate(225deg); }
.more-tags-expanded { display: none; }
.sidebar-more-tags[open] .more-tags-collapsed { display: none; }
.sidebar-more-tags[open] .more-tags-expanded { display: inline; }
.sidebar-tags-overflow { margin-top: 2px; }
.tag-nav { display: flex; min-height: 33px; align-items: center; gap: 8px; padding: 0 9px; border-radius: 6px; color: #45545a; font-size: 12px; }
.tag-nav.active { background: var(--accent-soft); color: #0c5f58; font-weight: 650; }
.tag-nav small { margin-left: auto; color: var(--muted); font-size: 11px; }
.sidebar-empty { margin: 4px 9px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.sidebar-bottom { gap: 3px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.channel-dot { width: 7px; height: 7px; margin-left: auto; background: #9aa6a8; }
.channel-dot.configured { background: #bf913d; }
.sidebar-profile { display: flex; min-height: 49px; align-items: center; gap: 9px; margin-top: 10px; padding: 8px 5px 0; border-top: 1px solid var(--line); }
.profile-avatar { display: grid; width: 31px; height: 31px; flex: none; place-items: center; border-radius: 50%; background: #e8f0ef; color: #286b65; font-weight: 700; }
.profile-copy { min-width: 0; }
.profile-copy strong, .profile-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 12px; font-weight: 650; }
.profile-copy small { color: var(--muted); font-size: 10px; }
.sidebar-profile form { margin-left: auto; }
.logout-button { width: 29px; height: 29px; border: 0; border-radius: 6px; background: transparent; color: #67767b; cursor: pointer; }
.logout-button:hover { background: #f0f4f4; color: var(--ink); }
.app-main { min-width: 0; min-height: 100vh; margin-left: 216px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; height: 56px; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(8px); }
.topbar-label { display: flex; align-items: center; gap: 9px; color: #435258; font-size: 12px; font-weight: 600; }
.topbar-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.topbar-separator { color: #a0abad; font-weight: 400; }
.topbar-demo { margin-left: auto; }
.nav-toggle { display: none; align-items: center; gap: 7px; border: 0; background: none; color: #45545a; cursor: pointer; font-size: 12px; }
.page-shell { width: 100%; min-width: 0; max-width: none; margin: 0; padding: 16px 22px 38px; }
.page-heading, .inbox-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.page-heading h1, .inbox-heading h1, .form-page h1 { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -.5px; line-height: 1.25; }
.eyebrow { margin: 0 0 4px; color: #64747a; font-size: 10px; font-weight: 700; letter-spacing: .75px; }
.page-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid transparent; border-radius: 7px; font-weight: 650; cursor: pointer; transition: background .14s, border-color .14s, color .14s; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { border-color: var(--line-strong); background: #fff; color: #34444a; }
.button-secondary:hover { border-color: #9aabad; background: #f8fafa; }
.button-quiet { border-color: transparent; background: transparent; color: #4d5d62; }
.button-quiet:hover { background: #f0f4f4; }
.button-small { min-height: 33px; padding: 0 10px; font-size: 12px; }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) 210px 210px; gap: 9px; align-items: end; margin-bottom: 8px; padding: 9px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.search-control { display: flex; height: 38px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.search-control:focus-within { border-color: #75aaa4; box-shadow: 0 0 0 3px rgba(15,118,110,.08); }
.search-symbol { color: #5e6d72; font-size: 19px; line-height: 1; }
.search-control input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-control input:focus-visible { outline: 0; }
.filter-control { display: grid; gap: 2px; color: #526166; font-size: 10px; font-weight: 600; }
.filter-control select { width: 100%; height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #35454a; font-size: 12px; }
.inbox-content { min-width: 0; }
.results-bar { display: flex; min-height: 40px; align-items: center; justify-content: space-between; gap: 12px; }
.results-bar > p { margin: 0; color: #55646a; font-size: 12px; }
.results-bar > p strong { color: var(--ink); font-size: 13px; font-weight: 700; }
.results-bar > p span { color: #66757a; font-size: 11px; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-chip, .clear-filters { display: inline-flex; min-height: 27px; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: #45565b; font-size: 11px; }
.filter-chip:hover { border-color: #a3bab8; background: #f5faf9; color: var(--accent-dark); }
.filter-chip span { color: #68777b; font-size: 14px; }
.clear-filters { border-color: transparent; background: transparent; color: var(--accent); }
.clear-filters:hover { text-decoration: underline; text-underline-offset: 2px; }
.table-frame { overflow: visible; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.leads-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.leads-table th { position: sticky; top: 56px; z-index: 2; height: 39px; padding: 0 12px; border-bottom: 1px solid var(--line); background: #f8fafb; color: #59686d; font-size: 11px; font-weight: 650; text-align: left; }
.leads-table th:first-child { border-top-left-radius: 7px; }
.leads-table th:last-child { border-top-right-radius: 7px; }
.leads-table td { height: 66px; padding: 9px 12px; border-bottom: 1px solid #e9edef; vertical-align: middle; }
.leads-table tbody tr:last-child td { border-bottom: 0; }
.leads-table tbody tr { transition: background .12s; }
.leads-table tbody tr:hover { background: #f7faf9; }
.leads-table tbody tr.selected { background: #edf6f4; }
.col-client { width: 20%; }
.col-request { width: 31%; }
.col-tags { width: 17%; }
.col-source { width: 13%; }
.col-status { width: 11%; }
.col-created { width: 8%; }
.client-link { display: flex; min-width: 0; flex-direction: column; gap: 1px; border-radius: 3px; }
.client-link:hover strong { color: var(--accent-dark); }
.client-link strong { overflow: hidden; color: #1e3035; font-size: 13px; font-weight: 680; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.client-link small { overflow: hidden; color: #526268; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.client-link > span { color: #68767b; font-size: 10px; line-height: 1.3; }
.request-cell { color: #3d4d52; font-size: 12px; line-height: 1.45; }
.request-cell > span { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.row-tags, .detail-tags, .mobile-card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.tag-chip, .detail-tag { display: inline-flex; max-width: 100%; min-height: 23px; align-items: center; padding: 2px 7px; border-radius: 5px; background: #edf5f3; color: #235e58; font-size: 11px; line-height: 1.3; overflow-wrap: anywhere; }
.tag-color-0 { background: #fff1d9 !important; color: #76500b !important; }
.tag-color-1 { background: #e3f1fb !important; color: #245d80 !important; }
.tag-color-2 { background: #f1e9fb !important; color: #674493 !important; }
.tag-color-3 { background: #e4f4e8 !important; color: #2c6940 !important; }
.tag-color-4 { background: #ffe9e3 !important; color: #8b4936 !important; }
.tag-color-5 { background: #def4f2 !important; color: #17645e !important; }
.tag-color-6 { background: #e9edf2 !important; color: #495c72 !important; }
.tag-color-7 { background: #f2f2d9 !important; color: #5e611e !important; }
.tag-nav[class*="tag-color-"]::before { width: 7px; height: 7px; flex: none; border-radius: 50%; background: currentColor; content: ""; }
.tag-chip:hover, .quick-tags button:hover { filter: saturate(1.25) brightness(.96); }
a.tag-chip { border: 1px solid transparent; }
a.tag-chip:hover { border-color: #b8d8d2; background: #e4f2ef; text-decoration: none; }
.tag-more { position: relative; }
.tag-more summary { display: grid; min-width: 27px; min-height: 24px; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: #4b5b60; cursor: pointer; font-size: 10px; list-style: none; }
.tag-more summary::-webkit-details-marker { display: none; }
.tag-popover { position: absolute; top: 27px; right: 0; z-index: 8; display: flex; width: max-content; max-width: 220px; flex-wrap: wrap; gap: 5px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 8px 24px rgba(20,43,47,.14); }
.source-badge { display: inline-flex; align-items: center; gap: 6px; color: #4e5e63; font-size: 11px; line-height: 1.35; }
.source-badge i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #7f8b8e; }
.source-bot i { background: #5586a8; }
.source-telegram i { background: #438c79; }
.status-badge { display: inline-flex; min-height: 23px; align-items: center; gap: 6px; padding: 2px 7px; border-radius: 5px; background: var(--amber-soft); color: var(--amber); font-size: 11px; font-weight: 620; white-space: nowrap; }
.status-badge i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.status-in_progress { background: var(--blue-soft); color: var(--blue); }
.status-closed { background: #edf0f1; color: #4f5d62; }
.status-qualified, .status-proposal_sent, .status-negotiation { background: var(--blue-soft); color: var(--blue); }
.status-briefing, .status-waiting { background: var(--amber-soft); color: var(--amber); }
.status-lost { background: var(--red-soft); color: var(--red); }
.created-cell time { display: block; color: #405056; font-size: 11px; white-space: nowrap; }
.created-cell time small { display: block; margin-top: 2px; color: #5b696e; font-size: 10px; }
.demo-row-label { display: inline-block; margin-top: 3px; color: #697579; font-size: 9px; }
.no-tags { color: #657378; font-size: 11px; }
.pagination { display: flex; min-height: 45px; align-items: center; justify-content: center; gap: 18px; color: #56666b; font-size: 12px; }
.pagination a { color: var(--accent); }
.pagination a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mobile-lead-list { display: none; }
.empty-state { display: flex; min-height: 250px; align-items: center; flex-direction: column; justify-content: center; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-align: center; }
.empty-symbol { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: #637277; font-size: 22px; }
.empty-state h2 { margin: 12px 0 4px; font-size: 15px; }
.empty-state p { max-width: 320px; margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; background: rgba(18, 33, 37, .35); animation: backdrop-in .16s ease-out; }
.drawer-panel { display: flex; width: min(560px, calc(100vw - 32px)); height: 100%; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; background: #fff; box-shadow: var(--shadow); animation: panel-in .18s ease-out; }
.drawer-toolbar { position: sticky; top: 0; z-index: 3; display: flex; min-height: 50px; align-items: center; justify-content: flex-end; gap: 14px; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.drawer-open-separate { color: var(--accent); font-size: 12px; }
.drawer-open-separate:hover { text-decoration: underline; text-underline-offset: 2px; }
.drawer-close { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #44545a; cursor: pointer; font-size: 21px; line-height: 1; }
.drawer-close:hover { background: #f4f7f7; }
.mobile-back-label { display: none; }
.lead-card { padding: 19px 22px 22px; }
.detail-topline { display: flex; align-items: center; gap: 9px; }
.detail-topline .eyebrow { margin: 0; }
.demo-chip { display: inline-flex; min-height: 19px; align-items: center; padding: 1px 6px; border-radius: 4px; background: #eef1f2; color: #4e5d62; font-size: 10px; }
.detail-identity { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 11px 0 15px; }
.detail-identity h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.35px; line-height: 1.3; overflow-wrap: anywhere; }
.detail-identity p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.text-action { flex: none; color: var(--accent); font-size: 11px; }
.detail-section { margin: 0; padding: 14px 0; border-top: 1px solid #e7edef; }
.deal-amount-section .section-heading { align-items: baseline; }
.deal-amount-value { color: #08756a; font-size: 15px; font-variant-numeric: tabular-nums; }
.deal-amount-form { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.deal-amount-form input { width: min(210px, 100%); min-height: 36px; }
.detail-section h3, .activity-list h3 { margin: 0 0 7px; color: #536268; font-size: 11px; font-weight: 700; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.section-heading h3 { margin: 0; }
.contact-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.contact-line strong { overflow-wrap: anywhere; font-size: 13px; font-weight: 630; }
.copy-button { min-height: 32px; padding: 0 5px; border: 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 11px; white-space: nowrap; }
.copy-button:hover { text-decoration: underline; text-underline-offset: 2px; }
.contact-action { display: inline-flex; min-height: 32px; align-items: center; gap: 5px; margin-top: 3px; color: var(--accent); font-size: 11px; }
.request-full { margin: 0; color: #334349; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.quick-status-form { margin-left: auto; }
.status-form { display: flex; min-height: 37px; align-items: center; gap: 9px; }
.status-form select { min-width: 165px; min-height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #33444a; font-size: 12px; }
.status-feedback { color: #28694d; font-size: 11px; }
.action-notice { margin: 0 0 9px; padding: 8px 10px; border-radius: 6px; background: #eaf5ef; color: #266646; font-size: 12px; }
.action-notice-error { background: var(--red-soft); color: var(--red); }
.detail-tags { min-height: 25px; }
.detail-tag { gap: 6px; padding-right: 5px; }
.detail-tag form { display: inline-flex; }
.detail-tag button { display: grid; width: 20px; height: 20px; place-items: center; border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; }
.detail-tag button:hover { background: #d9ebe7; }
.tag-count { color: #66757a; font-size: 11px; }
.add-tag-form { display: flex; gap: 7px; margin-top: 9px; }
.add-tag-form input, .field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink); font-size: 13px; }
.add-tag-form input { min-height: 35px; }
.quick-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.quick-tags button { min-height: 26px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #4d5d62; cursor: pointer; font-size: 10px; }
.quick-tags button[class*="tag-color-"] { border-color: transparent; }
.quick-tags button:hover { border-color: #b4d1cc; background: #f1f8f6; color: var(--accent-dark); }
.activity-list { padding: 13px 0; border-top: 1px solid #e7edef; }
.activity-item { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; color: #536268; font-size: 11px; }
.activity-item i { width: 6px; height: 6px; flex: none; margin-top: 5px; border-radius: 50%; background: #5b9f95; }
.activity-item small { display: block; color: #66757a; font-size: 10px; }
.detail-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding-top: 11px; border-top: 1px solid #e7edef; color: #66757a; font-size: 10px; }
.standalone-detail { width: min(680px, 100%); margin: 0 auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.back-link { display: inline-flex; min-height: 36px; align-items: center; margin-bottom: 10px; color: var(--accent); font-size: 12px; }
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.board-summary, .calendar-summary { color: var(--muted); font-size: 12px; }
.kanban-scroll { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; padding: 2px 2px 12px; scrollbar-color: #bbc9ca transparent; scrollbar-width: thin; }
.kanban-board { display: grid; width: max-content; grid-auto-columns: minmax(230px, 260px); grid-auto-flow: column; align-items: start; gap: 12px; }
.board-action-feedback { margin: 0 0 10px; padding: 8px 11px; border-radius: 6px; font-size: 12px; }
.board-action-feedback.feedback-success { background: #e9f6ef; color: #286442; }
.board-action-feedback.feedback-error { background: #fff0ed; color: #8b3c33; }
.kanban-column { display: flex; min-height: 420px; max-height: calc(100vh - 190px); flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #eef2f3; }
.kanban-column-header { display: flex; min-height: 45px; align-items: center; justify-content: space-between; gap: 9px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #f8fafa; }
.kanban-column-header h2 { margin: 0; font-size: 12px; font-weight: 680; }
.kanban-column-count { min-width: 23px; padding: 1px 6px; border-radius: 12px; background: #e7eded; color: #4e5d62; font-size: 10px; text-align: center; }
.kanban-column-summary { display: grid; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fff; }
.kanban-column-total { display: flex; align-items: baseline; gap: 5px; color: #69787c; font-size: 10px; }
.kanban-column-total > span { color: var(--accent-dark); font-size: 13px; font-weight: 700; }
.kanban-column-total strong { color: #263b40; font-size: 11px; font-weight: 700; }
.kanban-add-deal { width: fit-content; min-height: 28px; color: var(--accent-dark); font-size: 11px; font-weight: 600; text-decoration: none; }
.kanban-add-deal:hover { color: #075c56; text-decoration: underline; }
.kanban-add-deal:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.kanban-dropzone { display: grid; min-height: 365px; align-content: start; gap: 8px; overflow-y: auto; padding: 8px; }
.kanban-column.drag-over .kanban-dropzone { background: #e5f2f0; }
.kanban-card { min-width: 0; padding: 10px; border: 1px solid #dce4e5; border-radius: 7px; background: #fff; box-shadow: 0 1px 2px rgba(24,39,44,.04); cursor: grab; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .48; }
.kanban-card-title { display: block; overflow: hidden; color: #24383d; font-size: 12px; font-weight: 670; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card-title:hover { color: var(--accent-dark); }
.kanban-card-contact { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card-amount { margin-top: 7px; color: #076d64; font-size: 12px; font-weight: 720; font-variant-numeric: tabular-nums; }
.kanban-card-request { display: -webkit-box; overflow: hidden; margin: 8px 0; color: #46565b; font-size: 11px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.kanban-card-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.kanban-card-tags { display: flex; min-width: 0; flex: 1; flex-wrap: wrap; align-items: center; gap: 4px; }
.kanban-card-tags .tag-chip { min-height: 20px; padding: 2px 6px; font-size: 9px; }
.kanban-no-tags { color: var(--muted); font-size: 9px; }
.kanban-card-footer time { flex: none; padding-top: 4px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.board-stage-select { width: 100%; min-height: 29px; margin-top: 8px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #506065; font-size: 10px; }
.kanban-empty { padding: 14px 10px; border: 1px dashed #c8d2d4; border-radius: 7px; color: #68777c; font-size: 11px; text-align: center; }
.calendar-controls { display: flex; align-items: center; gap: 8px; }
.calendar-controls a { display: inline-grid; min-width: 34px; min-height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #405257; }
.calendar-controls a:hover { border-color: #aac8c3; background: var(--accent-soft); }
.calendar-month { min-width: 135px; margin: 0 5px; font-size: 16px; font-weight: 680; text-align: center; text-transform: capitalize; }
.calendar-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.calendar-agenda { display: none; }
.calendar-agenda-item { display: grid; grid-template-columns: 48px minmax(0,1fr) 18px; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.calendar-agenda-item:hover { border-color: #a8c9c4; background: #f7fbfa; }
.calendar-agenda-item time { color: #536268; font-size: 11px; font-variant-numeric: tabular-nums; }
.calendar-agenda-item strong, .calendar-agenda-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-agenda-item strong { color: #293b40; font-size: 12px; }
.calendar-agenda-item small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.agenda-arrow { color: var(--accent); text-align: right; }
.calendar-grid { display: grid; min-width: 720px; grid-template-columns: repeat(7,minmax(0,1fr)); }
.calendar-weekday { padding: 9px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #59696e; font-size: 10px; font-weight: 700; text-align: right; }
.calendar-day { min-height: 126px; padding: 7px; border-right: 1px solid #e8edef; border-bottom: 1px solid #e8edef; background: #fff; }
.calendar-day.outside-month { background: #f8fafa; color: #9aa5a8; }
.calendar-day.today { background: #f0f8f6; box-shadow: inset 0 0 0 1px #95bdb6; }
.calendar-day-number { display: flex; width: 25px; height: 25px; align-items: center; justify-content: center; border-radius: 50%; color: #4f5f64; font-size: 11px; }
.calendar-day.today .calendar-day-number { background: var(--accent); color: #fff; font-weight: 700; }
.calendar-events { display: grid; gap: 4px; margin-top: 4px; }
.calendar-event { display: block; overflow: hidden; padding: 4px 5px; border-left: 2px solid var(--accent); border-radius: 3px; background: var(--accent-soft); color: #235e58; font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event:hover { background: #dcefeb; color: #144e49; }
.calendar-event.status-lost { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.calendar-event.status-closed { border-color: #839094; background: #edf0f1; color: #4f5d62; }
.follow-up-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.follow-up-form label { display: grid; flex: 1 1 175px; gap: 4px; color: #536268; font-size: 11px; font-weight: 600; }
.follow-up-form input { min-height: 36px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.follow-up-hint { width: 100%; color: var(--muted); font-size: 10px; }
.follow-up-error { width: 100%; color: var(--red); font-size: 11px; }
.calendar-empty { margin: 12px 0; color: var(--muted); font-size: 11px; }
.form-page { width: min(680px, 100%); margin: 8px auto; }
.form-card { display: flex; flex-direction: column; gap: 13px; margin-top: 17px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { color: #35464b; font-size: 12px; font-weight: 650; }
.field-hint, .optional-label { color: var(--muted); font-size: 11px; font-weight: 400; }
.field-row { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 12px; }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.field input, .field select, .field textarea { min-height: 40px; }
.field-error { color: var(--red); font-size: 12px; }
.form-alert { padding: 9px 11px; border: 1px solid #efd2ce; border-radius: 6px; background: var(--red-soft); color: var(--red); font-size: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 3px; padding-top: 13px; border-top: 1px solid var(--line); }
.toast-stack { position: fixed; top: 66px; right: 18px; z-index: 70; display: grid; gap: 7px; max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 10px 13px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 7px; background: #fff; box-shadow: 0 8px 24px rgba(18,33,37,.12); font-size: 12px; }
.toast-error { border-left-color: var(--red); }
.guide-layout { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 18px; align-items: start; }
.guide-main, .guide-meta, .channel-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.guide-main { padding: 2px 18px; }
.guide-section { display: grid; grid-template-columns: 31px minmax(0,1fr); gap: 9px; padding: 16px 0; border-bottom: 1px solid #e8edef; }
.guide-section:last-child { border: 0; }
.guide-number { padding-top: 2px; color: var(--accent); font-size: 11px; font-weight: 700; }
.guide-section h2 { margin: 0 0 5px; font-size: 14px; }
.guide-section p { margin: 0; color: #536268; font-size: 12px; line-height: 1.6; }
.guide-inline-link { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
.guide-meta { position: sticky; top: 72px; padding: 15px; }
.guide-meta h2 { margin: 13px 0 8px; font-size: 14px; }
.guide-meta ul { margin: 0; padding-left: 17px; color: #4f5f64; font-size: 12px; line-height: 1.9; }
.guide-meta p { margin: 10px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.status-pill { display: inline-flex; padding: 5px 8px; border-radius: 5px; background: var(--amber-soft); color: var(--amber); font-size: 10px; font-weight: 650; }
.status-pill-error { background: var(--red-soft); color: var(--red); }
.channel-list { display: grid; width: min(850px, 100%); gap: 10px; }
.channel-card { padding: 16px; }
.channel-title { display: flex; align-items: center; gap: 11px; }
.channel-icon { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 16px; }
.channel-icon-muted { background: #f0f3f4; color: #56666b; }
.channel-title h2 { margin: 0; font-size: 14px; }
.channel-title p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.channel-state { margin-left: auto; padding: 4px 7px; border-radius: 5px; background: var(--red-soft); color: var(--red); font-size: 10px; font-weight: 650; white-space: nowrap; }
.channel-state.state-pending { background: var(--amber-soft); color: var(--amber); }
.channel-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 14px 0 0; padding-top: 11px; border-top: 1px solid var(--line); }
.channel-facts dt { color: var(--muted); font-size: 10px; }
.channel-facts dd { margin: 3px 0 0; color: #36474c; font-size: 12px; overflow-wrap: anywhere; }
.channel-note { margin: 12px 0 0; color: #56666b; font-size: 11px; line-height: 1.55; }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; background: radial-gradient(ellipse at 50% 25%, #fbfdfc 0, #f4f7f8 65%); }
.login-card { width: min(390px,100%); padding: 29px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 18px 50px rgba(20,43,47,.08); }
.login-brand { margin-bottom: 28px; }
.login-card h1 { margin: 0; font-size: 22px; }
.login-card .muted { margin: 6px 0 18px; color: var(--muted); }
.login-card input { width: 100%; min-height: 41px; margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; }
.login-foot { margin: 16px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.login-doc-link { display: block; margin-top: 14px; color: var(--accent); font-size: 12px; font-weight: 700; text-align: center; text-decoration: none; }
.login-doc-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.nav-scrim { display: none; }

@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes panel-in { from { transform: translateX(14px); } to { transform: translateX(0); } }

@media (max-width: 1279px) {
  .app-main { margin-left: 0; }
  .sidebar { top: 56px; transform: translateX(-102%); transition: transform .18s ease; box-shadow: none; }
  .nav-toggle { display: inline-flex; }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 12px 0 30px rgba(18,33,37,.11); }
  body.nav-open::after { position: fixed; inset: 56px 0 0; z-index: 19; display: block; background: rgba(18,33,37,.24); content: ""; }
}

@media (max-width: 767px) {
  .topbar { height: 52px; gap: 8px; padding: 0 12px; }
  .sidebar { top: 52px; width: min(280px, 84vw); }
  body.nav-open::after { inset-block-start: 52px; }
  .page-shell { padding: 13px 12px 28px; }
  .page-heading, .inbox-heading { align-items: flex-start; gap: 9px; margin-bottom: 12px; }
  .calendar-heading { flex-direction: column; }
  .calendar-controls { width: 100%; justify-content: space-between; gap: 5px; }
  .calendar-month { min-width: 0; margin: 0 2px; font-size: 14px; }
  .calendar-wrap { display: none; }
  .calendar-agenda { display: grid; gap: 7px; }
  .inbox-heading h1, .page-heading h1, .form-page h1 { font-size: 21px; }
  .eyebrow { font-size: 10px; }
  .add-lead-button { min-height: 40px; padding: 0 9px; font-size: 11px; white-space: nowrap; }
  .filter-bar { grid-template-columns: 1fr 1fr; gap: 7px; padding: 8px; }
  .search-control { grid-column: 1 / -1; height: 42px; }
  .filter-control { font-size: 10px; }
  .filter-control select { height: 42px; font-size: 12px; }
  .results-bar { min-height: 38px; align-items: flex-start; flex-direction: column; gap: 5px; padding: 3px 0 7px; }
  .active-filters { gap: 5px; }
  .table-frame { display: none; }
  .mobile-lead-list { display: grid; gap: 8px; }
  .mobile-lead-card { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  .mobile-lead-card.selected { border-color: #83b5ae; background: #f1f8f6; }
  .mobile-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
  .mobile-card-heading > div { min-width: 0; }
  .mobile-card-heading .client-link strong { font-size: 14px; }
  .mobile-card-heading .status-badge { min-height: 25px; font-size: 10px; }
  .mobile-lead-number { display: block; margin-top: 2px; color: #66757a; font-size: 10px; }
  .mobile-request { display: -webkit-box; overflow: hidden; margin: 10px 0; color: #3d4d52; font-size: 12px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
  .mobile-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid #e8edef; }
  .mobile-card-meta time { color: #56666b; font-size: 10px; }
  .mobile-card-tags { margin-top: 8px; }
  .mobile-card-tags .tag-chip { min-height: 25px; }
  .drawer-backdrop { background: #fff; }
  .drawer-panel { width: 100%; max-width: none; }
  .drawer-toolbar { min-height: 50px; justify-content: space-between; padding: 0 12px; }
  .drawer-open-separate { margin-left: auto; }
  .drawer-close { display: inline-flex; width: auto; min-width: 44px; min-height: 40px; align-items: center; justify-content: center; gap: 5px; padding: 0 8px; font-size: 12px; }
  .drawer-close > span:first-child { font-size: 18px; }
  .mobile-back-label { display: inline; }
  .lead-card { padding: 14px 15px 22px; }
  .detail-identity h2 { font-size: 19px; }
  .detail-section { padding: 12px 0; }
  .guide-layout { grid-template-columns: 1fr; gap: 9px; }
  .guide-meta { position: static; }
  .guide-main { padding: 0 13px; }
  .guide-section { grid-template-columns: 25px minmax(0,1fr); gap: 7px; padding: 13px 0; }
  .channel-card { padding: 13px; }
  .field-row { grid-template-columns: 1fr; gap: 12px; }
  .deal-amount-form { align-items: stretch; flex-direction: column; }
  .deal-amount-form input { width: 100%; }
  .form-card { padding: 15px; }
  .form-actions { position: sticky; bottom: 0; margin: 0 -15px -15px; padding: 11px 15px; background: #fff; }
  .button { min-height: 42px; }
  .button-small { min-height: 36px; }
  .pagination { min-height: 48px; }
}

@media (max-width: 380px) {
  .topbar-label { gap: 6px; font-size: 11px; }
  .nav-toggle { gap: 4px; font-size: 11px; }
  .add-lead-button { font-size: 10px; }
  .page-shell { padding-inline: 9px; }
  .filter-bar { gap: 6px; }
  .filter-control select { padding-inline: 6px; font-size: 11px; }
  .channel-facts { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
