/* ============================================================
   STREAMREPORTS — DESIGN SYSTEM
   Tema: "Señal" — panel de garantías de streaming, oscuro premium
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Color */
    --bg:            #090B12;
    --bg-glow-a:     #1B1240;
    --bg-glow-b:     #071A22;
    --surface:       #12151F;
    --surface-2:     #171B28;
    --surface-3:     #1D2233;
    --border:        rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.16);

    --text:          #EDEFF5;
    --text-dim:      #9AA1B4;
    --text-faint:    #676E85;

    --accent:        #7C5CFF;
    --accent-2:      #22D3EE;
    --accent-grad:   linear-gradient(135deg, #7C5CFF 0%, #4C7DFF 55%, #22D3EE 100%);

    --amber:         #FFB020;
    --green:         #34D399;
    --red:           #FB5B6B;

    --radius-sm: 8px;
    --radius:    14px;
    --radius-lg: 20px;

    --shadow-card: 0 20px 60px -20px rgba(0,0,0,0.6);
    --shadow-glow: 0 0 0 1px rgba(124,92,255,0.15), 0 0 40px rgba(124,92,255,0.08);

    --font-display: 'Sora', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Fondo ambiental: glow radial + grid de puntos (estática de señal) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse 900px 600px at 15% -5%, rgba(124,92,255,0.18), transparent 60%),
        radial-gradient(ellipse 800px 500px at 100% 10%, rgba(34,211,238,0.12), transparent 60%),
        var(--bg);
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.35;
    background-image: radial-gradient(rgba(255,255,255,0.055) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black, transparent 75%);
}

h1, h2, h3, h4, .display {
    font-family: var(--font-display);
    color: var(--text);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: rgba(124,92,255,0.35); }

/* Enfoque visible de teclado */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
}

/* ============ LAYOUT ============ */
.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* ============ TOPBAR ============ */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    max-width: 1180px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 19px;
    color: var(--text);
}

.brand .dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 0 0 rgba(34,211,238,0.6);
    animation: pulse 2.2s infinite;
    flex-shrink: 0;
}

.brand .bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}
.brand .bars span {
    width: 3px;
    border-radius: 2px;
    background: var(--accent-grad);
    animation: bar-bounce 1.4s ease-in-out infinite;
}
.brand .bars span:nth-child(1) { height: 40%; animation-delay: 0s; }
.brand .bars span:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.brand .bars span:nth-child(3) { height: 65%; animation-delay: 0.4s; }
.brand .bars span:nth-child(4) { height: 85%; animation-delay: 0.1s; }

@keyframes bar-bounce {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34,211,238,0.55); }
    70% { box-shadow: 0 0 0 9px rgba(34,211,238,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,211,238,0); }
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    color: var(--text-dim);
}
.user-chip strong { color: var(--text); font-weight: 600; }

/* ============ CARDS ============ */
.card {
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 28px;
    position: relative;
}

.card--clip {
    clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%);
}

.card--glow { box-shadow: var(--shadow-card), var(--shadow-glow); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
    flex-wrap: wrap;
}

.eyebrow {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 11px;
    color: var(--accent-2);
    margin-bottom: 8px;
    display: block;
}

/* ============ AUTH FORM WRAP ============ */
.auth-wrap {
    width: 100%;
    max-width: 460px;
}
.auth-wrap.wide { max-width: 620px; }

.auth-head {
    text-align: center;
    margin-bottom: 26px;
}
.auth-head .brand { justify-content: center; margin-bottom: 14px; }
.auth-head p { color: var(--text-dim); margin: 0; font-size: 14px; }

/* ============ FORMS ============ */
label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 7px;
}

.field { margin-bottom: 18px; }

input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel],
input[type=number], select, textarea {
    width: 100%;
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14.5px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}

input::placeholder, textarea::placeholder { color: var(--text-faint); }

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124,92,255,0.18);
    outline: none;
}

textarea { resize: vertical; min-height: 90px; font-family: var(--font-body); }

.phone-row {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 10px;
}

.help-text {
    font-size: 12.5px;
    color: var(--text-faint);
    margin-top: 6px;
}

.error-text {
    font-size: 12.5px;
    color: var(--red);
    margin-top: 6px;
}

/* File input custom */
.file-drop {
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 22px;
    text-align: center;
    background: var(--surface-3);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    position: relative;
}
.file-drop:hover { border-color: var(--accent); background: rgba(124,92,255,0.06); }
.file-drop input[type=file] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.file-drop .icon { font-size: 26px; margin-bottom: 6px; }
.file-drop .fname { color: var(--accent-2); font-weight: 600; margin-top: 6px; font-size: 13px; word-break: break-all; }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
    text-decoration: none !important;
    line-height: 1.2;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--accent-grad);
    color: #fff;
    box-shadow: 0 10px 30px -8px rgba(124,92,255,0.55);
}
.btn-primary:hover { box-shadow: 0 14px 34px -8px rgba(124,92,255,0.7); }

.btn-ghost {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-2); }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.btn-success { background: linear-gradient(135deg,#22c56e,#0fae7d); color:#08150f; box-shadow: 0 10px 26px -8px rgba(52,211,153,0.5);}
.btn-danger  { background: linear-gradient(135deg,#fb5b6b,#e02b4d); color:#fff; box-shadow: 0 10px 26px -8px rgba(251,91,107,0.5);}
.btn-warn    { background: linear-gradient(135deg,#ffc247,#ff9c1f); color:#241300; box-shadow: 0 10px 26px -8px rgba(255,176,32,0.4);}

/* ============ BADGES / ESTADOS ============ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.badge::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.badge-waiting { background: rgba(255,176,32,0.12); color: var(--amber); }
.badge-review  { background: rgba(34,211,238,0.12); color: var(--accent-2); }
.badge-review::before { animation: pulse-dot 1.6s infinite; }
.badge-success { background: rgba(52,211,153,0.12); color: var(--green); }
.badge-failed  { background: rgba(251,91,107,0.12); color: var(--red); }

@keyframes pulse-dot {
    0%,100% { opacity: 1; } 50% { opacity: 0.35; }
}

/* ============ TABLA HISTORIAL ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
thead th {
    text-align: left;
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
tbody td {
    padding: 14px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13.8px;
    color: var(--text);
    vertical-align: middle;
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child td { border-bottom: none; }

.mono { font-family: var(--font-mono); color: var(--text-dim); }

/* ============ STATS ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 26px;
}
.stat-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.stat-card .num {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
}
.stat-card .lbl {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}
.stat-card.accent-amber .num { color: var(--amber); }
.stat-card.accent-cyan .num { color: var(--accent-2); }
.stat-card.accent-green .num { color: var(--green); }
.stat-card.accent-red .num { color: var(--red); }

@media (max-width: 780px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ TABS (admin filtro estado) ============ */
.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.tab {
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--surface-2);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active {
    color: #fff;
    background: var(--accent-grad);
    border-color: transparent;
}

/* ============ FLASH MESSAGES ============ */
.flash {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 18px;
    border: 1px solid;
}
.flash-success { background: rgba(52,211,153,0.08); color: var(--green); border-color: rgba(52,211,153,0.3); }
.flash-error   { background: rgba(251,91,107,0.08); color: var(--red); border-color: rgba(251,91,107,0.3); }
.flash-info    { background: rgba(34,211,238,0.08); color: var(--accent-2); border-color: rgba(34,211,238,0.3); }

/* ============ DETALLE DE REPORTE ============ */
.report-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 22px;
    align-items: start;
}
@media (max-width: 880px) {
    .report-grid { grid-template-columns: 1fr; }
}

.kv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 18px;
}
.kv-item .kv-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-faint); font-family: var(--font-mono); margin-bottom: 4px;
}
.kv-item .kv-value { font-size: 14.5px; color: var(--text); word-break: break-word; }
.kv-item .kv-value.mono { font-family: var(--font-mono); }

.creds-box {
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}
.creds-box code { font-family: var(--font-mono); font-size: 13.5px; color: var(--accent-2); }

.photo-thumb {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: zoom-in;
    display: block;
    position: relative;
    max-width: 100%;
}
.photo-thumb img { width: 100%; display: block; transition: transform .3s; }
.photo-thumb:hover img { transform: scale(1.03); }
.photo-thumb .zoom-hint {
    position: absolute; bottom: 8px; right: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff; font-size: 11px; padding: 4px 9px; border-radius: 6px;
    font-family: var(--font-mono);
}

/* Modal foto */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(4,5,10,0.86);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 30px;
}
.modal-overlay.open { display: flex; }
.modal-overlay img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: var(--radius);
    box-shadow: 0 30px 90px rgba(0,0,0,0.6);
    border: 1px solid var(--border-strong);
}
.modal-close {
    position: absolute;
    top: 26px; right: 30px;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.modal-close:hover { border-color: var(--red); color: var(--red); }

/* ============ CHAT ============ */
.chat-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 16px;
}
.chat-msg {
    max-width: 82%;
    padding: 11px 15px;
    border-radius: var(--radius-sm);
    font-size: 13.8px;
    line-height: 1.5;
}
.chat-msg .meta {
    font-size: 11px;
    font-family: var(--font-mono);
    opacity: 0.65;
    margin-bottom: 4px;
    display: block;
}
.chat-msg.from-admin {
    align-self: flex-start;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-top-left-radius: 2px;
}
.chat-msg.from-client {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(124,92,255,0.22), rgba(34,211,238,0.14));
    border: 1px solid rgba(124,92,255,0.3);
    border-top-right-radius: 2px;
}
.chat-empty { color: var(--text-faint); font-size: 13px; text-align: center; padding: 20px 0; }

/* ============ RESOLUTION BOX ============ */
.resolution-box {
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-top: 16px;
    border: 1px solid;
    font-size: 13.8px;
}
.resolution-box.success { background: rgba(52,211,153,0.07); border-color: rgba(52,211,153,0.3); color: var(--green); }
.resolution-box.failed  { background: rgba(251,91,107,0.07); border-color: rgba(251,91,107,0.3); color: var(--red); }
.resolution-box .title { font-weight: 700; margin-bottom: 6px; font-family: var(--font-display); font-size: 14.5px;}
.resolution-box p { color: var(--text); margin: 0; }

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-dim);
}
.empty-state .icon { font-size: 34px; margin-bottom: 10px; }

/* ============ UTIL ============ */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8{margin-top:8px;} .mt-16{margin-top:16px;} .mt-24{margin-top:24px;}
.text-dim { color: var(--text-dim); }
.text-center { text-align: center; }
.small { font-size: 12.5px; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

@media (max-width: 600px) {
    .kv-grid { grid-template-columns: 1fr; }
    .card { padding: 20px; }
    .topbar { flex-direction: column; gap: 12px; align-items: flex-start; }
}
.site-footer{
  width:100%;
  margin-top:auto;
  padding:22px 20px;
  text-align:center;
  border-top:1px solid var(--border-soft);
  background:rgba(11,12,20,.5);
  font-size:13px;
  color:var(--txt-3);
}
.site-footer a{
  color:var(--accent);
  font-weight:600;
}
.site-footer a:hover{
  text-decoration:underline;
}
.site-footer .dot{
  margin:0 8px;
  color:var(--border);
}
.logo-img{
  display:block;
  margin:0 auto 8px auto;
  width:72px !important;
  height:72px !important;
  max-width:72px;
  object-fit:contain;
  filter:drop-shadow(0 0 20px rgba(124,92,255,.35));
}
.auth-head{
  text-align:center;
  margin-bottom:16px;
}
.auth-head h1{
  font-size:22px;
  margin:8px 0 4px;
}