/* ===================================================
   RIALTA HORMIGONES - SISTEMA INDUSTRIAL & PATIO
   Diseño de Alta Gama: Industrial Dark & Modo Sol de Patio
   v2.0 PREMIUM EDITION
   =================================================== */

:root {
  --primary: #0E3846;
  --primary-light: #16566c;
  --primary-dark: #07232d;
  --accent: #00D084;
  --accent-2: #00B8D4;
  --accent-amber: #F59E0B;
  --accent-red: #EF4444;
  --bg-main: #080F14;
  --bg-card: #0D1E28;
  --bg-card-hover: #122a36;
  --bg-glass: rgba(13, 30, 40, 0.75);
  --border-color: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(0, 208, 132, 0.3);
  --text-main: #E8F4F8;
  --text-muted: #7A9BAD;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-card: 0 4px 6px -1px rgba(0,0,0,0.5), 0 20px 40px -10px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
  --shadow-glow: 0 0 30px rgba(0, 208, 132, 0.15), 0 0 60px rgba(0, 208, 132, 0.05);
  --gradient-brand: linear-gradient(135deg, #00D084 0%, #00B8D4 100%);
  --gradient-dark: linear-gradient(180deg, #0D1E28 0%, #080F14 100%);
}

/* Modo Sol de Patio (Altísimo Contraste) */
body.high-contrast {
  --bg-main: #FFFFFF;
  --bg-card: #F8FAFC;
  --bg-card-hover: #F1F5F9;
  --border-color: #000000;
  --text-main: #000000;
  --text-muted: #1E293B;
  --primary: #000000;
  --primary-light: #334155;
  --accent: #047857;
  --accent-red: #B91C1C;
  --accent-amber: #B45309;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  overflow-x: hidden;
  width: 100%;
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

.nota-thumbnail {
  width: 100%;
  max-width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
  display: block;
  border: 1px solid var(--border-color);
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 208, 132, 0.04) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 100%, rgba(0, 184, 212, 0.04) 0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  transition: background-color 0.25s, color 0.25s;
}

/* ===================================================
   ENCABEZADO PRINCIPAL (NAVBAR)
   =================================================== */
.app-header {
  background: rgba(8, 15, 20, 0.88);
  border-bottom: 1px solid rgba(0, 208, 132, 0.12);
  padding: 0.6rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 1px 0 rgba(0, 208, 132, 0.08), 0 4px 20px rgba(0, 0, 0, 0.4);
}

@media (min-width: 1024px) {
  .app-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    gap: 1rem;
  }
}

.header-main-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

@media (min-width: 1024px) {
  .header-main-bar {
    width: auto;
    gap: 1.5rem;
  }
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.logo-container {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: transform 0.15s, background-color 0.2s;
}

.logo-container:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.05);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-brand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.25rem;
  color: #071610;
  box-shadow: 0 4px 15px rgba(0, 208, 132, 0.4), 0 0 0 1px rgba(0, 208, 132, 0.2);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.logo-icon::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.15) 50%, transparent 70%);
  animation: logoSheen 4s ease-in-out infinite;
}

@keyframes logoSheen {
  0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
  background: linear-gradient(135deg, #FFFFFF 0%, rgba(255,255,255,0.75) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text span {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-header-action {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-text-desktop {
  display: none;
}

@media (min-width: 640px) {
  .btn-text-desktop {
    display: inline;
  }
}

.header-nav-bar {
  width: 100%;
}

@media (min-width: 1024px) {
  .header-nav-bar {
    width: auto;
  }
}

/* Conmutador de Roles / Vistas Responsive */
.role-switch-container {
  background: rgba(0, 0, 0, 0.35);
  padding: 3px;
  border-radius: 12px;
  display: flex;
  width: 100%;
  gap: 3px;
  border: 1px solid var(--border-color);
}

@media (min-width: 1024px) {
  .role-switch-container {
    width: auto;
  }
}

.role-btn {
  flex: 1 1 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.55rem 0.4rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.2s;
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .role-btn {
    flex: initial;
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
  }
}

.role-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, #0a4a5c 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 208, 132, 0.2);
}

.role-text-short {
  display: inline;
}

.role-text-full {
  display: none;
}

@media (min-width: 640px) {
  .role-text-short {
    display: none;
  }
  .role-text-full {
    display: inline;
  }
}

/* ===================================================
   LAYOUT & CONTENEDORES
   =================================================== */
.main-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem 1rem;
}

.view-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hidden {
  display: none !important;
}

/* ===================================================
   TARJETAS Y COMPONENTES VISUALES
   =================================================== */
.card {
  background: linear-gradient(145deg, rgba(13, 30, 40, 1) 0%, rgba(9, 20, 27, 1) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 208, 132, 0.3) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  border-color: rgba(0, 208, 132, 0.2);
  box-shadow: var(--shadow-card), 0 0 30px rgba(0, 208, 132, 0.06);
  transform: translateY(-1px);
}

.card:hover::before {
  opacity: 1;
}

.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title-lg {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

/* Botones Grandes (XXL) para Móviles / Guantes */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-lg {
  padding: 1.1rem 1.75rem;
  font-size: 1.1rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-xxl {
  padding: 1.5rem 2rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-radius: var(--radius-md);
  width: 100%;
}

.btn-sm {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
}

.btn-xs {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--primary-light);
}

.btn-success {
  background: #059669;
  color: #FFFFFF;
}

.btn-success:hover {
  background: #10B981;
}

.btn-danger {
  background: #DC2626;
  color: #FFFFFF;
}

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

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-outline-warning {
  background: transparent;
  border: 1px solid var(--accent-amber);
  color: var(--accent-amber);
}

.btn-outline-warning:hover {
  background: rgba(245, 158, 11, 0.1);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary { background: rgba(14, 56, 70, 0.5); color: #8ED1FC; border: 1px solid rgba(14, 56, 70, 0.8); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #F87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-secondary { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }

/* ===================================================
   MODO OPERARIO: FICHAJE Y CAMIONES
   =================================================== */
.fichaje-panel {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
  align-items: center;
}

@media (max-width: 768px) {
  .fichaje-panel { grid-template-columns: 1fr; }
}

.fichaje-emp-card {
  background: rgba(0, 0, 0, 0.2);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* Sección de Camiones & Palets */
.camiones-selector-bar {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr auto;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .camiones-selector-bar { grid-template-columns: 1fr; }
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

/* CRÍTICO: Opciones de select legibles en dark mode */
.form-control option,
select option {
  background-color: #0D1E28;
  color: #E8F4F8;
  padding: 0.5rem;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300D084' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 208, 132, 0.15);
}

.form-control::placeholder {
  color: rgba(122, 155, 173, 0.6);
}

.palets-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.palet-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 600px) {
  .palet-card { flex-direction: column; align-items: flex-start; }
}

.palet-alerta-curado {
  border-color: var(--accent-red);
  background: rgba(239, 68, 68, 0.08);
}

.badge-curado-rojo {
  margin-top: 0.4rem;
  background: rgba(239, 68, 68, 0.2);
  color: #FCA5A5;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  border: 1px solid var(--accent-red);
}

.badge-curado-verde {
  margin-top: 0.4rem;
  color: #34D399;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Canvas de Firma Digital */
.signature-box {
  background: #FFFFFF;
  border: 2px dashed #CBD5E1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  margin-top: 0.75rem;
}

#canvas-firma-chofer {
  width: 100%;
  max-width: 500px;
  height: 160px;
  touch-action: none;
  background: #FFFFFF;
  cursor: crosshair;
}

/* ===================================================
   MODO GERENCIA: IA CHAT & PEDIDOS EN REPOSO
   =================================================== */
.ai-chat-window {
  display: flex;
  flex-direction: column;
  height: 440px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.ai-chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-msg {
  display: flex;
  width: 100%;
}

.chat-msg-user { justify-content: flex-end; }
.chat-msg-ai { justify-content: flex-start; }

.chat-bubble {
  max-width: 80%;
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.45;
}

.chat-msg-user .chat-bubble {
  background: var(--primary);
  color: #FFFFFF;
  border-bottom-right-radius: 2px;
}

.chat-msg-ai .chat-bubble {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 2px;
}

.chat-author {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  opacity: 0.75;
}

.ai-chips-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
}

.ai-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}

.ai-chip:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.ai-input-bar {
  display: flex;
  padding: 0.75rem;
  gap: 0.5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

/* Barra de Lote en Pedidos en Reposo */
.progress-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 0.4rem;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
}

.fill-primary { background: var(--accent); }
.fill-warning { background: var(--accent-amber); }

/* ===================================================
   BÓVEDA SECRETA (MODAL & VISTA)
   =================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  background: #0F1E26;
  border: 1px solid rgba(0, 208, 132, 0.3);
  border-radius: var(--radius-md);
  padding: 2rem;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.vault-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.vault-table th, .vault-table td {
  padding: 0.75rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  word-break: break-word;
}

.vault-table th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Wrapper responsive de tablas - sin scroll horizontal en contenedor padre */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}

/* En móvil, las tablas de personal/bóveda se convierten en tarjetas verticales */
@media (max-width: 640px) {
  .vault-table thead { display: none; }
  .vault-table tr {
    display: block;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    padding: 0.5rem;
  }
  .vault-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.82rem;
  }
  .vault-table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
  }
  .vault-table td:last-child { border-bottom: none; }
}

/* Clases de utilidad */
.text-green { color: #10B981 !important; }
.text-red { color: #EF4444 !important; }
.text-code { font-family: monospace; font-size: 0.85rem; color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ===================================================
   ESTILOS DE CIBERSEGURIDAD, WAF & ESCÁNER DE ATAQUES
   =================================================== */

.security-score-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(135deg, rgba(0, 208, 132, 0.15) 0%, rgba(14, 56, 70, 0.4) 100%);
  border: 1px solid rgba(0, 208, 132, 0.4);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1rem;
}

.score-circle {
  width: 75px;
  height: 75px;
  border-radius: 50%;
  background: rgba(0, 208, 132, 0.2);
  border: 3px solid #00D084;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  color: #00D084;
  box-shadow: 0 0 20px rgba(0, 208, 132, 0.35);
  flex-shrink: 0;
}

.tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.test-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  transition: all 0.2s;
}

.test-passed {
  border-left: 4px solid #10B981;
}

.test-failed {
  border-left: 4px solid #EF4444;
}

.test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.payload-box {
  background: #060e12;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.45rem 0.65rem;
  border-radius: 4px;
  font-size: 0.8rem;
  word-break: break-all;
}

.payload-box code {
  color: #F87171;
  font-family: monospace;
}

.defense-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.45rem 0.65rem;
  border-radius: 4px;
  font-weight: 500;
}

/* ===================================================
   CATÁLOGO RIALTA, MUESTRARIO DE COLORES & DOSIFICACIONES
   =================================================== */

.catalogo-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  /* NO overflow-x: los botones hacen wrap automático en móvil */
}

.catalogo-filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.catalogo-filter-btn:hover {
  background: rgba(0, 208, 132, 0.15);
  color: #FFFFFF;
}

.catalogo-filter-btn.active {
  background: var(--accent);
  color: #0E3846;
  font-weight: 700;
  border-color: var(--accent);
}

/* ===================================================
   CATÁLOGO RIALTA - TARJETAS PRODUCTO PREMIUM v2
   =================================================== */

.product-card-rialta {
  background: linear-gradient(160deg, rgba(14, 40, 55, 0.9) 0%, rgba(8, 16, 22, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.35s, box-shadow 0.35s;
  position: relative;
  overflow: hidden;
  cursor: default;
}

.product-card-rialta::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(0, 208, 132, 0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
  z-index: 1;
}

.product-card-rialta:hover {
  border-color: rgba(0, 208, 132, 0.35);
  transform: translateY(-6px) scale(1.005);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 208, 132, 0.12);
}

.product-card-rialta:hover::before {
  opacity: 1;
}

/* Imagen hero de la tarjeta de producto */
.product-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  position: relative;
  overflow: hidden;
}

.product-card-image-wrap {
  width: 100%;
  height: 180px;
  overflow: hidden;
  position: relative;
}

.product-card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}

.product-card-rialta:hover .product-card-image-wrap img {
  transform: scale(1.08);
}

.product-card-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0,0,0,0.05) 0%,
    rgba(0,0,0,0.15) 40%,
    rgba(8, 16, 22, 0.85) 100%);
  pointer-events: none;
}

.product-card-badge-top {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.product-card-body {
  padding: 1.1rem 1.25rem 0;
  position: relative;
  z-index: 2;
}

.product-card-footer-area {
  padding: 0 1.25rem 1.1rem;
  position: relative;
  z-index: 2;
}

.product-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.product-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.product-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 1.8rem;
  margin-top: 0.2rem;
  line-height: 1.4;
}

.product-specs-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.spec-item {
  display: flex;
  flex-direction: column;
  font-size: 0.76rem;
  gap: 0.1rem;
}

.spec-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.spec-val {
  color: #FFFFFF;
  font-weight: 600;
}

.color-swatches-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 90px;
  overflow-y: auto;
  padding: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  margin: 0.5rem 0;
}

.color-swatch-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.color-swatch-item:hover {
  background: rgba(0, 208, 132, 0.15);
  border-color: var(--accent);
  transform: scale(1.06);
  color: #FFFFFF;
}

.swatch-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.patio-status-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.product-actions-footer {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 0.85rem;
  margin-top: 0.75rem;
}

.product-actions-footer button {
  flex: 1;
}

/* ===================================================
   INDUSTRIAL TOAST NOTIFICATIONS
   =================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 90vw;
  width: 380px;
  pointer-events: none;
}

.industrial-toast {
  pointer-events: auto;
  background: #11222C;
  color: #FFFFFF;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  animation: slideUpToast 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.industrial-toast.toast-error {
  border-left-color: var(--danger);
}

.industrial-toast.toast-warning {
  border-left-color: var(--warning);
}

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

/* ===================================================
   SPOTLIGHT SEARCH MODAL (LUPA UNIVERSAL)
   =================================================== */
.spotlight-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 16, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 8vh;
  padding-left: 1rem;
  padding-right: 1rem;
}

.spotlight-card {
  width: 100%;
  max-width: 650px;
  background: #0E1E26;
  border: 1px solid rgba(0, 208, 132, 0.35);
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 208, 132, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: spotlightFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes spotlightFadeIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.spotlight-header {
  display: flex;
  align-items: center;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  gap: 0.8rem;
}

.spotlight-lupa-icon {
  font-size: 1.35rem;
  color: var(--accent);
}

.spotlight-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 1.1rem;
  font-family: inherit;
  outline: none;
}

.spotlight-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.95rem;
}

.spotlight-kbd-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.spotlight-results {
  max-height: 52vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.spotlight-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
  border: 1px solid transparent;
  gap: 0.8rem;
}

.spotlight-item:hover,
.spotlight-item.selected {
  background: rgba(0, 208, 132, 0.12);
  border-color: rgba(0, 208, 132, 0.3);
}

.spotlight-item-main {
  flex: 1;
  min-width: 0;
}

.spotlight-category-tag {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.spotlight-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotlight-item-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

.spotlight-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.2rem;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.spotlight-footer-keys {
  display: flex;
  gap: 0.8rem;
}

.spotlight-footer-keys kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

/* ===================================================
   TARJETAS PRODUCTO - IMAGEN COVER (catalog v2)
   =================================================== */

.product-cover-container {
  position: relative;
  width: 100%;
  height: 175px;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.product-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card-rialta:hover .product-cover-image {
  transform: scale(1.07);
}

.product-cover-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0,0,0,0.0) 0%,
    rgba(0,0,0,0.1) 35%,
    rgba(8, 14, 20, 0.88) 100%
  );
  pointer-events: none;
}

.product-cover-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.product-cover-overlay-info {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge-mini-tag {
  background: rgba(0, 208, 132, 0.18);
  border: 1px solid rgba(0, 208, 132, 0.4);
  color: #00D084;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-id-tag {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: monospace;
  letter-spacing: 0.05em;
}

.glass-badge {
  backdrop-filter: blur(8px);
  background: rgba(14, 56, 70, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.product-card-body {
  padding: 1rem 1.25rem 0.25rem;
  position: relative;
  z-index: 2;
}

/* ===================================================
   KPI DASHBOARD - BANNER GERENCIA
   =================================================== */
.gerencia-kpi-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.kpi-card {
  background: linear-gradient(145deg, rgba(13, 30, 40, 0.95) 0%, rgba(8, 14, 20, 1) 100%);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.kpi-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.kpi-card.kpi-green::after { background: var(--accent); }
.kpi-card.kpi-amber::after { background: var(--accent-amber); }
.kpi-card.kpi-blue::after  { background: var(--accent-2); }
.kpi-card.kpi-red::after   { background: var(--accent-red); }

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 208, 132, 0.2);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 20px rgba(0, 208, 132, 0.06);
}

.kpi-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #FFFFFF;
}

.kpi-value.kpi-green  { color: #00D084; }
.kpi-value.kpi-amber  { color: #F59E0B; }
.kpi-value.kpi-blue   { color: #00B8D4; }
.kpi-value.kpi-red    { color: #EF4444; }

.kpi-delta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.kpi-icon-bg {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  opacity: 0.06;
  user-select: none;
  pointer-events: none;
}

/* ===================================================
   ANIMACIONES DE ENTRADA SCROLL-BASED
   =================================================== */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.anim-fade-up {
  animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.anim-fade-up:nth-child(1) { animation-delay: 0ms; }
.anim-fade-up:nth-child(2) { animation-delay: 60ms; }
.anim-fade-up:nth-child(3) { animation-delay: 120ms; }
.anim-fade-up:nth-child(4) { animation-delay: 180ms; }
.anim-fade-up:nth-child(5) { animation-delay: 240ms; }
.anim-fade-up:nth-child(6) { animation-delay: 300ms; }

/* ===================================================
   VISUAL HERO BANNER - INDUSTRIAL (UPGRADES)
   =================================================== */
.visual-hero-banner {
  border-radius: var(--radius-lg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  border: 1px solid rgba(0, 208, 132, 0.15);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  position: relative;
}

.visual-hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 208, 132, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.visual-hero-content {
  padding: 2rem 2rem 1.75rem;
  position: relative;
  z-index: 2;
}

.visual-hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0.5rem 0;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.visual-hero-desc {
  max-width: 600px;
  line-height: 1.6;
  color: rgba(255,255,255,0.65);
}

.visual-hero-telemetry-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.75rem;
}

.telemetry-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  backdrop-filter: blur(8px);
}

.telemetry-label {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.45);
  font-weight: 700;
}

.live-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00D084;
  box-shadow: 0 0 0 0 rgba(0, 208, 132, 0.6);
  animation: livePulse 1.8s ease-out infinite;
  flex-shrink: 0;
}

@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 208, 132, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(0, 208, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 208, 132, 0); }
}

/* ===================================================
   UTILITY EXTRAS
   =================================================== */
.text-accent   { color: var(--accent) !important; }
.text-blue     { color: var(--accent-2) !important; }
.text-white    { color: #FFFFFF !important; }
.text-small    { font-size: 0.82rem; }
.font-bold     { font-weight: 700; }
.mt-1 { margin-top: 0.35rem; }
.mt-2 { margin-top: 0.75rem; }
.mt-3 { margin-top: 1.25rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.35rem; }
.mb-2 { margin-bottom: 0.75rem; }
.mb-3 { margin-bottom: 1.25rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }
.p-2  { padding: 0.75rem; }
.p-4  { padding: 1.5rem; }
.rounded { border-radius: var(--radius-sm); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.d-flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.35rem; }
.gap-2 { gap: 0.75rem; }
.flex-wrap { flex-wrap: wrap; }
.col-span-full { grid-column: 1 / -1; }
.bg-dark { background: rgba(0,0,0,0.35); }
.permiso-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.permiso-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ===================================================
   GERENCIA DUAL PANEL (CHART + FEED)
   =================================================== */
.gerencia-dual-panel {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* MINI BAR CHART - Producción Semanal */
.prod-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.prod-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.prod-bar-day {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  width: 28px;
  flex-shrink: 0;
}

.prod-bar-track {
  flex: 1;
  height: 22px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

.prod-bar-fill {
  height: 100%;
  width: var(--bar-pct, 0%);
  background: var(--bar-color, var(--accent));
  border-radius: 6px;
  position: relative;
  animation: barGrow 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--bar-idx, 0) * 80ms);
}

.prod-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  border-radius: 6px 6px 0 0;
}

@keyframes barGrow {
  from { width: 0; opacity: 0.3; }
  to   { width: var(--bar-pct, 0%); opacity: 1; }
}

.prod-bar-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.prod-bar-footer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

/* ACTIVITY FEED */
.activity-feed {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item:hover {
  background: rgba(255,255,255,0.02);
  margin: 0 -0.5rem;
  padding: 0.65rem 0.5rem;
  border-radius: 8px;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-time {
  margin-top: 0.2rem;
}

/* GLASS BADGE VARIANT */
.glass-badge {
  background: rgba(14, 56, 70, 0.65) !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 208, 132, 0.25) !important;
}

/* ML-AUTO UTILITY */
.ml-auto {
  margin-left: auto;
}

/* ===================================================
   EAN SCANNER PANEL — REDISEÑO PREMIUM
   =================================================== */
.ean-panel {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(0, 208, 132, 0.18);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ean-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(0, 208, 132, 0.05);
}

.ean-panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
}

.ean-category {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.ean-category:last-child {
  border-bottom: none;
}

.ean-category-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cat-color, var(--accent));
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ean-btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ean-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-main);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: var(--font-family);
  white-space: nowrap;
}

.ean-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--btn-accent, var(--accent));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3), 0 0 0 1px var(--btn-accent, var(--accent));
}

.ean-btn:active {
  transform: translateY(0);
}

.ean-btn-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===================================================
   LOGIN SCREEN — Pantalla de acceso obligatoria
   =================================================== */
.login-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse at 30% 40%, rgba(0, 208, 132, 0.12) 0%, transparent 60%),
              linear-gradient(135deg, #040C12 0%, #0A1A24 50%, #050E14 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: opacity 0.4s ease;
}

.login-screen-overlay.login-fade-out {
  opacity: 0;
  pointer-events: none;
}

.login-screen-card {
  background: rgba(10, 25, 35, 0.95);
  border: 1px solid rgba(0, 208, 132, 0.25);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 0 60px rgba(0, 208, 132, 0.08), 0 30px 60px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
  animation: loginCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.login-logo-block {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.login-logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #00a066 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: #0A1A24;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 208, 132, 0.35);
}

.login-logo-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.1em;
}

.login-logo-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
}

.login-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.4;
}

.login-form-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.login-field-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  font-family: var(--font-family);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.login-field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 208, 132, 0.15);
}

.login-field-input::placeholder {
  color: rgba(122,155,173,0.45);
}

.login-submit-btn {
  width: 100%;
  padding: 0.9rem;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.25rem;
  border-radius: 10px;
}

.login-error {
  color: #f87171;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  background: rgba(248, 113, 113, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.login-hint {
  font-size: 0.72rem;
  color: rgba(122,155,173,0.45);
  text-align: center;
  margin-top: 1.25rem;
  margin-bottom: 0;
}

/* Shake animation para error */
.login-shake {
  animation: loginShake 0.5s ease;
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

/* KPI clickable */
.kpi-clickable {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.kpi-clickable:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.kpi-arrow {
  position: absolute;
  bottom: 0.6rem;
  right: 0.75rem;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
}
.kpi-clickable:hover .kpi-arrow {
  opacity: 0.6;
  transform: translateX(3px);
}

/* Vault filter bar */
.vault-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}
.vault-period-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.vault-period-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-family);
}
.vault-period-btn:hover { background: rgba(0,208,132,0.1); color: #fff; }
.vault-period-btn.active {
  background: var(--accent);
  color: #0E3846;
  border-color: var(--accent);
}
.vault-filter-right {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}
.vault-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}
@media (max-width: 700px) { .vault-kpi-row { grid-template-columns: repeat(2, 1fr); } }
.vault-kpi-box {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.vault-kpi-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.vault-kpi-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

/* Role lock styles */
.role-btn-locked {
  opacity: 0.45;
  cursor: not-allowed !important;
}
.role-lock-icon {
  font-size: 0.7rem;
  margin-left: 0.25rem;
}
