/* Vista cliente: login, panel empleado, primer ingreso.
   Aislado de :root del admin. Se carga al final para pisar employee-improved. */

body.employee-app,
body.login-body,
body.primer-ingreso {
    /* Tokens (vista cliente) - paleta navy/emerald/amber */
    --navy-900: #07162b;
    --navy-800: #0b2341;

    --emerald-500: #25a244;
    --emerald-600: #1b8a35;
    --emerald-700: #146927;

    --amber-500: #f59e0b;
    --amber-600: #d97706;

    /* Texto sobre fondos claros (cards glass) */
    --ink: var(--navy-800);
    --ink-soft: #4b5563;

    /* Fondo “paper” suave (landing/app) */
    --paper: #f1f5f9;
    --paper-deep: #e7edf7;
    --line: rgba(7, 22, 43, 0.14);

    /* Primary (emerald) */
    --accent: var(--emerald-600);
    --accent-ink: #ffffff;

    /* Estados */
    --amber: var(--amber-500);
    --taken: #64748b;
    --ok: var(--emerald-600);
    --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --radius: 10px;
    --radius-card: 16px;
    --app-width: 480px;
    --header-h: 56px;
    --nav-h: 64px;
    --status-h: 64px;
}

body.employee-app,
body.login-body,
body.primer-ingreso {
    margin: 0;
    min-height: 100dvh;
    background: var(--paper-deep);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

body.employee-app {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    padding-bottom: 0;
}

html:has(body.employee-app) {
    height: 100%;
    overflow: hidden;
}

body.employee-app .skip-link {
    position: absolute;
    left: -999px;
}

/* ---------- App shell (centrado como app, no 1200px) ---------- */
body.employee-app .employee-layout {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    max-width: var(--app-width);
    margin: 0 auto;
    background-color: var(--paper);
    background-image: radial-gradient(circle at 1px 1px, rgba(7, 22, 43, 0.07) 1px, transparent 0);
    background-size: 16px 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: none;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
}

@media (max-width: 480px) {
    body.employee-app .employee-layout {
        border-left: 0;
        border-right: 0;
    }
}

/* ---------- Header ---------- */
body.employee-app .employee-header {
    position: relative;
    flex-shrink: 0;
    z-index: 40;
    background: var(--navy-900);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(7, 22, 43, 0.18);
}

body.employee-app .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top));
    max-width: none;
    margin: 0;
    min-height: var(--header-h);
}

body.employee-app .header-content .logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    text-decoration: none;
    color: var(--accent-ink);
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.15;
}

body.employee-app .header-content .logo i,
body.employee-app .header-content .logo .logo-mark {
    display: none;
}

body.employee-app .header-content .logo span {
    font-size: 1.05rem;
}

body.employee-app .logo-kicker {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--emerald-500);
}

body.employee-app .user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

body.employee-app .user-info {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: none;
}

body.employee-app .user-info i {
    display: none;
}

body.employee-app .user-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.82);
}

body.employee-app .btn-logout {
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    min-height: 36px;
    box-shadow: none;
}

body.employee-app .btn-logout:hover,
body.employee-app .btn-logout:focus {
    background: rgba(37, 162, 68, 0.18);
    border-color: rgba(37, 162, 68, 0.45);
    color: #ffffff;
    transform: none;
}

/* ---------- Main ---------- */
body.employee-app .employee-main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0 0 calc(var(--nav-h) + env(safe-area-inset-bottom));
}

body.employee-app .employee-main .container {
    max-width: none;
    margin: 0;
    height: 100%;
    min-height: 0;
    padding: 0 12px 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: none;
}

/* ---------- Welcome ---------- */
body.employee-app .welcome-section {
    position: relative;
    flex-shrink: 0;
    background: none;
    color: var(--ink);
    padding: 8px 0 4px;
    border-radius: 0;
    margin-bottom: 0;
    border: 0;
    box-shadow: none;
    overflow: visible;
}

body.employee-app .welcome-section::before {
    display: none;
}

body.employee-app .welcome-content {
    text-align: left;
}

body.employee-app .welcome-content h1,
body.employee-app .welcome-section h1 {
    font-family: var(--font-ui);
    font-size: 1.15rem;
    font-weight: 650;
    color: var(--ink);
    margin: 0 0 4px;
    text-shadow: none;
    display: block;
}

body.employee-app .welcome-content h1 i,
body.employee-app .welcome-content p i {
    display: none;
}

body.employee-app .welcome-content p,
body.employee-app .welcome-section p {
    font-size: 0.88rem;
    color: var(--ink-soft);
    margin: 0;
    opacity: 1;
    display: block;
}

/* ---------- Stats: una franja ---------- */
body.employee-app .employee-stats {
    display: none;
}

body.employee-app .stat-card {
    background: transparent;
    border-radius: 0;
    padding: 12px 8px;
    box-shadow: none;
    border: 0;
    border-right: 1px solid var(--line);
    overflow: visible;
    text-align: center;
}

body.employee-app .stat-card:last-child {
    border-right: 0;
}

body.employee-app .stat-card::before,
body.employee-app .stat-card.primary::before,
body.employee-app .stat-card.success::before,
body.employee-app .stat-card.warning::before {
    display: none;
}

body.employee-app .stat-card:hover {
    transform: none;
    box-shadow: none;
}

body.employee-app .stat-card .stat-icon {
    display: none;
}

body.employee-app .stat-card .stat-info h3,
body.employee-app .stat-card .stat-info p {
    margin: 0;
}

body.employee-app .stat-card .stat-info h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.2;
}

body.employee-app .stat-card .stat-info p {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-top: 4px;
}

/* ---------- Bottom nav ---------- */
body.employee-app .tabs-nav,
body.employee-app .employee-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--app-width);
    z-index: 50;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--navy-900);
    backdrop-filter: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    box-shadow: none;
}

body.employee-app .tab-btn {
    flex: 1;
    min-width: 0;
    min-height: 52px;
    padding: 6px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    flex-direction: column;
    gap: 4px;
    box-shadow: none;
}

body.employee-app .tab-btn i {
    font-size: 1rem;
    line-height: 1;
}

body.employee-app .tab-btn:hover {
    background: transparent;
    color: #ffffff;
    transform: none;
}

body.employee-app .tab-btn.active {
    background: transparent;
    color: var(--emerald-500);
    box-shadow: none;
    border-bottom: 0;
    border-top: 2px solid var(--emerald-500);
}

body.employee-app .tab-btn.disabled {
    opacity: 0.35;
}

body.employee-app .tab-content {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.employee-app .tab-panel {
    display: none;
}

body.employee-app .tab-panel.active {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
}

body.employee-app #elegir-tab.tab-panel.active > .card {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.employee-app #elegir-tab .card-body {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 10px 12px 8px;
}

/* Otras pestañas: misma card flex; scroll en card-body */
body.employee-app #mis-numeros-tab.tab-panel.active > .card,
body.employee-app #historial-tab.tab-panel.active > .card,
body.employee-app #ganadores-tab.tab-panel.active > .card,
body.employee-app #video-loteria-tab.tab-panel.active > .card {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.employee-app #mis-numeros-tab .card-body,
body.employee-app #historial-tab .card-body,
body.employee-app #ganadores-tab .card-body,
body.employee-app #video-loteria-tab .card-body {
    flex: 1 1 0%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 12px 14px 14px;
}

/* Título vive en welcome; no duplicar card-header */
body.employee-app #mis-numeros-tab .card-header,
body.employee-app #historial-tab .card-header,
body.employee-app #ganadores-tab .card-header,
body.employee-app #video-loteria-tab .card-header {
    display: none;
}

body.employee-app .balota-selection-simplified {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
    gap: 8px;
    margin-top: 0;
    overflow: hidden;
}

/* ---------- Cards ---------- */
body.employee-app .card,
body.employee-app .info-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(7, 22, 43, 0.14);
    border-radius: var(--radius-card);
    box-shadow: none;
    backdrop-filter: blur(10px);
}

body.employee-app .balotas-section {
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    padding: 4px 0 0;
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.employee-app .balotas-container {
    display: none;
    flex: 1 1 0%;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

/* jQuery .show() pone display:block; forzamos flex para que el grid pueda scrollear */
body.employee-app #balotasContainer[style*="block"],
body.employee-app #balotasContainer[style*="flex"] {
    display: flex !important;
}

body.employee-app #balotasContainer[style*="display: none"],
body.employee-app #balotasContainer[style*="display:none"] {
    display: none !important;
}

body.employee-app .card-header {
    padding: 16px 16px 0;
    border-bottom: 0;
    background: transparent;
}

body.employee-app .card-header h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--ink);
    margin: 0 0 4px;
}

body.employee-app .card-header h3 i {
    display: none;
}

body.employee-app .card-header p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

body.employee-app .card-body {
    padding: 14px 16px 18px;
}

/* ---------- Countdown inyectado ---------- */
body.employee-app .countdown-container,
body.employee-app #countdown-timer,
body.employee-app .countdown-line {
    margin: 0 0 6px;
    flex-shrink: 0;
}

body.employee-app .countdown-container .alert,
body.employee-app #countdown-timer .alert {
    display: none;
}

body.employee-app .countdown-display,
body.employee-app #countdown-display {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink-soft);
    margin: 0;
    line-height: 1.4;
}

body.employee-app #countdown-display.text-warning {
    color: var(--amber-600);
}

body.employee-app #countdown-display.text-danger {
    color: var(--amber-600);
    font-weight: 650;
}

body.employee-app .countdown-card,
body.employee-app .countdown-section {
    background: none;
    animation: none;
    box-shadow: none;
    color: var(--ink);
}

/* ---------- Toolbar compacta ---------- */
body.employee-app .search-controls {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    flex-shrink: 0;
}

body.employee-app .control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

body.employee-app .search-controls .btn-icon {
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    text-transform: none;
    letter-spacing: 0;
}

body.employee-app .control-group-search {
    flex: 1 1 auto;
}

body.employee-app .control-group-search .input-group {
    align-items: stretch;
}

body.employee-app .control-group-search .search-affix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 38px;
    padding: 0 4px 0 8px;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
}

body.employee-app .control-group-search .input-group input,
body.employee-app .control-group-search input[type="number"] {
    min-height: 38px;
    padding: 6px 8px;
    font-size: 0.9rem;
    border-radius: 0;
}

body.employee-app .control-group-search .btn-clear {
    min-height: 38px;
    min-width: 34px;
}

body.employee-app .control-group label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
    text-shadow: none;
    margin: 0;
}

body.employee-app .control-group label i,
body.employee-app .form-text {
    display: none;
}

body.employee-app .form-select,
body.employee-app .input-group input,
body.employee-app input[type="number"],
body.employee-app input[type="text"],
body.employee-app input[type="password"] {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    font-size: 1rem;
    font-weight: 400;
    box-shadow: none;
}

body.employee-app .form-select:focus,
body.employee-app .input-group input:focus,
body.employee-app input:focus {
    border-color: var(--ink);
    box-shadow: none;
    outline: 2px solid transparent;
}

body.employee-app .input-group {
    display: flex;
    gap: 0;
}

body.employee-app .input-group input {
    flex: 1;
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
}

body.employee-app .btn-clear {
    background: var(--navy-800);
    color: #fff;
    border: 1px solid var(--navy-800);
    border-radius: 0 var(--radius) var(--radius) 0;
    min-height: 46px;
    min-width: 46px;
    padding: 0;
}

body.employee-app .btn-clear:hover,
body.employee-app .btn-clear:focus {
    background: var(--accent);
    border-color: var(--accent);
    transform: none;
    outline: none;
}

body.employee-app .btn-random,
body.employee-app .btn-refresh,
body.employee-app .btn-primary,
body.employee-app .btn-secondary,
body.employee-app .btn-danger {
    border-radius: var(--radius);
    box-shadow: none;
    transform: none;
    min-height: 42px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

body.employee-app .btn-random {
    background: transparent;
    color: var(--navy-800);
    border: 1px solid rgba(7, 22, 43, 0.22);
    width: auto;
    padding: 0 12px;
    min-height: 42px;
}

body.employee-app .btn-random:hover,
body.employee-app .btn-random:focus {
    background: rgba(7, 22, 43, 0.06);
    border-color: var(--navy-800);
    color: var(--navy-800);
    transform: none;
    box-shadow: none;
}

body.employee-app .btn-refresh {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
    padding: 8px 12px;
    width: auto;
    min-height: 42px;
}

body.employee-app .search-controls .btn-icon.btn-random,
body.employee-app .search-controls .btn-icon.btn-refresh {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    text-transform: none;
    letter-spacing: 0;
}

body.employee-app .balotas-actions {
    display: none;
}

body.employee-app .btn-primary {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--accent-ink);
}

body.employee-app .btn-primary:hover {
    background: var(--emerald-700);
    border-color: var(--emerald-700);
    color: var(--accent-ink);
}

body.employee-app .btn-secondary {
    background: rgba(7, 22, 43, 0.04);
    border: 1px solid rgba(7, 22, 43, 0.14);
    color: var(--ink);
}

body.employee-app .btn-secondary:hover {
    background: rgba(7, 22, 43, 0.07);
    color: var(--ink);
}

body.employee-app .btn-danger {
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--navy-900);
}

/* ---------- Balotas ---------- */
body.employee-app .balotas-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

body.employee-app .balotas-header h4,
body.employee-app .balotas-header h4 i,
body.employee-app #balotasTitle {
    color: var(--ink);
    text-shadow: none;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex: 1 1 auto;
    margin: 0;
}

body.employee-app .balotas-header .btn-refresh {
    margin-left: auto;
    min-height: 32px;
    font-size: 0.68rem;
    padding: 4px 10px;
}

body.employee-app .balotas-range-btns {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin: 0 0 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

body.employee-app .range-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 32px;
    padding: 5px 4px;
    border: 1px solid rgba(7, 22, 43, 0.14);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font-size: 0.62rem;
    font-weight: 650;
    letter-spacing: 0;
    white-space: nowrap;
    cursor: pointer;
}

body.employee-app .range-btn:hover,
body.employee-app .range-btn:focus {
    border-color: rgba(27, 138, 53, 0.45);
    outline: none;
}

body.employee-app .range-btn.active {
    background: rgba(27, 138, 53, 0.12);
    border-color: rgba(27, 138, 53, 0.45);
    color: var(--emerald-700);
}

body.employee-app .balotas-header h4 i {
    display: none;
}

body.employee-app .count-badge {
    background: var(--paper-deep);
    color: var(--ink);
    border-radius: 2px;
    padding: 2px 6px;
    font-size: 0.7rem;
}

body.employee-app .balotas-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin: 0;
    flex: 1 1 100%;
}

body.employee-app .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--ink-soft);
    padding: 0;
}

body.employee-app .legend-color {
    width: 14px;
    height: 14px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.85rem;
    line-height: 1;
}

body.employee-app .legend-color::before {
    content: "\f015";
}

body.employee-app .legend-color.available {
    color: #86c99a;
}

body.employee-app .legend-color.occupied {
    color: #f0a0a0;
}

body.employee-app .legend-color.selected {
    color: #f0c674;
}

body.employee-app .balotas-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 0;
    flex: 1 1 0%;
    min-height: 0;
    height: 0; /* fuerza altura limitada en flex; el scroll vive solo aquí */
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 2px 2px 8px;
}

body.employee-app .balota {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    min-height: 48px;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #86c99a;
    font-family: var(--font-ui);
    box-shadow: none;
    cursor: pointer;
}

body.employee-app .balota-house {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(2.25rem, 13.5vw, 3.15rem);
    line-height: 1;
    color: inherit;
    opacity: 0.72;
    pointer-events: none;
}

body.employee-app .balota-num {
    position: relative;
    z-index: 1;
    display: inline-block;
    margin-top: 0.28em;
    padding: 0.18em 0.32em 0.16em;
    max-width: 62%;
    box-sizing: border-box;
    font-size: clamp(0.85rem, 3.9vw, 1.01rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--navy-900);
    text-align: center;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(7, 22, 43, 0.12);
    pointer-events: none;
}

body.employee-app .balota.disponible {
    color: #86c99a;
    background: transparent;
}

body.employee-app .balota.disponible:hover,
body.employee-app .balota.disponible:focus,
body.employee-app .balota.disponible:focus-visible {
    color: #6bb884;
    background: transparent;
    transform: none;
    outline: 2px solid rgba(20, 105, 39, 0.2);
    outline-offset: 1px;
}

body.employee-app .balota.disponible:hover .balota-house,
body.employee-app .balota.disponible:focus .balota-house {
    opacity: 0.88;
}

body.employee-app .balota.ocupada {
    color: #f0a0a0;
    background: transparent;
    cursor: default;
    text-decoration: none;
    opacity: 1;
}

body.employee-app .balota.ocupada .balota-num {
    color: #7f1d1d;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.9);
}

body.employee-app .balota.selected {
    color: #f0c674;
    background: transparent;
    transform: none;
}

body.employee-app .balota.selected .balota-house {
    opacity: 0.9;
}

body.employee-app .balota.selected .balota-num {
    color: var(--navy-900);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(7, 22, 43, 0.16);
}

body.employee-app .balota[aria-pressed="true"] {
    transform: none;
    box-shadow: none;
}

body.employee-app .loading-indicator,
body.employee-app .loading-state,
body.employee-app .empty-state,
body.employee-app .no-data-message,
body.employee-app .panel-empty {
    text-align: left;
    padding: 18px 4px;
    color: var(--ink-soft);
}

body.employee-app .panel-empty h4,
body.employee-app .empty-state h4,
body.employee-app .no-data-message h4 {
    margin: 0 0 6px;
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 650;
    color: var(--ink);
}

body.employee-app .panel-empty p,
body.employee-app .empty-state p,
body.employee-app .no-data-message p {
    margin: 0 0 14px;
    font-size: 0.88rem;
    line-height: 1.4;
}

body.employee-app .panel-empty .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    background: var(--accent);
    border: 1px solid var(--emerald-700);
    color: var(--accent-ink);
    cursor: pointer;
}

/* ---------- Mis números ---------- */
body.employee-app .numbers-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body.employee-app .number-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(7, 22, 43, 0.12);
    border-radius: 12px;
    padding: 14px 12px;
    text-align: left;
    box-shadow: none;
}

body.employee-app .number-card .number {
    font-family: var(--font-ui);
    font-size: 1.45rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--navy-800);
    line-height: 1.1;
}

body.employee-app .number-card .date {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--ink-soft);
}

body.employee-app .number-card .sorteo-info {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

body.employee-app .number-card .sorteo-info small {
    font-size: 0.72rem;
    color: var(--ink-soft);
    line-height: 1.3;
}

body.employee-app .number-card .sorteo-info i {
    display: none;
}

/* ---------- Historial ---------- */
body.employee-app .historial-filters,
body.employee-app .ganadores-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

body.employee-app .historial-filters .filter-group,
body.employee-app .ganadores-filters .filter-group {
    min-width: 0;
}

body.employee-app .historial-filters label,
body.employee-app .ganadores-filters label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

body.employee-app .historial-filters .form-select,
body.employee-app .ganadores-filters .form-select {
    min-height: 42px;
    font-size: 0.9rem;
}

body.employee-app .historial-filters .btn-secondary,
body.employee-app .ganadores-filters .btn-secondary {
    width: 100%;
    min-height: 42px;
}

body.employee-app .historial-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    border: 1px solid var(--line);
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 12px;
    overflow: hidden;
}

body.employee-app .historial-stats .stat-item {
    padding: 10px 8px;
    text-align: left;
    border-right: 1px solid var(--line);
    min-width: 0;
}

body.employee-app .historial-stats .stat-item:last-child {
    border-right: 0;
}

body.employee-app .historial-stats .stat-number {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    word-break: break-word;
}

body.employee-app .historial-stats .stat-label {
    display: block;
    margin-top: 3px;
    font-size: 0.6rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

body.employee-app .historial-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.employee-app .historial-item {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(7, 22, 43, 0.12);
    border-radius: 12px;
    padding: 12px;
}

body.employee-app .historial-item.ganadora {
    border-color: rgba(27, 138, 53, 0.35);
    background: rgba(27, 138, 53, 0.06);
}

body.employee-app .historial-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

body.employee-app .historial-balota {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

body.employee-app .historial-item .balota-numero {
    flex: 0 0 auto;
    min-width: 48px;
    padding: 8px 6px;
    border-radius: 8px;
    background: var(--navy-800);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 750;
    text-align: center;
    line-height: 1.1;
}

body.employee-app .historial-item.ganadora .balota-numero {
    background: var(--emerald-600);
}

body.employee-app .balota-info {
    min-width: 0;
}

body.employee-app .balota-info h4 {
    margin: 0 0 2px;
    font-size: 0.88rem;
    font-weight: 650;
    color: var(--ink);
    line-height: 1.25;
}

body.employee-app .balota-info p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--ink-soft);
}

body.employee-app .resultado-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--paper-deep);
    color: var(--ink-soft);
    border: 1px solid var(--line);
}

body.employee-app .resultado-badge i {
    display: none;
}

body.employee-app .resultado-badge.ganadora {
    background: rgba(27, 138, 53, 0.12);
    border-color: rgba(27, 138, 53, 0.3);
    color: var(--emerald-700);
}

body.employee-app .historial-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

body.employee-app .detail-item {
    display: flex;
    gap: 0;
    min-width: 0;
}

body.employee-app .detail-icon {
    display: none;
}

body.employee-app .detail-label {
    font-size: 0.6rem;
    font-weight: 650;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

body.employee-app .detail-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.25;
}

/* ---------- Ganadores ---------- */
body.employee-app .ganadores-container {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body.employee-app .ganadores-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

body.employee-app .ganador-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(7, 22, 43, 0.12);
    border-radius: 12px;
    padding: 14px;
    box-shadow: none;
    overflow: visible;
}

body.employee-app .ganador-card::before {
    display: none;
}

body.employee-app .ganador-card:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(27, 138, 53, 0.35);
}

body.employee-app .ganador-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

body.employee-app .ganador-trophy {
    display: none;
}

body.employee-app .ganador-position {
    background: var(--paper-deep);
    color: var(--ink);
    border-radius: 6px;
    box-shadow: none;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 8px;
    border: 1px solid var(--line);
}

body.employee-app .ganador-name {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 650;
    color: var(--ink);
    margin-bottom: 2px;
}

body.employee-app .ganador-documento {
    font-size: 0.75rem;
    color: var(--ink-soft);
    margin-bottom: 2px;
}

body.employee-app .ganador-cargo {
    background: transparent;
    color: var(--ink-soft);
    padding: 0;
    border-radius: 0;
    font-size: 0.78rem;
    margin-bottom: 10px;
}

body.employee-app .ganador-balota {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    background: var(--navy-800);
    color: #fff;
    border-radius: 10px;
    box-shadow: none;
    padding: 10px 12px;
    margin-bottom: 10px;
}

body.employee-app .ganador-balota-numero {
    font-size: 1.25rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

body.employee-app .ganador-balota-label {
    font-size: 0.62rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.75;
}

body.employee-app .ganador-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

body.employee-app .ganador-detail-label {
    font-size: 0.6rem;
    font-weight: 650;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

body.employee-app .ganador-detail-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink);
}

body.employee-app .ganador-sorteo-nombre {
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--ink);
    line-height: 1.3;
}

body.employee-app .ganador-sorteo-estado {
    margin-top: 2px;
    font-size: 0.72rem;
    color: var(--ink-soft);
}

body.employee-app .ganador-premio {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--emerald-700);
}

/* ---------- Video ---------- */
body.employee-app .video-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.employee-app .video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: var(--navy-900);
    border: 1px solid rgba(7, 22, 43, 0.2);
    box-shadow: none;
}

body.employee-app .video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

body.employee-app .video-info {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

body.employee-app .status-indicator {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--paper-deep);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.75rem;
    font-weight: 650;
}

body.employee-app .status-indicator.online {
    color: var(--emerald-700);
    background: rgba(27, 138, 53, 0.1);
    border-color: rgba(27, 138, 53, 0.3);
}

body.employee-app .status-indicator.offline {
    color: var(--ink-soft);
    background: transparent;
}

body.employee-app .video-controls {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

body.employee-app .video-controls button {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    justify-content: center;
}

body.employee-app .video-placeholder {
    border-radius: 12px;
    background: var(--navy-800);
    color: rgba(255, 255, 255, 0.85);
    padding: 28px 16px;
    text-align: left;
}

body.employee-app .video-placeholder h4 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 1rem;
    font-weight: 650;
}

body.employee-app .video-placeholder p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

/* ---------- Info sorteo ---------- */
body.employee-app .info-section {
    margin-top: 8px;
    flex-shrink: 0;
}

body.employee-app .info-card {
    padding: 12px 14px 10px;
}

body.employee-app .info-kicker {
    margin: 0 0 2px;
    font-size: 0.62rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--emerald-600);
}

body.employee-app .info-name {
    margin: 0 0 10px;
    font-size: 0.88rem;
    font-weight: 650;
    line-height: 1.3;
    color: var(--ink);
}

body.employee-app .info-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1.6fr;
    gap: 0;
    border-top: 1px solid var(--line);
}

body.employee-app .info-metric {
    padding: 8px 8px 0 0;
    min-width: 0;
}

body.employee-app .info-metric + .info-metric {
    padding-left: 8px;
    border-left: 1px solid var(--line);
}

body.employee-app .info-metric .value {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink);
    text-align: left;
    line-height: 1.25;
    word-break: break-word;
}

body.employee-app .info-metric .label {
    display: block;
    margin-top: 2px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

body.employee-app .info-header,
body.employee-app .info-content,
body.employee-app .info-item {
    display: contents;
}

/* ---------- Footer ---------- */
body.employee-app .employee-footer {
    display: none;
}

body.employee-app .employee-footer p {
    font-size: 0.7rem;
}

body.employee-app .employee-footer i {
    color: var(--ink-soft);
}

/* ---------- Modals ---------- */
body.employee-app .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 22, 43, 0.45);
    z-index: 1000;
    animation: none;
    align-items: center;
    justify-content: center;
}

body.employee-app .modal.show {
    display: flex;
}

body.employee-app .modal-content {
    width: calc(100% - 24px);
    max-width: 420px;
    border-radius: 16px;
    border: 1px solid rgba(7, 22, 43, 0.14);
    box-shadow: none;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

body.employee-app .modal-content.small {
    max-width: 360px;
}

body.employee-app .modal-content.medium {
    max-width: 420px;
}

body.employee-app .modal-header,
body.employee-app .modal-footer {
    border-color: rgba(7, 22, 43, 0.14);
    background: transparent;
}

body.employee-app .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 8px;
}

body.employee-app .modal-header h3 {
    font-family: var(--font-ui);
    font-size: 1.05rem;
    font-weight: 650;
    margin: 0;
}

body.employee-app .modal-header h3 i {
    display: none;
}

body.employee-app .modal-close {
    background: transparent;
    border: 0;
    color: var(--ink);
    margin-left: auto;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

body.employee-app .modal-body {
    padding: 4px 16px 12px;
}

body.employee-app #logoutModal .modal-footer {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 0 16px 16px;
}

body.employee-app #logoutModal .modal-footer .btn-secondary,
body.employee-app #logoutModal .modal-footer .btn-danger {
    width: auto;
    flex: 1;
    min-height: 42px;
}

body.employee-app #logoutModal .btn-danger {
    background: var(--navy-800);
    border: 1px solid var(--navy-800);
    color: #fff;
}

body.employee-app .balota-display-large,
body.employee-app .balota-confirm {
    background: var(--ink);
    color: var(--paper);
    border-radius: 2px;
    box-shadow: none;
    animation: none;
    text-shadow: none;
}

body.employee-app .balota-pick-modal {
    text-align: center;
    padding-top: 8px;
}

body.employee-app .balota-pick-modal .modal-body {
    padding: 24px 20px 8px;
}

body.employee-app .balota-pick-preview {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    color: var(--amber);
}

body.employee-app .balota-pick-house {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    line-height: 1;
    color: inherit;
}

body.employee-app .balota-pick-num {
    position: relative;
    z-index: 1;
    margin-top: 0.9rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 1px 2px rgba(7, 22, 43, 0.35);
}

body.employee-app .warning-notice,
body.employee-app .warning-text {
    background: transparent;
    border: 0;
    color: var(--ink-soft);
}

body.employee-app .modal-footer {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
}

body.employee-app .modal-footer .btn-primary,
body.employee-app .modal-footer .btn-secondary,
body.employee-app .modal-footer .btn-danger {
    width: 100%;
}

body.employee-app.modal-open {
    overflow: hidden;
}

/* Screen reader only (si no está cargado styles.css) */
body.employee-app .sr-only,
body.login-body .sr-only,
body.primer-ingreso .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---------- Alerts ---------- */
body.employee-app .alert-container {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 24px), 440px);
    z-index: 80;
}

body.employee-app .alert,
body.login-body .alert {
    border-radius: 16px;
    border: 1px solid rgba(7, 22, 43, 0.14);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    color: var(--ink);
}

/* Colores de estado para alertas (mantenemos look sobrio) */
body.employee-app .alert-success,
body.login-body .alert-success {
    border-color: rgba(27, 138, 53, 0.35);
}

body.employee-app .alert-danger,
body.login-body .alert-danger {
    border-color: rgba(239, 68, 68, 0.35);
}

body.employee-app .alert-warning,
body.login-body .alert-warning {
    border-color: rgba(245, 158, 11, 0.38);
}

body.employee-app .alert-info,
body.login-body .alert-info {
    border-color: rgba(6, 182, 212, 0.35);
}

body.employee-app .alert-success,
body.login-body .alert-success {
    background: rgba(27, 138, 53, 0.10);
    color: var(--ink);
}

body.employee-app .alert-danger,
body.login-body .alert-danger {
    background: rgba(239, 68, 68, 0.08);
    color: var(--ink);
}

body.employee-app .alert-warning,
body.login-body .alert-warning {
    background: rgba(245, 158, 11, 0.10);
    color: var(--ink);
}

body.employee-app .alert-info,
body.login-body .alert-info {
    background: rgba(6, 182, 212, 0.08);
    color: var(--ink);
}

/* Utilities usados por templates del JS del cliente */
body.employee-app .text-center,
body.login-body .text-center,
body.primer-ingreso .text-center {
    text-align: center;
}

body.employee-app .py-5,
body.login-body .py-5,
body.primer-ingreso .py-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

body.employee-app .time-expired-message,
body.login-body .time-expired-message,
body.primer-ingreso .time-expired-message {
    animation: none;
    margin: 0 0 12px;
    padding: 10px 12px;
    font-size: 0.85rem;
}

body.employee-app .time-expired-message p {
    margin: 0;
}

body.employee-app .mt-3,
body.login-body .mt-3,
body.primer-ingreso .mt-3 { margin-top: 1rem; }

body.employee-app .mb-3,
body.login-body .mb-3,
body.primer-ingreso .mb-3 { margin-bottom: 1rem; }

body.employee-app .text-muted,
body.login-body .text-muted,
body.primer-ingreso .text-muted { color: var(--ink-soft); }

/* ---------- Login ---------- */
body.login-body,
body.login-body *,
body.login-body *::before,
body.login-body *::after {
    box-sizing: border-box;
}

body.login-body {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    padding: 0;
    background: var(--navy-900);
    width: 100%;
    max-width: 100vw;
}

body.login-body .login-shell,
body.login-body .login-container {
    width: 100%;
    max-width: var(--app-width);
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    overflow: hidden;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse 130% 80% at 50% -5%, rgba(37, 162, 68, 0.28), transparent 52%),
        radial-gradient(ellipse 90% 50% at 80% 100%, rgba(11, 35, 65, 0.9), transparent 60%),
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.09) 1px, transparent 0),
        var(--navy-900);
    background-size: auto, auto, 18px 18px, auto;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding:
        calc(20px + env(safe-area-inset-top, 0px))
        max(16px, env(safe-area-inset-right, 0px))
        calc(20px + env(safe-area-inset-bottom, 0px))
        max(16px, env(safe-area-inset-left, 0px));
}

@media (max-width: 480px) {
    body.login-body .login-shell,
    body.login-body .login-container {
        border-left: 0;
        border-right: 0;
    }
}

body.login-body .login-compose {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.login-body .login-top {
    flex-shrink: 0;
    background: transparent;
    border-bottom: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

body.login-body .login-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

body.login-body .login-kicker {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--emerald-500);
}

body.login-body .login-brand-name {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    word-wrap: break-word;
}

body.login-body .login-brand-tag {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.85rem;
    line-height: 1.35;
    max-width: 28ch;
}

body.login-body .login-main {
    flex: 0 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    display: block;
    padding: 0;
    overflow: visible;
}

body.login-body .login-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.35),
        0 2px 0 rgba(255, 255, 255, 0.8) inset;
    backdrop-filter: blur(14px);
    padding: 26px 18px 22px;
}

body.login-body .login-header {
    text-align: left;
    padding: 0 0 16px;
    background: none;
    min-width: 0;
}

body.login-body .login-header .logo,
body.login-body .login-header .logo i {
    display: none;
}

body.login-body .login-header h1 {
    font-family: var(--font-ui);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

body.login-body .login-header p {
    color: var(--ink-soft);
    font-size: 0.88rem;
    margin: 0;
    line-height: 1.4;
}

body.login-body .login-form {
    padding: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

body.login-body .form-group {
    margin-bottom: 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

body.login-body .form-group label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

body.login-body .form-group label i {
    display: none;
}

body.login-body .login-form input {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid rgba(7, 22, 43, 0.14);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-size: 1.05rem;
    box-shadow: inset 0 1px 2px rgba(7, 22, 43, 0.04);
}

body.login-body .login-form input:focus {
    outline: none;
    border-color: rgba(27, 138, 53, 0.55);
    box-shadow: 0 0 0 3px rgba(37, 162, 68, 0.15);
}

body.login-body #codigo_otp {
    letter-spacing: 0.28em;
    font-family: var(--font-ui);
    font-size: 1.4rem;
    text-align: center;
}

body.login-body .btn-primary,
body.login-body .btn-secondary,
body.login-body .btn-full {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 48px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: none;
    cursor: pointer;
}

body.login-body .btn-primary {
    background: linear-gradient(180deg, var(--emerald-500), var(--emerald-600));
    border: 1px solid var(--emerald-700);
    color: var(--accent-ink);
    box-shadow: 0 8px 18px rgba(27, 138, 53, 0.28);
}

body.login-body .btn-primary:hover {
    background: var(--emerald-700);
}

body.login-body .btn-secondary {
    background: rgba(7, 22, 43, 0.03);
    border: 1px solid rgba(7, 22, 43, 0.14);
    color: var(--ink);
    margin-top: 8px;
}

body.login-body .login-role-title {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 650;
    color: var(--ink);
    text-align: left;
    margin: 0 0 12px;
}

body.login-body .login-role-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

body.login-body .login-role-actions .btn-primary,
body.login-body .login-role-actions .btn-secondary {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
    margin-top: 0;
    min-height: 48px;
    font-size: 0.72rem;
    box-shadow: none;
    padding-left: 8px;
    padding-right: 8px;
}

body.login-body .login-role-actions .btn-primary {
    box-shadow: 0 6px 14px rgba(27, 138, 53, 0.22);
}

body.login-body .login-text-link {
    display: inline-block;
    width: auto;
    max-width: 100%;
    min-height: 0;
    margin-top: 14px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: underline;
    cursor: pointer;
}

body.login-body .login-otp-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-wrap: wrap;
}

body.login-body .login-otp-actions .login-text-link {
    margin-top: 0;
}

body.login-body .login-alerts {
    position: static;
    transform: none;
    left: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    z-index: 1;
    margin: 0 0 10px;
    overflow-x: hidden;
}

body.login-body .login-alerts:empty {
    display: none;
    margin: 0;
}

body.login-body .login-alerts .alert {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    font-size: 0.82rem;
    border-radius: 10px;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

body.login-body .login-alerts .alert-close {
    background: none;
    border: 0;
    color: inherit;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

body.login-body .login-footer {
    margin: 16px 0 0;
    padding: 12px 0 0;
    border: 0;
    border-top: 1px solid rgba(7, 22, 43, 0.08);
    background: transparent;
    text-align: left;
    font-size: 0.75rem;
    color: var(--ink-soft);
    line-height: 1.4;
    max-width: 100%;
}

body.login-body .login-footer p {
    font-size: 0.75rem;
    color: var(--ink-soft);
    margin: 0;
}

body.login-body .login-footer i {
    display: none;
}

/* Alturas cortas / landscape: compactar sin cortar ni overflow H */
@media (max-height: 700px) {
    body.login-body .login-shell,
    body.login-body .login-container {
        padding-top: calc(12px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    body.login-body .login-compose {
        gap: 12px;
    }

    body.login-body .login-brand-name {
        font-size: 1.45rem;
    }

    body.login-body .login-brand-tag {
        font-size: 0.8rem;
    }

    body.login-body .login-card {
        padding: 18px 16px 16px;
        border-radius: 16px;
    }

    body.login-body .login-header {
        padding-bottom: 12px;
    }

    body.login-body .login-header h1 {
        font-size: 1.1rem;
    }

    body.login-body .form-group {
        margin-bottom: 10px;
    }

    body.login-body .login-form input,
    body.login-body .btn-primary,
    body.login-body .btn-secondary,
    body.login-body .btn-full {
        min-height: 44px;
    }

    body.login-body .login-footer {
        margin-top: 12px;
        padding-top: 10px;
    }
}

/* ---------- Primer ingreso ---------- */
body.primer-ingreso .primer-ingreso-container {
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: var(--paper);
    background-image: radial-gradient(circle at 1px 1px, rgba(7, 22, 43, 0.07) 1px, transparent 0);
    background-size: 16px 16px;
    padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
}

body.primer-ingreso .primer-ingreso-card {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    max-width: var(--app-width);
    width: 100%;
    text-align: left;
}

body.primer-ingreso .warning-icon {
    display: none;
}

body.primer-ingreso .primer-ingreso-title {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 500;
    color: var(--ink);
    margin: 0 0 8px;
}

body.primer-ingreso .primer-ingreso-subtitle,
body.primer-ingreso .user-info,
body.primer-ingreso .security-notice,
body.primer-ingreso .password-requirements {
    background: transparent;
    border: 0;
    border-radius: 0;
    color: var(--ink-soft);
    text-align: left;
    padding: 0;
    margin-bottom: 16px;
}

body.primer-ingreso .user-info {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}

body.primer-ingreso .password-requirements ul {
    margin: 8px 0 0 18px;
    color: var(--ink-soft);
}

body.primer-ingreso .form-group {
    margin-bottom: 14px;
}

body.primer-ingreso .form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

body.primer-ingreso .input-with-icon {
    position: relative;
}

body.primer-ingreso .input-with-icon i {
    display: none;
}

body.primer-ingreso input {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

body.primer-ingreso .btn-primary,
body.primer-ingreso .btn-block,
body.primer-ingreso .btn-secondary {
    width: 100%;
    min-height: 48px;
    border-radius: var(--radius);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
}

body.primer-ingreso .btn-primary {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--accent-ink);
}

body.primer-ingreso .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
}

body.primer-ingreso .mt-3 {
    margin-top: 12px;
}

/* Números del empleado (HTML dinámico) */
body.employee-app #misNumerosContainer,
body.employee-app #historialContainer {
    color: var(--ink);
}

@media (min-width: 481px) {
    body.employee-app .balotas-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    body.employee-app .numbers-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.employee-app .historial-filters,
    body.employee-app .ganadores-filters {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-end;
    }

    body.employee-app .historial-filters .filter-group,
    body.employee-app .ganadores-filters .filter-group {
        flex: 1 1 140px;
    }

    body.employee-app .historial-filters .btn-secondary,
    body.employee-app .ganadores-filters .btn-secondary {
        width: auto;
        flex: 0 0 auto;
        padding: 0 14px;
    }
}
