body {
  background: #f6f7fb;
}

.card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.checks-table {
  font-size: 0.88rem;
}

.checks-table th {
  white-space: nowrap;
}

.title-cell {
  min-width: 280px;
  max-width: 520px;
}

.title-cell a {
  text-decoration: none;
}

.title-cell a:hover {
  text-decoration: underline;
}

.source-link-cell {
  max-width: 360px;
  word-break: break-all;
}

.preview-cell {
  min-width: 280px;
  max-width: 520px;
}

.stat-card {
  height: 100%;
  padding: 1rem;
  border-radius: 0.85rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.stat-label {
  font-size: 0.78rem;
  color: #6c757d;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
}

.public-body {
  background: #f6f7fb;
}

.public-container {
  max-width: 1600px;
}

.doc-pages-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1rem;
}

.doc-pages-nav {
  position: sticky;
  top: 82px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.8rem;
  padding: 0.75rem;
}

.doc-pages-viewer {
  min-width: 0;
}

.doc-page-card {
  margin-bottom: 1.5rem;
  background: #f1f3f7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.95rem;
  overflow: hidden;
}

.doc-page-meta {
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.doc-page-scroll {
  --doc-zoom: 1;
  padding: 1.25rem;
  overflow: auto;
  min-height: 420px;
}

.doc-page-scale {
  transform-origin: top left;
  width: calc(960px * var(--doc-zoom));
  min-width: max-content;
}

.doc-page-render {
  position: relative;
  background: #fff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.doc-page-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.doc-page-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.doc-page-block {
  position: absolute;
  display: block;
  white-space: pre;
  overflow: visible;
  box-sizing: border-box;
  cursor: default;
}

.doc-page-block.is-ai {
  outline: 1px solid rgba(220, 53, 69, 0.15);
}

.doc-page-block.is-ai:hover {
  outline: 2px solid rgba(220, 53, 69, 0.55);
  z-index: 4;
}

@media (max-width: 992px) {
  .doc-pages-layout {
    grid-template-columns: 1fr;
  }

  .doc-pages-nav {
    position: static;
    max-height: none;
  }
}

.resource-pill {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #eef6ff;
  border: 1px solid rgba(13, 110, 253, 0.15);
  font-size: 0.85rem;
  color: #334155;
}

.login-body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #eef6ff, #f6f7fb 45%, #eef1f7);
}

.login-card-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.upload-dropzone {
  border: 2px dashed rgba(13, 110, 253, 0.25);
  border-radius: 0.9rem;
  padding: 1rem;
  background: #f8fbff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-dropzone.is-dragover {
  border-color: rgba(13, 110, 253, 0.75);
  background: #eef6ff;
}

.selected-files-box {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  border-radius: 0.75rem;
  padding: 0.75rem;
  max-height: 180px;
  overflow: auto;
}

.uploads-table td {
  vertical-align: middle;
}

.upload-file-cell {
  min-width: 220px;
}

.upload-error-text {
  max-width: 320px;
  white-space: normal;
}

.app-navbar {
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.app-main {
  max-width: 1720px;
}

.navbar-brand {
  letter-spacing: -0.02em;
}

.header-actions .btn,
.header-action-btn {
  min-height: 34px;
  border-radius: 0.65rem;
}

.page-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #ffffff, #eef6ff);
  border: 1px solid rgba(13, 110, 253, 0.12);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0d6efd;
  margin-bottom: 0.35rem;
}

.ticket-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.5rem;
  border-radius: 0.55rem;
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.ticket-work-cell {
  min-width: 240px;
  max-width: 420px;
}

.ticket-link-group {
  min-width: 280px;
}

.ticket-public-shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: min(8vh, 4rem) 0;
}

.ticket-public-shell-wide {
  max-width: 1120px;
  padding-top: 1rem;
}

.ticket-public-card {
  border-radius: 1.25rem;
  overflow: hidden;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.tickets-table th,
.tickets-table td {
  vertical-align: middle;
}

@media (max-width: 1199.98px) {
  .header-actions {
    align-items: stretch !important;
  }

  .header-actions > *,
  .header-actions .dropdown,
  .header-actions .btn,
  .header-actions .resource-pill {
    width: 100%;
  }

  .header-actions .dropdown > .btn {
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 768px) {
  .page-hero {
    flex-direction: column;
    padding: 1rem;
  }

  .page-hero .btn {
    width: 100%;
  }

  .card-body {
    padding: 1rem;
  }

  .table-responsive {
    border-radius: 0.85rem;
  }

  .ticket-link-group {
    min-width: 220px;
  }

  .ticket-public-shell {
    padding: 1rem 0;
  }

  .doc-page-scroll {
    padding: 0.75rem;
    min-height: 300px;
  }
}

.app-toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}

.app-toast {
  width: 100%;
  border-radius: 0.9rem;
  overflow: hidden;
  pointer-events: auto;
}

.app-toast .toast-body {
  padding: 0.85rem 0.95rem;
  font-size: 0.92rem;
  line-height: 1.35;
}

.btn-compact {
  min-height: 34px;
  padding-top: 0.38rem;
  padding-bottom: 0.38rem;
}

.upload-dropzone {
  padding: 0.8rem;
}

.upload-dropzone .form-control {
  min-height: 38px;
}

.analysis-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.stat-card-compact {
  min-height: 82px;
  padding: 0.75rem 0.9rem;
}

.stat-card-compact .stat-value {
  font-size: 1.15rem;
}

.analysis-explain-card,
.analysis-tabs-card,
.share-card {
  border-radius: 1rem;
}

.analysis-note {
  padding: 0.85rem;
  border-radius: 0.8rem;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.analysis-tabs {
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
}

.analysis-tabs .nav-link {
  white-space: nowrap;
}

.analysis-table td,
.analysis-table th {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.analysis-actions .btn {
  min-height: 32px;
}

.share-input-group .form-control {
  min-height: 40px;
}

.share-input-group .btn {
  min-height: 40px;
  white-space: nowrap;
}

.table-actions .btn {
  margin-top: 0.1rem;
  margin-bottom: 0.1rem;
}

.checks-live-card .card-header {
  min-height: 58px;
}

.dictionary-list .list-group-item {
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

@media (max-width: 1199.98px) {
  .analysis-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .app-toast-container {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: auto;
  }

  .analysis-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card-compact {
    min-height: 74px;
  }

  .share-input-group {
    display: grid;
    grid-template-columns: 1fr;
  }

  .share-input-group .form-control,
  .share-input-group .btn {
    width: 100%;
    border-radius: 0.5rem !important;
  }

  .analysis-actions {
    width: 100%;
  }

  .analysis-actions .btn {
    flex: 1 1 160px;
  }
}

/* Более спокойные служебные акценты: статусы и уведомления без яркой синевы */
.badge {
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.28rem 0.44rem;
}

.badge-soft {
  color: #495057 !important;
  background: #f1f3f5 !important;
  border: 1px solid #dee2e6;
}

.text-bg-primary {
  color: #fff !important;
  background-color: #6c757d !important;
}

.alert-info,
.alert-primary {
  color: #343a40;
  background-color: #f1f3f5;
  border-color: #dee2e6;
}

.app-toast.text-bg-primary,
.app-toast.text-bg-info {
  color: #fff !important;
  background-color: #6c757d !important;
}

.app-toast {
  border-radius: 0.72rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12) !important;
}

.app-toast .toast-body {
  padding: 0.68rem 0.82rem;
  font-size: 0.86rem;
}

.resource-pill {
  background: #f1f3f5;
  border-color: #dee2e6;
}

.upload-dropzone {
  border-color: #ced4da;
  background: #f8f9fa;
}

.upload-dropzone.is-dragover {
  border-color: #868e96;
  background: #f1f3f5;
}

.doc-pages-nav-compact {
  width: 100%;
}

.page-number-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.page-number-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.85rem;
  padding: 0 0.45rem;
  border-radius: 0.5rem;
  border: 1px solid #dee2e6;
  background: #f8f9fa;
  color: #343a40;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.page-number-link:hover {
  background: #e9ecef;
  color: #212529;
}

.page-number-link.has-ai {
  border-color: rgba(220, 53, 69, 0.45);
  color: #842029;
  background: #fff5f5;
}

.doc-pages-layout {
  grid-template-columns: 180px minmax(0, 1fr);
}

@media (max-width: 992px) {
  .doc-pages-layout {
    grid-template-columns: 1fr;
  }

  .page-number-link {
    min-width: 1.9rem;
    height: 1.75rem;
    font-size: 0.74rem;
  }
}

/* Uploads, queue and accounts polishing */
.page-hero-muted {
  background: #fff;
  border-color: #e5e7eb;
}

.page-hero-muted .eyebrow {
  color: #6c757d !important;
}

.dropzone-icon {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.55rem;
  background: #e9ecef;
  color: #495057;
  font-weight: 700;
  font-size: 1.2rem;
}

.upload-dropzone-compact {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}

.selected-files-table-wrap {
  max-height: 260px;
  overflow: auto;
}

.selected-files-table th,
.selected-files-table td {
  font-size: 0.82rem;
}

.uploads-actionbar .btn,
.queue-hero-actions .btn,
.queue-hero-actions .form-control,
.account-actions .btn {
  min-height: 32px;
}

.uploads-table-wrap,
.queue-table-wrap,
.accounts-table-wrap {
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.uploads-table thead th,
.queue-table thead th,
.accounts-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8f9fa;
}

.uploads-table input.form-control-sm {
  min-width: 130px;
}

.upload-service-cell .badge {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.queue-doc-cell,
.queue-error-cell {
  max-width: 420px;
  word-break: break-word;
}

.queue-hero-actions input[type="number"] {
  width: 86px;
}

.current-account-chip {
  min-width: 220px;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
}

.account-name-cell {
  min-width: 210px;
}

.accounts-table td,
.accounts-table th,
.queue-table td,
.queue-table th,
.uploads-table td,
.uploads-table th {
  vertical-align: middle;
}

@media (max-width: 1199.98px) {
  .uploads-table-wrap,
  .queue-table-wrap,
  .accounts-table-wrap {
    max-height: none;
  }

  .queue-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .upload-dropzone-compact {
    min-height: 130px;
  }

  .uploads-actionbar,
  .queue-hero-actions,
  .account-actions {
    width: 100%;
  }

  .uploads-actionbar .btn,
  .queue-hero-actions .btn,
  .account-actions .btn,
  .queue-hero-actions form,
  .queue-hero-actions input[type="number"] {
    width: 100%;
  }

  .queue-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .current-account-chip {
    width: 100%;
  }
}

.report-percent-card {
  border-radius: 1rem;
}

.report-percent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.report-percent-item {
  min-height: 72px;
  padding: 0.75rem;
  border: 1px solid #e9ecef;
  border-radius: 0.85rem;
  background: #fff;
}

.report-percent-label {
  color: #495057;
  font-size: 0.78rem;
  line-height: 1.2;
  font-weight: 600;
}

.report-percent-value {
  color: #212529;
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}

.report-percent-bar {
  height: 0.48rem;
  border-radius: 999px;
  background: #f1f3f5;
  overflow: hidden;
}

.report-percent-progress {
  height: 100%;
  min-width: 0.15rem;
  border-radius: inherit;
}

.metric-green {
  background: #55a630;
}

.metric-yellow {
  background: #f2c94c;
}

.metric-soft-green {
  background: #d1ecc3;
}

.metric-red {
  background: #dc3545;
}

@media (max-width: 1199.98px) {
  .report-percent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .report-percent-grid {
    grid-template-columns: 1fr;
  }
}
