/* ERP SystemLike - App Executivo (v3.0 Extended) */
:root {
  --bg-main: #090d16;
  --bg-card: #121827;
  --bg-card-hover: #1a2236;
  --bg-header: rgba(18, 24, 39, 0.88);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(16, 185, 129, 0.4);
  --border-ai: rgba(6, 182, 212, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.25);
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="light"],
html[data-theme="light"],
body[data-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #e2e8f0;
  --bg-header: rgba(255, 255, 255, 0.94);
  
  --border-color: rgba(15, 23, 42, 0.12);
  --border-focus: rgba(9, 105, 218, 0.5);
  --border-ai: rgba(6, 182, 212, 0.5);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --accent-emerald: #059669;
  --accent-emerald-glow: rgba(5, 150, 105, 0.2);
  --accent-cyan: #0284c7;
  --accent-cyan-glow: rgba(2, 132, 199, 0.2);
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
}

[data-theme="light"] .systemlike-logo-img {
  content: url('/SystemLike_bp.png');
}

[data-theme="light"] .hero-kpi-card {
  background: linear-gradient(135deg, rgba(9, 105, 218, 0.08) 0%, rgba(6, 182, 212, 0.05) 100%);
  border-color: rgba(9, 105, 218, 0.2);
}

[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .modal-sheet {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

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

input, textarea, button {
  user-select: text;
  -webkit-user-select: text;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-family);
  overflow: hidden;
  position: fixed;
}

#app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background-color: var(--bg-main);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* Header Superior */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px 16px;
  background: var(--bg-header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  z-index: 20;
}

.brand-left {
  display: flex;
  align-items: center;
  flex: 1;
}

.systemlike-logo-img {
  height: 44px;
  max-height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.brand-right {
  display: flex;
  align-items: center;
}

.header-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.header-user-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.1);
}

.user-avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  font-weight: 700;
  font-size: 13px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.modal-avatar-badge {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header-avatar-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  border-radius: 4px;
}

.user-company-titles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.15;
}

.user-header-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-sub-pill {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Área de Conteúdo */
.app-content {
  flex: 1;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(75px, calc(65px + env(safe-area-inset-bottom)));
}

.tab-pane {
  display: none;
  padding: 16px;
  opacity: 0;
  will-change: opacity, transform;
}

.tab-pane.active {
  display: block;
  animation: tabNativeSlide 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tabNativeSlide {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ABA: Raio-X do Dia */
.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin: 16px 0 10px 0;
}

.hero-kpi-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(6, 182, 212, 0.05) 100%);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  position: relative;
}

.hero-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.hero-kpi-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.hero-kpi-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
}

.hero-kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.hero-kpi-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.kpi-subcard {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.kpi-subcard-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.kpi-subcard-value {
  font-size: 18px;
  font-weight: 700;
}

.kpi-subcard-value.green { color: var(--accent-emerald); }
.kpi-subcard-value.rose { color: var(--accent-rose); }
.kpi-subcard-value.cyan { color: var(--accent-cyan); }
.kpi-subcard-value.amber { color: var(--accent-amber); }

/* Filtro de Data Personalizada no Relatório */
.custom-date-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  animation: fadeIn 0.2s cubic-bezier(0,0,0.2,1);
}

.custom-date-field {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.custom-date-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.app-date-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}

.app-date-input:focus {
  border-color: var(--accent-emerald);
}

/* ABA: Lyko (IA) - Minimalista & Clean */
.app-content.ia-active {
  overflow: hidden;
  padding-bottom: calc(65px + env(safe-area-inset-bottom)) !important;
}

#tab-ia.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px 14px 6px 14px;
  box-sizing: border-box;
}

.ai-header-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.ai-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.ai-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.pulse-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulseGlow 1.5s infinite;
}

.ai-glow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulseGlow 2s infinite;
}

.chat-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 10px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 92%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
  animation: fadeIn 0.2s cubic-bezier(0,0,0.2,1);
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-bottom-left-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  color: #ffffff;
  border-bottom-right-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
  font-weight: 500;
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 5px 5px 14px;
  border-radius: var(--radius-full);
  margin-top: auto;
  margin-bottom: 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input-bar:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.25);
}

.chat-input-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13.5px;
}

.chat-input-bar input::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.send-btn:active {
  transform: scale(0.94);
}

/* ABA: Relatórios Executivos por Período */
.period-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 12px 0;
  scrollbar-width: none;
}
.period-pills::-webkit-scrollbar { display: none; }

.pill-btn {
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.pill-btn.active {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.bar-chart-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding: 12px 8px 0 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.bar-col {
  flex: 1;
  min-width: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.bar-fill {
  width: 100%;
  max-width: 24px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #10b981 0%, #06b6d4 100%);
  transition: height 0.3s ease;
}

.bar-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ABA: Consultas Minimalistas */
.segmented-control {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.segment-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
}

.clickable-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.clickable-card:active {
  transform: scale(0.98);
  border-color: var(--border-focus);
}

/* ABA: Liberações e Alertas */
.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.action-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.action-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.action-tag.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.action-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.btn-action-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}

.btn-action-solid {
  background: var(--accent-emerald);
  border: none;
  color: #ffffff;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}

/* Bottom Navigation Bar (5 Abas) */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(65px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 30;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  width: 20%;
  height: 52px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
  transition: var(--transition-fast);
}

.nav-item span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

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

.nav-item.active svg {
  transform: translateY(-2px);
  stroke: var(--accent-cyan);
}

/* List Cards */
.list-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.list-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.list-item-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.list-item-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Modais de Detalhe e Perfil */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: var(--bg-card);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 20px max(24px, calc(16px + env(safe-area-inset-bottom))) 20px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0, 0, 0.2, 1);
  user-select: text;
  -webkit-user-select: text;
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

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

.btn-danger-outline {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius-md);
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-action-outline-blue {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius-md);
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-secondary {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

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

/* Offline Banner (Ícone Sem Internet) */
.offline-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(244, 63, 94, 0.15);
  border-bottom: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  z-index: 25;
  animation: fadeIn 0.25s ease;
}

.offline-banner svg {
  flex-shrink: 0;
  margin-right: 6px;
}

.btn-retry-offline {
  background: var(--accent-rose);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: max(80px, calc(70px + env(safe-area-inset-bottom)));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(18, 24, 39, 0.95);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  white-space: nowrap;
}

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

.toast-notification.success {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.toast-notification.error {
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

/* Form Inputs extra */
.app-textarea {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font-family);
  outline: none;
  resize: vertical;
}

.app-textarea:focus {
  border-color: var(--border-focus);
}

.profile-card-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}

[data-theme="light"] .profile-card-box {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.1);
}

.theme-switcher-toggle {
  display: flex;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 4px;
}

.theme-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-btn.active {
  background: var(--bg-card);
  color: var(--accent-cyan);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-weight: 700;
  border: 1px solid var(--border-color);
}

/* ERP SystemLike - Brand Colors & Gradient Tokens */
:root {
  --accent-blue: #0969da;
  --accent-blue-glow: rgba(9, 105, 218, 0.25);
  --brand-gradient: linear-gradient(135deg, #0969da 0%, #06b6d4 50%, #10b981 100%);
  --brand-gradient-glow: rgba(9, 105, 218, 0.35);
}

.btn-danger-solid {
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-rose);
  border: none;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.btn-action-solid-blue {
  width: 100%;
  min-height: 46px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--brand-gradient-glow);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* ==========================================================================
   MOBILE NATIVE LOGIN PAGE STYLES (/app/login.php v3.3)
   ========================================================================== */
.login-body {
  background-color: var(--bg-main);
  overflow-y: auto !important;
  position: relative !important;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

/* Ambient Glow Blobs in Background */
.login-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.25;
  animation: pulseGlow 8s ease-in-out infinite alternate;
}

.login-bg-glow.glow-blue {
  top: -80px;
  left: -60px;
  width: 280px;
  height: 280px;
  background: var(--accent-blue);
}

.login-bg-glow.glow-cyan {
  bottom: 10%;
  right: -50px;
  width: 260px;
  height: 260px;
  background: var(--accent-cyan);
  animation-delay: -3s;
}

.login-bg-glow.glow-emerald {
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 220px;
  background: var(--accent-emerald);
  animation-delay: -5s;
}

@keyframes pulseGlow {
  0% { transform: scale(1) translateY(0); opacity: 0.2; }
  100% { transform: scale(1.15) translateY(-15px); opacity: 0.35; }
}

.login-container {
  width: 100%;
  max-width: 390px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  z-index: 2;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-brand-header {
  text-align: center;
}

.logo-glow-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle, rgba(9, 105, 218, 0.2) 0%, rgba(6, 182, 212, 0.1) 60%, transparent 100%);
  margin-bottom: 8px;
  transition: transform 0.3s ease;
}

.logo-glow-wrapper:hover {
  transform: scale(1.02);
}

.login-logo-img {
  height: 68px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(9, 105, 218, 0.3));
}

.login-app-title {
  font-size: 23px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 2px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-app-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s ease;
}

.app-input,
.app-select {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 13px 14px 13px 44px;
  font-size: 14px;
  font-family: var(--font-family);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.app-input:focus,
.app-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

.app-input:focus + .input-icon,
.input-with-icon:focus-within .input-icon {
  color: var(--accent-cyan);
}

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

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

.form-options {
  margin-bottom: 20px;
}

.custom-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.custom-checkbox-label input {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-main);
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.custom-checkbox-label input:checked + .checkbox-custom {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.custom-checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.btn-login-solid {
  width: 100%;
  min-height: 50px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--brand-gradient-glow);
  transition: transform 0.15s ease, opacity 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-login-solid:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-link-btn {
  color: var(--accent-cyan);
  background: none;
  border: none;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.login-version {
  font-size: 11px;
  opacity: 0.7;
}

/* ==========================================================================
   FULL-SCREEN SPLASH SCREEN TRANSITION OVERLAY
   ========================================================================== */
.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.splash-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}

.splash-logo-container {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.splash-ring-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent-cyan);
  border-right-color: var(--accent-emerald);
  border-bottom-color: var(--accent-blue);
  animation: ringRotate 1.4s linear infinite;
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.3);
}

.splash-spinning-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  animation: iconPulse 2s ease-in-out infinite alternate;
}

@keyframes ringRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes iconPulse {
  0% { transform: scale(0.95); opacity: 0.85; }
  100% { transform: scale(1.08); opacity: 1; filter: drop-shadow(0 0 12px var(--accent-cyan)); }
}

.splash-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.splash-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 20px;
}

.splash-progress-bar {
  width: 180px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.splash-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--brand-gradient);
  border-radius: 99px;
  transition: width 0.35s ease;
}

/* ==========================================================================
   PULL-TO-REFRESH INDICATOR (NATIVO MOBILE)
   ========================================================================== */
.ptr-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 0px;
  overflow: hidden;
  opacity: 0;
  transition: height 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  color: var(--text-secondary, #94a3b8);
  font-size: 12px;
  font-weight: 600;
  padding-top: 0px;
}

.ptr-indicator.pulling {
  opacity: 1;
}

.ptr-indicator.refreshing {
  height: 48px;
  opacity: 1;
  padding-top: 8px;
}

.ptr-spinner-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
}

.ptr-indicator.refreshing .ptr-spinner-container {
  animation: ptrSpin 0.9s linear infinite;
  border-top-color: var(--accent-cyan, #06b6d4);
}

.ptr-icon {
  transition: transform 0.2s ease;
}

.ptr-indicator.ready .ptr-icon {
  transform: rotate(180deg);
}

@keyframes ptrSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   SKELETON LOADERS (CARREGAMENTO ELEGANTE PULSANTE)
   ========================================================================== */
.skeleton-loader {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06) !important;
  border-radius: 6px;
  color: transparent !important;
  user-select: none !important;
  pointer-events: none !important;
  min-height: 18px;
}

.skeleton-loader * {
  visibility: hidden !important;
}

.skeleton-loader::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  animation: skeletonShimmer 1.4s infinite;
}

@keyframes skeletonShimmer {
  100% {
    transform: translateX(100%);
  }
}

/* -------------------------------------------------------------
   GRÁFICO LEVE DE EVOLUÇÃO POR HORA (SVG SPARKLINE INTRADAY)
   ------------------------------------------------------------- */
.hourly-chart-wrapper {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hourly-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.hourly-chart-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #94a3b8);
}

.hourly-chart-peak {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-emerald, #10b981);
}

.hourly-chart-container {
  position: relative;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hourly-svg {
  width: 100%;
  height: 92px;
  display: block;
}

.bar-group {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.bar-group:hover, .bar-group:active {
  opacity: 0.85;
}

.bar-rect {
  transition: height 0.3s ease, y 0.3s ease, fill 0.3s ease;
}

.bar-rect.peak {
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.4));
}

.bar-label {
  font-size: 8.5px;
  fill: #94a3b8;
  font-weight: 500;
}

.bar-label.peak-label {
  fill: #10b981;
  font-weight: 700;
}

.chart-tooltip {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #f8fafc;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.chart-tooltip.visible {
  opacity: 1;
}

/* ==========================================================================
   FICHA DE ITENS E AUDITORIA DE MARGEM - APP CEO MOBILE (BOTTOM SHEET)
   ========================================================================== */
.quote-sheet-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.quote-sheet-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quote-sheet-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}

.quote-sheet-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.quote-kpi-box {
  background: var(--bg-card-subtle, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 10px 12px;
}

.quote-kpi-label {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.quote-kpi-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

.quote-prod-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.quote-prod-card {
  background: var(--bg-card-subtle, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 12px;
  position: relative;
  transition: transform 0.15s ease;
}

.quote-prod-card.alert-below {
  border-left: 4px solid #ef4444;
  background: rgba(239, 68, 68, 0.03);
}

.quote-prod-card.alert-ok {
  border-left: 4px solid #10b981;
}

.quote-prod-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 6px;
}

.quote-prod-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 6px;
}

[data-theme="light"] .quote-prod-grid {
  background: rgba(0, 0, 0, 0.04);
}

.quote-prod-col {
  display: flex;
  flex-direction: column;
}

.quote-prod-col-label {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  text-transform: uppercase;
}

.quote-prod-col-val {
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}

.quote-prod-col-val.text-danger {
  color: #ef4444;
}

.quote-prod-col-val.text-success {
  color: #10b981;
}

.quote-prod-col-val.text-muted {
  color: var(--text-secondary);
}

.quote-prod-diff-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.quote-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.quote-btn-approve-lg {
  width: 100%;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  background: #10b981;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}

.quote-btn-approve-lg:active {
  transform: scale(0.98);
  filter: brightness(0.92);
}

.quote-btn-reject-lg {
  width: 100%;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.quote-btn-reject-lg:active {
  background: rgba(239, 68, 68, 0.08);
}

@keyframes spin-infinite {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-icon {
  animation: spin-infinite 1s linear infinite;
  display: inline-block;
}






