/* ==========================================================================
   RAPOSÃO NA FESTA • SISTEMA INTEGRADO DE GESTÃO
   Orçamentos Inteligentes • Contratos Oficiais • Pipeline de Clientes
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Squada+One&family=Sora:wght@400;600;700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-dark: #041318;
  --bg-card: #0A2530;
  --bg-card-alt: #0C2D38;
  --bg-card-hover: #0f3644;
  --bg-surface: #071e26;
  
  --teal-primary: #00C9D4;
  --teal-hover: #00e0ed;
  --teal-dark: #007A85;
  --teal-glow: rgba(0, 201, 212, 0.35);
  
  --blue-accent: #0077B6;
  --blue-light: #0096C7;
  
  --gold-primary: #F4C430;
  --gold-dark: #C8950A;
  --gold-glow: rgba(244, 196, 48, 0.3);
  
  --green-success: #22C97A;
  --green-glow: rgba(34, 201, 122, 0.25);
  
  --red-danger: #FF4D6D;
  --yellow-warning: #FFB703;
  --purple-custom: #A855F7;
  
  --text-main: #E8F8FA;
  --text-muted: #8AB8C2;
  --text-sub: #5F8F9B;
  
  --border-teal: rgba(0, 201, 212, 0.22);
  --border-gold: rgba(244, 196, 48, 0.25);
  --border-light: rgba(255, 255, 255, 0.08);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  --font-title: 'Outfit', 'Squada One', sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Sora', sans-serif;
  --font-squada: 'Squada One', sans-serif;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(ellipse 70% 40% at 85% 5%, rgba(0, 201, 212, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 5% 90%, rgba(0, 119, 182, 0.10) 0%, transparent 55%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── BARRA SUPERIOR (HEADER UNIFICADO) ── */
.app-header {
  background: linear-gradient(180deg, rgba(10, 37, 48, 0.95), rgba(7, 30, 38, 0.9));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-teal);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 10px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-surface));
  border: 1px solid var(--border-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 201, 212, 0.25);
  flex-shrink: 0;
}

.brand-logo-wrap img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-text h1 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(0, 201, 212, 0.15);
  color: var(--teal-primary);
  border: 1px solid var(--border-teal);
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.brand-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── NAVEGAÇÃO ENTRE AS 3 TELAS PRINCIPAIS ── */
.nav-pills {
  display: flex;
  align-items: center;
  background: rgba(4, 19, 24, 0.8);
  border: 1px solid var(--border-teal);
  padding: 4px;
  border-radius: 14px;
  gap: 4px;
}

.nav-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-pill-btn svg {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.nav-pill-btn:hover {
  color: #fff;
  background: rgba(0, 201, 212, 0.1);
}

.nav-pill-btn.active {
  background: linear-gradient(135deg, var(--teal-primary), var(--blue-accent));
  color: #041318;
  font-weight: 700;
  box-shadow: 0 2px 12px var(--teal-glow);
}

.nav-pill-btn.active svg {
  transform: scale(1.1);
  stroke: #041318;
}

.badge-count {
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 700;
}

.nav-pill-btn.active .badge-count {
  background: #041318;
  color: var(--teal-primary);
}

/* ── AÇÕES DO TOPO ── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-header-action {
  background: rgba(0, 201, 212, 0.1);
  border: 1px solid var(--border-teal);
  color: var(--teal-primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-header-action:hover {
  background: var(--teal-primary);
  color: var(--bg-dark);
}

.btn-header-gold {
  background: rgba(244, 196, 48, 0.12);
  border-color: var(--border-gold);
  color: var(--gold-primary);
}

.btn-header-gold:hover {
  background: var(--gold-primary);
  color: var(--bg-dark);
}

/* ── CONTEÚDO PRINCIPAL (SPA SCREENS) ── */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  width: 100%;
  flex: 1;
}

.app-screen {
  display: none;
  animation: fadeIn 0.22s ease-in-out;
}

.app-screen.active {
  display: block;
}

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

/* ==========================================================================
   TELA 1: PAINEL DE CLIENTES (PIPELINE / KANBAN)
   ========================================================================== */
.pipeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.pipeline-title-group h2 {
  font-family: var(--font-title);
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.pipeline-title-group p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.pipeline-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap input {
  background: rgba(0, 201, 212, 0.06);
  border: 1px solid var(--border-teal);
  border-radius: 11px;
  padding: 9px 14px 9px 36px;
  color: #fff;
  font-size: 0.85rem;
  font-family: var(--font-body);
  width: 220px;
  outline: none;
  transition: all 0.2s;
}

.search-input-wrap input:focus {
  border-color: var(--teal-primary);
  background: rgba(0, 201, 212, 0.12);
  width: 270px;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  stroke: var(--text-sub);
  pointer-events: none;
}

.btn-primary-add {
  background: linear-gradient(135deg, var(--teal-primary), var(--blue-accent));
  border: none;
  border-radius: 11px;
  color: #041318;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 14px var(--teal-glow);
  transition: all 0.2s;
}

.btn-primary-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--teal-glow);
}

/* ── STATS BAR NO TOPO DO PIPELINE ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat-card {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-card-alt));
  border: 1px solid var(--border-teal);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-info .stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-info .stat-number {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-top: 3px;
}

.stat-card.stat-success {
  border-color: rgba(34, 201, 122, 0.35);
}

.stat-card.stat-success .stat-number {
  color: var(--green-success);
}

.stat-card.stat-gold {
  border-color: rgba(244, 196, 48, 0.35);
}

.stat-card.stat-gold .stat-number {
  color: var(--gold-primary);
}

/* ── COLUNAS DO KANBAN / PIPELINE (5 COLUNAS) ── */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
}

.pipeline-col {
  background: rgba(10, 37, 48, 0.55);
  border: 1px solid var(--border-teal);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  max-height: calc(100vh - 250px);
  overflow: hidden;
}

.col-header {
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: rgba(10, 37, 48, 0.95);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.col-title-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.col-title-text {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.col-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* Cores específicas das 5 colunas */
.col-waiting .col-indicator { background: var(--yellow-warning); box-shadow: 0 0 8px var(--yellow-warning); }
.col-waiting { border-top: 3px solid var(--yellow-warning); }

.col-sent .col-indicator { background: #FB923C; box-shadow: 0 0 8px #FB923C; }
.col-sent { border-top: 3px solid #FB923C; }

.col-promising .col-indicator { background: var(--teal-primary); box-shadow: 0 0 8px var(--teal-primary); }
.col-promising { border-top: 3px solid var(--teal-primary); }

.col-closed .col-indicator { background: var(--green-success); box-shadow: 0 0 8px var(--green-success); }
.col-closed { border-top: 3px solid var(--green-success); }

.col-other .col-indicator { background: var(--purple-custom); box-shadow: 0 0 8px var(--purple-custom); }
.col-other { border-top: 3px solid var(--purple-custom); }

.col-cards-container {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}

.col-cards-container::-webkit-scrollbar {
  width: 5px;
}
.col-cards-container::-webkit-scrollbar-thumb {
  background: rgba(0, 201, 212, 0.25);
  border-radius: 4px;
}

/* ── CARD DE CLIENTE / LEAD NO PIPELINE ── */
.lead-card {
  background: linear-gradient(160deg, #0e303d, #09222c);
  border: 1px solid rgba(0, 201, 212, 0.16);
  border-radius: 12px;
  padding: 13px;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lead-card:hover {
  border-color: var(--teal-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 201, 212, 0.18);
}

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

.lead-name {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.lead-date-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(0, 201, 212, 0.12);
  color: var(--teal-primary);
  border: 1px solid var(--border-teal);
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.lead-details {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lead-details-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.lead-total {
  font-family: var(--font-squada);
  font-size: 1.15rem;
  color: var(--gold-primary);
}

.lead-signal {
  font-size: 0.72rem;
  color: var(--text-sub);
}

/* ── CAMPO DE OBSERVAÇÃO DENTRO DO CARD ── */
.lead-obs-box {
  background: rgba(0, 0, 0, 0.28);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 0.75rem;
  color: #d1ecf1;
  position: relative;
}

.lead-obs-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #e0f2f7;
  font-family: var(--font-body);
  font-size: 0.74rem;
  resize: vertical;
  min-height: 28px;
}

.lead-obs-input::placeholder {
  color: #3f6e7b;
}

/* Tag customizável para a coluna 'Outros' */
.lead-other-tag {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #d8b4fe;
  font-size: 0.72rem;
  padding: 3px 7px;
  border-radius: 6px;
  font-weight: 600;
}

/* ── AÇÕES DO CARD ── */
.lead-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.btn-card-contract {
  flex: 1;
  background: linear-gradient(135deg, var(--teal-primary), var(--blue-accent));
  border: none;
  border-radius: 8px;
  color: #041318;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.18s;
  text-decoration: none;
}

.btn-card-contract:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-card-icon {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-card-icon:hover {
  background: rgba(0, 201, 212, 0.2);
  color: var(--teal-primary);
  border-color: var(--border-teal);
}

.btn-card-icon.danger:hover {
  background: rgba(255, 77, 109, 0.2);
  color: var(--red-danger);
  border-color: var(--red-danger);
}

.lead-status-select {
  background: rgba(4, 19, 24, 0.85);
  border: 1px solid var(--border-teal);
  color: var(--teal-primary);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 4px 6px;
  outline: none;
  cursor: pointer;
  width: 100%;
}

.lead-status-select option {
  background: #071e26;
  color: #fff;
}

/* ==========================================================================
   TELA 2: GERADOR DE ORÇAMENTO
   ========================================================================== */
.budget-wrapper {
  max-width: 680px;
  margin: 0 auto;
}

.card-paste {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-card-alt));
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 4px 20px rgba(244, 196, 48, 0.08);
}

.paste-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(244, 196, 48, 0.15);
}

.paste-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(244, 196, 48, 0.12);
  border: 1px solid rgba(244, 196, 48, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.paste-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-primary);
}

.paste-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.budget-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(244, 196, 48, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.6;
  outline: none;
  min-height: 100px;
  resize: vertical;
}

.budget-textarea:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.12);
}

.btn-parse-gold {
  width: 100%;
  padding: 13px;
  margin-top: 10px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
  border: none;
  border-radius: 11px;
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--bg-dark);
  cursor: pointer;
  box-shadow: 0 4px 16px var(--gold-glow);
  transition: all 0.2s;
}

.btn-parse-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 196, 48, 0.4);
}

.parse-status {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  display: none;
}
.parse-ok { background: rgba(34, 201, 122, 0.15); border: 1px solid rgba(34, 201, 122, 0.35); color: #5de8a4; }
.parse-err { background: rgba(255, 77, 109, 0.15); border: 1px solid rgba(255, 77, 109, 0.35); color: #ff8099; }

/* ── CARDS DO FORMULÁRIO DE ORÇAMENTO ── */
.form-card {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-card-alt));
  border: 1px solid var(--border-teal);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 3px 18px rgba(0, 0, 0, 0.28);
}

.form-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(0, 201, 212, 0.12);
}

.form-card-ico {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(0, 201, 212, 0.12);
  border: 1px solid rgba(0, 201, 212, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.form-card-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.form-group-field {
  margin-bottom: 14px;
}
.form-group-field:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--teal-primary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 6px;
}

.form-input-text {
  width: 100%;
  background: rgba(0, 201, 212, 0.05);
  border: 1px solid rgba(0, 201, 212, 0.22);
  border-radius: 10px;
  padding: 11px 14px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
  color-scheme: dark;
}

.form-input-text:focus {
  border-color: var(--teal-primary);
  background: rgba(0, 201, 212, 0.1);
  box-shadow: 0 0 0 3px rgba(0, 201, 212, 0.12);
}

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

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

.toggle-group {
  display: flex;
  gap: 8px;
}

.toggle-btn {
  flex: 1;
  padding: 11px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.toggle-btn-yes { background: rgba(34, 201, 122, 0.08); border-color: rgba(34, 201, 122, 0.25); color: #4ad890; }
.toggle-btn-yes.on { background: rgba(34, 201, 122, 0.2); border-color: var(--green-success); box-shadow: 0 0 12px rgba(34, 201, 122, 0.18); }

.toggle-btn-no { background: rgba(255, 77, 109, 0.08); border-color: rgba(255, 77, 109, 0.25); color: #ff7a90; }
.toggle-btn-no.on { background: rgba(255, 77, 109, 0.2); border-color: var(--red-danger); box-shadow: 0 0 12px rgba(255, 77, 109, 0.18); }

.btn-calc-main {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--teal-primary), var(--blue-accent));
  border: none;
  border-radius: 14px;
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #041318;
  cursor: pointer;
  box-shadow: 0 6px 22px var(--teal-glow);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-calc-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 28px rgba(0, 201, 212, 0.5);
}

/* ── RESULTADO DO ORÇAMENTO ── */
.res-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(0, 201, 212, 0.15), rgba(0, 119, 182, 0.1));
  border: 1px solid var(--border-teal);
  border-radius: 16px;
  margin-bottom: 14px;
}

.res-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.res-value {
  font-family: var(--font-squada);
  font-size: 2.5rem;
  color: var(--teal-primary);
  line-height: 1;
  text-shadow: 0 0 20px rgba(0, 201, 212, 0.45);
}

.res-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.badge-tag {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.badge-ok { background: rgba(34, 201, 122, 0.15); color: #5de8a4; border: 1px solid rgba(34, 201, 122, 0.35); }
.badge-late { background: rgba(255, 77, 109, 0.18); color: #ff8099; border: 1px solid rgba(255, 77, 109, 0.35); }

.breakdown-box {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-card-alt));
  border: 1px solid var(--border-teal);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}

.brow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(0, 201, 212, 0.08);
  font-size: 0.86rem;
}
.brow:last-child { border-bottom: none; }
.brow.hl {
  background: rgba(0, 201, 212, 0.08);
}
.brow.hl .bv {
  color: var(--teal-primary);
  font-size: 1.05rem;
  font-weight: 700;
}

.msg-preview-card {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-card-alt));
  border: 1px solid var(--border-teal);
  border-radius: 16px;
  margin-bottom: 16px;
  overflow: hidden;
}

.msg-preview-top {
  padding: 12px 18px;
  background: rgba(0, 201, 212, 0.1);
  border-bottom: 1px solid rgba(0, 201, 212, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.msg-preview-body {
  padding: 18px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: #bce5ee;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
}

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

.btn-copy-gold {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
  border: none;
  border-radius: 12px;
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--bg-dark);
  cursor: pointer;
  box-shadow: 0 4px 18px var(--gold-glow);
  transition: all 0.2s;
}

.btn-contract-bridge {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--teal-primary), var(--blue-accent));
  border: none;
  border-radius: 12px;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: #041318;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--teal-glow);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ==========================================================================
   TELA 3: GERADOR DE CONTRATOS (PREVIEW A4 OFICIAL & FORMULÁRIO)
   ========================================================================== */
.contract-view-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contract-tabs-nav {
  display: flex;
  gap: 6px;
  background: rgba(4, 19, 24, 0.7);
  border: 1px solid var(--border-teal);
  padding: 6px;
  border-radius: 14px;
  overflow-x: auto;
}

.contract-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.18s;
}

.contract-tab-btn:hover {
  color: #fff;
  background: rgba(0, 201, 212, 0.08);
}

.contract-tab-btn.active {
  background: rgba(0, 201, 212, 0.18);
  border: 1px solid var(--border-teal);
  color: var(--teal-primary);
  font-weight: 700;
}

.contract-tab-content {
  display: none;
}
.contract-tab-content.active {
  display: block;
}

/* ── PREVIEW DO DOCUMENTO A4 OFICIAL (SEM LINKS NEM URLS NO PDF) ── */
.contract-preview-box {
  background: #111a1e;
  border: 1px solid var(--border-teal);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview-toolbar {
  width: 100%;
  max-width: 820px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

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

.btn-doc-action {
  background: linear-gradient(135deg, var(--teal-primary), var(--blue-accent));
  border: none;
  border-radius: 9px;
  color: #041318;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 14px var(--teal-glow);
  transition: all 0.2s;
}

.btn-doc-whatsapp {
  background: #25D366;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.btn-doc-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: none;
}

/* Folha A4 em tela */
.a4-viewport {
  width: 100%;
  overflow-x: auto;
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.a4-sheet {
  width: 794px; /* A4 proporção exata em 96 DPI */
  min-height: 1123px;
  background: #ffffff;
  color: #1e293b;
  padding: 40px 45px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  font-family: 'Plus Jakarta Sans', Arial, sans-serif;
  font-size: 11px;
  line-height: 1.5;
  transform-origin: top center;
  position: relative;
}

/* Estilo do Documento Oficial do Raposão */
.doc-brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #0284c7;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

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

.doc-logo-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.doc-header-titles h1 {
  font-size: 15px;
  font-weight: 800;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.doc-header-titles p {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}

.doc-protocol {
  text-align: right;
  font-size: 9.5px;
  color: #0369a1;
  font-weight: 700;
}

.doc-box-section {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  margin-bottom: 10px;
  overflow: hidden;
}

.doc-box-title {
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  padding: 5px 10px;
  font-size: 10.5px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.doc-box-body {
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 10.5px;
}

.doc-field-line {
  line-height: 1.35;
}
.doc-field-line strong {
  color: #0f172a;
}
.doc-field-line span {
  color: #334155;
}

.doc-clauses-wrapper {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.doc-clause-block {
  border-left: 2px solid #0284c7;
  padding-left: 8px;
}

.doc-clause-head {
  font-size: 10.5px;
  font-weight: 800;
  color: #0369a1;
  margin-bottom: 2px;
}

.doc-clause-text {
  font-size: 10px;
  color: #334155;
  line-height: 1.45;
  white-space: pre-line;
}

.doc-signatures-wrap {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid #cbd5e1;
}

.doc-signatures-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 20px;
  text-align: center;
}

.sig-line-draw {
  border-top: 1px solid #475569;
  margin-bottom: 4px;
}

.sig-name {
  font-size: 10.5px;
  font-weight: 700;
  color: #0f172a;
}
.sig-info {
  font-size: 9.5px;
  color: #64748b;
}

/* Rodapé do documento SEM QUALQUER LINK */
.doc-print-footer {
  margin-top: 20px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  font-size: 8.5px;
  color: #94a3b8;
}

/* ── MODAL DE NOVO CLIENTE / DETALHES ── */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-window {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-card-alt));
  border: 1px solid var(--border-teal);
  border-radius: 18px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-window-head {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 201, 212, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-window-head h3 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-window-body {
  padding: 20px;
  max-height: 75vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-window-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── TOAST NOTIFICATIONS ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(10, 37, 48, 0.95);
  border: 1px solid var(--border-teal);
  border-radius: 10px;
  padding: 12px 18px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastSlide 0.25s ease-out;
}

.toast-success { border-color: var(--green-success); }
.toast-error { border-color: var(--red-danger); }
.toast-info { border-color: var(--teal-primary); }

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

/* ── IMPRESSÃO LIMPA E SEM LINKS ── */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm;
  }
  
  body, html {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .app-header,
  .pipeline-header,
  .pipeline-board,
  .stats-grid,
  .budget-wrapper,
  .contract-tabs-nav,
  .form-card,
  .preview-toolbar,
  .modal-backdrop,
  .toast-container {
    display: none !important;
  }
  
  .app-screen {
    display: block !important;
  }
  
  #screen-pipeline,
  #screen-budget {
    display: none !important;
  }
  
  #screen-contract {
    display: block !important;
  }
  
  .contract-preview-box {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
  }
  
  .a4-viewport {
    padding: 0 !important;
    overflow: visible !important;
  }
  
  .a4-sheet {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-height: auto !important;
    transform: none !important;
  }
  
  /* Remove qualquer link ou cabeçalho de URL */
  a[href]:after {
    content: none !important;
  }
}

/* ── RESPONSIVIDADE ── */
@media (max-width: 1024px) {
  .pipeline-board {
    grid-template-columns: repeat(5, 260px);
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .nav-pills {
    width: 100%;
    overflow-x: auto;
    justify-content: space-between;
  }
  
  .nav-pill-btn {
    padding: 8px 12px;
    font-size: 0.78rem;
  }
  
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  
  .a4-sheet {
    transform: scale(0.48);
    transform-origin: top center;
    margin-bottom: -500px;
  }
}
