/* ==============================================================================
   PROMORADAR — PAINEL ADMINISTRATIVO & AUTENTICAÇÃO (admin.css)
   Design System profissional, responsivo, dark/light accents e estética moderna
   ============================================================================== */

:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;

  --sidebar-bg: #0F172A;
  --sidebar-hover: #1E293B;
  --sidebar-active: #2563EB;
  --sidebar-text: #94A3B8;
  --sidebar-text-active: #FFFFFF;

  --bg-app: #F8FAFC;
  --bg-surface: #FFFFFF;

  --border-color: #E2E8F0;
  --border-subtle: #F1F5F9;

  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;

  --status-pending: #F59E0B;
  --status-pending-bg: #FFFBEB;
  --status-pending-border: #FDE68A;

  --status-approved: #10B981;
  --status-approved-bg: #ECFDF5;
  --status-approved-border: #A7F3D0;

  --status-rejected: #EF4444;
  --status-rejected-bg: #FEF2F2;
  --status-rejected-border: #FECACA;

  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background: var(--bg-app);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==============================================================================
   TELA DE LOGIN
   ============================================================================== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.08) 0%, rgba(248, 250, 252, 0) 70%),
              radial-gradient(circle at 90% 80%, rgba(15, 23, 42, 0.08) 0%, rgba(248, 250, 252, 0) 70%);
  padding: 1.5rem;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
}

.login-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #2563EB, #10B981);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand {
  display: inline-block;
  margin-bottom: 1.25rem;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #EEF2FF;
  color: #3730A3;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.login-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.alert-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

.alert-error {
  background: var(--status-rejected-bg);
  border: 1px solid var(--status-rejected-border);
  color: #991B1B;
}

.alert-content strong {
  display: block;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.login-form .form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--text-light);
  pointer-events: none;
}

.form-input, .form-select {
  width: 100%;
  min-height: 44px;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.input-icon-wrapper .form-input {
  padding-left: 2.75rem;
}

.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-toggle-pass {
  position: absolute;
  right: 0.35rem;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #FFFFFF;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.btn-success {
  background: var(--status-approved);
  color: #FFFFFF;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--status-rejected);
  color: #FFFFFF;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-sm {
  min-height: 40px;
  padding: 0.45rem 0.8rem;
  font-size: 0.8125rem;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 0.85rem;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-footer {
  margin-top: 1.75rem;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
}

.login-security-notice {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.login-security-notice code {
  background: #F1F5F9;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.link-back {
  font-size: 0.8125rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.link-back:hover {
  text-decoration: underline;
}

/* ==============================================================================
   DASHBOARD LAYOUT (SIDEBAR & MAIN)
   ============================================================================== */
.dashboard-body {
  min-height: 100vh;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.admin-tag {
  background: var(--primary);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.6875rem;
  text-transform: uppercase;
  color: #64748B;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 0.75rem 0.75rem 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sidebar-text);
  background: none;
  border: none;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #FFFFFF;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #FFFFFF;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.badge-pending {
  background: var(--status-pending);
}

.badge-approved {
  background: var(--status-approved);
}

.badge-rejected {
  background: var(--status-rejected);
}

.sidebar-user-card {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  display: block;
  font-size: 0.72rem;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  background: none;
  border: none;
  color: #64748B;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ==============================================================================
   TOPBAR & MAIN CONTENT
   ============================================================================== */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.btn-toggle-sidebar {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  color: var(--text-main);
  flex-shrink: 0;
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.page-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.server-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--status-approved);
  border-radius: 50%;
}

.admin-content {
  padding: 1.75rem;
  flex: 1;
}

/* ==============================================================================
   KPIS GRID
   ============================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: #F1F5F9;
  flex-shrink: 0;
}

.icon-pending { background: #FEF3C7; }
.icon-approved { background: #D1FAE5; }
.icon-rejected { background: #FEE2E2; }

.kpi-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.kpi-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin-top: 0.2rem;
}

.kpi-warning .kpi-value { color: #B45309; }
.kpi-success .kpi-value { color: #047857; }
.kpi-danger .kpi-value { color: #B91C1C; }

/* ==============================================================================
   FILTROS E TABELA DE OFERTAS
   ============================================================================== */
.filter-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-field {
  position: relative;
  flex: 1 1 240px;
  min-width: min(100%, 240px);
}

.search-field-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-field .search-input {
  padding-left: 2.5rem;
}

.filter-select-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.filter-select-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.table-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.table-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.table-count-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.admin-table th {
  background: #F8FAFC;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: #F8FAFC;
}

.table-item-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: #F1F5F9;
  padding: 2px;
  border: 1px solid var(--border-color);
}

.table-item-title {
  font-weight: 600;
  color: var(--text-main);
  max-width: 320px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.table-store-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-top: 0.25rem;
}

.store-amazon { background: #FFF7ED; color: #C2410C; border: 1px solid #FDBA74; }
.store-mercadolivre { background: #FEFCE8; color: #854D0E; border: 1px solid #FDE047; }
.store-shopee { background: #FFF1F0; color: #C2410C; border: 1px solid #FCA5A5; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-status-pending {
  background: var(--status-pending-bg);
  border: 1px solid var(--status-pending-border);
  color: #B45309;
}

.badge-status-approved {
  background: var(--status-approved-bg);
  border: 1px solid var(--status-approved-border);
  color: #047857;
}

.badge-status-rejected {
  background: var(--status-rejected-bg);
  border: 1px solid var(--status-rejected-border);
  color: #B91C1C;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.table-empty-state {
  text-align: center;
  padding: 4rem 1rem;
}

.table-empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.table-pagination {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  background: #F8FAFC;
}

.pagination-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-page-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 0 0.5rem;
}

/* ==============================================================================
   MODAIS E DRAWERS
   ============================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalEnter 0.2s ease-out;
}

.modal-lg {
  max-width: 680px;
}

.modal-xl {
  max-width: 920px;
}

.modal-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  margin-bottom: 0.25rem;
}

.moderation-notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--status-pending-bg);
  border: 1px solid var(--status-pending-border);
  color: #92400E;
  font-size: 0.84rem;
  line-height: 1.45;
  margin-bottom: 1.25rem;
}

.moderation-notice-banner.is-edit-mode {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1E3A8A;
}

.moderation-notice-icon {
  font-size: 1.15rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.moderation-notice-content strong {
  display: block;
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.2rem;
}

.moderation-notice-content p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
}

.form-error-banner {
  display: flex;
  margin: 0 0 1.25rem;
}

.form-error-banner p {
  margin: 0.15rem 0 0.35rem;
}

.form-error-list {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.82rem;
}

.duplicate-offer-box {
  margin-top: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  color: #92400E;
  font-size: 0.82rem;
}

.duplicate-offer-box strong {
  display: inline;
  margin: 0;
}

.duplicate-offer-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.offer-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.offer-form-grid .form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.form-col-full {
  grid-column: 1 / -1;
}

.required-mark {
  color: var(--status-rejected);
  font-weight: 700;
}

.field-counter {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.field-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.form-field-error {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #B91C1C;
  line-height: 1.4;
}

.form-input[aria-invalid="true"],
.form-select[aria-invalid="true"] {
  border-color: var(--status-rejected);
  background: #FFFBFB;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 84px;
}

.discount-preview-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--status-approved-bg);
  color: #047857;
  border: 1px solid var(--status-approved-border);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 0 0 auto;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.modal-close {
  background: none;
  border: none;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  flex-shrink: 0;
}

.modal-close:hover {
  background: #F1F5F9;
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
  flex: 1 1 auto;
}

.confirm-item-preview {
  margin-top: 1rem;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

/* Detalhes técnicos da oferta */
.details-top {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.details-thumb {
  width: 112px;
  height: 112px;
  object-fit: contain;
  background: #F1F5F9;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.details-summary {
  flex: 1 1 200px;
  min-width: 0;
}

.details-title {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.details-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.55rem;
  overflow-wrap: anywhere;
}

.details-metadata {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.details-category {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.details-metrics-box {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.details-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.details-metric-item {
  min-width: 0;
  overflow-wrap: anywhere;
}

.details-metric-caption {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  display: block;
  margin-bottom: 0.1rem;
}

.details-urls {
  font-size: 0.85rem;
}

.details-url-block {
  margin-bottom: 0.65rem;
}

.details-url-caption {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.details-url-link {
  word-break: break-all;
  overflow-wrap: anywhere;
}

.details-url-code {
  background: #F1F5F9;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  word-break: break-all;
  overflow-wrap: anywhere;
  display: block;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: #F8FAFC;
  flex: 0 0 auto;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #0F172A;
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.25s ease;
  border: 1px solid #334155;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Manual offer form & modal flex layout */
.table-actions {
  flex-wrap: wrap;
}

.modal-card {
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
}

#offer-form-modal form {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

#offer-form-modal .modal-body {
  max-height: none;
  flex: 1 1 auto;
}

.form-error-banner .alert-content {
  min-width: 0;
}

.form-error-list:empty {
  display: none;
}

.duplicate-offer-box p {
  margin: 0;
}

#offer-form-modal :focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.65);
  outline-offset: 2px;
}

/* ==============================================================================
   RESPONSIVIDADE DO PAINEL (DESKTOP, 900px, 768px, 640px, 430px, 390px, 375px, 320px)
   ============================================================================== */
@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, calc(100vw - 3rem));
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 100;
    transform: translateX(-100%);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.35);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .btn-toggle-sidebar {
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  .admin-topbar {
    padding: 0.85rem 1rem;
    flex-wrap: wrap;
  }

  .topbar-left {
    width: 100%;
  }

  .topbar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-content {
    padding: 1.15rem 1rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }

  .kpi-card {
    padding: 1rem;
    gap: 0.75rem;
  }

  .kpi-value {
    font-size: 1.45rem;
  }

  .filter-row {
    gap: 0.75rem;
  }

  .search-field {
    flex: 1 1 100%;
    min-width: 0;
  }

  .filter-select-group {
    flex: 1 1 calc(50% - 0.5rem);
  }

  .table-header {
    padding: 1rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.75rem;
  }

  .table-pagination {
    padding: 0.85rem 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

@media (max-width: 640px) {
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card,
  #offer-form-modal .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 94vh;
    max-height: 94dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .modal-header {
    padding: 1rem 1.15rem;
  }

  .modal-body,
  #offer-form-modal .modal-body {
    padding: 1rem 1.15rem;
  }

  .offer-form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
  }

  .form-col-full {
    grid-column: auto;
  }

  .modal-footer,
  #offer-form-modal .modal-footer {
    padding: 0.85rem 1.15rem;
  }

  .details-metrics-grid {
    grid-template-columns: 1fr;
  }

  .table-pagination {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pagination-buttons {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .login-body {
    padding: 1rem;
  }

  .login-card {
    padding: 1.75rem 1.25rem;
  }

  .login-title {
    font-size: 1.35rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .filter-select-group {
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
  }

  #btn-reset-filters {
    width: 100%;
    min-height: 44px;
  }

  .table-header > div,
  #btn-new-offer-table {
    width: 100%;
  }

  #btn-new-offer-table {
    min-height: 44px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .modal-footer .btn {
    width: 100%;
    min-height: 44px;
  }

  .toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: calc(100vw - 2rem);
  }
}

@media (max-width: 390px) {
  .admin-topbar {
    padding: 0.75rem;
  }

  .page-subtitle {
    font-size: 0.75rem;
  }

  .topbar-right .btn {
    flex: 1 1 calc(50% - 0.35rem);
    min-height: 44px;
  }

  .server-status-pill,
  #meli-integration-status {
    width: 100%;
    justify-content: center;
  }

  .admin-content {
    padding: 0.85rem 0.75rem;
  }

  .filter-card {
    padding: 0.85rem;
  }

  .moderation-notice-banner {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .details-thumb {
    width: 88px;
    height: 88px;
  }
}

/* ==============================================================================
   DISTRIBUIÇÃO MULTICANAL — WHATSAPP (WAHA) & TELEGRAM
   Glassmorphism suave, Bento Grid, Soft UI e Acessibilidade (PREFERENCIAS.md)
   ============================================================================== */

/* Pill de Modo na Barra Superior */
.distribution-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
  transition: all 0.25s ease;
}

.pill-dry-run {
  background: #EFF6FF;
  color: #1E40AF;
  border-color: #BFDBFE;
}

.pill-dry-run .pulse-dot {
  background: #3B82F6;
}

.pill-live {
  background: #FEF2F2;
  color: #991B1B;
  border-color: #FECACA;
}

.pill-live .pulse-dot {
  background: #EF4444;
}

.pill-unknown {
  background: #F1F5F9;
  color: #475569;
  border-color: #CBD5E1;
}

.pill-unknown .pulse-dot {
  background: #94A3B8;
  animation: none;
}

/* Banner de Status de Modo na Visão de Distribuição */
.distribution-mode-banner {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.distribution-mode-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
}

.banner-dry-run {
  background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
  border-color: #BFDBFE;
}

.banner-dry-run::before {
  background: #2563EB;
}

.banner-live {
  background: linear-gradient(135deg, #FFFDFD 0%, #FEF2F2 100%);
  border-color: #FECACA;
}

.banner-live::before {
  background: #DC2626;
}

.banner-unknown {
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  border-color: #CBD5E1;
}

.banner-unknown::before {
  background: #94A3B8;
}

.mode-banner-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.mode-banner-body {
  flex: 1;
  min-width: 0;
}

.mode-banner-body strong {
  display: block;
  font-size: 1.05rem;
  font-family: var(--font-heading);
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.mode-banner-body p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.mode-banner-actions {
  flex-shrink: 0;
  align-self: center;
}

.distribution-warnings-list {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.8rem;
  color: #B45309;
}

.distribution-warning-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #FEF3C7;
  color: #92400E;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-right: 0.5rem;
  margin-top: 0.25rem;
}

/* Bento Grid de KPIs da Distribuição */
.distribution-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-uncertain {
  border-color: #FDE68A;
  background: #FFFBEB;
}

.icon-uncertain {
  background: #FEF3C7;
  color: #D97706;
}

.icon-sending {
  background: #E0E7FF;
  color: #4F46E5;
}

/* Badges de Canais */
.channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.channel-telegram {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}

.channel-whatsapp {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

/* Badges de Status dos Jobs */
.badge-job-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending);
  border: 1px solid var(--status-pending-border);
}

.badge-job-retry_wait {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.badge-job-sending {
  background: #EEF2FF;
  color: #4338CA;
  border: 1px solid #C7D2FE;
}

.badge-job-sent {
  background: var(--status-approved-bg);
  color: var(--status-approved);
  border: 1px solid var(--status-approved-border);
}

.badge-job-uncertain {
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #F59E0B;
  font-weight: 800;
}

.badge-job-failed {
  background: var(--status-rejected-bg);
  color: var(--status-rejected);
  border: 1px solid var(--status-rejected-border);
}

.badge-job-cancelled {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #E2E8F0;
}

/* Badges de Modo do Job */
.badge-mode {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-mode-dryrun {
  background: #F1F5F9;
  color: #475569;
}

.badge-mode-live {
  background: #FEE2E2;
  color: #991B1B;
}

/* Destinos: Toggles e Status */
.status-pill-active {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #16A34A;
  font-weight: 700;
  font-size: 0.8rem;
}

.status-pill-inactive {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #94A3B8;
  font-weight: 600;
  font-size: 0.8rem;
}

.btn-toggle-enable {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

.btn-toggle-enable:hover {
  background: #BBF7D0;
}

.btn-toggle-disable {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #E2E8F0;
}

.btn-toggle-disable:hover {
  background: #E2E8F0;
  color: #334155;
}

.btn-requeue {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.btn-requeue:hover {
  background: #FDE68A;
}

/* Aviso de Reenvio At-Most-Once / Uncertain */
.requeue-warning-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
  color: #92400E;
}

.warning-box-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}

.requeue-warning-box p {
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Modal de Distribuição Manual */
.distribute-offer-summary {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.distribution-mode-indicator-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.distribution-mode-indicator-box .mode-tag {
  background: #2563EB;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.distribution-mode-indicator-box p {
  font-size: 0.85rem;
  color: #1E40AF;
  margin: 0;
}

.distribute-destinations-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  background: #FFFFFF;
  margin-top: 0.5rem;
}

.destination-check-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.destination-check-row:hover {
  background: #F8FAFC;
}

.destination-check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Tabela de Tentativas no Modal de Detalhes do Job */
.job-attempts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 0.75rem;
}

.job-attempts-table th,
.job-attempts-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.job-attempts-table th {
  background: #F8FAFC;
  color: var(--text-muted);
  font-weight: 600;
}

.message-preview-card {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.875rem;
  color: var(--text-main);
  max-height: 250px;
  overflow-y: auto;
}

@media (max-width: 640px) {
  .distribution-mode-banner {
    flex-direction: column;
    gap: 1rem;
  }

  .mode-banner-actions {
    align-self: stretch;
  }

  .mode-banner-actions .btn {
    width: 100%;
  }

  .distribution-kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Publicação automática — estado, resumo e controles */
.auto-publish-card {
  background: linear-gradient(145deg, #FFFFFF 0%, #F8FAFC 100%);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.auto-publish-card-header,
.auto-publish-state-wrap,
.auto-publish-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auto-publish-eyebrow {
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auto-publish-title {
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-top: 0.15rem;
}

.auto-publish-state {
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 1rem;
  font-weight: 800;
  justify-content: center;
  min-width: 8.5rem;
  padding: 0.5rem 0.9rem;
}

.auto-publish-state.state-active { background: #DCFCE7; border-color: #86EFAC; color: #166534; }
.auto-publish-state.state-inactive { background: #F1F5F9; border-color: #CBD5E1; color: #334155; }
.auto-publish-state.state-unknown { background: #E2E8F0; border-color: #94A3B8; color: #334155; }

.auto-publish-mode {
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.4rem 0.65rem;
  white-space: nowrap;
}

.auto-publish-mode.mode-live { background: #FEE2E2; color: #991B1B; }
.auto-publish-mode.mode-dry-run { background: #DBEAFE; color: #1E40AF; }
.auto-publish-mode.mode-unknown { background: #E2E8F0; color: #334155; }

.auto-publish-description { color: var(--text-muted); margin: 0.85rem 0 1rem; }
.auto-publish-metrics { display: grid; gap: 0.75rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto-publish-metric { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px; min-width: 0; padding: 0.85rem; }
.auto-publish-metric > span,
.auto-publish-metric > small { color: #475569; display: block; font-size: 0.78rem; }
.auto-publish-metric > strong { color: var(--text-main); display: block; font-size: 1.2rem; margin: 0.3rem 0; overflow-wrap: anywhere; }
.auto-publish-warning { background: #FEF3C7; border: 1px solid #FDE68A; border-radius: 10px; color: #78350F; font-size: 0.875rem; margin-top: 0.75rem; padding: 0.7rem 0.85rem; }
.auto-publish-error,
.auto-publish-modal-error { background: #FEF2F2; border: 1px solid #FECACA; border-radius: 10px; color: #991B1B; font-size: 0.875rem; margin-top: 0.75rem; padding: 0.7rem 0.85rem; }
.auto-publish-actions { justify-content: flex-end; margin-top: 1rem; }
.auto-publish-live-warning { background: #FEF2F2; border: 1px solid #FECACA; border-radius: 12px; color: #7F1D1D; margin-top: 1rem; padding: 1rem; }
.auto-publish-live-warning strong { display: block; margin-bottom: 0.35rem; }
.auto-publish-modal-card { max-width: 34rem; }

@media (max-width: 900px) {
  .auto-publish-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .auto-publish-card { padding: 1rem; }
  .auto-publish-card-header { align-items: flex-start; flex-direction: column; }
  .auto-publish-state-wrap { flex-wrap: wrap; justify-content: flex-start; }
  .auto-publish-metrics { grid-template-columns: 1fr; }
  .auto-publish-actions,
  .auto-publish-actions .btn { width: 100%; }
}

/* Cartão de saúde */
.health-card { background: var(--bg-surface); border: 1px solid #E2E8F0; border-radius: var(--radius-lg); box-shadow: 0 4px 14px rgb(39 53 75 / 5%); margin: 0 0 1.25rem; padding: 1.25rem; scroll-margin-top: 5rem; }
.health-card-header, .health-actions { align-items: center; display: flex; gap: 0.85rem; justify-content: space-between; }
.health-card-header h2 { color: var(--text-main); font-size: 1.2rem; margin: 0; }
.health-eyebrow { color: #475569; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; margin: 0 0 0.25rem; text-transform: uppercase; }
.health-status { align-items: center; border: 1px solid transparent; border-radius: 999px; display: inline-flex; font-size: 0.85rem; font-weight: 800; gap: 0.4rem; padding: 0.42rem 0.75rem; }
.health-status.status-ok, .health-block-status.status-ok { background: #DCFCE7; border-color: #86EFAC; color: #166534; }
.health-status.status-degraded, .health-block-status.status-degraded { background: #FEF3C7; border-color: #FCD34D; color: #78350F; }
.health-status.status-critical, .health-block-status.status-critical { background: #FEE2E2; border-color: #FCA5A5; color: #991B1B; }
.health-status.status-unknown, .health-block-status.status-unknown { background: #E2E8F0; border-color: #94A3B8; color: #334155; }
.health-status.status-unreachable { background: #FEE2E2; border-color: #B91C1C; color: #7F1D1D; }
.health-block-status.status-neutral { background: #DBEAFE; border-color: #93C5FD; color: #1E3A8A; }
.health-block-status.status-neutral-good { background: #F1F5F9; border-color: #CBD5E1; color: #334155; }
.health-message { color: #334155; margin: 0.9rem 0; }
.health-blocks { display: grid; gap: 0.75rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.health-block { background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px; min-width: 0; padding: 0.85rem; }
.health-block h3 { color: #334155; font-size: 0.85rem; margin: 0 0 0.55rem; }
.health-block p { margin: 0; }
.health-block-status { border: 1px solid transparent; border-radius: 8px; display: inline-flex; font-size: 0.8rem; font-weight: 700; padding: 0.28rem 0.5rem; }
.health-block small { color: #475569; display: block; font-size: 0.75rem; line-height: 1.45; margin-top: 0.55rem; }
.health-updated { align-items: center; color: #475569; display: flex; flex-wrap: wrap; font-size: 0.82rem; gap: 0.55rem; margin: 0.9rem 0; }
.health-stale { background: #FEF3C7; border-radius: 6px; color: #78350F; font-weight: 700; padding: 0.25rem 0.45rem; }
.health-attempt { font-size: 0.78rem; margin-top: -0.55rem; }
.health-last-known { color: #475569; font-size: 0.75rem; line-height: 1.4; margin-top: 0.55rem; }
.health-alerts h3 { color: var(--text-main); font-size: 0.9rem; margin: 0 0 0.4rem; }
.health-alerts ul { display: grid; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.health-alert { border-left: 4px solid #94A3B8; display: grid; gap: 0.2rem; padding: 0.55rem 0.7rem; }
.health-alert strong { color: #334155; font-size: 0.82rem; }
.health-alert span { color: #475569; font-size: 0.78rem; }
.health-alert.alert-degraded { background: #FFFBEB; border-color: #B45309; }
.health-alert.alert-critical { background: #FEF2F2; border-color: #B91C1C; }
.health-alert.alert-unknown { background: #F1F5F9; border-color: #475569; }
.health-alert-unavailable { background: #F1F5F9; border-left: 4px solid #475569; color: #334155; margin: 0.5rem 0; padding: 0.65rem 0.75rem; }
.health-details { border-radius: 8px; color: #334155; font-size: 0.82rem; margin-top: 0.65rem; padding: 0.55rem 0.7rem; }
.health-details summary { cursor: pointer; font-weight: 700; }
.health-archived, .health-unknown { background: #F1F5F9; border: 1px solid #CBD5E1; }
.health-archived .health-alert { background: #F8FAFC; border-color: #64748B; }
.health-archived .health-alert strong, .health-archived .health-alert span { color: #475569; }
.health-details ul { display: grid; gap: 0.4rem; list-style: none; margin: 0.6rem 0 0; padding: 0; }
.health-refresh { min-height: 44px; min-width: 44px; }
.health-refresh[aria-disabled="true"] { cursor: wait; opacity: 0.7; }
.health-refresh:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 3px; }
@media (max-width: 900px) { .health-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .health-card { padding: 1rem; }
  .health-card-header { align-items: flex-start; flex-direction: column; }
  .health-actions { justify-content: space-between; width: 100%; }
  .health-blocks { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .admin-topbar { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .health-card, .health-card *, .health-refresh { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
