:root{
  --bg:#0b1020;
  --card:#101a33;
  --text:#e9ecff;
  --muted:#aab3d6;
  --line:rgba(255,255,255,.10);
  --brand:#7c5cff;
  --brand2:#2dd4bf;

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  --r:14px;

  --s1:6px;
  --s2:10px;
  --s3:14px;
  --s4:18px;
  --s5:24px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
}

.container{
  max-width:980px;
  margin:0 auto;
  padding:var(--s4);
}

.topbar{
  border-bottom:1px solid var(--line);
  background:rgba(0,0,0,.18);
  backdrop-filter: blur(8px);
}
.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--s3);
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  letter-spacing:.2px;
}
.brand i{color:var(--brand)}

.topnav{
  display:flex;
  align-items:center;
  gap:12px;
}

.h1{
  margin:0 0 var(--s3);
  font-size:24px;
}
.muted{color:var(--muted)}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r);
  padding:var(--s5);
}

.btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:var(--brand);
  color:white;
  cursor:pointer;
  font-weight:700;
  text-decoration:none;
}
.btn--ghost{
  background:transparent;
  color:var(--text);
}

.flash{
  margin:var(--s4) 0;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--line);
}
.flash--ok{background:rgba(124,92,255,.12)}
.flash--warn{background:rgba(255,180,0,.12)}

.form{margin-top:var(--s4)}
.label{display:block;margin-bottom:6px;color:var(--muted);font-size:14px}
.input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.15);
  background:transparent;
  color:var(--text);
  outline:none;
}
.input:focus{border-color:rgba(124,92,255,.7)}
.actions{margin-top:12px}

.hint{
  margin-top:var(--s4);
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:12px 14px;
  border-radius:12px;
  border:1px dashed rgba(255,255,255,.15);
  color:var(--muted);
}
.hint i{margin-top:2px;color:var(--brand2)}

.grid{
  margin-top:var(--s4);
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:var(--s3);
}
.tile{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  text-decoration:none;
  color:var(--text);
}
.tile i{color:var(--brand);font-size:18px;margin-top:2px}
.tile span{display:block;color:var(--muted);font-size:13px;margin-top:4px}

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


/* =========================
   CODEBOX COMPONENTS (cb-*)
========================= */

.cb-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r);
  padding:var(--s5);
  margin-bottom:var(--s4);
}

.cb-h1{
  margin:0 0 var(--s3);
  font-size:22px;
  display:flex;
  align-items:center;
  gap:10px;
}

.cb-muted{
  color:var(--muted);
}

.cb-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:var(--s4) 0;
}

/* =========================
   BUTTONS
========================= */

.cb-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:transparent;
  color:var(--text);
  text-decoration:none;
  font-weight:600;
  cursor:pointer;
  transition:.2s ease;
}

.cb-btn:hover{
  background:rgba(255,255,255,.06);
}

.cb-btn-primary{
  background:var(--brand);
  color:white;
  border-color:var(--brand);
}

.cb-btn-primary:hover{
  background:#6a4fff;
}

/* =========================
   INPUTS
========================= */

.cb-input{
  padding:8px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.15);
  background:transparent;
  color:var(--text);
  outline:none;
  min-width:220px;
}

.cb-input:focus{
  border-color:var(--brand);
}

/* =========================
   TABLE
========================= */

.cb-table{
  width:100%;
  border-collapse:collapse;
  margin-top:var(--s3);
}

.cb-table th,
.cb-table td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  text-align:left;
  font-size:14px;
}

.cb-table th{
  color:var(--muted);
  font-weight:600;
}

.cb-table tr:hover{
  background:rgba(255,255,255,.04);
}

/* =========================
   PRE (correo raw)
========================= */

.cb-pre{
  background:rgba(0,0,0,.25);
  padding:var(--s4);
  border-radius:12px;
  border:1px solid var(--line);
  white-space:pre-wrap;
  word-break:break-word;
  font-size:13px;
  margin-top:var(--s4);
}


/* =========================
   AGENT SEARCH - LIST UI
========================= */

.cb-results-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:var(--s3);
  margin-bottom:var(--s3);
}

.cb-h2{
  margin:0;
  font-size:16px;
  font-weight:800;
}

.cb-list{
  display:flex;
  flex-direction:column;
  gap:var(--s2);
  margin-top:var(--s3);
}

.cb-item{
  display:flex;
  gap:var(--s3);
  padding:var(--s3);
  border-radius:calc(var(--r) + 6px);
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  color:var(--text);
  text-decoration:none;
  transition:.18s ease;
}

.cb-item:hover{
  border-color:rgba(124,92,255,.45);
  background:rgba(255,255,255,.04);
  transform:translateY(-1px);
}

.cb-item__main{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.cb-item__top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:var(--s3);
}

.cb-title{
  min-width:0;
}

.cb-title__text{
  display:block;
  font-weight:800;
  font-size:14px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}

.cb-date{
  flex-shrink:0;
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
}

.cb-item__mid{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
}

.cb-meta{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size:13px;
  min-width:0;
}

.cb-dot{
  color:var(--muted);
  opacity:.7;
}

.cb-truncate{
  display:inline-block;
  max-width:260px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  vertical-align:bottom;
}

.cb-snippet{
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.cb-item__right{
  display:flex;
  align-items:center;
  flex-shrink:0;
}

.cb-chev{
  width:34px;
  height:34px;
  border-radius:999px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  color:var(--muted);
  background:rgba(0,0,0,.12);
  transition:.18s ease;
}

.cb-item:hover .cb-chev{
  border-color:rgba(45,212,191,.35);
  color:var(--text);
}

/* Badges */
.cb-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.03);
  font-size:12px;
  color:var(--text);
}

.cb-badge--kind{
  border-color:rgba(124,92,255,.35);
  background:rgba(124,92,255,.10);
}

.cb-badge--otp{
  border-color:rgba(45,212,191,.35);
  background:rgba(45,212,191,.10);
}

.cb-loadmore{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:12px;
  margin-top:var(--s4);
}
.cb-loadmore__spinner{
  display:none;
  align-items:center;
  gap:10px;
  color:var(--muted);
  font-size:13px;
}
.cb-loadmore__spinner.is-on{
  display:inline-flex;
}



/* =========================
   SEARCH PANEL (cb-search)
   Solo afecta el bloque búsqueda
========================= */

.cb-search{
  position:relative;
  overflow:hidden;
}

.cb-search::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(900px 220px at 15% 0%, rgba(124,92,255,.22), transparent 60%),
    radial-gradient(700px 220px at 85% 0%, rgba(45,212,191,.14), transparent 55%);
  pointer-events:none;
  opacity:.85;
}

.cb-search > *{
  position:relative;
}

.cb-search__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:var(--s4);
  padding:0 0 var(--s4);
  border-bottom:1px solid rgba(255,255,255,.08);
  margin-bottom:var(--s4);
}

.cb-search__title{
  display:flex;
  gap:12px;
  align-items:flex-start;
  min-width:0;
}

.cb-search__icon{
  width:40px;
  height:40px;
  border-radius:14px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.18);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
}

.cb-search__icon i{
  color:var(--brand2);
}

.cb-search__h1{
  margin:0;
}

.cb-search__desc{
  margin:6px 0 0;
  max-width:66ch;
}

.cb-search__meta{
  display:flex;
  align-items:center;
  gap:10px;
  padding-top:2px;
}

.cb-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:var(--text);
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}

.cb-chip i{
  color:var(--brand);
}

/* grid pro */
.cb-search__grid{
  display:grid;
  grid-template-columns: 1.1fr 1.25fr 1.25fr;
  gap:var(--s3);
}

.cb-search__field{
  padding:12px;
  border-radius:calc(var(--r) + 6px);
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  transition:.18s ease;
}

.cb-search__field:hover{
  border-color:rgba(255,255,255,.16);
  background:rgba(255,255,255,.045);
}

.cb-search__field:focus-within{
  border-color:rgba(124,92,255,.55);
  box-shadow: 0 0 0 4px rgba(124,92,255,.10);
}

.cb-help{
  margin-top:8px;
  color:var(--muted);
  font-size:12px;
  line-height:1.2;
}

/* control with icons */
.cb-control{
  position:relative;
}

.cb-control .cb-input{
  width:100%;
  min-width:0;
  padding-right:40px;
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
  background:rgba(0,0,0,.10);
}

.cb-control .cb-input:hover{
  border-color:rgba(255,255,255,.22);
}

.cb-control .cb-input:focus{
  border-color:rgba(124,92,255,.75);
  box-shadow: 0 0 0 4px rgba(124,92,255,.12);
}

.cb-control__icon{
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  color:rgba(170,179,214,.85);
  pointer-events:none;
  font-size:14px;
}

/* select polish */
select.cb-input{
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  cursor:pointer;
}

select.cb-input option{
  background:var(--card);
  color:var(--text);
}

/* Date range wrapper */
.cb-search__field--range{
  grid-column: 1 / -1;
  padding:0;
  border:none;
  background:transparent;
}

.cb-range{
  padding:14px;
  border-radius:calc(var(--r) + 8px);
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.16);
}

.cb-range__head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.cb-range__title{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-weight:900;
  font-size:13px;
}

.cb-range__title i{
  color:var(--brand2);
}

.cb-range__hint{
  color:var(--muted);
  font-size:12px;
  white-space:nowrap;
}

.cb-range__grid{
  display:grid;
  grid-template-columns: 1fr 10px 1fr;
  gap:12px;
  align-items:end;
}

.cb-range__sep{
  height:42px;
  border-radius:999px;
  background:linear-gradient(
    to bottom,
    transparent,
    rgba(255,255,255,.12),
    transparent
  );
  opacity:.9;
}

/* Actions */
.cb-search__actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  padding-top:var(--s3);
  margin:var(--s4) 0 0;
}

.cb-btn{
  transform:translateY(0);
}

.cb-btn:hover{
  transform:translateY(-1px);
}

.cb-btn:active{
  transform:translateY(0);
}

.cb-btn--primary{
  background: linear-gradient(135deg, rgba(124,92,255,1), rgba(124,92,255,.82));
  border-color: rgba(124,92,255,.65);
  color:#fff;
  box-shadow: 0 12px 26px rgba(124,92,255,.18);
}

.cb-btn--primary:hover{
  box-shadow: 0 16px 34px rgba(124,92,255,.24);
  border-color: rgba(124,92,255,.78);
}

/* Responsive */
@media (max-width: 980px){
  .cb-search__grid{
    grid-template-columns: 1fr 1fr;
  }
  .cb-range__hint{
    display:none;
  }
}

@media (max-width: 680px){
  .cb-search__head{
    flex-direction:column;
    gap:12px;
  }

  .cb-search__grid{
    grid-template-columns: 1fr;
  }

  .cb-range__grid{
    grid-template-columns:1fr;
  }

  .cb-range__sep{
    display:none;
  }

  .cb-search__actions{
    justify-content:stretch;
  }

  .cb-search__actions .cb-btn,
  .cb-search__actions a.cb-btn{
    flex:1;
    justify-content:center;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .cb-search__field,
  .cb-btn,
  .cb-control .cb-input{
    transition:none;
  }
}



