:root {
  /* Paleta Oficial LÓGIX — Cobre Metálico & Titânio Escuro */
  --bg-main: #0B0E17;
  --bg-card: #121826;
  --bg-card-hover: #192236;
  --bg-input: #1B2438;
  
  --border-color: rgba(234, 88, 12, 0.18);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #EA580C;

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  /* Cobre Metálico & Bronze Primário */
  --primary: #C2410C;
  --primary-hover: #9A3412;
  --accent-copper: #EA580C;
  --accent-copper-light: #FB923C;
  --accent-copper-gold: #F59E0B;
  --accent-copper-dark: #7C2D12;
  --accent-cyan: #EA580C; /* Mapeado para cobre metálico */

  /* Cores Funcionais */
  --accent-green: #10B981;
  --accent-amber: #F59E0B;
  --accent-purple: #8B5CF6;
  --accent-red: #EF4444;
  --accent-blue: #38BDF8;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
  --shadow-copper: 0 0 24px rgba(234, 88, 12, 0.35);
  --shadow-cyan: 0 0 24px rgba(234, 88, 12, 0.35);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Background Aesthetic Glowing Blobs em Cobre Quente */
.bg-glow {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-glow-1 {
  position: absolute;
  top: -150px; right: -100px;
  width: 550px; height: 550px;
  background: radial-gradient(circle, rgba(234, 88, 12, 0.16) 0%, transparent 70%);
  filter: blur(90px);
}
.bg-glow-2 {
  position: absolute;
  bottom: -150px; left: -100px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.11) 0%, transparent 70%);
  filter: blur(100px);
}

/* Global Navbar Cobre & Titânio */
.logix-navbar {
  background: rgba(18, 24, 38, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 900;
  padding: 12px 24px;
}

.logix-nav-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

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

.logix-brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-copper-gold), var(--primary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #FFF;
  box-shadow: var(--shadow-copper);
}

.logix-brand-text h1 {
  font-size: 16px;
  font-weight: 800;
  color: #FFF;
  letter-spacing: -0.5px;
}
.logix-brand-text h1 span { 
  background: linear-gradient(135deg, #FB923C, #F59E0B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logix-brand-text p {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.logix-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.logix-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.logix-nav-link:hover {
  color: var(--text-primary);
  background: rgba(234, 88, 12, 0.08);
}

.logix-nav-link.active {
  color: #FFF;
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.25), rgba(194, 65, 12, 0.25));
  border: 1px solid rgba(234, 88, 12, 0.5);
  box-shadow: 0 0 16px rgba(234, 88, 12, 0.2);
}

.logix-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* User Badge */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(234, 88, 12, 0.12);
  border: 1px solid rgba(234, 88, 12, 0.35);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-copper-light);
}

/* Buttons Cobre Metálico */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #EA580C, #C2410C);
  color: #FFF;
  border: 1px solid rgba(251, 146, 60, 0.3);
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #F97316, #EA580C);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.5);
}

.btn-success {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFF;
}
.btn-success:hover {
  background: #059669;
}

.btn-secondary {
  background: #1B2438;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
  background: #24304A;
  border-color: rgba(234, 88, 12, 0.3);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: #EF4444;
  color: #FFF;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 11.5px;
}

/* Layout Containers */
.main-wrapper {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

/* Cards em Titânio & Cobre */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: #FFF;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* KPI Box */
.kpi-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--accent-copper-gold), var(--primary));
}
.kpi-title { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.kpi-value { font-size: 22px; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: var(--accent-copper-light); }
.kpi-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Value Colors */
.val-positive { color: #10B981; font-weight: 700; }
.val-negative { color: #EF4444; font-weight: 700; }
.val-cyan { color: var(--accent-copper-light); font-weight: 700; }
.val-amber { color: #F59E0B; font-weight: 700; }
.val-purple { color: #A855F7; font-weight: 700; }

/* Status Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}
.pill-cyan { background: rgba(234, 88, 12, 0.16); color: var(--accent-copper-light); border: 1px solid rgba(234, 88, 12, 0.3); }
.pill-green { background: rgba(16, 185, 129, 0.15); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.3); }
.pill-amber { background: rgba(245, 158, 11, 0.15); color: #F59E0B; border: 1px solid rgba(245, 158, 11, 0.3); }
.pill-red { background: rgba(239, 68, 68, 0.15); color: #EF4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.pill-blue { background: rgba(56, 189, 248, 0.15); color: #38BDF8; border: 1px solid rgba(56, 189, 248, 0.3); }

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}
th {
  background: #182236;
  color: var(--accent-copper-light);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.5px;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}
tbody tr:hover {
  background: rgba(234, 88, 12, 0.04);
}

/* ==================== GRID E CARDS DE CASAS / IMÓVEIS ==================== */
.casas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.casa-card {
  background: #151D2D;
  border: 1px solid rgba(234, 88, 12, 0.15);
  border-radius: 12px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.casa-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-copper);
  box-shadow: var(--shadow-copper);
  background: #1B263B;
}

.casa-card.cabos {
  border-left: 4px solid var(--accent-copper);
}

.casa-card.critica {
  border-left: 4px solid var(--accent-amber);
}

.casa-card.nao_iniciada {
  border-left: 4px solid var(--text-muted);
}

.casa-num {
  font-size: 14px;
  font-weight: 800;
  color: #FFF;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.casa-area {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 500;
}

.casa-tag-fotos {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--accent-copper-light);
  background: rgba(234, 88, 12, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 8px;
  font-weight: 600;
}

/* Progress Bar Cobre & Ouro */
.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #EA580C, #F59E0B);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Filter Tab Buttons */
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tab-btn {
  background: #1B2438;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tab-btn:hover {
  background: rgba(234, 88, 12, 0.15);
  color: var(--accent-copper-light);
  border-color: rgba(234, 88, 12, 0.3);
}

.filter-tab-btn.active {
  background: linear-gradient(135deg, #EA580C, #C2410C);
  color: #FFF;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.4);
}

/* Form Controls */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: #1B2438 !important;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #FFF !important;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--accent-copper); box-shadow: 0 0 10px rgba(234, 88, 12, 0.3); }

/* ==================== DOCUMENTOS IMPRESSOS A4 / LAUDOS / PROPOSTAS ==================== */
.laudo-container, .proposta-container {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border-radius: 12px;
  padding: 36px 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  border: 1px solid #E2E8F0;
  max-width: 1050px;
  margin: 0 auto 40px auto;
}

.laudo-container table, .proposta-container table {
  background: #FFFFFF !important;
  color: #0F172A !important;
  width: 100%;
}

.laudo-container th, .proposta-container th {
  background: #F8FAFC !important;
  color: #0F172A !important;
  border: 1px solid #CBD5E1 !important;
  font-weight: 800 !important;
  font-size: 11px !important;
  text-transform: uppercase;
}

.laudo-container td, .proposta-container td {
  color: #1E293B !important;
  border: 1px solid #CBD5E1 !important;
  background: #FFFFFF !important;
  font-size: 11px !important;
}

.laudo-container tbody tr:hover, .proposta-container tbody tr:hover {
  background: #F1F5F9 !important;
}

@media print {
  body {
    background: #FFF !important;
    color: #000 !important;
  }
  .logix-navbar, .bg-glow, .btn, .main-wrapper > div:first-child {
    display: none !important;
  }
  .main-wrapper {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .laudo-container, .proposta-container {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
}

.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  position: relative;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.modal-title { font-size: 17px; font-weight: 800; color: #FFF; }
.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}
.modal-close:hover { color: #FFF; }
