/* ==========================================================================
   MODULE 1: FLOOR TERMINAL STYLES (LIGHT THEME OPERATOR WORKSTATION)
   Dual Stage: Check-in Gate -> Active Workspace
   Matches KKN4 Apparel Manufacturing Operator UI Exactly
   ========================================================================== */

/* Overall Container */
.terminal-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 1240px;
  margin: 0 auto;
}

/* Light Theme Navigation Bar (Top Mode Pills) */
.terminal-mode-pills-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #ffffff;
  padding: 0.45rem 0.65rem;
  border-radius: 9999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  max-width: fit-content;
  margin: 0 auto 0.5rem auto;
}

.terminal-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.65rem;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.terminal-mode-pill:hover {
  color: #4f46e5;
  background: #f8fafc;
}

.terminal-mode-pill.active {
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.terminal-mode-pill.cutting.active {
  background: #4f46e5;
  color: #ffffff;
}

/* ==========================================================================
   STAGE 1: CHECK-IN / SCAN GATEWAY CARDS
   ========================================================================== */
.checkin-hero-wrapper {
  display: flex;
  justify-content: center;
  padding: 1rem 0 2rem 0;
  width: 100%;
}

.checkin-card {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 20px;
  padding: 2rem 2.25rem;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  border: 1px solid #e2e8f0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.checkin-card.cutting {
  border-top: 4px solid #f43f5e;
}

.checkin-card-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.checkin-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.checkin-card-subtitle {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}

.checkin-form-group {
  margin-bottom: 1.15rem;
  text-align: left;
}

.checkin-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.45rem;
}

.checkin-select,
.checkin-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.checkin-select:focus,
.checkin-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.checkin-card.cutting .checkin-select:focus,
.checkin-card.cutting .checkin-input:focus {
  border-color: #f43f5e;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
}

.checkin-scan-box {
  position: relative;
  display: flex;
  align-items: center;
}

.checkin-scan-box input {
  padding-right: 3rem;
}

.checkin-scan-btn {
  position: absolute;
  right: 6px;
  width: 36px;
  height: 36px;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.checkin-card.cutting .checkin-scan-btn {
  background: #e11d48;
}

.checkin-action-btn {
  width: 100%;
  padding: 0.9rem;
  border-radius: 14px;
  border: none;
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  background: #4f46e5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
  transition: all 0.2s;
}

.checkin-action-btn:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

.checkin-action-btn.btn-cutting {
  background: #e11d48;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.35);
}

.checkin-action-btn.btn-cutting:hover {
  background: #be123c;
}

/* ==========================================================================
   STAGE 2: ACTIVE SPREADING WORKSPACE (2 COLUMNS)
   ========================================================================== */
.spreading-active-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .spreading-active-grid {
    grid-template-columns: 1fr;
  }
}

/* Left Column: Job Info Card */
.spreading-info-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 1.25rem;
  border: 1.5px solid #e0e7ff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.spreading-info-title {
  color: #4f46e5;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.85rem;
}

.spreading-no-badge {
  background: #fff7ed;
  border: 1px solid #ffedd5;
  border-radius: 12px;
  padding: 0.6rem;
  text-align: center;
  margin-bottom: 0.85rem;
}

.spreading-no-label {
  font-size: 0.72rem;
  color: #9a3412;
  font-weight: 700;
  text-transform: uppercase;
}

.spreading-no-val {
  font-size: 2rem;
  font-weight: 900;
  color: #ea580c;
  line-height: 1.1;
}

.job-meta-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.75rem;
  font-size: 0.82rem;
  margin-bottom: 0.85rem;
}

.job-meta-row {
  display: flex;
  flex-direction: column;
}

.job-meta-key {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}

.job-meta-value {
  font-weight: 700;
  color: #1e293b;
  word-break: break-all;
}

.markname-pill-box {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.55rem;
  border-radius: 8px;
  text-align: center;
  word-break: break-all;
  margin-bottom: 0.85rem;
}

.job-dims-dark-pill {
  background: #1e293b;
  color: #ffffff;
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  display: flex;
  justify-content: space-around;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.job-stat-row {
  display: flex;
  justify-content: space-between;
  text-align: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.5rem;
  margin-bottom: 0.85rem;
}

.job-stat-col {
  flex: 1;
}

.job-stat-label {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
  display: block;
}

.job-stat-val-red {
  color: #dc2626;
  font-size: 1.15rem;
  font-weight: 900;
}

.job-stat-val-green {
  color: #059669;
  font-size: 1.15rem;
  font-weight: 900;
}

.job-accum-counters {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0.25rem;
  border-top: 1px dashed #cbd5e1;
  font-size: 0.85rem;
  font-weight: 800;
  color: #0f172a;
}

.btn-close-spreading {
  width: 100%;
  padding: 0.85rem;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
  background: #10b981;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: background-color 0.2s;
}

.btn-close-spreading:hover {
  background: #059669;
}

.btn-reset-job {
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.4rem;
  text-align: center;
}

.btn-reset-job:hover {
  color: #ef4444;
}

/* Right Column: Rolls Step Form Card */
.spreading-rolls-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 1.35rem 1.5rem;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.rolls-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.rolls-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e293b;
}

.btn-start-spread-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1.15rem;
  background: #4f46e5;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.roll-form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.roll-field {
  display: flex;
  flex-direction: column;
}

.roll-field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.3rem;
}

.roll-input-box {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  outline: none;
  background: #ffffff;
}

.roll-input-box:focus {
  border-color: #4f46e5;
}

/* High-Visibility Paper Insertion Highlight Banner */
.paper-highlight-card {
  padding: 1.1rem 1.35rem;
  border-radius: 16px;
  margin: 1rem 0 1.15rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2.5px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
}

.paper-highlight-card:hover {
  border-color: #cbd5e1;
}

.paper-highlight-card.active-paper {
  background: #fffbeb;
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2), 0 6px 20px rgba(245, 158, 11, 0.15);
  animation: pulseGoldGlow 2s infinite ease-in-out;
}

@keyframes pulseGoldGlow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2), 0 4px 16px rgba(245, 158, 11, 0.15); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.35), 0 8px 24px rgba(245, 158, 11, 0.25); }
}

.paper-highlight-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.paper-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: #e2e8f0;
  color: #64748b;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.paper-highlight-card.active-paper .paper-icon-box {
  background: #f59e0b;
  color: #ffffff;
  transform: scale(1.05);
}

.paper-text-group {
  display: flex;
  flex-direction: column;
}

.paper-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #334155;
  line-height: 1.3;
  margin-bottom: 0.2rem;
  transition: color 0.3s;
}

.paper-highlight-card.active-paper .paper-title {
  color: #92400e;
  font-size: 1.05rem;
}

.paper-subtitle {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
  transition: color 0.3s;
}

.paper-highlight-card.active-paper .paper-subtitle {
  color: #b45309;
  font-weight: 700;
}

/* Large Switch Toggle */
.switch-label-lg {
  position: relative;
  display: inline-block;
  width: 62px;
  height: 34px;
  flex-shrink: 0;
}

.switch-label-lg input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider-lg {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  border-radius: 34px;
  transition: 0.3s;
}

.switch-slider-lg:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.switch-label-lg input:checked + .switch-slider-lg {
  background-color: #f59e0b;
}

.switch-label-lg input:checked + .switch-slider-lg:before {
  transform: translateX(28px);
}

.roll-calculated-loss {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  margin: 0.5rem 0 0.85rem 0;
}

.btn-finish-roll {
  width: 100%;
  padding: 0.85rem;
  background: #fef3c7;
  border: 1.5px solid #fde68a;
  color: #92400e;
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-finish-roll:hover {
  background: #fde68a;
}

/* Rolls Table */
.rolls-table-container {
  overflow-x: auto;
  margin-top: 1.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.rolls-light-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: center;
}

.rolls-light-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 0.65rem 0.5rem;
  border-bottom: 1.5px solid #e2e8f0;
}

.rolls-light-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  font-weight: 600;
}

.rolls-light-table tr:hover {
  background: #f8fafc;
}

/* ==========================================================================
   STAGE 2: ACTIVE CUTTING WORKSPACE (CARD WITH RED TOP BORDER)
   ========================================================================== */
.cutting-active-card {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 20px;
  padding: 1.75rem 2rem;
  border: 1px solid #e2e8f0;
  border-top: 4px solid #f43f5e;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.cutting-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.cutting-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #e11d48;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-back-scan {
  padding: 0.35rem 0.85rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back-scan:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.cutting-sp-badge {
  background: #fdf2f8;
  border: 1px solid #fbcfe8;
  border-radius: 12px;
  padding: 0.5rem;
  text-align: center;
  margin-bottom: 1rem;
}

.cutting-sp-label {
  font-size: 0.72rem;
  color: #9d174d;
  font-weight: 700;
}

.cutting-sp-val {
  font-size: 2rem;
  font-weight: 900;
  color: #db2777;
  line-height: 1;
}

.cutting-perimeter-box {
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: 12px;
  padding: 0.65rem;
  text-align: center;
  margin: 0.85rem 0;
}

.cutting-perimeter-label {
  font-size: 0.75rem;
  color: #854d0e;
  font-weight: 700;
}

.cutting-perimeter-val {
  font-size: 1.45rem;
  color: #ca8a04;
  font-weight: 900;
}

.cutting-times-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.time-box-blue {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  text-align: center;
}

.time-box-pink {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  text-align: center;
}

.time-box-label {
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.time-box-blue .time-box-label { color: #1d4ed8; }
.time-box-pink .time-box-label { color: #b91c1c; }

.time-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.time-input-field {
  flex: 1;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  font-size: 1.15rem;
  font-weight: 900;
  color: #0f172a;
  text-align: center;
  outline: none;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
}

.time-input-field:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.btn-time-now {
  padding: 0.42rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 800;
  background: #ffffff;
  border: 1.5px solid #93c5fd;
  color: #1d4ed8;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-time-now:hover {
  background: #dbeafe;
}

.btn-time-now.pink {
  border-color: #fca5a5;
  color: #b91c1c;
}

.btn-time-now.pink:hover {
  background: #fee2e2;
}

/* Real-time Cutting Duration Summary Card */
.cutting-duration-summary-card {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.duration-label-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.duration-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #1e293b;
}

.duration-val-badge {
  background: #4f46e5;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 900;
  padding: 0.35rem 0.85rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}


.cutting-warning-banner {
  background: #fef9c3;
  border: 1.5px solid #fef08a;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #854d0e;
  margin-bottom: 1rem;
}

.auto-cut-params-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.auto-cut-field {
  display: flex;
  flex-direction: column;
}

.auto-cut-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.3rem;
}

.auto-cut-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  outline: none;
}

.auto-cut-input:focus {
  border-color: #f43f5e;
}

.btn-finish-cut-dark {
  width: 100%;
  padding: 0.95rem;
  background: #1e293b;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  box-shadow: 0 4px 14px rgba(30, 41, 59, 0.3);
  transition: all 0.2s;
}

.btn-finish-cut-dark:hover {
  background: #0f172a;
}
