:root {
  --bg: #141F17;
  --bg-header: #0F1712;
  --bg-card: #1F2E22;
  --text: #FAF6EE;
  --text-secondary: #9C9586;
  --accent-sand: #C4A87A;
  --bad: #E2484D;
  --medium: #EF9F27;
  --good: #8FCB9B;
  --info: #6EC1E4;
  --border: rgba(250, 246, 238, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", sans-serif;
  min-height: 100vh;
}

/* Floating overlay-style scrollbar — thin, rounded, doesn't reserve layout space. */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 168, 122, 0.4) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(196, 168, 122, 0.35);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(196, 168, 122, 0.6);
  background-clip: content-box;
}

a { color: var(--accent-sand); }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow 0.2s ease;
}
.app-header.is-scrolled {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

body.has-side-nav {
  margin-left: 64px;
  transition: margin-left 0.2s ease;
}
body.has-side-nav.sidenav-expanded {
  margin-left: 248px;
}
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 64px;
  background: var(--bg-header);
  border-right: 1px solid var(--border);
  z-index: 110;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.2s ease;
}
.side-nav.expanded {
  width: 248px;
}
.side-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 14px 10px 14px 14px;
  flex-shrink: 0;
}
.side-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 1;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  border-radius: 8px;
  padding: 4px;
  margin: -4px;
}
.side-nav-brand-icon, .side-nav-brand-toggle-icon {
  font-size: 22px;
  color: var(--accent-sand);
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}
.side-nav-brand-toggle-icon {
  display: none;
}
.side-nav:not(.expanded) .side-nav-brand:hover .side-nav-brand-icon {
  display: none;
}
.side-nav:not(.expanded) .side-nav-brand:hover .side-nav-brand-toggle-icon {
  display: inline-block;
}
.side-nav:not(.expanded) .side-nav-brand:hover {
  background: rgba(250, 246, 238, 0.06);
}
.side-nav-top-actions {
  display: none;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.side-nav.expanded .side-nav-top-actions {
  display: flex;
}
.side-nav-top-actions .side-nav-item {
  width: auto;
  padding: 8px;
}
.side-nav-top-actions .side-nav-label {
  display: none !important;
}
.side-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 8px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}
.side-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  text-align: left;
}
.side-nav-item i {
  font-size: 18px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.side-nav-label {
  display: none;
}
.side-nav.expanded .side-nav-label {
  display: inline;
}
.side-nav-item:hover {
  color: var(--text);
  background: rgba(250, 246, 238, 0.06);
}
.side-nav-item.active {
  color: var(--accent-sand);
  background: rgba(196, 168, 122, 0.12);
}
.side-nav-item.side-nav-action {
  color: var(--accent-sand);
}
.side-nav-item.side-nav-action:hover {
  background: rgba(196, 168, 122, 0.18);
}
@media (max-width: 720px) {
  body.has-side-nav, body.has-side-nav.sidenav-expanded {
    margin-left: 52px;
  }
  .side-nav, .side-nav.expanded {
    width: 52px;
  }
  .side-nav-item, .side-nav-toggle {
    padding: 10px;
  }
  .side-nav-top {
    padding: 12px 8px;
    justify-content: center;
  }
  .side-nav-top-actions {
    display: none !important;
  }
  .side-nav-label {
    display: none !important;
  }
}

.main-nav {
  /* Hidden by default — sideNav.js reads this markup as its data source and
     converts it into the left sidebar on every page that has one. Hiding it
     here (rather than relying on JS to hide/remove it) avoids a flash of
     the old top nav bar during the moment before that script runs. */
  display: none;
  gap: 4px;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
}
.main-nav a:hover {
  color: var(--text);
  background: rgba(250, 246, 238, 0.06);
}
.main-nav a.active {
  color: var(--accent-sand);
  background: rgba(196, 168, 122, 0.12);
}
.main-nav-action {
  color: var(--accent-sand);
  background: rgba(196, 168, 122, 0.08);
  border: 1px solid rgba(196, 168, 122, 0.35);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.main-nav-action:hover {
  background: rgba(196, 168, 122, 0.18);
  border-color: var(--accent-sand);
}

.scope-toggle {
  display: flex;
  gap: 6px;
}
.scope-toggle .btn {
  padding: 5px 10px;
  font-size: 12px;
}

.app-header h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-left: auto;
}

.date-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.date-range input[type="date"] {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 8px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  color-scheme: dark;
}
.date-range .btn {
  padding: 5px 10px;
  font-size: 12px;
}
.range-presets {
  display: inline-flex;
  gap: 4px;
  padding-left: 4px;
  border-left: 1px solid var(--border);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--good);
}
.live-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
}
.live-badge.stale {
  color: var(--text-secondary);
}
.live-badge.stale .dot {
  background: var(--text-secondary);
}

.updated-at {
  color: var(--text-secondary);
}

.btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { border-color: var(--accent-sand); }
.btn-primary {
  background: var(--accent-sand);
  color: var(--bg-header);
  border-color: var(--accent-sand);
  font-weight: 600;
}
.btn-danger {
  background: var(--bad);
  color: #fff;
  border-color: var(--bad);
  font-weight: 600;
}
.btn-danger:hover { opacity: 0.9; }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Wide tables (many columns, long text) benefit from more room than the
   1200px default — /lavka/tables opts in here rather than widening every
   page, since the narrower layout is deliberate everywhere else. */
main.main-wide {
  max-width: 1800px;
}

.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid var(--border);
}

.card .label {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 6px;
}

.card .value {
  font-size: 28px;
  font-weight: 700;
}

.card .value.good { color: var(--good); }
.card .value.medium { color: var(--medium); }
.card .value.bad { color: var(--bad); }
.card .value.info { color: var(--info); }

.rank-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin: -8px 0 14px;
}
.rank-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
}
.rank-legend .dot.bad { background: var(--bad); }
.rank-legend .dot.medium { background: var(--medium); }
.rank-legend .dot.good { background: var(--good); }

.panel {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
}

.panel h2 {
  font-size: 15px;
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel-subheading {
  font-size: 12px;
  margin: 20px 0 10px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.details-panel summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.details-panel summary::-webkit-details-marker {
  display: none;
}
.details-panel summary h2 {
  margin: 0;
}
.details-panel summary::after {
  content: "▾";
  color: var(--text-secondary);
  font-size: 12px;
  transition: transform 0.15s ease;
  margin-left: auto;
}
.details-panel[open] summary::after {
  transform: rotate(180deg);
}
.details-panel[open] summary {
  margin-bottom: 16px;
}
.details-panel ul, .details-panel p {
  margin-top: 0;
}

.panels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) {
  .panels-grid { grid-template-columns: 1fr; }
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.workspace-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.workspace-tile:hover {
  border-color: var(--accent-sand);
  transform: translateY(-2px);
}
.workspace-tile-icon {
  font-size: 32px;
  color: var(--accent-sand);
}
.workspace-tile h3 {
  margin: 14px 0 6px;
  font-size: 18px;
}
.workspace-tile p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.workspace-stub-panel {
  text-align: center;
  padding: 48px 24px;
}
.workspace-stub-icon {
  font-size: 40px;
  color: var(--accent-sand);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
th:last-child, td:last-child { border-right: none; }
/* Long unbroken strings (pasted URLs, concatenated deal lists) otherwise force
   the whole column — and the table's total width — to their longest single
   token, even though the text itself already wraps at spaces. Capping width
   and letting it break mid-word keeps one wide cell from pushing every other
   column out of the visible area. */
td {
  max-width: 340px;
  overflow-wrap: anywhere;
}
th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
}

tr.clickable-row {
  cursor: pointer;
}
tr.clickable-row:hover {
  background: rgba(196, 168, 122, 0.1);
}
tr.clickable-row.selected {
  background: rgba(196, 168, 122, 0.18);
}

.search-box-input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
}

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.role-badge.admin { background: rgba(196, 168, 122, 0.2); color: var(--accent-sand); }
.role-badge.viewer { background: rgba(143, 203, 155, 0.15); color: var(--good); }

/* Поставщики: статус проверки — не начата (голубой) / в работе (жёлтый) /
   прошёл (зелёный) / не прошёл (красный), тот же pill-стиль что .role-badge. */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge.info { background: rgba(110, 193, 228, 0.15); color: var(--info); }
.status-badge.medium { background: rgba(239, 159, 39, 0.15); color: var(--medium); }
.status-badge.good { background: rgba(143, 203, 155, 0.15); color: var(--good); }
.status-badge.bad { background: rgba(226, 72, 77, 0.15); color: var(--bad); }
.status-badge.neutral { background: rgba(250, 246, 238, 0.08); color: var(--text-secondary); }

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  padding: 24px;
}

.center-screen h1 {
  font-size: 22px;
  margin: 0;
}
.center-screen p {
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent-sand);
  color: var(--bg-header);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

.admin-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.admin-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
}

.error-text { color: var(--bad); font-size: 13px; }
.empty-state { color: var(--text-secondary); font-size: 14px; padding: 12px 0; }

/* Full-page "still loading" placeholder — spinner + label, centered. Used
   where a page has literally nothing else to show yet (e.g. before the
   first status fetch resolves), as opposed to inline button spinners. */
.page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 0;
  color: var(--text-secondary);
  font-size: 14px;
}
.page-loading .spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent-sand);
  animation: page-loading-spin 0.8s linear infinite;
}
@keyframes page-loading-spin {
  to { transform: rotate(360deg); }
}

.login-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-panel { width: 100%; max-width: 340px; }
.login-form { flex-direction: column; align-items: stretch; }
.login-form input { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 14px; }
.password-field { position: relative; display: flex; }
.password-field input { padding-right: 36px !important; }
.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 6px;
  border-radius: 6px;
}
.password-toggle:hover { color: var(--text); background: rgba(250, 246, 238, 0.06); }

.login-panel code {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--accent-sand);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  word-break: break-all;
}

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 11, 0.7);
  z-index: 100002;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.search-panel {
  width: 100%;
  max-width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.search-input-row i.ti-search {
  color: var(--text-secondary);
  font-size: 18px;
}
.search-input-row input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}
.search-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 6px;
}
.search-close:hover { color: var(--text); background: rgba(250, 246, 238, 0.06); }
.search-results {
  overflow-y: auto;
  padding: 6px;
}
.search-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 10px 10px 4px;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.search-result i {
  color: var(--accent-sand);
  font-size: 16px;
  width: 16px;
  text-align: center;
}
.search-result:hover {
  background: rgba(250, 246, 238, 0.06);
}
.search-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* МояКоманда — умный поиск, styled like the .search-input-row/.search-panel
   command-palette overlay above but embedded in the page (not position:fixed) —
   same pill-shaped input-with-icon look, same rounded bordered panel for results. */
.botmk-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.botmk-search-box i.ti-search {
  color: var(--text-secondary);
  font-size: 18px;
}
.botmk-search-box input,
.botmk-search-box textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  resize: none;
}
.botmk-search-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 14px;
}
.botmk-search-tab {
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.botmk-search-tab.active {
  background: var(--accent-sand);
  color: var(--bg-header);
  font-weight: 600;
}
.botmk-results-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  margin-top: 14px;
}
.botmk-results-panel .search-group-label {
  padding: 10px 12px 6px;
}
.botmk-results-panel .card {
  margin: 4px 6px;
}

.export-dialog {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  width: 100%;
  max-width: 380px;
}
.export-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}
.export-dialog-form { display: flex; flex-direction: column; gap: 16px; }
.export-dialog-form h3 { margin: 0; font-size: 16px; }
.export-section { display: flex; flex-direction: column; gap: 8px; }
.export-section-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.export-section label { font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.export-section input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  margin-top: 6px;
}
.export-presets { display: flex; gap: 4px; flex-wrap: wrap; }
.export-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.login-form .btn-primary { margin-top: 4px; }

tr.row-inactive {
  opacity: 0.5;
}
tr.row-inactive:hover {
  opacity: 0.75;
}

.inactive-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(226, 72, 77, 0.15);
  color: var(--bad);
  vertical-align: middle;
}
.inactive-badge.compact {
  padding: 1px 6px;
  font-size: 10px;
  margin-left: 4px;
}

tr.row-match {
  background: rgba(196, 168, 122, 0.16);
  box-shadow: inset 3px 0 0 var(--accent-sand);
}
tr.row-match:hover {
  background: rgba(196, 168, 122, 0.24);
}

td a.entity-link {
  color: var(--accent-sand);
  text-decoration: none;
}
td a.entity-link:hover {
  text-decoration: underline;
}

th.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable-th:hover {
  color: var(--accent-sand);
}

tr.filter-row th {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
}
.table-filter-input,
.page-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-sand), var(--good));
  z-index: 100001;
  opacity: 0;
  transition: width 0.25s ease, opacity 0.2s ease;
  box-shadow: 0 0 8px rgba(196, 168, 122, 0.6);
}
.page-loading-bar.is-active {
  opacity: 1;
}
.page-loading-bar.is-done {
  opacity: 0;
  transition: width 0.2s ease, opacity 0.4s ease 0.1s;
}

/* Site-wide request status: prominent banner under the header for the page's
   first load, compact corner chip for later background requests (save,
   filter, refresh). Driven by siteUX.js's initRequestStatus(). Bottom-left so
   it never overlaps .achievement-toast, which lives bottom-right. */
.request-status-banner,
.request-status-chip {
  position: fixed;
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color: var(--text-secondary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.request-status-banner {
  top: 12px;
  left: 50%;
  padding: 8px 16px;
  font-size: 13px;
  transform: translate(-50%, -8px);
}
.request-status-banner.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.request-status-chip {
  left: 20px;
  bottom: 20px;
  padding: 6px 12px;
  font-size: 12px;
  transform: translateY(8px);
}
.request-status-chip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.request-status-banner.is-error,
.request-status-chip.is-error {
  color: var(--bad);
  border-color: var(--bad);
}
.request-status-banner .spinner,
.request-status-chip .spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent-sand);
  animation: page-loading-spin 0.8s linear infinite;
  flex: none;
}
.request-status-banner.is-error .spinner,
.request-status-chip.is-error .spinner {
  display: none;
}

.scroll-nav {
  position: fixed;
  left: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}
.scroll-nav button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.scroll-nav button:hover {
  border-color: var(--accent-sand);
  color: var(--accent-sand);
}

.logo-link {
  text-decoration: none;
  color: inherit;
}

.names {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.week-all-clear {
  text-align: center;
  color: var(--good);
  font-style: italic;
}

.week-not-done-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
}
.week-not-done-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}
.week-not-done-row .btn {
  padding: 4px 10px;
  font-size: 12px;
}

/* Hover/focus "?" tooltip — content comes from the data-tip attribute so no
   extra markup is needed per instance beyond the span itself. */
.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--text-secondary);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  position: relative;
  margin-left: 5px;
  vertical-align: middle;
}
.info-tip:hover,
.info-tip:focus {
  border-color: var(--accent-sand);
  color: var(--accent-sand);
  outline: none;
}
.info-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 260px;
  background: var(--bg-header);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  z-index: 60;
  pointer-events: none;
}
.info-tip:hover::after,
.info-tip:focus::after {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 720px) {
  .app-header {
    padding: 12px 14px;
    gap: 10px;
  }
  .app-header h1 {
    font-size: 15px;
  }
  .main-nav a, .main-nav-action {
    font-size: 12px;
    padding: 5px 8px;
  }
  .header-right {
    font-size: 12px;
    gap: 10px;
    width: 100%;
    justify-content: flex-end;
  }

  main {
    padding: 12px;
    gap: 16px;
  }

  .cards-row {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }
  .card {
    padding: 12px 14px;
  }
  .card .value {
    font-size: 22px;
  }

  .panel {
    padding: 14px;
  }

  /* No horizontal page scroll for wide tables — the table itself scrolls
     instead, without needing a wrapper element on every page. */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  thead, tbody, tr {
    display: table;
    width: 100%;
    table-layout: auto;
  }

  .scope-toggle {
    flex-wrap: wrap;
  }
  .date-range {
    flex-wrap: wrap;
  }

  .scroll-nav {
    left: 12px;
    bottom: 12px;
    gap: 6px;
  }
  .scroll-nav button {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .export-dialog {
    max-width: 92vw;
  }
}

/* Interactive product tour (public/js/tour.js) — dims everything except a
   "spotlight" hole around the current step's target, forcing the user
   through the highlighted element before the rest of the page unlocks. */
.tour-dim-panel {
  position: fixed;
  background: rgba(10, 16, 11, 0.78);
  z-index: 99997;
  transition: all 0.15s ease;
}
.tour-spotlight-ring {
  position: fixed;
  border: 2px solid var(--accent-sand);
  border-radius: 10px;
  box-shadow: 0 0 0 4px rgba(196, 168, 122, 0.22), 0 0 24px rgba(196, 168, 122, 0.35);
  z-index: 99998;
  pointer-events: none;
  transition: all 0.15s ease;
}
/* Secondary highlight — picks out one specific random row within an
   already-spotlighted list (e.g. "click any agent") so there's a concrete
   suggestion, not just "somewhere in this area". */
.tour-row-highlight {
  position: fixed;
  border: 2px dashed var(--accent-sand);
  border-radius: 6px;
  background: rgba(196, 168, 122, 0.12);
  z-index: 99998;
  pointer-events: none;
  transition: all 0.15s ease;
  animation: tour-row-pulse 1.6s ease-in-out infinite;
}
@keyframes tour-row-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 168, 122, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(196, 168, 122, 0); }
}
.tour-tooltip {
  position: fixed;
  z-index: 99999;
  max-width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--accent-sand);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.tour-tooltip-progress {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-sand);
  margin-bottom: 6px;
}
.tour-tooltip-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}
.tour-tooltip-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}
.tour-tooltip-hint {
  font-size: 12px;
  color: var(--accent-sand);
  font-weight: 600;
}
.tour-tooltip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.tour-skip-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
}
.tour-skip-link:hover { color: var(--text); }
.tour-tooltip-secondary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tour-welcome-card {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(460px, 90vw);
  height: fit-content;
  z-index: 99999;
  background: var(--bg-card);
  border: 1px solid var(--accent-sand);
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.tour-welcome-card h2 {
  margin: 0 0 10px;
  font-size: 19px;
}
.tour-welcome-card p {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}
.tour-badge {
  display: inline-block;
  background: rgba(196, 168, 122, 0.18);
  color: var(--accent-sand);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.tour-resume-pill {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  background: var(--bg-card);
  border: 1px solid var(--accent-sand);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.tour-demo-banner {
  background: rgba(196, 168, 122, 0.14);
  border: 1px solid var(--accent-sand);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--accent-sand);
}

/* Generic centered modal (public/js/modal.js) — same visual language as
   .tour-welcome-card, but a standalone component not coupled to the tour
   system, with its own dimmed backdrop and a fade+scale-in transition. */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 16, 11, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.modal-overlay.is-open {
  opacity: 1;
}
.modal-card {
  width: min(440px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--accent-sand);
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.96) translateY(6px);
  transition: transform 0.18s ease;
}
.modal-overlay.is-open .modal-card {
  transform: scale(1) translateY(0);
}
.modal-card h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.modal-card .modal-subtitle {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 13px;
}
.modal-field-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.modal-card-footer {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

/* Modern checklist — custom checkbox rows instead of bare native
   checkboxes, used for the service picker (real "Начать проверку" form
   and the demo/test-check equivalent). */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.checklist-item:hover {
  border-color: var(--accent-sand);
}
.checklist-item.is-checked {
  border-color: var(--accent-sand);
  background: rgba(196, 168, 122, 0.12);
}
.checklist-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.checklist-item-box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.checklist-item.is-checked .checklist-item-box {
  border-color: var(--accent-sand);
  background: var(--accent-sand);
}
.checklist-item-box::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid var(--bg-header);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.12s ease;
  margin-top: -2px;
}
.checklist-item.is-checked .checklist-item-box::after {
  transform: rotate(45deg) scale(1);
}

/* Custom select (public/js/customSelect.js) — animated dropdown used
   everywhere a <select> would go: action forms (add/edit error), admin
   controls, table/filter selects. Same border/accent language as
   .checklist-item. `.compact` is the dense variant for filter rows
   (mirrors the old .table-filter-select sizing); `.is-disabled` mirrors a
   native <select disabled>. */
.custom-select {
  position: relative;
  display: inline-block;
  min-width: 160px;
}
.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.custom-select-trigger:hover {
  border-color: var(--accent-sand);
}
.custom-select.is-open .custom-select-trigger {
  border-color: var(--accent-sand);
}
.custom-select.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}
.custom-select.compact {
  min-width: 0;
}
.custom-select.compact .custom-select-trigger {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  gap: 4px;
}
.custom-select.compact .custom-select-chevron {
  font-size: 14px;
}
.custom-select.compact .custom-select-panel {
  font-size: 12px;
  padding: 4px;
}
.custom-select.compact .custom-select-option {
  padding: 6px 8px;
  font-size: 12px;
}
.custom-select-trigger span.is-placeholder {
  color: var(--text-secondary);
}
.custom-select-chevron {
  flex-shrink: 0;
  transition: transform 0.15s ease;
  color: var(--text-secondary);
}
.custom-select.is-open .custom-select-chevron {
  transform: rotate(180deg);
}
.custom-select-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--accent-sand);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: scale(0.97) translateY(-4px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.custom-select.is-open .custom-select-panel {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.custom-select-option {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.custom-select-option:hover {
  background: var(--bg);
}
.custom-select-option.is-selected {
  background: rgba(196, 168, 122, 0.15);
  color: var(--accent-sand);
}

/* Non-blocking confirmation for demo/test flows (public/js/testResolveModal.js) — a native alert() would be a blocking dialog the scripted tour can't dismiss on its own. */
.demo-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--accent-sand);
  border-radius: 10px;
  padding: 12px 20px;
  color: var(--text);
  font-size: 14px;
  max-width: min(420px, calc(100vw - 32px));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  z-index: 100000;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.demo-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Pagination controls (public/js/managersUnresolved.js and similar). */
.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.pagination-current {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Steam-style "achievement unlocked" toast (public/js/achievementToast.js). */
.achievement-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 320px;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-header));
  border: 1px solid var(--accent-sand);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}
.achievement-toast.show {
  transform: translateX(0);
  opacity: 1;
}
.achievement-toast-icon {
  font-size: 30px;
  flex-shrink: 0;
}
.achievement-toast-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-sand);
  font-weight: 700;
}
.achievement-toast-title {
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
}
.achievement-toast-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Achievements page (/achievements). */
.achievement-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
}
.achievement-card.locked { opacity: 0.5; }
.achievement-card-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(196, 168, 122, 0.14);
  flex-shrink: 0;
}
.achievement-card.locked .achievement-card-icon { filter: grayscale(1); }
.achievement-card-body { flex: 1; min-width: 0; }
.achievement-card-title { font-weight: 700; font-size: 15px; }
.achievement-card-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.achievement-card-progress-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(250, 246, 238, 0.08);
  overflow: hidden;
}
.achievement-card-progress-fill {
  height: 100%;
  background: var(--accent-sand);
  border-radius: 999px;
}
.achievement-card-meta {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Reusable stand-in for .panels-grid's gap when a page needs a single
   *stacked* column of panels inside its own show/hide wrapper div, rather
   than that class's 2-column grid — any <div id="..." style="display:none">
   toggled to visible by JS that wraps 2+ sibling .panel/.cards-row blocks
   needs this, or main's own 24px gap (which only reaches its *direct*
   children) never applies between them and their rounded borders touch
   directly (found across three separate pages this way — Бот МК's session/
   cache cards, its search-results panels, Поставщиков' home and stats
   panels — same root cause each time: a wrapper div with no gap of its
   own). JS must toggle this element's display to "flex", not "block", for
   the gap to actually take effect. */
.panel-stack {
  flex-direction: column;
  gap: 24px;
}

/* Бот МК: главная (/botmk) — карточки сессии/кеша с бейджами статуса и
   анимированным прогресс-баром обновления. */
.botmk-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.botmk-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(196, 168, 122, 0.14);
  color: var(--accent-sand);
  flex-shrink: 0;
}
.botmk-card-head-title { flex: 1; min-width: 0; }
.botmk-card-head-title h2 { margin: 0; }
.botmk-card-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Дот + текст — статус сессии/кеша. Тот же смысл, что у .status-badge, но
   с точкой вместо заливки всей плашки — компактнее рядом с заголовком. */
.botmk-dot-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgba(250, 246, 238, 0.06);
}
.botmk-dot-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  flex-shrink: 0;
}
.botmk-dot-badge.is-good { color: var(--good); }
.botmk-dot-badge.is-warning { color: var(--medium); }
.botmk-dot-badge.is-bad { color: var(--bad); }
.botmk-dot-badge.is-neutral { color: var(--text-secondary); }
.botmk-dot-badge.is-neutral::before { animation: none; }
.botmk-dot-badge.is-good::before,
.botmk-dot-badge.is-warning::before {
  animation: botmk-pulse 1.8s ease-in-out infinite;
}
@keyframes botmk-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.botmk-otp-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(239, 159, 39, 0.08);
  border: 1px solid rgba(239, 159, 39, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.botmk-otp-box i { color: var(--medium); font-size: 18px; flex-shrink: 0; }
.botmk-otp-box input { flex: 1; min-width: 180px; }

.botmk-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.botmk-stat-tile {
  background: rgba(250, 246, 238, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.botmk-stat-tile-label {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.botmk-stat-tile-value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
}
.botmk-stat-tile.is-stale .botmk-stat-tile-value { color: var(--medium); }

.botmk-progress-wrap {
  margin: 14px 0;
}
.botmk-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.botmk-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(250, 246, 238, 0.08);
  overflow: hidden;
  position: relative;
}
.botmk-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-sand), #DCC098);
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}
.botmk-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 45%,
    transparent 60%
  );
  background-size: 200% 100%;
  animation: botmk-shimmer 1.6s linear infinite;
}
@keyframes botmk-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.botmk-account-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
}
.botmk-account-summary i { color: var(--accent-sand); }

/* Бот МК: поиск (/botmk/search) — история запросов, отдельный таб рядом с
   "Один запрос"/"Несколько запросов". Каждая строка кликабельна — повторяет
   сохранённый запрос. */
.botmk-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 4px 6px;
  border-radius: 8px;
  background: rgba(250, 246, 238, 0.03);
  cursor: pointer;
  transition: background 0.15s ease;
}
.botmk-history-item:hover { background: rgba(196, 168, 122, 0.1); }
.botmk-history-item i { color: var(--accent-sand); flex-shrink: 0; }
.botmk-history-item-query {
  flex: 1;
  min-width: 0;
  white-space: pre-line;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.botmk-history-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Бот МК: выгрузки (/botmk/exports) — сетка кликабельных карточек, каждая
   открывает попап с параметрами фильтра (или сразу скачивает, если их нет). */
.botmk-export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.botmk-export-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(250, 246, 238, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.botmk-export-card:hover {
  background: rgba(196, 168, 122, 0.08);
  border-color: rgba(196, 168, 122, 0.3);
}
.botmk-export-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(196, 168, 122, 0.14);
  color: var(--accent-sand);
  flex-shrink: 0;
}
.botmk-export-card-title { font-weight: 600; font-size: 14px; }
.botmk-export-card-desc { font-size: 12px; color: var(--text-secondary); margin-top: 3px; line-height: 1.4; }

.botmk-export-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.botmk-export-field { margin-bottom: 14px; }
.botmk-export-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.botmk-export-checklist {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Brief "Загрузка…" placeholder shown while the tour's spotlight target is
   still settling (async page data) — see tour.js's renderLoadingHint. */
.tour-loading-hint {
  border-color: var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}

/* Бот МК: Плееркоины (/botmk/coins) */
.coins-tab-panel {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.coins-amount-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.coins-amount-row input,
.coins-amount-row textarea {
  flex: 1;
  min-width: 180px;
}
#bulk-names-input,
#single-comment-input {
  width: 100%;
  box-sizing: border-box;
}
.coins-search-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
}
.coins-search-result-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
.coins-search-result-row:hover {
  background: rgba(250, 246, 238, 0.04);
  border-color: var(--border);
}
.coins-selected-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.coins-selected-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.coins-selected-name {
  font-weight: 600;
}
.coins-summary {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.coins-summary .coins-summary-bad {
  color: var(--bad);
}
.coins-summary ul {
  margin: 2px 0 0;
  padding-left: 18px;
}
.coins-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.coins-preview-table th,
.coins-preview-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.coins-delta-positive { color: var(--good); }
.coins-delta-negative { color: var(--bad); }

/* ===========================================================================
   Бот МК — buttons/selects/modals/popups polish.
   Scoped under .botmk-page (set on <body> of every /botmk/* page) rather
   than edited on the base .btn/.custom-select-*/.modal-* rules directly, so
   this doesn't ripple into Лавка/Поставщики/Кандидаты — those keep their
   current look untouched. modal.js appends its overlay straight onto
   <body>, and customSelect's panel lives wherever the trigger was inserted
   in the page, so both still end up as real descendants of .botmk-page and
   these selectors reach them correctly.
   =========================================================================== */

.botmk-page .btn {
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.botmk-page .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}
.botmk-page .btn:active {
  transform: translateY(0);
  box-shadow: none;
}
.botmk-page .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.botmk-page .btn-primary {
  background: linear-gradient(135deg, var(--accent-sand), #DCC098);
  box-shadow: 0 2px 10px rgba(196, 168, 122, 0.22);
}
.botmk-page .btn-primary:hover {
  box-shadow: 0 6px 18px rgba(196, 168, 122, 0.35);
}
.botmk-page .btn-danger:hover {
  box-shadow: 0 6px 18px rgba(226, 72, 77, 0.3);
  opacity: 1;
}

.botmk-page .custom-select-trigger {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.botmk-page .custom-select-trigger:hover {
  box-shadow: 0 0 0 3px rgba(196, 168, 122, 0.1);
}
.botmk-page .custom-select.is-open .custom-select-trigger {
  box-shadow: 0 0 0 3px rgba(196, 168, 122, 0.16);
}
.botmk-page .custom-select-panel {
  backdrop-filter: blur(8px);
  background: rgba(31, 46, 34, 0.92);
}
.botmk-page .custom-select-option {
  transition: background 0.12s ease;
}

.botmk-page .modal-overlay {
  backdrop-filter: blur(3px);
}
.botmk-page .modal-card {
  position: relative;
  overflow: hidden;
}
.botmk-page .modal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-sand), #DCC098, var(--accent-sand));
}

.botmk-page .botmk-search-tab {
  transition: background 0.15s ease, color 0.15s ease;
}
.botmk-page .botmk-search-tab:not(.active):hover {
  background: rgba(250, 246, 238, 0.06);
  color: var(--text);
}

.botmk-page .botmk-search-box {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.botmk-page .botmk-search-box:focus-within {
  border-color: var(--accent-sand);
  box-shadow: 0 0 0 3px rgba(196, 168, 122, 0.12);
}

.botmk-page .botmk-export-card {
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.botmk-page .botmk-export-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.botmk-page .checklist-item {
  transition: background 0.12s ease;
  border-radius: 6px;
}
.botmk-page .checklist-item:hover {
  background: rgba(250, 246, 238, 0.05);
}

.mono-value {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  background: rgba(250, 246, 238, 0.06);
  border-radius: 4px;
  padding: 1px 5px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  vertical-align: middle;
  transition: color 0.12s ease, background 0.12s ease;
}
.copy-btn:hover {
  color: var(--accent-sand);
  background: rgba(250, 246, 238, 0.08);
}
.copy-btn.is-copied {
  color: #7FBF7F;
}

