/* ==========================================================================
   CUSTOMWEAR ORDERS - DESIGN SYSTEM & STYLESHEET
   Aesthetics: Modern Dark Mode, Neon Accents, Glassmorphism & High Usability
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* Color Palette */
  --bg-primary: #0a0d14;
  --bg-secondary: #101522;
  --bg-tertiary: #161e31;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 55, 0.85);
  --bg-glass: rgba(16, 21, 34, 0.65);
  --bg-input: rgba(12, 17, 28, 0.8);

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-focus: #38bdf8;

  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #6366f1 100%);
  --grad-accent: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --grad-card: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
  --grad-glow: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.15), transparent 70%);

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #38bdf8;

  /* Shadows & Glows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.25);
  --shadow-glow-purple: 0 0 25px rgba(139, 92, 246, 0.25);

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout & Spacing */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  --container-max: 1100px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(0, 242, 254, 0.08), transparent 70%);
  background-attachment: fixed;
}

/* Global Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-normal);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.35);
  border: 1px solid rgba(0, 242, 254, 0.4);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: var(--grad-primary);
  color: #060911;
  box-shadow: 0 4px 16px rgba(0, 242, 254, 0.3);
  font-weight: 700;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 242, 254, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-focus);
}

.btn-accent {
  background: var(--grad-accent);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(139, 92, 246, 0.45);
}

.btn-outline-danger {
  background: transparent;
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.35);
}

.btn-outline-danger:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: var(--accent-rose);
  color: #fff;
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.95rem 1.8rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-ordered {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-paid {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.badge-processing {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-shipped {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-received {
  background: rgba(14, 165, 233, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.badge-completed {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-cancelled {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* ==========================================================================
   HERO / BANNER
   ========================================================================== */
.hero-section {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.85rem;
}

.hero-title .highlight {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 1.5rem;
}

/* ==========================================================================
   FORM & CARDS
   ========================================================================== */
.form-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-primary);
  opacity: 0.7;
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  font-size: 1.25rem;
}

.card-title-group h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-title-group p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.form-label .req {
  color: var(--accent-rose);
  font-weight: 700;
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  transition: all var(--transition-fast);
  outline: none;
  width: 100%;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
  background: rgba(14, 21, 35, 0.95);
}

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

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* ==========================================================================
   GARMENT ITEM CARDS (PRENDAS DEL PEDIDO)
   ========================================================================== */
.items-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.garment-card {
  background: rgba(13, 18, 30, 0.85);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  position: relative;
  transition: border-color var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.garment-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

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

.garment-number-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-cyan);
}

.garment-number-tag span.badge-num {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border-radius: var(--radius-full);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
}

/* Image Upload Area */
.image-upload-wrapper {
  margin-bottom: 1.25rem;
}

.image-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  background: rgba(10, 15, 26, 0.6);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.image-dropzone:hover, .image-dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: var(--shadow-glow);
}

.image-dropzone.has-image {
  border-style: solid;
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.04);
  padding: 0.85rem;
}

.dropzone-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.dropzone-icon {
  font-size: 2.2rem;
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.4));
}

.dropzone-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dropzone-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.image-preview-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
}

.preview-thumb {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--accent-emerald);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  cursor: zoom-in;
}

.preview-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
  flex: 1;
}

.preview-filename {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.preview-status {
  font-size: 0.78rem;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

/* Size Selector Buttons */
.size-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 0.5rem;
}

.size-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 0.25rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.size-btn:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.size-btn.active {
  background: var(--accent-indigo);
  border-color: #818cf8;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.4);
}

/* Live Customization Preview Card */
.custom-preview-badge {
  background: linear-gradient(135deg, rgba(20, 27, 45, 0.95), rgba(10, 14, 25, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.2rem;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.preview-badge-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.jersey-back-preview {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.jersey-preview-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.jersey-preview-num {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--accent-cyan);
  text-shadow: 0 0 12px rgba(0, 242, 254, 0.5);
}

/* ==========================================================================
   ORDER SUMMARY & SUBMIT
   ========================================================================== */
.order-summary-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-stats {
  display: flex;
  gap: 1.8rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.stat-lbl {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   ADMIN DASHBOARD
   ========================================================================== */
.admin-view {
  padding-bottom: 4rem;
}

.admin-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-title-area h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-title-area p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

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

/* Filter and Search Bar */
.filter-search-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-input-wrap input {
  padding-left: 2.5rem;
}

.search-icon-inside {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.status-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.tab-btn.active {
  background: var(--accent-indigo);
  color: #fff;
  border-color: #818cf8;
}

/* Orders Cards / Table */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.order-row-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 160px 1.4fr 1fr 140px auto;
  align-items: center;
  gap: 1.25rem;
  transition: all var(--transition-fast);
}

.order-row-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: var(--shadow-md);
}

.order-id-cell {
  display: flex;
  flex-direction: column;
}

.order-code-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent-cyan);
}

.order-date-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.customer-info-cell h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.customer-info-cell p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.items-preview-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.item-thumb-mini {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-medium);
}

.tracking-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.tracking-code-text {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #a5b4fc;
}

.actions-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  position: relative;
  transform: translateY(20px) scale(0.98);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-box-lg {
  max-width: 880px;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Tracking Input Box in Order Details */
.tracking-manager-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.tracking-inputs-flex {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* Zoom Image Modal */
.image-zoom-content {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-medium);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* (Print styles moved to dedicated document system at bottom of stylesheet) */

/* ==========================================================================
   MOBILE & RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 868px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .order-row-card {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 1.25rem;
  }

  .actions-cell {
    justify-content: flex-start;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.75rem;
  }

  .summary-stats {
    flex-direction: column;
    gap: 0.75rem;
  }

  .tracking-inputs-flex {
    flex-direction: column;
  }

  .form-card {
    padding: 1.25rem;
  }

  .brand-text h1 {
    font-size: 1.05rem;
  }
}

/* Loading Spinner & Toast */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast-msg {
  background: rgba(16, 21, 34, 0.95);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.4rem;
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  backdrop-filter: blur(12px);
  pointer-events: auto;
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-msg.toast-success {
  border-left: 4px solid var(--accent-emerald);
}

.toast-msg.toast-error {
  border-left: 4px solid var(--accent-rose);
}

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

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4rem;
}

/* ==========================================================================
   FINANCIALS & PRODUCT MANAGEMENT (COSTES, PRECIOS Y TABLA DE PRENDAS)
   ========================================================================== */
.financials-card {
  background: rgba(13, 20, 36, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.fin-item {
  display: flex;
  flex-direction: column;
}

.fin-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.3rem;
  letter-spacing: 0.04em;
}

.fin-value {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
}

.fin-val-sale { color: #34d399; }
.fin-val-cost { color: #38bdf8; }
.fin-val-fee { color: #fbbf24; }
.fin-val-profit { color: #c084fc; text-shadow: 0 0 14px rgba(192, 132, 252, 0.35); }

.fin-fee-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.fin-fee-input {
  max-width: 95px;
  padding: 0.3rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-sm);
  outline: none;
}

/* Tabla de Productos similar a la captura de pantalla */
.products-mgmt-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: rgba(10, 15, 26, 0.65);
  margin-bottom: 1.25rem;
}

.products-mgmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.products-mgmt-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border-medium);
  white-space: nowrap;
}

.products-mgmt-table td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.products-mgmt-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.product-thumb-table {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-medium);
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.product-thumb-table:hover {
  transform: scale(1.08);
  border-color: var(--accent-cyan);
}

.pill-version {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  text-transform: uppercase;
}

.pill-patch {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}
.pill-patch-yes {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.pill-patch-no {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.action-icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: var(--border-medium);
}

.action-icon-btn.btn-trash:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.4);
}

/* ==========================================================================
   SISTEMA DE DOCUMENTOS: RECIBO CLIENTE & FICHA DE TALLER (PREVIEW & PRINT)
   ========================================================================== */

/* Modal de Previsualización de Documentos */
.doc-modal-box {
  background: #0b1120 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: var(--radius-lg);
  max-width: 900px !important;
  width: 95vw;
  max-height: 94vh;
  overflow-y: hidden;
  padding: 0 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
}

.doc-top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0f172a;
  color: #fff;
  padding: 0.9rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.doc-top-bar-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: #f8fafc;
}

.doc-top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.doc-scroll-viewport {
  padding: 1.75rem 1rem;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  background: #060913;
}

/* Lienzo Físico de Hoja A4 */
.paper-sheet {
  background: #ffffff !important;
  color: #0f172a !important;
  width: 100%;
  max-width: 800px;
  padding: 36px 42px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   DOCUMENTO 1: RECIBO OFICIAL DEL CLIENTE (SOLO PVP - SIN COSTES FÁBRICA)
   -------------------------------------------------------------------------- */
.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0284c7;
  padding-bottom: 18px;
  margin-bottom: 22px;
}

.receipt-brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.receipt-logo-img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
}

.receipt-brand-title h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.1;
}

.receipt-brand-title p {
  font-size: 11px;
  color: #64748b;
  margin: 3px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.receipt-meta {
  text-align: right;
}

.receipt-order-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 800;
  color: #0284c7;
}

.receipt-date {
  font-size: 13px;
  color: #64748b;
  margin-top: 3px;
}

.receipt-client-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  font-size: 13px;
  color: #334155;
}

.receipt-client-box strong {
  color: #0f172a;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 22px;
}

.receipt-table th {
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 11px 12px;
  border-bottom: 2px solid #cbd5e1;
  text-align: left;
}

.receipt-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  color: #1e293b;
  vertical-align: middle;
}

.receipt-thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  display: block;
}

.receipt-total-section {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
}

.receipt-total-card {
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 8px;
  padding: 16px 24px;
  text-align: right;
  min-width: 260px;
}

.receipt-total-card .lbl {
  font-size: 12px;
  color: #166534;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.receipt-total-card .val {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #15803d;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   DOCUMENTO 2: FICHA DE TALLER & PRODUCCIÓN (OPTIMIZADA PARA OPERARIOS)
   -------------------------------------------------------------------------- */
.workshop-header {
  border-bottom: 3px solid #0f172a;
  padding-bottom: 14px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.workshop-title-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.workshop-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 22px;
}

.workshop-meta-item .meta-lbl {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.workshop-meta-item .meta-val {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 2px;
}

/* Tarjeta individual de prenda para taller */
.workshop-card {
  border: 2px solid #0f172a;
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 16px;
  background: #ffffff;
  page-break-inside: avoid;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.workshop-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.workshop-garment-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.workshop-size-badge-large {
  background: #0f172a;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  padding: 4px 14px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.workshop-card-body {
  display: grid;
  grid-template-columns: 140px 1fr 180px;
  gap: 16px;
  align-items: center;
}

.workshop-img-large {
  width: 135px;
  height: 135px;
  object-fit: cover;
  border: 2px solid #0f172a;
  border-radius: 6px;
  display: block;
}

.workshop-custom-box {
  background: #f1f5f9;
  border: 2px dashed #94a3b8;
  border-radius: 6px;
  padding: 12px 16px;
}

.workshop-custom-label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.workshop-name-text {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.workshop-num-text {
  font-family: 'Outfit', sans-serif;
  font-size: 34px;
  font-weight: 900;
  color: #0284c7;
  line-height: 1;
  margin-top: 4px;
}

.workshop-checklist {
  border-left: 2px solid #e2e8f0;
  padding-left: 14px;
  font-size: 12px;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workshop-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.workshop-square {
  width: 14px;
  height: 14px;
  border: 2px solid #0f172a;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.workshop-footer-sign {
  border-top: 2px solid #0f172a;
  padding-top: 15px;
  margin-top: 25px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #475569;
}

/* ==========================================================================
   REGLAS DE IMPRESIÓN PROFESIONAL (MEDIA PRINT)
   ========================================================================== */
@media print {
  @page {
    margin: 8mm;
    size: A4 portrait;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Ocultar interfaz web ordinaria */
  .site-header, .site-footer, #view-customer-order, #view-admin-dashboard,
  .toast-container, .modal-close-btn, .doc-top-bar, .btn, .site-header * {
    display: none !important;
  }

  .modal-overlay {
    position: static !important;
    background: transparent !important;
    display: none !important;
    padding: 0 !important;
  }

  /* Imprimir Recibo */
  body.print-receipt-active #modal-client-receipt {
    display: block !important;
  }
  body.print-receipt-active #modal-client-receipt .doc-modal-box {
    background: transparent !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    overflow: visible !important;
    border: none !important;
  }
  body.print-receipt-active #modal-client-receipt .doc-scroll-viewport {
    padding: 0 !important;
    background: transparent !important;
    overflow: visible !important;
  }
  body.print-receipt-active .paper-sheet {
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }

  /* Imprimir Ficha de Taller */
  body.print-workshop-active #modal-workshop-sheet {
    display: block !important;
  }
  body.print-workshop-active #modal-workshop-sheet .doc-modal-box {
    background: transparent !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    overflow: visible !important;
    border: none !important;
  }
  body.print-workshop-active #modal-workshop-sheet .doc-scroll-viewport {
    padding: 0 !important;
    background: transparent !important;
    overflow: visible !important;
  }
  body.print-workshop-active .paper-sheet {
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }
}


