:root {
  --bg: #2B2B25;
  --panel: #3F3F37;
  --panel2: #494331;
  --line: #5A5748;
  --text: #D6D6B1;
  --muted: #B8B5A0;
  --orange: #E08020;
  --orange2: #F2A65A;
  --btn: #E08020;
  --btn-hover: #EE9232;
  --good: #7DBE72;
  --bad: #F58C94;
  --blue: #4aa3ff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--orange2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* Шапка: SoldbyK винаги най-отгоре по средата */
.brandbar { display: flex; flex-direction: column; align-items: center; padding: 10px 12px 8px; background: #23231E; border-bottom: 1px solid var(--line); }
.brandbar img { height: 92px; display: block; }
.brandbar .client { margin-top: 2px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.brandbar .client b { color: var(--text); font-weight: 600; }
/* Audit Log: горе вдясно, високо до логото */
.brandbar { position: relative; }
.topright { position: absolute; top: 10px; right: 18px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--orange); color: #23231E; font-weight: 700; font-size: 15px; letter-spacing: .5px; text-decoration: none; border: 2px solid transparent; transition: border-color .15s; }
.avatar:hover, .avatar.on { border-color: var(--orange2); }
.avatar:focus-visible { outline: 2px solid var(--orange2); outline-offset: 2px; }
button.avatar { padding: 0; cursor: pointer; font-family: inherit; }
.umenu { position: relative; }
.umenu-list { position: absolute; top: calc(100% + 8px); right: 0; min-width: 190px; padding: 6px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.45); z-index: 50; display: flex; flex-direction: column; gap: 2px; }
.umenu-list.hidden { display: none; }
.umenu-list a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); font-size: 14px; text-decoration: none; white-space: nowrap; }
.umenu-list a:hover, .umenu-list a.on { background: var(--panel2); color: var(--orange2); }
.umenu-list .sep { height: 1px; background: var(--line); margin: 4px 2px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.big { width: 84px; height: 84px; font-size: 30px; flex: none; cursor: default; }
.avrow { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.avbtns { margin: 8px 0 0; } .avbtns label.btn { cursor: pointer; display: inline-block; }
.auditlink { padding: 7px 14px; border: 1px solid var(--line2); border-radius: 10px; background: var(--panel); color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; transition: border-color .15s, background .15s; }
.auditlink:hover, .auditlink.on { border-color: var(--orange); background: var(--panel2); color: var(--text); }
.auditlink:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
@media (max-width: 640px) { .topright { top: 8px; right: 10px; gap: 6px; } .auditlink { padding: 5px 9px; font-size: 12.5px; } .avatar { width: 32px; height: 32px; font-size: 13px; } }

.shell { display: flex; min-height: calc(100vh - 130px); }
.side { width: 220px; background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px; flex-shrink: 0; position: sticky; top: 0; align-self: flex-start; height: calc(100vh - var(--hdr, 0px)); overflow-y: auto; display: flex; flex-direction: column; }
.side-bottom { margin-top: auto; padding-top: 8px; }
.side a.nav { display: block; padding: 9px 12px; border-radius: 8px; color: var(--muted); margin-bottom: 2px; }
.side a.nav:hover { background: var(--panel2); color: var(--text); }
.side a.nav.on { background: rgba(224,128,32,.14); color: var(--orange2); font-weight: 600; }
.side .sep { height: 1px; background: var(--line); margin: 12px 4px; }
.side .who { font-size: 13px; color: var(--muted); padding: 4px 12px; }
.main { flex: 1; min-width: 0; padding: 20px 22px 60px; }
h1 { margin: 0 0 14px; font-size: 22px; }
h2 { margin: 22px 0 10px; font-size: 16px; color: var(--muted); font-weight: 600; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat .v { font-size: 26px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat.good .v { color: var(--good); }
.stat.orange .v { color: var(--orange2); }

.btn { background: var(--btn); color: #23231E; border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--btn-hover); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--panel2); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(224,128,32,.5); border-color: var(--orange); }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 0 auto; width: auto; }
.row input[type=search], .row .grow { flex: 1 1 200px; }
.toolbar { margin-bottom: 14px; }
.toolbar select, .toolbar input { width: auto; min-width: 130px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel2); }
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel2); border: 1px solid var(--line); white-space: nowrap; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11px; background: var(--panel2); color: var(--muted); margin-right: 4px; }
.muted { color: var(--muted); }
.bad { color: var(--bad); }
.good { color: var(--good); }
.warn { color: #e0b341; }

/* Табло (канбан) */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: 260px; flex-shrink: 0; max-height: 72vh; display: flex; flex-direction: column; }
.col.over { outline: 2px dashed var(--orange); }
.col h3 { margin: 0; padding: 10px 12px; font-size: 13px; display: flex; justify-content: space-between; border-bottom: 3px solid var(--c, var(--line)); }
.col .cards { padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.lcard { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; cursor: pointer; }
.lcard:hover { border-color: var(--orange); }
.lcard .n { font-weight: 600; }
.lcard .s { font-size: 12px; color: var(--muted); }

/* Прозорец */
.modalbg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 12px; z-index: 50; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: min(720px, 100%); padding: 18px 20px; }
.modal h2 { margin-top: 0; color: var(--text); font-size: 19px; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.formgrid .full { grid-column: 1 / -1; }
.timeline { border-left: 2px solid var(--line); margin: 8px 0 0 6px; padding-left: 14px; }
.timeline .ev { margin-bottom: 10px; font-size: 13px; }
.timeline .ev .t { color: var(--muted); font-size: 12px; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #1E1E1A; border: 1px solid var(--orange); padding: 10px 16px; border-radius: 10px; z-index: 99; max-width: 90vw; }
.toast.err { border-color: var(--bad); }

/* Вход и избор на портал */
.center { max-width: 420px; margin: 40px auto; padding: 0 14px; }
.portals { display: grid; gap: 12px; }
.portal { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; color: var(--text); }
.portal:hover { border-color: var(--orange); }
.portal b { font-size: 18px; display: block; }
.portal span { color: var(--muted); font-size: 14px; }
.portal.off { opacity: .45; pointer-events: none; }
.err { color: var(--bad); margin-top: 8px; font-size: 14px; }
.bar { height: 8px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--orange); }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.tabs button.on { border-color: var(--orange); color: var(--orange2); }
pre.payload { background: var(--bg); border: 1px solid var(--line); padding: 8px; border-radius: 8px; overflow: auto; max-height: 160px; font-size: 12px; white-space: pre-wrap; word-break: break-all; }

@media (max-width: 800px) {
  .shell { flex-direction: column; }
  .side { position: static; height: auto; width: 100%; flex-direction: row; display: flex; gap: 4px; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side a.nav { white-space: nowrap; margin: 0; }
  .side .sep, .side .who { display: none; }
  .side-bottom { margin-top: 0; padding-top: 0; display: flex; gap: 4px; }
  .main { padding: 14px 12px 60px; }
  .formgrid { grid-template-columns: 1fr; }
  .brandbar img { height: 72px; }
}

/* ===== v2: оранжево, сиво и бели линии, по-интерактивно ===== */
:root {
  --bg: #2B2B25;
  --panel: #3F3F37;
  --panel2: #494331;
  --line: rgba(214,214,177,.18);
  --line2: rgba(214,214,177,.32);
  --muted: #B8B5A0;
}
html, body { background: var(--bg); }
.brandbar { background: #23231E; border-bottom: 1px solid var(--line); }
h1 { font-size: 28px; letter-spacing: -.01em; margin-bottom: 6px; }
h2 { color: #fff; opacity: .85; display: flex; align-items: center; gap: 8px; }

.side { padding: 18px 12px; background: var(--panel); border-right: 1px solid var(--line); }
.side a.nav { padding: 11px 14px; border-radius: 12px; margin-bottom: 4px; font-size: 15px; transition: background .15s, color .15s, transform .15s; }
.side a.nav:hover { transform: translateX(3px); background: rgba(255,255,255,.06); color: #fff; }
.side a.nav.on { background: rgba(224,128,32,.16); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.side .sep { background: var(--line); }

.card, .tablewrap, .col, .modal, .opencard { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.stat { transition: transform .15s, border-color .15s, box-shadow .15s; }
.stat:hover { transform: translateY(-3px); border-color: var(--orange); box-shadow: 0 10px 24px rgba(0,0,0,.4); }
.stat .v { font-size: 30px; }

input, select, textarea { border-radius: 12px; padding: 11px 13px; background: var(--panel); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--line2); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(224,128,32,.22); }
input[type=search] { padding-left: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23a3a8b0' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px center; }

.btn { border-radius: 12px; padding: 10px 18px; box-shadow: 0 6px 18px rgba(224,128,32,.28); transition: transform .12s, box-shadow .12s, background .12s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(224,128,32,.38); }
.btn:active { transform: translateY(0); }
.btn.ghost, .btn.danger { box-shadow: none; }
.btn.ghost { border-color: var(--line2); }

/* сегментирани бутони */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; transition: background .15s, color .15s; white-space: nowrap; }
.seg button:hover { color: #fff; background: rgba(255,255,255,.07); }
.seg button.on { background: var(--btn); color: #23231E; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.toolbar { gap: 12px; }

/* табло: цветни колони */
.col { transition: border-color .15s, background .15s; }
.col h3 { padding: 12px 14px; font-size: 14px; }
.col[data-group="lost"] { background: linear-gradient(180deg, rgba(229,97,79,.10), rgba(229,97,79,.03)); border-color: rgba(229,97,79,.40); }
.col[data-group="won"] { background: linear-gradient(180deg, rgba(76,193,111,.11), rgba(76,193,111,.03)); border-color: rgba(76,193,111,.45); }
.col[data-group="open"] { background: linear-gradient(180deg, rgba(224,128,32,.08), rgba(224,128,32,.02)); border-color: rgba(224,128,32,.30); }
.col[data-group="base"] { background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); }
.col.over { outline: 2px dashed var(--orange); background: rgba(224,128,32,.12); }
.lcard { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; transition: transform .15s, border-color .15s, box-shadow .15s, opacity .15s; }
.lcard:hover { transform: translateY(-2px); border-color: var(--orange); box-shadow: 0 10px 22px rgba(0,0,0,.45); }
.lcard.dragging { opacity: .4; transform: rotate(2deg) scale(.98); }
.lcard:active { cursor: grabbing; }

tr.click { transition: background .12s; }
tr.click:hover td { background: rgba(224,128,32,.08); }
th { border-bottom: 1px solid var(--line2); }
.badge, .tag { border-radius: 999px; }
.modal { box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.portal { border-radius: 18px; transition: transform .15s, border-color .15s, box-shadow .15s; }
.portal:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.45); }
@media (max-width: 800px) {
  .seg button { padding: 7px 10px; font-size: 14px; }
  h1 { font-size: 24px; }
}

/* ===== SaaS: начална страница, абонамент, стъпки ===== */
.banner { background: rgba(224,128,32,.12); border: 1px solid rgba(224,128,32,.45); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-size: 14.5px; }
.banner.bad { background: rgba(229,97,79,.12); border-color: rgba(229,97,79,.5); }
.banner.ok { background: rgba(76,193,111,.12); border-color: rgba(76,193,111,.5); }
.land { max-width: 1040px; margin: 0 auto; padding: 36px 20px 60px; }
.land.narrow { max-width: 720px; }
.land h2 { color: #fff; opacity: .95; margin: 26px 0 8px; }
.hero { text-align: center; padding: 28px 0 40px; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.1; margin: 0 auto 16px; max-width: 18ch; }
.hero .lead { color: var(--muted); font-size: 18px; max-width: 56ch; margin: 0 auto 26px; }
.btn.big { padding: 14px 26px; font-size: 16px; }
.center-h, .center-p { text-align: center; }
.grid.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.g2.plans { max-width: 640px; margin: 18px auto 0; }
.card p { margin: 8px 0 0; }
.plan { text-align: center; }
.plan.hot { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange) inset; }
.price { font-size: 38px; font-weight: 800; margin: 8px 0 16px; }
.price small { font-size: 15px; font-weight: 500; color: var(--muted); }
.foot { text-align: center; color: var(--muted); font-size: 14px; margin-top: 40px; }
.step { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; transition: border-color .15s; }
.step.done { border-color: rgba(76,193,111,.5); }
.stepno { flex: 0 0 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line2); display: grid; place-items: center; font-weight: 700; }
.step.done .stepno { background: var(--good); border-color: var(--good); color: #0e1a12; }
.stepbody { min-width: 0; flex: 1; }
.codebox { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.codebox code { flex: 1 1 260px; word-break: break-all; font-size: 13px; }
ol.plan { padding-left: 20px; }
ol.plan li { margin: 6px 0; }
.integ { margin-bottom: 16px; }
code { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .92em; }

.center-h { justify-content: center; }

/* Дублиран: червена значка в горния десен ъгъл на картата */
.lcard { position: relative; }
.dup-badge { position: absolute; top: 6px; right: 6px; z-index: 2; background: #e5262f; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 0 10px rgba(229,38,47,.75); animation: dupglow 1.8s ease-in-out infinite; }
.lcard:has(.dup-badge) .n { padding-right: 70px; }
.tag.dup { background: #e5262f; color: #fff; border: 1px solid #ff6b72; font-weight: 700; }
@keyframes dupglow { 0%, 100% { box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 0 6px rgba(229,38,47,.55); } 50% { box-shadow: 0 0 0 1px rgba(255,255,255,.35), 0 0 14px rgba(229,38,47,.95); } }

.timeline .ev { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Финанси */
.finbox { margin-top: 14px; }
.finbox h3 { margin: 0 0 8px; font-size: 17px; color: var(--text); }
.finbox .fh { margin: 0 0 10px; font-size: 13px; }
.fingrid { margin-bottom: 4px; }
.finpair { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-top: 14px; }
.finpair .finbox { margin-top: 0; }
.finlegend { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.finlegend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.findonut { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.fleg { display: grid; grid-template-columns: 14px 1fr auto 42px; gap: 8px; align-items: center; font-size: 14px; padding: 3px 0; }
.fleg span { width: 12px; height: 12px; border-radius: 3px; }
.fleg small { color: var(--muted); text-align: right; }
.finfun .fr { display: grid; grid-template-columns: 150px 1fr 120px; gap: 10px; align-items: center; margin: 7px 0; font-size: 14px; }
.finfun .fb { background: var(--panel2); border-radius: 6px; height: 22px; overflow: hidden; }
.finfun .fb span { display: block; height: 100%; border-radius: 6px; }
.finfun .fv small { display: block; color: var(--muted); font-size: 11px; }
@media (max-width: 640px) { .finfun .fr { grid-template-columns: 1fr; gap: 3px; } .finpair { grid-template-columns: 1fr; } }
.brandbar img { mix-blend-mode: lighten; }
/* правилата за логото не важат за снимката в аватара */
.brandbar .avatar img { height: 100%; width: 100%; mix-blend-mode: normal; }

/* Падащ списък вместо ред от бутони (период, месеци и т.н.) */
.dd { position: relative; display: inline-block; }
.ddbtn { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 190px; padding: 9px 14px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.ddbtn:hover, .dd.open .ddbtn { border-color: var(--orange); }
.ddbtn:focus-visible, .ddmenu button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.ddbtn .caret { color: var(--orange2); transition: transform .15s; }
.dd.open .ddbtn .caret { transform: rotate(180deg); }
.ddmenu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 100%; max-height: 60vh; overflow-y: auto; padding: 6px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 14px 30px rgba(0,0,0,.5); }
.ddmenu button { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--text); padding: 9px 12px; border-radius: 8px; font: inherit; cursor: pointer; white-space: nowrap; }
.ddmenu button:hover { background: rgba(224,128,32,.16); }
.ddmenu button.on { background: var(--btn); color: #23231E; font-weight: 700; }

/* Баджове на нивата (продуктите) и филтри на страницата „Клиенти“ */
.pbadge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.5; white-space: nowrap; color: var(--c); border: 1px solid var(--c); background: rgba(255,255,255,.06); background: color-mix(in srgb, var(--c) 16%, transparent); }
.lcard .s .pbadge { margin-right: 4px; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.chip { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: baseline; min-width: 150px; text-align: left; padding: 10px 14px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 12px; font: inherit; cursor: pointer; transition: transform .12s, border-color .12s, background .12s; }
.chip:hover { transform: translateY(-2px); border-color: var(--c); }
.chip.on { background: var(--panel2); border-color: var(--c); box-shadow: 0 0 0 1px var(--c) inset; }
.chip b { font-size: 20px; }
.chip small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Лийдове като групи (като в Monday): групите са една под друга, отварят се при натискане */
.mgroups { display: grid; gap: 10px; }
.mg { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 12px; overflow: hidden; }
.mgh { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; user-select: none; transition: background .12s; }
.mgh:hover, .mgh.over { background: rgba(214,214,177,.07); }
.mgh:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.mgh.over { box-shadow: 0 0 0 2px var(--c) inset; }
.mgh .caret { color: var(--c); font-size: 14px; transition: transform .15s; width: 14px; }
.mg.open .mgh .caret { transform: rotate(90deg); }
.mgt { font-weight: 700; font-size: 16px; color: var(--c); }
.mgn { background: var(--panel2); color: var(--text); border-radius: 999px; padding: 1px 10px; font-size: 13px; font-weight: 700; }
.mghint { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.mgb { border-top: 1px solid var(--line); }
.mgb .tablewrap { border: 0; border-radius: 0; background: transparent; }
.mgtable td { vertical-align: middle; }
.mgtable tr.dragging { opacity: .45; }
.mgname { font-weight: 600; }
.mgsel { width: auto; min-width: 150px; padding: 5px 8px; font-size: 13px; border-radius: 8px; }
.mgmore { padding: 8px 14px 12px; margin: 0; }
.mgempty { margin: 4px 2px 0; font-size: 13px; }

/* Срок на изпълнение */
.due { display: inline-block; padding: 1px 8px; border-radius: 8px; font-size: 12.5px; white-space: nowrap; border: 1px solid var(--line); }
.due.warn { color: var(--orange2); border-color: var(--orange); background: rgba(224,128,32,.12); }
.due.bad { color: var(--bad); border-color: var(--bad); background: rgba(245,140,148,.1); }
.due.muted { color: var(--muted); }
.quickdue { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chips .chip.scope { min-width: 0; grid-template-columns: auto auto; border-top-width: 1px; padding: 7px 14px; }

/* Избор на етикети за експорта за Mobica */
.mbtags { max-height: 190px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 2px; background: var(--panel2); }
.mbtags.off { opacity: .45; }
.mbtag { display: flex; align-items: center; gap: 8px; margin: 0; padding: 3px 4px; border-radius: 6px; cursor: pointer; color: var(--text); font-size: 14px; }
.mbtag:hover { background: rgba(224,128,32,.12); }
.mbtag small { margin-left: auto; }

/* ===== v3 VIP: тъмен, топъл, с оранжево и златно; само изглед ===== */
:root {
  --bg: #24241F;
  --panel: #34342C;
  --panel2: #403B2D;
  --line: rgba(214,214,177,.13);
  --line2: rgba(214,214,177,.26);
  --gold: #F2C14E;
  --lift: 0 1px 0 rgba(255,255,255,.05) inset, 0 12px 32px rgba(0,0,0,.32);
  --ease: cubic-bezier(.2,.7,.2,1);
}
html { scrollbar-color: #5A5748 transparent; scrollbar-width: thin; }
body {
  background:
    radial-gradient(1100px 520px at 50% -140px, rgba(224,128,32,.17), transparent 70%),
    radial-gradient(800px 500px at 100% 100%, rgba(242,193,78,.05), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(224,128,32,.45); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(214,214,177,.2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(224,128,32,.55); background-clip: padding-box; }

/* шапка: по-тясна, със златно-оранжева нишка отдолу */
.brandbar { padding: 8px 12px 7px; background: linear-gradient(180deg, #1C1C18, #22221D); border-bottom: 0; position: relative; }
.brandbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(224,128,32,.7) 30%, rgba(242,193,78,.9) 50%, rgba(224,128,32,.7) 70%, transparent); }
.brandbar img { height: 66px; }
.brandbar .client { letter-spacing: .22em; font-size: 11px; opacity: .85; }
.avatar { background: linear-gradient(135deg, #F2A65A, #E08020); box-shadow: 0 0 0 2px #1C1C18, 0 0 0 3.5px rgba(242,193,78,.75), 0 6px 16px rgba(0,0,0,.5); border: 0; }
.avatar:hover, .avatar.on { box-shadow: 0 0 0 2px #1C1C18, 0 0 0 3.5px var(--gold), 0 0 18px rgba(242,193,78,.45); }
.avatar.big { box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px rgba(242,193,78,.8), 0 10px 26px rgba(0,0,0,.5); }
.auditlink { background: rgba(255,255,255,.04); border-radius: 12px; }
.umenu-list { background: linear-gradient(180deg, #3B3A31, #302F28); border-radius: 14px; box-shadow: 0 22px 50px rgba(0,0,0,.6), 0 0 0 1px rgba(242,193,78,.12); animation: pop .16s var(--ease); }
.umenu-list a { transition: background .12s, color .12s, padding-left .12s; }
.umenu-list a:hover { padding-left: 16px; }

/* меню отляво */
.side { background: linear-gradient(180deg, #2C2C26, #272722); border-right: 1px solid var(--line); box-shadow: 8px 0 30px rgba(0,0,0,.18); }
.side a.nav { color: #C9C6AE; font-weight: 500; letter-spacing: .005em; }
.side a.nav:hover { background: rgba(255,255,255,.055); transform: translateX(2px); color: #fff; }
.side a.nav.on { background: linear-gradient(90deg, rgba(224,128,32,.26), rgba(224,128,32,.06)); box-shadow: inset 3px 0 0 var(--orange), 0 0 0 1px rgba(224,128,32,.18) inset; color: #fff; font-weight: 600; }
.side .who { color: #8F8C78; font-size: 12.5px; line-height: 1.4; }

/* основно съдържание */
.main { padding: 26px 30px 70px; max-width: 1500px; animation: pagein .28s var(--ease); }
@keyframes pagein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 18px; color: #F4F3E4; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); opacity: 1; font-weight: 700; margin: 28px 0 12px; }
h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); }
.modal h2 { text-transform: none; letter-spacing: 0; font-size: 19px; color: var(--text); }
.modal h2::after, .land h2::after, .finbox h3::after { display: none; }

/* карти и таблици */
.card, .tablewrap, .col, .modal, .opencard, .mg {
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0) 40%), var(--panel);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--lift);
}
.mg { border-left: 4px solid var(--c); }
.stat { position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--orange), transparent); opacity: .8; }
.stat .v { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.stat .l { text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; font-weight: 600; }
.stat.orange .v { color: #F7B25E; }
.stat.good .v { color: #8FD684; }
.stat:hover { box-shadow: 0 16px 36px rgba(0,0,0,.45), 0 0 0 1px rgba(224,128,32,.45); }
.plan.hot { box-shadow: 0 0 0 1px var(--gold) inset, 0 16px 40px rgba(242,193,78,.12); border-color: var(--gold); }

th { background: rgba(0,0,0,.14); font-size: 11.5px; letter-spacing: .1em; padding: 11px 12px; color: #A9A68F; }
td { padding: 11px 12px; }
tbody tr:nth-child(even) td { background: rgba(255,255,255,.018); }
tr.click:hover td, .mgtable tr:hover td { background: rgba(224,128,32,.1); }
tbody tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }

/* бутони и полета */
.btn { background: linear-gradient(180deg, #F29A3A, #DB7C1C); color: #1E1C16; font-weight: 700; letter-spacing: .01em; box-shadow: 0 8px 22px rgba(224,128,32,.3), 0 1px 0 rgba(255,255,255,.35) inset; }
.btn:hover { background: linear-gradient(180deg, #F7A64B, #E5851F); box-shadow: 0 12px 28px rgba(224,128,32,.42), 0 1px 0 rgba(255,255,255,.4) inset; }
.btn.ghost { background: rgba(255,255,255,.03); color: var(--text); box-shadow: none; }
.btn.ghost:hover { background: rgba(255,255,255,.08); border-color: var(--orange); transform: translateY(-1px); box-shadow: none; }
.btn.danger { background: transparent; box-shadow: none; }
.btn.danger:hover { background: rgba(245,140,148,.1); box-shadow: none; }
.seg { background: rgba(0,0,0,.22); border-radius: 14px; }
.seg button.on, .ddmenu button.on { background: linear-gradient(180deg, #F29A3A, #DB7C1C); box-shadow: 0 4px 12px rgba(224,128,32,.35); }
input, select, textarea { background: rgba(0,0,0,.18); }
input:focus, select:focus, textarea:focus { background: rgba(0,0,0,.26); }
.ddbtn { background: rgba(255,255,255,.04); }
.ddmenu { background: linear-gradient(180deg, #3B3A31, #302F28); box-shadow: 0 22px 50px rgba(0,0,0,.6); border-radius: 14px; animation: pop .14s var(--ease); }

/* етикети, баджове, групи */
.badge { background: rgba(255,255,255,.06); letter-spacing: .01em; }
.mg { transition: box-shadow .2s; }
.mg.open { box-shadow: 0 18px 44px rgba(0,0,0,.4); }
.mgh { padding: 14px 18px; }
.chip { background: linear-gradient(180deg, rgba(255,255,255,.04), transparent), var(--panel); border-radius: 14px; box-shadow: var(--lift); }
.chip.on { box-shadow: 0 0 0 1px var(--c) inset, 0 12px 28px rgba(0,0,0,.4); }
.lcard { background: linear-gradient(180deg, rgba(255,255,255,.04), transparent), var(--panel2); }
.portal { background: linear-gradient(180deg, rgba(255,255,255,.04), transparent), var(--panel); box-shadow: var(--lift); }
.portal:hover { border-color: var(--orange); box-shadow: 0 18px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(224,128,32,.4); }
.modalbg { background: rgba(10,10,8,.72); backdrop-filter: blur(5px); }
.modal { box-shadow: 0 40px 100px rgba(0,0,0,.7), 0 0 0 1px rgba(242,193,78,.1); }
.toast { background: linear-gradient(180deg, #2B2A24, #1E1E1A); box-shadow: 0 16px 40px rgba(0,0,0,.55); border-radius: 12px; }
.banner { border-radius: 14px; }
.bar { height: 10px; background: rgba(0,0,0,.28); }
.bar > i { background: linear-gradient(90deg, #E08020, #F2C14E); border-radius: 6px; }
.finfun .fb { background: rgba(0,0,0,.25); }
.step.done { box-shadow: 0 0 0 1px rgba(125,190,114,.25) inset; }
:focus-visible { outline-color: var(--gold); }

@media (max-width: 800px) {
  .main { padding: 16px 14px 60px; }
  .brandbar img { height: 54px; }
  h1 { font-size: 25px; }
  .side { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Лого на Вътрешно сияние: светла квадратна снимка, без смесване с тъмния фон */
.brandbar img { mix-blend-mode: normal; border-radius: 12px; height: 84px; }
@media (max-width: 700px) { .brandbar img { height: 64px; } }
