/* ============================================================================
 * АрендОК · Дизайн-токены и база (снято с arendok.ru)
 * Бирюза #53d9ba (primary) · Фиолет #8238c8 (accent) · Navy #111827 (sidebar)
 * Токены в shadcn-стиле — тот же контракт переменных, что на сайте.
 * ==========================================================================*/
:root {
  /* бренд */
  --brand:        #53d9ba;  /* мята/бирюза */
  --brand-600:    #2fbf9e;
  --brand-700:    #1fa588;
  --brand-soft:   #eaf7f2;
  --accent:       #6d54e0;  /* фиолет */
  --accent-2:     #8b74f0;
  --accent-soft:  #eeeafe;
  --warm:         #f18017;  /* оранж */
  --warm-soft:    #fff1e6;
  --gold:         #f0c20c;
  --navy:         #111827;
  --navy-700:     #1b2436;
  --navy-600:     #243049;

  /* семантика (shadcn contract) */
  --background:   #ffffff;
  --foreground:   #111827;
  --card:         #ffffff;
  --card-foreground: #111827;
  --muted:        #f5f7fb;
  --muted-foreground: #6a7688;
  --border:       #e7ebf3;
  --input:        #e7ebf3;
  --ring:         #53d9ba;
  --primary:      var(--brand);
  --primary-strong: #0d9488;   /* насыщенный бренд-тил для главных кнопок */
  --primary-foreground: #06251d;
  --secondary:    var(--accent-soft);
  --secondary-foreground: #4a1d78;
  --destructive:  #e5484d;
  --destructive-soft: #fdecec;
  --success:      #1fa588;
  --success-soft: #e8f6f1;
  --radius:       10px;

  /* сайдбар */
  --sidebar-bg:   var(--navy);
  --sidebar-fg:   #c7cede;
  --sidebar-muted:#7c869c;
  --sidebar-active-bg: rgba(83,217,186,.14);
  --sidebar-active-fg: #6ee7c8;
  --sidebar-border: rgba(255,255,255,.06);

  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow:    0 4px 18px rgba(16,24,40,.07);
  --shadow-lg: 0 16px 44px rgba(16,24,40,.12);

  --font: "Circe", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-head: "Days One", var(--font);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--foreground);
  background: var(--muted); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { margin: 0 0 .4em; font-weight: 700; color: var(--foreground); letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0 0 .8em; }
::selection { background: var(--brand-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cdd5e0; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6c0cf; background-clip: content-box; }

/* ---------- утилиты ---------- */
.muted { color: var(--muted-foreground); }
.small { font-size: 12.5px; }
.mono { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; }
.row { display: flex; gap: 12px; align-items: center; }
.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.hidden { display: none !important; }
.grow { flex: 1 1 auto; }

/* ---------- кнопки ---------- */
.btn {
  --bg: var(--primary); --fg: var(--primary-foreground);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--radius); border: 1px solid transparent;
  background: var(--bg); color: var(--fg); font: inherit; font-weight: 600; cursor: pointer;
  transition: filter .15s, background .15s, box-shadow .15s, transform .05s; white-space: nowrap;
}
.btn:hover { filter: brightness(.96); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.ghost { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn.ghost:hover { background: var(--muted); filter: none; }
.btn.accent { --bg: var(--accent); --fg: #fff; }
.btn.warm { --bg: var(--warm); --fg: #fff; }
.btn.danger { --bg: var(--destructive); --fg: #fff; }
.btn.soft { --bg: var(--brand-soft); --fg: var(--brand-700); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--muted-foreground); cursor: pointer; }
.icon-btn:hover { background: var(--muted); color: var(--foreground); }

/* ---------- бейджи / статусы ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--muted); color: var(--muted-foreground); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.mint  { background: var(--brand-soft); color: var(--brand-700); }
.badge.purple{ background: var(--accent-soft); color: var(--accent); }
.badge.warm  { background: var(--warm-soft); color: #c25e00; }
.badge.gold  { background: #fdf6d9; color: #9a7b04; }
.badge.red   { background: var(--destructive-soft); color: var(--destructive); }
.badge.gray  { background: #eef1f5; color: #64748b; }

/* ---------- карточки ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.pad { padding: 18px; }
.card-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-body { padding: 18px; }
.stat { padding: 18px; border-radius: var(--radius); background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.stat .label { color: var(--muted-foreground); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 28px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.stat .sub { font-size: 12.5px; margin-top: 4px; }
.stat .bar { height: 4px; border-radius: 4px; margin-top: 12px; background: linear-gradient(90deg,var(--brand),var(--accent-2)); }

/* ---------- формы ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #37415a; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--input); border-radius: 9px;
  font: inherit; color: var(--foreground); background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 10px 12px; min-height: 92px; resize: vertical; }
.input:focus, select.input:focus, textarea.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(83,217,186,.25); }
.input.err { border-color: var(--destructive); box-shadow: 0 0 0 3px var(--destructive-soft); }
.switch { position: relative; width: 42px; height: 24px; display: inline-block; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; background: #cbd3de; border-radius: 999px; transition: background .2s; cursor: pointer; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.seg { display: inline-flex; background: var(--muted); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; padding: 6px 12px; border-radius: 7px; font: inherit; font-weight: 600; font-size: 12.5px; color: var(--muted-foreground); cursor: pointer; }
.seg button.on { background: #fff; color: var(--foreground); box-shadow: var(--shadow-sm); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 12.5px; font-weight: 600; color: #45506a; cursor: pointer; }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-700); }

/* ---------- таблицы ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl thead th { position: sticky; top: 0; background: #fafbfc; text-align: left; font-weight: 600; color: #55617a; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12.5px; }
table.tbl tbody td { padding: 11px 14px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
table.tbl tbody tr:hover { background: #fbfdfc; }
table.tbl tbody tr.sel { background: var(--brand-soft); }
table.tbl tbody tr.err td { background: var(--destructive-soft); }
table.tbl tbody tr:last-child td { border-bottom: none; }
.tbl-tools { display: flex; gap: 10px; align-items: center; padding: 12px; flex-wrap: wrap; }

/* ---------- каналы: кликабельные ссылки, скрытые доступы, раскрытие строки ---------- */
.lnk { color: var(--brand-700); text-decoration: none; border-bottom: 1px solid var(--brand); font-weight: 600; word-break: break-all; }
.lnk:hover { color: var(--accent); border-color: var(--accent); }
.secret { filter: blur(4.5px); cursor: pointer; border-radius: 4px; background: #f1f3f7; padding: 0 3px; transition: filter .12s; user-select: none; }
.secret::after { content: ""; }
.secret.on { filter: none; background: #fff7d6; user-select: text; }
tr.ch-row:hover { background: var(--brand-soft) !important; }
tr.ch-detail:hover { background: transparent; }
tr.ch-detail td { padding-top: 0 !important; border-bottom: 1px solid var(--border); }
.dv { background: #fafbfc; border: 1px solid var(--border); border-radius: 10px; padding: 4px 0; margin-top: 4px; }
.dv-row { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 9px 16px; border-bottom: 1px solid #eef1f5; }
.dv-row:last-child { border-bottom: none; }
.dv-k { color: #64748b; font-size: 12.5px; font-weight: 600; }
.dv-v { color: #334155; font-size: 13px; line-height: 1.55; word-break: break-word; }
.dv-v a.badge { text-decoration: none; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 720px) { .dv-row { grid-template-columns: 1fr; gap: 3px; } }

/* ---------- прочее ---------- */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.kv { display: grid; grid-template-columns: minmax(120px,auto) 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--muted-foreground); }
.kv dd { margin: 0; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 9999; font-weight: 600; font-size: 13px; opacity: 0; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg,#eef1f5 25%,#f6f8fa 50%,#eef1f5 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; color: var(--muted-foreground); padding: 44px 20px; }
.empty .ico { font-size: 34px; opacity: .4; }

/* ---------- предупреждение / примечание над страницей ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; background: #fff8e6; border: 1px solid #f3dfa2; border-left: 3px solid #d99e00; border-radius: 12px; padding: 13px 16px; margin: 0 0 20px; }
.notice-t { font-weight: 700; font-size: 13px; color: #8a6604; margin-bottom: 3px; }
.notice-b { font-size: 13px; line-height: 1.5; color: #6b5405; }
.notice-b b { color: #55430a; }
@media (max-width: 720px) { .notice { padding: 12px 13px; border-radius: 10px; } }

/* ---------- платёжный календарь (модуль) ---------- */
.pc-wd { display: grid; grid-template-columns: repeat(7,1fr); margin-bottom: 6px; }
.pc-wd span { text-align: center; font-size: 11.5px; color: var(--muted-foreground); font-weight: 600; }
.pc-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; }
.pc-cell { min-height: 62px; border: 1px solid var(--border); border-radius: 9px; padding: 6px; cursor: pointer; background: #fff; transition: border-color .12s, background .12s; }
.pc-cell.empty { border: none; background: transparent; cursor: default; }
.pc-cell:not(.empty):hover { border-color: var(--brand); background: var(--brand-soft); }
.pc-cell.today { box-shadow: inset 0 0 0 1.5px var(--brand); }
.pc-cell.sel { background: var(--brand-soft); border-color: var(--brand); }
.pc-d { font-size: 13px; font-weight: 600; color: #37415a; }
.pc-marks { display: flex; flex-direction: column; gap: 3px; margin-top: 5px; }
.pc-mark { font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 5px; align-self: flex-start; }
.pc-mark.in { background: var(--success-soft); color: var(--success); }
.pc-mark.out { background: var(--destructive-soft); color: var(--destructive); }

/* ---------- модалка ---------- */
.modal-bd { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 9000; padding: 16px; }
.modal { width: min(480px, 96vw); background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }

/* ---------- карта объектов ---------- */
.map-board { position: relative; height: 560px; overflow: hidden; cursor: grab; background:
  radial-gradient(circle at 50% 40%, #f4f9f8, #eef2f7);
  background-image: linear-gradient(rgba(83,217,186,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(83,217,186,.06) 1px, transparent 1px);
  background-size: 40px 40px; }
.map-world { position: absolute; top: 0; left: 0; width: 2400px; height: 1900px; transform-origin: 0 0; }
.map-zone { position: absolute; width: 260px; height: 260px; margin: -130px 0 0 -130px; border-radius: 50%; background: radial-gradient(circle, rgba(130,56,200,.10), transparent 70%); border: 2px dashed rgba(130,56,200,.35); display: grid; place-items: center; }
.map-zone span { font-family: var(--font-head); font-size: 20px; color: var(--accent); background: rgba(255,255,255,.75); padding: 3px 12px; border-radius: 999px; }
.map-pin { position: absolute; margin: -30px 0 0 -9px; cursor: pointer; }
.map-pindot { width: 18px; height: 18px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--brand); border: 2.5px solid #fff; box-shadow: 0 3px 8px rgba(31,165,136,.5); }
.map-pinlbl { position: absolute; left: 22px; top: -2px; white-space: nowrap; background: var(--navy); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.ds-cal-trigger { border: 1px solid var(--border); border-radius: 9px; color: var(--foreground) !important; background: #fff; max-width: 190px; }
.ds-cal-trigger .dp-ico, .ds-cal-trigger .dp-chev { color: var(--muted-foreground) !important; }

/* ---------- Карты (whiteboard) ---------- */
.wb-wrap { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.wb-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: #fafbfc; }
.wb-tool { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; background: transparent; border-radius: 8px; color: #45506a; cursor: pointer; }
.wb-tool svg { width: 18px; height: 18px; }
.wb-tool:hover { background: #eef1f5; }
.wb-tool.on { background: var(--brand-soft); color: var(--brand-700); border-color: var(--brand); }
.wb-canvas { position: relative; height: calc(100vh - 230px); min-height: 460px; overflow: hidden; background:
  #f7f9fb; background-image: radial-gradient(#d9e0ea 1.2px, transparent 1.2px); background-size: 26px 26px; }
.wb-world { position: absolute; top: 0; left: 0; width: 1px; height: 1px; transform-origin: 0 0; }
.wb-edges { position: absolute; top: 0; left: 0; overflow: visible; width: 4000px; height: 3000px; pointer-events: none; }
.wb-node { position: absolute; box-sizing: border-box; border-radius: 10px; padding: 10px 12px; font-size: 13px; cursor: grab; box-shadow: var(--shadow-sm); user-select: none; }
.wb-node:active { cursor: grabbing; }
.wb-note { background: #fff4c2; border: 1px solid rgba(0,0,0,.06); box-shadow: 0 3px 10px rgba(180,150,20,.18); }
.wb-rect { background: #fff; border: 1.5px solid #cbd3e0; }
.wb-text { background: transparent; box-shadow: none; border: 1px solid transparent; font-weight: 600; font-size: 15px; padding: 4px 6px; }
.wb-text:hover { border-color: #cbd3e0; }
.wb-frame { background: rgba(130,56,200,.04); border: 1.5px dashed rgba(130,56,200,.4); border-radius: 12px; }
.wb-frame .wb-txt { color: var(--accent); font-weight: 700; font-family: var(--font-head); }
.wb-sel { outline: 2px solid var(--brand); outline-offset: 1px; }
.wb-linksrc { outline: 2px dashed var(--accent); outline-offset: 1px; }
.wb-txt { white-space: pre-wrap; word-break: break-word; outline: none; min-height: 18px; }
.wb-txt.editing { cursor: text; }
.wb-ph { color: #94a3b8; }
.wb-zoom { position: absolute; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 4px 6px; box-shadow: var(--shadow-sm); }
.wb-zoom button { width: 26px; height: 26px; border: none; background: transparent; border-radius: 50%; cursor: pointer; font-size: 16px; color: #45506a; }
.wb-zoom button:hover { background: var(--muted); }
.wb-zoom span { font-size: 12px; font-weight: 700; min-width: 40px; text-align: center; }
.wb-hint { position: absolute; left: 14px; bottom: 14px; background: rgba(17,24,39,.85); color: #fff; font-size: 11.5px; padding: 5px 11px; border-radius: 999px; pointer-events: none; }

/* ---------- Платёжный календарь (грид) ---------- */
.pcx-wrap { width: 100%; }
.pcx-scroll { overflow: auto; max-height: calc(100vh - 220px); }
table.pcx { border-collapse: separate; border-spacing: 0; font-size: 12.5px; white-space: nowrap; }
table.pcx th, table.pcx td { border-right: 1px solid #eef1f5; border-bottom: 1px solid #eef1f5; padding: 6px 8px; text-align: center; background: #fff; }
table.pcx thead th { position: sticky; top: 0; z-index: 3; background: #fafbfc; font-weight: 600; color: #55617a; }
.pcx-sticky { position: sticky; left: 0; z-index: 2; }
table.pcx thead th.pcx-cat.pcx-sticky { z-index: 4; }
.pcx-cat { text-align: left; min-width: 190px; max-width: 220px; box-shadow: 1px 0 0 #e6eaf0; }
.pcx-cat .pcx-rowtitle { cursor: pointer; }
.pcx-cat .pcx-rowtitle:hover { color: var(--accent); text-decoration: underline; }
.pcx-del { float: right; border: none; background: transparent; color: #c0c7d2; cursor: pointer; font-size: 11px; opacity: 0; }
tr:hover .pcx-del { opacity: 1; }
.pcx-day { min-width: 40px; color: #8792a6; }
.pcx-day span { display: block; font-size: 9px; text-transform: uppercase; color: #b3bccb; }
.pcx-day.we, td.we { background: #fbfcfd; }
.pcx-total { min-width: 90px; font-weight: 700; background: #fafbfc; box-shadow: -1px 0 0 #e6eaf0; position: sticky; right: 0; }
.pcx-c { cursor: pointer; min-width: 40px; font-weight: 600; }
.pcx-c:hover { outline: 2px solid var(--brand); outline-offset: -2px; }
.pcx-c.has.st-plan { background: #eef2f7; color: #45506a; }
.pcx-c.has.st-paid { background: var(--success-soft); color: var(--success); }
.pcx-c.has.st-overdue { background: var(--destructive-soft); color: var(--destructive); }
.pcx-section td { background: #f4f6f8; font-weight: 800; font-size: 11px; letter-spacing: .04em; color: #55617a; text-align: left; }
.pcx-section.inc td.pcx-cat { color: var(--success); }
.pcx-section.exp td.pcx-cat { color: var(--destructive); }
.pcx-sub td { background: #f7f9fb; font-weight: 700; }
.pcx-sub.inc td.pcx-total { color: var(--success); }
.pcx-sub.exp td.pcx-total { color: var(--destructive); }
.pcx-balance td { background: #f0f4f8; font-weight: 800; }
.pcx-pop { position: fixed; z-index: 9500; width: 244px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px; }
.pcx-pop .seg { width: 100%; }
.pcx-pop .seg button { flex: 1; padding: 5px 4px; font-size: 11.5px; }

/* ---------- каналы: сводка ---------- */
.ch-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ch-stat { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.ch-stat-v { font-size: 22px; font-weight: 800; line-height: 1; color: var(--foreground); }
.ch-stat-v.brand { color: var(--brand-700); }
.ch-stat-v.ok { color: var(--success); }
.ch-stat-v.warn { color: #c25e00; }
.ch-stat-v.off { color: #64748b; }
.ch-stat-v.hi { color: var(--destructive); }
.ch-stat-l { color: var(--muted-foreground); font-size: 12px; margin-top: 6px; }

/* ---------- Карты: холст архитектуры (Figma 1:1) ---------- */
.arch-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.arch-nav .chip { height: 32px; }
.arch-card { position: relative; }
.arch-viewport { position: relative; width: 100%; height: calc(100vh - 210px); min-height: 540px; overflow: hidden; background: #eef1f6; background-image: radial-gradient(#d7deea 1.2px, transparent 1.2px); background-size: 28px 28px; cursor: grab; }
.arch-viewport.grabbing { cursor: grabbing; }
.arch-world { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.arch-edges { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; z-index: 2; }
.arch-edge { fill: none; stroke: #46536b; stroke-width: 4px; vector-effect: non-scaling-stroke; stroke-linecap: round; opacity: .95; }
.arch-sec { position: absolute; z-index: 1; border: 2.5px dashed #b9c2d4; border-radius: 22px; box-sizing: border-box; }
.arch-sec-l { position: absolute; top: -19px; left: 26px; background: #334155; color: #fff; font-size: 26px; font-weight: 800; letter-spacing: .01em; padding: 6px 20px; border-radius: 11px; white-space: nowrap; box-shadow: 0 4px 14px rgba(16,24,40,.16); }
.arch-node { position: absolute; z-index: 3; box-sizing: border-box; border-radius: 16px; padding: 12px 16px; overflow: hidden; box-shadow: 0 6px 18px rgba(16,24,40,.14), 0 1px 3px rgba(16,24,40,.10); display: flex; align-items: center; justify-content: center; text-align: center; border: 1.5px solid rgba(255,255,255,.55); }
.arch-node.is-text { box-shadow: none; border: none; border-radius: 0; background: transparent !important; text-align: left; justify-content: flex-start; align-items: flex-start; }
.arch-node.is-sticky { border-radius: 6px; box-shadow: 4px 6px 16px rgba(16,24,40,.20); align-items: flex-start; text-align: left; }
.arch-node-txt { width: 100%; line-height: 1.24; font-weight: 650; white-space: pre-wrap; word-break: break-word; overflow: hidden; }
.arch-node.is-text .arch-node-txt { font-weight: 500; color: #334155; }
.arch-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted-foreground); font-size: 14px; z-index: 5; }
.arch-legend { position: absolute; left: 14px; bottom: 14px; z-index: 6; background: rgba(255,255,255,.95); border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; font-size: 12px; color: #475569; box-shadow: var(--shadow-md, 0 8px 24px rgba(16,24,40,.12)); }
.arch-legend > div { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.arch-leg-t { font-weight: 800; color: #334155; margin-bottom: 5px; }
.arch-sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid rgba(16,24,40,.12); }
.arch-zoom { position: absolute; right: 14px; bottom: 14px; z-index: 6; background: rgba(255,255,255,.95); border: 1px solid var(--border); border-radius: 9px; padding: 6px 11px; font-size: 12px; font-weight: 800; color: #334155; box-shadow: var(--shadow-sm); }

/* ---------- Каналы: аккуратная DS-таблица ---------- */
.tbl-ch tbody td { vertical-align: top; padding-top: 13px; }
.tbl-ch tbody tr.ch-row td:first-child { vertical-align: middle; }
.tbl-ch tbody tr.ch-row { transition: background .12s ease; }
.tbl-ch tbody tr.ch-detail td { vertical-align: top; }
.tbl-ch .badge { white-space: nowrap; }
.ch-agent { color: var(--accent); font-weight: 600; font-size: 13px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }

/* ---------- Каналы: чипы-лейблы + inline-редактирование карточки ---------- */
.chip-lbl { font-size: 11px; font-weight: 700; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .04em; align-self: center; margin-right: 1px; }
.dv-v[data-field] { cursor: text; border-radius: 7px; transition: background .12s; }
.dv-v[data-field]:hover { background: #eef2f7; }
.dv-empty { color: #cbd5e1; }
.dv-edit { display: block; width: 100%; border: none; outline: none; background: #fffbea; border-radius: 7px; padding: 6px 8px; font: inherit; font-size: 13px; line-height: 1.55; color: #334155; resize: none; overflow: hidden; box-shadow: none; }

/* ---------- Контент: Битрикс-диск браузер ---------- */
.ct-bxcrumb { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13.5px; }
.ct-bxcrumb .ct-crumb { color: var(--brand-700); font-weight: 600; cursor: pointer; }
.ct-bxcrumb .ct-crumb:last-child { color: var(--foreground); cursor: default; pointer-events: none; }
.ct-bxcrumb .ct-sep { color: var(--muted-foreground); }
.ct-bxtile { padding: 14px; cursor: pointer; transition: box-shadow .12s, border-color .12s, transform .12s; }
.ct-bxtile:hover { border-color: var(--brand); box-shadow: 0 8px 22px rgba(16,24,40,.10); transform: translateY(-1px); }
.ct-bxdl { display: flex; gap: 14px; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--border); }
.ct-bxdl a { font-size: 12px; font-weight: 700; color: var(--brand-700); text-decoration: none; }
.ct-bxdl a:hover { color: var(--accent); }
