:root{
  /* ===== Design Tokens (pro, consistente) ===== */
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;

  --bg0:#070a14;
  --bg1:#0b1220;
  --bg2:#0e1a38;
  --bg3:#0a5cff;

  --surface-1: rgba(255,255,255,.06);
  --surface-2: rgba(255,255,255,.08);
  --stroke:    rgba(160,200,255,.18);

  --text: #eef4ff;
  --muted: rgba(238,244,255,.72);

  --accent:#00e0ff;
  --accent-2:#2b8cff;

  --ok:#22c55e;
  --warn:#fbbf24;
  --err:#ff5252;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;

  --shadow-sm: 0 8px 18px rgba(0,0,0,.25);
  --shadow:    0 16px 40px rgba(0,0,0,.35);

  --gap: 16px;
  --topbar-h: 64px;
  --sidebar-w: 260px;

 
/* Paleta específica modo Jugador (violeta neón) */
--bg1-user:#0e071a;    /* violeta noche (muy oscuro) */
--bg2-user:#3a1670;    /* violeta medio profundo */
--bg3-user:#b56bff;    /* violeta neón */
--accent-user:#b56bff; /* acento botones/bordes */
}


*{box-sizing:border-box}
html,body{height:100%}


body{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  background: #0a1020;/* negro azulado profundo */

  display:flex;
  align-items:flex-start;
  justify-content:center;
}
.container{
  width:min(1100px,96vw);
  margin:24px auto;
  display:grid;
  gap:var(--gap);
}
body.app-layout .container{
  width: 100%;
  margin: 0;
}

.card{
 background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
}

.header{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px }
.brand{ display:flex; gap:10px; align-items:center }
.brand h1{ margin:0; font-size:1.5rem }
.brand small{ color:var(--muted) }

hr{border:none; border-top:1px solid rgba(255,255,255,.08); margin:12px 0}

.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:var(--gap) }
@media (max-width:780px){ .grid-2{ grid-template-columns:1fr } }

.form{ display:grid; gap:12px }
.row{ display:grid; grid-template-columns:1fr 1fr; gap:12px }
@media (max-width:780px){ .row{ grid-template-columns:1fr } }

.label{ font-size:.95rem; color:var(--muted) }
.input,.select,.textarea{
  width:100%; padding:12px; border-radius:10px;
  border:1px solid rgba(255,255,255,.12);
  background:#1c2130; color:#fff; outline:none;
}
.input:focus,.select:focus,.textarea:focus{
  border-color:rgba(0,224,255,.6);
  box-shadow:0 0 0 3px rgba(0,224,255,.15);
}
.textarea{ min-height:96px; resize:vertical }

.btn{
  appearance:none;
  border:none;
  border-radius:12px;
  padding:12px 14px;
  font-weight:700;
  cursor:pointer;
  box-shadow:var(--shadow);
  transition:.15s transform ease, .2s opacity ease, .25s box-shadow ease, .2s filter ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none; /* evita azul/subrayado en <a> */
  color:#eef4ff;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  border:1px solid rgba(255,255,255,.14);
}

.btn:hover{
  filter: brightness(1.06);
  box-shadow:0 12px 30px rgba(0,0,0,.32);
}

.btn:active{ transform:translateY(1px) }
.btn.primary{
  background: linear-gradient(180deg, var(--accent), #00b7ff);
  color:#001018;
  box-shadow:0 8px 24px rgba(0,224,255,.25), 0 0 0 1px rgba(0,224,255,.25) inset;
}
.btn.primary:hover{ box-shadow:0 8px 30px rgba(0,224,255,.35), 0 0 0 1px rgba(0,224,255,.35) inset }
.btn.ok{ background:var(--ok); color:#021 }
.btn.ghost{
  background:transparent; border:1px solid rgba(255,255,255,.18); color:#fff
}

.actions{ display:flex; gap:10px; flex-wrap:wrap }

.nav{ display:flex; gap:8px; flex-wrap:wrap }
.nav a{
  text-decoration:none; color:#fff; padding:8px 12px; border-radius:999px;
  border:1px solid rgba(255,255,255,.15);
}
.nav a.active{ background:rgba(255,255,255,.12) }

.help{ font-size:.9rem; color:var(--muted) }
.muted{ color: var(--muted); }

/* Badges globales (Consejo ya puede sobreescribir si quiere) */
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid rgba(148,163,184,.35);
  border-radius:999px;
  padding:4px 10px;
  font-size:.85rem;
  font-weight:800;
  letter-spacing:.2px;
  background: rgba(0,0,0,.18);
}
.badge.soft{ background: rgba(148,163,184,.12); }
.badge.info{ border-color: rgba(59,130,246,.55); background: rgba(59,130,246,.10); }
.badge.success{ border-color: rgba(34,197,94,.55); background: rgba(34,197,94,.10); }
.badge.warn{ border-color: rgba(251,191,36,.75); background: rgba(251,191,36,.10); }

.notice{ padding:10px 12px; border-radius:10px; background:rgba(0,0,0,.25); border:1px dashed rgba(255,255,255,.2) }
.center{ text-align:center }
/* Accesibilidad y foco más visible (opcional) */
:focus-visible {
  outline: 2px solid rgba(0,224,255,.75);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Estados de error/success genéricos (para mensajes debajo de forms) */
.msg-ok   { color: #00e676; }
.msg-err  { color: #ff5252; }

/* Botones deshabilitados coherentes */
.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  box-shadow: none;
}
/* ===== Tablas y helpers de estado ===== */
.table-wrap{ width:100%; overflow:auto }
.table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size:.95rem;

  background: rgba(255,255,255,.04);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow:hidden;
}
.table thead th{
  text-align:left;
  padding:10px 12px;
  background: rgba(255,255,255,.06);
  border-bottom:1px solid rgba(160,200,255,.16);
  position: sticky;
  top: 0;
  backdrop-filter: blur(6px);
}
.table tbody td{
  padding:10px 12px;
  border-bottom:1px solid rgba(160,200,255,.10);
}
.table tbody tr:hover{
  background: rgba(255,255,255,.05);
}
.table tfoot th, .table tfoot td{
  padding:10px 12px;
  background: rgba(255,255,255,.04);
  border-top:1px solid rgba(160,200,255,.14);
}
.table .right{ text-align:right }


.pill{
  display:inline-block; padding:4px 8px; border-radius:999px;
  background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.15);
}
.pill.up{    background:rgba(0,200,83,.15);  border-color:rgba(0,200,83,.35) }
.pill.down{  background:rgba(255,82,82,.15); border-color:rgba(255,82,82,.35) }

/* Key-value blocks usados en “Estado global” y “Detalle” */
.kv{
  display:grid; grid-template-columns:220px 1fr; gap:10px; align-items:center
}
.kv .key{ color:var(--muted) }
.kv .val{ font-weight:600 }
@media (max-width:780px){ .kv{ grid-template-columns:1fr } }
/* ====== Layout común: Topbar + Sidebar + Main ====== */
.app{
  min-height:100vh;
  display:grid;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
}

/* Topbar */
.topbar{
  grid-area:topbar;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:0 16px;

  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border-bottom:1px solid var(--stroke);
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
}
.top-left{ display:flex; align-items:center; gap:12px; }
.brand{ font-weight:700; letter-spacing:.3px; }
.company-chip{
  padding:6px 10px; border:1px solid rgba(120,190,255,.55);
  border-radius:999px; font-size:.95rem; color:#e7eefc;
  background:#0b1230; box-shadow:inset 0 0 24px rgba(120,190,255,.12);
}
.top-right{ display:flex; align-items:center; gap:10px; }
.points{
  display:flex; align-items:center; gap:6px;
  padding:6px 10px; border-radius:999px;
  border:1px solid rgba(150,200,255,.45);
  background:#0a1736; font-weight:700;
  box-shadow:inset 0 0 18px rgba(120,190,255,.12);
}
.points.equity{
  border-color: rgba(34,197,94,.40);
  box-shadow: inset 0 0 18px rgba(34,197,94,.10);
}

.level{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(0,224,255,.35);
  background:#0a1736;
  font-weight:800;
  box-shadow:inset 0 0 18px rgba(0,224,255,.10);
}

.gem{
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px; border-radius:8px;
  border:1px solid rgba(120,190,255,.06);
  box-shadow:0 0 12px rgba(120,190,255,.35) inset;
  font-size:16px; background:#0c1a3f;
}

/* Sidebar */
.sidebar{
  grid-area: sidebar;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  border-right: 1px solid var(--stroke);
}
.side-list{ display:grid; gap:12px; }
.side-nav{
  position:relative;
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; border-radius:14px;
  border:1px solid rgba(170,210,255,.55);
  background:linear-gradient(180deg,#0c1a42,#0c183a);
  text-decoration:none; color:#eef4ff; font-weight:800; letter-spacing:.25px;
  box-shadow:0 3px 14px rgba(0,0,0,.35), inset 0 0 26px rgba(120,190,255,.10);
  transition:border-color .15s, box-shadow .15s, transform .06s, background .15s, color .15s;
  outline:none;
}
.side-nav:hover{
  border-color:rgba(150,210,255,.9);
  box-shadow:0 0 0 3px rgba(90,170,255,.30), inset 0 0 30px rgba(120,190,255,.14);
  background:linear-gradient(180deg,#0e1f4f,#0d1c45); color:#fff;
}
.side-nav:focus-visible{ box-shadow:0 0 0 3px rgba(90,170,255,.40), inset 0 0 30px rgba(120,190,255,.18); }
.side-nav:active{ transform:translateY(1px); }
.side-nav::after{ content:"›"; margin-left:auto; opacity:.95; transform:translateY(-1px); }
.side-ico{
  width:30px; height:30px; border-radius:999px;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid rgba(150,210,255,.85);
  background:#0b173a; box-shadow:0 0 12px rgba(120,190,255,.25) inset;
  font-size:14px; color:#eaf2ff; flex:0 0 30px;
}
.side-accent{
  border-color:rgba(255,82,130,.95)!important;
  background:linear-gradient(180deg,rgba(255,77,141,.35),rgba(210,60,128,.25))!important;
  color:#fff!important;
  box-shadow:0 0 0 2px rgba(255,77,141,.22), inset 0 0 34px rgba(255,77,141,.28), 0 3px 14px rgba(0,0,0,.35)!important;
}

/* Main */
.main{
  grid-area:main;
  padding:18px;
  overflow:auto; /* scroll dentro del área de contenido */
}

/* En páginas con layout app, anulamos el centrado del <body> de ui.css */
body.app-layout{
  display:block !important;
  align-items:initial !important;
  justify-content:initial !important;
  min-height:100svh; min-height:100dvh;
  width:100vw;
}

/* === Chip Hora del juego === */
.points.clock{
  border-color: rgba(120,255,200,.45);
  background:#0b2a1b;
  box-shadow: inset 0 0 18px rgba(120,255,200,.10);
}
/* =========================================================
   Override fondo + acento cuando el actor es JUGADOR
   (mantén ui.css azul como base, pero si <body class="actor-user">
   cambiamos el background a verde)
   ========================================================= */

body.actor-user{
  /* Cambiamos variables efectivas a las user */
  --bg1: var(--bg1-user);
  --bg2: var(--bg2-user);
  --bg3: var(--bg3-user);
  --accent: var(--accent-user);

  /* Fondo VERDE neón (mismo estilo que tu ui.css verde) */
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(181,107,255,.30) 0%, rgba(181,107,255,0) 60%),
    radial-gradient(1000px 700px at -10% 110%, rgba(58,22,112,.35) 0%, rgba(58,22,112,0) 60%),
    linear-gradient(120deg, var(--bg1), var(--bg2) 55%, var(--bg3));
}
/* =============================================================================
   UI Components / Utilities (globales) — PRO
   ========================================================================== */

/* --- Utilities: layout / spacing --- */
.stack{ display:flex; flex-direction:column; gap:12px; }
.stack.sm{ gap:8px; }
.stack.lg{ gap:16px; }

.cluster{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.cluster.sm{ gap:8px; }
.cluster.between{ justify-content:space-between; }

.spacer-6{ margin-top:6px; }
.spacer-8{ margin-top:8px; }
.spacer-10{ margin-top:10px; }
.spacer-12{ margin-top:12px; }

/* --- Banner / Notice (pro) --- */
.banner{
  padding:10px 12px;
  border:1px solid rgba(160,200,255,.22);
  border-radius:12px;
  background: rgba(255,255,255,.04);
}

/* --- Progress (pro) --- */
.progress{ display:flex; flex-direction:column; gap:8px; }
.progress__head{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.progress__track{
  height:10px; border-radius:999px; overflow:hidden;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(160,200,255,.14);
}
.progress__bar{
  height:100%; width:0%;
  border-radius:999px;
  background: linear-gradient(90deg, rgba(0,224,255,.95), rgba(43,140,255,.95));
}

/* --- Overlay / Modal (pro) --- */
.overlay{
  position: fixed; inset: 0; z-index: 2000;
  display:grid; place-items: start center;
  padding: 8vh 16px 24px;
}
.overlay[hidden]{ display:none; }

.overlay-backdrop{
  position:absolute; inset:0;
  background: rgba(3,6,16,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.overlay-card{
  position: relative;
  width: min(720px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border:1px solid rgba(160,200,255,.22);
  border-radius:18px;
  padding:16px 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
/* =========================================================
   Skin JUGADOR (VIOLETA) – TOPBAR + SIDEBAR
   (arregla los azules hardcodeados de la UI base)
   ========================================================= */

body.actor-user .topbar{
  background:#160a26 !important;
  border-bottom:1px solid rgba(181,107,255,.55) !important;
  box-shadow:0 4px 18px rgba(0,0,0,.28);
}

body.actor-user .company-chip{
  border:1px solid rgba(181,107,255,.65) !important;
  background:#1a0c2c !important;
  color:#f7f0ff !important;
  box-shadow:inset 0 0 24px rgba(181,107,255,.14);
}

body.actor-user .points{
  border:1px solid rgba(181,107,255,.55) !important;
  background:#1b0f2f !important;
  color:#f7f0ff !important;
  box-shadow:inset 0 0 18px rgba(181,107,255,.12);
}

body.actor-user .level{
  border:1px solid rgba(181,107,255,.45) !important;
  background:#1b0f2f !important;
  color:#f7f0ff !important;
  box-shadow:inset 0 0 18px rgba(181,107,255,.10);
}

body.actor-user .gem{
  border:1px solid rgba(181,107,255,.60) !important;
  background:#1a0c2c !important;
  box-shadow: 0 0 12px rgba(181,107,255,.30) inset !important;
  color:#f3eaff !important;
}

/* Sidebar */
body.actor-user .sidebar{
  background:#140923 !important;
  border-right:1px solid rgba(181,107,255,.35) !important;
  box-shadow:inset -1px 0 0 rgba(181,107,255,.12);
}

body.actor-user .side-nav{
  color:#f7f0ff !important;
  border:1px solid rgba(200,150,255,.55) !important;
  background: linear-gradient(180deg, #22103a, #1a0c2c) !important;
  box-shadow: 0 3px 14px rgba(0,0,0,.35), inset 0 0 26px rgba(181,107,255,.12) !important;
}

body.actor-user .side-nav:hover{
  border-color: rgba(210,170,255,.90) !important;
  box-shadow: 0 0 0 3px rgba(181,107,255,.22), inset 0 0 30px rgba(181,107,255,.16) !important;
  background: linear-gradient(180deg, #2a1450, #20103c) !important;
  color:#fff !important;
}

body.actor-user .side-nav:focus-visible{
  box-shadow: 0 0 0 3px rgba(181,107,255,.28), inset 0 0 30px rgba(181,107,255,.18) !important;
}

body.actor-user .side-ico{
  border:1px solid rgba(210,170,255,.85) !important;
  background:#1a0c2c !important;
  box-shadow:0 0 12px rgba(181,107,255,.22) inset !important;
  color:#f3eaff !important;
}

body.actor-user .side-nav[aria-current="page"]{
  border-color: rgba(220,190,255,.95) !important;
  background: linear-gradient(180deg, rgba(181,107,255,.30), rgba(60,25,110,.22)) !important;
  color:#fff !important;
  box-shadow: 0 0 0 2px rgba(181,107,255,.22), inset 0 0 34px rgba(181,107,255,.24), 0 3px 14px rgba(0,0,0,.35) !important;
}

body.actor-user .side-nav[aria-current="page"] .side-ico{
  border-color: rgba(220,190,255,.90) !important;
  background: rgba(181,107,255,.18) !important;
  box-shadow: 0 0 12px rgba(181,107,255,.40) inset !important;
}