/* ═══════════════════════════════════════════════════════
   Texas Center Dashboard — CSS
   Background: #FBF6EB | Sidebar: #54382F | Font: Inter
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg: #FBF6EB;
  --surface: #FFFFFF;
  --surface2: #F5EDD8;
  --border: #D9CCAD;
  --border2: #C4B590;
  --palha: #3A2A14;
  --dourado: #B8860B;
  --verde: #1D544A;
  --verde-l: #2a7a6a;
  --marrom: #54382F;
  --marrom-l: #7a5240;
  --text: #3A2A14;
  --muted: #8A7050;
  --muted2: #A89070;
  --green: #1D7A5A;
  --red: #C0504A;
  --amber: #C08020;
  --sidebar-bg: #54382F;
  --sidebar-w: 220px;
  --topbar-h: 64px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ═══ SIDEBAR ═══ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(245,232,198,0.1);
}
.sidebar-logo img {
  max-width: 110px;
  height: auto;
  filter: brightness(1.1);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(245,232,198,0.55);
  transition: all 0.2s;
  cursor: pointer;
}
.sidebar-item:hover {
  color: #F5E8C6;
  background: rgba(245,232,198,0.08);
}
.sidebar-item.active {
  color: var(--sidebar-bg);
  background: #F5E8C6;
  font-weight: 700;
}
.sidebar-item.active .sidebar-icon {
  color: var(--sidebar-bg);
}

.sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.sidebar-footer {
  padding: 16px 16px 20px;
  border-top: 1px solid rgba(245,232,198,0.1);
}

.sidebar-link {
  display: block;
  text-align: center;
  font-size: 0.65rem;
  color: rgba(245,232,198,0.4);
  text-decoration: none;
  font-style: italic;
  margin-top: 10px;
  transition: color 0.2s;
}
.sidebar-link:hover { color: #F5E8C6; }

/* ═══ TOPBAR MOBILE ═══ */
.topbar-mobile {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--sidebar-bg);
  z-index: 150;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.topbar-logo img {
  height: 40px;
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: #F5E8C6;
  border-radius: 2px;
  transition: all 0.3s;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 190;
}
.sidebar-overlay.show { display: block; }

/* ═══ UPLOAD BUTTON ═══ */
.btn-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.6rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--sidebar-bg);
  background: #E6D296;
  border: 1px solid #E6D296;
  font-family: 'DM Mono', monospace;
  font-weight: 700;
  transition: all 0.25s;
  width: 100%;
  justify-content: center;
}
.btn-upload:hover {
  background: #F5E8C6;
  box-shadow: 0 0 16px rgba(230,210,150,0.4);
}
.btn-upload-mobile {
  width: auto;
  padding: 8px 14px;
  font-size: 0.55rem;
}

/* ═══ MAIN CONTENT ═══ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 28px;
}

.section { display: none; }
.section.active { display: block; animation: fadeIn 0.35s ease both; }

/* ═══ SECTION HEADER ═══ */
.sec-hdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.sec-hdr-left h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--palha);
}
.sec-hdr-left p {
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 3px;
}
.sec-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 1px solid var(--border2);
  color: var(--muted);
}
.sec-tag i {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  font-style: normal;
}

/* ═══ KPIs ═══ */
.kpi-row { display: grid; gap: 14px; margin-bottom: 20px; }
.g4 { grid-template-columns: repeat(4,1fr); }
.g3 { grid-template-columns: repeat(3,1fr); }
.g2 { grid-template-columns: 1fr 1fr; }
.mini-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.mk-lbl { font-size: .52rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.mk-val { font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 700; color: var(--palha); }

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.kpi:hover { border-color: var(--border2); transform: translateY(-2px); }
.kpi::before { content:''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--kc, var(--dourado)); }
.kpi::after { content:''; position: absolute; bottom: 0; right: 0; width: 80px; height: 80px; border-radius: 50%; background: var(--kc, var(--dourado)); opacity: 0.06; transform: translate(20px,20px); }
.kpi-lbl { font-size: .56rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.kpi-val { font-family: 'Inter', sans-serif; font-size: 1.6rem; font-weight: 800; color: var(--kc, var(--dourado)); line-height: 1; margin-bottom: 5px; }
.kpi-sub { font-size: .62rem; color: var(--muted); }
.kpi-src { font-size: .52rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted2); margin-top: 6px; }

/* ═══ VENDAS x FATURADO ═══ */
.vf-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px 28px; margin-bottom: 20px; }
.vf-title { font-size: .6rem; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.vf-title span { height: 1px; flex: 1; background: var(--border); }
.vf-cols { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: center; }
.vf-src { font-size: .54rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted2); margin-bottom: 6px; }
.vf-hero { font-family: 'Inter', sans-serif; font-size: 2.4rem; font-weight: 900; line-height: 1; }
.vf-sub { font-size: .65rem; color: var(--muted); margin-top: 6px; }
.vf-meta { margin-top: 14px; }
.vf-meta-row { display: flex; justify-content: space-between; font-size: .65rem; padding: 5px 0; border-bottom: 1px solid var(--border); }
.vf-meta-row:last-child { border-bottom: none; }
.vf-meta-lbl { color: var(--muted); }
.vf-sep { display: flex; flex-direction: column; align-items: center; gap: 8px; }
@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 0px rgba(180,130,20,0); border-color: var(--border2); }
  50% { box-shadow: 0 0 10px rgba(180,130,20,0.25), 0 0 20px rgba(180,130,20,0.1); border-color: rgba(180,130,20,0.55); }
}
.vf-diff-box { background: var(--surface2); border: 1px solid var(--border2); border-radius: 12px; padding: 14px 20px; text-align: center; animation: glowPulse 4s ease-in-out infinite; }
.vf-diff-lbl { font-size: .54rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.vf-diff-val { font-family: 'Inter', sans-serif; font-size: 1.2rem; font-weight: 800; color: var(--amber); }
.vf-diff-sub { font-size: .58rem; color: var(--muted); margin-top: 4px; }
.vf-arrow { font-size: 1.2rem; color: var(--border2); }

/* ═══ META ═══ */
.meta-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px 26px; margin-bottom: 20px; }
.meta-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.meta-top h3 { font-size: .6rem; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.fat-hero { font-family: 'Inter', sans-serif; font-size: 2rem; font-weight: 900; color: var(--dourado); }
.fat-hero span { font-size: 1rem; color: var(--muted); font-family: 'DM Mono', monospace; font-weight: 400; }
.prog-track { height: 8px; background: var(--surface2); border-radius: 100px; overflow: hidden; margin-bottom: 8px; }
.prog-fill { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--marrom), var(--dourado)); box-shadow: 0 0 12px rgba(180,130,20,0.2); transition: width 1.5s cubic-bezier(.4,0,.2,1); width: 0%; }
.meta-pins { display: flex; justify-content: space-between; margin-bottom: 14px; }
.mp-name { font-size: .56rem; text-transform: uppercase; letter-spacing: 1px; }
.mp-val { font-size: .6rem; color: var(--muted); }
.meta-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.meta-c { padding: 11px 14px; border-radius: 10px; border: 1px solid; display: flex; align-items: center; gap: 10px; }
.meta-c .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.meta-c .mn { font-size: .55rem; text-transform: uppercase; letter-spacing: 1px; opacity: .6; }
.meta-c .mv { font-family: 'Inter', sans-serif; font-size: .9rem; font-weight: 700; }
.meta-c .ms { font-size: .56rem; color: var(--muted); }

/* ═══ CARDS ═══ */
.cards-row { display: grid; gap: 18px; margin-bottom: 20px; }
.c2 { grid-template-columns: 1fr 1fr; }
.c3 { grid-template-columns: 1fr 1fr 1fr; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
}
.card-title {
  font-size: .6rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted);
  margin-bottom: 18px; display: flex; align-items: center; gap: 8px;
}
.card-title em { display: inline-block; width: 8px; height: 8px; border-radius: 2px; font-style: normal; }

/* ═══ TAXA DE CONVERSÃO POR CANAL ═══ */
.tc-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; margin-bottom: 20px; }
.tc-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 16px; position: relative; overflow: hidden; transition: border-color .2s, transform .2s; text-align: center; }
.tc-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.tc-card::before { content:''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--cc); }
.tc-canal { font-size: .55rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.tc-avatar { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; margin: 0 auto 10px; }
.tc-pct { font-family: 'Inter', sans-serif; font-size: 1.8rem; font-weight: 900; color: var(--cc); line-height: 1; margin-bottom: 6px; }
.tc-formula { font-size: .58rem; color: var(--muted); line-height: 1.5; margin-bottom: 8px; }
.tc-src { font-size: .52rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted2); padding: 3px 8px; border-radius: 4px; background: var(--surface2); display: inline-block; }
.tc-gauge { width: 70px; height: 35px; margin: 0 auto 8px; position: relative; }
.tc-gauge svg { width: 100%; height: 100%; }

/* ═══ TABELAS ═══ */
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-size: .55rem; letter-spacing: 2px; text-transform: uppercase; color: var(--muted2); padding: 8px 12px; border-bottom: 1px solid var(--border); }
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 10px 12px; font-size: .72rem; }
.vchip { display: flex; align-items: center; gap: 8px; }
.av { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: .6rem; font-weight: 700; flex-shrink: 0; }
.vname-txt { font-family: 'Inter', sans-serif; font-weight: 700; font-size: .85rem; }
.mbar-w { display: flex; align-items: center; gap: 6px; }
.mbar { flex: 1; height: 4px; background: var(--surface2); border-radius: 100px; overflow: hidden; max-width: 64px; }
.mbar-f { height: 100%; border-radius: 100px; }
.pct-txt { font-size: .62rem; color: var(--muted); min-width: 28px; }

/* ═══ LISTAS ═══ */
.estado-row,.prod-row,.origem-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.estado-row:last-child,.prod-row:last-child,.origem-row:last-child { border-bottom: none; }
.estado-sig { width: 32px; height: 32px; border-radius: 8px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: .65rem; font-weight: 700; color: var(--dourado); flex-shrink: 0; }
.estado-nome { flex: 1; font-size: .72rem; }
.estado-val { font-size: .72rem; color: var(--dourado); font-family: 'Inter', sans-serif; font-weight: 700; }
.estado-qtd { font-size: .6rem; color: var(--muted); margin-left: 6px; }
.prod-rank { width: 20px; font-size: .65rem; color: var(--muted2); text-align: center; flex-shrink: 0; }
.prod-name { flex: 1; font-size: .68rem; line-height: 1.3; }
.prod-val { font-size: .7rem; color: var(--dourado); font-family: 'Inter', sans-serif; font-weight: 700; white-space: nowrap; }
.prod-qtd { font-size: .6rem; color: var(--muted); white-space: nowrap; margin-left: 4px; }
.origem-name { font-size: .72rem; flex: 1; }
.origem-bar { flex: 2; height: 4px; background: var(--surface2); border-radius: 100px; overflow: hidden; }
.origem-bar-f { height: 100%; border-radius: 100px; background: var(--dourado); }
.origem-val { font-size: .68rem; color: var(--muted); min-width: 72px; text-align: right; }

/* ═══ ATENDIMENTO ═══ */
.atend-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; transition: border-color .2s; }
.atend-card:hover { border-color: var(--border2); }
.atend-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.atend-av { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; }
.atend-name { font-family: 'Inter', sans-serif; font-weight: 700; font-size: .9rem; }
.atend-email { font-size: .58rem; color: var(--muted); }
.atend-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.as { background: var(--surface2); border-radius: 8px; padding: 8px 10px; }
.asl { font-size: .53rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.asv { font-family: 'Inter', sans-serif; font-size: .95rem; font-weight: 700; color: var(--dourado); }

/* ═══ FOOTER ═══ */
footer {
  text-align: center; padding: 24px; color: var(--muted2); font-size: .58rem; letter-spacing: 2px;
  text-transform: uppercase; border-top: 1px solid var(--border); margin-top: 8px;
}

/* ═══ UPLOAD OVERLAY ═══ */
.upload-overlay { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(10,8,4,.88); backdrop-filter: blur(8px); align-items: center; justify-content: center; }
.upload-overlay.show { display: flex; }
.upload-box { background: var(--surface); border: 2px dashed var(--border2); border-radius: 20px; padding: 48px 56px; text-align: center; max-width: 540px; width: 90%; transition: border-color .3s; position: relative; }
.upload-box.dragover { border-color: var(--dourado); box-shadow: 0 0 30px rgba(180,130,20,0.15); }
.upload-box h3 { font-family: 'Inter', sans-serif; font-size: 1.3rem; font-weight: 800; color: var(--palha); margin-bottom: 8px; }
.upload-box p { font-size: .7rem; color: var(--muted); margin-bottom: 20px; line-height: 1.6; }
.upload-box .choose-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 28px; border-radius: 10px; font-size: .7rem; font-family: 'DM Mono', monospace; cursor: pointer; background: var(--verde); color: #F5E8C6; border: 1px solid var(--verde-l); letter-spacing: 1px; text-transform: uppercase; transition: all .2s; }
.upload-box .choose-btn:hover { background: var(--verde-l); box-shadow: 0 0 16px rgba(29,84,74,.4); }
.upload-box .close-btn { position: absolute; top: 16px; right: 20px; background: none; border: none; color: var(--muted); font-size: 1.6rem; cursor: pointer; transition: color .2s; }
.upload-box .close-btn:hover { color: var(--palha); }
.upload-status { margin-top: 16px; font-size: .68rem; color: var(--green); min-height: 22px; }
.upload-progress { height: 4px; background: var(--surface2); border-radius: 100px; overflow: hidden; margin-top: 10px; display: none; }
.upload-progress-fill { height: 100%; background: linear-gradient(90deg, var(--verde), var(--dourado)); border-radius: 100px; width: 0%; transition: width .6s ease; }
.upload-last { font-size: .54rem; color: var(--muted2); letter-spacing: 1px; margin-top: 12px; }

/* ═══ BADGE / NAV EXTRAS ═══ */
.badge-live { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 100px; font-size: .58rem; letter-spacing: 1.5px; text-transform: uppercase; background: rgba(29,84,74,.12); border: 1px solid rgba(29,122,90,.3); color: var(--green); }
.badge-live::before { content:''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 1.5s infinite; }
.badge-date { font-size: .6rem; color: var(--muted); letter-spacing: 1px; }

/* ═══ ACOES (placeholder) ═══ */
.acoes-placeholder {
  text-align: center;
  padding: 80px 40px;
  color: var(--muted);
}
.acoes-placeholder h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--palha);
  margin-bottom: 8px;
}

/* ═══ STATUS BAR ═══ */
.status-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  padding: 0 0 16px;
}

/* ═══ ANIMATIONS ═══ */
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mapDotPulse { from { opacity: .7; } to { opacity: 1; filter: drop-shadow(0 0 5px rgba(180,130,20,.8)); } }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2,1fr); }
  .c2, .c3 { grid-template-columns: 1fr; }
  .vf-cols { grid-template-columns: 1fr; }
  .tc-grid { grid-template-columns: repeat(2,1fr); }
  .meta-cards { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .topbar-mobile { display: flex; }
  .main-content { margin-left: 0; padding-top: var(--topbar-h); }
  .wrap { padding: 16px 14px; }
}
