/* Capivari Aqui Admin — camada visual consolidada 0.59.32 */
:root {
  --admin-focus: 0 0 0 4px rgba(196, 23, 12, .14);
  --admin-control-height: 44px;
  --admin-card-radius: 12px;
  --admin-soft-bg: #f8f9fb;
  --admin-subtle: #667085;
}

.admin-body {
  color: #202124;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.admin-body :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--admin-red);
  outline-offset: 2px;
  box-shadow: var(--admin-focus);
}

.admin-body :where(button, input, select, textarea) {
  font-size: 14px;
}

.admin-body :where(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select) {
  min-height: var(--admin-control-height);
}

.admin-body :where(input, select, textarea):disabled,
.admin-body :where(button, .admin-primary-button, .admin-secondary-button):disabled {
  cursor: not-allowed;
  opacity: .55;
}

.admin-sidebar nav a,
.admin-nav-group-label,
.admin-nav-group-toggle {
  font-size: 13px;
}

.admin-nav-submenu a {
  font-size: 12px;
}

.admin-topbar-title span,
.admin-page-heading > div > span,
.admin-panel > header span {
  font-size: 11px;
}

.admin-topbar-title strong {
  font-size: 16px;
}

.admin-page-heading h1 {
  font-size: clamp(25px, 2.2vw, 31px);
}

.admin-page-heading p,
.admin-panel p,
.admin-alert,
.admin-demo-notice,
.admin-form-note {
  font-size: 13px;
}

.admin-panel {
  border-radius: var(--admin-card-radius);
}

.admin-panel > header,
.admin-panel > h2:first-child {
  margin-bottom: 0;
}

.admin-panel > header h2,
.admin-panel > h2 {
  font-size: 18px;
}

.admin-primary-button,
.admin-secondary-button,
.admin-danger-button,
.admin-filters button,
.admin-bulk-toolbar button,
.admin-pipeline-actions form > button,
.admin-meta-actions button,
.admin-row-actions a,
.admin-row-actions button {
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.2;
}

.admin-primary-button,
.admin-secondary-button,
.admin-danger-button {
  gap: 8px;
}

.admin-secondary-button {
  border-color: #cfd4dc;
}

.admin-danger-button {
  border: 1px solid #efb5b0;
  background: #fff4f3;
  color: #9f1810;
  font-weight: 800;
}

.admin-danger-button:hover {
  border-color: #d83a30;
  background: #fee8e6;
}

.admin-row-actions {
  flex-wrap: wrap;
  gap: 7px;
}

.admin-row-actions form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-row-actions a,
.admin-row-actions button {
  border: 1px solid #d9dde3;
  background: #fff;
  color: #344054;
  font-weight: 700;
}

.admin-row-actions button {
  color: #a31b13;
}

.admin-row-actions a:hover,
.admin-row-actions button:hover {
  border-color: #e4aaa6;
  background: #fff3f2;
}

.admin-settings-layout,
.admin-editor,
.admin-company-editor,
.admin-dashboard-grid {
  align-items: start;
}

.admin-settings-layout > .admin-panel,
.admin-editor > .admin-panel,
.admin-editor > aside,
.admin-company-editor > * {
  min-width: 0;
}

.admin-settings-layout label,
.admin-editor label,
.admin-company-editor label,
.admin-meta-grid label,
.admin-media-upload label,
.admin-login-card label {
  font-size: 13px;
}

.admin-settings-layout label small,
.admin-editor label small,
.admin-company-editor label small,
.admin-setting-row small,
.admin-meta-grid small,
.admin-form-note,
.admin-current-cover figcaption,
.admin-media-card small,
.admin-direct-upload span,
.admin-upload-placeholder span {
  color: var(--admin-subtle);
  font-size: 12px;
  line-height: 1.5;
}

.admin-settings-layout :where(input, select, textarea),
.admin-editor :where(input, select, textarea),
.admin-company-editor :where(input, select, textarea),
.admin-meta-grid :where(input, select, textarea),
.admin-filters :where(input, select),
.admin-bulk-filters :where(input, select),
.admin-bulk-toolbar :where(input, select) {
  border-color: #cfd4dc;
  border-radius: 9px;
  font-size: 14px;
}

.admin-settings-layout :where(input, select, textarea):focus,
.admin-editor :where(input, select, textarea):focus,
.admin-company-editor :where(input, select, textarea):focus,
.admin-meta-grid :where(input, select, textarea):focus,
.admin-filters :where(input, select):focus,
.admin-bulk-filters :where(input, select):focus,
.admin-bulk-toolbar :where(input, select):focus {
  border-color: var(--admin-red);
  outline: 0;
  box-shadow: var(--admin-focus);
}

.admin-setting-row {
  min-height: 72px !important;
  padding: 10px 0;
}

.admin-setting-row strong {
  font-size: 13px;
}

.admin-setting-row > input[type="checkbox"],
.admin-table input[type="checkbox"],
.admin-selection-toolbar input[type="checkbox"],
.admin-publication-toolbar input[type="checkbox"] {
  min-width: 20px;
  width: 20px;
  height: 20px;
  accent-color: var(--admin-red);
}

.admin-stats article {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.admin-stats span,
.admin-quick > a > span,
.admin-module-list > article strong {
  font-size: 13px;
}

.admin-stats small,
.admin-quick > a small,
.admin-module-list > article small,
.admin-pending article span,
.admin-pending article a {
  font-size: 12px;
}

.admin-quick > a {
  min-height: 70px;
  transition: background .15s ease;
}

.admin-quick > a:hover {
  background: #fff8f7;
}

.admin-quick > a > b {
  width: 40px;
  height: 40px;
  font-size: 17px;
}

.admin-pending article {
  min-height: 76px;
}

.admin-table-wrap {
  width: 100%;
}

.admin-table {
  color: #344054;
}

.admin-table th {
  color: #667085;
  font-size: 11px;
  letter-spacing: .025em;
}

.admin-table td {
  font-size: 13px;
  line-height: 1.45;
}

.admin-table tbody tr:hover {
  background: #fffafa;
}

.status,
.admin-sponsored-label {
  padding: 6px 9px;
  font-size: 11px;
  line-height: 1.2;
}

.admin-filters,
.admin-bulk-filters,
.admin-bulk-toolbar,
.admin-selection-toolbar,
.admin-publication-toolbar {
  gap: 10px;
  padding: 16px 18px;
}

.admin-bulk-filters {
  background: #fff;
  border-bottom: 1px solid #e6e8ec;
}

.admin-bulk-toolbar,
.admin-selection-toolbar,
.admin-publication-toolbar {
  background: var(--admin-soft-bg);
}

.admin-bulk-toolbar [data-bulk-count],
.admin-selection-toolbar [data-external-bulk-count],
.admin-publication-toolbar [data-publication-count] {
  min-width: 92px;
  color: var(--admin-subtle);
  font-size: 12px;
}

.admin-bulk-form:not(.has-selection) .admin-bulk-toolbar :where(button[type="submit"], select[name="bulk_action"], [data-bulk-values]),
.admin-selection-toolbar:not(.has-selection) .admin-danger-button,
.admin-publication-toolbar:not(.has-selection) .admin-danger-button {
  opacity: .5;
}

.admin-email-card,
.admin-capture-email-card,
.admin-media-card,
.admin-publication-package,
.admin-message-list article {
  border-color: #e5e7eb;
}

.admin-email-card h3,
.admin-capture-email-card h3,
.admin-publication-package h2,
.admin-message-list h3 {
  font-size: 16px;
}

.admin-email-card p,
.admin-email-card span,
.admin-capture-email-card p,
.admin-capture-email-card small,
.admin-message-list p,
.admin-message-list small {
  font-size: 12px;
}

.admin-media-card strong {
  font-size: 13px;
}

.admin-media-card input,
.admin-media-card form button,
.admin-library-button,
.admin-media-picker-anchor {
  min-height: 42px;
  font-size: 12px;
}

.admin-alert {
  padding: 13px 15px;
}

.admin-empty-state {
  font-size: 13px;
}

@media (max-width: 1024px) {
  .admin-main {
    padding-inline: 24px;
  }

  .admin-settings-layout,
  .admin-company-editor,
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .admin-company-form-side {
    position: static;
  }
}

@media (max-width: 760px) {
  .admin-main {
    padding: 20px 14px 92px;
  }

  .admin-topbar {
    height: 64px;
    padding-inline: 14px;
  }

  .admin-topbar-create span,
  .admin-topbar-title span {
    display: none;
  }

  .admin-topbar-create {
    margin-left: 0;
    min-width: 42px;
    justify-content: center;
  }

  .admin-page-heading {
    gap: 16px;
    margin-bottom: 20px;
  }

  .admin-page-heading .admin-primary-button {
    width: 100%;
  }

  .admin-panel > header {
    align-items: flex-start;
    padding: 18px;
  }

  .admin-settings-layout > .admin-panel,
  .admin-editor > .admin-panel,
  .admin-editor > aside > .admin-panel,
  .admin-company-editor .admin-panel {
    padding: 18px;
  }

  .admin-form-columns,
  .admin-company-media-grid,
  .admin-meta-grid,
  .admin-ai-technical-grid {
    grid-template-columns: 1fr;
  }

  .admin-filters,
  .admin-bulk-filters,
  .admin-bulk-toolbar,
  .admin-selection-toolbar,
  .admin-publication-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 14px;
  }

  .admin-filters > *,
  .admin-bulk-filters > *,
  .admin-bulk-toolbar > *,
  .admin-selection-toolbar > *,
  .admin-publication-toolbar > * {
    width: 100%;
    min-width: 0 !important;
  }

  .admin-table-wrap {
    overflow: visible;
    padding: 12px;
    background: #f5f6f8;
  }

  .admin-table,
  .admin-intake-table,
  .admin-email-table {
    min-width: 0 !important;
    width: 100%;
    display: block;
    white-space: normal;
  }

  .admin-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .admin-table tbody {
    display: grid;
    gap: 12px;
  }

  .admin-table tbody tr {
    display: grid;
    width: 100%;
    overflow: hidden;
    border: 1px solid #dfe3e8;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .04);
  }

  .admin-table tbody tr[hidden] {
    display: none;
  }

  .admin-table tbody td,
  .admin-table tbody td:first-child {
    width: 100% !important;
    min-width: 0 !important;
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 11px 13px;
    border-bottom: 1px solid #edf0f2;
    overflow-wrap: anywhere;
    text-align: left;
  }

  .admin-table tbody td::before {
    content: attr(data-label);
    color: #667085;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .025em;
    text-transform: uppercase;
  }

  .admin-table tbody td:last-child {
    border-bottom: 0;
  }

  .admin-table tbody td.admin-row-actions {
    grid-template-columns: 1fr;
    padding-top: 13px;
    background: #fafbfc;
  }

  .admin-table tbody td.admin-row-actions::before {
    content: "Ações";
  }

  .admin-table tbody td.admin-row-actions > *,
  .admin-table tbody td.admin-row-actions form,
  .admin-table tbody td.admin-row-actions a,
  .admin-table tbody td.admin-row-actions button {
    width: 100%;
  }

  .admin-table tbody td.admin-table-empty-cell {
    grid-template-columns: 1fr;
    padding: 24px 16px;
    text-align: center;
  }

  .admin-table tbody td.admin-table-empty-cell::before {
    display: none;
  }

  .admin-setting-row {
    align-items: flex-start;
  }

  .admin-setting-row > span {
    min-width: 0;
  }

  .admin-row-actions:not(td) {
    align-items: stretch;
  }

  .admin-row-actions:not(td) > *,
  .admin-row-actions:not(td) form,
  .admin-row-actions:not(td) a,
  .admin-row-actions:not(td) button {
    min-height: 42px;
  }

  .admin-email-card-actions,
  .admin-capture-email-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-email-card-actions > *,
  .admin-email-card-actions form,
  .admin-email-card-actions a,
  .admin-email-card-actions button,
  .admin-capture-email-actions > * {
    width: 100%;
  }

  .admin-stats article {
    min-height: 116px;
  }
}

@media (max-width: 480px) {
  .admin-main {
    padding-inline: 10px;
  }

  .admin-page-heading h1 {
    font-size: 25px;
  }

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

  .admin-email-card-actions,
  .admin-capture-email-actions {
    grid-template-columns: 1fr;
  }

  .admin-table tbody td,
  .admin-table tbody td:first-child {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-body *,
  .admin-body *::before,
  .admin-body *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Central de mídias unificada */
.admin-media-hub-nav {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-media-hub-section {
  scroll-margin-top: 86px;
  margin-bottom: 30px;
}

.admin-media-hub-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--admin-line);
  border-radius: 12px;
  background: #fff;
}

.admin-media-hub-heading span {
  color: var(--admin-red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.admin-media-hub-heading h2 {
  margin: 3px 0 4px;
  font-size: 21px;
}

.admin-media-hub-heading p {
  margin: 0;
  color: var(--admin-muted);
  font-size: 14px;
  line-height: 1.45;
}

.admin-media-hub-heading > b {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  font-size: 12px;
}

.admin-media-generated-section {
  padding-top: 4px;
  border-top: 1px solid var(--admin-line);
}

@media (max-width: 640px) {
  .admin-media-hub-nav {
    grid-template-columns: 1fr;
  }

  .admin-media-hub-heading {
    padding: 15px;
  }

  .admin-media-hub-heading > b {
    display: none;
  }

  .admin-media-hub-heading h2 {
    font-size: 19px;
  }

  .admin-media-hub-heading p {
    font-size: 13px;
  }
}
