/* =============================================
   HERMES INSIGHTS — UPBAR NAVIGATION v3.0
   Horizontal top bar, mobile-first responsive
   ============================================= */

/* CSS vars for easy theming */
:root {
  --fn-bg: #1c1c1e;
  --fn-bg-hover: #2a2a2e;
  --fn-border: #3a3a44;
  --fn-gold: #c9a96e;
  --fn-gold-hover: #b89a5e;
  --fn-text: #d1d5db;
  --fn-text-dim: #6b7280;
  --fn-radius: 10px;
  --fn-icon-size: 34px;
  --fn-bar-height: 54px;
  --fn-transition: 0.2s ease;
}

/* GLOBAL: Allow scrolling (needed for top bar layout) */
html {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }

body {
  overflow-x: hidden;
  overflow-y: auto;
  /* Add top padding so content isn't hidden under fixed bar */
}

/* =============================================
   UPBAR — Fixed top navigation
   ============================================= */
.fn-upbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--fn-bar-height);
  background: var(--fn-bg);
  border-bottom: 1px solid var(--fn-border);
  z-index: 10001;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* Logo */
.fn-upbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
  flex-shrink: 0;
  margin-right: 8px;
}
.fn-upbar-logo:hover {
  background: rgba(201,169,110,0.1);
}
.fn-upbar-logo-icon {
  width: 28px;
  height: 28px;
  background: var(--fn-gold);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: #080809;
  flex-shrink: 0;
}
.fn-upbar-logo-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--fn-gold);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Nav items — horizontal scrollable row */
.fn-upbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
}
.fn-upbar-nav::-webkit-scrollbar { width: 0; height: 0; }

/* Individual nav item */
.fn-upbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: var(--fn-radius);
  text-decoration: none;
  color: var(--fn-text-dim);
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--fn-transition), color var(--fn-transition);
  border: 1px solid transparent;
  min-width: 52px;
  box-sizing: border-box;
}
.fn-upbar-item:hover {
  background: rgba(201,169,110,0.08);
  border-color: rgba(201,169,110,0.15);
  color: var(--fn-gold);
}
.fn-upbar-item.active {
  background: rgba(201,169,110,0.12);
  border-color: rgba(201,169,110,0.25);
  color: var(--fn-gold);
}

/* Nav icon (emoji) */
.fn-upbar-icon {
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Nav label */
.fn-upbar-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Section divider */
.fn-upbar-divider {
  width: 1px;
  height: 28px;
  background: var(--fn-border);
  flex-shrink: 0;
  margin: 0 4px;
}

/* Scroll hint — gradient fade on edges */
.fn-upbar-scroll-hint {
  position: relative;
  flex-shrink: 0;
}
.fn-upbar-scroll-hint::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
}
.fn-upbar-scroll-hint.right::after {
  right: -12px;
  background: linear-gradient(to right, transparent, var(--fn-bg));
}

/* =============================================
   DESKTOP: Always show labels
   ============================================= */
@media (min-width: 769px) {
  body { padding-top: var(--fn-bar-height); }

  .fn-upbar-label {
    font-size: 10px;
  }

  .fn-upbar-item {
    flex-direction: row;
    min-width: unset;
    padding: 8px 14px;
    gap: 8px;
    font-size: 12px;
    border-radius: 8px;
  }

  .fn-upbar-icon {
    font-size: 16px;
  }

  .fn-upbar-logo-text {
    font-size: 13px;
  }
}

/* =============================================
   MOBILE: Compact, icon-focused with label below
   ============================================= */
@media (max-width: 768px) {
  :root { --fn-bar-height: 60px; --fn-icon-size: 32px; }

  body { padding-top: var(--fn-bar-height); }

  .fn-upbar-logo-text { display: none; }
  .fn-upbar-logo { padding: 6px; }

  /* Make nav items more compact on mobile */
  .fn-upbar-item {
    padding: 5px 8px;
    min-width: 48px;
  }

  /* Section labels hidden on mobile */
  .fn-upbar-section-label { display: none; }
}

/* =============================================
   TABLE WRAPPERS — Horizontal scroll for tables
   ============================================= */
.table-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--fn-border) transparent;
}
.table-scroll-wrapper::-webkit-scrollbar {
  height: 4px;
}
.table-scroll-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.table-scroll-wrapper::-webkit-scrollbar-thumb {
  background: var(--fn-border);
  border-radius: 2px;
}

/* Apply to all tables */
table {
  min-width: 100%;
}

/* =============================================
   RESPONSIVE GRIDS — Mobile single column
   ============================================= */
@media (max-width: 768px) {
  /* Agent cards grid → single column */
  .agents-grid,
  .cards-grid {
    grid-template-columns: 1fr !important;
  }

  /* Dashboard special card — no span 2 on mobile */
  .special-card,
  [style*="grid-column: span 2"] {
    grid-column: span 1 !important;
    grid-column: unset !important;
  }

  /* Score labels — remove min-width */
  .score-label {
    min-width: unset !important;
    font-size: 11px;
  }

  /* Score bars — full width */
  .score-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Pontos forts / oportunidades — single column */
  .pontos-fortes,
  .oportunidade-list,
  .objetor-list {
    grid-template-columns: 1fr !important;
  }

  /* Score badge — smaller on mobile */
  .score-badge {
    width: 56px;
    height: 56px;
    font-size: 20px !important;
  }

  /* Card padding — tighter on mobile */
  .card {
    padding: 14px !important;
  }

  /* Conversation headers — stack vertically */
  .conv-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px;
  }

  .conv-header h3 {
    font-size: 13px !important;
    line-height: 1.4 !important;
  }

  /* Indicadores grid — 2 columns on mobile */
  .indicadores-grid,
  [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Nav items in upbar — smaller */
  .fn-upbar-item {
    min-width: 44px;
    padding: 5px 6px;
  }

  .fn-upbar-icon {
    font-size: 16px;
  }

  .fn-upbar-label {
    font-size: 8px;
  }
}

/* =============================================
   GENERAL PAGE RESPONSIVE HELPERS
   ============================================= */
@media (max-width: 768px) {
  h1 { font-size: 20px !important; }
  h2 { font-size: 16px !important; }
  h3 { font-size: 14px !important; }

  .container {
    padding: 12px !important;
  }

  .header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px;
  }

  /* Footer */
  .footer {
    font-size: 10px !important;
    padding: 12px !important;
  }
}

/* =============================================
   PAGE WRAPPER — Centraliza conteúdo
   ============================================= */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 20px 40px;
}

