/* РОПобот UX v2 — Components & Layout */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

body.ropo-v2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-text);
  background: linear-gradient(165deg, var(--color-gradient-start) 0%, var(--color-gradient-end) 100%);
  min-height: 100vh;
}

.ropo-container {
  max-width: var(--grid-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 1024px) {
  .ropo-container { padding: 0 var(--space-5); }
}

.ropo-app { display: flex; min-height: 100vh; }

.ropo-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--color-bg-subtle);
  border-right: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-2);
}
.ropo-sidebar__brand {
  padding: 0 var(--space-1) var(--space-3);
  margin-bottom: var(--space-1);
  border-bottom: 1px solid var(--color-border);
}

.ropo-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.ropo-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-3);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.ropo-content { flex: 1; padding: var(--space-3); }

.ropo-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-3);
}

.ropo-card__title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0 0 var(--space-2);
}

.ropo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  height: 40px;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 150ms ease;
  text-decoration: none;
}
a.ropo-btn:hover { text-decoration: none; }

.ropo-btn--primary {
  color: #fff;
  background: linear-gradient(180deg, #3B82F6 0%, var(--color-primary) 100%);
  box-shadow: var(--shadow-sm);
}

.ropo-btn--primary:hover {
  background: linear-gradient(180deg, #60A5FA 0%, var(--color-primary-hover) 100%);
  box-shadow: var(--shadow-md);
}

.ropo-btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.ropo-nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 10px var(--space-2);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
}
a.ropo-nav__item:hover { text-decoration: none; }

.ropo-nav__item:hover { background: var(--color-bg-muted); color: var(--color-text); }

.ropo-nav__item--active {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}

.ropo-tooltip-wrap { position: relative; display: inline-flex; }

.ropo-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
}

.ropo-tooltip-wrap.is-visible .ropo-tooltip { opacity: 1; }

/* Плавающая подсказка для таблиц и обрезанного текста */
#ropo-tooltip-float {
  position: fixed;
  z-index: 10050;
  max-width: min(420px, 90vw);
  padding: 8px 12px;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: var(--text-xs);
  line-height: 1.45;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  white-space: pre-wrap;
  word-break: break-word;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}
#ropo-tooltip-float.is-visible { opacity: 1; }

.ropo-theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
}

.ropo-stepper { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); }

.ropo-stepper__step {
  flex: 1;
  text-align: center;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.ropo-stepper__step--active {
  background: var(--color-primary-subtle);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}
.ropo-stepper__step--done {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.ropo-wizard__actions {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}
.ropo-summary {
  display: grid;
  gap: var(--space-2);
}
.ropo-summary__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.ropo-summary__label { color: var(--color-text-muted); }
.ropo-summary__value { font-weight: 600; text-align: right; }

.ropo-select {
  width: 100%;
  height: 40px;
  padding: 0 2.25rem 0 var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--color-text);
  font-size: var(--text-sm);
  appearance: none;
}
.ropo-cell-plain { max-width: 260px; }
.ropo-form-tab .ropo-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
}
.ropo-form-tab .ropo-input,
.ropo-form-tab .ropo-select,
.ropo-form-tab .ropo-input-group__addon {
  font-size: var(--text-sm);
}
.ropo-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.ropo-form-tab .ropo-badge {
  font-size: var(--text-xs);
}
.ropo-table-search {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}
.ropo-table-search__input {
  width: 100%;
  max-width: 100%;
}
.ropo-cell-date-inline {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text);
  white-space: nowrap;
}
.ropo-cell-ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.ropo-list-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}
.ropo-list-tabs__nav {
  display: flex;
  gap: var(--space-1);
}
.ropo-list-tabs__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
  flex-shrink: 0;
}

/* Горизонтальные подтабы (методология: Настройка / Обогащение) */
.ropo-subtabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
  padding: 4px;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  width: fit-content;
  margin-left: auto;
}
.ropo-subtabs__link {
  padding: 8px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
}
.ropo-subtabs__link:hover { color: var(--color-text); }
.ropo-subtabs__link--active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* Редактор методологии — legacy-разметка в v2-оболочке */
.ropo-methodology .accordion-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-1);
  overflow: hidden;
  background: var(--color-surface);
}
.ropo-methodology .accordion-button {
  background: var(--color-bg-subtle);
  color: var(--color-text);
  font-weight: 500;
  box-shadow: none;
}
.ropo-methodology .accordion-button:not(.collapsed) {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}
.ropo-methodology .form-control,
.ropo-methodology textarea.form-control {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
}
.ropo-methodology .btn-primary {
  background: linear-gradient(180deg, #3B82F6 0%, var(--color-primary) 100%);
  border: none;
  border-radius: var(--radius-md);
}
.ropo-methodology .btn-danger {
  border-radius: var(--radius-md);
}
.ropo-methodology .nav-pills .nav-link.active {
  background: var(--color-primary);
}
.ropo-methodology .nav-pills .nav-link {
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
}

/* Панель управления проектом */
.ropo-control { display: flex; flex-direction: column; gap: var(--space-2); }
.ropo-control__step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.ropo-control__step--disabled {
  opacity: 0.45;
  filter: grayscale(0.8);
  pointer-events: none;
}
.ropo-control__title { margin: 0 0 4px; font-size: var(--text-lg); font-weight: 600; }
.ropo-control__desc { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.ropo-control__text { flex: 1; min-width: 0; }

/* Аналитика */
.ropo-analytics .card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.ropo-analytics .table { font-size: var(--text-sm); }
.ropo-alert--info {
  background: var(--color-primary-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  text-align: center;
}

/* Dropdown отчётов */
.ropo-dropdown { position: relative; }
.ropo-dropdown__menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 140px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-1);
  z-index: 20;
}
.ropo-dropdown__menu.is-open { display: block; }
.ropo-dropdown__item {
  display: block;
  padding: 8px var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-sm);
}
.ropo-dropdown__item:hover { background: var(--color-bg-muted); }

.ropo-analytics .radar-chart {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-sm);
}

.ropo-dropzone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  background: var(--color-bg-subtle);
  cursor: pointer;
}

.ropo-dropzone:hover { border-color: var(--color-primary); background: var(--color-primary-subtle); }

.ropo-progress {
  height: 8px;
  background: var(--color-bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.ropo-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, #60A5FA 100%);
  transition: width 250ms ease;
}

.ropo-input {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
}

.ropo-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.ropo-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: 6px;
}

/* Tabs — vertical sidebar inside card */
.ropo-tabs { display: flex; gap: var(--space-3); }
.ropo-tabs__nav { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; }
.ropo-tabs__link {
  display: block;
  padding: 10px var(--space-2);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
}
.ropo-tabs__link:hover { background: var(--color-bg-muted); color: var(--color-text); }
.ropo-tabs__link--active {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  font-weight: 600;
}
.ropo-tabs__panel { flex: 1; min-width: 0; }
.ropo-tabs__pane { display: none; }
.ropo-tabs__pane--active { display: block; }
.ropo-tabs__pane[hidden] { display: none !important; }
[hidden] { display: none !important; }

/* Project cards grid */
.ropo-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-3);
}
.ropo-project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-2) var(--space-3);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: auto;
}
.ropo-project-card__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-bottom: var(--space-2);
}
.ropo-project-card__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0 0 var(--space-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: var(--space-1);
}
.ropo-project-card__meta { color: var(--color-text-muted); font-size: var(--text-xs); margin-top: var(--space-1); margin-bottom: 0; }
.ropo-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--color-bg-muted);
  color: var(--color-text);
}
.ropo-badge--info { background: var(--color-primary-subtle); color: var(--color-primary); }
.ropo-badge--success { background: #DCFCE7; color: var(--color-success); }
.ropo-badge--danger { background: #FEE2E2; color: var(--color-danger); }
[data-theme="dark"] .ropo-badge--success { background: #14532D; }
[data-theme="dark"] .ropo-badge--danger { background: #450A0A; }

.ropo-alert {
  padding: var(--space-2);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}
.ropo-alert--danger {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: var(--color-danger);
}
[data-theme="dark"] .ropo-alert--danger { background: #450A0A; border-color: #7F1D1D; }

.ropo-field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-2); margin-bottom: var(--space-2); }
.ropo-input-group { display: flex; align-items: stretch; }
.ropo-input-group .ropo-input { border-radius: 0; }
.ropo-input-group .ropo-input:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.ropo-input-group .ropo-input:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.ropo-input-group__addon {
  display: flex;
  align-items: center;
  padding: 0 var(--space-2);
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* file-area plugin inside dropzone */
.ropo-dropzone.file-area .files { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-bottom: var(--space-2); }
.ropo-dropzone.file-area .hint { color: var(--color-text-muted); font-size: var(--text-sm); margin: var(--space-2) 0 0; }
.ropo-dropzone__hint-icon { color: var(--color-primary); cursor: help; margin-left: 4px; }

.ropo-profile-menu { position: relative; }
.ropo-profile-menu__dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-1);
  z-index: 50;
}
.ropo-profile-menu.is-open .ropo-profile-menu__dropdown { display: block; }
.ropo-profile-menu__item {
  display: block;
  padding: 8px var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-sm);
}
.ropo-profile-menu__item:hover { background: var(--color-bg-muted); }
.ropo-profile-menu__item--danger { color: var(--color-danger); }

/* Таблицы внутри v2 shell (legacy datatables) */
.ropo-card .table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.ropo-card .table thead th {
  text-align: left;
  padding: 12px var(--space-2);
  color: var(--color-text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}
.ropo-card .table tbody td {
  padding: 12px var(--space-2);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
.ropo-card .table tbody tr:hover { background: var(--color-bg-subtle); }
.ropo-card .form-control {
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 var(--space-2);
  background: var(--color-surface);
  color: var(--color-text);
}

/* ─── Admin data lists ─── */
.ropo-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.ropo-page-header__title { margin: 0; font-size: var(--text-2xl); font-weight: 600; }
.ropo-page-header__desc { margin: 4px 0 0; color: var(--color-text-muted); font-size: var(--text-sm); }

.ropo-data-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.ropo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}
.ropo-toolbar__search {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.ropo-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

.ropo-filters {
  display: none;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  gap: var(--space-2);
}
.ropo-filters.is-open { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.ropo-filters__field label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.ropo-table-wrap { overflow-x: auto; margin: 0; padding: 0; }
.ropo-data-panel .table { margin: 0; border-collapse: collapse; }
.ropo-data-panel .table.text-nowrap { white-space: normal; }
.ropo-data-panel .custom-datatables-sort-trigger {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
}
.ropo-data-panel .custom-datatables-sort-trigger.active { color: var(--color-primary); }
.ropo-data-panel .custom-datatables-sort-trigger.asc::after { content: ' ↑'; }
.ropo-data-panel .custom-datatables-sort-trigger.desc::after { content: ' ↓'; }

.ropo-table-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
.ropo-cell-num,
.ropo-cell-plain__text,
.ropo-cell-link {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text);
}
.ropo-cell-link {
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.ropo-cell-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}
.ropo-table-filters__cell {
  padding: 6px var(--space-3) var(--space-2) !important;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.ropo-table-filter {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-subtle);
  font-size: var(--text-xs);
  color: var(--color-text);
}
.ropo-table-filter::placeholder { color: var(--color-text-muted); }
.ropo-table-filter:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-surface);
}
.ropo-profile-row {
  display: flex;
  gap: var(--space-3);
  align-items: stretch;
}
.ropo-profile-row > .ropo-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ropo-btn--sm {
  height: 32px;
  padding: 0 12px;
  font-size: var(--text-xs);
}
.ropo-btn--icon {
  width: 32px;
  padding: 0;
}
.ropo-btn--danger {
  color: var(--color-danger);
  border-color: #FECACA;
  background: #FEF2F2;
}
.ropo-btn--danger:hover { background: #FEE2E2; }
.ropo-btn--warning {
  color: var(--color-warning);
  border-color: #FDE68A;
  background: #FFFBEB;
}
[data-theme="dark"] .ropo-btn--danger { background: #450A0A; border-color: #7F1D1D; }
[data-theme="dark"] .ropo-btn--warning { background: #422006; border-color: #78350F; }

.ropo-cell-user__name { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ropo-cell-user__meta { display: block; font-size: var(--text-xs); color: var(--color-text-muted); }
.ropo-cell-plain__text { display: block; font-weight: 400; }
.ropo-cell-plain__meta { display: block; font-size: var(--text-xs); color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ropo-cell-date__main { display: block; font-weight: 400; }
.ropo-cell-date__meta { display: block; font-size: var(--text-xs); color: var(--color-text-muted); }
.ropo-table-error { color: var(--color-danger) !important; }

.ropo-data-panel .pagination-style-4 .page-link {
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  margin: 0 2px;
}
.ropo-data-panel .pagination-style-4 .page-item.active .page-link {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.ropo-data-panel .d-flex.align-items-center.p-3 {
  padding: var(--space-2) var(--space-3) !important;
  border-top: 1px solid var(--color-border);
}

/* Toast & modal v2 */
.ropo-toast-container {
  position: fixed;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  pointer-events: none;
}
.ropo-toast-container .toast { pointer-events: auto; }
.ropo-toast {
  min-width: 280px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.ropo-toast__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px var(--space-2);
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-size: var(--text-sm);
}
.ropo-toast.bg-danger-transparent .ropo-toast__header { background: var(--color-danger); }
.ropo-toast__close {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.ropo-toast__body { padding: var(--space-2); font-size: var(--text-sm); }

.modal-content.ropo-modal,
.ropo-modal.modal-content {
  border: none;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}
.ropo-modal .ropo-input,
.ropo-modal .ropo-select {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  width: 100%;
}
.ropo-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.ropo-modal__title { margin: 0; font-size: var(--text-lg); font-weight: 600; }
.ropo-modal__body { padding: var(--space-3); font-size: var(--text-sm); }
.ropo-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--color-border);
}

.ropo-form-card { max-width: 560px; }
.ropo-form-card .ropo-card__title { margin-bottom: var(--space-3); }
.ropo-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-1);
  margin-top: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--color-border);
}
.ropo-form-actions--sticky {
  position: sticky;
  bottom: 0;
  background: var(--color-surface);
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.06);
  z-index: 10;
}

/* Bootstrap modal в v2 shell */
.ropo-file-upload {
  display: block;
  margin-bottom: var(--space-2);
}
.ropo-file-upload .files:empty + .hint { margin-top: var(--space-3); }

/* Bootstrap modal в v2 shell */
.modal { display: none; position: fixed; inset: 0; z-index: 1050; overflow-x: hidden; overflow-y: auto; }
.modal.show { display: block; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1040; }
.modal-dialog { margin: 1.75rem auto; max-width: 500px; padding: 0 var(--space-2); }
.offcanvas {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1060;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  visibility: hidden;
  transform: translateX(100%);
  transition: transform .2s ease, visibility .2s;
}
.offcanvas.show {
  visibility: visible;
  transform: translateX(0);
}
.offcanvas-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 1055;
}

.ropo-sidebar__project {
  padding: var(--space-1) var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ropo-notify { position: relative; }
.ropo-notify__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}
.ropo-notify__btn:hover { background: var(--color-bg-muted); }
.ropo-notify__icon { display: block; opacity: .85; }
.ropo-notify__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 260px;
  padding: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.ropo-notify__empty { margin: 0; }

.ropo-data-panel table.custom-datatables {
  table-layout: auto;
  width: 100%;
  border-collapse: collapse;
}
/* Компактная таблица — админка «Проекты» без горизонтального скролла */
.ropo-data-panel--compact table.custom-datatables {
  table-layout: fixed;
}
.ropo-data-panel--compact table.custom-datatables th,
.ropo-data-panel--compact table.custom-datatables td {
  padding: 8px 10px;
}
.ropo-data-panel--compact .ropo-col-id {
  width: 44px;
  padding-right: 4px;
  padding-left: var(--space-3);
}
.ropo-data-panel--compact .ropo-col-name {
  width: 26%;
  padding-left: 4px;
}
.ropo-data-panel--compact .ropo-col-name .ropo-cell-plain {
  max-width: 100%;
}
.ropo-data-panel--compact .ropo-col-manager {
  width: 14%;
}
.ropo-data-panel--compact .ropo-col-num {
  width: 72px;
  padding-left: 4px;
  padding-right: 4px;
}
.ropo-data-panel--compact .ropo-col-date {
  width: 124px;
  white-space: nowrap;
}
.ropo-data-panel--compact .ropo-col-actions {
  width: 176px;
  padding-right: var(--space-3);
}
.ropo-data-panel--compact .custom-datatables-sort-trigger {
  padding-right: 14px !important;
}
.ropo-data-panel table.custom-datatables th,
.ropo-data-panel table.custom-datatables td {
  padding: 12px var(--space-3);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.ropo-data-panel table.custom-datatables thead th {
  background: var(--color-bg-subtle);
  font-weight: 600;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}
.ropo-data-panel table.custom-datatables tbody tr:last-child td {
  border-bottom: none;
}
.ropo-data-panel .ropo-col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right !important;
}
.ropo-data-panel td:not(.ropo-col-actions) {
  overflow: hidden;
  text-overflow: ellipsis;
}
.ropo-data-panel .ropo-pagination-wrap {
  border-top: 1px solid var(--color-border);
}
.ropo-data-panel .ropo-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--color-border);
}
.ropo-data-panel .ropo-pagination .page-item { list-style: none; }
.ropo-data-panel .ropo-pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-sm);
}
.ropo-data-panel .ropo-pagination .page-item.active .page-link {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.ropo-data-panel .ropo-pagination .page-item.disabled .page-link {
  opacity: .4;
  pointer-events: none;
}

.ropo-dropzone.file-area {
  display: block;
  position: relative;
  min-height: 140px;
  text-align: center;
}
.ropo-dropzone.file-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.ropo-list-tabs__btn {
  padding: 8px var(--space-2);
  border: none;
  background: none;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.ropo-list-tabs__btn--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.ropo-list-pane { display: none; }
.ropo-list-pane--active { display: block; }

.ropo-permissions {
  display: grid;
  gap: var(--space-1);
  max-height: 320px;
  overflow-y: auto;
  padding: var(--space-2);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.ropo-permission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 8px var(--space-2);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

/* Карточка участника (продавца) */
.ropo-employee-page { display: flex; flex-direction: column; gap: var(--space-3); }
.ropo-employee-back {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}
.ropo-employee-back:hover { color: var(--color-primary); }
.ropo-employee-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
}
.ropo-employee-hero__main { display: flex; gap: var(--space-3); min-width: 0; }
.ropo-employee-hero__avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--color-border);
}
.ropo-employee-hero__name { margin: 0 0 4px; font-size: var(--text-lg); font-weight: 600; }
.ropo-employee-hero__job { margin: 0 0 4px; color: var(--color-text-muted); font-size: var(--text-sm); }
.ropo-employee-hero__division { margin: 0; color: var(--color-text-muted); font-size: var(--text-xs); }
.ropo-employee-stats { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ropo-employee-stat {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
  min-width: 120px;
}
.ropo-employee-stat__value { margin: 0; font-size: var(--text-lg); font-weight: 600; line-height: 1.2; }
.ropo-employee-stat__label { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.ropo-employee-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--space-3);
  align-items: start;
}
@media (max-width: 1100px) {
  .ropo-employee-layout { grid-template-columns: 1fr; }
}
.ropo-employee-aside { display: flex; flex-direction: column; gap: var(--space-3); }
.ropo-employee-info-list { list-style: none; margin: 0; padding: 0; }
.ropo-employee-info-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 10px var(--space-3);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}
.ropo-employee-info-list li:last-child { border-bottom: none; }
.ropo-employee-info-list__label { font-weight: 500; flex-shrink: 0; }
.ropo-employee-info-list__value { color: var(--color-text-muted); text-align: right; word-break: break-word; }
.ropo-employee-section { padding: var(--space-3); }
.ropo-employee-section__title { font-weight: 600; font-size: var(--text-sm); margin: 0 0 var(--space-2); }
.ropo-employee-section__text { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); line-height: 1.5; }
.ropo-employee-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ropo-employee-tag {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
}
.ropo-dialog-list { list-style: none; margin: 0; padding: 0; }
.ropo-dialog-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.ropo-dialog-list__item:last-child { border-bottom: none; }
.ropo-dialog-list__body { flex: 1; min-width: 0; }
.ropo-dialog-list__name { margin: 0; font-size: var(--text-sm); font-weight: 500; }
.ropo-dialog-list__preview { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ropo-employee-eval .accordion-button {
  padding-right: 72px;
  font-size: var(--text-sm);
}
.ropo-employee-eval .accordion-body {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.ropo-employee-eval .mark {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  font-size: var(--text-xs);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.ropo-employee-eval .mark-danger { background: #FEE2E2; color: var(--color-danger); }
.ropo-employee-eval .mark-warning { background: #FEF3C7; color: #B45309; }
.ropo-employee-eval .mark-success { background: #DCFCE7; color: var(--color-success); }
.ropo-employee-eval .es-block-header { position: relative; }
.ropo-employee-eval .es-block .accordion-button:after { display: none !important; }
.ropo-employee-empty {
  padding: var(--space-3);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.ropo-employee-links-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.ropo-employee-links-table th,
.ropo-employee-links-table td {
  padding: 8px var(--space-2);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
.collapse:not(.show) { display: none; }
.collapsing { height: 0; overflow: hidden; transition: height .35s ease; }

/* Публичные страницы: лендинг и вход */
.ropo-public {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
.ropo-public__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(37, 99, 235, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 90%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    linear-gradient(165deg, var(--color-gradient-start) 0%, var(--color-gradient-end) 100%);
  pointer-events: none;
}
[data-theme="dark"] .ropo-public__bg {
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(59, 130, 246, 0.15) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 90%, rgba(129, 140, 248, 0.12) 0%, transparent 50%),
    linear-gradient(165deg, var(--color-gradient-start) 0%, var(--color-gradient-end) 100%);
}
.ropo-public__top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
}
.ropo-public__main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-3);
}
.ropo-landing-page .ropo-public__main {
  align-items: flex-start;
  padding-top: calc(72px + var(--space-4));
  padding-bottom: var(--space-5);
}
.ropo-landing {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}
.ropo-landing__hero {
  text-align: center;
  margin-bottom: var(--space-4);
}
.ropo-landing__brand {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-3);
}
.ropo-landing__badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-primary);
  background: var(--color-primary-subtle);
  border: 1px solid rgba(37, 99, 235, 0.15);
}
.ropo-landing__title {
  margin: 0 0 var(--space-2);
  font-size: clamp(2.25rem, 6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ropo-landing__lead {
  margin: 0 auto var(--space-2);
  max-width: 640px;
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--color-text-muted);
  font-weight: 400;
}
.ropo-landing__audience {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}
.ropo-landing__tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.ropo-landing-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.ropo-landing-tile:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.ropo-landing-tile__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-primary-subtle);
  border: 1px solid rgba(37, 99, 235, 0.15);
}
.ropo-landing-tile__title {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
}
.ropo-landing-tile__text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.ropo-landing__features {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  text-align: left;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
.ropo-landing__features li {
  position: relative;
  padding-left: 1.25rem;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.ropo-landing__features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: 0.7;
}
.ropo-landing__actions {
  display: flex;
  justify-content: center;
}
.ropo-landing__cta {
  min-width: 220px;
  height: 48px;
  padding: 0 var(--space-4);
  font-size: var(--text-base);
  font-weight: 600;
  box-shadow: var(--shadow-md);
}
@media (max-width: 768px) {
  .ropo-landing__tiles {
    grid-template-columns: 1fr;
  }
}
.ropo-auth {
  width: 100%;
  max-width: 420px;
}
.ropo-auth__back {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}
.ropo-auth__back:hover { color: var(--color-primary); }
.ropo-auth__logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-2);
}
.ropo-auth__card {
  padding: var(--space-4) var(--space-3);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
}
.ropo-auth__title {
  margin: 0 0 var(--space-1);
  font-size: var(--text-xl);
  font-weight: 600;
  text-align: center;
}
.ropo-auth__subtitle {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text-muted);
  text-align: center;
}
.ropo-auth__field { margin-bottom: var(--space-2); }
.ropo-auth__submit {
  width: 100%;
  height: 44px;
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 600;
}
.ropo-auth__error {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-danger);
  line-height: 1.45;
}
.ropo-auth__error--info { color: var(--color-text-muted); }
.ropo-auth__footer {
  margin: var(--space-3) 0 0;
  text-align: center;
  font-size: var(--text-sm);
}
.ropo-auth__link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}
.ropo-auth__link:hover { text-decoration: underline; }
.ropo-auth__notice {
  margin-bottom: var(--space-3);
  padding: var(--space-2);
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--color-text-muted);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

/* Логотип из legacy: /assets/logos/logo.svg */
.ropo-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  max-width: 100%;
}
.ropo-logo:hover { opacity: 0.9; }
.ropo-logo__img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 28px;
}
.ropo-logo--sm .ropo-logo__img { height: 22px; }
.ropo-logo--md .ropo-logo__img { height: 28px; }
.ropo-logo--lg .ropo-logo__img { height: 42px; }
/* SVG белый — на светлом фоне делаем тёмным */
:root:not([data-theme="dark"]) .ropo-logo__img {
  filter: brightness(0) saturate(100%) invert(7%) sepia(12%) saturate(1200%) hue-rotate(182deg) brightness(96%) contrast(96%);
}
[data-theme="dark"] .ropo-logo__img {
  filter: none;
}
.ropo-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

