/* ===== Mera design system: navy + cream + orange ===== */
:root {
  --navy-950:#050d1f; --navy-900:#0b1b3a; --navy-850:#0f2246; --navy-800:#13284f; --navy-700:#1c3666;
  --cream:#f4f1ea; --muted:#9aa8c4; --line:rgba(244,241,234,.09); --line-2:rgba(244,241,234,.16);
  --brand:#ff7a1a; --brand-2:#ff9a4d;
}
html { scroll-behavior:smooth; color-scheme:dark; }
::selection { background:var(--brand); color:#0b1b3a; }
input, textarea { caret-color:var(--brand); }
:focus-visible { outline:2px solid var(--brand); outline-offset:3px; border-radius:6px; }
a { text-underline-offset:4px; }
.tabular-nums, td { font-variant-numeric:tabular-nums; }
.font-display { letter-spacing:-.01em; }
.tracking-brand { letter-spacing:.32em; }

/* scrollbars */
* { scrollbar-width:thin; scrollbar-color:rgba(244,241,234,.18) transparent; }
*::-webkit-scrollbar { width:8px; height:8px; }
*::-webkit-scrollbar-thumb { background:rgba(244,241,234,.16); border-radius:8px; }

/* surfaces */
.card { background:linear-gradient(180deg, rgba(28,54,102,.55), rgba(15,34,70,.55)); border:1px solid var(--line); border-radius:18px; }
.card-solid { background:var(--navy-850); border:1px solid var(--line); border-radius:18px; }
.glass { background:rgba(11,27,58,.55); border:1px solid var(--line); backdrop-filter:blur(14px); }
.muted { color:var(--muted); }
.hairline { border-color:var(--line); }

/* forms */
.field { display:block; width:100%; border:1px solid var(--line-2); border-radius:12px; padding:.65rem .85rem; background:rgba(5,13,31,.55); color:var(--cream); font-size:.95rem; transition:border-color .15s, box-shadow .15s, background .15s; }
.field::placeholder { color:rgba(154,168,196,.7); }
.field:focus { outline:none; border-color:var(--brand); box-shadow:0 0 0 3px rgba(255,122,26,.18); background:rgba(5,13,31,.8); }
select.field option { background:#0b1b3a; color:var(--cream); }
.field[type=file] { padding:.5rem; }
.field[type=file]::file-selector-button { border:0; border-radius:8px; background:var(--brand); color:#0b1b3a; font-weight:700; padding:.4rem .8rem; margin-right:.8rem; cursor:pointer; }
.lbl { display:block; font-size:.78rem; font-weight:700; color:var(--muted); margin-bottom:.4rem; letter-spacing:.02em; }

/* buttons */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:.45rem; border-radius:12px; padding:.6rem 1.05rem; font-weight:700; font-size:.9rem; transition:background .15s, transform .08s, box-shadow .2s, border-color .15s; white-space:nowrap; }
.btn:active { transform:translateY(1px); }
.btn svg { width:1.05em; height:1.05em; }
.btn-brand { background:linear-gradient(135deg,#ff9a4d,#ff7a1a 50%,#e85d00); color:#0b1b3a; box-shadow:0 8px 24px -8px rgba(255,122,26,.6); }
.btn-brand:hover { box-shadow:0 10px 30px -6px rgba(255,122,26,.8); }
.btn-ghost { background:rgba(244,241,234,.05); border:1px solid var(--line-2); color:var(--cream); }
.btn-ghost:hover { background:rgba(244,241,234,.1); }
.btn-cream { background:var(--cream); color:#0b1b3a; } .btn-cream:hover { background:#fff; }
.btn-danger { background:rgba(255,92,122,.08); border:1px solid rgba(255,92,122,.35); color:#ff8fa3; }
.btn-danger:hover { background:rgba(255,92,122,.16); }
.btn-sm { padding:.4rem .7rem; font-size:.8rem; border-radius:10px; }
.icon-btn { display:inline-flex; align-items:center; justify-content:center; width:2.2rem; height:2.2rem; border-radius:10px; color:var(--muted); transition:background .15s,color .15s; }
.icon-btn:hover { background:rgba(244,241,234,.08); color:var(--cream); }

/* chips & badges */
.chip { display:inline-flex; align-items:center; gap:.3rem; border-radius:999px; padding:.18rem .6rem; font-size:.72rem; font-weight:700; background:rgba(244,241,234,.07); color:#cfd7e8; border:1px solid var(--line); }
.tag { display:inline-flex; align-items:center; border-radius:6px; padding:.1rem .45rem; font-size:.7rem; font-weight:700; background:rgba(255,122,26,.12); color:#ffb27a; }
.score { display:inline-flex; align-items:center; justify-content:center; min-width:2.5rem; height:1.75rem; padding:0 .5rem; border-radius:9px; font-weight:800; font-size:.82rem; font-variant-numeric:tabular-nums; }
.score-hi { background:rgba(47,211,138,.16); color:#5ff0a8; box-shadow:inset 0 0 0 1px rgba(47,211,138,.35); }
.score-mid { background:rgba(255,176,32,.14); color:#ffc25c; box-shadow:inset 0 0 0 1px rgba(255,176,32,.35); }
.score-lo { background:rgba(255,92,122,.14); color:#ff8fa3; box-shadow:inset 0 0 0 1px rgba(255,92,122,.35); }
.score-na { background:rgba(244,241,234,.06); color:var(--muted); }

/* checkbox tiles */
.check { display:flex; align-items:center; gap:.6rem; padding:.7rem .85rem; border:1px solid var(--line-2); border-radius:12px; background:rgba(5,13,31,.4); cursor:pointer; font-size:.9rem; transition:all .15s; }
.check:hover { border-color:rgba(255,122,26,.5); }
.check:has(input:checked) { border-color:var(--brand); background:rgba(255,122,26,.1); }
.check input { accent-color:var(--brand); width:1rem; height:1rem; }
.lic { display:inline-flex; position:relative; }
.lic input { position:absolute; opacity:0; pointer-events:none; }
.lic span { display:inline-flex; min-width:3.4rem; justify-content:center; padding:.6rem .8rem; border:1px solid var(--line-2); border-radius:12px; font-weight:800; cursor:pointer; background:rgba(5,13,31,.4); transition:all .15s; font-family:Unbounded, sans-serif; font-size:.85rem; }
.lic span:hover { border-color:rgba(255,122,26,.6); }
.lic input:checked + span { background:var(--brand); color:#0b1b3a; border-color:var(--brand); box-shadow:0 6px 18px -6px rgba(255,122,26,.7); }
.lic input:focus-visible + span { box-shadow:0 0 0 3px rgba(255,122,26,.45); }

/* tables */
.tbl th { text-align:left; font-size:.7rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:700; padding:.7rem .9rem; border-bottom:1px solid var(--line); white-space:nowrap; }
.tbl td { padding:.75rem .9rem; border-bottom:1px solid var(--line); font-size:.88rem; vertical-align:middle; }
.tbl tbody tr { transition:background .12s; }
.tbl tbody tr:hover td { background:rgba(244,241,234,.035); }

/* ===== amoCRM-like panel ===== */
.app-bg { background:
  radial-gradient(1200px 600px at 80% -10%, rgba(255,122,26,.10), transparent 60%),
  radial-gradient(900px 600px at -10% 110%, rgba(42,74,133,.45), transparent 60%),
  linear-gradient(180deg,#0b1b3a,#071330); }
.side-link { display:flex; flex-direction:column; align-items:center; gap:.25rem; padding:.6rem .2rem; border-radius:12px; color:#8fa0c2; font-size:.66rem; font-weight:700; transition:all .15s; position:relative; }
.side-link svg { width:1.35rem; height:1.35rem; }
.side-link:hover { color:var(--cream); background:rgba(244,241,234,.06); }
.side-link.active { color:var(--cream); background:rgba(255,122,26,.12); }
.side-link.active::before { content:""; position:absolute; left:-.55rem; top:22%; bottom:22%; width:3px; border-radius:3px; background:var(--brand); }
.side-badge { position:absolute; top:.25rem; right:.55rem; min-width:1.05rem; height:1.05rem; border-radius:999px; background:var(--brand); color:#0b1b3a; font-size:.6rem; display:flex; align-items:center; justify-content:center; padding:0 .25rem; }

/* kanban */
.board { display:flex; gap:12px; overflow-x:auto; padding-bottom:12px; align-items:flex-start; min-height:calc(100vh - 170px); }
.col { flex:0 0 280px; display:flex; flex-direction:column; max-height:calc(100vh - 170px); }
.col-head { padding:.75rem .85rem .7rem; border-radius:14px 14px 0 0; background:rgba(11,27,58,.75); border:1px solid var(--line); border-bottom:0; position:relative; }
.col-head::after { content:""; position:absolute; left:0; right:0; bottom:0; height:3px; background:var(--stage); border-radius:3px; }
.col-body { flex:1; overflow-y:auto; padding:.6rem; border:1px solid var(--line); border-top:0; border-radius:0 0 14px 14px; background:rgba(5,13,31,.35); min-height:120px; }
.col-body.drag-over { background:rgba(255,122,26,.06); }
.kcard { display:block; background:linear-gradient(180deg,#14294f,#102244); border:1px solid var(--line); border-radius:12px; padding:.7rem .75rem; margin-bottom:.55rem; cursor:grab; transition:border-color .15s, transform .15s, box-shadow .15s; }
.kcard:hover { border-color:rgba(255,122,26,.45); transform:translateY(-1px); box-shadow:0 10px 24px -14px rgba(0,0,0,.8); }
.kcard.sortable-ghost { opacity:.35; }
.kcard.sortable-chosen { cursor:grabbing; box-shadow:0 18px 40px -12px rgba(0,0,0,.9); border-color:var(--brand); }

/* feed */
.feed-item { position:relative; padding-left:2.6rem; }
.feed-item::before { content:""; position:absolute; left:1.05rem; top:0; bottom:-1rem; width:1px; background:var(--line); }
.feed-dot { position:absolute; left:.3rem; top:.1rem; width:1.55rem; height:1.55rem; border-radius:999px; display:flex; align-items:center; justify-content:center; background:var(--navy-800); border:1px solid var(--line-2); }
.feed-dot svg { width:.8rem; height:.8rem; }

/* stage progress (как в карточке amoCRM) */
.stages { display:flex; gap:3px; }
.stages button { flex:1; height:6px; border-radius:3px; background:rgba(244,241,234,.1); transition:background .2s, transform .15s; }
.stages button:hover { transform:scaleY(1.6); }

/* reveal animation helpers */
.reveal { opacity:0; transform:translateY(28px); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity:1; transform:none; } * { animation:none !important; transition:none !important; } }

@keyframes floaty { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-10px) } }
@keyframes pulse-ring { 0% { box-shadow:0 0 0 0 rgba(255,122,26,.55) } 100% { box-shadow:0 0 0 14px rgba(255,122,26,0) } }
.pulse-dot { animation:pulse-ring 1.8s ease-out infinite; }
