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

:root {
  --bg: linear-gradient(135deg, #f6f8fb 0%, #eef2f7 100%);
  --card: #ffffff;
  --text: #0f172a;
  --muted: #5b6475;
  --stroke: #e5e7eb;
  --accent: #0ea5e9;
  --accent-strong: #0284c7;
  --success: #16a34a;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Manrope', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
}

.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  width: 100%;
}

.page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 24px;
  flex-wrap: wrap;
  padding: 0 4px;
}

.title-group--center {
  flex: 1;
  text-align: center;
}

.page__header .spacer {
  width: 120px;
  flex-shrink: 0;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 0 0 4px 0;
}

.voltar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--stroke);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transition: all 0.2s ease;
}

.voltar:hover {
  background: #f9fafb;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
  transform: translateX(-2px);
}

.voltar:active {
  transform: translateX(0);
}

.btn-wts-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--stroke);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-wts-status:hover {
  background: #f9fafb;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
  transform: translateX(2px);
}

.btn-wts-status:active {
  transform: translateX(0);
}

.btn-wts-status.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent-strong);
}

.title-group h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.title-group #subtitulo {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  line-height: 1.4;
}

/* Monitor Dropdown */
.monitor-dropdown {
  position: fixed;
  top: 120px;
  right: 16px;
  width: 420px;
  max-width: calc(100vw - 32px);
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
  z-index: 1000;
  display: none;
  animation: slideInRight 0.3s ease;
}

.monitor-dropdown.show {
  display: block;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.monitor-dropdown__content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.monitor-dropdown__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
}

.monitor-dropdown__header h3 {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 600;
}

.monitor-dropdown__actions {
  display: flex;
  gap: 8px;
}

.main-grid {
  display: flex;
  margin-bottom: 10px;
}

.table-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.table-card__header {
  padding-bottom: 10px;
}

.tabela-responsive {
  flex: 1;
}

.unified-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  flex: 1;
}

.unified-content {
  display: flex;
  flex-direction: column;
}

.content-left {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.filters-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--stroke);
}

.filter-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cutoff-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.filter-row label {
  font-weight: 600;
  color: var(--muted);
  font-size: 14px;
}

.filter-row input,
.filter-row select,
.cutoff-modes input[type="time"],
.cutoff-modes select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: #f9fafb;
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-row input:focus,
.filter-row select:focus,
.cutoff-modes input[type="time"]:focus,
.cutoff-modes select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.cutoff-toggle {
  gap: 10px;
}

.cron-config {
  gap: 10px;
}

/* Filtros simples ocupam linha completa abaixo dos cards */
.filter-row:not(.cutoff-toggle):not(.cron-config) {
  grid-column: 1 / -1;
}

.simple-filters {
  display: flex;
  flex-direction: row;
  gap: 16px;
}

.simple-filters > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inline-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.toggle-switch input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="checkbox"]:checked + .toggle-slider {
  background-color: var(--accent);
}

input[type="checkbox"]:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

input[type="checkbox"]:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.cutoff-modes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.cutoff-modes input[type="time"],
.cutoff-modes select {
  min-width: 140px;
}

.primary {
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(14, 165, 233, 0.28);
}

/* Cron Configuration */
.cron-config {
  gap: 10px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid var(--stroke);
}

.cron-input-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cron-input-group select {
  flex: 1;
}

.cron-input-group button {
  flex: 0 0 auto;
}



.table-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 10px;
  margin-bottom: 4px;
}

.table-card__header h2 {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 700;
}

.tabela-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 15px;
  background: var(--card);
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--stroke);
  text-align: left;
  font-size: 15px;
  word-break: break-word;
}

th {
  background: #f9fafb;
  color: var(--muted);
  font-weight: 700;
}

tr:hover td {
  background: #f7fbff;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 22px;
}

th.sortable:hover {
  background: #eef5ff;
}

th.sortable::after {
  content: '⇅';
  position: absolute;
  right: 6px;
  opacity: 0.35;
  font-size: 13px;
}

th.sortable.sort-asc::after {
  content: '▲';
  opacity: 1;
  color: var(--accent-strong);
}

th.sortable.sort-desc::after {
  content: '▼';
  opacity: 1;
  color: var(--accent-strong);
}

.status-confirmado {
  color: var(--success);
  font-weight: 700;
}

.status-cancelado {
  color: var(--danger);
  font-weight: 700;
}

.status-pendente {
  color: var(--warning);
  font-weight: 700;
}

#btn-topo {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 999;
}

#btn-topo:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(14, 165, 233, 0.35);
}

/* Botão de Refresh */
.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--card);
  color: var(--accent);
  border: 1px solid var(--stroke);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Botão de Aniversariantes */
.btn-aniversariantes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #27ae60;
  color: white;
  border: 1px solid #229954;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.btn-aniversariantes:hover {
  background: #229954;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
}

.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e74c3c;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  border: 2px solid white;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-refresh:hover {
  background: #f9fafb;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

.btn-refresh svg {
  transition: transform 0.3s ease;
}

.btn-refresh.loading svg {
  animation: rotate 1s linear infinite;
}

.btn-refresh:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Modal de Aniversariantes */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: var(--card);
  margin: 10% auto;
  padding: 30px;
  border-radius: var(--radius);
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--stroke);
}

.modal-header h2 {
  color: var(--text);
  font-size: 24px;
  margin: 0;
}

.close {
  color: #999;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close:hover {
  color: #e74c3c;
}

.birthday-list {
  max-height: 400px;
  overflow-y: auto;
}

.birthday-item {
  padding: 15px;
  margin-bottom: 10px;
  background: var(--bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--stroke);
}

.birthday-item:last-child {
  margin-bottom: 0;
}

.birthday-icon {
  font-size: 24px;
}

.birthday-info {
  flex: 1;
}

.birthday-name {
  font-weight: 600;
  color: var(--text);
  font-size: 16px;
}

.birthday-phone {
  color: #666;
  font-size: 14px;
  margin-top: 4px;
}

.empty-birthdays {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.empty-birthdays-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

/* Modal de Mensagens */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-box {
  background: #2d2d2d;
  border-radius: 16px;
  padding: 32px 40px;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

.modal-box p {
  margin: 0 0 28px 0;
  font-size: 15px;
  line-height: 1.6;
  color: #e0e0e0;
}

.modal-btn {
  background: linear-gradient(135deg, #d4af37, #f4d874);
  color: #2d2d2d;
  border: none;
  border-radius: 28px;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
  display: block;
  margin-left: auto;
  min-width: 100px;
}

.modal-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4);
  background: linear-gradient(135deg, #e6c350, #f9e890);
}

.modal-btn:active {
  transform: translateY(0);
}

/* Painel de Logs em Tempo Real */
.logs-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.logs-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--stroke);
}

.logs-card__header h2 {
  margin: 4px 0 0;
  font-size: 16px;
}

.logs-card__header h3 {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.secondary-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  background: #f9fafb;
  border-color: var(--accent);
}

.logs-container {
  max-height: 500px;
  overflow-y: auto;
  border-radius: 8px;
  background: #f9fafb;
  padding: 8px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  flex: 1;
}

.logs-container::-webkit-scrollbar {
  width: 8px;
}

.logs-container::-webkit-scrollbar-track {
  background: #e5e7eb;
  border-radius: 4px;
}

.logs-container::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 4px;
}

.logs-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.log-item {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 4px;
  border-left: 2px solid transparent;
  background: white;
  transition: transform 0.2s ease;
}

.log-item:hover {
  transform: translateX(1px);
}

.log-time {
  font-weight: 600;
  color: var(--muted);
  min-width: 45px;
  font-size: 10px;
}

.log-message {
  flex: 1;
  word-break: break-word;
}

.log-success {
  border-left-color: var(--success);
}

.log-success .log-message {
  color: #15803d;
}

.log-error {
  border-left-color: var(--danger);
}

.log-error .log-message {
  color: #b91c1c;
}

.log-info {
  border-left-color: var(--accent);
}

.log-info .log-message {
  color: #0369a1;
}

@media (max-width: 1200px) {
  .unified-content {
    grid-template-columns: 1fr 260px;
    gap: 16px;
  }
}

@media (max-width: 1100px) {
  .unified-content {
    grid-template-columns: 1fr;
  }

  .logs-side {
    border-left: none;
    border-top: 2px solid var(--stroke);
    padding-left: 0;
    padding-top: 16px;
    margin-top: 8px;
  }

  .logs-container {
    max-height: 350px;
  }
}

/* Responsividade - Tablets */
@media (max-width: 900px) {
  .page {
    padding: 18px 12px 60px;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  .page__header {
    gap: 1rem;
    margin-bottom: 20px;
  }
  
  .title-group h1 {
    font-size: 22px;
  }

  .voltar,
  .btn-wts-status {
    padding: 9px 16px;
    font-size: 14px;
  }

  .btn-refresh {
    padding: 7px 12px;
    font-size: 12px;
  }

  .btn-aniversariantes {
    padding: 7px 12px;
    font-size: 12px;
  }

  .badge {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .monitor-dropdown {
    width: 380px;
    max-width: calc(100vw - 24px);
  }

  .unified-card {
    padding: 16px;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .filters-section {
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    width: 100% !important;
  }
  
  .cutoff-toggle {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: flex-start;
  }

  .cron-config {
    grid-column: 1 / -1;
  }
  
  .cutoff-modes {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .cutoff-modes input[type="time"],
  .cutoff-modes select {
    width: 100%;
  }

  .cron-config {
    grid-column: 1 / -1;
  }

  .cron-input-group {
    flex-direction: column;
  }

  .cron-input-group select,
  .cron-input-group button {
    width: 100%;
  }

  .primary {
    width: 100%;
  }
  
  table, th, td {
    font-size: 14px;
  }
  
  th, td {
    padding: 10px 8px;
  }
}

/* Responsividade - Mobile */
@media (max-width: 640px) {
  *:not(svg):not(path):not(circle):not(rect):not(line) {
    max-width: 100vw !important;
  }

  .page {
    padding: 14px 10px 60px !important;
    width: 100% !important;
    overflow-x: hidden !important;
  }
  
  .page__header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    flex-wrap: nowrap !important;
  }

  .voltar,
  .btn-wts-status {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: center;
    padding: 10px 14px;
    font-size: 14px;
  }

  .btn-wts-status {
    order: 2;
  }

  .title-group--center {
    order: 1;
  }

  .voltar {
    order: 3;
  }

  .monitor-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius) var(--radius) 0 0;
    animation: slideInUp 0.3s ease;
  }

  @keyframes slideInUp {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .monitor-dropdown__content {
    max-height: 65vh;
    padding: 14px;
  }

  .monitor-dropdown__header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .monitor-dropdown__actions {
    width: 100%;
    justify-content: flex-end;
  }

  .logs-container {
    max-height: 50vh;
    font-size: 10px;
  }

  .log-time {
    min-width: 40px;
    font-size: 9px;
  }
  
  .title-group--center {
    text-align: left;
  }
  
  .title-group h1 {
    font-size: 20px;
  }
  
  .eyebrow {
    font-size: 10px;
  }
  
  .title-group #subtitulo {
    font-size: 13px;
  }

  .unified-card {
    padding: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  
  .filters-section {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .simple-filters {
    flex-direction: column !important;
  }
  
  .filter-row label {
    font-size: 13px !important;
  }
  
  .filter-row input,
  .filter-row select {
    font-size: 14px !important;
    padding: 9px 10px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .cutoff-modes {
    width: 100% !important;
  }
  
  .cutoff-modes label {
    font-size: 13px !important;
  }
  
  .cutoff-modes input[type="time"],
  .cutoff-modes select {
    width: 100% !important;
    max-width: 100% !important;
  }

  .cron-config {
    grid-column: 1 / -1 !important;
  }

  .cron-input-group {
    flex-direction: column !important;
  }

  .cron-input-group select,
  .cron-input-group button {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .primary {
    width: 100% !important;
    max-width: 100% !important;
    padding: 11px !important;
    font-size: 14px !important;
  }

  .table-card__header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .header-actions {
    width: 100% !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .btn-refresh,
  .btn-aniversariantes {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: center !important;
  }
  
  .table-card__header h2 {
    font-size: 16px;
  }
  
  .tabela-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px !important;
    padding: 0 12px !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  table {
    min-width: 600px !important;
    font-size: 12px !important;
    width: 100% !important;
  }
  
  th, td {
    padding: 8px 6px;
    white-space: nowrap;
  }

  th {
    font-size: 11px;
  }
  
  #btn-topo {
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .modal-box {
    padding: 24px 28px;
    max-width: 90%;
  }
}

/* Mobile pequeno */
@media (max-width: 400px) {
  .page {
    padding: 12px 8px 56px;
  }

  .title-group h1 {
    font-size: 18px;
  }

  .unified-card {
    padding: 10px;
  }

  .filter-row input,
  .filter-row select {
    font-size: 13px;
    padding: 8px;
  }

  .primary {
    padding: 10px;
    font-size: 13px;
  }
  
  table {
    font-size: 11px;
    min-width: 550px;
  }
  
  th, td {
    padding: 6px 4px;
  }

  th {
    font-size: 10px;
  }

  .btn-refresh {
    padding: 6px 10px;
    font-size: 11px;
  }

  .btn-refresh svg {
    width: 14px;
    height: 14px;
  }
}
