/* =====================================================
   OZONCORE • LAYOUT GLOBAL
   ESTRUTURA BASE • SIDEBAR • MAIN • GRID • MOBILE NAV
===================================================== */

/* =====================================================
   CONTAINER / GRID / SEÇÕES
===================================================== */

.container{
  max-width:1200px;
  width:100%;
  margin:0 auto;
}

.grid{
  display:grid;
  gap:20px;
}

.grid-2{ grid-template-columns:1fr 1fr; }
.grid-3{ grid-template-columns:repeat(3,1fr); }
.grid-4{ grid-template-columns:repeat(4,1fr); }

.section{
  margin-bottom:25px;
}

/* =====================================================
   SIDEBAR DESKTOP
===================================================== */

.sidebar{
  width:260px;
  background:var(--sidebar);
  padding:30px 20px;
  display:flex;
  flex-direction:column;
  border-right:1px solid rgba(255,255,255,0.04);
  height:100vh;
  position:fixed;
  left:0;
  top:0;
  z-index:1000;
}

.logo{
  font-size:22px;
  font-weight:700;
  margin-bottom:40px;
  color:var(--accent);
}

.nav{
  display:flex;
  flex-direction:column;
  gap:8px;
  flex:1;
}

.nav a{
  display:block;
  padding:12px 14px;
  border-radius:12px;
  text-decoration:none;
  color:var(--muted);
  transition:.2s;
}

.nav a:hover,
.nav a.active{
  background:rgba(0,255,209,0.12);
  color:var(--accent);
}

/* =====================================================
   SIDEBAR FOOTER • LOGOUT
===================================================== */

.sidebar-footer{
  margin-top:auto;
  padding-top:24px;
  border-top:1px solid rgba(255,255,255,0.04);
}

.logout-btn-sidebar{
  appearance:none;
  -webkit-appearance:none;
  width:100%;
  min-height:52px;
  padding:14px 16px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.08);
  background:linear-gradient(135deg,#1F2937,#111827);
  color:#E6EDF3;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  transition:all .22s ease;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  box-sizing:border-box;
}

.logout-btn-sidebar:hover{
  border-color:rgba(239,68,68,.45);
  background:linear-gradient(135deg,#2A1A1A,#1A1111);
  color:#fff;
  transform:translateY(-2px);
  box-shadow:0 10px 25px rgba(239,68,68,0.22);
}

.logout-btn-sidebar:active{
  transform:scale(0.98);
}

/* =====================================================
   MAIN CONTENT
===================================================== */

.main{
  margin-left:260px;
  flex:1;
  padding:40px 50px;
  min-height:100vh;
}

/* =====================================================
   HEADER PADRÃO
===================================================== */

.page-header{
  margin-bottom:25px;
}

.page-title{
  font-size:26px;
  font-weight:700;
}

.page-sub{
  color:var(--muted);
  font-size:14px;
}

/* =====================================================
   MOBILE NAV (BLINDADO)
===================================================== */

/* 🔒 ESCONDE TOTALMENTE NO DESKTOP */
.mobile-bottom-nav,
.mobile-more-menu{
  display:none !important;
}

/* =====================================================
   ÁREAS AUXILIARES QUE JÁ EXISTEM NO SISTEMA
   (mantidas por segurança para não quebrar telas atuais)
===================================================== */

/* PREVIEW / TEMAS */
.area-preview{
  width:100%;
  max-width:1000px;
  margin:10px auto 0;
  display:flex;
  justify-content:center;
}

.temas-container{
  width:100%;
  max-width:1000px;
  margin:-100px auto 0;
  background:linear-gradient(180deg,#1F2937,#111827);
  border-radius:16px;
  padding:16px;
  border:1px solid rgba(255,255,255,.05);
}

.temas-linha{
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:8px;
}

/* LICENÇAS */
.cards-licencas{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:20px;
  margin-bottom:25px;
  align-items:stretch;
}

.card-licenca{
  background:linear-gradient(180deg,#0F1A2D,#0C1626);
  border:1px solid rgba(255,255,255,0.05);
  border-radius:20px;
  padding:20px;
  backdrop-filter:blur(6px);
  box-shadow:0 12px 30px rgba(0,0,0,.18);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-height:420px;
}

.card-licenca.destaque{
  border:1px solid rgba(0,255,209,.28);
  box-shadow:0 14px 36px rgba(0,255,209,.08);
}

.card-licenca h2{
  font-size:18px;
  font-weight:700;
  margin-bottom:10px;
  color:#E6EDF3;
}

.card-licenca .subtitulo{
  color:#94A3B8;
  font-size:13px;
  margin-top:0;
  margin-bottom:14px;
  line-height:1.45;
}

.cards-licencas.topo-operacao .card-licenca{
  padding:18px;
  min-height:420px;
}

.cards-licencas.topo-operacao .card-status{
  gap:6px;
  margin-bottom:14px;
}

.cards-licencas.topo-operacao .card-status p{
  font-size:15px;
  line-height:1.5;
}

.cards-licencas.topo-operacao .card-status p.extra-info{
  display:none;
}

.cards-licencas.topo-operacao .acoes-card{
  margin-top:14px;
}

.cards-licencas.topo-operacao .btn-licenca{
  min-height:50px;
}

/* STATUS / BLOCOS */
.card-status{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:18px;
}

.card-status p{
  font-size:14px;
  color:#E6EDF3;
  line-height:1.45;
}

.card-status strong{
  color:#fff;
}

.bloco-topo-header{
  margin-bottom:18px;
}

.bloco-topo-header h2{
  font-size:22px;
  margin-bottom:4px;
}

.bloco-topo-header p{
  color:#94A3B8;
  font-size:14px;
}

.upgrade-box{
  margin-top:14px;
  padding:16px;
  border-radius:16px;
  background:rgba(0,255,209,0.05);
  border:1px solid rgba(0,255,209,0.18);
  flex:1;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

.upgrade-box + .upgrade-box{
  margin-top:12px;
}

.upgrade-box .upgrade-title{
  font-size:14px;
  font-weight:700;
  color:#00FFD1;
  margin-bottom:10px;
}

.upgrade-box p{
  margin:5px 0;
  font-size:14px;
  color:#E6EDF3;
  line-height:1.45;
}

.upgrade-box .valor-antigo{
  color:#94A3B8;
}

.upgrade-box .credito{
  color:#10B981;
  font-weight:600;
}

.upgrade-box .valor-final{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid rgba(255,255,255,.08);
  font-size:18px;
  font-weight:800;
  color:#fff;
}

.obs-card{
  margin-top:10px;
  font-size:12px;
  line-height:1.5;
  color:#94A3B8;
}

.acoes-card{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:18px;
}

.btn-licenca{
  width:100%;
  min-height:52px;
  padding:14px 16px;
  border:none;
  border-radius:14px;
  cursor:pointer;
  font-size:15px;
  font-weight:700;
  transition:all .22s ease;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.btn-licenca.primario{
  background:#11E8D1;
  color:#000;
}

.btn-licenca.primario:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 24px rgba(0,255,209,.22);
}

.btn-licenca.secundario{
  background:rgba(255,255,255,.06);
  color:#E6EDF3;
  border:1px solid rgba(255,255,255,.08);
}

.btn-licenca.secundario:hover{
  background:rgba(255,255,255,.10);
  transform:translateY(-2px);
}

.btn-licenca.desabilitado,
.btn-licenca:disabled{
  background:rgba(148,163,184,.10);
  color:#64748B;
  border:1px solid rgba(148,163,184,.10);
  cursor:not-allowed;
  box-shadow:none;
  transform:none;
}

.historico-box{
  margin-top:10px;
  overflow-x:auto;
}

.historico-box table{
  width:100%;
  border-collapse:collapse;
  border-spacing:0;
}

.historico-box thead th{
  text-align:left;
  padding:14px 12px;
  color:#94A3B8;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.6px;
}

.historico-box thead tr{
  border-bottom:1px solid rgba(0,255,209,0.3);
}

.historico-box td{
  padding:16px 12px;
  font-size:14px;
  color:#E6EDF3;
}

.historico-box tbody tr{
  border-bottom:1px solid rgba(255,255,255,0.10);
  transition:.2s;
}

.historico-box tbody tr:last-child{
  border-bottom:none;
}

.historico-box tbody tr:hover{
  background:rgba(0,255,209,0.04);
}

.origem-link{
  color:#00FFD1;
  cursor:pointer;
  font-weight:600;
  text-decoration:none;
}

.origem-link:hover{
  text-decoration:underline;
}

.card-status.compacto{
  gap:10px;
}

.resumo-plano{
  font-size:15px;
  font-weight:600;
  color:#E6EDF3;
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}

.resumo-plano .divider{
  color:#64748B;
  font-weight:400;
}

.blocos-stack{
  display:flex;
  flex-direction:column;
  gap:14px;
  flex:1;
}

/* =====================================================
   RESPONSIVO GLOBAL
===================================================== */

@media(max-width:1100px){
  .cards-licencas{
    grid-template-columns:1fr;
  }
}

@media(max-width:900px){

  .sidebar{
    display:none;
  }

  .main{
    margin-left:0;
    padding:20px;
  }

  .grid-4{
    grid-template-columns:1fr 1fr;
  }

  .temas-linha{
    grid-template-columns:repeat(3,1fr);
  }

  .sidebar-footer{
    padding-top:16px;
  }

  .logout-btn-sidebar{
    min-height:50px;
    font-size:14px;
  }
}

/* MOBILE REAL */
@media(max-width:768px){

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

  /* NAV BAR */
  .mobile-bottom-nav{
    position:fixed;
    bottom:0;
    left:0;
    right:0;
    display:grid !important;
    grid-template-columns:repeat(5,1fr);
    background:rgba(11,18,34,0.96);
    border-top:1px solid rgba(255,255,255,0.08);
    padding:8px 4px;
    z-index:9999;
  }

  .mobile-bottom-nav a,
  .mobile-bottom-nav button{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:4px;
    color:#94A3B8;
    background:none;
    border:none;
    font-size:10px;
    cursor:pointer;
    text-decoration:none;
  }

  .mobile-bottom-nav a span,
  .mobile-bottom-nav button span{
    display:block;
    font-size:10px;
    line-height:1.1;
  }

  .mobile-bottom-nav a.active,
  .mobile-bottom-nav button.active{
    color:#00FFD1;
  }

  /* MENU MAIS */
  .mobile-more-menu{
    position:fixed;
    bottom:80px;
    left:0;
    right:0;
    display:none !important;
    justify-content:center;
    z-index:9998;
  }

  .mobile-more-menu.active{
    display:flex !important;
  }

  .mobile-more-box{
    width:90%;
    background:#111827;
    border-radius:16px;
    padding:12px;
    display:flex;
    flex-direction:column;
    gap:10px;
    box-shadow:0 18px 40px rgba(0,0,0,0.35);
    border:1px solid rgba(255,255,255,0.06);
  }

  .mobile-more-box a,
  .mobile-more-box button{
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px;
    border-radius:12px;
    text-decoration:none;
    background:#1F2937;
    color:#fff;
    border:none;
    cursor:pointer;
  }

  /* EVITA CONTEÚDO ATRÁS DA NAV */
 body{
  padding-bottom:env(safe-area-inset-bottom, 80px);
}

  .temas-linha{
    grid-template-columns:repeat(2,1fr);
  }

  .temas-container{
    margin:-60px auto 0;
    padding:14px;
  }
}

@media(max-width:600px){

  .logout-btn-sidebar{
    min-height:48px;
    border-radius:13px;
    font-size:14px;
  }

  .container{
    max-width:100%;
  }

  .cards-licencas{
    gap:14px;
  }

  .card-licenca{
    border-radius:18px;
    padding:16px;
    min-height:auto;
  }

  .card-licenca h2{
    font-size:18px;
    margin-bottom:10px;
  }

  .card-status p,
  .upgrade-box p{
    font-size:13px;
  }

  .cards-licencas.topo-operacao .card-status p{
    font-size:14px;
  }

  .upgrade-box{
    padding:14px;
    border-radius:14px;
  }

  .upgrade-box .valor-final{
    font-size:16px;
  }

  .obs-card{
    font-size:11px;
  }

  .btn-licenca{
    min-height:50px;
    font-size:14px;
    border-radius:13px;
  }

  .bloco-topo-header h2{
    font-size:20px;
  }

  .bloco-topo-header p{
    font-size:13px;
  }

  /* Histórico mobile amigável */
  .historico-box table,
  .historico-box thead,
  .historico-box tbody,
  .historico-box th,
  .historico-box td,
  .historico-box tr{
    display:block;
    width:100%;
  }

  .historico-box thead{
    display:none;
  }

  .historico-box tbody tr{
    margin-bottom:12px;
    padding:12px;
    border:1px solid rgba(255,255,255,0.08);
    border-radius:14px;
    background:rgba(255,255,255,0.03);
  }

  .historico-box td{
    padding:4px 0;
    border:none;
    font-size:13px;
  }

  .historico-box td::before{
    content:attr(data-label);
    display:block;
    color:#94A3B8;
    font-size:11px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.5px;
    margin-bottom:2px;
  }
}

/* =========================================
   FIX GLOBAL MOBILE • ESTRUTURA
========================================= */

@media (max-width:768px){

  body{
    display:block !important;
  }

  .main{
    margin-left:0 !important;
    display:block !important;
  }

}