:root {
  --bg: #f7f8fb;
  --ink: #111827;
  --muted: #667085;
  --line: rgba(17, 24, 39, 0.08);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.76);
  --accent: #00a3ff;
  --accent-strong: #0077ff;
  --accent-soft: rgba(0, 163, 255, 0.13);
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
}

* {
  letter-spacing: 0;
}

.planning-shell {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 8%, rgba(0, 163, 255, 0.13), transparent 28rem),
    radial-gradient(circle at 86% 14%, rgba(17, 24, 39, 0.06), transparent 22rem),
    linear-gradient(135deg, #fbfcfe 0%, var(--bg) 48%, #eef3f8 100%);
}

.app-topbar {
  margin: 18px auto 0;
  width: min(1280px, calc(100% - 32px));
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.module-icon,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid rgba(0, 119, 255, 0.16);
}

.module-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.format-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 119, 255, 0.18);
  background: var(--accent-soft);
  color: #075985;
  font-size: 11px;
  font-weight: 800;
}

.format-chip {
  padding: 8px 12px;
  border-radius: 999px;
}

.status-pill {
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}

.quality-badge {
  display: inline-flex;
  align-items: center;
  min-width: 86px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  border: 1px solid rgba(17, 24, 39, 0.08);
}

.quality-badge-pendiente {
  color: #92400e;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.24);
}

.quality-badge-aprobado {
  color: #047857;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.24);
}

.quality-badge-no-aceptado {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.13);
  border-color: rgba(239, 68, 68, 0.24);
}

.quality-badge-desviacion {
  color: #7c2d12;
  background: rgba(249, 115, 22, 0.14);
  border-color: rgba(249, 115, 22, 0.24);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(0, 163, 255, 0.13), 0 0 16px rgba(0, 163, 255, 0.54);
}

.glass-panel {
  color: var(--ink);
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 119, 255, 0.2);
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.11), 0 0 0 1px rgba(0, 163, 255, 0.06);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.panel-heading svg,
.accent-text {
  color: var(--accent-strong);
}

.muted-text {
  color: var(--muted);
}

.planning-shell label,
.planning-shell .field-label {
  color: #667085;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.planning-shell input:not([type="range"]),
.planning-shell select,
.planning-shell textarea {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(17, 24, 39, 0.09);
  border-radius: 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.planning-shell input:not([type="range"]):focus,
.planning-shell select:focus,
.planning-shell textarea:focus {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 119, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(0, 163, 255, 0.12);
}

.planning-shell input[type="range"] {
  accent-color: var(--accent);
}

.planning-shell .text-slate-400,
.planning-shell .text-slate-500,
.planning-shell .text-slate-600,
.planning-shell .text-slate-700,
.planning-shell .text-slate-800 {
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover,
.icon-button:hover,
.link-action:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 30px rgba(0, 119, 255, 0.26);
}

.btn-primary:hover {
  box-shadow: 0 16px 36px rgba(0, 119, 255, 0.34);
}

.btn-secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(17, 24, 39, 0.1);
}

.btn-compact {
  min-height: 32px;
  padding: 7px 12px;
}

.icon-button {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.link-action {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  transition: transform 160ms ease, color 160ms ease;
}

.glass-subpanel,
.preview-stage,
.quick-action {
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.preview-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(248, 250, 252, 0.42)),
    rgba(255, 255, 255, 0.48);
}

#screen-label-preview {
  border: 1px solid rgba(17, 24, 39, 0.14);
  box-shadow: 0 18px 36px rgba(16, 24, 40, 0.12);
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead {
  background: transparent;
}

.data-table th {
  color: #667085;
  font-size: 10px;
  font-weight: 800;
  border-bottom: 1px solid var(--line);
}

.data-table tbody {
  border: 0;
}

.data-table tbody tr {
  transition: background 160ms ease, transform 160ms ease;
}

.data-table tbody tr:hover {
  background: rgba(0, 163, 255, 0.06);
}

.data-table td {
  border-bottom: 1px solid rgba(17, 24, 39, 0.06);
}

#notification-hub > div:not(.empty-notification-message) {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 14px;
}

.notification-title,
.notification-meta,
.notification-meta span {
  display: inline-flex;
  align-items: center;
}

.notification-title {
  gap: 5px;
  color: var(--accent-strong);
}

.notification-meta {
  flex-wrap: wrap;
  gap: 6px;
}

.notification-meta span {
  max-width: 100%;
  gap: 4px;
  padding: 3px 7px;
  overflow: hidden;
  color: #475467;
  background: rgba(0, 163, 255, 0.08);
  border: 1px solid rgba(0, 119, 255, 0.12);
  border-radius: 999px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.notification-action {
  width: 100%;
  min-height: 30px;
}

.side-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 16px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.side-menu-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(0, 119, 255, 0.2);
}

.print-hint,
.app-footer {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.38);
  border-top: 1px solid rgba(17, 24, 39, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#toast-container > div {
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (max-width: 640px) {
  .app-topbar {
    width: min(100% - 20px, 1280px);
    margin-top: 10px;
    border-radius: 18px;
  }

  .btn {
    padding-inline: 12px;
  }
}

/* Estilos dinámicos para control total de la impresora térmica */
@media print {
  @page {
    size: 3in 2in;
    margin: 0;
  }

  html,
  body {
    width: 3in !important;
    height: 2in !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body > *:not(#print-area-wrapper) {
    display: none !important;
  }

  #print-area-wrapper {
    display: flex !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 3in !important;
    height: 2in !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    background-color: #ffffff !important;
    color: #000000 !important;
    align-items: center;
    justify-content: center;
  }

  .thermal-border {
    border: 2px solid #000000 !important;
  }

  .thermal-divide {
    border-color: #000000 !important;
  }
}

#print-area-wrapper {
  display: none;
}
