/* ==========================================================================
   PRODUTIVIDADE CALMA — DESIGN SYSTEM & PWA STYLESHEET
   Marca: Nascimento Consultoria (Vander Core)
   Cores Oficiais: Violet #7B6CF6, Slate Dark #1E293B, Off-white #F8FAFC
   Tipografia: Sora (Títulos) + Plus Jakarta Sans (Texto Principal)
   ========================================================================== */

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

:root {
  /* Design Tokens — Produtividade Calma / Nascimento Consultoria */
  --primary: #7B6CF6;
  --primary-hover: #6f60e9;
  --primary-light: #eceafd;
  --primary-secondary: #5c50b2;
  
  --bg-main: #F8FAFC;
  --surface: #FFFFFF;
  --slate-dark: #1E293B;
  --slate-mid: #334155;
  --slate-light: #64748B;
  --border-color: #E2E8F0;
  
  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --whatsapp: #25D366;

  --font-title: 'Sora', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(30, 41, 59, 0.05);
  --shadow-md: 0 4px 14px rgba(123, 108, 246, 0.08), 0 2px 6px rgba(30, 41, 59, 0.04);
  --shadow-lg: 0 10px 30px rgba(123, 108, 246, 0.12);
  --shadow-dark: 0 10px 25px rgba(30, 41, 59, 0.3);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--slate-dark);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Top Bar */
.app-header {
  background-color: var(--slate-dark);
  color: #FFFFFF;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-dark);
}

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

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

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #9B8DFD);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 20px;
  color: #FFFFFF;
  box-shadow: 0 0 15px rgba(123, 108, 246, 0.4);
}

.brand-info h1 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-info p {
  font-size: 0.75rem;
  color: #94A3B8;
}

.engineer-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.avatar-circle {
  width: 32px;
  height: 32px;
  background-color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 13px;
  color: #FFF;
}

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

.engineer-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.engineer-role {
  font-size: 0.7rem;
  color: #CBD5E1;
}

/* Tab Navigation */
.app-nav {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 72px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-container::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-light);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--primary);
  background-color: var(--primary-light);
}

.nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.nav-tab .badge {
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
}

/* Main Content Wrapper */
.main-wrapper {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
}

/* View Sections */
.view-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-section.active {
  display: block;
}

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

/* Page Header & Grid Layouts */
.section-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h2 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--slate-dark);
}

.section-header p {
  color: var(--slate-light);
  font-size: 0.9rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 24px;
}

/* Cards & UI Modules */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title-bar h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.status-pill.em_andamento {
  background-color: #EEF2FF;
  color: #4F46E5;
}

.status-pill.aprovado {
  background-color: var(--success-bg);
  color: var(--success);
}

.status-pill.alerta {
  background-color: var(--danger-bg);
  color: var(--danger);
}

/* Progress Bars */
.progress-container {
  margin: 16px 0;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background-color: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #9B8DFD);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(123, 108, 246, 0.25);
}

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

.btn-secondary {
  background-color: #F1F5F9;
  color: var(--slate-dark);
}

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

.btn-whatsapp {
  background-color: var(--whatsapp);
  color: #FFFFFF;
}

.btn-whatsapp:hover {
  background-color: #1eb956;
}

/* Checklist Modules */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: #FAFAFA;
  margin-bottom: 10px;
  transition: background 0.2s ease;
}

.checklist-item:hover {
  background-color: #F1F5F9;
}

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

.checklist-content {
  flex: 1;
}

.checklist-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.checklist-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--slate-light);
  margin-top: 4px;
}

/* Inspection Cards */
.inspection-card {
  border-left: 4px solid var(--primary);
  padding: 18px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.audio-player-mock {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #F1F5F9;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  margin: 12px 0;
}

.audio-play-btn {
  width: 32px;
  height: 32px;
  background-color: var(--primary);
  color: #FFF;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Client Portal Specific Styles */
.client-hero {
  background: linear-gradient(135deg, var(--slate-dark), #0F172A);
  color: #FFFFFF;
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-dark);
}

.client-hero h2 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.photo-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease;
}

.photo-thumb:hover {
  transform: scale(1.03);
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 20px;
  color: var(--slate-light);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  background-color: var(--surface);
}

/* Floating Voice Button */
.fab-audio {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  background-color: var(--primary);
  color: #FFF;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 200;
  transition: all 0.2s ease;
}

.fab-audio:hover {
  transform: scale(1.08);
  background-color: var(--primary-hover);
}

/* Mobile Hamburger Menu Button */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: #FFF;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Fornecedores & Tabela de Preços */
.supplier-badge {
  background: #EEF2FF;
  color: #4F46E5;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.price-tag {
  font-family: var(--font-title);
  font-weight: 800;
  color: var(--slate-dark);
  font-size: 1.1rem;
}

.delivery-time {
  font-size: 0.78rem;
  color: var(--success);
  font-weight: 600;
}

/* Responsive adjustments & Mobile Sandwich Menu */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
  
  .header-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .engineer-profile {
    display: none;
  }

  .app-nav {
    top: 64px;
  }

  .nav-container {
    display: none;
    flex-direction: column;
    background: var(--surface);
    padding: 8px;
    box-shadow: var(--shadow-dark);
  }

  .nav-container.mobile-open {
    display: flex;
  }

  .nav-tab {
    padding: 14px 16px;
    font-size: 0.92rem;
    border-bottom: 1px solid var(--border-color);
    border-left: 4px solid transparent;
    justify-content: space-between;
    width: 100%;
  }

  .nav-tab.active {
    border-bottom-color: var(--border-color);
    border-left-color: var(--primary);
    background: var(--primary-light);
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

