/* ═══════════════════════════════════════════════════════════
   MILLARES — Sistema de Seguimiento
   Paleta: Blanco / Negro / Rojo #D90000
═══════════════════════════════════════════════════════════ */

:root {
  --red:     #D90000;
  --red-dk:  #A80000;
  --black:   #0A0A0A;
  --dark:    #111111;
  --mid:     #1C1C1C;
  --panel:   #181818;
  --border:  #2A2A2A;
  --muted:   #555555;
  --light:   #AAAAAA;
  --white:   #F5F5F5;
  --pure:    #FFFFFF;

  --font-display: 'Bebas Neue', sans-serif;
  --font-cond:    'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;

  --radius: 4px;
  --shadow: 0 8px 40px rgba(0,0,0,0.6);
  --glow-red: 0 0 20px rgba(217,0,0,0.3);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

.red { color: var(--red); }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   INTRO SCREEN
═══════════════════════════════════════════════════════════ */
#intro-screen {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

#intro-screen.fade-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.scanline-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* FACTORY SCENE */
.factory-scene {
  width: 100%;
  max-width: 600px;
  height: 200px;
  position: relative;
  margin-bottom: 40px;
}

.conveyor-belt {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  height: 50px;
}

.belt-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 14px;
  background: var(--mid);
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.belt-item {
  color: var(--border);
  font-size: 20px;
  line-height: 0;
  animation: beltMove 0.6s linear infinite;
  min-width: 50px;
  text-align: center;
}

@keyframes beltMove {
  from { transform: translateX(0); }
  to   { transform: translateX(-50px); }
}

.products-on-belt {
  position: absolute;
  bottom: 14px;
  left: -100px;
  display: flex;
  gap: 80px;
  animation: productFlow 2.5s linear infinite;
}

.product-box {
  width: 40px;
  height: 36px;
  border: 2px solid var(--red);
  background: var(--mid);
  position: relative;
  border-radius: 2px;
}
.box-inner {
  position: absolute;
  inset: 4px;
  border: 1px solid var(--border);
}

@keyframes productFlow {
  from { transform: translateX(0); }
  to   { transform: translateX(800px); }
}

.factory-elements {
  position: absolute;
  top: 0;
  right: 20px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
}

.gear {
  color: var(--muted);
  line-height: 1;
  user-select: none;
}
.gear-big  { font-size: 64px; animation: spinGear 3s linear infinite; }
.gear-small { font-size: 36px; animation: spinGear 3s linear infinite reverse; margin-bottom: 10px; }

@keyframes spinGear {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.smoke-stack { position: relative; display: flex; flex-direction: column; align-items: center; }

.chimney {
  width: 24px;
  height: 60px;
  background: var(--mid);
  border: 1px solid var(--border);
  border-radius: 2px;
}

.smoke {
  width: 12px;
  height: 12px;
  background: rgba(100,100,100,0.5);
  border-radius: 50%;
  position: absolute;
  top: 0;
  animation: smokeRise 2s ease-out infinite;
}
.s1 { animation-delay: 0s;    left: 2px; }
.s2 { animation-delay: 0.6s;  left: -4px; }
.s3 { animation-delay: 1.2s;  left: 6px; }

@keyframes smokeRise {
  0%   { transform: translateY(0) scale(0.5); opacity: 0.6; }
  100% { transform: translateY(-50px) scale(2); opacity: 0; }
}

.spark-container {
  position: absolute;
  left: 30%;
  bottom: 70px;
}

.spark {
  width: 3px;
  height: 3px;
  background: var(--red);
  border-radius: 50%;
  position: absolute;
  animation: sparkFly 1s ease-out infinite;
}
.spark:nth-child(1) { animation-delay: 0s; }
.spark:nth-child(2) { animation-delay: 0.3s; left: 10px; }
.spark:nth-child(3) { animation-delay: 0.6s; left: -6px; }

@keyframes sparkFly {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx, 20px), -30px) scale(0); opacity: 0; }
}
.spark:nth-child(1) { --dx: 15px; }
.spark:nth-child(2) { --dx: -20px; }
.spark:nth-child(3) { --dx: 25px; }

/* INTRO BRAND */
.intro-brand {
  text-align: center;
  z-index: 3;
  animation: introFadeIn 0.6s ease 0.3s both;
}

.brand-text-intro {
  font-family: var(--font-display);
  font-size: clamp(60px, 16vw, 120px);
  color: var(--pure);
  letter-spacing: 0.05em;
  line-height: 1;
  text-shadow: 0 0 40px rgba(217,0,0,0.4);
}

.tagline-intro {
  font-family: var(--font-cond);
  font-size: 14px;
  letter-spacing: 0.4em;
  color: var(--muted);
  margin-top: 8px;
  animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

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

/* ═══════════════════════════════════════════════════════════
   MAIN APP
═══════════════════════════════════════════════════════════ */
#main-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: appReveal 0.6s ease both;
}

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

/* HEADER */
.site-header {
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.logo {
  font-family: var(--font-display);
  font-size: 38px;
  color: var(--pure);
  text-decoration: none;
  letter-spacing: 0.04em;
  line-height: 1;
}

.header-sub {
  font-family: var(--font-cond);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--muted);
  text-transform: uppercase;
}

.header-stripe {
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0%, var(--red-dk) 60%, transparent 100%);
}

/* VIEWS */
.view { display: none; flex: 1; }
.view.active { display: flex; }

/* ═══════════════════════════════════════════════════════════
   VISTA: BÚSQUEDA
═══════════════════════════════════════════════════════════ */
#view-search {
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  position: relative;
  overflow: hidden;
}

#view-search::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(217,0,0,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.search-container {
  width: 100%;
  max-width: 540px;
  position: relative;
  z-index: 1;
}

.search-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 48px 40px;
  box-shadow: var(--shadow);
}

.card-eyebrow {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--red);
  margin-bottom: 12px;
}

.card-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 8vw, 56px);
  color: var(--pure);
  line-height: 1.0;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.card-desc {
  font-size: 14px;
  color: var(--light);
  margin-bottom: 32px;
  line-height: 1.6;
}

.input-group {
  display: flex;
  gap: 12px;
}

.order-input {
  flex: 1;
  background: var(--mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  color: var(--pure);
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.order-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(217,0,0,0.15);
}

.order-input::placeholder {
  color: var(--muted);
  font-size: 22px;
}

.btn-search {
  background: var(--red);
  border: none;
  border-radius: var(--radius);
  padding: 16px 24px;
  color: var(--pure);
  font-family: var(--font-cond);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn-search:hover  { background: var(--red-dk); }
.btn-search:active { transform: scale(0.97); }

.btn-arrow { font-size: 18px; }

.search-error {
  margin-top: 16px;
  background: rgba(217,0,0,0.12);
  border: 1px solid rgba(217,0,0,0.4);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #FF6B6B;
}

.error-icon {
  background: var(--red);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

.search-loading {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--light);
  font-size: 13px;
}

.loading-dots { display: flex; gap: 4px; }
.loading-dots span {
  width: 6px; height: 6px;
  background: var(--red);
  border-radius: 50%;
  animation: dot-pulse 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1); opacity: 1; }
}

.deco-grid {
  position: absolute;
  top: -40px;
  right: -60px;
  width: 200px;
  height: 200px;
  z-index: 0;
  pointer-events: none;
}
.deco-line {
  position: absolute;
  background: var(--border);
  opacity: 0.4;
}
.deco-line:nth-child(1) { width: 100px; height: 1px; top: 40px; left: 0; }
.deco-line:nth-child(2) { width: 1px; height: 80px; top: 0; left: 60px; }
.deco-line:nth-child(3) { width: 60px; height: 1px; top: 100px; left: 80px; }
.deco-circle {
  position: absolute;
  width: 80px; height: 80px;
  border: 1px solid var(--red);
  border-radius: 50%;
  opacity: 0.15;
  bottom: 0; right: 0;
}

/* ═══════════════════════════════════════════════════════════
   VISTA: RESULTADO
═══════════════════════════════════════════════════════════ */
#view-result {
  flex-direction: column;
  padding: 40px 24px 60px;
}

.result-container {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  animation: slideUp 0.4s ease both;
}

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

.btn-back {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  color: var(--light);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 32px;
  transition: border-color 0.2s, color 0.2s;
}
.btn-back:hover { border-color: var(--red); color: var(--red); }

.result-header {
  margin-bottom: 28px;
}

.result-code-label {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--red);
  margin-bottom: 4px;
}

.result-code {
  font-family: var(--font-display);
  font-size: clamp(48px, 10vw, 80px);
  color: var(--pure);
  letter-spacing: 0.1em;
  line-height: 1;
}

.result-client {
  font-size: 16px;
  color: var(--light);
  margin-top: 6px;
}

/* STATUS CARD */
.status-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.status-label {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--muted);
  margin-bottom: 12px;
}

.status-badge {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.05em;
  color: var(--pure);
  margin-bottom: 24px;
}

/* PROGRESS STEPS */
.progress-steps {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.step-item {
  flex: 1;
  min-width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.step-item::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.step-item:last-child::after { display: none; }

.step-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--border);
  position: relative;
  z-index: 1;
  transition: all 0.3s;
  flex-shrink: 0;
}

.step-item.done .step-dot     { background: var(--red); border-color: var(--red); }
.step-item.current .step-dot  { background: var(--black); border-color: var(--red); box-shadow: var(--glow-red); animation: pulse-dot 1.5s ease infinite; }
.step-item.current::after { background: linear-gradient(90deg, var(--red), var(--border)); }
.step-item.done::after { background: var(--red); }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 6px rgba(217,0,0,0.4); }
  50%       { box-shadow: 0 0 16px rgba(217,0,0,0.8); }
}

.step-label {
  font-family: var(--font-cond);
  font-size: 9px;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.step-item.done .step-label,
.step-item.current .step-label { color: var(--light); }

/* DETAIL GRID */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  margin-bottom: 24px;
}

.detail-card, .image-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
}

.detail-label, .image-label {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--muted);
  margin-bottom: 14px;
}

.detail-content {
  font-size: 15px;
  color: var(--white);
  line-height: 1.7;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.detail-date-row {
  display: flex;
  gap: 24px;
  margin-bottom: 12px;
}

.detail-meta { display: flex; flex-direction: column; gap: 2px; }
.meta-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
}
.meta-val { font-size: 14px; color: var(--white); font-weight: 500; }

.detail-obs { display: flex; flex-direction: column; gap: 2px; }

/* IMAGE CARD */
.image-card { min-width: 200px; max-width: 240px; }

.image-wrap {
  width: 180px;
  height: 180px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--mid);
  border: 1px solid var(--border);
  position: relative;
}

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

.image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 12px;
}

/* WHATSAPP SECTION */
.whatsapp-section { margin-bottom: 24px; }

.wsp-card {
  background: linear-gradient(135deg, rgba(37,211,102,0.1), rgba(37,211,102,0.04));
  border: 1px solid rgba(37,211,102,0.3);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.wsp-icon {
  width: 44px;
  height: 44px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.wsp-text { flex: 1; min-width: 160px; }
.wsp-text strong { color: var(--pure); display: block; margin-bottom: 2px; }
.wsp-text p { font-size: 13px; color: var(--light); }

.btn-whatsapp {
  background: #25D366;
  color: var(--black);
  border: none;
  border-radius: var(--radius);
  padding: 12px 20px;
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
}
.btn-whatsapp:hover  { background: #1FB855; }
.btn-whatsapp:active { transform: scale(0.97); }

/* ═══════════════════════════════════════════════════════════
   VISTA: ADMIN
═══════════════════════════════════════════════════════════ */
#view-admin {
  flex-direction: column;
  padding: 40px 24px 60px;
}

.admin-container {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.admin-badge {
  background: var(--red);
  color: var(--pure);
  font-family: var(--font-cond);
  font-size: 10px;
  letter-spacing: 0.3em;
  padding: 4px 10px;
  border-radius: 2px;
}

.admin-title {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--pure);
  letter-spacing: 0.03em;
  flex: 1;
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* TABS */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 20px;
  color: var(--muted);
  font-family: var(--font-cond);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -1px;
}
.tab-btn:hover       { color: var(--light); }
.tab-btn.active      { color: var(--pure); border-bottom-color: var(--red); }

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

/* FORM */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

.form-group label {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--light);
  text-transform: uppercase;
}
.req { color: var(--red); }

.form-input, .form-textarea {
  background: var(--mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(217,0,0,0.1);
}
.form-textarea { resize: vertical; }

/* UPLOAD */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-area:hover { border-color: var(--red); background: rgba(217,0,0,0.04); }
.upload-icon { font-size: 28px; margin-bottom: 8px; }
.upload-text { font-size: 14px; color: var(--light); margin-bottom: 4px; }
.upload-sub  { font-size: 12px; color: var(--muted); }

.image-preview-wrap {
  margin-top: 12px;
  position: relative;
  display: inline-block;
}
.image-preview-wrap img {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}
.btn-remove-img {
  margin-top: 8px;
  background: rgba(217,0,0,0.15);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 4px 10px;
  color: var(--red);
  font-size: 12px;
  cursor: pointer;
}

.upload-progress {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--light);
}
.prog-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--red); width: 0; transition: width 0.3s; }

/* FORM ACTIONS */
.form-actions { margin-top: 24px; }

.btn-primary {
  background: var(--red);
  border: none;
  border-radius: var(--radius);
  padding: 14px 32px;
  color: var(--pure);
  font-family: var(--font-cond);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover  { background: var(--red-dk); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  color: var(--light);
  font-family: var(--font-cond);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: var(--red); color: var(--red); }

.admin-feedback {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
}
.admin-feedback.success { background: rgba(37,211,102,0.1); border: 1px solid rgba(37,211,102,0.3); color: #25D366; }
.admin-feedback.error   { background: rgba(217,0,0,0.1);   border: 1px solid rgba(217,0,0,0.3);   color: #FF6B6B; }

/* MANAGE LIST */
.manage-toolbar { display: flex; gap: 12px; margin-bottom: 20px; align-items: center; }
.manage-toolbar .form-input { flex: 1; }

.pedidos-list { display: flex; flex-direction: column; gap: 10px; }

.list-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px;
  font-size: 14px;
}

.pedido-row {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  transition: border-color 0.2s;
}
.pedido-row:hover { border-color: var(--border); }

.pr-code {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--pure);
  min-width: 70px;
}
.pr-client { flex: 1; font-size: 14px; color: var(--light); min-width: 120px; }
.pr-status {
  font-family: var(--font-cond);
  font-size: 11px;
  letter-spacing: 0.2em;
  padding: 4px 10px;
  border-radius: 2px;
  border: 1px solid;
}

.pr-status[data-s="RECIBIDO"]          { color: #7FB3D3; border-color: #7FB3D3; }
.pr-status[data-s="EN EDICION"]        { color: #F5C518; border-color: #F5C518; }
.pr-status[data-s="AGUARDANDO INSUMO"] { color: #FF8C42; border-color: #FF8C42; }
.pr-status[data-s="EN PRODUCCION"]     { color: #9B59B6; border-color: #9B59B6; }
.pr-status[data-s="YA CASI"]           { color: #E74C3C; border-color: #E74C3C; }
.pr-status[data-s="FINALIZADO"]        { color: #25D366; border-color: #25D366; }

.pr-actions { display: flex; gap: 8px; }

.btn-edit, .btn-status {
  border: none;
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-cond);
  font-weight: 600;
  letter-spacing: 0.1em;
  transition: opacity 0.2s;
}
.btn-edit   { background: var(--mid); color: var(--light); border: 1px solid var(--border); }
.btn-status { background: var(--red); color: var(--pure); }
.btn-edit:hover, .btn-status:hover { opacity: 0.8; }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow);
  animation: modalIn 0.25s ease;
}

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

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

.modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--red); }

.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }

.modal-footer {
  padding: 16px 24px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

.modal-wsp-section { display: flex; flex-direction: column; gap: 10px; }
.modal-wsp-alert {
  background: rgba(37,211,102,0.1);
  border: 1px solid rgba(37,211,102,0.3);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  color: #25D366;
}

/* FOOTER */
.site-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: var(--font-cond);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.footer-sep { margin: 0 8px; color: var(--red); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
  .search-card { padding: 32px 24px; }
  .input-group { flex-direction: column; }
  .btn-search { justify-content: center; }
  .detail-grid { grid-template-columns: 1fr; }
  .image-card { max-width: 100%; }
  .image-wrap { width: 100%; height: 220px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .wsp-card { flex-direction: column; text-align: center; }
  .factory-elements { right: 0; }
  .gear-big { font-size: 48px; }
}

@media (max-width: 480px) {
  .header-inner { padding: 14px 16px; }
  .logo { font-size: 30px; }
  .admin-header { flex-direction: column; align-items: flex-start; }
  .pedido-row { flex-direction: column; align-items: flex-start; }
}
