
/* ============================================================
   SKALRP PREMIUM — sistema de diseño (glassmorphism 2026)
   ============================================================ */
:root {
    /* Acento */
    --skal-accent-rgb: var(--skal-human-rgb, 74, 144, 217);   /* reserva si skal_ui no está instalado */
    --accent: rgb(var(--skal-accent-rgb));
    --accent-bright: rgb(var(--skal-accent-rgb));
    --accent-deep: rgba(var(--skal-accent-rgb), .72);
    --accent-dim: rgba(var(--skal-accent-rgb), .80);
    /* Glow */
    --glow: rgba(var(--skal-accent-rgb), .45);
    /* Cristal */
    --glass-bg: rgba(20, 22, 30, .72);
    --line: rgba(255, 255, 255, .09);
    /* Base */
    --carbon: #0c0d10;
    --bone: #e8e6df;
    --danger: #e5484d;
    --ok: #34d399;
    --warn: #f5a524;
    /* Easing */
    --ease: cubic-bezier(.22, 1, .36, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    /* Recortes */
    --cut: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    --cut-sm: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    width: 100vw; height: 100vh; overflow: hidden; background: transparent;
    font-family: 'SKAL Num', system-ui, sans-serif;
    font-size: clamp(14px, .28vw + 11px, 19px);
    user-select: none; -webkit-font-smoothing: antialiased; color: var(--bone);
}

.app { position: fixed; inset: 0; transition: opacity .3s var(--ease-out); }
.app[data-hide="true"] { opacity: 0; pointer-events: none; }
.veil {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, rgba(5,5,8,.62), rgba(5,5,8,.92));
}

/* ===== Panel principal (CRISTAL real) ===== */
.panel {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(680px, 74vw, 1080px);
    height: clamp(520px, 86vh, 720px);
    display: flex; flex-direction: column;
    background: linear-gradient(160deg, rgba(26,28,36,.94), rgba(14,16,21,.93));
    clip-path: var(--cut);
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
    filter: drop-shadow(0 20px 50px rgba(0,0,0,.5)) drop-shadow(0 8px 30px var(--glow));
}
/* Barra de acento superior con gradiente + glow que respira */
.panel::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 3;
    background: linear-gradient(90deg, transparent, var(--accent-deep) 12%, var(--accent-bright) 50%, var(--accent-deep) 88%, transparent);
    box-shadow: 0 0 14px var(--glow);
    animation: barBreath 4.5s ease-in-out infinite;
}
@keyframes barBreath {
    0%, 100% { opacity: .82; box-shadow: 0 0 9px var(--glow); }
    50%      { opacity: 1;   box-shadow: 0 0 22px var(--glow); }
}
/* Entrada del panel: SOLO al abrir (data-hide="false"), re-disparable */
.app[data-hide="false"] .panel { animation: panelIn .55s var(--ease) both; }
@keyframes panelIn {
    from { opacity: 0; transform: translate(-50%, -46%) scale(.965);
           filter: blur(8px) drop-shadow(0 20px 50px rgba(0,0,0,.5)) drop-shadow(0 8px 30px var(--glow)); }
    60%  { filter: blur(0)   drop-shadow(0 20px 50px rgba(0,0,0,.5)) drop-shadow(0 24px 54px var(--glow)); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1);
           filter: blur(0)   drop-shadow(0 20px 50px rgba(0,0,0,.5)) drop-shadow(0 8px 30px var(--glow)); }
}
.panel-head { display: flex; align-items: center; gap: 22px; padding: clamp(13px, 1.1vw, 20px) clamp(16px, 1.4vw, 26px); border-bottom: 1px solid var(--line); }
.brand { display: flex; flex-direction: column; }
.brand-mark {
    font-size: clamp(20px, .9vw + 8px, 30px); font-weight: 700; letter-spacing: .22em; line-height: 1;
    color: var(--accent-bright);
    text-shadow: 0 0 18px var(--glow);
    animation: markBreath 4.5s ease-in-out infinite;
}
@keyframes markBreath {
    0%, 100% { text-shadow: 0 0 10px rgba(79,157,240,.28); }
    50%      { text-shadow: 0 0 22px var(--glow); }
}
.brand-sub { font-size: clamp(9px, .2vw + 7px, 12px); letter-spacing: .16em; color: #8a897f; }
.tabs { display: flex; gap: 6px; margin-left: auto; }
.tab {
    font-family: inherit; font-size: clamp(11px, .25vw + 9px, 15px); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: #8a897f; background: transparent; border: none; padding: 8px 16px; cursor: pointer;
    clip-path: var(--cut-sm);
    transition: color .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease), transform .12s var(--ease);
}
.tab:hover { color: var(--bone); background: rgba(255,255,255,.05); }
.tab.active { color: #fff; background: linear-gradient(160deg, var(--accent), var(--accent-deep)); box-shadow: 0 4px 18px var(--glow); }
.tab:active { transform: scale(.97); }
.close-btn {
    width: 36px; height: 36px; display: grid; place-items: center;
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); clip-path: var(--cut-sm); cursor: pointer;
    transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .12s var(--ease);
}
.close-btn svg { width: 16px; height: 16px; fill: none; stroke: #9a9992; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s var(--ease); }
.close-btn:hover { background: rgba(229,72,77,.18); border-color: var(--danger); }
.close-btn:hover svg { stroke: var(--danger); }
.close-btn:active { transform: scale(.92) rotate(90deg); }

.body { flex: 1; overflow: hidden; position: relative; }
.view { display: none; height: 100%; }
.view.active { display: flex; }

/* ===== Jugadores ===== */
.players-col { width: clamp(280px, 23vw, 420px); flex-shrink: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: clamp(14px, 1.1vw, 22px); gap: 12px; }
.search {
    background: rgba(10,11,14,.72); border: 1px solid rgba(74,144,217,.2); clip-path: var(--cut-sm);
    color: var(--bone); font-family: inherit; font-size: clamp(13px, .2vw + 11px, 16px); font-weight: 600; padding: 10px 13px; outline: none;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search:focus { border-color: rgba(74,144,217,.6); box-shadow: 0 0 0 3px rgba(74,144,217,.12), 0 6px 20px var(--glow); }
.search::placeholder { color: #5d5c55; }
.players-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.players-list::-webkit-scrollbar, .actions-grid::-webkit-scrollbar { width: 4px; }
.players-list::-webkit-scrollbar-thumb { background: rgba(74,144,217,.3); border-radius: 4px; }
.pl-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: linear-gradient(160deg, rgba(40,44,56,.5), rgba(16,18,24,.5));
    clip-path: var(--cut-sm); cursor: pointer; border: 1px solid transparent;
    transition: background-color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
    animation: slideIn .38s var(--ease) backwards;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.pl-item:hover { background: linear-gradient(160deg, rgba(56,62,78,.6), rgba(22,25,32,.6)); transform: translateX(3px); border-color: rgba(255,255,255,.08); }
.pl-item.sel { border-color: var(--accent); background: linear-gradient(160deg, rgba(74,144,217,.16), rgba(74,144,217,.03)); box-shadow: inset 0 0 0 1px rgba(107,179,255,.25), 0 6px 18px var(--glow); }
.pl-item:active { transform: scale(.97); }
.pl-badge { font-family: 'SKAL Num', monospace; font-size: 12px; font-weight: 700; color: var(--accent-bright); min-width: 26px; }
.pl-info { min-width: 0; }
.pl-name { font-size: clamp(13px, .2vw + 11px, 16px); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-job { font-size: 11px; color: #8a897f; }

.detail { flex: 1; padding: clamp(16px, 1.5vw, 28px); overflow-y: auto; }
.detail-empty { height: 100%; display: grid; place-items: center; color: #5d5c55; font-size: 15px; letter-spacing: .04em; }
.dc-head { padding-bottom: 16px; border-bottom: 1px solid rgba(74,144,217,.18); margin-bottom: 16px; }
.dc-name { font-size: clamp(20px, .7vw + 12px, 30px); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.dc-meta { display: flex; gap: 8px; margin: 6px 0; }
.dc-tag { font-family: 'SKAL Num', monospace; font-size: 11px; padding: 3px 8px; background: rgba(10,11,14,.7); clip-path: polygon(5px 0,100% 0,100% calc(100% - 5px),calc(100% - 5px) 100%,0 100%,0 5px); color: var(--accent-bright); }
.dc-job { font-size: 14px; color: var(--accent-bright); font-weight: 600; }
.dc-money { font-family: 'SKAL Num', monospace; font-size: 13px; color: #b9b8b0; margin-top: 4px; }

.actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.self-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: clamp(16px, 1.5vw, 28px); align-content: start; }
.act-btn {
    display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 8px;
    background: linear-gradient(160deg, rgba(40,44,56,.55), rgba(16,18,24,.6));
    border: 1px solid rgba(255,255,255,.06); clip-path: var(--cut-sm); cursor: pointer; font-family: inherit;
    transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .18s var(--ease), filter .2s var(--ease);
    animation: riseIn .42s var(--ease) backwards;
}
@keyframes riseIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.act-btn:hover { background: linear-gradient(160deg, rgba(74,144,217,.16), rgba(74,144,217,.04)); border-color: rgba(74,144,217,.5); transform: translateY(-2px); filter: drop-shadow(0 8px 16px var(--glow)); }
.act-btn:active { transform: scale(.97); filter: none; }
.act-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--accent-bright); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s var(--ease); }
.act-btn span { font-size: clamp(11px, .2vw + 9px, 14px); font-weight: 600; letter-spacing: .04em; color: var(--bone); }
.act-btn.danger:hover { background: linear-gradient(160deg, rgba(229,72,77,.18), rgba(229,72,77,.04)); border-color: var(--danger); filter: drop-shadow(0 8px 16px rgba(229,72,77,.4)); }
.act-btn.danger svg { stroke: var(--danger); }
.act-btn.on { border-color: var(--ok); background: linear-gradient(160deg, rgba(52,211,153,.16), rgba(52,211,153,.03)); box-shadow: inset 0 0 0 1px rgba(52,211,153,.25); }
.act-btn.on svg { stroke: var(--ok); }
/* Stagger de rejillas de acciones / chips */
.act-btn:nth-child(1){animation-delay:.02s} .act-btn:nth-child(2){animation-delay:.05s} .act-btn:nth-child(3){animation-delay:.08s}
.act-btn:nth-child(4){animation-delay:.11s} .act-btn:nth-child(5){animation-delay:.14s} .act-btn:nth-child(6){animation-delay:.17s}
.act-btn:nth-child(7){animation-delay:.20s} .act-btn:nth-child(8){animation-delay:.23s} .act-btn:nth-child(9){animation-delay:.26s}
.act-btn:nth-child(10){animation-delay:.29s} .act-btn:nth-child(11){animation-delay:.32s} .act-btn:nth-child(12){animation-delay:.35s}

.money-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.mini-input { flex: 1; background: rgba(10,11,14,.72); border: 1px solid rgba(255,255,255,.1); clip-path: var(--cut-sm); color: var(--bone); font-family: inherit; font-size: clamp(12px, .2vw + 10px, 15px); padding: 9px 12px; outline: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.mini-input:focus { border-color: rgba(74,144,217,.55); box-shadow: 0 0 0 3px rgba(74,144,217,.1); }
.mini-btn {
    font-family: inherit; font-size: clamp(12px, .2vw + 10px, 15px); font-weight: 700; letter-spacing: .04em; color: #fff;
    background: linear-gradient(160deg, var(--accent), var(--accent-dim)); border: none; clip-path: var(--cut-sm); padding: 9px 16px; cursor: pointer;
    transition: filter .2s var(--ease), transform .16s var(--ease), box-shadow .2s var(--ease);
}
.mini-btn:hover { filter: brightness(1.12); transform: translateY(-1px); box-shadow: 0 8px 22px var(--glow); }
.mini-btn:active { transform: scale(.97); box-shadow: none; }
.mini-btn.wide { min-width: 120px; }
.mini-btn.ghost { background: rgba(255,255,255,.06); color: #b9b8b0; border: 1px solid rgba(255,255,255,.12); }
.mini-btn.ghost:hover { background: rgba(229,72,77,.16); color: var(--danger); border-color: var(--danger); box-shadow: 0 8px 22px rgba(229,72,77,.3); }
/* Botones que requieren jugador seleccionado: atenuados si están :disabled */
.mini-btn:disabled, .act-btn:disabled, .srv-chip:disabled { opacity: .4; filter: grayscale(.6); cursor: not-allowed; pointer-events: none; transform: none; box-shadow: none; }

/* ===== Servidor ===== */
.view[data-view="server"] { flex-direction: column; padding: clamp(18px, 1.7vw, 32px); gap: 20px; }
.srv-block { display: flex; flex-direction: column; gap: 10px; }
.srv-title { font-size: clamp(12px, .2vw + 10px, 15px); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-bright); }
.srv-row { display: flex; gap: 8px; }
.srv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.srv-chip {
    font-family: inherit; font-size: clamp(12px, .2vw + 10px, 15px); font-weight: 600; color: var(--bone);
    background: linear-gradient(160deg, rgba(40,44,56,.55), rgba(16,18,24,.6)); border: 1px solid rgba(255,255,255,.08); clip-path: var(--cut-sm); padding: 9px 16px; cursor: pointer;
    transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .16s var(--ease), filter .2s var(--ease);
    animation: riseIn .42s var(--ease) backwards;
}
.srv-chip:nth-child(1){animation-delay:.02s} .srv-chip:nth-child(2){animation-delay:.05s} .srv-chip:nth-child(3){animation-delay:.08s}
.srv-chip:nth-child(4){animation-delay:.11s} .srv-chip:nth-child(5){animation-delay:.14s} .srv-chip:nth-child(6){animation-delay:.17s}
.srv-chip:nth-child(7){animation-delay:.20s} .srv-chip:nth-child(8){animation-delay:.23s} .srv-chip:nth-child(9){animation-delay:.26s}
.srv-chip:hover { background: linear-gradient(160deg, rgba(74,144,217,.16), rgba(74,144,217,.04)); border-color: rgba(74,144,217,.5); color: var(--accent-bright); transform: translateY(-2px); filter: drop-shadow(0 6px 14px var(--glow)); }
.srv-chip:active { transform: scale(.97); filter: none; }

.panel-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px clamp(16px, 1.4vw, 26px); border-top: 1px solid var(--line); font-size: 11px; color: #6e6d65; letter-spacing: .04em; }

/* ===== Vigilancia (multi-pantalla) ===== */
.watch-wrap { display: flex; flex-direction: column; height: 100%; padding: clamp(14px, 1.2vw, 24px) clamp(16px, 1.4vw, 26px); gap: 14px; }
.watch-bar { display: flex; justify-content: space-between; align-items: center; }
.watch-info { font-size: 12px; color: #8a897f; letter-spacing: .04em; }
.watch-controls { display: flex; align-items: center; gap: 12px; }
.watch-controls label { font-size: 12px; color: #b9b8b0; display: flex; align-items: center; gap: 6px; }
.watch-controls select { background: rgba(10,11,14,.8); border: 1px solid rgba(74,144,217,.25); color: var(--accent-bright); font-family: inherit; font-size: 12px; padding: 5px 8px; clip-path: var(--cut-sm); outline: none; }
.watch-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(230px, 17vw, 330px), 1fr)); gap: 12px; align-content: start; }
.watch-grid::-webkit-scrollbar { width: 5px; }
.watch-grid::-webkit-scrollbar-thumb { background: rgba(74,144,217,.35); border-radius: 4px; }
.wcard {
    background: linear-gradient(160deg, rgba(28,29,35,.9), rgba(10,11,14,.94));
    clip-path: var(--cut); border-top: 2px solid var(--accent); overflow: hidden; cursor: pointer;
    transition: transform .2s var(--ease), filter .2s var(--ease);
    animation: slideIn .38s var(--ease) backwards;
}
.wcard:hover { transform: translateY(-3px); filter: drop-shadow(0 12px 24px var(--glow)); }
.wcard:active { transform: scale(.97); filter: none; }
.wcard-screen { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0a0b0e; display: grid; place-items: center; overflow: hidden; }
.wcard-screen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wcard-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #5d5c55; font-size: 12px; letter-spacing: .08em; }
.wcard-loading::after { content: ''; width: 22px; height: 22px; margin-top: 26px; border: 2px solid rgba(74,144,217,.25); border-top-color: var(--accent-bright); border-radius: 50%; animation: spin 1s linear infinite; position: absolute; }
@keyframes spin { to { transform: rotate(360deg); } }
.wcard-live { position: absolute; top: 7px; left: 7px; display: flex; align-items: center; gap: 5px; background: rgba(5,5,8,.7); padding: 3px 8px; clip-path: var(--cut-sm); font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--danger); }
.wcard-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
.wcard-foot { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; }
.wcard-name { font-size: 13px; font-weight: 600; color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcard-id { font-family: 'SKAL Num', monospace; font-size: 12px; font-weight: 700; color: var(--accent-bright); }

/* ===== Visor de capturas ===== */
.shot-overlay { position: absolute; inset: 0; background: rgba(3,3,5,.92); display: grid; place-items: center; gap: 14px; cursor: pointer; transition: opacity .25s var(--ease); grid-template-rows: 1fr auto; padding: 40px; }
.shot-overlay[data-hide="true"] { opacity: 0; pointer-events: none; }
.shot-overlay img { max-width: 84%; max-height: 78vh; align-self: end; clip-path: var(--cut); border-top: 2px solid var(--accent); filter: drop-shadow(0 20px 50px rgba(0,0,0,.6)); }
.shot-cap { color: #b9b8b0; font-size: 13px; letter-spacing: .04em; }
.shot-cap span { color: var(--accent-bright); font-weight: 700; }

/* ===== Escalado en monitores grandes (1440p / 4K) ===== */
@media (min-width: 2560px) {
    .panel { width: clamp(1080px, 62vw, 1500px); height: clamp(720px, 84vh, 1000px); }
}
@media (min-width: 3840px) {
    .panel { width: clamp(1500px, 56vw, 2100px); height: clamp(1000px, 84vh, 1360px); }
}

/* ===== Accesibilidad: respeta reduce-motion ===== */
@media (prefers-reduced-motion: reduce) {
    .app, .panel, .app[data-hide="false"] .panel,
    .panel::before, .brand-mark, .pl-item, .act-btn, .srv-chip, .wcard,
    .wcard-loading::after, .wcard-live::before {
        animation: none !important;
        transition: none !important;
    }
    .panel { filter: drop-shadow(0 20px 50px rgba(0,0,0,.5)) drop-shadow(0 8px 30px var(--glow)); }
    .tab, .close-btn, .search, .mini-input, .mini-btn, .act-btn, .srv-chip, .pl-item, .wcard {
        transition: none !important;
    }
}

/* ============================================================
   SANCIONES · TICKETS · NOTAS
   Techo técnico de CEF 103: sin backdrop-filter, sin color-mix(),
   sin :has(), sin anidado. Solo se animan transform y opacity.
   ============================================================ */

/* Punto de aviso sobre la pestaña de Tickets */
.tab { position: relative; }
.tab-dot {
    position: absolute; top: 4px; right: 6px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--danger); box-shadow: 0 0 8px var(--danger);
    animation: pulse 1.4s ease-in-out infinite;
}
.tab-dot[data-hide="true"] { display: none; }

/* Variantes de botón que faltaban */
.mini-btn.danger { background: linear-gradient(160deg, #e5484d, rgba(229,72,77,.78)); }
.mini-btn.danger:hover { box-shadow: 0 8px 22px rgba(229,72,77,.4); }
.mini-btn.warn { background: linear-gradient(160deg, #f5a524, rgba(245,165,36,.78)); color: #221a06; }
.mini-btn.warn:hover { box-shadow: 0 8px 22px rgba(245,165,36,.35); }
.mini-btn.small { padding: 6px 11px; font-size: clamp(10px, .18vw + 8px, 13px); }

/* ===== Columna de búsqueda de expedientes ===== */
.pun-col {
    width: clamp(280px, 23vw, 420px); flex-shrink: 0; border-right: 1px solid var(--line);
    display: flex; flex-direction: column; padding: clamp(14px, 1.1vw, 22px); gap: 10px;
}
.pun-hint { font-size: 11px; color: #6e6d65; letter-spacing: .03em; }
.pun-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.pun-list::-webkit-scrollbar, .tk-list::-webkit-scrollbar,
.pun-hist::-webkit-scrollbar, .pun-notes::-webkit-scrollbar,
.tk-chat::-webkit-scrollbar, .tbox-chat::-webkit-scrollbar { width: 4px; }
.pun-list::-webkit-scrollbar-thumb, .tk-list::-webkit-scrollbar-thumb,
.pun-hist::-webkit-scrollbar-thumb, .pun-notes::-webkit-scrollbar-thumb,
.tk-chat::-webkit-scrollbar-thumb, .tbox-chat::-webkit-scrollbar-thumb {
    background: rgba(74,144,217,.3); border-radius: 4px;
}
.pun-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: linear-gradient(160deg, rgba(40,44,56,.5), rgba(16,18,24,.5));
    clip-path: var(--cut-sm); cursor: pointer; border: 1px solid transparent;
    transition: background-color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
    animation: slideIn .38s var(--ease) backwards;
}
.pun-item:hover { transform: translateX(3px); border-color: rgba(255,255,255,.08); }
.pun-item.sel { border-color: var(--accent); background: linear-gradient(160deg, rgba(74,144,217,.16), rgba(74,144,217,.03)); }
.pun-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: #4b4a44; }
.pun-dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(52,211,153,.7); }
.pun-txt { min-width: 0; flex: 1; }
.pun-nm { font-size: clamp(13px, .2vw + 11px, 16px); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pun-sub { font-size: 11px; color: #8a897f; font-family: 'SKAL Num', monospace; }

/* ===== Expediente ===== */
.pun-detail { flex: 1; padding: clamp(16px, 1.5vw, 28px); overflow-y: auto; min-width: 0; }
.pun-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding-bottom: 14px; border-bottom: 1px solid rgba(74,144,217,.18); margin-bottom: 14px;
}
.pun-headleft { min-width: 0; }
.warnmeter {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 76px; padding: 8px 10px; flex-shrink: 0;
    background: linear-gradient(160deg, rgba(40,44,56,.6), rgba(16,18,24,.6));
    border: 1px solid rgba(255,255,255,.08); clip-path: var(--cut-sm);
    transition: border-color .2s var(--ease);
}
.warnmeter.hot { border-color: var(--warn); }
.warnmeter.crit { border-color: var(--danger); }
.warnmeter-num { font-size: clamp(20px, .6vw + 14px, 30px); font-weight: 700; line-height: 1; color: var(--bone); }
.warnmeter.hot .warnmeter-num { color: var(--warn); }
.warnmeter.crit .warnmeter-num { color: var(--danger); }
.warnmeter-lbl { font-size: 9px; letter-spacing: .14em; color: #8a897f; margin-top: 3px; }

.pun-tools { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.pun-sect { margin-bottom: 18px; display: flex; flex-direction: column; gap: 9px; }
.pun-hist { display: flex; flex-direction: column; gap: 6px; max-height: 34vh; overflow-y: auto; }
.pun-empty-line { font-size: 12px; color: #5d5c55; padding: 10px 2px; letter-spacing: .03em; }

.hist-row {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    background: linear-gradient(160deg, rgba(34,37,47,.55), rgba(14,16,21,.55));
    border-left: 2px solid #4b4a44; clip-path: var(--cut-sm);
    animation: riseIn .34s var(--ease) backwards;
}
.hist-row.ban { border-left-color: var(--danger); }
.hist-row.warn { border-left-color: var(--warn); }
.hist-row.kick { border-left-color: #8a897f; }
.hist-row.dead { opacity: .45; }
.hist-kind {
    font-size: 10px; font-weight: 700; letter-spacing: .1em; min-width: 42px;
    color: var(--accent-bright); text-transform: uppercase;
}
.hist-row.ban .hist-kind { color: var(--danger); }
.hist-row.warn .hist-kind { color: var(--warn); }
.hist-body { flex: 1; min-width: 0; }
.hist-reason { font-size: 13px; color: var(--bone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-meta { font-size: 10.5px; color: #8a897f; font-family: 'SKAL Num', monospace; margin-top: 2px; }
.hist-id { font-family: 'SKAL Num', monospace; font-size: 11px; color: #6e6d65; }

.pun-notes { display: flex; flex-direction: column; gap: 6px; max-height: 26vh; overflow-y: auto; }
.note-row {
    display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px;
    background: linear-gradient(160deg, rgba(34,37,47,.5), rgba(14,16,21,.5));
    border-left: 2px solid var(--accent); clip-path: var(--cut-sm);
    animation: riseIn .34s var(--ease) backwards;
}
.note-body { flex: 1; min-width: 0; }
.note-text { font-size: 13px; color: var(--bone); word-break: break-word; }
.note-meta { font-size: 10.5px; color: #8a897f; font-family: 'SKAL Num', monospace; margin-top: 3px; }
.note-del {
    background: none; border: none; color: #6e6d65; cursor: pointer; font-family: inherit;
    font-size: 15px; line-height: 1; padding: 2px 4px;
    transition: color .18s var(--ease), transform .18s var(--ease);
}
.note-del:hover { color: var(--danger); transform: scale(1.15); }

/* ===== Tickets ===== */
.tk-col {
    width: clamp(280px, 24vw, 430px); flex-shrink: 0; border-right: 1px solid var(--line);
    display: flex; flex-direction: column; padding: clamp(14px, 1.1vw, 22px); gap: 10px;
}
.tk-filters { display: flex; gap: 6px; }
.tk-filter {
    flex: 1; font-family: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: #8a897f; background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07); clip-path: var(--cut-sm); padding: 7px 6px; cursor: pointer;
    transition: color .18s var(--ease), background-color .18s var(--ease), transform .12s var(--ease);
}
.tk-filter:hover { color: var(--bone); }
.tk-filter.active { color: #fff; background: linear-gradient(160deg, var(--accent), var(--accent-deep)); border-color: transparent; }
.tk-filter:active { transform: scale(.97); }
.tk-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.tk-item {
    padding: 10px 12px; cursor: pointer; border: 1px solid transparent;
    background: linear-gradient(160deg, rgba(40,44,56,.5), rgba(16,18,24,.5));
    border-left: 2px solid #4b4a44; clip-path: var(--cut-sm);
    transition: background-color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
    animation: slideIn .34s var(--ease) backwards;
}
.tk-item:hover { transform: translateX(3px); }
.tk-item.sel { border-color: var(--accent); border-left-color: var(--accent); background: linear-gradient(160deg, rgba(74,144,217,.16), rgba(74,144,217,.03)); }
.tk-item.unclaimed { border-left-color: var(--danger); }
.tk-item.claimed { border-left-color: var(--warn); }
.tk-item.closed { border-left-color: #4b4a44; opacity: .6; }
.tk-line1 { display: flex; align-items: center; gap: 8px; }
.tk-num { font-family: 'SKAL Num', monospace; font-size: 12px; font-weight: 700; color: var(--accent-bright); }
.tk-name { font-size: 13px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-off { font-size: 10px; letter-spacing: .08em; color: #6e6d65; }
.tk-sub { font-size: 11.5px; color: #8a897f; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tk-detail { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: clamp(14px, 1.3vw, 26px); }
.tk-card { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.tk-head { padding-bottom: 12px; border-bottom: 1px solid rgba(74,144,217,.18); margin-bottom: 12px; }
.tk-subject { font-size: clamp(14px, .3vw + 12px, 19px); font-weight: 600; line-height: 1.35; word-break: break-word; }
.tk-state { font-size: 10px; font-weight: 700; letter-spacing: .1em; padding: 3px 9px; clip-path: var(--cut-sm); text-transform: uppercase; }
.tk-state.unclaimed { background: rgba(229,72,77,.18); color: var(--danger); }
.tk-state.claimed { background: rgba(245,165,36,.18); color: var(--warn); }
.tk-state.closed { background: rgba(255,255,255,.06); color: #8a897f; }
.tk-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }

.tk-shotwrap { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.tk-shotwrap img {
    width: clamp(180px, 22vw, 300px); aspect-ratio: 16 / 9; object-fit: cover; cursor: pointer;
    clip-path: var(--cut-sm); border-top: 2px solid var(--accent);
    transition: transform .2s var(--ease);
}
.tk-shotwrap img:hover { transform: scale(1.02); }
.tk-shotcap { font-size: 10.5px; color: #6e6d65; }

.tk-chat {
    flex: 1; min-height: 90px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px;
    padding: 12px; background: rgba(8,9,12,.5); clip-path: var(--cut-sm); margin-bottom: 10px;
}
.msg { max-width: 78%; padding: 8px 12px; clip-path: var(--cut-sm); animation: riseIn .3s var(--ease) backwards; }
.msg-who { font-size: 10px; letter-spacing: .08em; color: #8a897f; margin-bottom: 3px; }
.msg-txt { font-size: 13px; line-height: 1.4; word-break: break-word; color: var(--bone); }
.msg.player { align-self: flex-start; background: linear-gradient(160deg, rgba(46,50,62,.9), rgba(24,27,34,.9)); }
.msg.staff { align-self: flex-end; background: linear-gradient(160deg, rgba(74,144,217,.24), rgba(74,144,217,.08)); border-right: 2px solid var(--accent); }
.msg.system { align-self: center; background: none; max-width: 100%; padding: 2px; }
.msg.system .msg-txt { font-size: 11px; color: #6e6d65; letter-spacing: .03em; text-align: center; }
.tk-send { display: flex; gap: 8px; }

.srv-block.grow { flex: 1; min-height: 0; }

/* ===== Modales ===== */
.modal {
    position: absolute; inset: 0; z-index: 30; display: grid; place-items: center;
    background: rgba(3,3,5,.72); transition: opacity .22s var(--ease);
}
.modal[data-hide="true"] { opacity: 0; pointer-events: none; }
.modal-card {
    width: clamp(400px, 42vw, 620px); max-height: 84vh; display: flex; flex-direction: column;
    background: linear-gradient(160deg, rgba(30,33,42,.98), rgba(14,16,21,.98));
    clip-path: var(--cut); border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
    animation: modalIn .26s var(--ease) both;
}
.modal-card.small { width: clamp(340px, 32vw, 460px); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px; border-bottom: 1px solid var(--line);
    font-size: clamp(12px, .22vw + 10px, 15px); font-weight: 700; letter-spacing: .14em; color: var(--accent-bright);
}
.modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(74,144,217,.3); border-radius: 4px; }
.modal-who { font-size: 13px; color: #b9b8b0; }
.modal-who b { color: var(--bone); }
.modal-block { display: flex; flex-direction: column; gap: 8px; }
.modal-area {
    background: rgba(10,11,14,.72); border: 1px solid rgba(255,255,255,.1); clip-path: var(--cut-sm);
    color: var(--bone); font-family: inherit; font-size: clamp(12px, .2vw + 10px, 15px);
    padding: 10px 12px; outline: none; resize: none; min-height: 84px; line-height: 1.45;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.modal-area:focus { border-color: rgba(74,144,217,.55); box-shadow: 0 0 0 3px rgba(74,144,217,.1); }
.modal-count { font-size: 11px; color: #6e6d65; }
.modal-count.bad { color: var(--warn); }
.modal-warnbox { font-size: 11.5px; color: var(--warn); line-height: 1.45; min-height: 1px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line); }
.srv-chip.on { border-color: var(--accent); background: linear-gradient(160deg, rgba(74,144,217,.22), rgba(74,144,217,.05)); color: var(--accent-bright); }

/* ============================================================
   VENTANA DE TICKET DEL JUGADOR (fuera de #app: la usa cualquiera)
   ============================================================ */
.tbox {
    position: fixed; right: 2vw; bottom: 2vh; width: clamp(300px, 24vw, 400px);
    max-height: 62vh; display: flex; flex-direction: column; z-index: 60;
    background: linear-gradient(160deg, rgba(26,28,36,.97), rgba(12,14,19,.97));
    clip-path: var(--cut); border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
    filter: drop-shadow(0 16px 40px rgba(0,0,0,.55)) drop-shadow(0 4px 18px var(--glow));
    transition: opacity .24s var(--ease-out), transform .24s var(--ease-out);
}
.tbox[data-hide="true"] { opacity: 0; pointer-events: none; transform: translateY(16px); }
.tbox-head { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.tbox-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--glow); animation: pulse 1.8s ease-in-out infinite; }
.tbox-title { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: #8a897f; }
.tbox-title b { color: var(--accent-bright); }
.tbox-state { margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: .1em; padding: 3px 8px; clip-path: var(--cut-sm); text-transform: uppercase; }
.tbox-state.unclaimed { background: rgba(229,72,77,.18); color: var(--danger); }
.tbox-state.claimed { background: rgba(52,211,153,.16); color: var(--ok); }
.tbox-x { width: 24px; height: 24px; display: grid; place-items: center; background: none; border: none; cursor: pointer; padding: 0; }
.tbox-x svg { width: 13px; height: 13px; fill: none; stroke: #6e6d65; stroke-width: 2; stroke-linecap: round; transition: stroke .18s var(--ease); }
.tbox-x:hover svg { stroke: var(--danger); }
.tbox-subject { padding: 10px 13px 0; font-size: 12px; color: #8a897f; line-height: 1.4; word-break: break-word; }
.tbox-chat { flex: 1; min-height: 80px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px 13px; }
.tbox-send { display: flex; gap: 6px; padding: 10px 13px; border-top: 1px solid var(--line); }
.tbox-send input {
    flex: 1; background: rgba(10,11,14,.72); border: 1px solid rgba(255,255,255,.1); clip-path: var(--cut-sm);
    color: var(--bone); font-family: inherit; font-size: 13px; padding: 8px 11px; outline: none;
    transition: border-color .2s var(--ease);
}
.tbox-send input:focus { border-color: rgba(74,144,217,.55); }
.tbox-send button {
    width: 38px; display: grid; place-items: center; cursor: pointer; border: none;
    background: linear-gradient(160deg, var(--accent), var(--accent-dim)); clip-path: var(--cut-sm);
    transition: filter .18s var(--ease), transform .14s var(--ease);
}
.tbox-send button svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tbox-send button:hover { filter: brightness(1.12); }
.tbox-send button:active { transform: scale(.94); }

/* ===== Accesibilidad: reduce-motion para lo nuevo ===== */
@media (prefers-reduced-motion: reduce) {
    .pun-item, .hist-row, .note-row, .tk-item, .msg, .modal-card, .tbox,
    .tab-dot, .tbox-dot {
        animation: none !important;
        transition: none !important;
    }
}


/* ---- Vigilancia: edad de la captura y grabación ---- */
.wcard-age { position: absolute; top: 7px; left: 7px; z-index: 3;
    padding: 2px 7px; border-radius: 20px; font-size: 9px; font-weight: 700;
    letter-spacing: .04em; background: rgba(10,12,15,.86);
    border: 1px solid rgba(255,255,255,.12); color: #9aa4b1;
    font-variant-numeric: tabular-nums; }
.wcard-age.stale { color: #ffb3a5; border-color: rgba(255,93,74,.45); }

.wcard-clip { position: absolute; top: 6px; right: 6px; z-index: 3;
    width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
    display: grid; place-items: center; padding: 0;
    background: rgba(10,12,15,.86); border: 1px solid rgba(255,255,255,.14);
    color: #9aa4b1; opacity: 0; transition: opacity .18s ease, color .18s ease; }
.wcard:hover .wcard-clip { opacity: 1; }
.wcard-clip svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.wcard-clip:hover { color: #ff8f7d; border-color: rgba(255,93,74,.5); }
.wcard-clip.rec { opacity: 1; color: #ff5d4a; border-color: #ff5d4a;
    animation: wRec 1s ease-in-out infinite; }
@keyframes wRec {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,93,74,.5); }
    50%      { box-shadow: 0 0 0 6px rgba(255,93,74,0); }
}
