/* Montserrat v25 (latin-ext, latin, cyrillic-ext, cyrillic) — ті самі файли шрифту, що в Creatio (/core/hash/Fonts/Montserrat): інша версія має інші ширини літер */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 300; font-display: swap; src: local("Montserrat-Light"), url('/fonts/montserrat-v25-300.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400; font-display: swap; src: local("Montserrat-Regular"), url('/fonts/montserrat-v25-400.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 500; font-display: swap; src: local("Montserrat-Medium"), url('/fonts/montserrat-v25-500.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 600; font-display: swap; src: local("Montserrat-SemiBold"), url('/fonts/montserrat-v25-600.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 700; font-display: swap; src: local("Montserrat-Bold"), url('/fonts/montserrat-v25-700.woff2') format('woff2'); }
/* UDC CRM — стиль у дусі Freedom UI */
:root {
  --bg: #eef1f7; --panel: #ffffff; --text: #1d2433; --muted: #6b7486; --line: #e3e7ef; --line2: #d3d9e4;
  --primary: #0058ef; --primary-h: #0047c4; --link: #0058ef; --danger: #d32f2f; --ok: #22ac14; --warn: #ffac07;
  --tab: #e5352b; --top1: #10123a; --top2: #2a1a6e; --radius: 8px; --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --font: 'Roboto', -apple-system, 'Segoe UI', Arial, sans-serif; --font-h: 'Montserrat', var(--font);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 var(--font); }
a { color: var(--link); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
button { font: inherit; }
.app { display: flex; flex-direction: column; height: 100vh; }
.topbar { height: 52px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 14px; color: #fff;
  background: linear-gradient(100deg, var(--top1) 0%, #241b5e 45%, var(--top2) 70%, #5a1f6e 100%); }
.topbar .logo { font: 700 18px var(--font-h); letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.topbar .logo i { display: inline-block; width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg,#ff6534,#ffac07); }
.topbar .iconbtn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 18px; }
.topbar .iconbtn:hover { background: rgba(255,255,255,.22); }
.topbar .search { flex: 0 1 320px; height: 34px; border-radius: 6px; border: 0; padding: 0 12px; background: rgba(255,255,255,.14); color: #fff; outline: none; }
.topbar .search::placeholder { color: rgba(255,255,255,.7); }
.topbar .spacer { flex: 1; }
.topbar .user { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #c2185b; color: #fff; display: grid; place-items: center; font-weight: 600; }
.body { flex: 1; display: flex; min-height: 0; }
.sidemenu { width: 236px; flex: none; background: #fff; border-right: 1px solid var(--line); overflow: auto; padding: 8px 0; transition: width .15s; }
.sidemenu.collapsed { width: 0; padding: 0; border: 0; }
.sidemenu .wp { padding: 10px 16px 4px; font: 600 11px var(--font-h); text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }
.sidemenu .item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; color: var(--text); cursor: pointer; }
.sidemenu .item:hover { background: #f2f5fb; text-decoration: none; }
.sidemenu .item.active { background: #e8f0ff; color: var(--primary); font-weight: 500; }
.sidemenu .dot { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.main { flex: 1; min-width: 0; overflow: auto; padding: 12px; }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); }
.pagehead { display: flex; align-items: center; gap: 12px; padding: 16px 20px 8px; }
.pagehead h1 { margin: 0; font: 600 24px var(--font-h); }
.btn { height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line2); background: #fff; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: #f4f6fa; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.btn.primary:hover { background: var(--primary-h); }
.btn.danger { color: var(--danger); }
.btn.flat { border-color: transparent; background: transparent; color: var(--text); }
.btn.flat:hover { background: #eef2f8; }
.btn:disabled { opacity: .55; cursor: default; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 20px 12px; }
.toolbar input.search { height: 34px; border: 1px solid var(--line2); border-radius: 6px; padding: 0 10px; min-width: 240px; }
.grid { width: 100%; border-collapse: collapse; }
.grid th { position: sticky; top: 0; background: #fff; text-align: left; font-weight: 500; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.grid tr:hover td { background: #f7f9fd; }
.grid td.num, .grid th.num { text-align: right; }
.grid .rownum { color: var(--muted); width: 40px; text-align: right; }
.gridwrap { overflow: auto; max-height: calc(100vh - 240px); }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--muted); }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; background: #eef2f8; font-size: 12px; }
/* запис */
.rec-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px 6px; }
.rec-head h1 { margin: 0; font: 600 22px var(--font-h); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stages { display: flex; gap: 2px; padding: 8px 20px 12px; overflow-x: auto; }
.stage { flex: 1 0 120px; position: relative; height: 30px; display: flex; align-items: center; padding: 0 14px 0 18px; background: #e9edf4; color: #3b4456; font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); }
.stage:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.stage.done { background: #3d8a8a; color: #fff; }
.stage.current { background: #2f6f73; color: #fff; font-weight: 500; }
.stage.lost { background: var(--danger); color: #fff; }
.rec-body { display: grid; grid-template-columns: 300px 1fr; gap: 12px; align-items: start; }
.rec-body.nosidebar { grid-template-columns: 1fr; }
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); padding: 0 16px; overflow-x: auto; }
.tabs .tab { padding: 12px 0 10px; font: 600 13px var(--font-h); text-transform: uppercase; color: #2f5ca8; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs .tab.active { color: var(--text); border-bottom-color: var(--tab); }
.fgrid { display: grid; gap: 4px 24px; }
.field { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; align-items: center; gap: 10px; min-height: 36px; }
.field.vertical { grid-template-columns: 1fr; gap: 2px; }
.field > label { color: var(--muted); text-align: right; font-size: 13px; line-height: 1.2; }
.field.vertical > label { text-align: left; }
.field .req { color: var(--danger); }
.field input[type=text], .field input[type=number], .field input[type=date], .field input[type=datetime-local], .field input[type=time], .field textarea, .field select, .lk input {
  width: 100%; height: 32px; border: 1px solid transparent; border-bottom-color: var(--line2); border-radius: 4px; padding: 0 8px; background: transparent; font: inherit; color: var(--text); outline: none; }
.field textarea { height: auto; min-height: 64px; padding: 6px 8px; resize: vertical; }
.field input:hover, .field textarea:hover, .lk input:hover { border-color: var(--line2); }
.field input:focus, .field textarea:focus, .lk input:focus { border-color: var(--primary); background: #fff; }
.field input[readonly] { color: var(--muted); }
.field.dirty input, .field.dirty textarea { background: #fffbe6; }
.lk { position: relative; display: flex; align-items: center; }
.lk .val { flex: 1; min-width: 0; padding: 0 8px; height: 32px; display: flex; align-items: center; border-bottom: 1px solid var(--line2); }
.lk .val a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk .x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 6px; }
.dropdown { position: absolute; z-index: 50; top: 100%; left: 0; right: 0; max-height: 260px; overflow: auto; background: #fff; border-radius: 6px; box-shadow: 0 8px 24px rgba(16,24,40,.18); }
.dropdown .opt { padding: 8px 10px; cursor: pointer; }
.dropdown .opt:hover, .dropdown .opt.hl { background: #eef3ff; }
.section-title { display: flex; align-items: center; gap: 8px; font: 600 14px var(--font-h); margin: 14px 0 8px; cursor: pointer; }
.section-title .chev { width: 18px; height: 18px; border-radius: 4px; background: #f15a24; color: #fff; display: grid; place-items: center; font-size: 11px; }
.label-h { font: 600 15px var(--font-h); margin: 6px 0; }
.widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.widget { border-radius: 8px; color: #fff; padding: 10px 14px; min-height: 70px; background: #2251c9; }
.widget .t { font-size: 13px; opacity: .95; }
.widget .v { font: 600 26px var(--font-h); margin-top: 6px; }
.detail { margin: 12px 0; }
.detail .dhead { display: flex; align-items: center; gap: 8px; font: 600 14px var(--font-h); margin-bottom: 6px; }
.detail .grid td, .detail .grid th { padding: 7px 10px; font-size: 13px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 100; padding: 12px 16px; border-radius: 8px; color: #fff; background: #1d2433; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 420px; }
.toast.err { background: var(--danger); }
.modal-bg { position: fixed; inset: 0; background: rgba(16,18,40,.45); z-index: 80; display: grid; place-items: center; }
.modal { background: #fff; border-radius: 10px; width: min(760px, 94vw); max-height: 90vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal .mh { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font: 600 16px var(--font-h); }
.modal .mb { padding: 14px 18px; }
.modal .mf { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.login { height: 100vh; display: grid; place-items: center; background: linear-gradient(120deg, var(--top1), var(--top2) 60%, #7a2a73); }
.login .box { width: 360px; background: #fff; border-radius: 12px; padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.login h2 { margin: 0 0 18px; font: 700 22px var(--font-h); }
.login input { width: 100%; height: 40px; border: 1px solid var(--line2); border-radius: 6px; padding: 0 12px; margin-bottom: 12px; font: inherit; }
.login .err { color: var(--danger); margin-bottom: 10px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.file { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.file .ext { width: 34px; height: 40px; border-radius: 4px; background: #e8eefc; color: var(--primary); display: grid; place-items: center; font: 700 10px var(--font-h); text-transform: uppercase; flex: none; }
.file .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 20px 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 14px; background: #e8f0ff; color: var(--primary); font-size: 12px; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }
@media (max-width: 900px) { .rec-body { grid-template-columns: 1fr; } .sidemenu { position: absolute; z-index: 40; height: calc(100% - 52px); } }
.fwrap { container-type: inline-size; min-width: 0; }
@container (width <= 320px) { .field.auto { grid-template-columns: 1fr; gap: 2px; } .field.auto > label { text-align: left; } }
.freedom-page { min-width: 0; }
.freedom-page [data-n="MainHeader"] .label-h { font: 600 22px var(--font-h); color: #0d2e4e; }
.lk .val { gap: 4px; }
.lk .x { flex: none; }
.home-dash [data-n="Main"] { grid-auto-rows: 64px; }
.home-dash .widget { height: 100%; }

/* ===== Оболонка у стилі Creatio Freedom (власне оформлення) ===== */
body { background: #1b1640; }
.shell { background:
  radial-gradient(1200px 700px at 78% 55%, rgba(255,120,40,.55), transparent 60%),
  radial-gradient(900px 600px at 20% 70%, rgba(200,40,140,.45), transparent 60%),
  radial-gradient(1000px 800px at 60% 0%, rgba(90,70,220,.55), transparent 60%),
  linear-gradient(135deg, #191338 0%, #2a1b6b 45%, #4b1d6e 70%, #1a1236 100%); background-attachment: fixed; }
.shell .topbar { background: rgba(10,10,30,.25); backdrop-filter: blur(6px); height: 48px; }
.topbar .logo { font: 700 19px var(--font-h); letter-spacing: -.3px; }
.topbar .logo span { font-weight: 400; opacity: .85; margin-left: 2px; }
.topbar .iconbtn.plain { background: transparent; }
.topbar .iconbtn.plain:hover { background: rgba(255,255,255,.12); }
.topbar .iconbtn.round { width: 30px; height: 30px; font-size: 13px; background: rgba(255,255,255,.18); }
.topbar .searchbox { display: flex; align-items: center; gap: 6px; height: 32px; width: 300px; border-radius: 6px; background: rgba(255,255,255,.14); padding: 0 10px; }
.topbar .searchbox input { flex: 1; background: transparent; border: 0; color: #fff; outline: none; font: inherit; }
.topbar .searchbox input::placeholder { color: rgba(255,255,255,.7); }
.statuspill { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 14px; background: rgba(255,255,255,.14); font-size: 13px; margin-left: 10px; }
.statuspill .dot { width: 9px; height: 9px; border-radius: 50%; background: #2ecc71; }
.bell-badge { position: absolute; top: 4px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: #ff6534; }
.topdrop { top: 46px; position: absolute; color: var(--text); z-index: 90; min-width: 220px; }
.shell .avatar { width: 30px; height: 30px; background: #c2185b; font-size: 13px; }
.shell .sidemenu { position: absolute; z-index: 60; top: 48px; bottom: 0; left: 0; width: 260px; background: rgba(18,16,40,.92); backdrop-filter: blur(10px); border: 0; color: #fff; padding: 10px 0; }
.shell .sidemenu.collapsed { width: 0; padding: 0; overflow: hidden; }
.shell .sidemenu .navsearch { display: flex; gap: 4px; padding: 0 10px 8px; }
.shell .sidemenu .navsearch input { flex: 1; height: 30px; border-radius: 6px; border: 0; background: rgba(255,255,255,.12); color: #fff; padding: 0 10px; }
.shell .sidemenu .navsearch .x { background: none; border: 0; color: #fff; font-size: 18px; cursor: pointer; }
.shell .wpselect { margin: 2px 10px 8px; width: calc(100% - 20px); height: 30px; background: transparent; color: #fff; border: 0; font: 500 14px var(--font); }
.shell .wpselect option { color: #000; }
.shell .sidemenu .item { color: #fff; padding: 9px 14px; }
.shell .sidemenu .item:hover { background: rgba(255,255,255,.08); }
.shell .sidemenu .item.active { background: rgba(255,255,255,.14); color: #fff; }
.shell .sidemenu .dot { width: 26px; height: 26px; border-radius: 6px; }
.shell .body { position: relative; }
.shell .main { padding: 10px 14px; }
.shell .main.desktop { padding: 30px 8% 30px; }
.home-dash.desk .label-h { color: #fff; }
.home-dash.desk [data-n="Main"] { grid-template-columns: repeat(10, minmax(35px, 1fr)) !important; }
.home-dash.desk [data-n="GreetingLabel"], .home-dash.desk div[style*="FFFFFF"] { color: #fff; }
.widget.glass { background: rgba(20,20,30,.82); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; backdrop-filter: blur(8px); }
.widget.glass .t { font-size: 13px; }
.widget.glass .v { font-size: 30px; font-weight: 500; }
.panel.glass { background: rgba(20,20,30,.82); color: #fff; border: 1px solid rgba(255,255,255,.12); }
.panel.glass .label-h { color: #fff; font-weight: 500; font-size: 14px; }
.big-greet { font: 300 34px var(--font-h); color: #fff; margin: 0 0 10px; }
.widget.fill { border: 1px solid rgba(255,255,255,.35); border-radius: 10px; }
.widget .v { font-weight: 500; }
