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

:root {
  --primary: #292524;       /* Stone 800 (Warm Deep Charcoal) */
  --primary-light: #d97706; /* Amber 600 (Warm Accent Primary) */
  --accent: #e60023;        /* Rangoli Red */
  --accent-hover: #b8001b;
  --bg-app: #fafaf9;        /* Stone 50 (Warm Cream background) */
  --bg-card: #ffffff;
  --text-main: #44403c;     /* Stone 700 (Warm Dark Grey) */
  --text-muted: #78716c;    /* Stone 500 (Warm Light Grey) */
  --border: #e7e5e4;        /* Stone 200 (Soft Warm Border) */
  --border-focus: #d97706;  /* Amber 600 focus */
  --success: #10b981;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(41, 37, 36, 0.05), 0 2px 4px -1px rgba(41, 37, 36, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(41, 37, 36, 0.05), 0 4px 6px -2px rgba(41, 37, 36, 0.03);
  --shadow-premium: 0 20px 25px -5px rgba(41, 37, 36, 0.03), 0 10px 10px -5px rgba(41, 37, 36, 0.01);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 68px;
  --footer-height: 30px;
  --page-pad-x: clamp(12px, 2.5vw, 24px);
  --page-pad-y: clamp(12px, 2vw, 40px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  scroll-behavior: smooth;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: linear-gradient(135deg, #fafaf9 0%, #f5f5f4 100%);
  color: var(--text-main);
  line-height: 1.5;
  padding: var(--page-pad-y) var(--page-pad-x);
  padding-bottom: calc(var(--nav-height) + var(--footer-height) + var(--safe-bottom) + 24px);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 100% Chrome Zoom Layout Scaling (Matches 80% Browser Zoom View) */
@media screen and (min-width: 768px) {
  body {
    zoom: 0.8 !important;
  }
}
@media screen and (max-width: 767px) {
  body {
    zoom: 1 !important;
  }
}

/* Container Layout */
.app-container {
  width: 100%;
  max-width: min(1400px, 96%);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.5vw, 30px);
  min-width: 0;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 20px 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  height: 50px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.04);
}

.brand-info h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.brand-info p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Page Sections Visibility */
.page-section {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.page-section.active {
  display: block;
}

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

/* Layout Grid for Entry Page */
.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: start;
}

.main-grid.show-sidebar {
  grid-template-columns: 1.8fr 1.2fr;
}

@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-premium);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

/* Form Fields */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 11px 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  background-color: #faf7f2;   /* Soft warm cream background */
  border: 1px solid #e2dad0;    /* Distinct warm border */
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
}

/* Capitalized DateTime-Local Placeholder & Input Fields */
input[type="datetime-local"],
input[type="date"],
input[type="datetime-local"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper,
input[type="datetime-local"]::-webkit-datetime-edit-text,
input[type="datetime-local"]::-webkit-datetime-edit-month-field,
input[type="datetime-local"]::-webkit-datetime-edit-day-field,
input[type="datetime-local"]::-webkit-datetime-edit-year-field,
input[type="datetime-local"]::-webkit-datetime-edit-ampm-field,
input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
  text-transform: uppercase;
  font-weight: 700;
}

input:focus,
select:focus,
textarea:focus {
  background-color: #ffffff;    /* Pure white on focus */
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15); /* Warm amber ring */
}

input.locked-readonly-input,
input.locked-readonly-input:focus,
input.locked-readonly-input:hover,
#employeeInput,
#employeeInput:focus,
#employeeInput:hover,
#editJcEmployee,
#editJcEmployee:focus,
#editJcEmployee:hover {
  background-color: var(--bg-app) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
  outline: none !important;
  cursor: not-allowed !important;
  caret-color: transparent !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* Highlighting fields specifically placed first */
.highlight-field {
  background-color: rgba(217, 119, 6, 0.04);
  border: 1.5px solid var(--border-focus);
}

::placeholder {
  color: #c27d38 !important; /* Beautiful distinct warm amber/gold color */
  opacity: 0.65;
}

/* Interactive Form Validation Classes */
input.is-valid,
select.is-valid,
textarea.is-valid,
.searchable-dropdown input.is-valid {
  border-color: #10b981 !important;
  background-color: #f0fdf4 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18) !important;
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid,
.searchable-dropdown input.is-invalid {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25) !important;
}

.size-item-card.is-invalid {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}

.size-item-card.is-valid {
  border-color: #10b981 !important;
}

/* Multi-column Rows */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 15px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr));
  gap: 15px;
}

/* Autocomplete suggestions */
.suggestions-wrapper {
  position: relative;
}

.suggestions-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.suggestions-box div {
  padding: 10px 15px;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
  color: var(--text-main);
}

.suggestions-box div:hover {
  background-color: var(--bg-app);
  color: var(--primary-light);
  font-weight: 700;
}

/* File Upload Previews */
.file-upload-wrapper {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 15px;
  text-align: center;
  background: var(--bg-app);
  cursor: pointer;
  transition: var(--transition);
}

.file-upload-wrapper:hover {
  border-color: var(--border-focus);
  background: #fff;
}

.file-upload-wrapper input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload-icon {
  font-size: 24px;
  margin-bottom: 5px;
  color: var(--text-muted);
}

.file-upload-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.upload-preview {
  margin-top: 10px;
  max-width: 100%;
  max-height: 80px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: none;
  object-fit: contain;
}

/* ================================================================
   DROPZONE — Drag & Drop / Paste / Click image uploads
   ================================================================ */
.dropzone-container {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 28px 18px;
  min-height: 160px;
  text-align: center;
  background: var(--bg-app);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.dropzone-container:hover {
  border-color: var(--primary);
  background: #fff;
}

.dropzone-container.drag-active,
.dropzone-container:focus-within {
  border-color: var(--primary);
  background: rgba(14, 116, 144, 0.08);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.15);
  transform: scale(1.01);
}

.dropzone-container.paste-target {
  border-color: var(--primary-light);
  background: rgba(217, 119, 6, 0.06);
}

.dropzone-icon {
  font-size: 42px;
  margin-bottom: 4px;
  color: var(--text-muted);
  line-height: 1;
}

.dropzone-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.45;
}

.dropzone-text strong {
  color: var(--primary);
  font-weight: 800;
}

.dropzone-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.85;
}

.dropzone-container input[type="file"] {
  display: none;
}

.thumbnails-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
  width: 100%;
}

.thumbnail-card {
  position: relative;
  width: min(220px, calc(50vw - 28px));
  height: min(220px, calc(50vw - 28px));
  max-width: 220px;
  max-height: 220px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  overflow: hidden;
  background: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.thumbnail-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #f8fafc;
}

.thumbnail-card .delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
  z-index: 2;
}

.thumbnail-card:hover .delete-btn,
.thumbnail-card .delete-btn:focus {
  opacity: 1;
}

.thumbnail-card .delete-btn:hover {
  background: #dc2626;
  transform: scale(1.08);
}

.dropzone-compact {
  padding: 18px 12px;
  min-height: 110px;
}

.dropzone-compact .dropzone-icon {
  font-size: 28px;
  margin-bottom: 2px;
}

.dropzone-compact .dropzone-text {
  font-size: 12px;
}

.thumbnails-grid.compact .thumbnail-card {
  width: min(160px, calc(50vw - 28px));
  height: min(160px, calc(50vw - 28px));
  max-width: 160px;
  max-height: 160px;
}

/* Never show legacy single-image preview nodes at full size */
#logoPhotoRealPreview,
#logoPhotoPreview,
#logoFilePreview {
  display: none !important;
  max-width: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
}

/* Buttons */
.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 30px;
}

.btn {
  padding: 14px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(230, 0, 35, 0.2);
}

.btn-secondary {
  background: var(--primary);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 12px rgba(15, 44, 89, 0.2);
}

/* Tables & Lists */
.item-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.item-table th, 
.item-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.item-table th {
  background-color: var(--bg-app);
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
}

.item-table tr:hover {
  background-color: rgba(244, 246, 249, 0.5);
}

.item-badge {
  display: inline-block;
  padding: 2px 6px;
  background-color: var(--primary);
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.btn-action-icon {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-action-icon:hover {
  background-color: var(--border);
  color: var(--accent);
}

.btn-action-icon.view-btn:hover {
  color: var(--primary-light);
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

/* Progress bar inside tables */
.progress-bar-bg {
  background-color: var(--border);
  border-radius: 10px;
  height: 8px;
  width: 100px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

.progress-bar-fill {
  background-color: var(--success);
  height: 100%;
  border-radius: 10px;
  width: 0%;
  transition: width 0.4s ease;
}

/* Page 2: Job Card Grid Sections */
.jobcards-list-section {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  overflow: visible;
  width: 100%;
}

/* Job Cards page — prevent card clipping so lists scroll & show all rows */
#pageJobCards.page-section.active {
  display: block;
  width: 100%;
  overflow: visible;
}

#pageJobCards .card {
  overflow: visible;
}

#pageJobCards .stats-grid {
  position: relative;
  z-index: 1;
}

/* Smooth scrollable panels for each job-card status list */
.jobcards-scroll-panel {
  width: 100%;
  max-height: min(62vh, 680px);
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  scrollbar-gutter: stable;
}

.jobcards-scroll-panel .item-table,
.jobcards-scroll-panel .jc-table {
  margin: 0;
  width: 100%;
  border: none;
}

.jobcards-scroll-panel .item-table thead th,
.jobcards-scroll-panel .jc-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  box-shadow: 0 1px 0 var(--border);
}

.jobcards-scroll-panel::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.jobcards-scroll-panel::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
}

.jobcards-scroll-panel::-webkit-scrollbar-track {
  background: #f1f5f9;
}

/* Ensure page content clears the fixed bottom navbar */
#pageJobCards,
.jc-page-content {
  padding-bottom: 24px;
}

/* Page 3: Party Ledger Styling */
.ledger-header-panel {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}

#pagePartyLedger.page-section.active {
  display: block;
  width: 100%;
  overflow: visible;
}

#pagePartyLedger .party-tracker-page-card {
  overflow: visible;
  padding-bottom: 28px;
}

.party-tracker-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.party-tracker-stat {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.party-tracker-stat-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.party-tracker-stat-val {
  font-size: 24px;
  font-weight: 850;
  color: var(--primary);
}

.party-tracker-stat-val.accent {
  color: var(--accent);
}

.party-tracker-pending-wrap {
  margin-top: 8px;
  max-height: min(68vh, 720px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding-right: 4px;
}

.party-tracker-section-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.party-tracker-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.party-tracker-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.party-tracker-card:hover,
.party-tracker-card:focus {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  outline: none;
}

.party-tracker-card-main {
  flex: 1;
  min-width: 0;
}

.party-tracker-card-title {
  font-size: 15px;
  font-weight: 850;
  color: var(--primary);
  margin-bottom: 6px;
}

.party-tracker-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.party-tracker-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.party-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
}

.party-badge.pending { background: #dc2626; }
.party-badge.half { background: #d97706; }

.party-tracker-card-side {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.party-tracker-balance-lbl {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.party-tracker-balance-val {
  display: block;
  font-size: 20px;
  font-weight: 850;
  color: var(--accent);
}

.party-tracker-view-link {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-light);
}

.party-pending-details-scroll {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: min(60vh, 520px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.party-pending-jc-card {
  background: var(--bg-app);
  border: 1.5px solid var(--border);
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .party-tracker-card {
    flex-direction: column;
    align-items: stretch;
  }
  .party-tracker-card-side {
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-app);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  text-align: center;
}

.stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-top: 5px;
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

/* Modal and Print view — above fixed bottom navbar (--nav-height) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 44, 89, 0.45);
  backdrop-filter: blur(4px);
  z-index: 10050;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--nav-height) + var(--safe-bottom));
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  box-sizing: border-box;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.jobcard-modal {
  background: #fff;
  border-radius: 12px;
  width: 95%;
  max-width: 900px;
  max-height: calc(100vh - var(--nav-height) - var(--safe-bottom) - 32px);
  max-height: calc(100dvh - var(--nav-height) - var(--safe-bottom) - 32px);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  transform: scale(0.95);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.modal-overlay.active .jobcard-modal {
  transform: scale(1);
}

.modal-header {
  padding: 16px 20px;
  background: var(--bg-app);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.modal-close,
.modal-close-btn {
  appearance: none;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-main);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(26, 35, 50, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.modal-close:hover,
.modal-close-btn:hover,
.modal-close:focus-visible,
.modal-close-btn:focus-visible {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
  outline: none;
}

.modal-close:active,
.modal-close-btn:active {
  transform: scale(0.96);
}

.modal-body {
  padding: 30px;
}

.modal-body-scrollable {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-app);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.modal-tip-bar {
  flex-shrink: 0;
  background: var(--bg-app);
  border-bottom: 1.5px solid var(--border);
  padding: 8px 15px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Multi-fabric summary (Register / Entry status modal + job card view) */
.fabric-summary-card {
  background: #fff7ed;
  border: 1.5px solid #fdba74;
  border-radius: 10px;
  overflow: hidden;
  font-size: 12px;
}

.fabric-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: #ffedd5;
  border-bottom: 1px solid #fdba74;
}

.fabric-summary-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9a3412;
}

.fabric-summary-count {
  font-size: 10px;
  font-weight: 700;
  color: #c2410c;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 999px;
  padding: 2px 8px;
}

.fabric-summary-table-wrap {
  max-height: 220px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #fffbeb;
}

.fabric-summary-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

.fabric-summary-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #ffedd5;
  color: #9a3412;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #fdba74;
  white-space: nowrap;
}

.fabric-summary-table thead th:not(:first-child) {
  text-align: right;
}

.fabric-summary-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid #fed7aa;
  color: var(--text-main);
  vertical-align: middle;
}

.fabric-summary-table tbody tr:last-child td {
  border-bottom: none;
}

.fabric-summary-name {
  font-weight: 750;
  color: var(--primary);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fabric-summary-num {
  text-align: right;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fabric-summary-used {
  color: #b45309;
}

.fabric-summary-empty-row td {
  text-align: center !important;
  color: #9a3412;
  font-weight: 600;
  padding: 16px 10px !important;
  font-style: italic;
}

.fabric-summary-total-row {
  display: grid;
  grid-template-columns: minmax(90px, 1.4fr) repeat(3, minmax(70px, 1fr));
  gap: 4px;
  align-items: center;
  padding: 9px 12px;
  background: #ffedd5;
  border-top: 1.5px solid #fdba74;
  font-weight: 800;
  color: #9a3412;
}

.fabric-summary-total-label {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fabric-summary-total-val {
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.status-fabric-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.status-fabric-add-btn {
  border: 1.5px solid #fdba74;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 750;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.status-fabric-lines-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-fabric-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(90px, 0.9fr) 90px 34px;
  gap: 6px;
  align-items: center;
}

.status-fabric-editor-row input,
.status-fabric-editor-row select {
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #fdba74;
  background: #fff7ed;
  color: var(--text-main);
  font-weight: 700;
  font-size: 12px;
}

.status-fabric-remove-btn {
  height: 38px;
  border: 1.5px solid #fecaca;
  background: #fff1f2;
  color: #dc2626;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.status-fabric-used-box {
  background: #fff7ed;
  border: 1.5px solid #fdba74;
  border-radius: 10px;
  padding: 10px 12px;
}

.status-fabric-used-heading {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9a3412;
  margin-bottom: 8px;
}

.status-fabric-used-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fabric-used-now-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(100px, 0.8fr);
  gap: 8px;
  align-items: center;
}

.fabric-used-now-label {
  font-size: 12px;
  font-weight: 700;
  color: #9a3412;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fabric-used-now-input {
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #fdba74;
  background: #fff;
  color: var(--text-main);
  font-weight: 700;
  font-size: 12px;
}

/* Jobcard preview gallery thumbnails */
.jc-preview-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  min-height: 60px;
}

.artwork-thumb,
.garment-thumb,
.jc-preview-gallery img {
  max-height: 120px;
  max-width: 140px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: #fcfcfc;
}

/* Job card — artwork proof + garment reference (all devices) */
.jc-product-photos {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

.jc-photo-col {
  min-width: 0;
}

.jc-photo-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
  line-height: 1.35;
}

.jc-photo-label-artwork {
  color: #92400e;
}

.jc-photo-label-garment {
  color: #1e3a5f;
}

.jc-photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.jc-photo-empty {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.jc-spec-thumb {
  display: block;
  width: clamp(72px, 16vw, 120px);
  height: clamp(72px, 16vw, 120px);
  min-width: 72px;
  min-height: 72px;
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  object-position: center;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  flex: 0 0 auto;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.jc-spec-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: auto;
}

.jobcard-print-blueprint .jc-spec-table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  box-sizing: border-box !important;
}

.jobcard-print-blueprint .jc-spec-table th:first-child,
.jobcard-print-blueprint .jc-spec-table td:first-child {
  width: 34% !important;
  box-sizing: border-box !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  padding: 8px 6px !important;
}

.jobcard-print-blueprint .jc-spec-table th:nth-child(2),
.jobcard-print-blueprint .jc-spec-table td:nth-child(2) {
  width: 38% !important;
  box-sizing: border-box !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  padding: 8px 6px !important;
}

.jobcard-print-blueprint .jc-spec-table th:nth-child(3),
.jobcard-print-blueprint .jc-spec-table td:nth-child(3),
.jobcard-print-blueprint .jc-spec-table th:nth-child(4),
.jobcard-print-blueprint .jc-spec-table td:nth-child(4),
.jobcard-print-blueprint .jc-spec-table th:nth-child(5),
.jobcard-print-blueprint .jc-spec-table td:nth-child(5) {
  width: 9.3% !important;
  box-sizing: border-box !important;
  text-align: center !important;
  padding: 8px 4px !important;
}

.jc-artwork-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.jc-artwork-preview-overlay img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

@media (max-width: 640px) {
  .jc-product-photos {
    gap: 8px;
  }

  .jc-spec-thumb {
    width: clamp(64px, 26vw, 96px);
    height: clamp(64px, 26vw, 96px);
    min-width: 64px;
    min-height: 64px;
  }
}

@media (max-width: 400px) {
  .jc-product-photos {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.artwork-thumb:hover,
.garment-thumb:hover,
.jc-preview-gallery img:hover {
  transform: scale(1.04);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.jc-proof-box {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.jc-proof-box-label {
  color: #888888;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.4px;
}

.jc-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  font-size: 13px;
}

.jc-meta-grid .jc-meta-item label,
.jc-meta-grid .jc-meta-item .jc-meta-label {
  display: block;
  color: #888;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.jc-meta-grid .jc-meta-value {
  font-weight: 800;
  color: #000;
  font-size: 13px;
}

.jc-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #e65100;
}

.jc-status-badge.completed { background: #16a34a; }
.jc-status-badge.half-pending { background: #d97706; }
.jc-status-badge.pending { background: #dc2626; }

.jc-artwork-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px) {
  .jc-meta-grid,
  .jc-artwork-grid {
    grid-template-columns: 1fr;
  }

  .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-footer .whatsapp-share-group {
    justify-content: stretch !important;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

.jc-ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.jc-ledger-table th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 800;
  font-size: 10px;
  color: #e65100;
  border: 1.5px solid #e65100;
  text-transform: uppercase;
  background: #fff3e0;
}

.jc-ledger-table th.center,
.jc-ledger-table td.center { text-align: center; }
.jc-ledger-table th.right,
.jc-ledger-table td.right { text-align: right; }

.jc-ledger-table td {
  padding: 8px 10px;
  border: 1.5px solid #e0e0e0;
  font-weight: 700;
}

.jc-ledger-table tr.total-row td {
  border: 1.5px solid #e65100;
  font-weight: 900;
  background: #fff8f0;
}

/* Asymmetrical Blueprint Spec Sheet Layout for Print & Screen Modal */
.jobcard-print-blueprint,
.jobcard-print-blueprint * {
  letter-spacing: normal !important;
  word-spacing: normal !important;
  font-kerning: normal !important;
  text-rendering: optimizeLegibility !important;
  box-sizing: border-box !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.jobcard-print-blueprint {
  width: 194mm;
  max-width: 100%;
  background: #ffffff;
  color: #0f172a;
  padding: 12px 14px;
  border: 2px solid #b91c1c;
  border-radius: 8px;
  margin: 0 auto;
  box-sizing: border-box;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.jc-bp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2.5px solid #b91c1c;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.jc-bp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.jc-bp-logo {
  height: 42px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.jc-bp-brand-text h2 {
  display: block;
  font-size: 16pt;
  font-weight: 900;
  color: #b91c1c;
  margin: 0 0 2px 0;
  line-height: 1.15;
}

.jc-bp-brand-text p {
  display: block;
  font-size: 8pt;
  color: #64748b;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  line-height: 1.2;
}

.jc-bp-doc {
  text-align: right;
  flex-shrink: 0;
}

.jc-bp-cardno {
  display: block;
  font-size: 15pt;
  font-weight: 900;
  color: #b91c1c;
  line-height: 1.15;
  margin: 0 0 2px 0;
  white-space: nowrap;
}

.jc-bp-date {
  display: block;
  font-size: 8.5pt;
  font-weight: 700;
  color: #64748b;
  margin: 0 0 3px 0;
  line-height: 1.2;
  white-space: nowrap;
}

.jc-bp-status-wrap {
  display: block;
  margin-top: 2px;
}

.jc-bp-status {
  display: inline-block;
  color: #ffffff;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 850;
  font-size: 8pt;
  text-transform: uppercase;
}

/* Party / Jobber Info (2 rows, 4 columns) */
.jc-bp-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 12px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.jc-meta-cell {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
}

.jc-meta-lbl {
  display: block;
  font-size: 8pt;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.25;
  margin: 0 0 2px 0;
}

.jc-meta-val {
  display: block;
  font-size: 10pt;
  font-weight: 850;
  color: #0f172a;
  line-height: 1.25;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jc-meta-sub {
  display: block;
  font-size: 8pt;
  color: #64748b;
  margin-top: 1px;
  white-space: nowrap;
}

/* Product Block */
.jc-product-block {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
  break-inside: avoid;
  page-break-inside: avoid;
}

.jc-prod-header-box {
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  padding: 6px 10px;
}

.jc-prod-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.jc-prod-badge {
  font-size: 9pt;
  font-weight: 850;
  color: #1e293b;
  background: #ffffff;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #94a3b8;
}

.jc-brand-pill {
  font-size: 8.5pt;
  font-weight: 850;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #bae6fd;
  text-transform: uppercase;
}

.jc-prod-specs-line {
  font-size: 8.5pt;
  color: #334155;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.jc-prod-specs-line strong {
  color: #0f172a;
  font-weight: 750;
}

.jc-pipe {
  color: #94a3b8;
  font-weight: 400;
}

/* Size-wise Vertical Table */
.jc-size-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9pt;
}

.jc-size-table thead th {
  background: #f8fafc;
  color: #475569;
  font-size: 8pt;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 8px;
  border-bottom: 1px solid #cbd5e1;
}

.jc-size-table tbody tr {
  height: 7mm;
}

.jc-size-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.jc-size-table tbody td {
  padding: 3px 8px;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  vertical-align: middle;
}

.jc-size-total-row {
  background: #f1f5f9 !important;
  font-weight: 900 !important;
  height: 7mm;
  border-top: 1.5px solid #cbd5e1;
}

.jc-size-total-row td {
  padding: 4px 8px;
  color: #0f172a;
  font-weight: 900;
}

/* Size-wise Horizontal Matrix Table (for >7 sizes) */
.jc-size-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.5pt;
  text-align: center;
}

.jc-size-matrix-table th,
.jc-size-matrix-table td {
  padding: 3px 5px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  vertical-align: middle;
}

.jc-size-matrix-table thead th {
  background: #f8fafc;
  font-weight: 850;
  font-size: 8pt;
  color: #334155;
  border-bottom: 1.5px solid #cbd5e1;
}

.jc-size-matrix-table .matrix-lbl-cell,
.jc-size-matrix-table .matrix-hdr-col {
  background: #f1f5f9;
  font-weight: 850;
  color: #475569;
  text-align: left;
  padding-left: 8px;
  width: 75px;
}

.jc-size-matrix-table .matrix-total-hdr,
.jc-size-matrix-table .matrix-total-cell {
  background: #f1f5f9;
  font-weight: 900;
  color: #0f172a;
  border-right: none;
}

/* Balance Pill */
.jc-bal-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 850;
  font-size: 8.5pt;
  line-height: 1.2;
}

.jc-bal-pill.bal-pending {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.jc-bal-pill.bal-completed {
  background: #ecfdf5;
  color: #10b981;
  border: 1px solid #a7f3d0;
}

/* Product-Wise Total Summary Block */
.jc-product-summary-block {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  margin-top: 6px;
  margin-bottom: 6px;
  overflow: hidden;
  break-inside: avoid;
  page-break-inside: avoid;
}

.jc-product-summary-header {
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  padding: 5px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.jc-product-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.5pt;
}

.jc-product-summary-table th {
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
  padding: 5px 8px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  font-size: 7.5pt;
}

.jc-product-summary-table td {
  padding: 5px 8px;
  vertical-align: middle;
}

.jc-summary-grand-total-row {
  background: #f1f5f9;
  border-top: 2px solid #cbd5e1;
  font-weight: 900;
}

.jc-summary-subtext {
  display: block;
  font-size: 7.5pt;
  color: #64748b;
  font-weight: 600;
  margin-top: 1px;
}

/* Grand Total Summary Bar */
.jc-grand-total-bar {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: 6px;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  font-size: 9.5pt;
  break-inside: avoid;
  page-break-inside: avoid;
}

.jc-gt-left {
  font-weight: 850;
  display: flex;
  align-items: center;
  gap: 6px;
}

.jc-gt-right {
  display: flex;
  gap: 8px;
  font-weight: 800;
}

.jc-gt-pill {
  background: rgba(255,255,255,0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Signatures Footer */
.jc-bp-signs {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1.5px dashed #cbd5e1;
  break-inside: avoid;
  page-break-inside: avoid;
}

.jc-bp-sign {
  text-align: center;
  flex: 1;
  min-width: 0;
  break-inside: avoid;
  page-break-inside: avoid;
}

.jc-bp-sign-line {
  border-top: 1.5px solid #94a3b8;
  width: min(130px, 90%);
  margin: 0 auto 4px auto;
}

.jc-bp-sign-name {
  display: block;
  font-weight: 850;
  font-size: 9pt;
  color: #0f172a;
  line-height: 1.25;
}

.jc-bp-sign-role {
  display: block;
  font-size: 8pt;
  color: #64748b;
  line-height: 1.2;
}

/* Fabric Summary Card */
.fabric-summary-card {
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 6px;
  overflow: hidden;
  font-size: 8.5pt;
  margin-bottom: 8px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.fabric-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px;
  background: #ffedd5;
  color: #9a3412;
  font-weight: 800;
  font-size: 8pt;
}

.fabric-summary-table-wrap {
  overflow-x: auto;
  background: #fffbeb;
}

.fabric-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.5pt;
}

.fabric-summary-table thead th {
  background: #fed7aa;
  color: #9a3412;
  font-size: 8pt;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  text-align: left;
}

.fabric-summary-table thead th:not(:first-child) {
  text-align: right;
}

.fabric-summary-table tbody td {
  padding: 2px 6px;
  border-bottom: 1px solid #fed7aa;
  color: #1e293b;
}

.fabric-summary-table tbody tr:last-child td {
  border-bottom: none;
}

.fabric-summary-name {
  font-weight: 750;
  color: #b91c1c;
}

.fabric-summary-num {
  text-align: right;
  font-weight: 750;
}

.fabric-summary-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px;
  background: #ffedd5;
  font-weight: 850;
  font-size: 8.5pt;
  border-top: 1px solid #fdba74;
}

.jc-spec-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.bp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #1c1917;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.bp-brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.bp-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.bp-brand-text h2 {
  font-size: 22px;
  font-weight: 900;
  color: #1c1917;
  margin: 0;
  letter-spacing: 1px;
}

.bp-brand-text p {
  font-size: 10px;
  color: #78716c;
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 700;
}

.bp-doc-info {
  text-align: right;
}

.bp-card-title {
  font-size: 14px;
  font-weight: 800;
  color: #78716c;
  letter-spacing: 0.5px;
}

.bp-card-no {
  font-size: 18px;
  font-weight: 800;
  color: #1c1917;
  margin-top: 2px;
}

.bp-card-no span {
  color: #e60023;
}

.bp-date {
  font-size: 10px;
  color: #78716c;
  margin-top: 4px;
}

.bp-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

.bp-panel-left {
  display: flex;
  flex-direction: column;
}

.bp-panel-right {
  display: flex;
  flex-direction: column;
  border-left: 1.5px solid #e7e5e4;
  padding-left: 20px;
}

.bp-section-title {
  font-size: 10px;
  font-weight: 800;
  color: #78716c;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 20px 0 10px 0;
  border-bottom: 1.5px solid #1c1917;
  padding-bottom: 5px;
}

.bp-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
}

.bp-spec-item {
  display: flex;
  flex-direction: column;
  border-bottom: 1px dashed #e7e5e4;
  padding-bottom: 4px;
}

.bp-spec-item .label {
  font-size: 8px;
  font-weight: 700;
  color: #78716c;
  text-transform: uppercase;
}

.bp-spec-item .value {
  font-size: 12px;
  font-weight: 700;
  color: #1c1917;
  margin-top: 2px;
}

.bp-qty-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.bp-qty-table th {
  background-color: #fafaf9;
  color: #1c1917;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 1.5px solid #1c1917;
}

.bp-qty-table td {
  padding: 12px;
  font-size: 12px;
  border-bottom: 1px solid #e7e5e4;
}

.bp-qty-table td.bold {
  font-weight: 800;
}

.bp-meta-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bp-meta-row {
  display: flex;
  flex-direction: column;
  border-bottom: 1px dashed #e7e5e4;
  padding-bottom: 4px;
}

.bp-meta-row .lbl {
  font-size: 8px;
  font-weight: 700;
  color: #78716c;
  text-transform: uppercase;
}

.bp-meta-row .val {
  font-size: 12px;
  font-weight: 700;
  color: #1c1917;
}

.bp-meta-row .val.bold {
  font-weight: 800;
}

.bp-proofs-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.bp-proof-box {
  background-color: #fafaf9;
  border: 1px solid #e7e5e4;
  padding: 10px;
  border-radius: 4px;
}

.bp-proof-box p {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  color: #78716c;
  margin-bottom: 6px;
}

.bp-img-wrap {
  background-color: #ffffff;
  border: 1px solid #e7e5e4;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bp-img-wrap img {
  max-height: 90px;
  max-width: 100%;
  object-fit: contain;
}

.bp-img-wrap .no-img {
  font-size: 9px;
  color: #a8a29e;
}

.bp-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 60px;
  text-align: center;
}

.bp-sig-col {
  display: flex;
  flex-direction: column;
}

.bp-sig-line {
  border-top: 1.5px solid #1c1917;
  margin-bottom: 8px;
}

.bp-sig-col .title {
  font-size: 11px;
  font-weight: 800;
  color: #1c1917;
}

.bp-sig-col .subtitle {
  font-size: 9px;
  color: #78716c;
  margin-top: 2px;
}

/* Garment Size & Quantities Matrix Styling */
.matrix-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-top: 10px;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 8px;
}

.size-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 6px;
  background: var(--bg-app);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  user-select: none;
  min-height: 38px;
  box-sizing: border-box;
}

.size-item-card:hover {
  border-color: var(--primary-light);
  background: var(--bg-app);
}

.size-item-card.active {
  background-color: #fffbe6; /* Premium soft warm amber active background */
  border-color: var(--border-focus);
  box-shadow: 0 4px 6px -1px rgba(217, 119, 6, 0.08), 0 2px 4px -1px rgba(217, 119, 6, 0.04);
}

.size-item-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-weight: 800;
  font-size: 12px;
  color: var(--text-main);
  margin: 0;
  cursor: pointer;
  flex: 0 0 auto;
  min-width: 22px;
  text-align: center;
}

#freeSizeCard .size-item-label {
  min-width: 32px;
}

#freeSizeCard .size-item-label span {
  font-size: 9.5px !important;
  font-weight: 850 !important;
  line-height: 1.1 !important;
  display: inline-block !important;
  text-align: center !important;
  white-space: normal !important;
  max-width: 32px !important;
}

.size-item-card.active .size-item-label span {
  color: var(--border-focus);
}

.size-item-cb {
  width: 13px;
  height: 13px;
  accent-color: var(--border-focus);
  cursor: pointer;
  margin: 0 8px 0 0;
}

.size-item-qty {
  width: 54px !important;
  min-width: 52px !important;
  max-width: 58px !important;
  flex: 0 0 54px !important;
  height: 26px !important;
  padding: 0 2px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  text-align: center !important;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
  margin: 0;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  letter-spacing: 0.5px;
  transition: var(--transition);
}

.size-item-qty::placeholder {
  color: #94a3b8;
  font-weight: 500;
  opacity: 0.7;
}

/* Hide native number input spinners & disable scrolling effect on all number/price inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button,
.size-item-qty::-webkit-inner-spin-button,
.size-item-qty::-webkit-outer-spin-button,
.active-size-price-input::-webkit-inner-spin-button,
.active-size-price-input::-webkit-outer-spin-button,
.edit-row-price::-webkit-inner-spin-button,
.edit-row-price::-webkit-outer-spin-button,
#priceInput::-webkit-inner-spin-button,
#priceInput::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

input[type="number"],
.size-item-qty,
.active-size-price-input,
.edit-row-price,
#priceInput {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

.size-item-qty:focus {
  border-color: var(--border-focus);
  background: #ffffff;
  outline: none;
}

.size-item-card.active .size-item-qty {
  background: #ffffff;
  border-color: var(--border-focus);
}

/* Size-Wise Real Live Stock Badges */
.size-stock-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 1px 3px;
  margin-left: 2px;
  border-radius: 4px;
  font-family: inherit;
  line-height: 1;
  text-align: center;
  flex-shrink: 0;
  box-sizing: border-box;
  pointer-events: auto;
}

.size-stock-badge.in-stock {
  border: 1px solid #34d399;
  background: #f0fdf4;
  color: #059669;
}

.size-stock-badge.in-stock .stock-qty {
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.size-stock-badge.in-stock .stock-unit {
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  text-transform: lowercase;
}

.size-stock-badge.out-stock {
  border: 1px solid #f87171;
  background: #fef2f2;
  color: #dc2626;
}

.size-stock-badge.out-stock .stock-out {
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
}

.size-item-card input.size-item-qty:disabled {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
}

.size-item-card.is-out-of-stock {
  opacity: 0.85;
}

/* Alert response styles */
#response {
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  margin-top: 15px;
  font-weight: 600;
}

#response.success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

#response.error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--accent);
}

#response.info {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--border-focus);
}

.mode-toggle-btn {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mode-toggle-btn.OUT {
  background-color: var(--accent);
  color: white;
  box-shadow: 0 2px 5px rgba(217, 119, 6, 0.3);
}

.mode-toggle-btn.IN {
  background-color: var(--success);
  color: white;
  box-shadow: 0 2px 5px rgba(16, 185, 129, 0.3);
}

/* PRINTING STYLES */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body {
    background: #fff !important;
    padding: 0;
    margin: 0;
  }
  
  .app-container,
  header,
  .main-grid,
  .modal-header,
  .modal-header,
  .modal-tip-bar,
  .modal-footer,
  .tabs-navigation,
  .app-site-footer,
  #response {
    display: none !important;
  }

  .modal-overlay {
    position: static !important;
    background: none !important;
    backdrop-filter: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    display: block !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .jobcard-modal {
    box-shadow: none !important;
    border: none !important;
    max-height: none !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: none !important;
    transform: none !important;
    position: static !important;
    display: block !important;
  }

  .modal-body,
  .modal-body-scrollable {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    flex: none !important;
    max-height: none !important;
  }

  @page {
    size: A4 portrait;
    margin: 15mm 10mm 20mm 10mm;
  }

  body {
    display: block !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .jobcard-print-blueprint {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background-color: #ffffff !important;
    color: #000000 !important;
    box-sizing: border-box !important;
  }

  .bp-page {
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
  }

  .bp-page-1 {
    page-break-after: always !important;
    break-after: page !important;
  }

  .bp-page-2 {
    page-break-before: auto !important;
    break-before: auto !important;
  }

  .bp-qty-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 10px !important;
  }

  .bp-qty-table th {
    background: #fafaf9 !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
    padding: 8px !important;
    font-weight: bold !important;
    font-size: 11px !important;
  }

  .bp-qty-table td {
    border: 1px solid #000000 !important;
    padding: 8px !important;
    font-size: 11px !important;
    color: #000000 !important;
  }

  .bp-qty-table tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  thead {
    display: table-header-group !important;
  }

  .print-only-footer {
    display: none !important;
  }
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  min-width: 0;
}

.table-responsive .item-table,
.table-responsive .jc-table,
.table-responsive table {
  min-width: 640px;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Responsive Media Queries for Mobile & Tablet */
@media (max-width: 1440px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (max-width: 1024px) {
  header {
    flex-direction: column;
    gap: 20px;
    text-align: center;
    padding: 15px 20px;
  }

  .brand-wrapper {
    flex-direction: column;
    gap: 10px;
  }

  .user-session-wrapper {
    flex-direction: column;
    width: 100%;
    gap: 10px;
    align-items: center;
  }

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

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .ledger-header-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .bp-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .bp-panel-right {
    border-left: none;
    padding-left: 0;
    border-top: 1.5px solid #e7e5e4;
    padding-top: 16px;
  }

  .bp-signatures {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 32px;
  }

  .card {
    padding: 24px 20px;
  }

  .card-title {
    font-size: 18px;
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  /* Collapse secondary nav into More sheet */
  .tabs-navigation .tab-trigger.nav-secondary {
    display: none !important;
  }

  .tabs-navigation .tab-trigger.nav-more-btn {
    display: flex !important;
  }

  .tabs-navigation .tab-trigger {
    min-width: 0;
    max-width: none;
    flex: 1 1 0;
  }

  /* Keep primary tabs in a sensible left-to-right order when secondary is hidden */
  #nav-data-entry { order: 1; }
  #nav-jobcard { order: 2; }
  #nav-register { order: 3; }
  #nav-stock-manager { order: 4; }
  #nav-more { order: 5; }
}

@media (max-width: 600px) {
  .jc-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .jc-title-sec {
    text-align: center;
  }

  .jc-meta-grid,
  .jc-logo-previews,
  .jc-signatures {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .jc-signatures {
    margin-top: 30px;
  }

  .jc-sig-box {
    border-top: 1px solid #000;
    padding-top: 6px;
    margin-bottom: 10px;
  }

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

  .logo-sub-row {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding-top: 22px;
  }

  .logo-sub-rows-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .btn-add-logo {
    width: 100%;
    justify-content: center;
  }

  .bp-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .bp-specs-grid {
    grid-template-columns: 1fr;
  }

  .matrix-grid {
    grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
    gap: 6px;
  }

  .party-tracker-summary {
    grid-template-columns: 1fr 1fr;
  }

  .modal-body,
  .modal-body-scrollable {
    padding: 16px;
  }

  .modal-header {
    padding: 12px 16px;
  }

  .jobcard-modal {
    width: 100%;
    max-height: calc(100vh - var(--nav-height) - var(--safe-bottom) - 12px);
    max-height: calc(100dvh - var(--nav-height) - var(--safe-bottom) - 12px);
    border-radius: 12px 12px 0 0;
  }

  .jobcard-print-blueprint {
    padding: 14px;
    border-width: 2px;
    border-radius: 8px;
  }

  .jc-bp-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .jc-bp-brand {
    gap: 10px;
  }

  .jc-bp-logo {
    height: 38px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
  }

  .jc-bp-brand-text h2 {
    font-size: 16px;
    letter-spacing: 0.3px;
  }

  .jc-bp-brand-text p {
    font-size: 9px;
  }

  .jc-bp-doc {
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
  }

  .jc-bp-cardno {
    font-size: 16px;
    white-space: normal;
  }

  .jc-bp-date {
    margin-top: 0;
    width: 100%;
  }

  .jc-bp-status {
    margin-top: 0;
  }

  .jc-bp-meta {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
  }

  .jc-bp-signs {
    flex-direction: column;
    gap: 20px;
    margin-top: 24px;
  }

  .jobcard-modal-actions {
    flex-direction: column;
    align-items: stretch !important;
  }

  .jobcard-modal-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .modal-overlay {
    padding: 0;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
    align-items: flex-end;
  }

  .progress-bar-bg {
    width: 72px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .jc-bp-meta {
    grid-template-columns: 1fr;
  }

  .jobcard-print-blueprint {
    padding: 12px;
  }

  .app-container {
    max-width: 100%;
    padding: 0;
  }

  .card {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }

  .party-tracker-summary {
    grid-template-columns: 1fr;
  }

  .item-table th,
  .item-table td {
    padding: 10px 8px;
    font-size: 12px;
  }

  .thumbnail-card {
    width: min(150px, calc(50vw - 24px));
    height: min(150px, calc(50vw - 24px));
  }

  .thumbnails-grid.compact .thumbnail-card {
    width: min(120px, calc(50vw - 24px));
    height: min(120px, calc(50vw - 24px));
  }

  label {
    font-size: 12px;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  select,
  textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 10px 12px;
  }

  .btn {
    padding: 12px 16px;
    font-size: 14px;
  }

  .matrix-container {
    padding: 14px;
  }

  .empty-state {
    padding: 28px 14px;
  }
}

/* Redesigned Premium Navbar - Stacked UP/DOWN Layout */
.navbar-header {
  display: flex;
  flex-direction: column; /* Stack decks vertically (UP/DOWN) */
  align-items: stretch;
  gap: 16px;
  background: var(--bg-card);
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  border: 1px solid var(--border);
  margin-bottom: 25px;
  transition: var(--transition);
}

.navbar-header .brand-wrapper {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  padding-left: 160px;   /* reserve space for absolute logo on left */
  padding-right: 160px;  /* keep title visually centred */
  width: 100%;
  min-height: 52px;
  box-sizing: border-box;
}

.navbar-bottom-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.navbar-header .logo {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 52px;
  max-width: 150px;        /* never wider than the reserved padding */
  width: auto;
  object-fit: contain;
  object-position: left center;
}

.navbar-header .brand-info {
  text-align: center;
  margin: 0 auto;
}

.navbar-header .brand-info h1 {
  font-size: 28px; /* Big font size! */
  font-weight: 800;
  color: var(--primary);
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0.5px;
}

.navbar-header .brand-info p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  margin: 4px 0 0 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

body {
  padding-bottom: calc(var(--nav-height) + var(--footer-height) + var(--safe-bottom) + 24px);
}

/* Common Unified Bottom Navbar - 100% Reference Image Match */
.tabs-navigation {
  display: flex;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 8px 12px;
  padding-bottom: calc(8px + var(--safe-bottom));
  width: 100% !important;
  box-sizing: border-box;
  position: fixed;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  z-index: 9999;
  justify-content: space-between;
  align-items: center;
  border-radius: 0 !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  height: auto;
  min-height: var(--nav-height);
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out !important;
}

.tabs-navigation::-webkit-scrollbar {
  display: none;
}

/* Developer credit — sits above fixed bottom navbar */
.app-site-footer {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  left: 0;
  right: 0;
  z-index: 9998;
  text-align: center;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
  line-height: 1.4;
}

.app-site-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.app-site-footer a:hover {
  text-decoration: underline;
}

.tabs-navigation.nav-hidden {
  transform: translateY(100%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.tab-trigger {
  padding: 6px 10px;
  border: none;
  background: transparent;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  border-radius: 14px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column !important;
  align-items: center;
  justify-content: center;
  gap: 3px !important;
  text-decoration: none;
  flex: 1 1 0;
  min-width: 75px;
  max-width: 140px;
  height: 52px;
  box-sizing: border-box;
}

.tab-trigger:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.04);
}

.tab-trigger.active {
  background: #1e1e1e !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  padding: 6px 10px;
}

.tab-trigger svg {
  transition: transform 0.2s ease;
  color: inherit !important;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.tab-trigger.active svg {
  color: #ffffff !important;
  transform: scale(1.05);
}

.tab-trigger .nav-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.user-session-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  width: auto;
  min-width: 0;
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.user-profile-badge #currentUserName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 220px;
}

.user-profile-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.action-btn-group {
  display: inline-flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.action-btn-group .action-btn {
  width: auto !important;
  height: auto !important;
  border-radius: 6px !important;
  padding: 5px 10px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn-group .action-btn.txn {
  border-color: #fde68a !important;
  color: #b45309 !important;
  background: #fffbebf0 !important;
}
.action-btn-group .action-btn.txn:hover {
  background: #fef3c7 !important;
  border-color: #fcd34d !important;
  color: #92400e !important;
  transform: translateY(-1px);
}

.action-btn-group .action-btn.print:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: white !important;
}

.action-btn-group .action-btn.whatsapp {
  border-color: #bbf7d0;
  color: #16a34a;
  background: #f0fdf4;
}
.action-btn-group .action-btn.whatsapp:hover {
  background: #25D366 !important;
  border-color: #25D366 !important;
  color: white !important;
}

.action-btn-group .action-btn.call {
  border-color: #10b981;
  color: #10b981;
}
.action-btn-group .action-btn.call:hover {
  background: #10b981;
  border-color: #10b981;
  color: white !important;
}

.navbar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50% !important;
  border: 1.5px solid var(--border);
  background: #ffffff;
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}

.action-btn:hover {
  background: var(--bg-app);
  border-color: var(--primary-light);
  color: var(--primary-light);
  transform: translateY(-2px);
}

.action-btn.logout {
  color: var(--accent);
  border-color: rgba(230, 0, 35, 0.15);
  background: rgba(230, 0, 35, 0.02);
}

.action-btn.logout:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff !important;
  box-shadow: 0 4px 6px -1px rgba(230, 0, 35, 0.2);
}

.action-btn.nav-sheets-btn {
  color: #0f9d58 !important;
  border-color: rgba(15, 157, 88, 0.25) !important;
  background: #ffffff !important;
}

.action-btn.nav-sheets-btn:hover {
  background: #ecfdf5 !important;
  border-color: #0f9d58 !important;
  color: #047857 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(15, 157, 88, 0.25);
}

@media (max-width: 768px) {
  .navbar-header {
    flex-direction: column !important;
    gap: 12px !important;
    padding: 12px !important;
    text-align: center;
    overflow: hidden;
    margin-bottom: 16px;
  }

  .navbar-header .brand-wrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
    flex-direction: column !important;
    gap: 8px;
    min-height: 0;
  }

  .navbar-header .logo {
    position: static !important;
    transform: none !important;
    height: 40px !important;
    max-width: 120px !important;
  }

  .navbar-header .brand-info h1 {
    font-size: 22px;
  }

  .navbar-bottom-row {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
  }

  .user-session-wrapper {
    width: 100% !important;
    justify-content: space-between !important;
    flex-direction: row !important;
    gap: 8px !important;
    min-width: 0;
  }

  .user-profile-badge {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 120px);
    padding: 5px 10px;
    font-size: 11px;
  }

  .user-profile-badge #currentUserName {
    max-width: 100%;
  }

  .navbar-actions {
    gap: 4px;
  }

  .action-btn {
    width: 32px;
    height: 32px;
  }

  .tabs-navigation {
    padding: 6px 4px;
    padding-bottom: calc(6px + var(--safe-bottom));
    min-height: 64px;
    gap: 2px;
  }

  .tab-trigger {
    height: 54px;
    padding: 4px 2px;
    font-size: 10px;
    border-radius: 10px !important;
  }

  .tab-trigger svg {
    width: 18px;
    height: 18px;
  }

  .tab-trigger .nav-label,
  .tab-trigger span {
    font-size: 10px;
  }

  #jobCardSearchInput,
  #partySearchInput,
  #jobberSearchInput,
  input[type="text"][placeholder*="Search"]:not(.pm-search-input):not(.searchable-combobox-input):not(.search-input-box),
  input[type="text"][placeholder*="search"]:not(.pm-search-input):not(.searchable-combobox-input):not(.search-input-box) {
    font-size: 16px !important;
    padding: 10px 12px !important;
  }

  .table-responsive .item-table,
  .table-responsive .jc-table,
  .table-responsive table {
    min-width: 560px;
  }
}

/* Extra-small phones: 320px–380px */
@media (max-width: 380px) {
  body {
    padding-bottom: calc(60px + var(--safe-bottom) + 16px);
  }

  .navbar-header {
    padding: 10px !important;
    gap: 8px !important;
    margin-bottom: 14px;
  }

  .navbar-header .brand-info h1 {
    font-size: 16px !important;
  }

  .navbar-header .brand-info p {
    font-size: 9px !important;
  }

  .navbar-header .logo {
    height: 34px !important;
    max-width: 100px !important;
  }

  .user-profile-badge {
    max-width: calc(100% - 108px);
    padding: 4px 8px;
    font-size: 10px;
    gap: 5px;
  }

  .user-profile-badge #currentUserName {
    max-width: 100%;
  }

  .navbar-actions {
    gap: 3px;
  }

  .action-btn {
    width: 30px;
    height: 30px;
  }

  .action-btn svg {
    width: 15px !important;
    height: 15px !important;
  }

  .sync-status {
    display: none !important;
  }

  .tabs-navigation {
    min-height: 60px;
    padding: 4px 2px;
    padding-bottom: calc(4px + var(--safe-bottom));
  }

  .tab-trigger {
    height: 52px;
    padding: 3px 1px;
    gap: 1px !important;
    border-radius: 8px !important;
  }

  .tab-trigger.active {
    padding: 3px 1px;
  }

  .tab-trigger svg {
    width: 16px;
    height: 16px;
  }

  .tab-trigger .nav-label,
  .tab-trigger span {
    font-size: 9px;
    letter-spacing: normal;
  }

  .app-container {
    padding: 0 !important;
  }

  .card {
    padding: 14px 10px !important;
  }

  .party-tracker-card-side {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .fabric-qty-summary-grid {
    grid-template-columns: 1fr !important;
  }

  .status-fabric-unit-row {
    grid-template-columns: 1fr !important;
  }

  .fabric-summary-table-wrap {
    max-height: 180px;
  }

  .status-fabric-editor-row {
    grid-template-columns: 1fr 1fr !important;
  }

  .fabric-used-now-row {
    grid-template-columns: 1fr !important;
  }

  .fabric-summary-total-row {
    grid-template-columns: 1fr 1fr !important;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}



.revise-row:hover {
  background-color: rgba(217, 119, 6, 0.08) !important;
}

/* Custom Searchable Select Dropdowns ERP Upgrade */
.dropdown-container {
  position: relative;
}

.searchable-dropdown {
  position: relative;
  width: 100%;
}

.searchable-dropdown .dropdown-input {
  width: 100%;
  padding-right: 30px !important;
  cursor: text;
}

.searchable-dropdown .dropdown-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-muted);
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.searchable-dropdown.open .dropdown-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.searchable-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 5px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.searchable-dropdown.open .dropdown-menu {
  display: block;
}

.searchable-dropdown.open,
.dropdown-container:has(.searchable-dropdown.open),
.form-group:has(.searchable-dropdown.open) {
  z-index: 1050;
  position: relative;
}

#orderForm,
#orderForm .card,
#orderForm .erp-section-card {
  overflow: visible !important;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.erp-stock-table th,
.erp-stock-table td {
  transition: background-color 0.15s ease;
}

.erp-stock-table tbody tr:hover {
  background-color: #f8fafc;
}

.out-of-stock-pill {
  color: #ef4444;
  font-weight: 750;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  display: inline-block;
}

.in-stock-pill {
  color: #15803d;
  font-weight: 800;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  display: inline-block;
}

.dropdown-items {
  max-height: 200px;
  overflow-y: auto;
}

.dropdown-item {
  padding: 10px 15px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-main);
  transition: background-color 0.2s ease;
  text-align: left;
}

.dropdown-item:hover,
.dropdown-item.highlighted {
  background-color: var(--bg-app);
  color: var(--primary);
  font-weight: 700;
}

.dropdown-item.empty {
  padding: 12px 15px;
  font-size: 12px;
  color: var(--text-muted);
  background: transparent;
}

.dropdown-add-item {
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  border-top: 1.5px dashed var(--border);
  cursor: pointer;
  background-color: rgba(230, 0, 35, 0.03);
  text-align: center;
  transition: background-color 0.2s ease;
}

.dropdown-add-item:hover {
  background-color: rgba(230, 0, 35, 0.08);
}

.searchable-dropdown .dropdown-input[readonly] {
  cursor: pointer;
  background-color: #faf7f2 !important;
}

/* FREE SIZE card uses standard .size-item-card styling */

/* ================================================================
   LOGO SUB-ROW PANEL — Per-product logo entry in entry form
   ================================================================ */
.logo-sub-rows-wrapper {
  margin-top: 14px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  background: linear-gradient(135deg, #fafaf9, #fff8f0);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.logo-sub-rows-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.logo-sub-rows-header .lsr-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-add-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, var(--primary-light), #e07000);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

.btn-add-logo:hover {
  background: linear-gradient(135deg, #e07000, var(--primary-light));
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.35);
  transform: translateY(-1px);
}

.logo-sub-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  position: relative;
  animation: fadeInLogo 0.25s ease;
  box-shadow: var(--shadow-sm);
  page-break-inside: avoid;
  break-inside: avoid;
  min-width: 0;
}

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

.logo-sub-row .lsr-index {
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--primary-light);
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.logo-sub-row .form-group {
  margin-bottom: 0;
}

.logo-sub-row label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

.logo-sub-row select,
.logo-sub-row input[type="text"],
.logo-sub-row input[type="file"] {
  font-size: 12px;
  padding: 7px 10px;
  height: 34px;
}

.logo-sub-row input[type="file"] {
  padding: 4px 8px;
  height: auto;
  cursor: pointer;
}

.btn-remove-logo {
  padding: 6px 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1.5px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  align-self: flex-end;
  height: 34px;
}

.btn-remove-logo:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: #dc2626;
}

.logo-artwork-preview {
  max-height: 40px;
  max-width: 80px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-top: 4px;
  display: none;
}

/* ================================================================
   LOGO BADGES — Used in product table and jobcard view
   ================================================================ */
.logo-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  border: 1.5px solid;
  white-space: nowrap;
}

.logo-badge.embroidery {
  background: rgba(109, 40, 217, 0.07);
  color: #6d28d9;
  border-color: rgba(109, 40, 217, 0.3);
}

.logo-badge.printing {
  background: rgba(16, 185, 129, 0.07);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
}

.logo-badge.sublimation {
  background: rgba(14, 165, 233, 0.07);
  color: #0369a1;
  border-color: rgba(14, 165, 233, 0.3);
}

.logo-badge.embossing {
  background: rgba(249, 115, 22, 0.07);
  color: #c2410c;
  border-color: rgba(249, 115, 22, 0.3);
}

.logo-badge.default {
  background: rgba(100, 116, 139, 0.07);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.3);
}

/* ================================================================
   LOGOS VIEW SECTION — In jobcard view modal
   ================================================================ */
.logos-section {
  margin-top: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

.logos-section-header {
  background: #fff3e0;
  border-bottom: 1.5px solid #e65100;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 800;
  color: #e65100;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logos-section-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fffdf9;
}

.logo-mini-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid #ebebeb;
  border-radius: 5px;
  page-break-inside: avoid;
  break-inside: avoid;
}

.logo-mini-card .logo-num {
  font-size: 9px;
  font-weight: 800;
  color: #e65100;
  background: rgba(230, 81, 0, 0.08);
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
  border: 1px solid rgba(230, 81, 0, 0.2);
}

.logo-mini-card .logo-info {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.logo-loc-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(230, 0, 35, 0.08);
  color: #dc2626;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.logo-style-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(41, 37, 36, 0.06);
  color: #292524;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(41, 37, 36, 0.2);
}

.logo-mini-card .artwork-thumb {
  height: 40px;
  width: 50px;
  object-fit: contain;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s;
}

.logo-mini-card .artwork-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.artwork-none {
  font-size: 9px;
  color: #aaa;
  font-style: italic;
}

.btn-add-logo-post {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(217, 119, 6, 0.1);
  border: 1.5px solid rgba(217, 119, 6, 0.35);
  color: var(--primary-light);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.btn-add-logo-post:hover {
  background: rgba(217, 119, 6, 0.2);
  border-color: var(--primary-light);
}

/* ================================================================
   @media print — Jobwork Card Print Panel (A4 Portrait, 8mm margin)
   ================================================================ */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    box-sizing: border-box !important;
    letter-spacing: normal !important;
  }

  html, body {
    background: #ffffff !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
    -webkit-font-smoothing: antialiased !important;
  }

  /* Hide outer navigation & non-print elements */
  body > *:not(#jobCardModal),
  .app-container,
  header,
  nav,
  footer,
  .navbar,
  .navbar-header,
  .main-grid,
  .main-container,
  .container,
  .page-section,
  .tabs-navigation,
  .app-site-footer,
  .modal-header,
  .modal-header-dash,
  .modal-header-title,
  .modal-title,
  .modal-tip-bar,
  .modal-footer,
  .modal-footer-dash,
  .jobcard-modal-actions,
  .whatsapp-share-group,
  .modal-close,
  .modal-close-btn,
  .modal-close-x,
  .btn-add-logo-post,
  #btnShowSessionCards,
  .user-session-wrapper,
  .no-print {
    display: none !important;
  }

  .modal-overlay {
    position: static !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    width: 100% !important;
    height: auto !important;
    box-shadow: none !important;
    border: none !important;
  }

  .jobcard-modal,
  .dash-modal,
  .modal-dialog {
    position: static !important;
    transform: none !important;
    box-shadow: none !important;
    max-height: none !important;
    overflow: visible !important;
    border: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
  }

  .modal-body,
  .modal-body-scrollable,
  .modal-body-dash,
  #jobCardPrintArea {
    position: static !important;
    overflow: visible !important;
    max-height: none !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    width: 100% !important;
  }

  .jobcard-print-blueprint {
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: none !important;
    border: none !important;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    letter-spacing: normal !important;
  }

  .jobcard-print-blueprint.jc-scaled-fit {
    zoom: var(--jc-scale-factor, 1) !important;
  }

  @supports not (zoom: 1) {
    .jobcard-print-blueprint.jc-scaled-fit {
      transform: scale(var(--jc-scale-factor, 1)) !important;
      transform-origin: top left !important;
      width: calc(100% / var(--jc-scale-factor, 1)) !important;
    }
  }

  /* Prevent page splits inside components */
  .garment-order-card,
  .jc-bp-header,
  .jc-bp-meta,
  .fabric-summary-card,
  .jc-product-summary-block,
  .jc-grand-total-bar,
  .jc-bp-signs,
  .jc-bp-sign,
  .jc-product-photos,
  tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .jc-bp-signs {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin-top: 14px !important;
    padding-top: 10px !important;
  }

  thead {
    display: table-header-group !important;
  }

  /* Artwork & product thumbnails */
  .logo-mini-card .artwork-thumb,
  .jc-spec-thumb {
    width: 56px !important;
    height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    object-fit: contain !important;
    border: 1px solid #cbd5e1 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .jc-product-photos {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .free-size-print-label {
    display: inline-block;
    border: 1.5px solid #000000 !important;
    background: #000000 !important;
    color: #ffffff !important;
    padding: 2px 8px !important;
    font-weight: 800 !important;
    font-size: 10.5px !important;
    border-radius: 4px !important;
    letter-spacing: normal !important;
  }

  .logo-loc-badge {
    border: 1.5px solid #dc2626 !important;
    color: #dc2626 !important;
  }

  .logo-style-badge {
    border: 1.5px solid #444444 !important;
    color: #222222 !important;
  }

  .logo-mini-card .logo-num {
    border: 1px solid #e65100 !important;
    color: #e65100 !important;
  }
}

/* ================================================================
   RESPONSIVE NAV — More sheet (mobile overflow menu)
   ================================================================ */
.tab-trigger.nav-more-btn {
  display: none;
}

.nav-more-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.nav-more-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.nav-more-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
  padding: 12px 16px calc(16px + var(--safe-bottom));
  transform: translateY(110%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: min(70vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-more-sheet.open {
  transform: translateY(0);
}

.nav-more-handle {
  width: 40px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 4px;
  margin: 0 auto 14px;
}

.nav-more-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding: 0 4px;
}

.nav-more-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.nav-more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-app);
  color: var(--text-main);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
  min-width: 0;
}

.nav-more-item:hover,
.nav-more-item:focus {
  border-color: var(--primary-light);
  background: #fffbeb;
  color: var(--primary);
}

.nav-more-item.active {
  background: #1e1e1e;
  border-color: #1e1e1e;
  color: #ffffff;
}

.nav-more-item svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.nav-more-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Utility: prevent flex/grid children from overflowing */
.card,
.main-grid,
.page-section,
.form-group,
.searchable-dropdown {
  min-width: 0;
}

img:not(.logo):not(.stock-logo):not(.bp-logo):not(.jc-bp-logo):not(.admin-brand-logo):not(.login-logo),
video,
canvas {
  max-width: 100%;
  height: auto;
}

/* Landscape phones */
@media (max-height: 480px) and (orientation: landscape) {
  .tabs-navigation {
    min-height: 52px;
    padding: 2px 6px;
  }

  .tab-trigger {
    height: 46px;
    flex-direction: row !important;
    gap: 6px !important;
  }

  .tab-trigger .nav-label {
    font-size: 10px;
  }

  .nav-more-sheet {
    max-height: 85vh;
  }

  .modal-overlay {
    align-items: center;
    padding: 8px;
    padding-bottom: calc(8px + var(--nav-height) + var(--safe-bottom));
  }

  .jobcard-modal {
    border-radius: 12px;
    max-height: calc(100vh - var(--nav-height) - var(--safe-bottom) - 16px);
    max-height: calc(100dvh - var(--nav-height) - var(--safe-bottom) - 16px);
  }
}

/* Large desktops — keep content readable */
@media (min-width: 1600px) {
  .app-container {
    max-width: 1500px;
  }
}

/* =========================================================================
   Product Management & Searchable Combobox Design System Extensions
   ========================================================================= */
.pm-search-wrap,
.searchable-combobox,
.searchable-combobox-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.pm-search-input,
.searchable-combobox-input {
  width: 100% !important;
  height: 42px !important;
  padding-left: 46px !important;
  padding-right: 38px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  color: var(--text-main) !important;
  background: #ffffff !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  outline: none !important;
  transition: var(--transition) !important;
  box-sizing: border-box !important;
}

.pm-search-input::placeholder,
.searchable-combobox-input::placeholder {
  color: #78716c !important;
  opacity: 0.85 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
}

.pm-search-input:focus,
.searchable-combobox-input:focus {
  border-color: var(--primary-light) !important;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15) !important;
}

.pm-search-icon,
.searchable-combobox-icon {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #78716c !important;
  pointer-events: none !important;
  z-index: 3 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
  height: 18px !important;
}

.pm-search-clear,
.searchable-combobox-clear {
  position: absolute !important;
  right: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: none !important;
  border: none !important;
  color: var(--text-muted) !important;
  cursor: pointer !important;
  padding: 4px !important;
  font-size: 16px !important;
  line-height: 1 !important;
  z-index: 3 !important;
  display: none;
}

.pm-search-clear:hover,
.searchable-combobox-clear:hover {
  color: var(--accent) !important;
}

.searchable-combobox-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
  flex-direction: column;
}

.searchable-combobox-dropdown.active {
  display: flex;
}

.searchable-combobox-item {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.searchable-combobox-item:last-child {
  border-bottom: none;
}

.searchable-combobox-item:hover,
.searchable-combobox-item.focused {
  background: var(--bg-app);
  color: var(--primary-light);
}

.searchable-combobox-item.selected {
  background: #fffbeb;
  color: var(--primary-light);
  font-weight: 700;
}

.searchable-combobox-empty {
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Micro-badge for size tags */
.pm-size-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.pm-size-chip:hover {
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

.pm-size-chip .chip-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  padding: 0 2px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}

.pm-size-chip .chip-remove-btn:hover {
  color: var(--accent);
}

/* ==========================================================================
   DASHBOARD VIEW TOGGLES & ORDER CARDS GRID STYLING
   ========================================================================== */
.dash-view-nav-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.dash-view-btn {
  background: transparent;
  border: none;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 700;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.dash-view-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

.dash-view-btn.active {
  background-color: #182335;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(24, 35, 53, 0.2);
}

/* Order Cards Grid */
.order-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.order-card-box {
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.order-card-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(24, 35, 53, 0.08);
}

.order-card-header {
  background: #faf8f5;
  border-bottom: 1px solid #e7e2d7;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-card-jcno {
  font-family: monospace;
  font-size: 14px;
  font-weight: 800;
  color: #182335;
  background: rgba(24, 35, 53, 0.08);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid #d6d0c4;
}

.order-card-date {
  font-size: 11.5px;
  color: #78716c;
  font-weight: 600;
}

.order-card-body {
  padding: 16px;
  flex: 1;
}

.order-card-party {
  font-size: 16px;
  font-weight: 800;
  color: #182335;
  margin-bottom: 2px;
  line-height: 1.2;
}

.order-card-jobber {
  font-size: 12.5px;
  color: #78716c;
  font-weight: 600;
  margin-bottom: 12px;
}

.order-card-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 12px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.order-card-details-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #e2e8f0;
}

.order-card-details-table tr:last-child td {
  border-bottom: none;
}

.order-card-label {
  color: #64748b;
  font-weight: 600;
  width: 40%;
}

.order-card-val {
  color: #0f172a;
  font-weight: 700;
}

.order-card-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.order-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-card-action {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-card-action:hover {
  background: #182335;
  color: #ffffff;
  border-color: #182335;
}

.btn-card-action.btn-card-wa:hover {
  background: #25d366;
  color: #ffffff;
  border-color: #25d366;
}

@media print {
  body {
    background: #ffffff !important;
    padding: 0 !important;
  }
  .dash-container, .register-container, .navbar-header, .tabs-navigation, .dash-header, .kpi-grid, .dash-analytics-section, .controls-bar, .modal-header-dash, .modal-footer-dash, .modal-footer, .modal-tip-bar {
    display: none !important;
  }
  #jobCardModal {
    position: static !important;
    background: transparent !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  #jobCardPrintArea {
    background: #ffffff !important;
    padding: 0 !important;
    width: 100% !important;
  }
}

/* ========================================================================= */
/* RC ORDER HAMBURGER MENU & MOBILE NAVIGATION DRAWER STYLES */
/* ========================================================================= */
.nav-hamburger-btn {
  display: none !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: #1e1e1e;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  margin: 0 auto;
}

.nav-hamburger-btn:hover,
.nav-hamburger-btn:active {
  background: #333333;
  transform: translateY(-1px);
}

.hamburger-svg {
  flex-shrink: 0;
}

.hamburger-btn-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.hamburger-active-tag {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-header-hamburger-btn {
  display: none !important;
}

/* Mobile Navigation Drawer Overlay */
.mobile-nav-drawer {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  z-index: 999999 !important;
  display: none;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mobile-nav-drawer.active {
  display: flex !important;
  opacity: 1;
}

.mobile-nav-content {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 20px 18px calc(20px + var(--safe-bottom));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
  border: 1px solid #cbd5e1;
  max-height: 85vh;
  overflow-y: auto;
  box-sizing: border-box;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-drawer.active .mobile-nav-content {
  transform: translateY(0);
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 14px;
}

.mobile-nav-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.mobile-nav-close-btn {
  background: #f1f5f9;
  border: none;
  font-size: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.mobile-nav-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.mobile-nav-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.15s ease;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
}

.mobile-nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.mobile-nav-item.active {
  background: #1e1e1e !important;
  color: #ffffff !important;
  border-color: #1e1e1e !important;
}

.mobile-nav-label {
  flex: 1;
}

.mobile-active-badge {
  font-size: 10px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

/* Mobile & Small Screen Responsive Overrides */
@media (max-width: 768px) {
  .tabs-navigation {
    justify-content: center !important;
    padding: 8px 12px !important;
    padding-bottom: calc(8px + var(--safe-bottom)) !important;
    min-height: 54px !important;
  }

  .tabs-navigation .tab-trigger {
    display: none !important;
  }

  .nav-hamburger-btn {
    display: inline-flex !important;
  }

  .top-header-hamburger-btn {
    display: inline-flex !important;
  }
}

/* ============================================================================
   GLOBAL ORDER & MANUFACTURING STATUS BADGES / BUTTONS / BOXES
   ============================================================================ */
.status-badge, .status-btn, .status-btn-box, .badge, .status-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 5px 12px !important;
  border-radius: 9999px !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  letter-spacing: 0.25px !important;
  white-space: nowrap !important;
  border: 1px solid transparent !important;
  cursor: pointer !important;
  transition: all 0.18s ease-in-out !important;
  line-height: 1.3 !important;
  text-decoration: none !important;
  font-family: inherit !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  user-select: none !important;
}

.status-badge:hover, .status-btn:hover, .status-btn-box:hover, .badge:hover, .status-pill:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
  filter: brightness(0.97) !important;
}

.status-badge:active, .status-btn:active, .status-btn-box:active, .badge:active, .status-pill:active {
  transform: translateY(0) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

/* Canonical Order Statuses */
.badge.pending, .status-badge.status-pending, .status-badge.pending, .status-btn.status-pending, .status-btn.pending, .status-pending, .jc-status-badge.pending {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5 !important;
}

.badge.printing, .status-badge.status-printing, .status-badge.printing, .status-btn.status-printing, .status-btn.printing, .status-printing, .jc-status-badge.printing {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
  border: 1px solid #93c5fd !important;
}

.badge.packaging, .status-badge.status-packaging, .status-badge.packaging, .status-btn.status-packaging, .status-btn.packaging, .status-packaging, .jc-status-badge.packaging {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fcd34d !important;
}

.badge.out-for-delivery, .status-badge.status-out-for-delivery, .status-badge.out-for-delivery, .status-btn.status-out-for-delivery, .status-btn.out-for-delivery, .status-out-for-delivery, .jc-status-badge.out-for-delivery {
  background: #f3e8ff !important;
  color: #7e22ce !important;
  border: 1px solid #d8b4fe !important;
}

.badge.delivered, .badge.complete, .status-badge.status-delivered, .status-badge.delivered, .status-btn.status-delivered, .status-btn.delivered, .status-delivered, .status-completed, .jc-status-badge.delivered {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}

/* Manufacturing Order Status Badges (Issued -> Half Received -> Received) */
.badge.issued, .status-badge.status-issued, .status-badge.issued, .status-btn.status-issued, .status-btn.issued, .status-issued, .jc-status-badge.issued {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #7dd3fc !important;
}

.badge.half-received, .badge.half-pending, .status-badge.status-half-received, .status-badge.half-received, .status-btn.status-half-received, .status-btn.half-received, .status-half-received, .status-half-pending, .jc-status-badge.half-received {
  background: #ffedd5 !important;
  color: #c2410c !important;
  border: 1px solid #fdba74 !important;
}

.badge.received, .status-badge.status-received, .status-badge.received, .status-btn.status-received, .status-btn.received, .status-received, .jc-status-badge.received {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}

/* Cancelled / Closed */
.badge.cancelled, .badge.closed, .status-badge.status-cancelled, .status-badge.cancelled, .status-btn.status-cancelled, .status-btn.cancelled, .status-cancelled, .status-closed, .jc-status-badge.cancelled {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

/* ============================================================================
   TARGET PRODUCTION FAST ENTRY (Typeahead Suggestions & Size Grid)
   ============================================================================ */
.plan-typeahead-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 1050;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  max-height: 190px;
  overflow-y: auto;
  margin-top: 2px;
}
.plan-typeahead-item {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s ease, color 0.1s ease;
}
.plan-typeahead-item:last-child {
  border-bottom: none;
}
.plan-typeahead-item:hover, .plan-typeahead-item.highlighted {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}
.plan-did-you-mean {
  font-size: 11.5px;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  padding: 3px 8px;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.plan-did-you-mean button.accept-hint-btn {
  background: #4f46e5;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}
.plan-did-you-mean button.dismiss-hint-btn {
  background: transparent;
  color: #64748b;
  border: none;
  font-size: 11.5px;
  cursor: pointer;
  padding: 0 2px;
}
.plan-size-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 1024px) {
  .plan-size-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .plan-size-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .plan-size-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.plan-grid-tile {
  background: #faf8f5;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 4px;
  text-align: center;
  transition: all 0.15s ease;
}
.plan-grid-tile.has-qty {
  background: #eff6ff !important;
  border-color: #3b82f6 !important;
}

/* Live Spellcheck Suggestion Bar (Order Notes & Free-text textareas) */
.notes-spellcheck-container,
.notes-spellcheck-line {
  min-height: 28px;
  line-height: 24px;
  padding: 2px 0;
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  font-family: inherit;
  transition: opacity 0.15s ease;
}

.notes-spellcheck-container:not(.has-suggestions) {
  /* Keeps layout height reserved to prevent any layout shift */
  visibility: hidden;
}

.notes-spellcheck-container.has-suggestions {
  visibility: visible;
}

.spell-prompt {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  margin-right: 2px;
  display: inline-flex;
  align-items: center;
}

.spell-chip {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
  min-height: 24px;
}

.spell-chip:hover,
.spell-chip:focus {
  background: #e0e7ff;
  color: #1e1b4b;
  border-color: #818cf8;
  outline: none;
}

.spell-action-btn {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 24px;
}

.spell-action-btn:hover,
.spell-action-btn:focus {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
  outline: none;
}

.spell-next-btn {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
  font-weight: 700;
}

.spell-next-btn:hover {
  background: #fde68a;
  color: #78350f;
  border-color: #f59e0b;
}

/* Custom Dictionary admin badges */
.custom-dict-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  margin: 4px;
}

.custom-dict-badge .dict-del-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 13px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.custom-dict-badge .dict-del-btn:hover {
  color: #b91c1c;
}






