@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url('../fonts/barlow-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url('../fonts/barlow-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('../fonts/barlow-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('../fonts/barlow-500-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url('../fonts/barlow-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url('../fonts/barlow-600-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url('../fonts/barlow-condensed-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('../fonts/barlow-condensed-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('../fonts/barlow-condensed-700-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* La Casa de appscma.com — estilos comunes de la Puerta, «Mi cuenta» y el Panel. Marca del club (manual de marca). */
:root {
  --marino: #1E3A6E; --marino-2: #2B4E8C; --marino-oscuro: #132649;
  --rojo: #D62E25; --sol: #FAD24A; --ok: #1F8A4C; --warn: #B86E00;
  --bg: #F3F5F9; --surface: #FFFFFF; --surface-2: #E8ECF3; --text: #15181E; --muted: #5B6472;
  --line: #DDE2EA; --accent: var(--marino); --link: #1E4FA0; --hover: #F0F4FB;
  --shadow: 0 10px 40px rgba(21, 24, 30, .22), 0 1px 3px rgba(21, 24, 30, .12);
  --radius: 10px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151B; --surface: #1B2029; --surface-2: #252C38; --text: #EEF1F6; --muted: #A2ABB9;
    --line: #2F3744; --accent: #8FB0EA; --link: #9DBBF0; --hover: #222937; --ok: #4CC07F; --warn: #E6A13A;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Barlow', system-ui, sans-serif; font-size: 15px; line-height: 1.45; background: var(--bg); color: var(--text); }
h1, h2, h3 { font-family: 'Barlow Condensed', 'Barlow', sans-serif; font-weight: 700; letter-spacing: .01em; margin: 0; }
a { color: var(--link); }
button, input, select, textarea { font: inherit; color: inherit; }
.oculto { display: none !important; }
.muted { color: var(--muted); }
.pequeno { font-size: 13px; }

/* Botones y campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primario { background: var(--marino); border-color: var(--marino); color: #fff; }
.btn-primario:hover { background: var(--marino-2); }
.btn-peligro { color: var(--rojo); }
.btn-ancho { width: 100%; }
.btn-chico { min-height: 32px; padding: 0 10px; font-size: 13px; }
label.campo { display: block; margin: 0 0 12px; }
label.campo > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.aviso { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 14px; margin: 0 0 12px; }
.aviso.error { background: rgba(214, 46, 37, .12); color: var(--rojo); }
.aviso.ok { background: rgba(31, 138, 76, .12); color: var(--ok); }

/* Pantalla de entrada y «Mi cuenta»: tarjeta centrada sobre marino, como la entrada de Inventario */
.portada { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--marino-oscuro); }
.tarjeta { background: var(--surface); border-radius: 14px; padding: 28px 24px; width: 100%; max-width: 400px; box-shadow: var(--shadow); }
.tarjeta h1 { font-size: 28px; color: var(--accent); }
.tarjeta .sub { color: var(--muted); margin: 2px 0 20px; }
.separador { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.separador::before, .separador::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.marca { display: flex; align-items: center; gap: 8px; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.marca i { width: 10px; height: 10px; border-radius: 50%; background: var(--rojo); display: inline-block; }
.codigo-input { font-size: 26px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.lista-apps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.lista-apps a { display: flex; justify-content: space-between; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; color: var(--text); }
.lista-apps a:hover { background: var(--hover); }
.titulo-lista { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

/* ── Panel ─────────────────────────────────────────────────────────────── */
.barra { position: sticky; top: 0; z-index: 5; background: var(--marino-oscuro); color: #fff; }
.barra-fila { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.barra h1 { font-size: 22px; }
.barra .marca { color: #C9D4EA; margin: 0; }
.barra .yo { margin-left: auto; font-size: 14px; color: #C9D4EA; display: flex; gap: 12px; align-items: center; }
.barra .yo a { color: #fff; }
.pestanas { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; gap: 4px; overflow-x: auto; }
.pestanas button { background: none; border: 0; color: #C9D4EA; padding: 10px 14px; border-bottom: 3px solid transparent; cursor: pointer; font-weight: 600; white-space: nowrap; }
.pestanas button[aria-selected=true] { color: #fff; border-bottom-color: var(--sol); }
.contenido { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
.cabecera-seccion { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cabecera-seccion h2 { font-size: 24px; margin-right: auto; }
.cabecera-seccion input[type=search] { max-width: 280px; }
.cabecera-seccion select { width: auto; }
.explica { color: var(--muted); margin: -6px 0 16px; max-width: 760px; }

.tabla-envoltura { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th, .tabla td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabla th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tr.clic { cursor: pointer; }
.tabla tr.clic:hover td { background: var(--hover); }
.tabla tr.de-baja td { color: var(--muted); }
.tabla td.vacio { text-align: center; color: var(--muted); padding: 28px; }
.tabla select { min-height: 34px; padding: 4px 8px; min-width: 150px; }
.tabla .persona-nombre { font-weight: 600; }
.tabla .apodo { color: var(--muted); font-size: 13px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-size: 12px; margin: 2px 4px 2px 0; white-space: nowrap; }
.chip.rojo { background: rgba(214, 46, 37, .14); color: var(--rojo); }
.chip.ambar { background: rgba(184, 110, 0, .14); color: var(--warn); }
.chip.marino { background: var(--marino); color: #fff; }

.tarjetas { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.tarjeta-app { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.tarjeta-app h3 { font-size: 22px; }
.tarjeta-app .origen { font-size: 13px; color: var(--muted); word-break: break-all; margin: 2px 0 14px; }
.tarjeta-app fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.tarjeta-app legend { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.puertas-elegir { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.puertas-elegir label { border: 1px solid var(--line); border-radius: 8px; padding: 8px; cursor: pointer; text-align: center; font-weight: 600; font-size: 14px; }
.puertas-elegir input { position: absolute; opacity: 0; }
.puertas-elegir label:has(input:checked) { border-color: var(--marino); background: var(--marino); color: #fff; }
.puertas-elegir label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.interruptor { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.interruptor input { width: 18px; height: 18px; accent-color: var(--marino); }
.interruptor small { color: var(--muted); display: block; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; }

dialog { border: 0; border-radius: 14px; padding: 0; width: min(680px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 15, 25, .55); }
dialog form { padding: 22px; }
dialog h2 { font-size: 24px; margin-bottom: 14px; }
.rejilla-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.pie-dialogo { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.pie-dialogo .izq { margin-right: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.clave-mostrar { font-family: ui-monospace, Menlo, monospace; font-size: 14px; padding: 10px; background: var(--surface-2); border-radius: 8px; word-break: break-all; user-select: all; }
@media (max-width: 600px){ .rejilla-2 { grid-template-columns: 1fr; } .barra .yo { margin-left: 0; } }

.grupos-ficha { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; margin: 0 0 12px; }
.grupos-ficha legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.fila-grupo { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.fila-licencia { display: grid; grid-template-columns: 84px 1.3fr 1fr 1fr 80px auto; gap: 6px; margin-top: 8px; }
.fila-licencia input { min-height: 34px; padding: 4px 8px; }
.tabla-compacta th, .tabla-compacta td { padding: 6px 8px; }
.grupos-persona { font-size: 12px; color: var(--muted); }
@media (max-width: 600px){ .fila-grupo, .fila-licencia { grid-template-columns: 1fr; } }

.titulo-roles { font-size: 20px; margin: 8px 0 10px; }
.tabla-roles td, .tabla-roles th { text-align: center; }
.tabla-roles td:first-child, .tabla-roles th:first-child { text-align: left; }
.tabla-roles input[type=text] { min-height: 34px; padding: 4px 8px; min-width: 150px; }
.tabla-roles input[type=checkbox], .permisos-rol input { width: 18px; height: 18px; accent-color: var(--marino); }
.permisos-rol { display: grid; gap: 4px; margin: 8px 0 12px; }
.permisos-rol label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.permisos-rol small { display: block; color: var(--muted); font-size: 12px; }
.bloque-app-roles { margin-top: 28px; }

.tres-preguntas { margin: 0 0 16px; }
.tres-preguntas td { vertical-align: top; }
.chip-pruebas { display: inline-block; vertical-align: middle; font-size: 12px; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px; background: var(--sol); color: #15181E; }
