/* Secondary pages (Отчёты, Команда, Журнал, Правила, Архив) and empty/loading states in the approved board concept. */
.workspace > :is(.reports-view,.team-view,.audit-view,.rules-view,.archive-view) { width: auto !important; min-width: 0 !important; margin: 16px 24px 32px !important; padding: 0 !important; gap: 16px !important; background: #fff !important; }
.workspace > :is(.state-view,.loading-view,.board-empty-view) { margin: 16px 24px 32px !important; padding: 0 !important; background: #fff !important; }

/* Stat tiles */
:is(.report-overview,.team-overview) { gap: 12px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
:is(.report-overview,.team-overview) > * { display: grid !important; gap: 6px !important; padding: 12px 14px !important; border: 0 !important; border-radius: 8px !important; background: #f8f6fc !important; box-shadow: none !important; }
:is(.report-overview,.team-overview) span { color: #898397 !important; font-size: 13px !important; }
:is(.report-overview,.team-overview) strong { color: #24202c !important; font-size: 22px !important; font-weight: 600 !important; }

/* Cards */
:is(.reports-view .dash-panel,.team-directory,.team-access-guide,.audit-filters,.audit-results,.rules-toolbar,.rule-flow-card) { margin: 0 !important; padding: 18px 20px !important; border: 1px solid #eae5f3 !important; border-radius: 8px !important; background: #fff !important; box-shadow: none !important; }
:is(.reports-view,.team-view,.audit-view,.rules-view) :is(h2,h3) { color: #24202c !important; font-weight: 600 !important; letter-spacing: 0 !important; }
:is(.reports-view,.team-view,.audit-view,.rules-view) h3 { font-size: 16px !important; }
:is(.reports-view,.team-view,.audit-view,.rules-view) :is(p,small) { color: #898397 !important; }
:is(.reports-view,.team-view,.audit-view,.rules-view,.state-view) button.primary { min-height: 40px !important; padding: 8px 16px !important; border: 0 !important; border-radius: 7px !important; background: #7954d6 !important; box-shadow: none !important; color: #fff !important; font-size: 14px !important; }
:is(.team-view .team-toolbar,.audit-view,.rules-view .rules-toolbar) :is(input:not([type='checkbox']),select) { min-height: 40px !important; border: 1px solid #ddd7e7 !important; border-radius: 7px !important; background-color: #fff !important; box-shadow: none !important; color: #494558 !important; font-size: 14px !important; }

/* Bars and meters share the board progress style */
:is(.reports-view,.team-view) meter { width: 100% !important; height: 6px !important; border: 0 !important; border-radius: 4px !important; background: #e6e0ef !important; appearance: none; -webkit-appearance: none; }
:is(.reports-view,.team-view) meter::-webkit-meter-bar { height: 6px; border: 0; border-radius: 4px; background: #e6e0ef; }
:is(.reports-view,.team-view) meter::-webkit-meter-optimum-value,:is(.reports-view,.team-view) meter::-webkit-meter-suboptimum-value,:is(.reports-view,.team-view) meter::-webkit-meter-even-less-good-value { border-radius: 4px; background: #8b60e7; }
:is(.reports-view,.team-view) meter::-moz-meter-bar { border-radius: 4px; background: #8b60e7; }
.reports-view :is(.progress-row,.workload-row,.report-row) { margin: 0 !important; padding: 10px 0 !important; border: 0 !important; border-bottom: 1px solid #f0edf5 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
.reports-view :is(.progress-row,.workload-row,.report-row):last-child { border-bottom: 0 !important; }
.reports-view :is(.progress-row,.workload-row,.report-row) :is(span,strong) { color: #494558 !important; font-size: 14px !important; }

/* Team table */
.team-view .team-table-wrap { border: 1px solid #eae5f3 !important; border-radius: 8px !important; box-shadow: none !important; overflow-x: auto !important; }
.team-view :is(table,.team-table) { border-collapse: collapse !important; }
.team-view :is(th,.team-table-head) { background: #fbfaff !important; color: #898397 !important; font-size: 12px !important; font-weight: 500 !important; text-transform: uppercase !important; letter-spacing: 0 !important; }
.team-view :is(td,th) { border-color: #f0edf5 !important; }
.team-view .team-role-grid > * { border: 1px solid #eae5f3 !important; border-radius: 8px !important; background: #fff !important; box-shadow: none !important; }

/* Audit */
.audit-view .audit-row { margin: 0 !important; padding: 12px 4px !important; border: 0 !important; border-bottom: 1px solid #f0edf5 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
.audit-view .audit-row:last-child { border-bottom: 0 !important; }
.audit-view .audit-row:hover { background: #faf8fe !important; }

/* Rules */
.rules-view .rules-page-head { margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.rules-view .rules-list { gap: 12px !important; }
.rules-view .rule-flow-card:hover { border-color: #a282ee !important; }

/* Empty, loading and error states */
:is(.state-view,.board-empty-view,.archive-view) .empty-state { max-width: 560px !important; margin: 48px auto !important; padding: 32px !important; border: 1px dashed #d9d0e5 !important; border-radius: 8px !important; background: #fbfaff !important; box-shadow: none !important; text-align: center !important; }
:is(.state-view,.board-empty-view,.archive-view) .empty-state :is(h2,h3,strong) { color: #24202c !important; font-size: 18px !important; font-weight: 600 !important; }
:is(.state-view,.board-empty-view,.archive-view) .empty-state p { color: #746c84 !important; font-size: 14px !important; line-height: 1.5 !important; }
:is(.state-view,.board-empty-view,.archive-view) .empty-state button:not(.primary) { min-height: 40px !important; border: 1px solid #ddd7e7 !important; border-radius: 7px !important; background: #fff !important; box-shadow: none !important; color: #7954d6 !important; }

@media (max-width: 760px) {
  .workspace > :is(.reports-view,.team-view,.audit-view,.rules-view,.archive-view,.state-view,.loading-view,.board-empty-view) { margin: 12px 14px 14px !important; }
  :is(.reports-view .dash-panel,.team-directory,.team-access-guide,.audit-filters,.audit-results,.rules-toolbar,.rule-flow-card) { padding: 14px !important; }
  :is(.state-view,.board-empty-view,.archive-view) .empty-state { margin: 24px auto !important; padding: 20px !important; }
  .audit-view .audit-filters { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px !important; }
  .audit-view .audit-filters > * { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
  .audit-view .audit-filters > :first-child { grid-column: 1 / -1 !important; }
  .audit-view .audit-row { grid-template-columns: minmax(0,1fr) !important; gap: 4px !important; }
}

/* Switching a member's access off / back on */
.team-row-action { white-space: nowrap; }
.team-deactivate-button { min-height: 32px; margin-left: 4px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); padding: 0 8px; font: inherit; font-size: 13px; cursor: pointer; }
.team-deactivate-button:hover { border-color: #f3c7c7; background: #fff5f5; color: #c0392b; }
.team-deactivated .team-directory-head { margin-bottom: 8px; }
.team-deactivated-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.team-deactivated-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.team-deactivated-list .team-person { opacity: .72; min-width: 0; }
.team-deactivated-list .team-person small { overflow-wrap: anywhere; }
.team-deactivated-list button { flex: none; }
html[data-theme="dark"] .team-deactivate-button:hover { border-color: #5c2b2b; background: #2a1717; color: #ff8a80; }
