/* XINGUZINHO_CENTRAL_V2_FASE5_CSS_V1 */

.xv5-page{
  display:grid;
  gap:16px;
}

.xv5-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}

.xv5-header h1{
  margin:0 0 5px;
  color:var(--tema-texto,#0f172a);
  font-size:25px;
}

.xv5-header p{
  margin:0;
  color:var(--tema-texto-secundario,#64748b);
}

.xv5-cards{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
}

.xv5-card{
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px;
  border:1px solid var(--tema-borda,#e2e8f0);
  border-radius:13px;
  background:var(--tema-card,#fff);
}

.xv5-card>span{
  width:38px;
  height:38px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--tema-card-2,#f8fafc);
  border-radius:10px;
  font-size:19px;
}

.xv5-card>div{
  display:grid;
  gap:2px;
}

.xv5-card small{
  color:var(--tema-texto-secundario,#64748b);
  font-size:10px;
}

.xv5-card strong{
  color:var(--tema-texto,#0f172a);
  font-size:20px;
}

.xv5-panel-body{
  padding:15px;
}

.xv5-regras{
  display:grid;
  gap:9px;
}

.xv5-regra{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px;
  border:1px solid var(--tema-borda,#e2e8f0);
  background:var(--tema-card,#fff);
  border-radius:12px;
}

.xv5-regra-main{
  min-width:0;
  flex:1;
}

.xv5-regra-topo{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}

.xv5-regra-topo strong{
  color:var(--tema-texto,#0f172a);
  font-size:13px;
}

.xv5-regra p{
  margin:7px 0 0;
  color:var(--tema-texto-secundario,#64748b);
  font-size:11px;
}

.xv5-regra-main>small{
  display:block;
  margin-top:8px;
  color:var(--tema-texto-secundario,#94a3b8);
  font-size:9px;
}

.xv5-regra-acoes{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.xv5-pill{
  display:inline-flex;
  padding:4px 7px;
  border-radius:999px;
  font-size:9px;
  font-weight:800;
  white-space:nowrap;
}

.xv5-ok{
  background:#dcfce7;
  color:#166534;
}

.xv5-bad{
  background:#fee2e2;
  color:#991b1b;
}

.xv5-info{
  background:#dbeafe;
  color:#1d4ed8;
}

.xv5-off{
  background:#f1f5f9;
  color:#64748b;
}

.xv5-tabela-wrap{
  overflow:auto;
}

.xv5-tabela{
  width:100%;
  min-width:980px;
  border-collapse:collapse;
}

.xv5-tabela th,
.xv5-tabela td{
  padding:10px;
  border-bottom:1px solid var(--tema-borda,#e2e8f0);
  text-align:left;
  vertical-align:top;
  color:var(--tema-texto,#0f172a);
  font-size:11px;
}

.xv5-tabela th{
  color:var(--tema-texto-secundario,#64748b);
  font-size:9px;
  text-transform:uppercase;
}

.xv5-overlay{
  position:fixed;
  inset:0;
  z-index:20000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(15,23,42,.62);
  backdrop-filter:blur(3px);
}

.xv5-modal{
  width:min(720px,100%);
  max-height:min(90vh,850px);
  overflow:auto;
  padding:18px;
  border-radius:16px;
  border:1px solid var(--tema-borda,#e2e8f0);
  background:var(--tema-card,#fff);
  box-shadow:0 25px 60px rgba(0,0,0,.25);
}

.xv5-modal-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:16px;
}

.xv5-modal-head h2{
  margin:0 0 4px;
  color:var(--tema-texto,#0f172a);
  font-size:20px;
}

.xv5-modal-head p{
  margin:0;
  color:var(--tema-texto-secundario,#64748b);
  font-size:11px;
}

.xv5-form{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.xv5-form label,
.xv5-parametros label{
  display:grid;
  gap:5px;
  color:var(--tema-texto-secundario,#64748b);
  font-size:10px;
  font-weight:700;
}

.xv5-col-2,
.xv5-parametros{
  grid-column:1/-1;
}

.xv5-parametros{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  padding:12px;
  border:1px solid var(--tema-borda,#e2e8f0);
  border-radius:11px;
  background:var(--tema-card-2,#f8fafc);
}

.xv5-inline{
  display:flex;
  align-items:center;
  gap:6px;
}

.xv5-inline input{
  flex:1;
}

.xv5-inline span{
  font-size:10px;
  color:var(--tema-texto-secundario,#64748b);
}

.xv5-check{
  display:flex!important;
  align-items:center;
  gap:7px!important;
  grid-column:1/-1;
}

.xv5-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:18px;
}

.xv5-vazio,
.xv5-loading,
.xv5-erro{
  padding:24px;
  text-align:center;
  color:var(--tema-texto-secundario,#64748b);
}

.xv5-erro{
  color:#b91c1c;
}

/* ============================================================
   MOBILE / PWA
   ============================================================ */

.xv5-mobile-dock{
  display:none;
}

@media(max-width:820px){

  body{
    padding-bottom:
      calc(
        72px +
        env(safe-area-inset-bottom)
      );
  }

  .main{
    padding-bottom:
      calc(
        88px +
        env(safe-area-inset-bottom)
      )!important;
  }

  .xv5-mobile-dock{
    position:fixed;
    z-index:15000;
    left:8px;
    right:8px;
    bottom:
      calc(
        8px +
        env(safe-area-inset-bottom)
      );
    display:flex;
    align-items:flex-end;
    justify-content:space-around;
    gap:2px;
    min-height:58px;
    padding:6px;
    border:1px solid var(--tema-borda,#e2e8f0);
    border-radius:17px;
    background:var(--tema-card,#fff);
    background:color-mix(
      in srgb,
      var(--tema-card,#fff) 92%,
      transparent
    );
    box-shadow:0 14px 35px rgba(15,23,42,.2);
    backdrop-filter:blur(16px);
  }

  .xv5-mobile-dock button{
    position:relative;
    min-width:50px;
    flex:1;
    display:grid;
    place-items:center;
    gap:1px;
    padding:5px 2px;
    border:0;
    border-radius:10px;
    background:transparent;
    color:var(--tema-texto-secundario,#64748b);
  }

  .xv5-mobile-dock button>span{
    font-size:18px;
    line-height:1;
  }

  .xv5-mobile-dock button>small{
    font-size:8px;
    font-weight:700;
  }

  .xv5-mobile-dock .xv5-mobile-search{
    transform:translateY(-8px);
    min-width:54px;
    max-width:60px;
    height:54px;
    flex:none;
    border-radius:16px;
    background:#2563eb;
    color:white;
    box-shadow:0 7px 18px rgba(37,99,235,.35);
  }

  .xv5-mobile-dock .xv5-mobile-search>span{
    font-size:20px;
  }

  .xv5-cards{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .xv5-regra{
    align-items:flex-start;
    flex-direction:column;
  }

  .xv5-regra-acoes{
    width:100%;
    justify-content:flex-start;
  }

  .xv5-form{
    grid-template-columns:1fr;
  }

  .xv5-col-2,
  .xv5-parametros{
    grid-column:auto;
  }

  .xv5-parametros{
    grid-template-columns:1fr;
  }
}

html[data-theme="dark"] .xv5-ok{
  background:rgba(34,197,94,.13);
  color:#86efac;
}

html[data-theme="dark"] .xv5-bad{
  background:rgba(239,68,68,.13);
  color:#fca5a5;
}

html[data-theme="dark"] .xv5-info{
  background:rgba(59,130,246,.13);
  color:#93c5fd;
}

html[data-theme="dark"] .xv5-off{
  background:rgba(148,163,184,.13);
  color:#cbd5e1;
}
