:root{
  --primary:#1f7a5b;
  --primary-2:#e8f5ef;
  --gold:#c6a15a;
  --gold-2:#f6edd9;
  --bg:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --border:#e5e7eb;
  --card:#ffffff;
  --shadow:0 1px 2px rgba(17,24,39,.06), 0 6px 20px rgba(17,24,39,.06);
  --radius:12px;
  --radius-sm:10px;
  --focus:0 0 0 3px rgba(31,122,91,.25);
  --sidebar-w:260px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}

a{color:inherit;text-decoration:none}
button,input{font:inherit}
button{cursor:pointer}

.sr-only{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  white-space:nowrap;border:0;
}

/* Layout */
.layout{
  min-height:100vh;
  display:flex;
  background:var(--bg);
}

.sidebar{
  position:fixed;
  top:0;left:0;bottom:0;
  width:var(--sidebar-w);
  background:var(--card);
  border-right:1px solid var(--border);
  padding:16px 12px;
  overflow:auto;
  z-index:30;
  transform:translateX(0);
  transition:transform 160ms ease;
}

.sidebar-header{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px 14px;
  border-bottom:1px solid var(--border);
}

.brand-badge{
  width:40px;height:40px;
  border-radius:10px;
  background:linear-gradient(180deg, var(--primary), #17624a);
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:800;
  letter-spacing:.2px;
}
.brand-title{
  display:flex;
  flex-direction:column;
  line-height:1.1;
}
.brand-title strong{font-size:14px}
.brand-title span{font-size:12px;color:var(--muted)}

.nav{
  padding:12px 6px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.nav a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border-radius:10px;
  color:var(--text);
  border:1px solid transparent;
  transition:background 160ms ease,border-color 160ms ease;
}
.nav a:hover{background:#fafafa;border-color:var(--border)}
.nav a.active{
  background:linear-gradient(0deg, var(--primary-2), var(--primary-2));
  border-color:rgba(198,161,90,.55);
}
.nav small{color:var(--muted)}

.main{
  margin-left:var(--sidebar-w);
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
}

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  background:var(--bg);
  border-bottom:1px solid var(--border);
}

.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 16px;
}

.page-title{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.page-title h1{
  margin:0;
  font-size:16px;
  font-weight:800;
  letter-spacing:.2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.balance-pill{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  padding:8px 10px;
  background:#fff;
  border:1px solid rgba(198,161,90,.45);
  border-radius:999px;
  min-width:auto;
  text-align:right;
  box-shadow:0 1px 0 rgba(17,24,39,.03);
}
.balance-pill strong{
  font-size:13px;
  letter-spacing:0;
  font-weight:500;
}

.content{
  padding:16px;
}

/* Mobile behavior: collapsible sidebar */
.menu-toggle{
  display:none;
  width:40px;height:40px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  transition:background 160ms ease,border-color 160ms ease,transform 160ms ease;
}
.menu-toggle:focus{outline:none;box-shadow:var(--focus)}
.menu-toggle:hover{background:#fafafa}
.menu-toggle .bars{
  width:18px;height:12px;
  margin:0 auto;
  position:relative;
}
.menu-toggle .bars::before,
.menu-toggle .bars::after,
.menu-toggle .bars span{
  content:"";
  position:absolute;
  left:0;right:0;
  height:2px;
  border-radius:2px;
  background:#111;
}
.menu-toggle .bars::before{top:0}
.menu-toggle .bars span{top:5px}
.menu-toggle .bars::after{bottom:0}

.overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(17,24,39,.35);
  z-index:20;
}

@media (max-width: 900px){
  .main{margin-left:0}
  .menu-toggle{display:inline-grid;place-items:center}
  .sidebar{transform:translateX(-105%)}
  body.sidebar-open .sidebar{transform:translateX(0)}
  body.sidebar-open .overlay{display:block}
}

/* Banner horizontal (card) 100% largura */
.page-banner{
  position:relative;
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(198,161,90,.45);
  background:var(--gold-2);
  box-shadow:var(--shadow);
}
.page-banner-img{
  width:100%;
  height:clamp(140px, 22vw, 240px);
  object-fit:cover;
  display:block;
}

/* Action image */
.action-media{
  display:flex;
  align-items:center;
  gap:12px;
}
.action-thumb{
  width:58px;
  height:58px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
  object-fit:cover;
}
.action-name{
  font-size:15px;
  font-weight:900;
  margin:0;
  letter-spacing:.2px;
}

/* Offer card (Comprar Ações) */
.offer-card{
  border-radius:16px;
}
.offer-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.offer-title{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.offer-title strong{
  display:block;
  font-size:16px;
  font-weight:900;
  letter-spacing:.2px;
}
.offer-title .hint{margin:4px 0 0}
.offer-chip{
  font-size:11px;
  font-weight:800;
  color:var(--primary);
  background:var(--primary-2);
  border:1px solid rgba(31,122,91,.25);
  padding:6px 10px;
  border-radius:999px;
  white-space:nowrap;
}
.offer-grid{
  margin-top:12px;
  display:grid;
  grid-template-columns: 1fr 180px;
  gap:12px;
  align-items:end;
}
.offer-metrics{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
}
.metric{
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 10px;
  background:#fff;
}
.metric .label{
  display:block;
  font-size:11px;
  color:var(--muted);
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.metric .value{
  display:block;
  margin-top:6px;
  font-size:14px;
  font-weight:900;
}
.metric .sub{
  display:block;
  margin-top:4px;
  font-size:12px;
  color:#374151;
}
.buy-box .input{padding:10px 12px}
.buy-box .btn{width:100%}

@media (max-width: 720px){
  .offer-grid{grid-template-columns:1fr}
}

/* Vídeos (Como funciona / Operações do dia) */
.video-grid{
  margin-top:12px;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.video-card{
  overflow:hidden;
  border-radius:16px;
}
.video-thumb{
  width:100%;
  aspect-ratio:16/9;
  background:linear-gradient(180deg, var(--primary-2), #ffffff);
  border:1px solid rgba(198,161,90,.35);
  border-radius:14px;
  display:grid;
  place-items:center;
  color:#0f2a22;
  font-weight:700;
}
.video-embed{
  width:100%;
  aspect-ratio:16/9;
  border:1px solid rgba(198,161,90,.35);
  border-radius:14px;
  overflow:hidden;
  background:#000;
}
.video-embed video,
.video-embed iframe{
  width:100%;
  height:100%;
  display:block;
  border:0;
}
@media (max-width: 720px){
  .video-grid{grid-template-columns:1fr}
}

/* Components */
.grid{
  display:grid;
  gap:12px;
}
.grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}

@media (max-width: 900px){
  .grid.cols-3{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width: 520px){
  .grid.cols-3,.grid.cols-2{grid-template-columns:1fr}
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card.pad{padding:14px}

.kpi{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.kpi p{margin:0;color:var(--muted);font-size:12px}
.kpi strong{font-size:16px;letter-spacing:.2px}

.section-title{
  margin:18px 0 10px;
  font-size:13px;
  color:var(--muted);
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
/* Garantir que .live-op-card dentro de .list funcione corretamente */
.list .live-op-card{
  display:block !important;
  width:100% !important;
  margin-bottom:16px !important;
}
.list-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  box-shadow:0 1px 0 rgba(17,24,39,.03);
}
.list-item .meta{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}
.list-item .meta strong{
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.list-item .meta span{
  font-size:12px;
  color:var(--muted);
}
.status{
  font-size:12px;
  font-weight:700;
  color:#0b5b44;
  background:var(--primary-2);
  border:1px solid rgba(31,122,91,.25);
  padding:6px 10px;
  border-radius:999px;
  white-space:nowrap;
}

.btn{
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  border-radius:12px;
  padding:10px 12px;
  font-weight:800;
  letter-spacing:.2px;
  transition:transform 120ms ease,background 160ms ease,border-color 160ms ease;
}
.btn:hover{background:#fafafa}
.btn:active{transform:translateY(1px)}
.btn:focus{outline:none;box-shadow:var(--focus)}

.btn-primary{
  background:var(--primary);
  border-color:rgba(198,161,90,.65);
  color:#fff;
}
.btn-primary:hover{background:#1a6a50}

.btn-danger{
  background:#fff;
  border-color:#fecaca;
  color:#991b1b;
}
.btn-danger:hover{background:#fff5f5}

.input{
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  padding:11px 12px;
  background:#fff;
}
.input:focus{outline:none;box-shadow:var(--focus);border-color:rgba(198,161,90,.65)}
.hint{color:var(--muted);font-size:12px;margin-top:6px}

.row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.row.end{justify-content:flex-end}

.table{
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
  background:#fff;
}
.table .thead,
.table .trow{
  display:grid;
  grid-template-columns: 1.2fr .6fr 1fr 1fr .8fr;
  gap:10px;
  padding:10px 12px;
  align-items:center;
}
.table .thead{
  background:#fafafa;
  border-bottom:1px solid var(--border);
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}
.table .trow{
  border-bottom:1px solid var(--border);
  font-size:13px;
}
.table .trow:last-child{border-bottom:none}
.right{text-align:right}
.mono{font-variant-numeric:tabular-nums}
.table .label{display:none}

@media (max-width: 720px){
  .balance-pill{min-width:140px}
  .table .thead{display:none}
  .table .trow{
    grid-template-columns:1fr;
    gap:6px;
    padding:12px;
  }
  .table .trow .cell{
    display:flex;
    justify-content:space-between;
    gap:10px;
    border-bottom:1px dashed #f1f1f1;
    padding:6px 0;
  }
  .table .trow .cell:last-child{border-bottom:none}
  .table .trow .label{color:var(--muted);font-weight:800;font-size:12px}
  .table .label{display:inline}
}

.toast{
  position:fixed;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  background:#111827;
  color:#fff;
  padding:10px 12px;
  border-radius:999px;
  font-size:13px;
  box-shadow:0 14px 40px rgba(17,24,39,.35);
  opacity:0;
  pointer-events:none;
  transition:opacity 140ms ease, transform 140ms ease;
  z-index:50;
}
.toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(-2px);
}

/* Login */
.login-wrap{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:22px;
  background:linear-gradient(180deg, var(--primary-2) 0%, #ffffff 52%);
}
.login-card{
  width:min(420px, 100%);
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:var(--shadow);
  padding:18px;
}
.logo{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin-bottom:10px;
}
.logo .mark{
  width:46px;height:46px;
  border-radius:14px;
  background:linear-gradient(180deg, var(--primary), #17624a);
  display:grid;
  place-items:center;
  font-weight:900;
  color:#fff;
}
.logo h1{
  margin:0;
  font-size:22px;
  font-weight:900;
  letter-spacing:.2px;
}
.login-sub{
  margin:0 0 14px;
  text-align:center;
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
}

/* Termos pequenos */
.terms-text{
  font-size:9px;
  line-height:1.5;
  color:#6b7280;
  text-align:justify;
  max-height:120px;
  overflow-y:auto;
  padding:8px;
  background:#fafafa;
  border:1px solid var(--border);
  border-radius:8px;
  margin:10px 0;
}
.terms-text strong{color:#111827;font-weight:700}
.terms-checkbox{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin:10px 0;
  font-size:10px;
  color:var(--muted);
}
.terms-checkbox input[type="checkbox"]{
  margin-top:2px;
  flex-shrink:0;
}

/* Live Operations Cards - Estilo V Expandido Animado */
.live-op-card{
  background:linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%) !important;
  border:2px solid var(--primary) !important;
  border-radius:16px !important;
  padding:16px !important;
  margin-bottom:16px !important;
  box-shadow:0 4px 12px rgba(31,122,91,0.15) !important;
  position:relative !important;
  overflow:hidden !important;
  animation:slideInUp 0.6s ease-out backwards !important;
  transition:all 0.3s ease !important;
  display:block !important;
  width:100% !important;
}
.live-op-card:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(31,122,91,0.25);
}

.live-op-header{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:16px;
  padding-bottom:12px;
  border-bottom:2px solid rgba(31,122,91,0.1);
}

.live-op-icon{
  position:relative;
  width:48px;
  height:48px;
  border-radius:12px;
  background:linear-gradient(135deg, var(--primary), #17624a);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  box-shadow:0 4px 12px rgba(31,122,91,0.3);
  flex-shrink:0;
}
.pulse-dot{
  position:absolute;
  top:8px;
  right:8px;
  width:8px;
  height:8px;
  background:#10b981;
  border-radius:50%;
  animation:pulse 2s ease-in-out infinite;
}
@keyframes pulse{
  0%, 100%{opacity:1; transform:scale(1);}
  50%{opacity:0.5; transform:scale(1.2);}
}

.live-op-title{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.live-op-title strong{
  font-size:16px;
  color:var(--text);
  font-weight:800;
}
.live-op-status{
  font-size:12px;
  color:var(--primary);
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.5px;
}

.live-op-expand{
  color:var(--primary);
  transition:transform 0.3s ease;
}
.live-op-card:hover .live-op-expand{
  transform:rotate(180deg);
}

.live-op-content{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:20px;
  align-items:start;
  position:relative;
}

.live-op-image{
  width:80px;
  height:80px;
  border-radius:12px;
  overflow:hidden;
  border:3px solid var(--primary);
  background:#fff;
  box-shadow:0 4px 12px rgba(31,122,91,0.2);
  flex-shrink:0;
}
.live-op-image img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.live-op-details{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:16px;
  flex:1;
}
.live-op-metric{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:12px;
  background:rgba(255,255,255,0.8);
  border-radius:10px;
  border:1px solid rgba(31,122,91,0.15);
}
.live-op-metric .label{
  font-size:11px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0.5px;
  font-weight:700;
}
.live-op-metric .value{
  font-size:18px;
  font-weight:900;
  color:var(--text);
}

.live-op-footer{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top:12px;
  padding-top:12px;
  border-top:2px solid rgba(31,122,91,0.1);
}

.v-shape{
  display:flex;
  gap:4px;
  align-items:flex-end;
  height:24px;
}
.v-line{
  width:4px;
  background:linear-gradient(180deg, var(--primary), #10b981);
  border-radius:2px;
  animation:vExpand 1.5s ease-in-out infinite;
}
.v-line-1{
  height:8px;
  animation-delay:0s;
}
.v-line-2{
  height:16px;
  animation-delay:0.2s;
}
.v-line-3{
  height:24px;
  animation-delay:0.4s;
}
@keyframes vExpand{
  0%, 100%{transform:scaleY(1); opacity:0.7;}
  50%{transform:scaleY(1.3); opacity:1;}
}

.status-badge{
  background:linear-gradient(135deg, var(--primary), #10b981);
  color:#fff;
  padding:8px 16px;
  border-radius:20px;
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:0.5px;
  box-shadow:0 2px 8px rgba(31,122,91,0.3);
}

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

@media(max-width:768px){
  .live-op-details{
    grid-template-columns:1fr;
    gap:12px;
  }
  .live-op-content{
    grid-template-columns:1fr;
    gap:12px;
  }
  .live-op-image{
    width:60px;
    height:60px;
    margin:0 auto;
  }
}
