/* ==========================================================================
   Orçamento Lite - Mobile-First / Mobile-Exclusive Stylesheet
   Design limpo, veloz, intuitivo para jovens e idosos
   ========================================================================== */

:root {
  /* Paleta de Cores */
  --bg-app: #F8FAFC;
  --bg-desktop: #0F172A;
  --surface: #FFFFFF;
  --surface-alt: #F1F5F9;
  --border: #E2E8F0;
  --border-focus: #0284C7;

  --text-main: #0F172A;
  --text-muted: #475569;
  --text-light: #94A3B8;

  --primary: #0284C7;
  --primary-hover: #0369A1;
  --primary-light: #E0F2FE;
  --primary-contrast: #FFFFFF;

  --success: #16A34A;
  --success-light: #DCFCE7;
  --whatsapp: #25D366;
  --whatsapp-dark: #128C7E;
  
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --danger: #DC2626;
  --danger-light: #FEE2E2;

  /* Sombras & Formas */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  --shadow-drawer: 0 -10px 30px rgba(0, 0, 0, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Touch & Tipografia */
  --touch-min-height: 48px;
  --font-base: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition-fast: 0.18s ease;
}

/* Reset Global & Acessibilidade */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-base);
  background-color: var(--bg-desktop);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Layout Desktop Frame Mockup (Max 480px Smartphone Container) */
.app-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  background-color: var(--bg-desktop);
  padding: 0;
}

@media (min-width: 481px) {
  .app-wrapper {
    padding: 20px 0;
  }
}

.mobile-frame {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
}

@media (min-width: 481px) {
  .mobile-frame {
    min-height: 92vh;
    max-height: 94vh;
    border-radius: 28px;
    border: 6px solid #1E293B;
    overflow-y: auto;
  }
}

/* Scrollbar customizada e suave */
.mobile-frame::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar {
  width: 5px;
}
.mobile-frame::-webkit-scrollbar-thumb,
.drawer-body::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

/* Prevenção de quebra e truncamento de texto */
h1, h2, h3, h4, h5, p, span, strong, td, th, div {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ==========================================================================
   Header Superior do App
   ========================================================================== */
.app-header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284C7, #0369A1);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.brand-info h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-info p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon:active {
  transform: scale(0.95);
  background: var(--surface-alt);
}

/* ==========================================================================
   Barra de Busca e Filtros
   ========================================================================== */
.main-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 90px; /* Espaço para o botão flutuante */
}

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

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-light);
  pointer-events: none;
  font-size: 16px;
}

.search-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 42px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  color: var(--text-main);
  transition: var(--transition-fast);
  outline: none;
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Chips de Filtro */
.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 8px 16px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip.active {
  background-color: var(--primary);
  color: #FFF;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

/* Resumo de Indicadores (Dashboard Stats) */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.stat-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

/* ==========================================================================
   Lista de Ordens e Cards
   ========================================================================== */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-card:active {
  transform: scale(0.99);
}

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

.badge-tipo {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.3px;
}

.badge-tipo.orcamento {
  background-color: var(--primary-light);
  color: var(--primary);
}

.badge-tipo.os {
  background-color: #EDE9FE;
  color: #7C3AED;
}

.badge-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.badge-status.pendente {
  background-color: var(--warning-light);
  color: var(--warning);
}
.badge-status.aprovado {
  background-color: var(--primary-light);
  color: var(--primary);
}
.badge-status.concluido {
  background-color: var(--success-light);
  color: var(--success);
}
.badge-status.cancelado {
  background-color: var(--danger-light);
  color: var(--danger);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.card-client {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 2px;
}

.card-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
}

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

.btn-action-small {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
}

.btn-view {
  background: var(--surface-alt);
  color: var(--text-main);
  border-color: var(--border);
}

.btn-zap-direct {
  background: var(--whatsapp);
  color: #FFF;
}

/* Estado Vazio */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 2px dashed var(--border);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}

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

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   Botão Flutuante (FAB) & Barra Inferior
   ========================================================================== */
.fab-bottom {
  position: sticky;
  bottom: 16px;
  left: 0;
  right: 0;
  padding: 0 16px;
  z-index: 30;
  margin-top: auto;
}

.btn-fab {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  color: #FFF;
  font-size: 16px;
  font-weight: 700;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.4);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.btn-fab:active {
  transform: scale(0.98);
}

/* ==========================================================================
   Drawer / Modal Express de Criação (1 Minuto)
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.drawer-container {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-drawer);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.drawer-backdrop.open .drawer-container {
  transform: translateY(0);
}

.drawer-handle-bar {
  width: 48px;
  height: 5px;
  background: #CBD5E1;
  border-radius: 10px;
  margin: 10px auto 4px auto;
}

.drawer-header {
  padding: 10px 18px 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.drawer-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Segmented Control (Orçamento x O.S.) */
.segmented-control {
  display: flex;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.segmented-btn {
  flex: 1;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.segmented-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Campos de Formulário Otimizados para Touch */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.form-group label span {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 12px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  height: var(--touch-min-height);
  font-size: 16px; /* Evita zoom automático no iOS */
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-textarea {
  height: 70px;
  padding: 10px 14px;
  resize: vertical;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Grid de Linhas de Itens */
.items-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.items-section-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.items-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-row {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  animation: fadeIn 0.2s ease-in-out;
}

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

.item-row-top {
  display: flex;
  gap: 8px;
  align-items: center;
}

.item-row-top input {
  flex: 1;
  height: 42px;
  font-size: 15px;
}

.btn-remove-item {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--danger-light);
  color: var(--danger);
  border: none;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.item-row-bottom {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr 1.2fr;
  gap: 8px;
  align-items: center;
}

.item-subtotal-box {
  background: var(--surface);
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 8px;
}

.item-subtotal-box span {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1;
}

.item-subtotal-box strong {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.2;
}

.btn-add-item {
  width: 100%;
  height: 46px;
  background: var(--surface);
  border: 1.5px dashed var(--primary);
  color: var(--primary);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-add-item:active {
  background: var(--primary-light);
}

/* Rodapé Fixo do Drawer (Sticky Bottom) */
.drawer-footer {
  padding: 14px 18px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.total-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.total-value-highlight {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

.btn-submit-main {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
  color: #FFF;
  font-size: 16px;
  font-weight: 700;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35);
  transition: transform var(--transition-fast);
}

.btn-submit-main:active {
  transform: scale(0.98);
}

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

/* ==========================================================================
   Toasts e Alertas Rápidos
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast {
  background: #0F172A;
  color: #FFF;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.25s ease forwards;
}

.toast.success {
  background: #16A34A;
}

.toast.error {
  background: #DC2626;
}

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

/* ==========================================================================
   Estilos Específicos para View / Recibo Público (view.php)
   ========================================================================== */
.receipt-wrapper {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.receipt-header {
  border-bottom: 2px dashed var(--border);
  padding-bottom: 16px;
  text-align: center;
}

.receipt-header h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.receipt-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.receipt-order-id {
  display: inline-block;
  background: var(--surface-alt);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 8px;
}

.receipt-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  background: var(--surface-alt);
  padding: 14px;
  border-radius: var(--radius-md);
}

.receipt-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.receipt-info-row span {
  color: var(--text-muted);
}

.receipt-info-row strong {
  color: var(--text-main);
  text-align: right;
}

.receipt-items-table {
  width: 100%;
  border-collapse: collapse;
}

.receipt-items-table th {
  text-align: left;
  font-size: 12px;
  color: var(--text-muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.receipt-items-table td {
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.receipt-items-table tr:last-child td {
  border-bottom: none;
}

.receipt-total-box {
  background: var(--primary-light);
  border: 1px solid #BAE6FD;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.receipt-total-box span {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-hover);
}

.receipt-total-box strong {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-hover);
}

/* Caixa Chave PIX */
.pix-box {
  background: #F0FDF4;
  border: 1.5px dashed var(--success);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pix-box-title {
  font-size: 13px;
  font-weight: 700;
  color: #15803D;
}

.pix-key-val {
  font-family: monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  background: #FFF;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid #BBF7D0;
  user-select: all;
}

/* Ações do Recibo / PDF */
.receipt-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pdf-top-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.pdf-top-actions .btn-receipt {
  flex: 1;
}

.btn-receipt {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
}

.btn-whatsapp-send {
  background: var(--whatsapp);
  color: #FFF;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp-send:hover {
  background: #1EBE5D;
}

.btn-print {
  background: var(--primary);
  color: #FFF;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-print:hover {
  background: var(--primary-hover);
}

.btn-action-small.btn-pdf-direct {
  background: #E0F2FE;
  color: var(--primary);
  border: 1px solid #BAE6FD;
}

.btn-action-small.btn-pdf-direct:hover {
  background: var(--primary);
  color: #FFF;
}

/* ==========================================================================
   Estilos Específicos para Emissão de PDF / Folha de Serviço
   ========================================================================== */
.pdf-body {
  background: #F1F5F9;
}

.pdf-frame {
  max-width: 680px;
}

.pdf-business-badge {
  font-size: 32px;
  margin-bottom: 6px;
}

.status-indicator-tag {
  color: var(--primary);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.pdf-section-title {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  font-weight: 700;
}

.pdf-service-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.pdf-obs-box {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  background: var(--surface-alt);
  padding: 12px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
  border-left: 3px solid var(--primary);
}

.signatures-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}

.signature-line {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.signature-line .line {
  height: 1px;
  background: #94A3B8;
  margin-bottom: 8px;
}

.signature-line span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.signature-line small {
  font-size: 11px;
  color: var(--text-muted);
}

.pdf-footer-note {
  text-align: center;
  margin-top: 8px;
}

.pdf-footer-note p {
  font-size: 11px;
  color: var(--text-light);
}

/* ==========================================================================
   Modal de Sucesso Pós-Criação
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

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

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  width: 100%;
  max-width: 420px;
  max-height: min(92vh, 680px);
  overflow-y: auto;
  margin: auto;
  text-align: center;
  box-shadow: var(--shadow-modal);
  transform: scale(0.92);
  transition: transform var(--transition-normal);
}

.modal-backdrop.open .modal-card {
  transform: scale(1);
}

.modal-icon-success {
  width: 56px;
  height: 56px;
  background: #DCFCE7;
  color: var(--success);
  font-size: 28px;
  font-weight: 800;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px auto;
}

.modal-card h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.modal-summary-card {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  margin-bottom: 18px;
}

.modal-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.modal-summary-row span {
  color: var(--text-muted);
}

.modal-summary-row strong {
  color: var(--text-main);
  max-width: 65%;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-summary-total {
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 2px;
}

.modal-summary-total strong {
  color: var(--primary);
  font-size: 15px;
  font-weight: 800;
}

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

.btn-modal-action {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform var(--transition-fast);
}

.btn-modal-action:active {
  transform: scale(0.98);
}

.btn-modal-whatsapp {
  background: var(--whatsapp);
  color: #FFF;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.btn-modal-pdf {
  background: var(--primary);
  color: #FFF;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-modal-close {
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
  height: 42px;
  font-size: 14px;
}

.btn-modal-close:hover {
  background: #E2E8F0;
  color: var(--text-main);
}

/* ==========================================================================
   Modo de Impressão Nativo e Exportação em PDF
   ========================================================================== */
@media print {
  @page {
    margin: 12mm 15mm;
    size: A4 portrait;
  }

  body, .pdf-body, .app-wrapper, .mobile-frame, .pdf-frame {
    background: #FFF !important;
    padding: 0 !important;
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
  }

  .receipt-actions, .pdf-top-actions, .app-header, .fab-bottom, .filter-chips, .search-box, .btn-icon, .no-print, .modal-backdrop, .toast-container {
    display: none !important;
  }

  .receipt-wrapper, .printable-document {
    box-shadow: none !important;
    border: 1px solid #CBD5E1 !important;
    padding: 16px !important;
    border-radius: 4px !important;
  }

  .receipt-total-box {
    background: #F8FAFC !important;
    border: 1px solid #94A3B8 !important;
  }

  .receipt-total-box span, .receipt-total-box strong {
    color: #0F172A !important;
  }

  .pix-box {
    background: #F8FAFC !important;
    border: 1px solid #CBD5E1 !important;
  }

  .signatures-box {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 30px !important;
    margin-top: 40px !important;
  }
}

/* ==========================================================================
   Estilos SaaS - Header, Onboarding, Autenticação e Planos
   ========================================================================== */

/* Header SaaS */
.badge-plan-header {
  display: inline-block;
  background: #E0F2FE;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.btn-icon-highlight {
  background: #E0F2FE;
  border-color: #BAE6FD;
}

/* ==========================================================================
   Tela de Onboarding Interativo
   ========================================================================== */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0284C7 100%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.onboarding-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.onboarding-container {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  width: 100%;
  max-width: 420px;
  border-radius: 28px;
  padding: 28px 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.onboarding-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.onboarding-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.btn-onboarding-skip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-onboarding-skip:hover {
  background: var(--surface-alt);
  color: var(--text-main);
}

.onboarding-carousel {
  position: relative;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-slide {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: fadeInSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.onboarding-slide.active {
  display: flex;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.slide-badge {
  background: #E0F2FE;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.slide-badge.badge-green {
  background: #DCFCE7;
  color: var(--whatsapp);
}

.slide-badge.badge-blue {
  background: #E0F2FE;
  color: #0284C7;
}

.slide-badge.badge-purple {
  background: #F3E8FF;
  color: #7E22CE;
}

.slide-icon-circle {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-full);
  background: #E0F2FE;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 4px 0;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.18);
}

.slide-icon-circle.icon-green {
  background: #DCFCE7;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.2);
}

.slide-icon-circle.icon-blue {
  background: #E0F2FE;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.2);
}

.slide-icon-circle.icon-purple {
  background: #F3E8FF;
  box-shadow: 0 8px 20px rgba(126, 34, 206, 0.2);
}

.onboarding-slide h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.onboarding-slide p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 320px;
}

/* Indicadores de Passo (Dots) */
.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 6px 0;
}

.onboarding-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: #CBD5E1;
  cursor: pointer;
  transition: all 0.25s ease;
}

.onboarding-dots .dot.active {
  width: 24px;
  background: var(--primary);
}

/* Botões de Ação do Onboarding */
.onboarding-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-onboarding-primary {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  color: #FFF;
  font-size: 15px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35);
  transition: transform var(--transition-fast);
}

.btn-onboarding-primary:active {
  transform: scale(0.98);
}

.btn-onboarding-secondary {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px;
  transition: color var(--transition-fast);
}

.btn-onboarding-secondary:hover {
  color: var(--text-main);
}

/* ==========================================================================
   Modais de Autenticação (Login, Cadastro & Perfil)
   ========================================================================== */
.auth-backdrop {
  z-index: 1100;
}

.auth-card {
  max-width: 420px;
  padding: 22px 20px;
  position: relative;
  text-align: left;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.btn-close-modal {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-close-modal:hover {
  background: #E2E8F0;
  color: var(--text-main);
}

.auth-header {
  text-align: center;
  margin-bottom: 12px;
}

.auth-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: #E0F2FE;
  color: var(--primary);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px auto;
}

.auth-header h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}

.auth-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form .form-group {
  margin-bottom: 0;
}

.auth-form .form-input {
  height: 44px;
  font-size: 14px;
  padding: 0 12px;
}

.btn-auth-submit {
  width: 100%;
  height: 50px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  color: #FFF;
  font-size: 15px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
  margin-top: 6px;
  transition: transform var(--transition-fast);
}

.btn-auth-submit:active {
  transform: scale(0.98);
}

.btn-auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-auth-logout {
  height: 50px;
  border-radius: var(--radius-md);
  background: #FEE2E2;
  color: #DC2626;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid #FECACA;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-auth-logout:hover {
  background: #FCA5A5;
}

.auth-footer-link {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.auth-footer-link a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.auth-footer-link a:hover {
  text-decoration: underline;
}

/* Card de Status do Plano */
.plan-status-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.plan-status-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plan-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.plan-status-info strong {
  font-size: 14px;
  color: var(--text-main);
}

.plan-status-info small {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-upgrade-plan {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFF;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}


