:root {
  --sky: #0284c7;
  --sky-ink: #075985;
  --sky-light: #eaf7ff;
  --line: #e2e8ed;
  --ink: #171b20;
  --soft: #f5f7f9;
}
body {
  background: var(--soft);
  color: var(--ink);
}
.sidebar {
  background: var(--soft);
  border-color: var(--line);
}
.brand {
  background: transparent;
  margin: 14px 0 10px;
  height: 100px;
  display: flex;
  align-items: center;
}
.brand img {
  object-fit: contain;
  width: 100%;
  height: auto;
  max-height: 90px;
}
.hero-logo {
  width: 260px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.nav-label {
  margin-top: 12px;
}
.nav-item {
  border-radius: 10px;
  margin-bottom: 5px;
}
.nav-item.active {
  background: #171b20;
  color: #fff;
  box-shadow: 0 4px 12px #17223114;
}
.nav-item.active svg {
  stroke: #7dd3fc;
}
.nav-item.active .count {
  background: #33424b;
  color: #bae6fd;
}
.nav-item:hover:not(.active) {
  background: #e6f2f9;
}
main {
  padding-top: 36px;
}
button {
  border-radius: 10px;
  border-color: #dce2e7;
  font-weight: 550;
  transition:
    background 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
button:hover {
  background: #f0f7fb;
  border-color: #add8ed;
}
button:disabled {
  cursor: not-allowed;
}
button.primary {
  background: #171b20;
  border-color: #171b20;
  box-shadow: 0 3px 8px #13283818;
}
button.primary:hover {
  background: #303b45;
  border-color: #303b45;
}
button.accent,
.accent {
  color: #fff;
  background: #027ebc;
  border-color: #027ebc;
  box-shadow: 0 4px 10px #0284c726;
}
button.accent:hover {
  background: #03699c;
  color: white;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #38bdf8;
  outline: 2px solid #bae6fd;
}
:focus-visible {
  outline: 2px solid #0284c7;
}
.panel,
.card,
.search-box,
.stat {
  border-color: var(--line);
  border-radius: 16px;
  box-shadow: 0 3px 14px #152b3b04;
}
.stat strong {
  letter-spacing: -0.04em;
}
.stat:nth-child(3) {
  background: linear-gradient(135deg, #fff, #edf8ff);
}
.stat:nth-child(3) strong {
  color: var(--sky-ink);
}
.note {
  background: #f0f7fb;
  border-left: 3px solid #7dd3fc;
  color: #435364;
  border-radius: 0 8px 8px 0;
}
.pill {
  border-color: #dee5eb;
  background: #f5f7f9;
  border-radius: 7px;
}
.pill.dark,
.pill.positive {
  color: #075985;
  background: #e5f5ff;
  border-color: #bae6fd;
}
.pill.attention {
  background: #fff7ed;
  color: #9a4b0a;
  border-color: #fed7aa;
}
.pill.negative {
  background: #fff1f2;
  color: #9f1239;
  border-color: #fecdd3;
}
.tabs .tab.active {
  border-color: var(--sky);
  color: var(--sky-ink);
}
.bar-fill {
  background: linear-gradient(90deg, #0284c7, #7dd3fc);
  border-radius: 6px;
}
.bar-track {
  background: #eaf1f6;
  border-radius: 6px;
}
.inline-status {
  min-width: 125px;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 550;
  background: #f7fafc;
}
.inline-status[data-value="в работе"],
.inline-status[data-value="проверен"] {
  background: #eaf7ff;
  border-color: #bae6fd;
  color: #075985;
}
.small-button[data-research] {
  color: #075985;
  background: #eaf7ff;
  border-color: #c5e6fa;
}
.settings-card {
  padding: 26px;
  display: flex;
  flex-direction: column;
}
.settings-card .actions {
  margin-top: auto;
  padding-top: 12px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
}
.section-title h3 {
  margin: 0;
  font-size: 1.1rem;
}
.section-title p {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: #697887;
}
.section-icon {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  height: 46px;
  border-radius: 13px;
  background: #e2f4ff;
  color: #0369a1;
  font-size: 1.4rem;
}
.settings-card .status-line {
  padding: 15px 0;
  gap: 12px;
}
.settings-card .note {
  font-size: 0.875rem;
  margin: 22px 0;
}
.connection-models {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 10px;
}
.model-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  margin: 0;
}
.model-choice select {
  width: auto;
  max-width: 320px;
  margin: 0;
  background: #f4f9fc;
}
.search-bottom {
  flex-wrap: wrap;
  gap: 15px;
}
.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0 14px;
}
.history-head h2 {
  margin: 0;
  font-size: 1.1rem;
}
.history-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: #667786;
  font-size: 0.8rem;
  margin-bottom: 15px;
}
.result-excerpt {
  color: #526171;
  font-size: 0.9rem;
  line-height: 1.65;
}
.report-modal {
  width: min(1280px, calc(100vw - 32px));
  height: 92dvh;
  max-height: 94dvh;
  overflow: hidden;
}
.report-modal[open] {
  display: flex;
  flex-direction: column;
}
.report-modal .modal-header {
  flex-shrink: 0;
  padding: 20px 26px;
}
.report-modal .modal-header h2 {
  font-size: 1.35rem;
}
.report-modal #modal-body {
  padding: 0;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.report-meta {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfd;
}
.report-meta .result-meta {
  margin: 0;
}
.report-layout {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  min-height: 0;
  flex: 1;
}
.report-nav {
  border-right: 1px solid var(--line);
  background: #f7f9fb;
  padding: 20px 12px;
  overflow-y: auto;
}
.report-nav .eyebrow {
  padding: 0 12px;
  font-size: 0.63rem;
  margin: 0 0 14px;
}
.report-nav button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 12px;
  margin-bottom: 4px;
  font-size: 0.83rem;
}
.report-nav button.active {
  background: #dff2ff;
  color: #075985;
}
.report-nav small {
  color: #668091;
}
.report-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.report-tools {
  padding: 16px 22px;
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.report-tools input {
  flex: 2;
  min-width: 160px;
}
.report-tools select {
  flex: 1;
  min-width: 175px;
}
.report-scroll {
  overflow: auto;
  padding: 24px;
  scroll-behavior: smooth;
}
.report-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.report-summary > div {
  padding: 16px;
  border: 1px solid #dcecf6;
  border-radius: 12px;
  background: #f0f9ff;
}
.report-summary strong {
  display: block;
  font-size: 1.5rem;
  color: #075985;
}
.report-summary small {
  color: #5a7184;
  font-size: 0.75rem;
}
.report-section {
  border: 1px solid var(--line);
  padding: 22px;
  border-radius: 14px;
  background: #fff;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}
.report-section[data-kind="suppliers"] {
  border-top: 3px solid #7dd3fc;
}
.report-section .section-kicker {
  color: #4485a9;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  font-weight: 650;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.markdown {
  font-size: 0.9rem;
  line-height: 1.75;
  white-space: normal;
}
.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4 {
  font-size: 1.1rem;
  line-height: 1.4;
  margin: 22px 0 12px;
  letter-spacing: -0.02em;
}
.markdown > :first-child {
  margin-top: 0;
}
.markdown p {
  margin: 0 0 12px;
}
.markdown ul,
.markdown ol {
  padding-left: 22px;
  margin: 10px 0 18px;
}
.markdown li {
  margin: 5px 0;
}
.markdown a {
  color: #0369a1;
  text-decoration-color: #7dd3fc;
  text-underline-offset: 3px;
}
.markdown table {
  width: 100%;
  font-size: 0.8rem;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  margin: 16px 0;
}
.markdown th,
.markdown td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
  min-width: 100px;
}
.markdown th {
  background: #edf7fc;
  color: #355a72;
}
.markdown blockquote {
  border-left: 3px solid #7dd3fc;
  padding: 10px 16px;
  margin: 16px 0;
  background: #f5faff;
}
.markdown code {
  background: #f0f3f6;
  padding: 2px 5px;
  border-radius: 4px;
}
.markdown pre {
  overflow: auto;
}
.source-card {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  margin-bottom: 12px;
  text-decoration: none;
}
.source-card:hover {
  border-color: #7dd3fc;
  background: #f4fbff;
}
.source-card .source-index {
  color: #0284c7;
  background: #eaf7ff;
  border-radius: 8px;
  padding: 5px 10px;
}
.source-card strong,
.source-card small {
  display: block;
  overflow-wrap: anywhere;
}
.source-card small {
  color: #70818f;
  margin-top: 5px;
  font-size: 0.75rem;
}
.storage-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(230px, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.storage-capacity {
  padding: 26px;
  background: #171e25;
  color: #fff;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
}
.storage-capacity .eyebrow {
  color: #a5b9c9;
}
.storage-capacity h2 {
  font-size: 2.8rem;
  margin: 12px 0 0;
  letter-spacing: -0.05em;
}
.storage-capacity h2 span {
  font-size: 1rem;
  letter-spacing: 0;
  font-weight: 400;
  color: #a2b4c2;
}
.storage-meter {
  height: 8px;
  background: #33424e;
  border-radius: 8px;
  margin: 22px 0 12px;
  overflow: hidden;
}
.storage-meter > span {
  height: 100%;
  display: block;
  min-width: 3px;
  background: linear-gradient(90deg, #38bdf8, #bae6fd);
  border-radius: 8px;
}
.storage-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.75rem;
  color: #a5b9c9;
}
.storage-security {
  padding: 24px;
  border-radius: 18px;
  background: linear-gradient(140deg, #fff, #edf8ff);
  border: 1px solid #d9eaf5;
}
.storage-security h3 {
  margin: 10px 0;
}
.storage-security p {
  color: #60798b;
  font-size: 0.85rem;
}
.storage-security button {
  margin-top: 6px;
}
.drop-zone {
  border: 2px dashed #b9d6e8;
  border-radius: 14px;
  padding: 30px 20px;
  background: #f6fbff;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.drop-zone.dragging {
  background: #def2ff;
  border-color: #0284c7;
  box-shadow: 0 0 0 4px #bae6fd70;
}
.drop-zone:focus-within {
  outline: 2px solid #0284c7;
  outline-offset: 3px;
}
.drop-zone strong {
  display: block;
  font-size: 1rem;
  margin: 8px 0;
}
.drop-zone p {
  font-size: 0.82rem;
  color: #687f91;
  margin: 0;
}
.drop-zone .upload-glyph {
  color: #0284c7;
  font-size: 1.6rem;
}
.drop-zone input {
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  position: absolute;
}
.file-queue {
  padding: 0;
  list-style: none;
  max-height: 200px;
  overflow: auto;
  margin: 12px 0;
}
.file-queue li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 4px;
  border-bottom: 1px solid #edf0f3;
  font-size: 0.85rem;
}
.file-queue .filename {
  overflow-wrap: anywhere;
}
.file-queue small {
  color: #698194;
  white-space: nowrap;
}
.upload-progress {
  width: 100%;
  accent-color: #0284c7;
  height: 9px;
}
.storage-filters {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.storage-filters input {
  flex: 2;
  min-width: 180px;
}
.storage-filters select {
  flex: 1;
  min-width: 130px;
}
.file-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.file-type {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  height: 44px;
  border-radius: 10px;
  color: #075985;
  background: #edf7fc;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}
.storage-search-info {
  padding: 12px 20px;
  font-size: 0.8rem;
  color: #687e8e;
  border-top: 1px solid var(--line);
}
.mini-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}
#menu-toggle {
  margin: 16px 18px 0;
  align-self: flex-start;
  z-index: 51;
}
@media (min-width: 801px) {
  #menu-toggle {
    display: none;
  }
}
@media (max-width: 1000px) {
  .history-filters {
    grid-template-columns: 1fr 1fr;
  }
  .storage-hero {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 800px) {
  main {
    padding: 20px 18px;
  }
  .report-layout {
    display: flex;
    flex-direction: column;
  }
  .report-nav {
    display: flex;
    flex-shrink: 0;
    overflow-x: auto;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .report-nav .eyebrow {
    display: none;
  }
  .report-nav button {
    width: auto;
    white-space: nowrap;
    gap: 8px;
    padding: 9px 12px;
    margin: 0;
  }
  .report-content {
    flex: 1;
  }
  .report-scroll {
    padding: 14px;
  }
  .report-tools {
    padding: 12px;
  }
  .report-section {
    padding: 16px;
  }
  .report-summary {
    gap: 7px;
  }
  .report-summary > div {
    padding: 12px;
  }
  .report-meta {
    padding: 12px 16px;
  }
  .report-modal .modal-header {
    padding: 14px 18px;
  }
  .report-modal {
    width: calc(100vw - 16px);
  }
  .model-choice {
    width: 100%;
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
