/* ============================================================
   TAP4TAP — Design System (Dark Dashboard, basado en tablet)
   Fondo:       Dark         #0B0D10 / #0F1217
   Superficie:  Cards dark   #13171E
   Acento:      Orange       #FF8A00
   Texto:       Light        #E7EAF0
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Design Tokens (Dark Dashboard) ── */
:root {
    /* Acento (naranja) */
    --primary:          #FF8A00;
    --primary-dark:     #E46F00;
    --primary-light:    rgba(255, 138, 0, 0.18);
    --primary-alpha-10: rgba(255, 138, 0, 0.10);
    --primary-alpha-15: rgba(255, 138, 0, 0.15);
    --primary-alpha-20: rgba(255, 138, 0, 0.20);

    /* Base dark */
    --bg:               #0B0D10;
    --bg-2:             #0F1217;
    --surface:          #13171E;
    --surface-2:        #171C24;
    --border:           rgba(255, 255, 255, 0.08);
    --border-strong:    rgba(255, 255, 255, 0.12);
    --text:             #E7EAF0;
    --text-2:           rgba(231, 234, 240, 0.70);
    --text-3:           rgba(231, 234, 240, 0.52);
    --nav-pill-bg:      rgba(255, 255, 255, 0.06);

    /* Compat (nombres legacy usados en el CSS existente) */
    --bg-cream:         var(--bg);
    --bg-cream-alt:     var(--bg-2);
    --light-bg:         var(--bg);
    --light-surface:    var(--surface);
    --light-border:     var(--border);
    --light-text:       var(--text);
    --light-text-2:     var(--text-2);

    --bg-dark:          var(--bg);
    --bg-surface:       var(--surface);
    --bg-surface-2:     var(--surface-2);
    --bg-card:          var(--surface);
    --bg-card-hover:    var(--surface-2);

    --text-primary:     var(--text);
    --text-secondary:   var(--text-2);
    --text-muted:       var(--text-3);
    --border-color:     var(--border);
    --border-orange:    rgba(255, 138, 0, 0.34);

    /* Semánticos */
    --success:          #22C55E;
    --warning:          #EAB308;
    --error:            #EF4444;
    --info:             #3B82F6;

    /* Radios (tarjetas más redondeadas tipo Materio) */
    --radius-sm:        6px;
    --radius:           8px;
    --radius-md:        12px;
    --radius-lg:        18px;
    --radius-xl:        20px;
    --radius-full:      9999px;

    /* Sombras (dark) */
    --shadow-card:      0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-sm:        0 6px 18px rgba(0, 0, 0, 0.35);
    --shadow-md:        0 14px 36px rgba(0, 0, 0, 0.45);
    --shadow-lg:        0 22px 60px rgba(0, 0, 0, 0.55);
    --shadow-orange:    0 14px 40px rgba(255, 138, 0, 0.22);

    /* Tipografía */
    --font:             'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono:        'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

    /* Tipografía Materio: métricas grandes, títulos de tarjeta pequeños */
    --text-display:     clamp(1.75rem, 4vw, 2.5rem);
    --text-metric:      clamp(2rem, 5vw, 3rem);
    --text-card-title:  0.875rem;
    --text-card-value:  clamp(1.75rem, 4vw, 2.5rem);

    /* Transición */
    --transition:       all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:  all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Body base ── */
body {
    font-family: var(--font);
    background: radial-gradient(1200px 800px at 20% 0%,
        rgba(255, 138, 0, 0.10) 0%,
        transparent 55%),
      radial-gradient(900px 700px at 85% 15%,
        rgba(255, 255, 255, 0.05) 0%,
        transparent 55%),
      linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 60%);
    min-height: 100vh;
    color: var(--light-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

:focus-visible {
    outline: 3px solid rgba(255, 138, 0, 0.35);
    outline-offset: 2px;
}

/* ── Pantallas (una sola visible) ── */
.screen {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    z-index: 1;
}

.screen.active { display: block; }

.screen:not(.active) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}


/* ══════════════════════════════════════════════════════════
   MÓDULO 1 — AUTH: Login y Registro
   ══════════════════════════════════════════════════════════ */

#adminLoginScreen,
#loginScreen,
#registerScreen {
    background: var(--light-bg);
    display: none;
    align-items: center;
    justify-content: center;
}

#adminLoginScreen.active,
#loginScreen.active,
#registerScreen.active {
    display: flex;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    padding: 48px 40px 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.auth-logo-mark {
    width: 40px;
    height: 40px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.05em;
    flex-shrink: 0;
}

.auth-logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--light-text);
    letter-spacing: -0.04em;
}

.auth-container h1 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--light-text);
    letter-spacing: -0.04em;
    margin-bottom: 6px;
}

.auth-container h2 {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-2);
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-2);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 15px;
    font-family: var(--font);
    transition: var(--transition);
    outline: none;
    appearance: none;
}

.form-group textarea {
    height: auto;
    padding: 12px 14px;
    resize: vertical;
}

.form-group input::placeholder { color: var(--light-text-2); }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.22);
}

.form-group input:disabled,
.form-group select:disabled {
    background: var(--light-bg);
    color: var(--light-text-2);
    cursor: not-allowed;
}

/* Botones auth */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    padding: 0 20px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.01em;
    text-decoration: none;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: var(--shadow-orange);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-2);
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.auth-switch a:hover { text-decoration: underline; }

.error-message {
    font-size: 13px;
    color: var(--error);
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.10);
    border-radius: var(--radius);
    border: 1px solid rgba(239, 68, 68, 0.28);
    display: none;
}

.error-message.show { display: block; }


/* ══════════════════════════════════════════════════════════
   MÓDULO 2 — DASHBOARD WEB (pantalla mis máquinas)
   ══════════════════════════════════════════════════════════ */

#dashboardScreen {
    background: transparent;
}

/* Header (Materio: limpio, sin borde duro) */
.header {
    background: rgba(19, 23, 30, 0.72);
    border-bottom: none;
    box-shadow: var(--shadow-sm);
    padding: 0 40px;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo-mark {
    width: 34px;
    height: 34px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 13px;
    color: #fff;
    letter-spacing: -0.04em;
    flex-shrink: 0;
}

.header h1 {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--light-text);
    letter-spacing: -0.03em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
}

/* Content */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 40px;
}

.main-content h2 {
    font-size: var(--text-display);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.04em;
    margin-bottom: 24px;
}

/* Device cards grid (Materio: tarjetas blancas, sombra sutil, sin borde) */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.device-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition-slow);
    box-shadow: var(--shadow-card);
    position: relative;
    backdrop-filter: blur(10px);
}

.device-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.device-card::after {
    content: '';
    position: absolute;
    top: 16px;
    right: 16px;
    width: 18px;
    height: 18px;
    opacity: 0.35;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14'/%3E%3C/svg%3E") center/contain no-repeat;
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.device-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.device-status {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.status-pending  { background: rgba(234,179,8,0.15);  color: #92400E; }
.status-active   { background: rgba(34,197,94,0.12);  color: #166534; }
.status-offline  { background: rgba(107,114,128,0.12); color: var(--light-text-2); }
.status-error    { background: rgba(239,68,68,0.12);  color: #991B1B; }

.device-info {
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.6;
    margin-top: 12px;
}

.device-id {
    display: inline-block;
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: rgba(255, 196, 120, 0.95);
    margin-top: 8px;
}

.devices-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
}
.devices-empty-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.devices-empty-sub {
    font-size: 0.95rem;
    color: var(--text-2);
}


/* ══════════════════════════════════════════════════════════
   MÓDULO 3 — MODAL
   ══════════════════════════════════════════════════════════ */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(6px);
    overflow: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
}

.modal-content {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    padding: 36px;
    border-radius: var(--radius-xl);
    max-width: 560px;
    width: calc(100% - 32px);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
}

.modal-content.large { max-width: 880px; }

.close {
    position: absolute;
    right: 18px;
    top: 18px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-2);
    cursor: pointer;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    transition: var(--transition);
    line-height: 1;
}

.close:hover {
    color: var(--text);
    background: rgba(255,255,255,0.10);
}

.modal-content h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--light-text);
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.modal-content h3 {
    font-size: var(--text-card-title);
    font-weight: 600;
    color: var(--text-2);
    margin: 20px 0 12px;
}

.qr-section, .manual-section { margin: 20px 0; }

.divider {
    text-align: center;
    margin: 28px 0;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: var(--border);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

#qrScanner { text-align: center; }
#qrVideo {
    width: 100%;
    max-width: 380px;
    border-radius: var(--radius-md);
    margin: 16px 0;
}

#qrResult {
    margin-top: 12px;
    padding: 10px;
    background: rgba(0,0,0,0.20);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 28px;
    font-size: 13px;
}

/* Device details modal */
.device-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.device-details-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--light-text);
    letter-spacing: -0.03em;
}

.taps-section { margin: 24px 0; }

.taps-section h3,
.stats-section h3,
.transactions-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--light-text);
    margin-bottom: 14px;
}

.tap-item {
    background: rgba(0, 0, 0, 0.20);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

/* Webapp cliente: taps con visual de barril tipo TapBrains */
.portal-taps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.portal-tap-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--surface);
}
.portal-tap-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.portal-tap-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
}
.portal-tap-beer {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.portal-tap-badge {
    font-size: 0.68rem;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 700;
}
.portal-tap-badge.on {
    background: rgba(34, 197, 94, 0.16);
    color: #86efac;
}
.portal-tap-badge.off {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}
.portal-tap-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-2);
    margin-top: 8px;
}

.portal-tap-card--compact {
    padding: 10px;
}
.portal-tap-card--compact .portal-tap-beer {
    font-size: 0.88rem;
}

/* Cliente: agrupación por congelador (misma lógica que admin local, datos del backup) */
.portal-freezers-stack {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    align-items: start;
}
@media (max-width: 900px) {
    .portal-freezers-stack {
        grid-template-columns: 1fr;
    }
}
.portal-freezer-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: var(--surface);
    min-width: 0;
}
.portal-freezer-head {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.portal-freezer-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
}
.portal-freezer-live-temp {
    font-weight: 600;
    color: var(--text-2);
    font-size: 0.88rem;
}
.portal-freezer-chart-wrap {
    position: relative;
    height: 140px;
    margin: 0 0 10px 0;
}
.portal-freezer-inner-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}
@media (max-width: 520px) {
    .portal-freezer-inner-grid {
        grid-template-columns: 1fr;
    }
}

.portal-device-detail-head {
    margin-bottom: 14px;
}
.portal-device-detail-head .device-details-name {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}
.portal-device-detail-freezers {
    min-width: 0;
}

.tap-id {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.tap-state {
    margin-top: 4px;
    font-size: 13px;
    color: var(--light-text-2);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.stat-card {
    background: rgba(0, 0, 0, 0.20);
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: var(--text-card-value);
    font-weight: 800;
    color: var(--light-text);
    letter-spacing: -0.04em;
}

.stat-label {
    color: var(--light-text-2);
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Transactions table */
.transactions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 13px;
}

.transactions-table th,
.transactions-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.transactions-table th {
    background: rgba(255,255,255,0.04);
    font-weight: 700;
    font-size: 11px;
    color: var(--light-text-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.transactions-table tr:hover td { background: rgba(255,255,255,0.04); }

.sales-history-section {
    margin-top: 2.75rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.sales-history-heading {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
}
.sales-history-intro {
    margin: 0 0 1.25rem;
    color: var(--light-text-2);
    font-size: 0.92rem;
    max-width: 42rem;
}
.sales-history-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}
.sales-filter-field label {
    display: block;
    font-size: 0.8rem;
    color: var(--light-text-2);
    margin-bottom: 0.35rem;
}
.sales-filter-select,
.sales-filter-input {
    min-width: 10rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
}
.sales-filter-apply { align-self: flex-end; }
.sales-history-status {
    font-size: 0.88rem;
    color: var(--light-text-2);
    margin-bottom: 0.5rem;
    min-height: 1.25em;
}
.sales-history-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}
.sales-history-pager button {
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}
.sales-history-pager button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.tx-cell-mono {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.device-sales-link {
    margin-top: 1rem;
}


/* ══════════════════════════════════════════════════════════
   MÓDULO 4 — WELCOME SCREEN (splash)
   ══════════════════════════════════════════════════════════ */

.welcome-screen {
    background: radial-gradient(1100px 750px at 50% 20%,
        rgba(255, 138, 0, 0.14) 0%,
        transparent 55%),
      linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 70%);
    position: relative;
    overflow: hidden;
}

/* Solo cuando está activa: flex centrado (evita display:flex !important pisando .screen:not(.active) en algunos WebKit) */
.welcome-screen.screen.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.welcome-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 40%,
        rgba(255, 138, 0, 0.10) 0%,
        transparent 70%);
    pointer-events: none;
}

.welcome-container {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 24px;
}

.welcome-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.05em;
    box-shadow: 0 18px 60px rgba(255, 138, 0, 0.26);
}

.welcome-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 900;
    color: var(--light-text);
    letter-spacing: -0.05em;
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--light-text-2);
    font-weight: 400;
    margin-bottom: 48px;
}

.welcome-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.welcome-loading p:empty { display: none; }

.welcome-loading p {
    font-size: 14px;
    color: var(--light-text-2);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 138, 0, 0.25);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }


/* ══════════════════════════════════════════════════════════
   MÓDULO 5 — ADMIN SCREEN (sidebar + secciones)
   ══════════════════════════════════════════════════════════ */

.admin-screen {
    background: transparent;
    display: flex;
    overflow: hidden;
}

.admin-layout {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}

/* ─ Sidebar (Materio: gris muy claro, íconos) ─ */
.admin-sidebar {
    width: 260px;
    background: rgba(19, 23, 30, 0.78);
    border-right: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.admin-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: var(--border);
    pointer-events: none;
}

.sidebar-header {
    padding: 28px 20px 24px;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 13px;
    color: #fff;
    letter-spacing: -0.04em;
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--light-text);
    letter-spacing: -0.04em;
}

/* ─ Navegación ─ */
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.nav-item {
    width: calc(100% - 16px);
    margin: 2px 8px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    text-align: left;
    border-radius: var(--radius);
    line-height: 1.4;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.nav-item.active {
    background: rgba(255, 138, 0, 0.10);
    color: var(--text);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(255, 138, 0, 0.25);
}

.nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-label { flex: 1; }

/* Footer del sidebar */
.sidebar-footer {
    padding: 16px;
    border-top: none;
}

.device-info {
    background: rgba(255,255,255,0.04);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.device-id-label {
    font-size: 10px;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 5px;
}

.device-id-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(255, 196, 120, 0.95);
    word-break: break-all;
}

/* ─ Main content (Materio: fondo cream, tarjetas blancas) ─ */
.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
    background: transparent;
    overflow-y: auto;
}

.admin-section { display: none; }
.admin-section.active { display: block; }

.section-title {
    font-size: var(--text-display);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 24px;
    letter-spacing: -0.04em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: var(--radius-full);
    margin-bottom: 2px;
}

.section-content {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(10px);
}

/* ─ Cards en admin (Materio) ─ */
.card {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: var(--transition-slow);
    backdrop-filter: blur(10px);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* ─ Botones en admin ─ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    padding: 0 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: 0.01em;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: var(--shadow-orange);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.30);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.20);
}

.btn.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.40;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ─ Form group en admin ─ */
.admin-screen .form-group label {
    color: var(--text-2);
    font-size: 13px;
}

.admin-screen .form-group input,
.admin-screen .form-group select,
.admin-screen .form-group textarea {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border);
    color: var(--text);
}

.admin-screen .form-group input::placeholder { color: var(--text-muted); }

.admin-screen .form-group input:focus,
.admin-screen .form-group select:focus,
.admin-screen .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.22);
}

/* ─ Tabla admin ─ */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    color: var(--text-2);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255,255,255,0.04);
}

.admin-table td { color: var(--text); }

.admin-table tr:hover td {
    background: rgba(255, 138, 0, 0.08);
}

.admin-table .actions-cell {
    white-space: nowrap;
}
.admin-table .valve-toggle-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
    vertical-align: middle;
}
.admin-table .valve-label {
    font-size: 12px;
    color: var(--text-secondary);
}
.admin-table .valve-off {
    color: var(--text-muted);
    font-size: 13px;
}

/* ─ Streams (admin): tabla de sensores por streamer ─ */
.streams-table-wrap {
    padding: 0;
    overflow: hidden;
}
.streams-sensors-table {
    min-width: 640px;
    font-size: 13px;
}
.streams-sensors-table th,
.streams-sensors-table td {
    white-space: nowrap;
    vertical-align: middle;
}
.streams-sensors-table .streams-num-cell {
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    text-align: right;
}
.streams-sensors-table th.streams-taps-col,
.streams-sensors-table td.streams-taps-col {
    text-align: center;
}
.streams-sensors-table .streams-extra-cell {
    max-width: 220px;
    white-space: normal;
    word-break: break-word;
}
.streams-id-code {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(255, 138, 0, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
}
.streams-extra-json {
    font-size: 11px;
    color: var(--text-secondary);
    word-break: break-all;
}
.streams-extra-empty {
    color: var(--text-muted);
}
.streams-badge-ok,
.streams-badge-warn,
.streams-badge-off {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    border-radius: 6px;
}
.streams-badge-ok {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}
.streams-badge-warn {
    background: rgba(234, 179, 8, 0.18);
    color: #facc15;
}
.streams-badge-off {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

/* ─ Toggle switch ─ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--light-border);
    border-radius: 24px;
    transition: background 200ms ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 200ms ease, background 200ms ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: #fff;
}

/* ─ Grillas ─ */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Barriles: máximo 4 tarjetas por fila, ancho fijo sin estirarse */
.barrel-cards-grid {
    grid-template-columns: repeat(4, minmax(240px, 280px));
    justify-content: start;
    gap: 16px;
}

@media (max-width: 1320px) {
    .barrel-cards-grid {
        grid-template-columns: repeat(3, minmax(240px, 280px));
    }
}

@media (max-width: 1024px) {
    .barrel-cards-grid {
        grid-template-columns: repeat(2, minmax(240px, 280px));
    }
}

@media (max-width: 640px) {
    .barrel-cards-grid {
        grid-template-columns: minmax(240px, 1fr);
    }
}

/* ─ Visual de barril (módulo Barriles) ─ */
.barrel-visual {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin: 10px 0 14px;
}

.barrel-shell {
    position: relative;
    width: 88px;
    height: 128px;
    border: 2px solid var(--border-orange);
    border-radius: 18px 18px 14px 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(0,0,0,0.08));
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 138, 0, 0.22);
}

.barrel-shell::before,
.barrel-shell::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 138, 0, 0.32);
    z-index: 2;
}

.barrel-shell::before { top: 28px; }
.barrel-shell::after { top: 58px; }

.barrel-fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 0%;
    background: linear-gradient(180deg, #FCD34D 0%, #F59E0B 50%, #D97706 100%);
    transition: height 260ms ease;
}

.barrel-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.barrel-percent {
    font-size: var(--text-card-value);
    font-weight: 800;
    line-height: 1;
    color: var(--light-text);
    letter-spacing: -0.04em;
}

.barrel-caption {
    font-size: var(--text-card-title);
    color: var(--light-text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ─ Barriles (admin): congelador agrupado + subtarjetas compactas ─ */
/* Dos congeladores por fila (cada unidad = 2 barriles); una columna en móvil. */
#section-barrel-change .barrel-freezers-stack {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    align-items: start;
}
@media (max-width: 900px) {
    #section-barrel-change .barrel-freezers-stack {
        grid-template-columns: 1fr;
    }
}
#section-barrel-change .barrel-freezer-card {
    padding: 0.65rem 0.85rem;
    min-width: 0;
}
#section-barrel-change .barrel-freezer-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 14px;
    margin-bottom: 0.55rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border);
}
#section-barrel-change .barrel-freezer-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
}
#section-barrel-change .barrel-freezer-temp {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
}
#section-barrel-change .barrel-freezer-temp-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-right: 6px;
}
#section-barrel-change .barrel-freezer-inner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
#section-barrel-change .barrel-tap-card {
    padding: 0.5rem 0.65rem;
}
#section-barrel-change .barrel-tap-card-title {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.25;
}
#section-barrel-change .barrel-tap-meta {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.3;
}
#section-barrel-change .barrel-tap-card .barrel-visual {
    gap: 8px;
    margin: 6px 0 8px;
}
#section-barrel-change .barrel-tap-card .barrel-shell {
    width: 56px;
    height: 82px;
    border-radius: 12px 12px 10px 10px;
}
#section-barrel-change .barrel-tap-card .barrel-shell::before { top: 18px; }
#section-barrel-change .barrel-tap-card .barrel-shell::after { top: 38px; }
#section-barrel-change .barrel-tap-card .barrel-percent {
    font-size: 1.1rem;
}
#section-barrel-change .barrel-tap-card .barrel-caption {
    font-size: 0.62rem;
}
#section-barrel-change .barrel-tap-field label {
    font-size: 0.72rem;
}
#section-barrel-change .barrel-tap-volume {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0.15rem 0 0;
    line-height: 1.2;
}
#section-barrel-change .barrel-tap-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}


/* ══════════════════════════════════════════════════════════
   MÓDULO 6 — SETUP SCREEN (wizard mini PC)
   ══════════════════════════════════════════════════════════ */

.setup-screen {
    background: transparent;
    display: block;
    padding: clamp(20px, 4vw, 48px);
    overflow-y: auto;
    position: relative;
}

.setup-screen::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 60% 40% at 50% 0%,
        rgba(255, 138, 0, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.setup-container {
    max-width: min(95vw, 700px);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.setup-title {
    text-align: center;
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 900;
    color: var(--light-text);
    margin-bottom: clamp(20px, 4vw, 36px);
    letter-spacing: -0.04em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.setup-title-badge {
    width: 36px;
    height: 36px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 900;
    color: #fff;
    flex-shrink: 0;
}

.setup-content {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border-radius: var(--radius-lg);
    padding: clamp(24px, 5vw, 36px);
    margin-bottom: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(10px);
}

.setup-content h2 {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 800;
    color: var(--light-text);
    margin-bottom: 12px;
    letter-spacing: -0.03em;
}

.setup-content p {
    color: var(--text-2);
    margin-bottom: 20px;
    line-height: 1.65;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.setup-content .form-group {
    margin-bottom: 16px;
}

.setup-content label {
    display: block;
    color: var(--text-2);
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.01em;
}

.setup-content input[type="text"],
.setup-content input[type="number"],
.setup-content input[type="date"],
.setup-content input[type="time"] {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    font-size: 15px;
    font-family: var(--font);
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: var(--transition);
    outline: none;
    appearance: none;
}

.setup-content input[type="text"]:focus,
.setup-content input[type="number"]:focus,
.setup-content input[type="date"]:focus,
.setup-content input[type="time"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.22);
}

.setup-content input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Botones del wizard */
.setup-content .btn-setup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 20px;
    margin: 6px 6px 0 0;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--primary);
    color: #fff;
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.setup-content .btn-setup:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: var(--shadow-orange);
    transform: translateY(-1px);
}

.setup-content .btn-setup:active:not(:disabled) {
    transform: translateY(0);
}

.setup-content .btn-setup.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
}

.setup-content .btn-setup.secondary:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-alpha-10);
    box-shadow: none;
}

.setup-content .btn-setup:disabled {
    opacity: 0.40;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Peso display en setup */
.setup-content .weight-display {
    font-size: clamp(2.5rem, 7vw, 4rem);
    font-weight: 900;
    color: var(--primary);
    margin: 16px 0;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
}

/* Listas en setup */
.setup-content .streamer-list,
.setup-content .tap-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.setup-content .streamer-list li,
.setup-content .tap-list li {
    padding: 13px 16px;
    background: rgba(0, 0, 0, 0.20);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-2);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.setup-content .streamer-list li:hover,
.setup-content .tap-list li:hover {
    background: rgba(255, 138, 0, 0.08);
}

/* Tap row en wizard */
.setup-content .tap-row {
    display: grid;
    grid-template-columns: 2fr 120px 1fr;
    gap: clamp(8px, 2vw, 16px);
    align-items: end;
    margin-bottom: 14px;
}

/* Error en setup */
.setup-error {
    color: var(--error);
    min-height: 1.4em;
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.08);
    border-radius: var(--radius);
    border: 1px solid rgba(239, 68, 68, 0.25);
    font-size: 14px;
}

.setup-content code {
    background: var(--nav-pill-bg);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    color: var(--primary-dark);
    font-size: 0.88em;
    word-break: break-all;
}


/* ══════════════════════════════════════════════════════════
   MÓDULO 7 — KIOSK SCREEN (POS / modo venta) — FULL SCREEN
   ══════════════════════════════════════════════════════════ */

.kiosk-screen {
    background: var(--bg);
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    overflow: hidden;
    box-sizing: border-box;
    z-index: 100;
}

.kiosk-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 50% at 50% 50%,
        rgba(255, 138, 0, 0.08) 0%,
        transparent 70%);
    pointer-events: none;
}

.kiosk-container {
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    text-align: center;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}

.kiosk-content {
    color: var(--light-text);
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    box-sizing: border-box;
}

/* Área de tarjetas: ocupa todo el espacio menos el banner */
.kiosk-cards-area {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: stretch;
}

.kiosk-content.kiosk-layout-single .kiosk-cards-area {
    display: flex;
}
.kiosk-content.kiosk-layout-single .kiosk-panel {
    flex: 1;
    width: 100%;
    min-width: 0;
}

/* 2 taps: dos paneles 50% cada uno */
.kiosk-content.kiosk-layout-split .kiosk-panel {
    flex: 1;
    width: 50%;
    min-width: 0;
    display: flex;
    padding: 0;
    border-right: 1px solid rgba(0,0,0,0.08);
    box-sizing: border-box;
}
.kiosk-content.kiosk-layout-split .kiosk-panel:nth-child(2) {
    border-right: none;
}

/* TAP_SELECT con 3+ opciones (lector compartido entre tapracks / todos los taps) */
.kiosk-content.kiosk-layout-multi-tap-select .kiosk-cards-area {
    display: flex;
    justify-content: center;
    overflow-y: auto;
    padding: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.kiosk-tap-select-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    width: 100%;
    max-width: 52rem;
    align-content: start;
}

.kiosk-content.kiosk-layout-multi-tap-select .kiosk-panel--tap-pick {
    min-height: 0;
    padding: 0;
    display: flex;
    border-right: none;
}

.kiosk-content.kiosk-layout-multi-tap-select .kiosk-beer-tile {
    min-height: 150px;
}

/* Tarjeta de cerveza: ocupa toda su mitad, imagen de fondo, nombre arriba, specs centro, precio abajo-derecha */
.kiosk-beer-tile {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    padding: clamp(20px, 4vw, 40px);
    box-sizing: border-box;
    background-color: #1a1a1a;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.kiosk-beer-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.5) 0%,
        rgba(0,0,0,0.15) 25%,
        rgba(0,0,0,0.1) 50%,
        rgba(0,0,0,0.4) 100%);
    pointer-events: none;
}
.kiosk-beer-tile button,
.kiosk-beer-tile .kiosk-tile-name,
.kiosk-beer-tile .kiosk-tile-specs,
.kiosk-beer-tile .kiosk-tile-price {
    position: relative;
    z-index: 1;
}
/* Fondito para que nombre, especificaciones y precio no se pierdan sobre la imagen */
.kiosk-tile-name {
    font-size: clamp(1.5rem, 4.5vw, 3rem);
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    line-height: 1.15;
    margin: 0;
    text-align: left;
    padding: 0.2em 0.45em 0.25em;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.48);
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
}
.kiosk-tile-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 1em;
    font-size: clamp(0.85rem, 2.2vw, 1.15rem);
    color: rgba(255,255,255,0.98);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    margin: auto 0;
    padding: 0.4em 0.5em;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.42);
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
}
.kiosk-tile-price {
    font-size: clamp(1.75rem, 5vw, 3.5rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    text-align: right;
    margin: 0;
    margin-top: auto;
    padding: 0.15em 0.4em 0.2em;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    display: inline-block;
    align-self: flex-end;
}
.kiosk-beer-tile.kiosk-beer-tile-select {
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}
button.kiosk-beer-tile.kiosk-beer-tile-select {
    appearance: none;
    border: none;
    font: inherit;
    text-align: left;
}
.kiosk-beer-tile.kiosk-beer-tile-select:hover {
    box-shadow: inset 0 0 0 4px rgba(255,193,7,0.5);
}
.kiosk-beer-tile.kiosk-beer-tile-select:active {
    box-shadow: inset 0 0 0 4px rgba(255,193,7,0.7);
}

/* Banner inferior: ancho completo, hora + mensaje al cliente */
/* Por defecto: fondo claro → texto oscuro */
.kiosk-banner {
    flex-shrink: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: clamp(12px, 2.5vw, 20px) clamp(20px, 4vw, 40px);
    background: rgba(245, 240, 232, 0.97);
    border-top: 1px solid rgba(0,0,0,0.1);
    box-sizing: border-box;
    color: #1a1a1a;
}
.kiosk-banner-time {
    font-size: clamp(1.1rem, 3vw, 1.75rem);
    font-weight: 700;
    color: inherit;
    font-variant-numeric: tabular-nums;
}
.kiosk-banner-msg {
    flex: 1;
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 600;
    color: inherit;
}
.kiosk-banner-msg .kiosk-state-indicator {
    display: inline-flex;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Cuando el fondo del kiosk es oscuro: banner oscuro y texto claro */
.kiosk-screen[data-banner-theme="dark"] .kiosk-banner {
    background: rgba(26, 26, 26, 0.96);
    border-top-color: rgba(255,255,255,0.12);
    color: #f5f5f5;
}
.kiosk-screen[data-banner-theme="dark"] .kiosk-banner-time,
.kiosk-screen[data-banner-theme="dark"] .kiosk-banner-msg {
    color: inherit;
}

/* Vista serving: un tap a pantalla completa con animación de ml */
.kiosk-content.kiosk-layout-serving {
    padding: 0;
}
.kiosk-content.kiosk-layout-serving .kiosk-cards-area {
    flex: 1;
    min-height: 0;
}
.kiosk-content.kiosk-layout-serving .kiosk-panel {
    position: relative;
    width: 100%;
    height: 100%;
}
/* Barra de llenado durante servicio (centrada, fondo blur oscuro) */
.kiosk-serving-bar-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: clamp(180px, 36vw, 280px);
    height: clamp(240px, 52vw, 400px);
    z-index: 2;
    padding: 24px;
    box-sizing: border-box;
}
.kiosk-serving-bar-wrap::before {
    content: '';
    position: absolute;
    inset: -24px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: -1;
    border-radius: 24px;
}
.kiosk-serving-bar-markers {
    position: relative;
    width: 4.5rem;
    height: 100%;
    margin-right: 14px;
    pointer-events: none;
}
.kiosk-serving-bar-marker {
    position: absolute;
    right: 0;
    transform: translateY(50%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 0;
    width: 100%;
}
.kiosk-serving-bar-marker::after {
    content: '';
    display: block;
    width: 10px;
    height: 2px;
    margin-left: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1px;
    flex-shrink: 0;
}
.kiosk-serving-bar-marker-label {
    font-size: clamp(0.85rem, 2.2vw, 1.1rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8), 0 0 8px rgba(0,0,0,0.5);
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.35);
}
.kiosk-serving-bar {
    position: relative;
    flex: 1;
    min-width: 56px;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}
.kiosk-serving-bar-fill {
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, rgba(255, 193, 7, 0.98), rgba(251, 191, 36, 0.9));
    border-radius: 12px;
    transition: height 0.15s ease-out;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.3);
}
.kiosk-content.kiosk-layout-serving .kiosk-beer-tile .kiosk-tile-name {
    font-size: clamp(1.25rem, 3.5vw, 2.25rem);
}
.kiosk-content.kiosk-layout-serving .kiosk-beer-tile .kiosk-tile-specs,
.kiosk-content.kiosk-layout-serving .kiosk-beer-tile .kiosk-tile-price {
    opacity: 0.85;
}

/* Overlay de resumen encima de la barra (5 s y vuelve a principal) */
.kiosk-summary-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.kiosk-summary-overlay-enter {
    animation: kioskOverlayIn 0.4s ease-out;
}
.kiosk-summary-card-enter {
    animation: kioskSummaryCardIn 0.45s ease-out 0.05s both;
}
@keyframes kioskOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes kioskSummaryCardIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

/* Transiciones de cambio de vista (evitar cortes bruscos) */
.kiosk-content-enter .kiosk-cards-area {
    animation: kioskContentIn 0.35s ease-out;
}
.kiosk-panel-enter {
    animation: kioskPanelIn 0.4s ease-out;
}
@keyframes kioskContentIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes kioskPanelIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Pantalla de resumen (card dentro del overlay) */
.kiosk-summary-card {
    text-align: center;
    max-width: 420px;
    padding: clamp(2rem, 5vw, 3rem);
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(30, 30, 36, 0.97) 0%, rgba(18, 18, 22, 0.98) 100%);
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.4), 0 24px 56px rgba(0, 0, 0, 0.5);
}
.kiosk-summary-icon {
    font-size: clamp(3.5rem, 12vw, 5.5rem);
    line-height: 1;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}
.kiosk-summary-title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}
.kiosk-summary-beer {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 1.25rem;
}
.kiosk-summary-ml {
    font-size: clamp(2.5rem, 10vw, 5rem);
    font-weight: 900;
    color: #fcd34d;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    margin-bottom: 0.15em;
}
.kiosk-summary-ml-unit {
    font-size: 0.45em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    margin-left: 0.15em;
}
.kiosk-summary-total {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
.kiosk-summary-msg {
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Tarjeta de cerveza (estilo imagen: logo, nombre, precio, desc, PRESIONA) */
.kiosk-beer-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: clamp(12px, 2vw, 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.06);
    min-height: 180px;
}

.kiosk-beer-card-select {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 2px solid transparent;
    font: inherit;
    text-align: center;
}
button.kiosk-beer-card-select {
    appearance: none;
    background: #fff;
    padding: clamp(12px, 2vw, 20px);
    min-height: 180px;
}
.kiosk-beer-card-select:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 28px rgba(0,0,0,0.18);
    border-color: var(--primary);
}
.kiosk-beer-card-select:active {
    transform: scale(0.98);
}
.kiosk-tap-select-title {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    text-align: center;
}

.kiosk-beer-avatar {
    width: clamp(64px, 12vw, 100px);
    height: clamp(64px, 12vw, 100px);
    border-radius: 50%;
    object-fit: contain;
    background: rgba(0,0,0,0.04);
    margin-bottom: 8px;
}

.kiosk-beer-avatar-placeholder {
    width: clamp(64px, 12vw, 100px);
    height: clamp(64px, 12vw, 100px);
    border-radius: 50%;
    background: linear-gradient(135deg, #e5e5e5 0%, #f5f5f5 100%);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #999;
}

.kiosk-beer-name {
    font-size: clamp(0.95rem, 2.2vw, 1.25rem);
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.2;
}

.kiosk-beer-price-main {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.kiosk-beer-desc {
    font-size: clamp(0.7rem, 1.6vw, 0.85rem);
    color: #666;
    margin-bottom: 10px;
    line-height: 1.3;
    flex: 1;
}

.kiosk-beer-cta {
    font-size: clamp(0.8rem, 1.8vw, 1rem);
    font-weight: 700;
    color: var(--primary);
    margin-top: auto;
    padding: 8px 12px;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    background: var(--primary-alpha-10);
}

.kiosk-state-row {
    margin-top: clamp(16px, 3vw, 28px);
    width: 100%;
}

/* Estado indicator */
.kiosk-state-indicator {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    margin: 0 auto clamp(24px, 4vw, 36px);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kiosk-state-indicator::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    opacity: 0.20;
}

.kiosk-state-indicator::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: currentColor;
}

.kiosk-state-indicator.state-idle,
.kiosk-state-indicator.state-tap-select {
    background: var(--nav-pill-bg);
    color: var(--primary);
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.25);
    animation: pulse-idle 2.5s ease-in-out infinite;
}

.kiosk-state-indicator.state-serving {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
    box-shadow: 0 0 32px rgba(34, 197, 94, 0.25);
    animation: pulse-serving 1s ease-in-out infinite;
}

.kiosk-state-indicator.state-stabilizing {
    background: rgba(234, 179, 8, 0.12);
    color: var(--warning);
    box-shadow: 0 0 24px rgba(234, 179, 8, 0.20);
    animation: pulse-serving 0.7s ease-in-out infinite;
}

.kiosk-state-indicator.state-summary {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    box-shadow: 0 0 32px rgba(34, 197, 94, 0.30);
}

@keyframes pulse-idle {
    0%, 100% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.2); }
    50%       { box-shadow: 0 0 36px rgba(245, 158, 11, 0.35); }
}

@keyframes pulse-serving {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.08); }
}

/* Textos kiosk */
.kiosk-content .beer-name {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 900;
    color: var(--light-text);
    margin-bottom: 8px;
    letter-spacing: -0.04em;
}

.kiosk-content .price-display {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--light-text-2);
    margin-bottom: 32px;
    font-weight: 400;
}

.kiosk-content .msg-idle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--light-text-2);
    font-weight: 400;
    margin-top: 8px;
    padding: 16px 24px;
    background: var(--nav-pill-bg);
    border: none;
    border-radius: var(--radius-md);
    display: inline-block;
    box-shadow: var(--shadow-sm);
}

.kiosk-content .msg-serving {
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    color: var(--success);
    margin-bottom: 12px;
    font-weight: 700;
}

.kiosk-content .big-ml {
    font-size: clamp(5rem, 18vw, 9rem);
    font-weight: 900;
    color: var(--primary);
    margin: clamp(8px, 2vw, 24px) 0;
    letter-spacing: -0.06em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.kiosk-content .sub-total {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--light-text);
    margin-bottom: 16px;
    font-weight: 700;
}

.kiosk-content .msg-serve-again {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--light-text-2);
    margin-top: 16px;
    font-weight: 400;
}

.kiosk-content .msg-stabilizing {
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    color: var(--warning);
    font-weight: 700;
}

.kiosk-content .msg-summary {
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    color: var(--success);
    margin-bottom: 12px;
    font-weight: 700;
}

.kiosk-content .msg-back {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-muted);
    margin-top: 16px;
    font-weight: 400;
}

.kiosk-two-taps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(16px, 3vw, 24px);
    margin: 1em 0 1.25em;
}
.kiosk-tap-card {
    background: var(--light-surface);
    border-radius: var(--radius-md);
    padding: clamp(12px, 2vw, 20px);
    border: none;
    box-shadow: var(--shadow-card);
}
.kiosk-tap-name {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    font-weight: 700;
    color: var(--light-text);
}
.kiosk-tap-price {
    font-size: clamp(0.85rem, 2vw, 1rem);
    color: var(--light-text-2);
    margin-top: 0.35em;
}
.kiosk-content .kiosk-taps-label {
    color: var(--light-text-2);
    font-size: clamp(0.8rem, 2vw, 1rem);
    margin-bottom: 0.5em;
}

.kiosk-content .kiosk-status {
    color: var(--light-text-2);
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 400;
}

.kiosk-content .error-backend {
    color: var(--error);
    font-size: clamp(0.95rem, 2vw, 1.2rem);
    background: rgba(239, 68, 68, 0.10);
    padding: 14px 20px;
    border-radius: var(--radius);
    border: 1px solid rgba(239, 68, 68, 0.25);
    display: inline-block;
}

/* Pantalla offline / esperando streamer: diseño destacado con animaciones */
.kiosk-offline-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 2rem;
    box-sizing: border-box;
}
.kiosk-offline {
    text-align: center;
    max-width: 420px;
    padding: clamp(28px, 5vw, 48px);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(30, 30, 35, 0.97) 0%, rgba(20, 20, 24, 0.98) 100%);
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.35), 0 20px 50px rgba(0, 0, 0, 0.5);
}
.kiosk-offline--offline {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4), 0 20px 50px rgba(0, 0, 0, 0.5);
}
.kiosk-offline--waiting {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.45), 0 20px 50px rgba(0, 0, 0, 0.5);
}
.kiosk-offline--table_disabled {
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.5), 0 20px 50px rgba(0, 0, 0, 0.5);
}
.kiosk-offline-icon {
    font-size: clamp(4rem, 12vw, 6rem);
    line-height: 1;
    margin-bottom: 1rem;
    animation: kiosk-offline-pulse-icon 1.8s ease-in-out infinite;
}
.kiosk-offline-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}
.kiosk-offline-msg {
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    margin: 0 0 1.5rem;
}
.kiosk-offline-pulse {
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    font-weight: 600;
    color: rgba(255, 193, 7, 0.95);
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    animation: kiosk-offline-pulse-text 2s ease-in-out infinite;
}
.kiosk-offline--waiting .kiosk-offline-pulse { color: rgba(96, 165, 250, 0.95); }
.kiosk-offline--offline .kiosk-offline-pulse { color: rgba(248, 113, 113, 0.95); }
.kiosk-offline--table_disabled .kiosk-offline-pulse { color: rgba(251, 191, 36, 0.95); }
.kiosk-offline-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: kiosk-offline-blink 1s ease-in-out infinite;
}
@keyframes kiosk-offline-pulse-icon {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.9; }
}
@keyframes kiosk-offline-pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
@keyframes kiosk-offline-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.85); }
}


/* ══════════════════════════════════════════════════════════
   MÓDULO 8 — RESPONSIVE
   ══════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
    .admin-sidebar { width: 220px; }
    .admin-main    { margin-left: 220px; padding: 24px; }
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 64px;
        overflow: hidden;
    }

    .sidebar-header h2,
    .nav-label,
    .sidebar-footer {
        display: none;
    }

    .sidebar-header {
        padding: 20px 14px;
        justify-content: center;
    }

    .nav-item {
        justify-content: center;
        padding: 14px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .nav-item.active {
        border-left: none;
        border-bottom: none;
        background: var(--nav-pill-bg);
    }

    .nav-icon { width: auto; }

    .admin-main {
        margin-left: 64px;
        padding: 20px 16px;
    }

    .section-content { padding: 20px; }

    .setup-content .tap-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .main-content { padding: 24px 20px; }
    .header { padding: 0 20px; }

    .auth-container { padding: 36px 24px 28px; }
}

@media (max-width: 480px) {
    .admin-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto;
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border-color);
    }

    .sidebar-header { display: none; }

    .sidebar-nav {
        flex-direction: row;
        padding: 4px 8px;
        overflow-x: auto;
        gap: 0;
    }

    .nav-item {
        flex-direction: column;
        padding: 8px 10px;
        min-width: 56px;
        font-size: 9px;
        gap: 4px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .nav-item.active {
        border-left: none;
        border-bottom: none;
        background: var(--nav-pill-bg);
    }

    .nav-label {
        display: block;
        font-size: 9px;
        font-weight: 600;
        line-height: 1.2;
        text-align: center;
    }

    .admin-main {
        margin-left: 0;
        margin-bottom: 68px;
        padding: 16px;
    }

    .section-title { font-size: 1.4rem; }

    .kiosk-content {
        padding: 32px 20px;
        border-radius: var(--radius-md);
    }

    .setup-content {
        padding: 20px 16px;
        border-radius: var(--radius-md);
    }

    .setup-content .btn-setup {
        width: 100%;
        margin: 6px 0 0;
    }

    .devices-grid {
        grid-template-columns: 1fr;
    }
}

/* Pantallas muy grandes */
@media (min-width: 1920px) {
    .kiosk-container { max-width: 900px; }
    .kiosk-content   { padding: 80px 100px; }
}

/* Landscape pequeño */
@media (max-width: 1024px) and (orientation: landscape) {
    .kiosk-content {
        padding: clamp(20px, 3vw, 36px);
    }

    .kiosk-content .big-ml {
        font-size: clamp(3.5rem, 10vw, 6rem);
    }
}

/* ============================================================
   REBUILD V2 — Tema tablet (NO KIOSK)
   - Texto base siempre blanco
   - Naranja solo como acento (botones, foco, indicadores)
   - Reconstrucción visual para auth/dashboard/admin/setup/modales
   ============================================================ */

body:not(.kiosk-only-body) {
    --v2-bg-0: #07090d;
    --v2-bg-1: #0b0f16;
    --v2-bg-2: #111722;
    --v2-surface: #121926;
    --v2-surface-2: #171f2d;
    --v2-border: rgba(255, 255, 255, 0.10);
    --v2-text: #f4f7fb;
    --v2-text-soft: rgba(244, 247, 251, 0.72);
    --v2-text-muted: rgba(244, 247, 251, 0.56);
    --v2-accent: #ff8a00;
    --v2-accent-2: #e77000;
    --v2-accent-soft: rgba(255, 138, 0, 0.12);
    background:
      radial-gradient(1000px 700px at 20% -5%, rgba(255,138,0,0.10), transparent 60%),
      radial-gradient(900px 600px at 85% 12%, rgba(110,155,255,0.08), transparent 60%),
      linear-gradient(180deg, var(--v2-bg-1) 0%, var(--v2-bg-0) 70%);
    color: var(--v2-text);
}

body:not(.kiosk-only-body) .screen:not(#kioskScreen) {
    color: var(--v2-text);
}

/* Texto blanco por defecto en módulos no-kiosk */
body:not(.kiosk-only-body) :is(
    #adminLoginScreen, #loginScreen, #registerScreen, #dashboardScreen, .admin-screen, .setup-screen, .modal-content
) :is(h1, h2, h3, h4, p, label, th, td, li, span, div) {
    color: inherit;
}

body:not(.kiosk-only-body) #adminLoginScreen,
body:not(.kiosk-only-body) #loginScreen,
body:not(.kiosk-only-body) #registerScreen,
body:not(.kiosk-only-body) #dashboardScreen,
body:not(.kiosk-only-body) .admin-screen,
body:not(.kiosk-only-body) .setup-screen {
    background: transparent;
}

/* Auth */
body:not(.kiosk-only-body) .auth-container {
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
    border: 1px solid var(--v2-border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(12px);
}
body:not(.kiosk-only-body) .auth-logo-mark,
body:not(.kiosk-only-body) .header-logo-mark,
body:not(.kiosk-only-body) .sidebar-logo,
body:not(.kiosk-only-body) .setup-title-badge,
body:not(.kiosk-only-body) .welcome-logo {
    background: linear-gradient(180deg, var(--v2-accent), var(--v2-accent-2));
}
body:not(.kiosk-only-body) .auth-container h1,
body:not(.kiosk-only-body) .auth-logo-text,
body:not(.kiosk-only-body) .header h1,
body:not(.kiosk-only-body) .section-title,
body:not(.kiosk-only-body) .setup-title,
body:not(.kiosk-only-body) .setup-content h2,
body:not(.kiosk-only-body) .modal-content h2,
body:not(.kiosk-only-body) .device-name,
body:not(.kiosk-only-body) .device-details-name {
    color: var(--v2-text);
}
body:not(.kiosk-only-body) .auth-container h2,
body:not(.kiosk-only-body) .auth-switch,
body:not(.kiosk-only-body) .header-actions span,
body:not(.kiosk-only-body) .setup-content p,
body:not(.kiosk-only-body) .setup-content label,
body:not(.kiosk-only-body) .modal-content h3,
body:not(.kiosk-only-body) .divider,
body:not(.kiosk-only-body) .device-info,
body:not(.kiosk-only-body) .tap-state,
body:not(.kiosk-only-body) .stat-label {
    color: var(--v2-text-soft);
}

/* Inputs/forms */
body:not(.kiosk-only-body) .form-group input,
body:not(.kiosk-only-body) .form-group select,
body:not(.kiosk-only-body) .form-group textarea,
body:not(.kiosk-only-body) .setup-content input[type="text"],
body:not(.kiosk-only-body) .setup-content input[type="number"],
body:not(.kiosk-only-body) .setup-content input[type="date"],
body:not(.kiosk-only-body) .setup-content input[type="time"] {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--v2-border);
    color: var(--v2-text);
}
body:not(.kiosk-only-body) .form-group input::placeholder,
body:not(.kiosk-only-body) .setup-content input::placeholder {
    color: var(--v2-text-muted);
}
body:not(.kiosk-only-body) .form-group input:focus,
body:not(.kiosk-only-body) .form-group select:focus,
body:not(.kiosk-only-body) .form-group textarea:focus,
body:not(.kiosk-only-body) .setup-content input:focus {
    border-color: var(--v2-accent);
    box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.22);
}

/* Buttons: naranja como acento, texto blanco */
body:not(.kiosk-only-body) .btn-primary,
body:not(.kiosk-only-body) .btn.btn-primary,
body:not(.kiosk-only-body) .setup-content .btn-setup:not(.secondary) {
    background: linear-gradient(180deg, var(--v2-accent), var(--v2-accent-2));
    color: #fff;
}
body:not(.kiosk-only-body) .btn-secondary,
body:not(.kiosk-only-body) .btn.btn-secondary,
body:not(.kiosk-only-body) .setup-content .btn-setup.secondary {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--v2-border);
    color: var(--v2-text);
}
body:not(.kiosk-only-body) .btn-secondary:hover,
body:not(.kiosk-only-body) .btn.btn-secondary:hover,
body:not(.kiosk-only-body) .setup-content .btn-setup.secondary:hover {
    background: var(--v2-accent-soft);
    border-color: rgba(255, 138, 0, 0.40);
}

/* Dashboard */
body:not(.kiosk-only-body) .header {
    background: rgba(18, 24, 36, 0.75);
    border-bottom: 1px solid var(--v2-border);
    backdrop-filter: blur(12px);
}
body:not(.kiosk-only-body) .device-card,
body:not(.kiosk-only-body) .section-content,
body:not(.kiosk-only-body) .card,
body:not(.kiosk-only-body) .modal-content,
body:not(.kiosk-only-body) .setup-content {
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.035));
    border: 1px solid var(--v2-border);
    box-shadow: 0 18px 48px rgba(0,0,0,0.45);
    backdrop-filter: blur(12px);
}
body:not(.kiosk-only-body) .device-id,
body:not(.kiosk-only-body) .tap-item,
body:not(.kiosk-only-body) .stat-card,
body:not(.kiosk-only-body) #qrResult,
body:not(.kiosk-only-body) .setup-content .streamer-list li,
body:not(.kiosk-only-body) .setup-content .tap-list li {
    background: rgba(0,0,0,0.24);
    border: 1px solid var(--v2-border);
    color: var(--v2-text);
}

/* Admin sidebar */
body:not(.kiosk-only-body) .admin-sidebar {
    background: rgba(14, 20, 32, 0.78);
    backdrop-filter: blur(12px);
}
body:not(.kiosk-only-body) .admin-sidebar::after {
    background: var(--v2-border);
}
body:not(.kiosk-only-body) .nav-item {
    color: var(--v2-text-soft);
}
body:not(.kiosk-only-body) .nav-item:hover {
    color: var(--v2-text);
    background: rgba(255, 255, 255, 0.06);
}
body:not(.kiosk-only-body) .nav-item.active {
    color: var(--v2-text);
    background: rgba(255, 138, 0, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 138, 0, 0.35);
}

/* Tables */
body:not(.kiosk-only-body) .admin-table th,
body:not(.kiosk-only-body) .transactions-table th {
    background: rgba(255,255,255,0.05);
    color: var(--v2-text-soft);
}
body:not(.kiosk-only-body) .admin-table td,
body:not(.kiosk-only-body) .transactions-table td {
    color: var(--v2-text);
}
body:not(.kiosk-only-body) .admin-table th,
body:not(.kiosk-only-body) .admin-table td,
body:not(.kiosk-only-body) .transactions-table th,
body:not(.kiosk-only-body) .transactions-table td {
    border-bottom: 1px solid var(--v2-border);
}
body:not(.kiosk-only-body) .admin-table tr:hover td,
body:not(.kiosk-only-body) .transactions-table tr:hover td {
    background: rgba(255, 138, 0, 0.08);
}

/* Welcome + setup visual coherence */
body:not(.kiosk-only-body) .welcome-screen {
    background:
      radial-gradient(1000px 700px at 50% 15%, rgba(255,138,0,0.13), transparent 60%),
      linear-gradient(180deg, var(--v2-bg-2), var(--v2-bg-0) 72%);
}
body:not(.kiosk-only-body) .welcome-screen::before {
    background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(255,138,0,0.10), transparent 70%);
}
body:not(.kiosk-only-body) .welcome-subtitle,
body:not(.kiosk-only-body) .welcome-loading p {
    color: var(--v2-text-soft);
}
body:not(.kiosk-only-body) .spinner {
    border: 3px solid rgba(255,138,0,0.22);
    border-top-color: var(--v2-accent);
}

/* Requisito: evitar texto naranja en general */
body:not(.kiosk-only-body) .section-title::after,
body:not(.kiosk-only-body) .btn-primary,
body:not(.kiosk-only-body) .btn.btn-primary,
body:not(.kiosk-only-body) .setup-content .btn-setup:not(.secondary),
body:not(.kiosk-only-body) .auth-logo-mark,
body:not(.kiosk-only-body) .header-logo-mark,
body:not(.kiosk-only-body) .sidebar-logo,
body:not(.kiosk-only-body) .setup-title-badge {
    color: #fff;
}
body:not(.kiosk-only-body) .tap-id,
body:not(.kiosk-only-body) .device-id-value,
body:not(.kiosk-only-body) .setup-content code {
    color: var(--v2-text);
}

/* ============================================================
   REBUILD V3 — Pixel-fit (NO KIOSK)
   Ajuste fino de medidas/espaciados para acercar al mock tablet
   ============================================================ */

body:not(.kiosk-only-body) {
    --fit-sidebar-w: 212px;
    --fit-radius-card: 14px;
    --fit-radius-soft: 10px;
    --fit-title: clamp(2rem, 3.3vw, 3rem);
    --fit-label: 12px;
    --fit-body: 14px;
}

/* Admin layout */
body:not(.kiosk-only-body) .admin-sidebar {
    width: var(--fit-sidebar-w);
}
body:not(.kiosk-only-body) .admin-main {
    margin-left: var(--fit-sidebar-w);
    padding: 28px 26px 30px;
}
body:not(.kiosk-only-body) .sidebar-header {
    padding: 22px 16px 16px;
    gap: 10px;
}
body:not(.kiosk-only-body) .sidebar-logo {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    font-size: 10px;
}
body:not(.kiosk-only-body) .sidebar-header h2 {
    font-size: 1.05rem;
    font-weight: 800;
}
body:not(.kiosk-only-body) .sidebar-nav {
    padding: 10px 0;
}
body:not(.kiosk-only-body) .nav-item {
    margin: 2px 10px;
    width: calc(100% - 20px);
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    gap: 0;
}
body:not(.kiosk-only-body) .nav-icon {
    display: none !important;
}
body:not(.kiosk-only-body) .nav-label {
    width: 100%;
}
body:not(.kiosk-only-body) .sidebar-footer {
    padding: 12px;
}
body:not(.kiosk-only-body) .device-info {
    border-radius: 10px;
    padding: 10px 11px;
}
body:not(.kiosk-only-body) .device-id-label {
    font-size: 9px;
}
body:not(.kiosk-only-body) .device-id-value {
    font-size: 11px;
}

/* Main sections */
body:not(.kiosk-only-body) .section-title {
    font-size: var(--fit-title);
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.035em;
}
body:not(.kiosk-only-body) .section-title::after {
    width: 5px;
    height: 5px;
    margin-bottom: 3px;
}
body:not(.kiosk-only-body) .section-content {
    border-radius: var(--fit-radius-card);
    padding: 18px 20px;
}

/* Dashboard web */
body:not(.kiosk-only-body) .header {
    height: 58px;
    padding: 0 24px;
}
body:not(.kiosk-only-body) .header h1 {
    font-size: 1.06rem;
}
body:not(.kiosk-only-body) .main-content {
    max-width: 1320px;
    padding: 30px 24px;
}
body:not(.kiosk-only-body) .main-content h2 {
    font-size: var(--fit-title);
    margin-bottom: 18px;
}
body:not(.kiosk-only-body) .devices-grid {
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
body:not(.kiosk-only-body) .device-card {
    border-radius: var(--fit-radius-card);
    padding: 18px;
}
body:not(.kiosk-only-body) .device-name {
    font-size: 1rem;
}
body:not(.kiosk-only-body) .device-status {
    font-size: 10px;
    padding: 3px 9px;
}
body:not(.kiosk-only-body) .device-id {
    border-radius: 7px;
    font-size: 10px;
}

/* Buttons and controls */
body:not(.kiosk-only-body) .btn,
body:not(.kiosk-only-body) .btn-primary,
body:not(.kiosk-only-body) .btn-secondary,
body:not(.kiosk-only-body) .setup-content .btn-setup {
    height: 36px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
body:not(.kiosk-only-body) .btn.btn-sm {
    height: 30px;
    font-size: 11px;
}

/* Forms */
body:not(.kiosk-only-body) .form-group {
    margin-bottom: 14px;
}
body:not(.kiosk-only-body) .form-group label,
body:not(.kiosk-only-body) .admin-screen .form-group label,
body:not(.kiosk-only-body) .setup-content label {
    font-size: var(--fit-label);
    font-weight: 600;
}
body:not(.kiosk-only-body) .form-group input,
body:not(.kiosk-only-body) .form-group select,
body:not(.kiosk-only-body) .form-group textarea,
body:not(.kiosk-only-body) .setup-content input[type="text"],
body:not(.kiosk-only-body) .setup-content input[type="number"],
body:not(.kiosk-only-body) .setup-content input[type="date"],
body:not(.kiosk-only-body) .setup-content input[type="time"] {
    height: 38px;
    border-radius: 8px;
    font-size: 13px;
}
body:not(.kiosk-only-body) .form-group textarea {
    min-height: 92px;
    height: auto;
}

/* Tables */
body:not(.kiosk-only-body) .admin-table,
body:not(.kiosk-only-body) .transactions-table {
    font-size: 12px;
}
body:not(.kiosk-only-body) .admin-table th,
body:not(.kiosk-only-body) .transactions-table th {
    font-size: 10px;
    letter-spacing: 0.06em;
    padding: 9px 12px;
}
body:not(.kiosk-only-body) .admin-table td,
body:not(.kiosk-only-body) .transactions-table td {
    padding: 10px 12px;
}

/* Modal tuning */
body:not(.kiosk-only-body) .modal-content {
    border-radius: 16px;
    padding: 22px;
}
body:not(.kiosk-only-body) .modal-content h2 {
    font-size: 1.15rem;
    margin-bottom: 16px;
}
body:not(.kiosk-only-body) .close {
    width: 28px;
    height: 28px;
    top: 14px;
    right: 14px;
}

/* Setup/welcome */
body:not(.kiosk-only-body) .setup-container {
    max-width: 760px;
}
body:not(.kiosk-only-body) .setup-title {
    font-size: clamp(1.7rem, 3.2vw, 2.3rem);
    margin-bottom: 18px;
}
body:not(.kiosk-only-body) .setup-content {
    border-radius: 14px;
    padding: clamp(18px, 3.2vw, 28px);
}
body:not(.kiosk-only-body) .welcome-title {
    font-size: clamp(2.6rem, 7vw, 4.2rem);
    letter-spacing: -0.045em;
}
body:not(.kiosk-only-body) .welcome-subtitle {
    font-size: clamp(0.98rem, 2.1vw, 1.2rem);
}

/* Responsive fine-tuning non-kiosk */
@media (max-width: 1100px) {
    body:not(.kiosk-only-body) {
        --fit-sidebar-w: 188px;
    }
    body:not(.kiosk-only-body) .admin-main {
        padding: 22px 18px 24px;
    }
}
@media (max-width: 768px) {
    body:not(.kiosk-only-body) .section-title,
    body:not(.kiosk-only-body) .main-content h2 {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
    body:not(.kiosk-only-body) .section-content,
    body:not(.kiosk-only-body) .device-card,
    body:not(.kiosk-only-body) .modal-content {
        border-radius: 12px;
    }
}

/* Streamers section pixel-fit */
body:not(.kiosk-only-body) #section-streamers .section-content {
    padding: 22px;
}
body:not(.kiosk-only-body) #streamersContent .streamers-intro-card {
    border-radius: 12px;
    padding: 16px 18px;
}
body:not(.kiosk-only-body) #streamersContent .streamers-title {
    color: var(--v2-text) !important;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
body:not(.kiosk-only-body) #streamersContent .streamers-subtitle {
    color: var(--v2-text-soft) !important;
    font-size: 14px;
    line-height: 1.55;
}
body:not(.kiosk-only-body) #streamersContent .streamers-actions-row {
    margin-bottom: 12px !important;
}
body:not(.kiosk-only-body) #streamersScanBtn,
body:not(.kiosk-only-body) #streamersLinkBtn {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    font-size: 13px;
}
body:not(.kiosk-only-body) #streamersContent .streamers-status {
    color: var(--v2-text-soft) !important;
    font-size: 14px;
}
body:not(.kiosk-only-body) #streamersContent .streamers-divider {
    border: none;
    height: 1px;
    background: var(--v2-border);
}
body:not(.kiosk-only-body) #streamersNetList {
    margin: 0;
    padding: 0;
}
body:not(.kiosk-only-body) #streamersNetList li {
    padding: 10px 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
body:not(.kiosk-only-body) #streamersNetList li label {
    color: var(--v2-text);
    font-size: 15px;
}
body:not(.kiosk-only-body) #streamersLinkedList {
    gap: 10px !important;
}
body:not(.kiosk-only-body) .streamer-linked-card {
    border-radius: 11px;
    padding: 12px !important;
    gap: 8px !important;
}
body:not(.kiosk-only-body) .streamer-linked-id {
    color: var(--v2-text) !important;
    font-size: 14px !important;
    font-weight: 700;
}
body:not(.kiosk-only-body) .streamer-linked-meta {
    color: var(--v2-text-soft);
}
body:not(.kiosk-only-body) .streamer-linked-meta strong {
    color: var(--v2-text-muted);
    font-weight: 600;
}
body:not(.kiosk-only-body) .streamer-badge {
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 8px;
    line-height: 1;
}
body:not(.kiosk-only-body) .streamer-badge-ok {
    color: #86efac;
    background: rgba(34, 197, 94, 0.16);
}
body:not(.kiosk-only-body) .streamer-badge-warn {
    color: #fde047;
    background: rgba(234, 179, 8, 0.16);
}
body:not(.kiosk-only-body) .streamer-linked-card .btn.btn-sm {
    height: 30px;
    font-size: 11px;
}
body:not(.kiosk-only-body) .streamers-replace-modal .streamers-title {
    font-size: 1.2rem;
}

/* Ensure portal modals are never clipped by admin containers */
body > .modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 5000 !important;
}

/* —— Vista meseros (/mesas) — alineada al design system (kiosk / admin) —— */
.mesas-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font, 'Inter', system-ui, sans-serif);
    background:
        radial-gradient(ellipse 120% 80% at 100% -20%, var(--primary-alpha-20) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 0% 100%, rgba(59, 130, 246, 0.08) 0%, transparent 45%),
        linear-gradient(165deg, var(--bg) 0%, var(--bg-2) 45%, var(--surface) 100%);
    color: var(--text);
}
.mesas-gate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}
.mesas-gate-card {
    width: min(440px, 100%);
    padding: clamp(28px, 5vw, 40px);
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg), var(--shadow-orange);
    text-align: center;
}
.mesas-gate-brand {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 10px;
}
.mesas-gate-icon { font-size: 3rem; line-height: 1; margin-bottom: 8px; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35)); }
.mesas-gate-title { margin: 0 0 8px; font-size: 1.65rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.mesas-gate-hint { margin: 0 0 18px; color: var(--text-2); font-size: 0.95rem; line-height: 1.45; }
.mesas-gate-help { margin: 18px 0 0; font-size: 0.82rem; color: var(--warning); line-height: 1.45; }
.mesas-pin-input {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 18px;
    font-size: 1.25rem;
    letter-spacing: 0.18em;
    text-align: center;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-strong);
    background: var(--bg-2);
    color: var(--text);
    margin-bottom: 8px;
}
.mesas-pin-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha-15);
}
.mesas-gate-error {
    min-height: 1.25rem;
    margin: 8px 0;
    font-size: 0.88rem;
    color: var(--error);
}
.mesas-app {
    padding: clamp(14px, 2.5vw, 24px);
    max-width: 1280px;
    margin: 0 auto;
    box-sizing: border-box;
    min-height: 100vh;
}
.mesas-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.mesas-brand-block { min-width: 0; flex: 1; }
.mesas-brand-pill {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-alpha-10);
    border: 1px solid var(--border-orange);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-bottom: 8px;
}
.mesas-title { margin: 0; font-size: clamp(1.45rem, 3.8vw, 1.85rem); font-weight: 800; letter-spacing: -0.03em; }
.mesas-subtitle { margin: 6px 0 0; color: var(--text-2); font-size: 0.92rem; line-height: 1.4; max-width: 36rem; }
.mesas-waiter-line { margin: 10px 0 0; font-size: 0.88rem; color: var(--primary); font-weight: 600; }
.mesas-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

/* Flecha panel barriles (desliza pista) */
.mesas-nav-fab {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--border-orange);
    background: linear-gradient(145deg, var(--primary-alpha-20), var(--surface-2));
    color: var(--primary);
    font-size: 1.35rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s;
}
.mesas-nav-fab:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: var(--shadow-orange);
}
.mesas-nav-fab--back {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text-2);
}

.mesas-stage {
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}
.mesas-track {
    display: flex;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
.mesas-track--inventory { transform: translateX(-50%); }
.mesas-pane {
    width: 50%;
    flex: 0 0 50%;
    box-sizing: border-box;
    padding: clamp(16px, 2.5vw, 22px);
    min-height: 52vh;
}
.mesas-pane--inventory {
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 40%);
    border-left: 1px solid var(--border);
}
.mesas-status { min-height: 1.4rem; margin-bottom: 12px; font-size: 0.9rem; color: var(--info); }
.mesas-status--err { color: var(--error); }
.mesas-inv-status { color: var(--text-2); }
.mesas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: clamp(14px, 2vw, 20px);
}
.mesas-empty { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; margin: 0; }
.mesas-muted { color: var(--text-3); font-size: 0.86rem; margin: 0.5rem 0 0; line-height: 1.45; }

.mesas-card {
    border-radius: var(--radius-lg);
    padding: 20px 18px;
    border: 1px solid var(--border);
    background: var(--bg-2);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}
.mesas-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.85;
}
.mesas-card--on::before { background: linear-gradient(90deg, var(--success), rgba(34, 197, 94, 0.35)); }
.mesas-card--off::before { background: linear-gradient(90deg, var(--error), rgba(239, 68, 68, 0.35)); }
.mesas-card--on { border-color: rgba(34, 197, 94, 0.35); }
.mesas-card--off { border-color: rgba(239, 68, 68, 0.32); }
.mesas-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.mesas-card-num { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }
.mesas-badge {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}
.mesas-badge--on { background: rgba(34, 197, 94, 0.18); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.4); }
.mesas-badge--off { background: rgba(239, 68, 68, 0.14); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.mesas-card-state { font-size: 0.88rem; font-weight: 500; color: var(--text-2); line-height: 1.45; }
.mesas-toggle {
    width: 100%;
    padding: 14px 16px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    border-radius: var(--radius-md) !important;
    margin-top: 4px;
}

.mesas-inv-toolbar {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}
.mesas-inv-headings { flex: 1; min-width: 0; }
.mesas-inv-title { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.mesas-inv-sub { margin: 6px 0 0; font-size: 0.88rem; color: var(--text-2); line-height: 1.45; }

.mesas-barrel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.mesas-barrel-card {
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--bg-2);
    border: 1px solid var(--border);
}
.mesas-barrel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.mesas-barrel-name { margin: 0; font-size: 1.05rem; font-weight: 700; }
.mesas-barrel-tapid { font-size: 0.75rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; }
.mesas-barrel-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}
.mesas-stat-label { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 2px; }
.mesas-stat-val { font-size: 0.92rem; font-weight: 700; color: var(--text); }
.mesas-barrel-meter {
    height: 14px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid var(--border-strong);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    margin-bottom: 12px;
}
.mesas-barrel-meter-fill {
    height: 100%;
    min-width: 0;
    border-radius: 2px;
    background: var(--text-3);
    transition: width 0.45s ease, background-color 0.35s ease;
}
.mesas-barrel-meter-fill--low {
    background: linear-gradient(90deg, #b91c1c, #ef4444);
}
.mesas-barrel-meter-fill--mid {
    background: linear-gradient(90deg, #c2410c, #f97316);
}
.mesas-barrel-meter-fill--high {
    background: linear-gradient(90deg, #15803d, #22c55e);
}
.mesas-barrel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mesas-btn {
    cursor: pointer;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 600;
    padding: 11px 16px;
    font-size: 0.92rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s, filter 0.15s;
}
.mesas-btn-sm { padding: 9px 12px !important; font-size: 0.85rem !important; }
.mesas-btn-primary {
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    color: #111;
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: var(--shadow-orange);
}
.mesas-btn-primary:hover { filter: brightness(1.05); }
.mesas-btn-ghost {
    background: var(--nav-pill-bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.mesas-btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.mesas-btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--border-orange);
}
.mesas-btn-outline:hover { background: var(--primary-alpha-10); }
.mesas-btn-warn { background: linear-gradient(145deg, #f59e0b, #d97706) !important; color: #111 !important; }
.mesas-btn-success { background: linear-gradient(145deg, var(--success), #15803d) !important; color: #fff !important; }
.mesas-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 6000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.mesas-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}
.mesas-modal-card {
    position: relative;
    width: min(400px, 100%);
    padding: 26px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.mesas-modal-title { margin: 0 0 8px; font-size: 1.28rem; font-weight: 800; }
.mesas-modal-hint { margin: 0 0 16px; color: var(--text-2); font-size: 0.9rem; line-height: 1.45; }
.mesas-label { display: block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 6px; }
.mesas-text-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--text);
    font-size: 1rem;
}
.mesas-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.mesas-table-enabled-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.9rem; color: var(--text-secondary, #94a3b8); user-select: none; }
.mesas-table-enabled-label input { width: 1.1rem; height: 1.1rem; }

/* ── Portal cliente (móvil / PWA) ── */
.portal-dashboard .portal-header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    align-items: flex-start;
}
.portal-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
}
@media (min-width: 720px) {
    .portal-dashboard .portal-header { flex-wrap: nowrap; align-items: center; }
    .portal-header-actions { width: auto; }
}
.portal-user-name {
    font-size: 0.9rem;
    color: var(--text-2);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.portal-header-btn { min-height: 44px; padding-left: 14px; padding-right: 14px; }
.portal-main {
    padding: 16px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    max-width: 1100px;
    margin: 0 auto;
}
.portal-section-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 24px 0 8px;
    letter-spacing: -0.02em;
}
.portal-section-hint {
    color: var(--text-2);
    font-size: 0.88rem;
    margin-bottom: 12px;
}
.portal-summary-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
}
.portal-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}
.portal-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}
.portal-summary-card--global {
    grid-column: 1 / -1;
    border-color: var(--border-orange);
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}
.portal-summary-card .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    margin-bottom: 6px;
}
.portal-summary-card .value {
    font-size: var(--text-card-value);
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}
.portal-org-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 8px;
}
.org-list-wrap {
    font-size: 0.9rem;
    color: var(--text-2);
    margin-bottom: 16px;
    line-height: 1.5;
}
.org-actions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
    align-items: end;
}
@media (min-width: 640px) {
    .org-actions-grid {
        grid-template-columns: 1fr 1fr auto;
    }
}
.portal-invite-result {
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 12px;
    word-break: break-all;
}
.portal-devices-grid {
    gap: 12px;
}
@media (max-width: 520px) {
    .transactions-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
.device-remote-panel {
    margin-top: 16px;
    padding: 14px;
    background: var(--bg-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.device-remote-panel h4 {
    font-size: 0.9rem;
    margin: 0 0 10px;
    color: var(--text-2);
}
.remote-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}
.remote-payload-input {
    width: 100%;
    min-height: 72px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════
   Portal cloud — shell tipo app (menú + vistas)
   ═══════════════════════════════════════════════════════════ */
.portal-dashboard {
    font-family: 'Plus Jakarta Sans', var(--font);
    background: var(--bg);
    padding: 0 !important;
}

/* Flex en lugar de solo block: el área central puede hacer scroll y la barra inferior queda en el flujo (Chrome Android falla con fixed+dentro de overflow hidden). */
#dashboardScreen.screen.active {
    display: flex !important;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

.portal-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
}

@media (max-width: 900px) {
    .portal-shell {
        flex-direction: column;
    }
}

.portal-sidebar {
    width: 252px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
    border-right: 1px solid var(--border);
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.portal-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.5rem 0.5rem;
}

.portal-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.06em;
    box-shadow: var(--shadow-orange);
}

.portal-brand-name {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.2;
}

.portal-brand-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-3);
    margin-top: 2px;
}

.portal-side-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.portal-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    text-align: left;
    padding: 0.7rem 0.85rem;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-2);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.portal-nav-item:hover {
    background: var(--nav-pill-bg);
    color: var(--text);
}

.portal-nav-item.is-active {
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary-alpha-20);
}

.portal-nav-ic {
    width: 1.35rem;
    text-align: center;
    opacity: 0.85;
    font-size: 0.95rem;
}

.portal-main-wrap {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.portal-topbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 18, 23, 0.85);
    backdrop-filter: blur(12px);
}

.portal-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px 14px;
    flex-wrap: wrap;
    min-width: 0;
}

.portal-site-select-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.portal-site-select-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
}

.portal-site-select {
    min-width: 0;
    max-width: min(240px, 42vw);
    padding: 6px 28px 6px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.portal-site-select:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.portal-add-device-site-hint {
    font-size: 0.88rem;
    color: var(--text-2);
    line-height: 1.45;
    margin: 0 0 10px;
}

.portal-summary-empty {
    margin: 0;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px dashed var(--border);
    color: var(--text-2);
    font-size: 0.92rem;
    line-height: 1.5;
}

.portal-dashboard .is-hidden {
    display: none !important;
}

/* ── Panel de control (portal / inicio) ── */
.portal-dash-section {
    max-width: 1200px;
    margin: 0 auto;
}

.portal-dash-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(120% 180% at 100% 0%, rgba(255, 138, 0, 0.18) 0%, transparent 55%),
        radial-gradient(80% 120% at 0% 100%, rgba(56, 189, 248, 0.1) 0%, transparent 45%),
        linear-gradient(165deg, var(--surface) 0%, var(--bg-2) 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.portal-dash-hero-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.35rem, 3.5vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
    line-height: 1.15;
}

.portal-dash-hero-sub {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-2);
    line-height: 1.45;
    max-width: 36rem;
}

.portal-dash-system-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.portal-dash-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-2);
}

.portal-dash-pill--ok {
    border-color: rgba(34, 197, 94, 0.45);
    color: #86efac;
    background: rgba(34, 197, 94, 0.1);
}

.portal-dash-pill--warn {
    border-color: rgba(245, 158, 11, 0.5);
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.12);
}

.portal-dash-pill--muted {
    opacity: 0.9;
}

.portal-dash-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

.portal-dash-toolbar {
    margin-bottom: 0.5rem;
}

.portal-dash-body {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.portal-dash-kpi-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 720px) {
    .portal-dash-kpi-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

.portal-dash-kpi {
    position: relative;
    overflow: hidden;
    padding: 1rem 1.1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.portal-dash-kpi::after {
    content: '';
    position: absolute;
    inset: auto -30% -60% auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0.12;
    pointer-events: none;
}

.portal-dash-kpi--tx::after {
    background: var(--primary);
}
.portal-dash-kpi--vol::after {
    background: #38bdf8;
}
.portal-dash-kpi--money::after {
    background: #a78bfa;
}
.portal-dash-kpi--avg::after {
    background: #f472b6;
}

.portal-dash-kpi-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin-bottom: 0.35rem;
}

.portal-dash-kpi-value {
    display: block;
    font-size: clamp(1.35rem, 4vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.1;
}

.portal-dash-kpi-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-3);
    line-height: 1.3;
}

.portal-dash-chart-grid {
    display: grid;
    gap: 0.85rem;
}

@media (min-width: 900px) {
    .portal-dash-chart-grid {
        grid-template-columns: 1.35fr 1fr;
    }
    .portal-dash-chart-grid--split {
        grid-template-columns: minmax(220px, 0.9fr) 1.4fr;
    }
}

.portal-dash-chart-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface) 0%, rgba(15, 18, 23, 0.5) 100%);
    padding: 1rem 1.1rem 1.15rem;
    box-shadow: var(--shadow-sm);
}

.portal-dash-chart-card--grow {
    min-width: 0;
}

.portal-dash-chart-card--compact {
    max-width: 100%;
}

@media (min-width: 900px) {
    .portal-dash-chart-card--compact {
        max-width: 340px;
    }
}

.portal-dash-chart-head {
    margin-bottom: 0.65rem;
}

.portal-dash-chart-title {
    margin: 0 0 0.2rem;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.portal-dash-chart-desc {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-3);
    line-height: 1.35;
}

.portal-dash-chart-canvas {
    position: relative;
    min-height: 220px;
    max-height: 280px;
}

.portal-dash-chart-canvas--doughnut {
    min-height: 200px;
    max-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-dash-chart-canvas--status {
    min-height: 200px;
    max-height: 240px;
}

.portal-dash-chart-canvas canvas {
    max-height: 100%;
}

.portal-dash-chart-empty {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    color: var(--text-3);
    text-align: center;
}

.portal-dash-device-bars {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 120px;
}

.portal-dash-devrow-name {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-2);
}

.portal-dash-devrow-name strong {
    color: var(--text);
    font-weight: 700;
}

.portal-dash-devrow-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    overflow: hidden;
}

.portal-dash-devrow-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary) 0%, #fb923c 100%);
    box-shadow: 0 0 16px rgba(255, 138, 0, 0.35);
    transition: width 0.35s ease;
}

/* Dashboard admin local: más KPIs por fila */
.admin-local-dash .admin-dash-kpi-row {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}

.portal-topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.portal-topbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.portal-user-chip {
    font-size: 0.8rem;
    color: var(--text-2);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-tb-btn {
    padding: 0.45rem 0.85rem !important;
    font-size: 0.8rem !important;
    border-radius: var(--radius-md) !important;
}

.portal-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 1.25rem;
    overscroll-behavior-y: contain;
}

@media (max-width: 900px) {
    .portal-scroll {
        padding-bottom: 1.25rem;
    }
}

.portal-panel {
    display: none;
    animation: portalFade 0.2s ease;
}

.portal-panel.is-active {
    display: block;
}

@keyframes portalFade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.portal-view-head {
    margin-bottom: 1.25rem;
}

.portal-view-head--compact {
    margin-bottom: 1rem;
}

.portal-view-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    margin: 0 0 0.35rem;
}

.portal-view-desc {
    font-size: 0.88rem;
    color: var(--text-2);
    line-height: 1.55;
    margin: 0;
    max-width: 52rem;
}

/* Barra inferior: en móvil va al final del flex column (no position:fixed) para toques fiables en Chrome Android */
.portal-bottom-nav {
    display: none;
    flex-shrink: 0;
    position: relative;
    z-index: 20;
    background: rgba(19, 23, 30, 0.96);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding: 8px 8px calc(10px + env(safe-area-inset-bottom, 0));
    justify-content: space-around;
    align-items: stretch;
    gap: 4px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.portal-bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: 8px 4px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-3);
    font-size: 0.65rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 138, 0, 0.15);
}

.portal-bnav-ic {
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.75;
}

.portal-bnav-item.is-active {
    color: var(--primary);
    background: var(--primary-alpha-10);
}

.portal-bnav-item.is-active .portal-bnav-ic {
    opacity: 1;
}

@media (max-width: 900px) {
    .portal-sidebar {
        display: none;
    }
    .portal-bottom-nav {
        display: flex;
    }
    .portal-topbar-actions .portal-user-chip {
        display: none;
    }
}

.device-pending-callout {
    margin: 0 0 1.25rem;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.12) 0%, rgba(255, 138, 0, 0.08) 100%);
    border: 1px solid rgba(234, 179, 8, 0.35);
}

.device-pending-callout h4 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--warning);
}

.device-pending-callout p {
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    color: var(--text-2);
    line-height: 1.55;
}

.device-pending-callout ol {
    margin: 0 0 0.65rem;
    padding-left: 1.2rem;
    font-size: 0.82rem;
    color: var(--text-2);
    line-height: 1.6;
}

.device-pending-callout li {
    margin-bottom: 0.35rem;
}

.device-pending-callout code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: var(--bg);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.portal-dashboard .device-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.portal-dashboard .device-card:hover {
    border-color: var(--border-orange);
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}

.portal-dashboard .device-name {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.portal-devices-grid {
    gap: 18px;
}

.portal-dashboard .device-card.portal-station-card {
    position: relative;
    overflow: hidden;
    min-height: 210px;
    padding: 1.2rem 1.2rem 1rem;
    background: linear-gradient(155deg, rgba(23, 28, 36, 0.98) 0%, rgba(17, 21, 28, 0.97) 55%, rgba(14, 17, 22, 1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.portal-dashboard .device-card.portal-station-card::after {
    display: none;
}

.portal-dashboard .device-card.portal-station-card:hover {
    border-color: rgba(255, 138, 0, 0.45);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 138, 0, 0.12);
    transform: translateY(-4px);
}

.portal-station-card__accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, rgba(255, 138, 0, 0.35) 60%, transparent 100%);
}

.portal-station-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.7rem;
}

.portal-station-card__mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: linear-gradient(145deg, var(--primary-alpha-20), rgba(255, 138, 0, 0.05));
    border: 1px solid rgba(255, 138, 0, 0.25);
}

.portal-station-card__status.device-status {
    padding: 6px 12px;
    font-size: 0.62rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.portal-station-card__body {
    margin-top: 0.55rem;
}

.portal-station-card__title.device-name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.portal-station-card__chips {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.portal-station-chip {
    padding: 0.34rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
}

.portal-station-chip--muted {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-3);
    background: rgba(0, 0, 0, 0.22);
}

.portal-station-taps {
    margin-top: 0.75rem;
}

.portal-station-taps__grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 5px;
}

.portal-station-taps__block {
    height: 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
}

.portal-station-taps__block.is-active {
    border-color: rgba(255, 138, 0, 0.5);
    background: linear-gradient(180deg, rgba(255, 179, 92, 0.95) 0%, rgba(255, 138, 0, 0.96) 100%);
    box-shadow: 0 0 8px rgba(255, 138, 0, 0.35);
}

.portal-station-taps__label {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text-2);
}

.portal-station-card__foot {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 0.45rem;
    align-items: baseline;
    flex-wrap: wrap;
}

.portal-station-card__id-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-3);
    font-weight: 800;
}

.portal-station-card__id {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: rgba(255, 196, 120, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.35);
    padding: 0.2rem 0.45rem;
    word-break: break-all;
}

/* ── Admin · RFID studio (lectores ↔ tapracks) ─ */
.rfid-device-pre {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.45;
    overflow: auto;
    max-height: 200px;
    margin: 0 0 1rem;
    white-space: pre-wrap;
    word-break: break-all;
    background: var(--surface-2);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}

.rfid-studio {
    max-width: 1120px;
    margin: 0 auto;
}

.rfid-studio__hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.35rem;
}

.rfid-studio__titles {
    min-width: 0;
}

.rfid-studio__h {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary, var(--text));
    line-height: 1.2;
}

.rfid-studio__tag {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.rfid-studio__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.35rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, var(--border-strong));
}

.rfid-studio__save-btn {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    padding: 0.35rem 0.85rem !important;
    min-height: 0 !important;
    line-height: 1.25 !important;
    border-radius: var(--radius, 8px) !important;
}

.rfid-studio__status {
    margin: 0.5rem 0 0;
    font-size: 0.84rem;
    color: var(--text-secondary);
    min-height: 1.25em;
    text-align: right;
}

.rfid-dnd-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.rfid-toolbar-btn {
    font-size: 0.8rem !important;
    padding: 0.4rem 0.75rem !important;
}

.rfid-dnd-board {
    display: grid;
    gap: 1.1rem;
    align-items: start;
}

@media (min-width: 880px) {
    .rfid-dnd-board {
        grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.15fr);
    }
}

.rfid-panel {
    background: linear-gradient(155deg, var(--surface-2) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md, 12px);
    padding: 1rem 1rem 1.1rem;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
}

.rfid-panel__head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.rfid-panel__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.rfid-panel__dot--pool {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.45);
}

.rfid-panel__dot--target {
    background: linear-gradient(135deg, var(--primary, #ff8a00), #ff6b35);
    box-shadow: 0 0 12px rgba(255, 138, 0, 0.35);
}

.rfid-panel__head-text {
    min-width: 0;
}

.rfid-panel__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary, var(--text));
}

.rfid-panel__sub {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.rfid-dnd-pool,
.rfid-dnd-board .rfid-dnd-dropzone {
    color: var(--text-primary);
    border-radius: var(--radius-md, 12px);
}

.rfid-dnd-pool {
    min-height: 140px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: color-mix(in srgb, var(--surface-2) 88%, #000 12%);
    border: 1px dashed color-mix(in srgb, var(--border-strong) 70%, transparent);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.rfid-dnd-board .rfid-dnd-dropzone {
    background: color-mix(in srgb, var(--surface-2) 90%, #000 10%);
    border: 1px dashed color-mix(in srgb, var(--border-strong) 65%, transparent);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.rfid-dnd-pool.rfid-dnd--drag-hover {
    border-style: solid;
    border-color: var(--primary);
    box-shadow:
        0 0 0 3px var(--primary-alpha-20, rgba(255, 138, 0, 0.22)),
        0 10px 32px rgba(0, 0, 0, 0.1);
}

.rfid-taprack-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.rfid-taprack-card__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.15rem 0.2rem 0.35rem 0;
}

.rfid-taprack-card__badge {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.05rem;
    color: #fff;
    background: linear-gradient(145deg, var(--primary, #ff8a00), #e65100);
    box-shadow: 0 4px 14px rgba(255, 138, 0, 0.35);
    flex-shrink: 0;
}

.rfid-taprack-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.rfid-taprack-card__title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary, var(--text));
}

.rfid-taprack-card__sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono, ui-monospace, monospace);
}

.rfid-taprack-card__drop.rfid-dnd-dropzone {
    min-height: 92px;
    padding: 0.65rem;
    margin-top: 0.15rem;
}

.rfid-taprack-card__drop.rfid-dnd--drag-hover {
    border-style: solid;
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary-alpha-20, rgba(255, 138, 0, 0.28));
}

.rfid-taprack-card__scope {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-color);
}

.rfid-scope-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.rfid-scope-mode {
    width: 100%;
    max-width: 100%;
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius, 8px);
    border: 1px solid var(--border-color);
    background: var(--bg-card, #fff);
    color: var(--text-primary);
}

.rfid-scope-kiosks {
    margin-top: 0.5rem;
}

.rfid-scope-kiosks-inner {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.82rem;
}

.rfid-scope-cb-line {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.rfid-drop-hint {
    min-height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
    color: var(--text-muted);
    padding: 0.35rem;
}

.rfid-drop-hint__plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    border: 2px dashed currentColor;
    opacity: 0.55;
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1;
}

.rfid-drop-hint__text {
    font-size: 0.78rem;
    font-weight: 600;
    max-width: 12rem;
    line-height: 1.35;
}

.rfid-pool-empty {
    text-align: center;
    padding: 1.35rem 0.75rem;
    color: var(--text-muted);
}

.rfid-pool-empty__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.65rem;
    border-radius: 14px;
    border: 2px dashed color-mix(in srgb, currentColor 40%, transparent);
    position: relative;
    opacity: 0.75;
}

.rfid-pool-empty__icon::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
}

.rfid-pool-empty__title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.rfid-pool-empty__hint {
    margin: 0.35rem 0 0;
    font-size: 0.76rem;
    line-height: 1.45;
    max-width: 17rem;
    margin-inline: auto;
}

.rfid-dnd-chip {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid color-mix(in srgb, var(--primary, #ff8a00) 45%, transparent);
    border-radius: 14px;
    cursor: grab;
    user-select: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.rfid-dnd-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: color-mix(in srgb, var(--primary, #ff8a00) 70%, transparent);
}

.rfid-dnd-chip:active {
    cursor: grabbing;
}

.rfid-dnd-chip--dragging {
    opacity: 0.48;
    transform: scale(0.98);
}

.rfid-dnd-chip--ghost {
    border-style: dashed;
    border-color: var(--border-strong);
    background: linear-gradient(135deg, rgba(120, 120, 120, 0.1), rgba(80, 80, 80, 0.04));
    box-shadow: none;
}

.rfid-dnd-chip--ghost:hover {
    transform: none;
}

.rfid-dnd-chip__grip {
    width: 11px;
    flex-shrink: 0;
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 3px,
        color-mix(in srgb, var(--text-muted) 35%, transparent) 3px,
        color-mix(in srgb, var(--text-muted) 35%, transparent) 5px
    );
    border-right: 1px solid color-mix(in srgb, var(--border-strong) 80%, transparent);
}

.rfid-dnd-chip__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.15rem;
    flex-shrink: 0;
    padding: 0.35rem;
    color: var(--primary, #ff8a00);
    background: color-mix(in srgb, var(--primary, #ff8a00) 14%, transparent);
    border-right: 1px solid color-mix(in srgb, var(--primary, #ff8a00) 22%, transparent);
}

.rfid-dnd-chip__icon--muted {
    color: var(--text-muted);
    background: color-mix(in srgb, var(--text-muted) 12%, transparent);
    border-right-color: color-mix(in srgb, var(--border-strong) 70%, transparent);
}

.rfid-dnd-chip__svg {
    width: 32px;
    height: 32px;
    display: block;
}

.rfid-dnd-chip__body {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.75rem 0.55rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.rfid-dnd-chip-name {
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--text-primary, var(--text));
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.rfid-dnd-chip-kind {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--primary, #ff8a00);
    opacity: 0.92;
}

.rfid-dnd-chip-sub {
    font-size: 0.7rem;
    line-height: 1.3;
    color: var(--danger, #c62828);
    opacity: 0.95;
}

.rfid-dnd-chip-path {
    font-size: 0.68rem;
    font-family: var(--font-mono, ui-monospace, monospace);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.08rem;
}

.rfid-perm-banner {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-orange);
    background: linear-gradient(180deg, rgba(255, 138, 0, 0.18), rgba(255, 138, 0, 0.06));
    color: var(--text-primary);
}

.rfid-perm-banner__title {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 0.35rem;
}

.rfid-perm-banner__p {
    margin: 0.45rem 0 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.rfid-perm-banner__pre {
    margin: 0.5rem 0 0;
    padding: 0.55rem 0.65rem;
    font-size: 0.75rem;
    line-height: 1.45;
    overflow-x: auto;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
}

.rfid-dnd-chip--perm-warning {
    border-color: color-mix(in srgb, var(--danger, #c62828) 55%, transparent);
    background: linear-gradient(135deg, rgba(198, 40, 40, 0.12), rgba(198, 40, 40, 0.04));
}

.rfid-dnd-chip--perm-warning .rfid-dnd-chip__icon {
    color: var(--danger, #c62828);
    background: rgba(198, 40, 40, 0.12);
    border-right-color: rgba(198, 40, 40, 0.22);
}

.firmware-banner {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: 0.9rem;
    display: grid;
    gap: 0.6rem;
}

.firmware-banner--available {
    border-color: var(--primary);
    background: var(--primary-alpha-10);
}

.firmware-banner--error {
    border-color: var(--error);
}

.firmware-banner--ok {
    border-color: var(--success);
}

.firmware-banner__main {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.firmware-banner__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.firmware-banner__status {
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.firmware-banner__notes summary {
    cursor: pointer;
    color: var(--primary);
}

.firmware-banner__notes p {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.settings-subtabs {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.settings-subtab {
    padding: 0.45rem 1rem;
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.settings-subtab.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-alpha-10);
}

.settings-subpanel {
    margin-top: 0.25rem;
}
