*{ box-sizing: border-box; }

:root{
  --bg: #0b0f18;
  --card: rgba(255,255,255,0.92);
  --text: #0f1420;
  --muted: rgba(15,20,32,0.65);
  --line: rgba(0,0,0,0.12);
  --line2: rgba(0,0,0,0.08);
  --purple: #6e37c8;
  --purple2:#4e20a6;
  --danger: #a83333;
  --dangerBg: rgba(255,230,230,0.65);
}

body{
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.pg{
  min-height: 100vh;
  padding: 22px;
  background-image: url("https://estudarpoker.com.br/imgep23/testes/t1/fundo.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* ================= TOPO ================= */
.topo{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.topo-left{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 320px;
}

.logo{
  width: 200px;
  height: auto;
  display: block;
  padding: 15px;
}

.topo-txt h1{
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.topo-txt p{
  margin: 4px 0 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* Steps */
.topo-steps{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.05);
  border: 1px solid var(--line2);
  flex: 1;
  justify-content: center;
  max-width: 980px;
}

.step{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 12px;
  cursor: pointer;
}
.step:hover{ background: rgba(0,0,0,0.04); }

.step .num{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: rgba(0,0,0,0.07);
  border: 1px solid var(--line2);
}

.step.active .num{
  background: rgba(94,182,94,0.30);
  border-color: rgba(94,182,94,0.45);
}

.step .meta strong{
  display: block;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 900;
}
.step .meta small{
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.sep{
  width: 28px;
  height: 2px;
  background: rgba(0,0,0,0.10);
  border-radius: 10px;
}

.topo-right{
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  min-width: 320px;
}

.chip-status{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(122,67,67,0.35);
  background: var(--dangerBg);
  white-space: nowrap;
}

.chip-status .dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
}

.btn-primary{
  border: 0;
  cursor: pointer;
  background: linear-gradient(180deg, var(--purple), var(--purple2));
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 10px 20px rgba(78,32,166,0.25);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:active{ transform: translateY(1px); }

.btn-ghost{
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.85);
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
}

.btn-ghost.danger{
  border-color: rgba(168,51,51,0.40);
  background: rgba(255,235,235,0.70);
  color: rgba(120,25,25,0.95);
}

/* ================= CARD ================= */
.card{
  margin-top: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--line);
  overflow: hidden;
}

/* ================= SEÇÕES ================= */
.sec{
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

/* ===== separador forte entre blocos ===== */
.sec-divider{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: rgba(0,0,0,0.03);
  border-top: 1px solid rgba(0,0,0,0.10);
  border-bottom: 1px solid rgba(0,0,0,0.10);
}

.sec-divider .line{
  flex: 1;
  height: 2px;
  background: rgba(110,55,200,0.22);
  border-radius: 10px;
}

.sec-divider .pill{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(110,55,200,0.25);
  background: rgba(110,55,200,0.08);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.6px;
  color: rgba(0,0,0,0.70);
}

/* ================= COLLAPSIBLE ================= */
.collapsible{
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  overflow: hidden;
}

.collapsible-head{
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 14px;
  cursor: pointer;
  background: rgba(0,0,0,0.04);
  border-bottom: 1px solid rgba(0,0,0,0.10);
}

.collapsible-head::-webkit-details-marker{ display:none; }

.head-left{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
}

.title-wrap{
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.title-wrap h2{
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  color: rgba(0,0,0,0.78);
}

.title-wrap p{
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.collapse-ui{
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.75);
  user-select: none;
}

.collapse-ui .hint{
  font-size: 12px;
  font-weight: 900;
  color: rgba(0,0,0,0.60);
}

.collapse-ui .chev{
  font-size: 16px;
  transition: 180ms ease;
  color: rgba(0,0,0,0.55);
}

.collapsible[open] .collapse-ui .chev{
  transform: rotate(180deg);
}

.collapsible-body{
  padding: 14px;
}

.form-actions{
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

/* ================= CAMPOS ================= */
.field label{
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: rgba(0,0,0,0.75);
  margin-bottom: 6px;
  white-space: nowrap;
}

.field input,
.field select{
  width: 100%;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  padding: 0 10px;
  background: #fff;
  outline: none;
  font-size: 14px;
}

.field input:focus,
.field select:focus{
  border-color: rgba(110,55,200,0.45);
  box-shadow: 0 0 0 4px rgba(110,55,200,0.12);
}

/* ================= BUSCA/LISTA ================= */
.select-row{
  display: grid;
  grid-template-columns: 1.4fr 220px 220px auto;
  gap: 10px;
  align-items: end;
}

.select-actions{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.list-wrap{
  margin-top: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.92);
}

.list-head,
.list-row{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr 0.6fr 1fr 0.6fr 0.9fr 0.7fr;
  gap: 10px;
  align-items: center;
}

.list-head{
  padding: 10px 12px;
  background: rgba(0,0,0,0.05);
  border-bottom: 1px solid rgba(0,0,0,0.12);
}

.lh{
  font-size: 12px;
  font-weight: 900;
  color: rgba(0,0,0,0.70);
  white-space: nowrap;
}

.list-row{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.list-row:last-child{ border-bottom: 0; }
.list-row:hover{ background: rgba(110,55,200,0.04); }

.ld{
  font-size: 13px;
  color: rgba(0,0,0,0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ld.strong{ font-weight: 900; }
.ld.action{ display: flex; justify-content: center; }

.pick{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.85);
  cursor: pointer;
  user-select: none;
}
.pick input{ transform: scale(1.05); }
.pick span{
  font-weight: 900;
  font-size: 12px;
  color: rgba(0,0,0,0.65);
}

.btn-mini{
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.92);
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  color: rgba(0,0,0,0.72);
}
.btn-mini:hover{
  background: rgba(110,55,200,0.06);
  border-color: rgba(110,55,200,0.22);
}

/* ================= UMA LINHA (novo torneio) ================= */
.one-line{
  display: grid;
  grid-template-columns:
    1.2fr  /* titulo */
    1fr    /* slug */
    0.8fr  /* grupo */
    1fr    /* tipo */
    1fr    /* estrutura */
    0.7fr  /* assentos */
    1fr    /* pgto */
    1fr    /* sala */
    0.6fr  /* ante */
    1.2fr; /* nota */
  gap: 10px;
  align-items: end;
}

/* ================= SUB-COLLAPSIBLE (salas) ================= */
.sub-collapsible{
  margin-top: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  overflow: hidden;
}

.sub-collapsible summary{ list-style: none; cursor: pointer; }
.sub-collapsible summary::-webkit-details-marker{ display:none; }

.sub-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.04);
  border-bottom: 1px solid rgba(0,0,0,0.10);
}

.sub-title{
  font-weight: 900;
  font-size: 13px;
  color: rgba(0,0,0,0.72);
}

.sub-ui{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.75);
}

.sub-hint{
  font-size: 12px;
  font-weight: 900;
  color: rgba(0,0,0,0.60);
}

.sub-chev{
  font-size: 16px;
  transition: 180ms ease;
  color: rgba(0,0,0,0.55);
}
.sub-collapsible[open] .sub-chev{ transform: rotate(180deg); }

.sub-body{ padding: 14px; }

/* ================= TAGS (SALAS GRID) ================= */
.tag-box{
  border: 2px solid rgba(0,0,0,0.25);
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  padding: 16px 16px 14px;
}

.tag-title{
  text-align: center;
  font-weight: 900;
  font-size: 16px;
  margin: 0 0 12px 0;
  color: rgba(0,0,0,0.78);
}

.tag-grid{
  display: grid;
  gap: 14px;
  align-items: start;
  justify-items: center;
}

.tag-grid-salas{
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.tag-item{
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tag-item input{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tag-ui{
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.85);
  filter: grayscale(1);
  opacity: 0.40;
  transform: scale(1);
  transition: 150ms ease;
}

.tag-ui img{
  height: 44px;
  width: auto;
  display: block;
}

.tag-name{
  font-size: 12px;
  font-weight: 900;
  color: rgba(0,0,0,0.70);
  text-align: center;
  line-height: 1.15;
}

.tag-link{
  font-size: 11px;
  font-weight: 700;
  color: rgba(0,0,0,0.45);
  text-align: center;
}

.tag-item input:checked + .tag-ui{
  filter: grayscale(0);
  opacity: 1;
  transform: scale(1.02);
  border-color: rgba(110,55,200,0.28);
  box-shadow: 0 10px 22px rgba(78,32,166,0.12);
}

/* ================= FOOTER ACTIONS ================= */
.footer-actions{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: rgba(0,0,0,0.03);
}

.center-actions,
.right-actions{
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ================= RESPONSIVO ================= */
@media (max-width: 1200px){
  .topo{ flex-direction: column; align-items: stretch; }
  .topo-left{ justify-content: center; }
  .topo-txt{ text-align: center; }
  .topo-right{ justify-content: center; min-width: auto; flex-wrap: wrap; }
  .topo-steps{ max-width: 100%; }
  .logo{ width: 180px; }

  .select-row{ grid-template-columns: 1fr 1fr; }
  .select-actions{
    grid-column: 1 / -1;
    justify-content: center;
  }

  .one-line{ grid-template-columns: 1fr 1fr; }

  .tag-grid-salas{
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 640px){
  .one-line{ grid-template-columns: 1fr; }

  .list-head, .list-row{
    grid-template-columns: 1fr 0.9fr 0.9fr;
  }

  .list-head .lh:nth-child(4),
  .list-head .lh:nth-child(5),
  .list-head .lh:nth-child(6),
  .list-head .lh:nth-child(7),
  .list-head .lh:nth-child(8),
  .list-row .ld:nth-child(4),
  .list-row .ld:nth-child(5),
  .list-row .ld:nth-child(6),
  .list-row .ld:nth-child(7),
  .list-row .ld:nth-child(8){
    display: none;
  }

  .head-left{
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .tag-grid-salas{ grid-template-columns: repeat(2, minmax(120px, 1fr)); }

  .form-actions{ justify-content: stretch; }
  .form-actions .btn-primary{ width: 100%; }
}