/* ==========================================================================
   MAINTTRACK - HOTEL INVENTORY CONTROL DESIGN SYSTEM
   Mobile-First, High Contrast, Ultra-Responsive & Touch Friendly
   ========================================================================== */

:root {
  --bg-main: #0B0F19;
  --bg-card: #161C2E;
  --bg-card-hover: #1E263D;
  --bg-header: #111625;
  --bg-input: #0F1422;
  
  --border-color: #26304A;
  --border-active: #3B82F6;

  --accent-blue: #3B82F6;
  --accent-cyan: #06B6D4;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #EF4444;

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-glow-cyan: 0 0 25px rgba(6, 182, 212, 0.35);
  --shadow-glow-emerald: 0 0 25px rgba(16, 185, 129, 0.35);
  --shadow-glow-rose: 0 0 25px rgba(239, 68, 68, 0.35);
}

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

html, body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 40px;
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  box-sizing: border-box;
}

/* ==================== ENTERPRISE SAAS HEADER ==================== */
.app-header {
  background: rgba(15, 23, 42, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 0;
}

.brand-icon-wrapper {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #ffffff;
  line-height: 1;
}

.brand-subtitle {
  font-size: 0.65rem;
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 3px;
}

.header-user-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 12px 4px 5px;
  border-radius: 30px;
  transition: all 0.2s ease;
}

.user-profile-menu:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(6, 182, 212, 0.4);
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background: #10b981;
  border: 2px solid #0f172a;
  border-radius: 50%;
}

.user-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.user-display-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f8fafc;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-master {
  color: var(--accent-blue);
}

.badge-owner {
  color: var(--accent-amber);
}

.badge-tech {
  color: var(--accent-emerald);
}

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

.header-btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-btn-icon:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: #ffffff;
}

.header-btn-logout {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
}

@media (max-width: 600px) {
  .app-header {
    padding: 8px 12px;
  }
  .brand-subtitle {
    display: none;
  }
  .user-display-name {
    max-width: 75px;
    font-size: 0.76rem;
  }
  .logout-text {
    display: none;
  }
  .header-btn-logout {
    padding: 0 10px;
  }
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: var(--accent-rose);
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-rose);
}

/* ==================== PASSWORD INPUT TOGGLE ==================== */
.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-input-wrapper .form-input {
  padding-right: 44px;
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-password:hover {
  color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
}

/* ==================== PRODUCT IMAGE UPLOAD & THUMBNAILS ==================== */
.image-upload-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.image-preview-box {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.image-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-img {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.prod-thumb-img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
}

.product-badge-icon-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--accent-cyan);
  flex-shrink: 0;
}

/* ==================== TOAST & NOTIFICATIONS ==================== */
.toast-container {
  position: fixed;
  top: 70px;
  right: 16px;
  left: 16px;
  max-width: 500px;
  margin: 0 auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(22, 28, 46, 0.95);
  border-left: 4px solid var(--accent-amber);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideDown 0.3s ease-out;
}

.toast-danger {
  border-left-color: var(--accent-rose);
}

.toast-icon {
  color: var(--accent-rose);
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-content h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.toast-content p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

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

/* ==================== MAIN CONTENT ==================== */
.app-content {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 16px 20px;
  box-sizing: border-box;
}

.role-view {
  display: none;
}

.role-view.active {
  display: block;
}

/* ==================== VISTA TÉCNICO ==================== */
.tech-hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tech-welcome h2 {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.tech-welcome p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* BOTÓN GIGANTE ESCÁNER QR */
.btn-giant-scan {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, #0284C7, #0D9488);
  border: none;
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-glow-cyan);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
  overflow: hidden;
  min-height: 180px;
  text-align: center;
}

.btn-giant-scan:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(6, 182, 212, 0.55);
}

.btn-giant-scan:active {
  transform: scale(0.98);
}

.btn-giant-scan i {
  width: 52px;
  height: 52px;
}

.btn-giant-scan span {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.btn-giant-scan small {
  font-size: 0.82rem;
  opacity: 0.9;
  font-weight: 400;
}

.scan-pulse {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
  animation: pulseGlow 3s infinite linear;
  pointer-events: none;
}

@keyframes pulseGlow {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.9; }
  100% { transform: scale(0.8); opacity: 0.5; }
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 4px 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.divider span {
  padding: 0 12px;
}

/* Quick Products Grid */
.quick-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.product-card-tech {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  transition: all 0.2s ease;
}

.product-card-tech:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.prod-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.prod-card-identity {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.prod-info {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.prod-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prod-info p {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-tag {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.stock-tag.low-stock {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-rose);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ==================== VISTA MASTER ==================== */

.master-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--bg-card);
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  width: 100%;
}

.tab-btn {
  flex: 1 1 calc(25% - 8px);
  min-width: 110px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

@media (max-width: 580px) {
  .tab-btn {
    flex: 1 1 calc(50% - 8px);
    font-size: 0.8rem;
    padding: 8px 10px;
  }
}

.tab-btn.active {
  background: var(--accent-blue);
  color: #fff;
}

.badge-alert-count {
  background: var(--accent-rose);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.master-tab-content {
  display: none;
}

.master-tab-content.active {
  display: block;
}

/* KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.kpi-card.kpi-warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, var(--bg-card), rgba(245, 158, 11, 0.08));
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.icon-blue { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }
.icon-amber { background: rgba(245, 158, 11, 0.2); color: var(--accent-amber); }
.icon-emerald { background: rgba(16, 185, 129, 0.2); color: var(--accent-emerald); }

.kpi-val {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-mono);
  display: block;
  line-height: 1;
}

.kpi-lbl {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Section Cards */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.section-header h3 {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-icon {
  color: var(--accent-amber);
  animation: pulseAmber 2s infinite;
}

@keyframes pulseAmber {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.section-tag {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.section-tag.tag-warning {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-rose);
}

/* Alerts List */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-item-card {
  background: var(--bg-input);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 4px solid var(--accent-rose);
  padding: 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.alert-item-info h4 {
  font-size: 0.92rem;
  font-weight: 600;
}

.alert-item-info p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Email log list */
.email-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
}

.email-log-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.82rem;
}

.email-log-meta {
  display: flex;
  justify-content: space-between;
  color: var(--accent-cyan);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 4px;
  flex-wrap: wrap;
  gap: 4px;
}

/* Search Box & Controls */
.search-box {
  position: relative;
  width: 100%;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px 12px 42px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent-blue);
}

.action-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.action-bar .search-box {
  flex: 1 1 240px;
}

.action-bar .btn-primary {
  flex-shrink: 0;
}

/* ==================== MASTER INVENTORY CARD LIST (ZERO SCROLL & HYPER-CLEAN) ==================== */
.master-products-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.master-product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.master-product-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}

.mp-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.mp-card-thumb {
  flex-shrink: 0;
}

.mp-card-thumb img {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
}

.mp-card-title-group {
  flex: 1;
  min-width: 0;
}

.mp-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.mp-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.mp-card-loc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mp-card-id {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--accent-cyan);
}

.mp-card-stock-row {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-input);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
  box-sizing: border-box;
}

.mp-stock-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mp-stock-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.mp-min-stock {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.mp-card-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.mp-card-actions .btn-sm {
  width: 100%;
  justify-content: center;
  min-height: 36px;
  padding: 6px 8px;
  font-size: 0.8rem;
  box-sizing: border-box;
}

@media (max-width: 580px) {
  .mp-card-actions {
    grid-template-columns: 1fr 1fr;
  }
}

/* Data Table 100% Full Width (Zero Side Scroll) */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  text-align: left;
  min-width: 0;
  table-layout: auto;
}

.data-table th, .data-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  vertical-align: middle;
  word-break: break-word;
}

@media (max-width: 640px) {
  .table-responsive {
    border: none;
    background: transparent;
  }
  .data-table th:nth-child(1), .data-table td:nth-child(1) {
    display: none;
  }
  .data-table th, .data-table td {
    padding: 8px 6px;
    font-size: 0.78rem;
  }
  .table-actions-cell {
    gap: 4px;
  }
  .table-actions-cell .btn-sm {
    padding: 4px 6px;
    font-size: 0.72rem;
  }
}

.table-actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.data-table th {
  background: var(--bg-header);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Logs List */
.logs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-entry {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.log-entry-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.log-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.log-details h4 {
  font-size: 0.88rem;
  font-weight: 600;
}

.log-details p {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.log-qty {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-amber);
  font-size: 0.95rem;
  text-align: right;
  flex-shrink: 0;
}

/* ==================== BUTTONS & INPUTS ==================== */
.btn-primary {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-primary:hover {
  background: #2563EB;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 38px;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-secondary);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  min-height: 32px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 0.8rem;
  cursor: pointer;
}

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  animation: modalPop 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.modal-body {
  padding: 20px;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* LOGIN MODAL SPECIFICS */
.login-brand-box {
  text-align: center;
  margin-bottom: 20px;
}

.login-brand-box h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.login-brand-box p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Scanner viewport */
.qr-camera-viewport {
  width: 240px;
  height: 240px;
  max-width: 240px;
  margin: 0 auto 12px auto;
  border-radius: 16px;
  overflow: hidden;
  border: 2.5px solid var(--accent-cyan);
  background: #000;
  min-height: 240px;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.35);
}

.scanner-fallback-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Retiro de Material Form */
.product-summary-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.product-badge-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.prod-title {
  font-size: 1rem;
  font-weight: 700;
}

.prod-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* STEPPER NUMÉRICO EXTRAGRANDE */
.number-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}

.btn-step {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  background: var(--bg-card-hover);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-step:active {
  transform: scale(0.92);
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.stepper-input {
  width: 90px;
  height: 60px;
  background: var(--bg-input);
  border: 2px solid var(--accent-blue);
  border-radius: var(--radius-md);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.preset-chips {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.chip-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.tech-signature-info {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.btn-giant-confirm {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-glow-emerald);
  transition: all 0.2s ease;
  min-height: 52px;
}

.btn-giant-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

/* Form Styles */
.form-group {
  margin-bottom: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-blue);
}

/* Modal QR Code Label */
.qr-label-printable {
  background: #FFFFFF;
  color: #000000;
  padding: 24px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  display: inline-block;
  width: 100%;
  max-width: 280px;
}

.qr-hotel-header {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #475569;
  border-bottom: 2px solid #000;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.qr-label-printable h3 {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  color: #000;
  margin-bottom: 12px;
}

.qr-code-box {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.qr-code-box canvas, .qr-code-box img {
  border: 4px solid #fff;
  border-radius: 4px;
}

.qr-code-id {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: #1E293B;
}

.qr-code-loc {
  font-size: 0.75rem;
  color: #64748B;
}

.qr-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* DIN A4 STICKER SHEET PREVIEW & PRINT ENGINE */
.a4-page {
  width: 210mm;
  min-height: 297mm;
  background: #ffffff;
  color: #0f172a;
  padding: 12mm 10mm;
  margin: 0 auto 20px auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 8mm 6mm;
  box-sizing: border-box;
}

.sticker-card-item {
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  background: #ffffff;
  box-sizing: border-box;
  overflow: hidden;
  height: 50mm;
}

.sticker-title {
  font-family: var(--font-main);
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.15;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
}

.sticker-qr-box {
  width: 32mm;
  height: 32mm;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticker-qr-box canvas, .sticker-qr-box img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.sticker-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin-top: 2px;
}

/* PRINT STYLES */
@media print {
  body * {
    visibility: hidden !important;
  }
  #a4StickerPagesContainer, #a4StickerPagesContainer * {
    visibility: visible !important;
  }
  #a4StickerPagesContainer {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }
  .a4-page {
    box-shadow: none !important;
    margin: 0 !important;
    page-break-after: always !important;
    break-after: page !important;
    width: 210mm !important;
    height: 297mm !important;
  }
  #modalViewQR, #modalViewQR * {
    visibility: visible !important;
  }
}

/* ==================== FOOTER LEGAL & PRIVACY ==================== */
.app-footer {
  margin-top: 30px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-header);
  border-radius: var(--radius-md);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-family: var(--font-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.2s ease;
}

.btn-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

#modalLegalTerms {
  z-index: 999999 !important;
}

.badge-status-online {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
