:root {
  --primary: #168A57;
  --primary-dark: #126B45;
  --mint-soft: #E7F4ED;
  --mint-light: #F0F9F4;
  --bg-light: #F7F9F7;
  --white: #FFFFFF;
  --text-dark: #26332D;
  --text-muted: #5F7369;
  --border-light: #E1EBE5;
  --border-focus: #168A57;
  --warning-bg: #FEF3C7;
  --warning-text: #92400E;
  --success-bg: #D1FAE5;
  --success-text: #065F46;
  --wa-color: #25D366;
  --wa-dark: #128C7E;
  --shadow-sm: 0 1px 3px rgba(38, 51, 45, 0.05), 0 1px 2px rgba(38, 51, 45, 0.03);
  --shadow-md: 0 4px 12px rgba(22, 138, 87, 0.08), 0 2px 4px rgba(38, 51, 45, 0.04);
  --shadow-lg: 0 10px 25px rgba(22, 138, 87, 0.12), 0 4px 10px rgba(38, 51, 45, 0.06);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
}

/* App Container - Centered Mobile App Shell */
.app-container {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  background-color: var(--bg-light);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
  padding-bottom: 84px;
  /* Space for bottom nav */
}

/* Top App Header */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 20px 20px 24px;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: var(--white);
  padding: 3px;
  object-fit: contain;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--white);
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--mint-soft);
  opacity: 0.95;
  font-weight: 500;
}

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

.icon-btn {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover,
.icon-btn:active {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(0.96);
}

/* Month & Year Navigator inside Top Header */
.month-navigator-header {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.month-nav-btn {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.month-nav-btn:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(1.05);
}

.month-nav-btn:active {
  transform: scale(0.95);
}

.month-center-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.month-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-label {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--white);
  text-transform: capitalize;
  letter-spacing: -0.01em;
}

.month-status-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--primary-dark);
}

.month-status-pill.past {
  background: rgba(255, 255, 255, 0.85);
  color: #374151;
}

.month-status-pill.future {
  background: #FEF3C7;
  color: #92400E;
}

.btn-today-shortcut {
  font-size: 0.72rem;
  color: var(--mint-soft);
  font-weight: 600;
  margin-top: 2px;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
}

.btn-today-shortcut:hover {
  color: var(--white);
}

/* Main Content Area */
.main-content {
  padding: 16px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}


/* Quick Summary Metric Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: -6px;
}

.stat-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 0;
}

.stat-label {
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value {
  font-size: clamp(0.92rem, 3.2vw, 1.15rem);
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-pending-card .stat-value {
  color: #B45309;
}

.stat-paid-card .stat-value {
  color: #047857;
}

.stat-total-card {
  background-color: var(--mint-soft);
  border-color: #c7e6d5;
}

.stat-total-card .stat-value {
  color: var(--primary-dark);
}

.stat-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* Action Banner / CTA Button */
.cta-banner {
  display: flex;
  gap: 10px;
}

.btn-primary {
  flex: 1;
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Search and Filters */
.search-filter-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--white);
  font-size: 0.9rem;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(22, 138, 87, 0.12);
}

.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background-color: var(--white);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* Client List Section */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-count {
  background-color: var(--mint-soft);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.client-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Individual Client Card */
.client-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 13px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.client-card:hover {
  box-shadow: var(--shadow-md);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.client-info-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.client-name-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.client-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.25;
}

.payer-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.payer-highlight {
  color: var(--primary-dark);
  font-weight: 600;
  background-color: var(--mint-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.card-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.btn-status-toggle {
  background: var(--white);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-status-toggle:hover {
  transform: scale(1.08);
}

.btn-status-toggle.status-btn-pending {
  background-color: #FEF3C7;
  color: #B45309;
  border-color: #FDE68A;
}

.btn-status-toggle.status-btn-sent {
  background-color: #E0F2FE;
  color: #0369A1;
  border-color: #BAE6FD;
}

.btn-status-toggle.status-btn-paid {
  background-color: var(--success-bg);
  color: var(--success-text);
  border-color: #A7F3D0;
}

.recurrence-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background-color: var(--mint-soft);
  color: var(--primary-dark);
  border: 1px solid #c7e5d5;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-pending {
  background-color: #FEF3C7;
  color: #B45309;
}

.status-sent {
  background-color: #E0F2FE;
  color: #0369A1;
}

.status-paid {
  background-color: var(--success-bg);
  color: var(--success-text);
}

/* Recurrence Form Box */
.recurrence-box {
  background-color: #F3F8F5;
  border: 1px solid #D2E7DC;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.custom-checkbox {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  user-select: none;
}

.checkbox-label strong {
  font-size: 0.88rem;
  color: var(--text-dark);
}

.checkbox-label span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.recurrence-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #D2E7DC;
}


/* Service & Calculation Row */
.service-calc-box {
  background-color: var(--mint-light);
  border: 1px solid #D6EADF;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.service-details {
  display: flex;
  flex-direction: column;
}

.service-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
}

.service-rate {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Quantity Adjuster Widget */
.qty-adjuster {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: var(--mint-soft);
  color: var(--primary-dark);
  font-weight: bold;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.qty-btn:hover {
  background: #CBE6D8;
}

.qty-number {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-dark);
  min-width: 22px;
  text-align: center;
}

/* Card Total and WhatsApp Action */
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
}

.card-amount-due {
  display: flex;
  flex-direction: column;
}

.amount-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 2px;
}

.amount-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

/* Cores de status de vencimento para cada aluno */
.due-blue {
  color: #0284C7 !important;
}

.amount-label.due-blue {
  color: #0284C7 !important;
  font-weight: 700;
}

.amount-val.due-blue {
  color: #0284C7 !important;
}

.due-red {
  color: #DC2626 !important;
}

.amount-label.due-red {
  color: #DC2626 !important;
  font-weight: 700;
}

.amount-val.due-red {
  color: #DC2626 !important;
}

.due-paid {
  color: #059669 !important;
}

.amount-label.due-paid {
  color: #059669 !important;
  font-weight: 700;
}

.amount-val.due-paid {
  color: #059669 !important;
}

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

.btn-send-wa {
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  padding: 9px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(22, 138, 87, 0.2);
  transition: all 0.2s;
}

.btn-send-wa:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-send-wa svg {
  fill: currentColor;
}

.btn-secondary-icon {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-secondary-icon:hover {
  background: var(--white);
  color: var(--text-dark);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-light);
  display: none;
}

.empty-state.visible {
  display: block;
}

.empty-state h3 {
  font-size: 1rem;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 520px;
  background-color: var(--white);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  padding: 8px 12px;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.04);
  z-index: 40;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: transparent;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(38, 51, 45, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  /* Mobile drawer style */
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-sheet {
  background: var(--white);
  width: 100%;
  max-width: 520px;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 20px 32px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  position: relative;
}

.modal-drag-indicator {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 4px;
  background-color: #D1DED7;
  border-radius: 4px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
}

.modal-close {
  background: var(--bg-light);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
}

/* WhatsApp Message Preview Chat Bubble */
.wa-preview-wrapper {
  background: #EFEAE2;
  background-image: radial-gradient(#d3cbbf 1px, transparent 1px);
  background-size: 16px 16px;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid #DFD7CD;
}

.wa-preview-header {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-weight: 600;
}

.wa-edit-notice {
  font-size: 0.72rem;
  color: var(--primary-dark);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-reset-text {
  background: none;
  border: none;
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-reset-text:hover {
  color: var(--primary);
}

.wa-chat-bubble {
  background: var(--white);
  border-radius: 8px 8px 8px 0;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.wa-message-textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  color: #111B21;
  line-height: 1.45;
  resize: vertical;
  min-height: 250px;
  outline: none;
  padding: 0;
  white-space: pre-line;
}

.wa-message-textarea:focus {
  outline: none;
}


.wa-chat-time {
  font-size: 0.68rem;
  color: #667781;
  text-align: right;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

/* PIX Box inside preview */
.pix-copy-box {
  background-color: var(--mint-soft);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pix-copy-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-dark);
  word-break: break-all;
}

.btn-copy-pix {
  background-color: var(--white);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.btn-copy-pix:hover {
  background-color: var(--primary);
  color: var(--white);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-wa-direct {
  background-color: #25D366;
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transition: background-color 0.2s, transform 0.1s;
}

.btn-wa-direct:hover {
  background-color: #20BA5A;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-light);
  color: var(--text-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary:hover {
  background-color: #EBF1ED;
}

.btn-danger-outline {
  background-color: transparent;
  color: #DC2626;
  border: 1px solid #FCA5A5;
  border-radius: var(--radius-md);
  padding: 11px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  transition: all 0.2s;
}

.btn-danger-outline:hover {
  background-color: #FEE2E2;
  border-color: #DC2626;
}

/* Form Styles */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background-color: var(--white);
  font-size: 0.9rem;
  color: var(--text-dark);
  outline: none;
  font-family: inherit;
}

/* Date Picker Wrapper & Button */
.date-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.date-input-wrapper .date-mask-input {
  padding-right: 44px;
}

.btn-calendar-trigger {
  position: absolute;
  right: 6px;
  background: var(--mint-soft);
  color: var(--primary-dark);
  border: 1px solid #cce5d6;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-calendar-trigger:hover {
  background: #c0e3ce;
  color: var(--primary-dark);
  transform: scale(1.05);
}

.btn-calendar-trigger:active {
  transform: scale(0.95);
}

.hidden-native-datepicker {
  position: absolute;
  right: 6px;
  bottom: 0;
  width: 32px;
  height: 32px;
  opacity: 0;
  pointer-events: none;
  border: none;
  padding: 0;
  margin: 0;
}


.form-input:focus,
.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(22, 138, 87, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background-color: var(--text-dark);
  color: var(--white);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================================================
   TELA DE LOGIN (ACESSO RESTRITO)
   ======================================================== */
body.logged-out {
  background: radial-gradient(circle at 50% 12%, #E7F4ED 0%, #F7F9F7 75%);
}

body.logged-out .app-container {
  padding-bottom: 0;
  box-shadow: none;
  background: transparent;
}

.login-view {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 18px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: 0 12px 36px rgba(22, 138, 87, 0.08), 0 3px 10px rgba(38, 51, 45, 0.04);
  padding: 34px 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeInLogin 0.35s ease-out;
}

@keyframes fadeInLogin {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.login-logo-wrapper {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  background-color: var(--white);
  box-shadow: 0 6px 18px rgba(22, 138, 87, 0.16);
  border: 1px solid #D2E7DC;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  padding: 10px;
  transition: transform 0.2s ease;
}

.login-logo-wrapper:hover {
  transform: scale(1.04);
}

.login-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-app-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.5px;
}

.login-app-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.login-badge-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--mint-soft);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid #c7e5d5;
  margin-top: 4px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.login-input {
  padding-left: 44px !important;
  padding-right: 44px !important;
  height: 48px;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
}

.btn-toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.15s;
}

.btn-toggle-password:hover {
  color: var(--primary);
}

.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.login-remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-dark);
  user-select: none;
}

.btn-link-action {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.btn-link-action:hover {
  color: var(--primary-dark);
}

.btn-submit-login {
  height: 48px;
  font-size: 1rem;
  font-weight: 700;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(22, 138, 87, 0.28);
  margin-top: 4px;
}

.btn-header-logout {
  color: var(--text-muted);
  transition: color 0.15s, background-color 0.15s;
}

.btn-header-logout:hover {
  color: #DC2626;
  background-color: #FEE2E2;
}

/* ========================================================
   MODELO PADRÃO DE MENSAGEM & AÇÕES DE TEMPLATE
   ======================================================== */
.wa-header-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-wa-action-pill {
  background: var(--white);
  border: 1px solid #CDE5D8;
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.btn-wa-action-pill:hover {
  background-color: var(--mint-soft);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-save-template {
  background-color: var(--mint-soft);
  color: var(--primary-dark);
  border-color: #A3D4BA;
}

.btn-save-template:hover {
  background-color: #D0EBDD;
}

.template-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  background-color: #F3F8F5;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #D2E7DC;
}

.tag-pill {
  background: var(--white);
  border: 1px solid #C7E3D4;
  color: var(--primary-dark);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tag-pill:hover {
  background-color: var(--mint-soft);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.template-textarea {
  min-height: 180px;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  resize: vertical;
}