/* NeuroBytes Soporte — misma identidad visual que neurobytes.net */
:root {
  --bg: #071529;          /* fondo del sitio */
  --bg-deep: #06111F;     /* secciones alternas */
  --bg-foot: #030b17;     /* pie de página */
  --card: #0D2746;        /* tarjetas */
  --card-2: #102f55;
  --teal: #52FFE2;        /* "Neuro" */
  --green: #9CF34B;       /* "Bytes" */
  --wa: #25D366;
  --ink: #ffffff;
  --ink-2: #c9d3e0;
  --ink-3: #8a9bb3;
  --line: rgba(82, 255, 226, .15);
  --line-2: rgba(255, 255, 255, .08);
  --ok: #9CF34B;
  --warn: #ffb547;
  --bad: #ff5c5c;
  --radius: 20px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: 'Poppins', sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--teal); text-decoration: none; transition: .3s; }
a:hover { color: var(--green); }
h1 { font-size: 2rem; line-height: 1.15; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.muted { color: var(--ink-3); }
.small { font-size: .82rem; }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }
.accent { color: var(--green); }

/* ---------- Encabezado (igual al sitio) ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(6, 17, 31, .90); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.menu { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; gap: 16px; }
.logo { font-size: 32px; font-weight: 700; color: var(--teal); line-height: 1; display: flex; align-items: baseline; gap: 0; white-space: nowrap; }
.logo span { color: var(--green); }
.logo small { font-size: .78rem; font-weight: 500; color: var(--ink-2); margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line); letter-spacing: .02em; }
.logo:hover { color: var(--teal); }
.site-header nav { display: flex; align-items: center; flex-wrap: wrap; }
.site-header nav a { color: #fff; margin-left: 28px; font-weight: 500; font-size: .95rem; }
.site-header nav a:hover { color: var(--green); }
.site-header nav a i { margin-right: 4px; color: var(--teal); }
.nav-user { color: var(--ink-2) !important; }
.nav-toggle, .nav-burger { display: none; }

.page { flex: 1; padding-top: 36px; padding-bottom: 60px; }

/* ---------- Encabezado de página ---------- */
.hero { margin: 10px 0 30px; }
.hero h1 { font-size: 2.6rem; margin-bottom: 12px; max-width: 760px; }
.hero h1 span { color: var(--green); }
.hero p { font-size: 1.05rem; color: #ddd; max-width: 680px; }
.pill-note { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 8px 18px; border-radius: 50px; background: rgba(82,255,226,.08); border: 1px solid var(--line); color: var(--teal); font-weight: 500; font-size: .9rem; }

/* ---------- Tarjetas y formularios ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.form.narrow { max-width: 460px; }
label { display: flex; flex-direction: column; gap: 7px; font-weight: 500; font-size: .92rem; color: var(--ink-2); }
input, textarea, select { font: inherit; color: #fff; background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; width: 100%; transition: border-color .2s; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(82,255,226,.15); }
input[type=file] { padding: 10px; background: transparent; border-style: dashed; color: var(--ink-2); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; border: 0; border-radius: 50px; padding: 6px 16px; margin-right: 12px; background: var(--card-2); color: var(--teal); cursor: pointer; }
select option { background: var(--card); }
textarea { resize: vertical; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid .full { grid-column: 1 / -1; }
.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); }
.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.inline-right { display: flex; justify-content: flex-end; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.step { display: flex; align-items: center; gap: 12px; font-size: 1.15rem; margin-top: 8px; color: #fff; }
.step span { width: 32px; height: 32px; border-radius: 50%; background: var(--teal); color: var(--bg); display: grid; place-items: center; font-size: .9rem; font-weight: 700; }

/* ---------- Botones (píldora, como el sitio) ---------- */
.btn { font: inherit; font-weight: 600; border: 0; padding: 13px 30px; border-radius: 50px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: .3s; background: var(--card-2); color: #fff; border: 1px solid var(--line); }
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,.3); color: #fff; }
.btn-primary, .btn.email { background: var(--teal); color: var(--bg); border-color: var(--teal); }
.btn-primary:hover, .btn.email:hover { color: var(--bg); }
.btn-green { background: var(--green); color: var(--bg); border-color: var(--green); }
.btn-green:hover { color: var(--bg); }
.btn.whatsapp { background: var(--wa); color: #fff; border-color: var(--wa); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn-sm { padding: 8px 18px; font-size: .88rem; }
.btn-block { width: 100%; }
.buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.buttons.center { justify-content: center; }

/* ---------- Selector de tipo de problema ---------- */
.cat-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.cat-group { border: 0; display: flex; flex-direction: column; gap: 10px; }
.cat-group legend { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--green); font-weight: 600; margin-bottom: 8px; }
.cat-group legend i { color: var(--teal); margin-right: 6px; }
.cat { flex-direction: row; align-items: center; gap: 12px; padding: 13px 16px; border: 1px solid var(--line-2); background: var(--bg); border-radius: 14px; cursor: pointer; font-weight: 400; color: #fff; transition: .25s; }
.cat:hover { border-color: var(--teal); transform: translateY(-2px); }
.cat input { width: 18px; height: 18px; accent-color: var(--teal); flex: none; }
.cat:has(input:checked) { border-color: var(--teal); background: rgba(82,255,226,.08); box-shadow: 0 0 0 1px var(--teal) inset; }
.cat-body { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.tag-urgente { flex: none; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--bad); background: rgba(255,92,92,.12); padding: 3px 9px; border-radius: 50px; }

/* ---------- Alertas ---------- */
.alert { padding: 14px 20px; border-radius: 14px; margin-bottom: 20px; border: 1px solid; background: var(--card); }
.alert ul { margin: 6px 0 0 18px; }
.alert-ok { border-color: rgba(156,243,75,.45); }
.alert-ok strong { color: var(--green); }
.alert-warn { border-color: rgba(255,181,71,.5); }
.alert-error { border-color: rgba(255,92,92,.55); }
.alert.big { font-size: 1.02rem; }

/* ---------- Etiquetas ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; padding: 4px 11px; border-radius: 50px; background: rgba(255,255,255,.05); border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.prio { color: var(--c); border-color: color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); }
.badge.prio i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.estado-nuevo { color: #c7a4ff; border-color: rgba(199,164,255,.35); }
.estado-en_proceso { color: var(--teal); border-color: var(--line); }
.estado-esperando_cliente { color: var(--warn); border-color: rgba(255,181,71,.35); }
.estado-resuelto, .estado-cerrado { color: var(--green); border-color: rgba(156,243,75,.35); }
.badge.agente i { color: var(--teal); }
.badge.agente.libre { color: var(--warn); border-style: dashed; }
.badge.agente.libre i { color: var(--warn); }

/* ---------- SLA ---------- */
.sla { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.sla-track { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.sla-fill { height: 100%; border-radius: 99px; background: var(--green); }
.sla-txt { font-size: .82rem; font-weight: 600; }
.sla-ok .sla-txt { color: var(--green); }
.sla-riesgo .sla-fill { background: var(--warn); } .sla-riesgo .sla-txt { color: var(--warn); }
.sla-vencido .sla-fill { background: var(--bad); width: 100% !important; } .sla-vencido .sla-txt { color: var(--bad); }
.sla-pausa .sla-txt { color: var(--ink-3); }

/* ---------- Panel: KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.kpi-n { font-size: 1.8rem; font-weight: 700; line-height: 1.2; color: var(--teal); }
.kpi-l { color: var(--ink-3); font-size: .8rem; }
.kpi-bad { border-color: rgba(255,92,92,.5); }
.kpi-bad .kpi-n { color: var(--bad); }
.kpi-split { display: flex; gap: 12px; margin-top: 6px; font-size: .8rem; color: var(--ink-2); }
.kpi-split i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.kpi-sm { font-weight: 700; font-size: 1.1rem; color: var(--teal); }

/* ---------- Panel: siguiente tiquete ---------- */
.next { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; margin-bottom: 24px; color: #fff; border-left: 4px solid var(--green); padding: 20px 26px; }
.next:hover { color: #fff; transform: translateY(-3px); }
.next-l { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--green); display: flex; align-items: center; gap: 8px; }
.next-main { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Panel: cola ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); padding: 5px; border-radius: 50px; flex-wrap: wrap; }
.tab { padding: 7px 16px; border-radius: 50px; color: var(--ink-2); font-weight: 500; font-size: .9rem; }
.tab.on { background: var(--teal); color: var(--bg); }
.tab:hover { color: #fff; } .tab.on:hover { color: var(--bg); }
.tab .n { font-size: .75rem; opacity: .75; margin-left: 4px; }
.search { display: flex; gap: 8px; align-items: center; }
.search input, .search select { border-radius: 50px; padding: 9px 16px; }
.search input { min-width: 250px; }
.queue { display: flex; flex-direction: column; gap: 10px; }
.row { display: grid; grid-template-columns: 5px 1fr auto; gap: 18px; align-items: center; padding: 16px 20px 16px 0; color: #fff; overflow: hidden; border-radius: 16px; transition: .25s; }
.row:hover { color: #fff; border-color: var(--teal); transform: translateX(3px); }
.row-prio { align-self: stretch; background: var(--c); margin: -16px 0; }
.row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-title { font-weight: 600; margin: 4px 0 2px; font-size: 1.02rem; }
.row-sla { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.row.sla-vencido { border-color: rgba(255,92,92,.45); }
.empty { text-align: center; color: var(--ink-3); padding: 50px; }
.empty i { font-size: 2.4rem; color: var(--green); display: block; margin-bottom: 10px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 600; color: var(--green); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .muted { font-size: .82rem; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 34px 0 14px; }
.section-title h2 { color: var(--green); }

/* ---------- Detalle ---------- */
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.ticket-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.ticket-head h1 { font-size: 1.6rem; margin: 4px 0 12px; }
.ticket-sla { text-align: right; }
.side { display: flex; flex-direction: column; gap: 16px; }
.side .card { padding: 22px; }
.side .form { margin: 0; gap: 12px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: .86rem; }
.dl dt { color: var(--ink-3); }
.dl dd { text-align: right; white-space: nowrap; }
.thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.msg { background: var(--card); border: 1px solid var(--line-2); border-radius: 18px; padding: 16px 20px; max-width: 88%; }
.msg header { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.msg header strong { color: #fff; }
.msg-body { overflow-wrap: anywhere; color: #e6ecf3; }
.msg-tecnico { align-self: flex-end; background: #0f3150; border-color: var(--line); }
.msg-tecnico header strong { color: var(--teal); }
.msg-interno { background: rgba(255,181,71,.07); border: 1px dashed rgba(255,181,71,.45); }
.msg-sys { align-self: center; font-size: .78rem; color: var(--ink-3); padding: 2px 12px; }
.files { list-style: none; margin-top: 10px; font-size: .88rem; }
.files i { color: var(--green); }
.back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--ink-2); }

/* ---------- Pie de página (igual al sitio) ---------- */
.site-footer { background: var(--bg-foot); padding: 60px 20px; text-align: center; }
.site-footer h2 { color: var(--teal); font-size: 2rem; margin-bottom: 10px; }
.site-footer p { color: var(--ink-2); margin-bottom: 26px; }
.site-footer .copy { margin: 34px 0 0; font-size: .82rem; color: var(--ink-3); }
.site-footer.slim { padding: 24px 20px; }
.site-footer.slim .copy { margin: 0; }
.wa-float { position: fixed; right: 26px; bottom: 26px; width: 58px; height: 58px; border-radius: 50%; background: var(--wa); color: #fff; display: grid; place-items: center; font-size: 30px; box-shadow: 0 10px 25px rgba(0,0,0,.35); z-index: 60; }
.wa-float:hover { color: #fff; transform: scale(1.08); }

/* ---------- Responsivo ---------- */
@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticket-layout { grid-template-columns: 1fr; }
  .next { grid-template-columns: 1fr; }
  .nav-burger { display: block; font-size: 1.4rem; color: #fff; cursor: pointer; }
  .site-header nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: rgba(6,17,31,.97); padding: 10px 5% 18px; border-bottom: 1px solid var(--line); }
  .site-header nav a { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
  .nav-toggle:checked ~ nav { display: flex; }
  .menu { position: relative; }
}
@media (max-width: 640px) {
  .logo { font-size: 26px; }
  .logo small { display: none; }
  .hero h1 { font-size: 1.9rem; }
  .card { padding: 20px; }
  .grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 5px 1fr; }
  .row-sla { grid-column: 2; text-align: left; align-items: flex-start; }
  .search, .search input { width: 100%; min-width: 0; }
  .search { flex-wrap: wrap; }
  .msg { max-width: 100%; }
  .cat-groups { grid-template-columns: 1fr; }
  .site-footer h2 { font-size: 1.6rem; }
  .actions .btn, .buttons .btn { width: 100%; }
}

/* ---------- Tipo de cliente ---------- */
.tipo-cliente { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tipo-card { flex-direction: row; align-items: flex-start; gap: 14px; padding: 20px; border: 1px solid var(--line-2); background: var(--bg); border-radius: 16px; cursor: pointer; color: #fff; transition: .25s; }
.tipo-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.tipo-card input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--teal); flex: none; }
.tipo-card:has(input:checked) { border-color: var(--teal); background: rgba(82,255,226,.08); box-shadow: 0 0 0 1px var(--teal) inset; }
.tipo-body { display: flex; flex-direction: column; gap: 4px; }
.tipo-head { font-weight: 600; font-size: 1.05rem; }
.tipo-head i { color: var(--green); margin-right: 6px; }
.tipo-extra { display: none; flex-direction: column; gap: 12px; padding: 18px 20px; border-radius: 16px; background: rgba(0,0,0,.18); border: 1px dashed var(--line); }
form:has(input[name=tipo_cliente][value=contrato]:checked) .solo-contrato { display: flex; }
form:has(input[name=tipo_cliente][value=ocasional]:checked) .solo-ocasional { display: flex; }
form:has(input[name=tipo_cliente][value=contrato]:checked) .solo-ocasional-inline { display: none; }
.tarifa { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.tarifa-precio { font-size: 2.2rem; font-weight: 700; color: var(--green); line-height: 1; }
.tarifa-precio small { font-size: .9rem; color: var(--ink-2); font-weight: 500; margin-left: 4px; }
.tarifa ul { list-style: none; color: var(--ink-2); font-size: .9rem; }
.tarifa li::before { content: "✓ "; color: var(--teal); font-weight: 700; }
.badge.tipo.contrato { color: var(--green); border-color: rgba(156,243,75,.4); background: rgba(156,243,75,.08); }
.badge.tipo.ocasional { color: var(--ink-2); }
.cobro { font-size: .88rem; }
.cobro .total { font-size: 1.25rem; font-weight: 700; color: var(--green); }
@media (max-width: 640px) { .tipo-cliente { grid-template-columns: 1fr; } }
/* Sin soporte de :has() (navegadores antiguos): mostrar ambos bloques */
@supports not selector(:has(*)) { .tipo-extra { display: flex; } }
code.codigo { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92rem; font-weight: 700; color: var(--teal); background: rgba(82,255,226,.08); padding: 3px 8px; border-radius: 8px; letter-spacing: .04em; }

.btn-danger { background: transparent; color: var(--bad); border-color: rgba(255,92,92,.5); }
.btn-danger:hover { background: rgba(255,92,92,.12); color: var(--bad); }
.zona-peligro { border-color: rgba(255,92,92,.35); }
.zona-peligro h3 { color: var(--bad); }