:root { --ice: #E8EEF3; --mist: #C9D6E2; --steel: #8FA8BF; --deep: #3E5468; --night: #16202B; --ink: #14202B; --ink2: #5A6B7B; --line: #D7E0E8; --ok: #2F6F8F; --cond: 'Sofia Sans Extra Condensed', 'Arial Narrow', sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--ice); color: var(--ink); font: 16px/1.45 'Sofia Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--deep); }
.login { min-height: 100svh; display: grid; place-items: center; padding: 16px; background: var(--night); }
.login__box { width: min(100%, 360px); background: #fff; border-radius: 20px; padding: 28px; display: grid; gap: 14px; justify-items: center; }
.login__box img { border-radius: 50%; }
.login__box h1 { font: 800 34px/1 var(--cond); text-transform: uppercase; margin: 0; }
.login__box label { width: 100%; }
.login__err { color: var(--deep); font-weight: 600; margin: 0; min-height: 1.4em; }

.app { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: rgba(232,238,243,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top__title { font: 800 28px/1 var(--cond); text-transform: uppercase; }
.top__site { font-size: 14px; font-weight: 600; text-decoration: none; }
.tabs { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--night); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { position: relative; border: 0; background: none; color: rgba(255,255,255,.62); padding: 10px 2px 9px; display: grid; justify-items: center; gap: 2px; font-size: 12px; cursor: pointer; }
.tabs button i { font-style: normal; font-size: 20px; line-height: 1; }
.tabs button[aria-current] { color: #fff; }
.tabs em { position: absolute; top: 4px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #fff; color: var(--night); font: 700 11px/18px sans-serif; font-style: normal; }
@media (min-width: 900px) {
  .app { padding: 0 0 0 220px; }
  .tabs { top: 0; right: auto; width: 220px; grid-template-columns: 1fr; align-content: start; padding: 72px 12px 0; gap: 4px; }
  .tabs button { grid-template-columns: 28px 1fr; justify-items: start; align-items: center; font-size: 16px; padding: 12px; border-radius: 10px; }
  .tabs button[aria-current] { background: rgba(255,255,255,.1); }
  .tabs em { position: static; margin-left: 6px; }
}
.main { padding: 16px; max-width: 880px; }
.bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.hint { color: var(--ink2); font-size: 14px; margin: 0 0 14px; }
.b { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 12px; border: 0; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); }
.b--main { background: var(--night); color: #fff; box-shadow: none; }
.b--wide { width: 100%; }
.b--quiet { background: none; box-shadow: none; color: var(--deep); padding: 0 8px; }
.b--danger { color: var(--deep); box-shadow: inset 0 0 0 1.5px var(--steel); }
.b:disabled { opacity: .5; cursor: default; }

.list { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: #fff; border-radius: 14px; padding: 10px; cursor: pointer; border: 0; text-align: left; width: 100%; }
.item__thumb { width: 54px; height: 96px; border-radius: 8px; object-fit: cover; background: var(--mist); }
.item__thumb--sq { height: 54px; display: grid; place-items: center; font: 800 22px var(--cond); color: var(--deep); }
.item b { display: block; font-size: 16px; line-height: 1.3; }
.item small { color: var(--ink2); font-size: 13px; }
.item__side { display: grid; gap: 6px; justify-items: end; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--ice); color: var(--deep); }
.chip--pub { background: var(--night); color: #fff; }
.chip--proc { background: var(--mist); }
.chip--err { box-shadow: inset 0 0 0 1px var(--deep); background: #fff; }
.star { font-size: 20px; color: var(--steel); }
.star.on { color: var(--night); }
.empty { background: #fff; border-radius: 14px; padding: 24px; text-align: center; color: var(--ink2); }

.f { display: grid; gap: 14px; }
.f label, .fld { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.f label small, .fld small { font-weight: 400; color: var(--ink2); }
.f input:not([type=checkbox]):not([type=radio]):not([type=file]), .f select, .f textarea, .login input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 16px; font-weight: 400; }
.f textarea { min-height: 96px; resize: vertical; }
.f input:focus, .f textarea:focus, .f select:focus { outline: none; border-color: var(--deep); }
.check { display: flex !important; grid-template-columns: none; align-items: center; gap: 10px; font-weight: 500 !important; font-size: 16px !important; }
.check input { width: 22px; height: 22px; accent-color: var(--night); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { display: flex; gap: 0; }
.seg input { position: absolute; opacity: 0; }
.seg span { padding: 9px 14px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600; cursor: pointer; }
.seg input:checked + span { background: var(--night); color: #fff; box-shadow: none; }
.seg input:focus-visible + span { outline: 2px solid var(--deep); }
.group { background: #fff; border-radius: 14px; padding: 16px; display: grid; gap: 14px; }
.group h3 { margin: 0; font: 800 22px/1 var(--cond); text-transform: uppercase; }
.row2 { display: grid; gap: 12px; }
@media (min-width: 600px) { .row2 { grid-template-columns: 1fr 1fr; } }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos figure { margin: 0; position: relative; }
.photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.photos button { position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(22,32,43,.8); color: #fff; cursor: pointer; }
.pick { display: grid; gap: 6px; max-height: 260px; overflow: auto; padding: 4px; background: var(--ice); border-radius: 12px; }

.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(22,32,43,.5); display: grid; align-items: end; }
.sheet__box { background: var(--ice); border-radius: 20px 20px 0 0; max-height: 92svh; overflow: auto; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 900px) { .sheet { place-items: center; } .sheet__box { width: 640px; border-radius: 20px; } }
.sheet__head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--ice); border-bottom: 1px solid var(--line); }
.sheet__head b { font: 800 24px/1 var(--cond); text-transform: uppercase; }
.x { border: 0; background: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.sheet__body { padding: 16px; }
.sheet__foot { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 0 4px; background: linear-gradient(transparent, var(--ice) 30%); }
.sheet__foot .b--main { flex: 1; }
.prog { height: 8px; border-radius: 4px; background: var(--mist); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--night); transition: width .2s; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0; background: var(--night); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; transition: .25s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #fff; color: var(--ink); box-shadow: 0 0 0 2px var(--deep); }

.lead { background: #fff; border-radius: 14px; padding: 14px; display: grid; gap: 6px; }
.lead--new { box-shadow: inset 4px 0 0 var(--night); }
.lead dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 15px; }
.lead dt { color: var(--ink2); }
.lead dd { margin: 0; word-break: break-word; }
.lead__top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.lead__acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 600px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: #fff; border-radius: 14px; padding: 14px; }
.kpi b { display: block; font: 800 40px/1 var(--cond); }
.kpi small { color: var(--ink2); }
.bars { display: flex; align-items: end; gap: 3px; height: 120px; background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.bars i { flex: 1; background: var(--steel); border-radius: 3px 3px 0 0; min-height: 2px; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.tbl td, .tbl th { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--ice); font-size: 15px; }
.tbl td:last-child, .tbl th:last-child { text-align: right; }
.menu { display: grid; gap: 10px; }
.menu button { justify-content: space-between; min-height: 60px; font-size: 17px; }
