@font-face{font-family:"Inter";font-weight:100 900;font-style:normal;font-display:swap;
  src:url("../fonts/inter-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Inter";font-weight:100 900;font-style:normal;font-display:swap;
  src:url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root{
  --bg:#f7f7f9; --fg:#0a0a0a; --muted:#717182; --border:rgba(0,0,0,.1);
  --input:#f3f3f5; --primary:#7dd3fc; --primary-h:#5fc6f8; --primary-fg:#082f49; --accent:#38bdf8;
  --ok-bg:#dcfce7; --ok-fg:#166534; --err-bg:#fee2e2; --err-fg:#b91c1c;
  --warn-bg:#e0f2fe; --warn-fg:#0369a1; --info-bg:#dbeafe; --info-fg:#1e40af; --neu-bg:#f1f5f9; --neu-fg:#475569;
}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--fg);font:400 14px/20px "Inter",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;-webkit-font-smoothing:antialiased}
button,input{font:inherit;color:inherit}
button{cursor:pointer}
.ic{flex:none;display:block}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;color:var(--muted)}
.muted{color:var(--muted)}

/* ---------- кнопки ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:36px;padding:0 16px;border-radius:8px;border:1px solid transparent;font-weight:500;white-space:nowrap;background:var(--primary);color:var(--primary-fg);transition:background .12s}
.btn:hover{background:var(--primary-h)}
.btn.sm{height:32px;padding:0 12px}
.btn.outline{background:#fff;border-color:var(--border);color:var(--fg)}
.btn.outline:hover{background:#f6f6f8}
.btn.excel{color:#15803d;border-color:#bbf7d0}
.btn.excel:hover{background:#f0fdf4}
.btn.block{width:100%}
.btn:disabled{opacity:.55;cursor:default}
.btn:focus-visible,.tab:focus-visible,.icon-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;border:0;background:transparent;color:var(--fg)}
.icon-btn:hover{background:#f1f1f4}

/* ---------- бейджи ---------- */
.badge{display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border-radius:6px;font-size:12px;line-height:16px;font-weight:500;white-space:nowrap}
.badge.ok{background:var(--ok-bg);color:var(--ok-fg)} .badge.err{background:var(--err-bg);color:var(--err-fg)}
.badge.warn{background:var(--warn-bg);color:var(--warn-fg)} .badge.info{background:var(--info-bg);color:var(--info-fg)}
.badge.neu{background:var(--neu-bg);color:var(--neu-fg)}
.spin{width:10px;height:10px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:rot .8s linear infinite}
@keyframes rot{to{transform:rotate(360deg)}}

/* ---------- каркас приложения ---------- */
.app{max-width:1024px;margin:16px auto;background:#fff;border:1px solid var(--border);border-radius:16px;overflow:hidden}
.app-header{display:flex;align-items:center;border-bottom:1px solid var(--border);height:45px}
.logo{display:flex;align-items:center;gap:8px;padding:0 16px;height:100%;border-right:1px solid var(--border);font-weight:600}
.logo i{width:16px;height:16px;border-radius:4px;background:var(--primary);display:block}
.tabs{display:flex;padding:0 8px;flex:1;align-self:stretch;align-items:flex-end}
.tab{height:40px;padding:0 16px;border:0;border-bottom:2px solid transparent;background:none;font-size:12px;line-height:16px;font-weight:500;color:var(--muted);margin-bottom:-1px}
.tab:hover{color:var(--fg)}
.tab.active{color:var(--fg);border-bottom-color:var(--accent)}
.user{display:flex;align-items:center;gap:12px;padding:0 16px;font-size:12px;color:var(--muted)}
.app-body{padding:16px}
.page-title{font-size:14px;font-weight:500;margin:4px 0 16px}

.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}
.metric{border:1px solid var(--border);border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:2px}
.metric span{font-size:12px;line-height:16px;color:var(--muted)}
.metric b{font-size:24px;line-height:30px;font-weight:600;color:var(--fg)}

.panel{border:1px solid var(--border);border-radius:14px;overflow:hidden;margin-bottom:16px;background:#fff}
.panel-head{display:flex;align-items:center;justify-content:space-between;padding:0 16px;height:56px;border-bottom:1px solid var(--border)}
.panel-head h3,.panel-title{margin:0;font-size:14px;font-weight:500}
.panel-actions{display:flex;gap:12px;align-items:center}
.dz-inline{display:flex;align-items:center;gap:8px;height:32px;padding:0 12px;border:1px dashed rgba(0,0,0,.25);border-radius:8px;font-size:12px;color:var(--muted);background:#fff;cursor:pointer}
.dz-inline u{text-underline-offset:2px}
.dz-inline.drag,.dropzone.drag{border-color:var(--accent);background:#f0f9ff}

table{border-collapse:collapse;width:100%}
.q-table{table-layout:fixed}
.q-table th{font-weight:500;text-align:left;padding:14px 8px;font-size:14px}
.q-table td{padding:0 8px;height:49px;border-top:1px solid var(--border)}
.q-table th:first-child,.q-table td:first-child{padding-left:8px}
.q-table td.num,.q-table th.num{text-align:center}
.q-table tbody tr:first-child td{border-top:1px solid var(--border)}
.q-table .sum{font-weight:500}
.q-table .actions{display:flex;gap:8px;align-items:center;justify-content:flex-start}
.q-table tr.new td{animation:flash 1.6s ease-out}
@keyframes flash{from{background:#f0f9ff}to{background:transparent}}

/* ---------- аналитика ---------- */
.chart{display:flex;align-items:flex-end;gap:8px;height:96px;padding:0 16px 16px}
.chart .col{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:4px;font-size:10px;color:var(--muted)}
.chart .bar{width:100%;background:var(--primary);border-radius:3px 3px 0 0}
.chart .col span{line-height:12px}
.panel-pad{padding:16px 16px 0}
.an-table th{font-weight:500;text-align:left;padding:12px 8px;font-size:14px}
.an-table td{padding:0 8px;height:37px;border-top:1px solid var(--border);color:var(--muted)}
.an-table td:first-child{color:var(--fg)} .an-table td.b{color:var(--fg);font-weight:500}
.an-table th:first-child,.an-table td:first-child{padding-left:16px}

/* ---------- настройки ---------- */
.subtabs{display:flex;border-bottom:1px solid var(--border);margin-bottom:16px}
.subtabs .tab{margin-bottom:-1px}
.hint{font-size:12px;color:var(--muted);margin:-4px 0 12px}
.card{border:1px solid var(--border);border-radius:14px;padding:16px;margin-bottom:12px;background:#fff}
.card h4{margin:0;font-size:14px;font-weight:500}
.card p{margin:0 0 12px;font-size:12px;line-height:16px;color:var(--muted)}
.dropzone{border:1.5px dashed rgba(0,0,0,.18);border-radius:10px;height:100px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:12px;color:var(--muted);cursor:pointer;margin-bottom:12px;text-align:center}
.dropzone .ic{margin-bottom:6px}
.dropzone a{color:#0284c7;text-decoration:underline;text-underline-offset:2px}
.dropzone small{font-size:11px;opacity:.85}
.dropzone.done{border-style:solid;border-color:#bbf7d0;background:#f0fdf4;color:#166534}
.form-card{border:1px solid var(--border);border-radius:14px;margin-bottom:16px;overflow:hidden}
.form-card>h4{margin:0;padding:0 20px;height:48px;line-height:48px;font-size:14px;font-weight:500;border-bottom:1px solid var(--border)}
.form-body{padding:16px 20px 20px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.field label{display:block;font-size:12px;line-height:16px;font-weight:500;margin-bottom:6px}
.field+.field{margin-top:0}
.field{margin-bottom:14px}
.grid2 .field{margin-bottom:0} .grid2{margin-bottom:14px}
.input{width:100%;height:36px;border:1px solid transparent;border-radius:8px;background:var(--input);padding:0 12px;outline:none}
.input::placeholder{color:#8b8b99}
.input:focus{border-color:var(--accent);background:#fff;box-shadow:0 0 0 3px rgba(56,189,248,.2)}
.input-wrap{position:relative}
.input-wrap .icon-btn{position:absolute;right:4px;top:4px;color:var(--muted)}
.checks{border-top:1px solid var(--border);padding-top:14px;display:flex;flex-direction:column;gap:12px}
.check{display:flex;align-items:center;gap:10px;cursor:pointer;user-select:none}
.check input{appearance:none;width:14px;height:14px;border-radius:3px;border:1px solid #c4c4cc;background:#fff;margin:0;display:grid;place-items:center;flex:none}
.check input:checked{background:var(--accent);border-color:var(--accent)}
.check input:checked::after{content:"";width:8px;height:4px;border:2px solid #fff;border-top:0;border-right:0;transform:rotate(-45deg) translate(1px,-1px)}
.check input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.save-row{display:flex;justify-content:flex-end}

/* ---------- вход ---------- */
.login-wrap{min-height:100vh;display:grid;place-items:center;padding:24px}
.login{width:384px;max-width:100%;background:#fff;border:1px solid var(--border);border-radius:16px;padding:24px}
.login .logo{border:0;padding:0;height:auto;margin-bottom:20px}
.login h1{font-size:18px;line-height:24px;font-weight:600;margin:0 0 6px}
.login .sub{font-size:12px;color:var(--muted);margin:0 0 18px}
.login .field{margin-bottom:14px}
.login .btn{margin-top:6px}
.forgot{display:block;text-align:center;font-size:12px;color:var(--muted);margin:14px 0;background:none;border:0;width:100%}
.demo-note{background:#f0f9ff;border:1px solid #e0f2fe;border-radius:8px;padding:10px 12px;font-size:12px;line-height:16px;color:#0369a1}

/* ---------- модальное окно ---------- */
.overlay{position:fixed;inset:0;background:rgba(0,0,0,.46);overflow:auto;display:flex;padding:32px 16px;z-index:50}
.modal{margin:auto;width:1024px;max-width:100%;background:#fff;border-radius:16px;box-shadow:0 24px 60px rgba(0,0,0,.28)}
.modal.wide{width:1200px}
.m-head{display:flex;align-items:center;justify-content:space-between;padding:20px 20px 0}
.m-title{display:flex;align-items:baseline;gap:6px;min-width:0}
.m-title b{font-weight:600;white-space:nowrap}
.m-title span{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.m-right{display:flex;align-items:center;gap:12px}
.chip{background:var(--neu-bg);border-radius:6px;padding:2px 8px;font-size:12px;line-height:16px;color:var(--neu-fg);font-weight:500}
.m-tabs{display:flex;padding:8px 12px 0;border-bottom:1px solid var(--border)}
.m-tabs .tab{margin-bottom:-1px}
.tab[aria-disabled="true"]{opacity:.45;cursor:not-allowed}
.m-body{padding:20px}
.cols{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.sec-title{font-size:14px;font-weight:500;margin:4px 0 12px}
.file-card{display:flex;align-items:center;gap:12px;border:1px solid var(--border);border-radius:12px;padding:12px;margin-bottom:12px}
.file-ico{width:36px;height:36px;border-radius:8px;background:#fee2e2;color:#dc2626;font-weight:700;font-size:11px;display:grid;place-items:center;flex:none}
.file-card b{display:block;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-card small{display:block;font-size:12px;line-height:16px;color:var(--muted)}
.fc-text{min-width:0}
.box{display:flex;align-items:center;gap:10px;border-radius:12px;padding:10px 14px;margin-bottom:12px;font-size:12px;line-height:16px}
.box b{display:block;font-weight:600;font-size:12px}
.box.ok{background:#f0fdf4;border:1px solid #bbf7d0;color:#16a34a} .box.ok b{color:#166534}
.box.err{background:#fef2f2;border:1px solid #fecaca;color:#dc2626} .box.err b{color:#991b1b}
.box.load{background:#f8fafc;border:1px solid var(--border);color:var(--muted)} .box.load b{color:var(--fg)}
.bar-track{height:4px;border-radius:2px;background:#e5e7eb;overflow:hidden;margin-top:6px;width:200px}
.bar-track i{display:block;height:100%;width:40%;background:var(--accent);border-radius:2px;animation:slide 1.1s ease-in-out infinite}
@keyframes slide{0%{margin-left:-40%}100%{margin-left:100%}}
.obj-card{border:1px solid var(--border);border-radius:12px;padding:12px 16px;margin-bottom:12px}
.obj-card span{display:block;font-size:12px;line-height:16px;color:var(--muted)}
.obj-card b{display:block;font-size:20px;line-height:30px;font-weight:600;margin:2px 0}
.fields{border:1px solid var(--border);border-radius:12px;overflow:hidden}
.frow{display:flex;justify-content:space-between;align-items:center;height:37px;padding:0 16px;font-size:12px;border-top:1px solid var(--border)}
.frow:first-child{border-top:0}
.frow span{color:var(--muted)} .frow b{font-weight:500;display:flex;align-items:center;gap:10px}
.dot{width:8px;height:8px;border-radius:50%;background:#4ade80;flex:none}
.dot.low{background:#fbbf24}
.sk{display:inline-block;height:10px;width:90px;border-radius:5px;background:linear-gradient(90deg,#eceff3,#f7f8fa,#eceff3);background-size:200% 100%;animation:sh 1.2s linear infinite}
@keyframes sh{to{background-position:-200% 0}}

.t-head{display:flex;align-items:center;gap:10px;margin:0 0 12px}
.banner{display:flex;align-items:flex-start;gap:8px;border-radius:12px;padding:10px 14px;font-size:12px;line-height:16px;margin-bottom:16px;background:#eff6ff;border:1px solid #bfdbfe;color:#1d4ed8}
.banner.ok{background:#f0fdf4;border-color:#bbf7d0;color:#166534}
.banner .ic{margin-top:1px}
.tbl-wrap{border:1px solid var(--border);border-radius:12px;overflow-x:auto;margin-bottom:16px}
.p-table{table-layout:fixed;min-width:1160px;font-size:13px}
.p-table th{font-weight:500;text-align:left;padding:14px 8px;height:62px;vertical-align:middle;line-height:18px;font-size:13px}
.p-table td{padding:0 2px;height:37px;border-top:1px solid var(--border)}
.p-table td.pad{padding:0 8px}
.cell{width:100%;height:30px;border:1px solid transparent;border-radius:6px;background:transparent;padding:0 6px;font-size:13px;outline:none;text-overflow:ellipsis}
.cell.mono{font-size:12px}
.cell:hover{background:#f6f6f8}
.cell:focus{border-color:var(--accent);background:#fff;box-shadow:0 0 0 2px rgba(56,189,248,.25)}
.cell:read-only{cursor:default}.cell:read-only:hover{background:transparent}.cell:read-only:focus{box-shadow:none;border-color:transparent}
.x-btn{width:28px;height:28px;border:0;border-radius:6px;background:none;color:#a1a1ad;display:grid;place-items:center}
.x-btn:hover{background:#fee2e2;color:#b91c1c}
.p-table tfoot td{background:#f4f4f6;font-weight:600;padding:0 8px;height:37px;border-top:2px solid var(--border)}
.m-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.xlsx-chip{display:flex;align-items:center;gap:10px;border:1px solid var(--border);border-radius:10px;padding:6px 14px;background:#fff;text-align:left}
.xlsx-chip b{display:block;font-weight:500;font-size:13px;line-height:16px}
.xlsx-chip small{display:block;font-size:12px;line-height:16px;color:var(--muted)}
.xlsx-chip.ready{border-color:#bbf7d0;background:#f0fdf4;color:#15803d;cursor:pointer}
.xlsx-chip.ready:hover{background:#e7f9ee}
.xlsx-chip.ready small{color:#16a34a}

/* ---------- тосты ---------- */
#toast-root{position:fixed;left:0;right:0;bottom:24px;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;z-index:200}
.toast{background:#0a0a0a;color:#fff;border-radius:10px;padding:10px 16px;font-size:13px;box-shadow:0 8px 24px rgba(0,0,0,.25);animation:tin .18s ease-out}
.toast.err{background:#b91c1c}
@keyframes tin{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ---------- панель исследователя ---------- */
.rp{position:fixed;right:16px;bottom:16px;width:360px;max-height:calc(100vh - 32px);overflow:auto;background:#111827;color:#e5e7eb;border-radius:14px;padding:16px;z-index:300;font-size:12px;line-height:18px;box-shadow:0 12px 40px rgba(0,0,0,.4)}
.rp h4{margin:0 0 10px;font-size:13px;color:#fff;display:flex;justify-content:space-between}
.rp label{display:block;margin:8px 0 4px;color:#9ca3af}
.rp input{width:100%;height:30px;border-radius:6px;border:1px solid #374151;background:#1f2937;color:#fff;padding:0 8px}
.rp .row{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.rp button{height:28px;padding:0 10px;border-radius:6px;border:1px solid #374151;background:#1f2937;color:#e5e7eb;font-size:12px}
.rp button:hover{background:#374151}
.rp .m{display:grid;grid-template-columns:1fr auto;gap:2px 12px;margin-top:10px;border-top:1px solid #374151;padding-top:8px}
.rp .m b{color:#fff;text-align:right;font-weight:500}
.rp small{display:block;color:#9ca3af;margin-top:8px}

@media (max-width:820px){
  .metrics{grid-template-columns:repeat(2,1fr)} .cols{grid-template-columns:1fr}
  .q-table{table-layout:auto;min-width:760px} .panel{overflow-x:auto}
}

/* ---------- вступительный экран ---------- */
.login.intro{width:600px}
.steps{list-style:none;margin:0 0 16px;padding:0;display:flex;flex-direction:column;gap:16px}
.steps li{display:flex;gap:14px}
.steps .n{width:26px;height:26px;border-radius:50%;background:var(--warn-bg);color:var(--warn-fg);font-weight:600;font-size:13px;display:grid;place-items:center;flex:none;margin-top:1px}
.steps b{font-weight:600}
.steps p{margin:2px 0 10px;font-size:13px;line-height:18px;color:var(--muted)}
.steps li:not(:first-child) p{margin-bottom:0}
a.btn{text-decoration:none}
details{margin-top:10px;font-size:13px}
summary{cursor:pointer;color:#0369a1;list-style:none}
summary::-webkit-details-marker{display:none}
summary::before{content:"▸ ";display:inline-block;transition:transform .15s}
details[open] summary::before{transform:rotate(90deg)}
.files{margin:8px 0 0;padding:0;list-style:none;display:grid;grid-template-columns:1fr 1fr;gap:4px 16px}
.files a{color:var(--fg);text-decoration:none;display:flex;gap:6px;align-items:center;padding:3px 0;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.files a:hover{color:#0369a1}
.warn-note{background:#fffbeb;border:1px solid #fde68a;border-radius:10px;padding:10px 12px;font-size:12px;line-height:16px;color:#92400e;margin-bottom:14px}
.login.intro .demo-note{margin-top:14px}
.hint-bar{display:flex;align-items:center;gap:8px;background:#fffbeb;border:1px solid #fde68a;border-radius:12px;padding:10px 14px;font-size:12px;line-height:16px;color:#92400e;margin-bottom:16px}
.hint-bar a{color:#0369a1;font-weight:500;margin-left:auto;white-space:nowrap}
.dialog{margin:auto;width:460px;max-width:100%;background:#fff;border-radius:16px;box-shadow:0 24px 60px rgba(0,0,0,.28);padding:24px}
.dialog h3{margin:0 0 8px;font-size:16px;line-height:22px}
.dialog p{margin:0 0 16px;color:var(--muted);font-size:13px;line-height:19px}
.dialog .row{display:flex;gap:10px;flex-wrap:wrap}
.cookie{position:fixed;left:16px;right:16px;bottom:16px;max-width:760px;margin:0 auto;background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:0 16px 40px -16px rgba(14,26,43,.45);padding:16px 18px;display:flex;flex-wrap:wrap;gap:12px 20px;align-items:center;z-index:400}
.cookie p{margin:0;flex:1 1 360px;font-size:13px;line-height:19px}
.cookie a{color:#0369a1}
.cookie-btns{display:flex;gap:10px}
.banner a{color:inherit;font-weight:600;white-space:nowrap}
@media (max-width:640px){.files{grid-template-columns:1fr}.login.intro{padding:20px}}

.intro-wrap{padding-bottom:160px;align-content:start}
