/* Keep page entrances without creating a containing block for fixed dialogs. */
@media (prefers-reduced-motion: no-preference) {
  #app .main > section, #app .main > div:not(.global-notices) {
    animation-name: rmh-in-viewport-safe !important;
    animation-fill-mode: backwards !important;
  }
}
@keyframes rmh-in-viewport-safe {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* Hide the legacy overview entry; direct campaign reports remain available. */
.menu-list a[href="/admin/campaigns/analytics"] { display: none !important; }
/* Keep summary values intact and give compact cards enough horizontal room. */
section.dashboard article.tile.is-child .title { white-space: nowrap; word-break: normal; overflow-wrap: normal; }
@media (min-width: 769px) and (max-width: 1200px) {
  section.dashboard .counts > .tile > .tile > .tile { flex-direction: column; }
}
@media (max-width: 1000px) {
  section.dashboard article.tile.is-child > .columns.is-mobile { flex-direction: column; }
  section.dashboard article.tile.is-child > .columns.is-mobile > .column { width: 100%; }
}
@media (max-width: 768px) {
  .modal-content .modal-card {
    margin: 0 !important;
    width: 100% !important;
    max-height: calc(100dvh - 24px) !important;
  }
}
html body #app .menu-list li:has(> a[href="/admin/campaigns/analytics"]) {
  display: none !important;
}
/* Campaign management: compact layouts retain selection, sorting and all actions. */
@media (max-width: 1100px) {
  #app section.campaigns { min-width: 0; }
  #app section.campaigns .page-header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
  #app section.campaigns .page-header > .column { flex: 1 1 240px; width: auto; padding: 0; }
  #app section.campaigns .page-header > .column.has-text-right { flex: 0 1 180px; }
  #app section.campaigns .top.level { display: flex; flex-wrap: wrap; gap: 12px; }
  #app section.campaigns .top.level > .level-left { flex: 1 1 100%; min-width: 0; }
  #app section.campaigns .top.level .columns { margin: 0; width: 100%; }
  #app section.campaigns .top.level .column { width: 100%; padding: 0; }
  #app section.campaigns .table-mobile-sort { display: flex; margin: 12px 0; }
  #app section.campaigns .table-mobile-sort > .field { width: 100%; }
  #app section.campaigns .table-wrapper.has-mobile-cards { overflow: visible; background: transparent; border: 0; box-shadow: none; }
  #app section.campaigns table, #app section.campaigns tbody { display: block; width: 100%; }
  #app section.campaigns thead { display: block; }
  #app section.campaigns thead tr { display: block !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 0 10px !important; }
  #app section.campaigns thead th { display: none !important; }
  #app section.campaigns thead th.checkbox-cell { display: flex !important; width: auto; align-items: center; gap: 8px; background: transparent !important; border: 0 !important; }
  #app section.campaigns thead th.checkbox-cell::after { content: 'Выбрать все'; font-size: 12px; font-weight: 600; color: var(--rmh-muted); text-transform: none; letter-spacing: normal; }
  #app section.campaigns tbody tr:not(.detail):not(.is-empty) { display: grid !important; grid-template-columns: 44px minmax(0,1fr); gap: 0; padding: 12px !important; margin: 0 0 16px !important; background: var(--rmh-surface); border: 1px solid var(--rmh-line); border-radius: 16px; }
  #app section.campaigns tbody tr td { display: block !important; width: auto !important; min-width: 0; height: auto; max-width: none; padding: 12px 4px !important; text-align: left !important; white-space: normal; overflow-wrap: anywhere; grid-column: 1 / -1; }
  #app section.campaigns tbody tr td::before { content: attr(data-label); display: block; flex: none; margin-bottom: 8px; font-size: 12px; color: var(--rmh-muted); text-transform: none; letter-spacing: normal; }
  #app section.campaigns tbody tr td.checkbox-cell { grid-column: 1; border-bottom: 0 !important; }
  #app section.campaigns tbody tr td.status { grid-column: 2; border-bottom: 0 !important; }
  #app section.campaigns tbody tr td.checkbox-cell::before, #app section.campaigns tbody tr td.status::before, #app section.campaigns tbody tr td.actions::before { display: none; }
  #app section.campaigns tbody tr td.status > div > p { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; }
  #app section.campaigns tbody tr td > div, #app section.campaigns tbody tr td > ul { width: 100%; min-width: 0; }
  #app section.campaigns tbody tr td > div > p { text-align: left; }
  #app section.campaigns tbody tr td.lists ul { margin: 0 0 0 18px; }
  #app section.campaigns tbody tr td .fields p { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
  #app section.campaigns tbody tr td .fields p label { flex: 0 1 44%; }
  #app section.campaigns tbody tr td .fields p > span { min-width: 0; flex: 1; text-align: right; white-space: normal; }
  #app section.campaigns tbody tr td.actions > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  #app section.campaigns tbody tr td.actions a { display: inline-flex; justify-content: center; align-items: center; min-width: 44px; min-height: 44px; margin: 0; }
  #app section.campaigns .b-checkbox { min-height: 32px; }
}
@media (max-width: 480px) {
  #app section.campaigns .page-header > .column.has-text-right { flex: 1 1 100%; }
}
@media (max-width: 1100px) {
  #app section.campaigns .page-header { flex-direction: row !important; }
  #app section.campaigns .table-mobile-sort .select:not(:has(option:checked))::before {
    content: 'Сортировать по…'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--rmh-muted); font-size: 14px;
  }
}
@media (max-width: 1100px) {
  #app section.campaigns .table-mobile-sort .select::before { z-index: 1; }
  #app section.campaigns tbody tr td.actions a { min-width: 44px !important; min-height: 44px !important; }
}
