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

:root {
  --stock-blue: #0b345e;
  --stock-header-blue: #072a4d;
  --stock-label-blue: #0a2f55;
  --stock-border: #cccccc;
  --stock-border-focus: #0b345e;
  --stock-red: #d3072a;
  --stock-red-hover: #b00521;
  --stock-bg: #f9fafb;
  --stock-card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --success: #10b981;
  --success-dark: #065f46;
  --warning: #f59e0b;
  --danger: #dc2626;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--stock-bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  padding: 12px 10px calc(76px + env(safe-area-inset-bottom, 14px));
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
  body {
    padding: 18px 16px 85px;
  }
}

@media (min-width: 1024px) {
  body {
    padding: 20px 24px 90px;
  }
}

/* ============================================================
   TOP GLOBAL UTILITY HEADER (STATUS & ACTIONS)
   ============================================================ */
.global-nav-container {
  max-width: 1200px;
  margin: 0 auto 16px;
  width: 100%;
}

.global-top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 12px;
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-header-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.top-header-logo {
  height: 32px;
  max-width: 120px;
  object-fit: contain;
}

.top-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Google Sheets Sync Badge & Status */
.sheet-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.sheet-pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  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); }
}

.btn-sync {
  background: #ffffff;
  color: var(--stock-blue);
  border: 1.5px solid var(--stock-blue);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.btn-sync:hover {
  background: var(--stock-blue);
  color: #ffffff;
}

.btn-sync:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-sync.btn-sync-muted {
  color: #64748b;
  border-color: #cbd5e1;
}

.btn-sync.btn-sync-muted:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* ============================================================
   GLOBAL RESPONSIVE BOTTOM NAVIGATION BAR
   ============================================================ */
.bottom-nav-bar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.98);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid #cbd5e1;
  box-shadow: 0 -4px 20px rgba(11, 52, 94, 0.1);
  z-index: 9990;
  align-items: center;
  justify-content: center;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 960px;
  height: 100%;
  box-sizing: border-box;
}

/* Base Navigation Item (Unified Color & Styling for all 5 items) */
.bottom-nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  height: 42px;
  flex: 1 1 0px;
  max-width: 180px;
  min-width: 0;
  border-radius: 10px;
  text-decoration: none;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  overflow: hidden;
}

.bottom-nav-item:hover {
  background: #e2e8f0;
  color: var(--stock-blue);
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.bottom-nav-item:active {
  transform: scale(0.97);
}

/* Active State: Deep Blue high-contrast pill highlight */
.bottom-nav-item.active {
  background: #0b345e;
  color: #ffffff;
  border-color: #0b345e;
  box-shadow: 0 4px 14px rgba(11, 52, 94, 0.32);
  transform: translateY(-1px);
}

.bottom-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.bottom-nav-svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: block;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.bottom-nav-item:hover .bottom-nav-svg,
.bottom-nav-item.active .bottom-nav-svg {
  transform: scale(1.05);
}

/* Navigation Text Label */
.bottom-nav-label {
  font-size: 12px;
  font-weight: 700;
  color: inherit;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.1px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   RESPONSIVE NAVIGATION BREAKPOINTS
   ============================================================ */
@media (max-width: 640px) {
  .bottom-nav-inner {
    gap: 5px;
  }

  .bottom-nav-item {
    padding: 6px 6px;
    height: 40px;
    gap: 4px;
  }

  .bottom-nav-label {
    font-size: 11px;
  }

  .bottom-nav-svg {
    width: 15px;
    height: 15px;
  }
}

@media (max-width: 480px) {
  .bottom-nav-label {
    font-size: 10.5px;
  }

  .bottom-nav-item {
    padding: 5px 4px;
    border-radius: 8px;
  }
}

/* ============================================================
   MAIN STOCK FORM CARD (EXACT MATCH TO SCREENSHOTS 1 & 2)
   ============================================================ */
.stock-page-container {
  max-width: 480px;
  width: 100%;
  margin: 0 auto 30px;
}

.stock-page-container.fabric-page-container,
.stock-page-container.readymade-page-container {
  width: 95%;
  max-width: 1200px;
  margin: 0 auto 30px;
}

.stock-card {
  background: var(--stock-card-bg);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 24px 20px;
  box-shadow: var(--shadow-md);
  width: 100%;
}

.stock-card.fabric-stock-card,
.stock-card.readymade-stock-card {
  width: 100%;
  max-width: 1200px;
  padding: 24px 28px;
  box-sizing: border-box;
}

.stock-card-header {
  text-align: center;
  margin-bottom: 20px;
}

.stock-logo {
  height: 48px;
  max-width: 180px;
  object-fit: contain;
  margin-bottom: 8px;
}

.stock-card-title {
  color: var(--stock-blue);
  font-size: 19px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.2px;
}

/* Form Groups & Labels */
.stock-form-group {
  margin-bottom: 12px;
}

.stock-label {
  display: block;
  color: var(--stock-label-blue);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stock-input {
  width: 100%;
  height: 38px;
  padding: 6px 10px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1px solid var(--stock-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  touch-action: manipulation;
}

.stock-input:focus {
  border-color: var(--stock-border-focus);
  box-shadow: 0 0 0 3px rgba(11, 52, 94, 0.1);
}

.stock-input[readonly] {
  background-color: #ffffff;
  color: #334155;
}

/* Radio Row for Stock Out / Stock In */
.stock-radio-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin: 14px 0 16px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid #f1f5f9;
}

.stock-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--stock-label-blue);
  cursor: pointer;
  padding: 4px 8px;
  user-select: none;
  touch-action: manipulation;
}

.stock-radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--stock-blue);
  cursor: pointer;
}

/* Dropdowns with thick down chevron */
.stock-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 12px;
}

.stock-grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px 10px;
  margin-bottom: 14px;
}

.stock-select-wrapper {
  position: relative;
  width: 100%;
}

.stock-select {
  width: 100%;
  height: 38px;
  padding: 6px 28px 6px 9px;
  font-size: 12.5px;
  font-family: inherit;
  color: #334155;
  background-color: #ffffff;
  border: 1px solid var(--stock-border);
  border-radius: var(--radius-sm);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  touch-action: manipulation;
}

.stock-select:focus {
  border-color: var(--stock-border-focus);
  box-shadow: 0 0 0 3px rgba(11, 52, 94, 0.1);
}

.stock-select-wrapper::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #000000;
  pointer-events: none;
}

/* Hide native wrapper arrow when custom combobox is mounted or input child is used */
.stock-select-wrapper.has-combobox::after,
.stock-select-wrapper:has(.combobox-control-wrapper)::after,
.stock-select-wrapper:has(input)::after {
  display: none !important;
}

/* Remove up/down spinner arrows from all number inputs across the Stock app */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Size / Quantity Section (Screenshot 1: 3 columns cleanly aligned) */
.size-qty-container {
  background-color: #f1f5f9;
  border-radius: 6px;
  padding: 14px 10px;
  margin: 8px 0 18px;
}

.size-qty-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px 10px;
}

.size-qty-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.size-tag-label {
  font-size: 11.5px;
  font-weight: 800;
  color: #0f172a;
  min-width: 38px;
  text-align: left;
}

.size-qty-input {
  width: 100%;
  height: 30px;
  padding: 2px 6px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--stock-border);
  border-radius: 3px;
  background: #ffffff;
  outline: none;
  text-align: center;
  touch-action: manipulation;
}

.size-qty-input:focus {
  border-color: var(--stock-blue);
  box-shadow: 0 0 0 2px rgba(11, 52, 94, 0.15);
}

/* Submit Button (Screenshot 1 & 2: Solid Red button) */
.btn-stock-submit {
  width: 100%;
  height: 46px;
  background-color: var(--stock-red);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.2s ease, transform 0.1s;
  touch-action: manipulation;
}

.btn-stock-submit:hover {
  background-color: var(--stock-red-hover);
}

.btn-stock-submit:active {
  transform: translateY(1px);
}

.btn-stock-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsive adjustments for Form & Entry Cards */
@media (max-width: 540px) {
  .stock-grid-3col {
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
  }
  .stock-grid-3col > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .stock-card {
    padding: 18px 14px;
  }
  .stock-card-title {
    font-size: 17px;
  }
  .stock-logo {
    height: 42px;
  }
  .stock-radio-row {
    margin: 10px 0 14px;
    padding: 6px 8px;
  }
  .stock-radio-label {
    font-size: 13.5px;
  }
}

@media (max-width: 440px) {
  .size-qty-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
  }
  .size-qty-item[style*="visibility:hidden"] {
    display: none !important;
  }
  .size-tag-label {
    min-width: 42px;
    font-size: 12px;
  }
  .size-qty-input {
    height: 34px;
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  .stock-card {
    padding: 14px 10px;
  }
  .stock-grid-2col {
    gap: 8px 6px;
  }
  .size-qty-grid {
    gap: 6px 6px;
  }
  .size-tag-label {
    min-width: 36px;
    font-size: 11px;
  }
}

/* ============================================================
   SCREENSHOT 3: READY MADE STOCK REPORT STYLES
   ============================================================ */
.report-page-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.report-header-banner {
  background-color: var(--stock-header-blue);
  color: #ffffff;
  text-align: center;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
  border-radius: 4px 4px 0 0;
}

@media (max-width: 480px) {
  .report-header-banner {
    font-size: 14.5px;
    padding: 10px 12px;
  }
}

.report-filter-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.report-filter-row {
  margin-bottom: 10px;
}

.report-filter-input {
  width: 100%;
  height: 38px;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--stock-border);
  border-radius: 3px;
  outline: none;
  touch-action: manipulation;
}

.report-filter-input:focus {
  border-color: var(--stock-blue);
  box-shadow: 0 0 0 2px rgba(11, 52, 94, 0.1);
}

.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 600px) {
  .report-filter-panel {
    padding: 12px 12px;
  }
  .report-filter-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

@media (max-width: 360px) {
  .report-filter-grid {
    grid-template-columns: 1fr;
  }
}

/* Summary Statistics Cards */
.summary-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

@media (min-width: 1024px) {
  .summary-cards-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .summary-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .summary-stat-card {
    padding: 10px 12px;
  }
  .stat-card-label {
    font-size: 10px;
  }
  .stat-card-value {
    font-size: 18px;
  }
}

.summary-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.summary-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--stock-blue);
}

.summary-stat-card.card-in::before { background: #10b981; }
.summary-stat-card.card-out::before { background: #f59e0b; }
.summary-stat-card.card-curr::before { background: #0b345e; }
.summary-stat-card.card-low::before { background: #ea580c; }
.summary-stat-card.card-zero::before { background: #dc2626; }

.stat-card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--stock-blue);
}

/* Product Report Cards Container & Grid - Full Width Product Cards */
#reportCardsContainer {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Dedicated Product No Card matching screenshot */
.product-no-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.product-no-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: #dc2626;
}

.product-no-card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.pno-card-header {
  padding: 16px 20px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.pno-card-main-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 260px;
  flex: 1 1 auto;
}

.pno-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pno-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef2f2;
  color: #991b1b;
  border: 1.5px solid #fecaca;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 13.5px;
  font-weight: 850;
  letter-spacing: 0.5px;
}

.pno-badge .pno-label-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: #b91c1c;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.pno-prod-name {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
  text-transform: uppercase;
}

.pno-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.pno-chip {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pno-chip-brand {
  background: #eef2ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.pno-chip-material {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.pno-chip-count {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
  font-weight: 700;
}

.pno-card-metrics {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.product-meta-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  margin-bottom: 12px;
}

.product-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.meta-label {
  font-weight: 700;
  color: #64748b;
  width: 90px;
}

.meta-val {
  font-weight: 700;
  color: #0f172a;
  text-align: right;
  flex: 1;
  word-break: break-word;
}

.report-sizes-divider {
  height: 1px;
  background-color: #e2e8f0;
  margin: 10px 0;
}

.report-sizes-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.report-sizes-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.size-stock-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
  border-bottom: 1px solid #f1f5f9;
}

.size-stock-tag {
  font-weight: 700;
  color: #334155;
}

.size-stock-qty {
  font-weight: 800;
  color: #0f172a;
}

.report-card-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
}

.total-stock-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.total-stock-amount {
  font-size: 18px;
  font-weight: 800;
  color: #10b981;
}

.total-stock-amount.is-zero {
  color: #dc2626;
}

/* ============================================================
   DATA TABLES (READYMADE & FABRIC STOCK MANAGERS)
   ============================================================ */
.stock-table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  margin-top: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stock-table-header {
  padding: 14px 18px;
  background: #fafafa;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.stock-table-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--stock-blue);
}

.table-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-search-input {
  height: 34px;
  padding: 6px 12px;
  font-size: 12.5px;
  border: 1px solid var(--stock-border);
  border-radius: 4px;
  outline: none;
}

.table-search-input:focus {
  border-color: var(--stock-blue);
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

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

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

.custom-stock-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.custom-stock-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
  font-size: 11px;
  text-transform: uppercase;
}

.custom-stock-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

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

.table-pagination-bar {
  padding: 12px 18px;
  background: #fafafa;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #64748b;
  flex-wrap: wrap;
  gap: 10px;
}

.pagination-btn {
  padding: 5px 12px;
  border: 1px solid var(--stock-border);
  background: #ffffff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
  background: #f1f5f9;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 12px));
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-message {
  min-width: 260px;
  max-width: 400px;
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  animation: slideInRight 0.3s ease;
}

.toast-success { background-color: #059669; }
.toast-error { background-color: #dc2626; }
.toast-warning { background-color: #d97706; }
.toast-info { background-color: #0b345e; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   ADMIN STOCK MANAGEMENT STYLES & RESPONSIVE DASHBOARD
   ============================================================ */
.admin-stock-container {
  max-width: 1200px;
  margin: 0 auto 40px;
  width: 100%;
}

.admin-main-header {
  background: var(--stock-header-blue);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

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

@media (max-width: 640px) {
  .admin-main-header {
    padding: 14px 14px;
  }
  .admin-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .admin-header-left {
    gap: 10px;
  }
  .admin-header-actions {
    width: 100%;
  }
  .admin-header-actions .admin-action-btn {
    width: 100%;
    text-align: center;
    padding: 8px 12px;
  }
}

.admin-tabs-bar {
  display: flex;
  background: #ffffff;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  border-bottom: 2px solid #cbd5e1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  gap: 4px;
  padding: 8px 12px 0;
}

.admin-tabs-bar::-webkit-scrollbar {
  height: 4px;
}

.admin-tabs-bar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.admin-tab-btn {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  touch-action: manipulation;
}

.admin-tab-btn:hover {
  color: var(--stock-blue);
  background: #f8fafc;
}

.admin-tab-btn.active {
  color: var(--stock-blue);
  border-bottom-color: var(--stock-red);
  background: #ffffff;
}

.admin-tab-content {
  display: none;
}

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

.admin-panel-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 600px) {
  .admin-panel-card {
    padding: 16px 12px;
  }
}

.admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 14px;
}

@media (max-width: 600px) {
  .admin-panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .admin-panel-header .admin-primary-btn {
    width: 100%;
    justify-content: center;
  }
}

.admin-panel-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--stock-blue);
  margin: 0;
}

.admin-panel-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.admin-primary-btn {
  background: var(--stock-red);
  color: #ffffff;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s;
  touch-action: manipulation;
}

.admin-primary-btn:hover {
  background: var(--stock-red-hover);
}

.admin-btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
  touch-action: manipulation;
}

.admin-btn-secondary:hover {
  background: #e2e8f0;
}

.admin-action-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
  touch-action: manipulation;
}

.admin-filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-search-input {
  flex: 2;
  min-width: 200px;
  height: 38px;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--stock-border);
  border-radius: 4px;
  outline: none;
  touch-action: manipulation;
}

.admin-select-input {
  flex: 1;
  min-width: 150px;
  height: 38px;
  padding: 6px 10px;
  font-size: 12.5px;
  border: 1px solid var(--stock-border);
  border-radius: 4px;
  outline: none;
  touch-action: manipulation;
}

@media (max-width: 640px) {
  .admin-filter-bar {
    flex-direction: column;
    gap: 8px;
  }
  .admin-search-input,
  .admin-select-input {
    width: 100%;
    min-width: 100%;
  }
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}

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

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

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}

.admin-data-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
  padding: 10px 14px;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.admin-data-table tbody tr:hover td {
  background: #f8fafc;
}

.admin-status-toggle {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-active {
  background: #dcfce7;
  color: #15803d;
}

.status-inactive {
  background: #fee2e2;
  color: #b91c1c;
}

.admin-btn-action {
  background: none;
  border: 1px solid #cbd5e1;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 4px;
  touch-action: manipulation;
}

.admin-btn-action:hover {
  background: #f1f5f9;
}

.admin-btn-danger {
  color: #dc2626;
  border-color: #fca5a5;
}

.admin-btn-danger:hover {
  background: #fef2f2;
}

/* Badges Grid for Options / Sizes / Units */
.admin-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 580px) {
  .admin-badge-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .admin-badge-card {
    padding: 9px 12px;
  }
}

.admin-badge-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  min-height: 52px;
}

.admin-badge-card:hover {
  border-color: var(--stock-blue);
  box-shadow: 0 3px 8px rgba(11, 52, 94, 0.09);
  transform: translateY(-1px);
}

.admin-badge-card.is-inactive {
  opacity: 0.55;
  background: #f8fafc;
  border-style: dashed;
}

.admin-badge-name {
  font-weight: 700;
  font-size: 13.5px;
  color: #0b345e;
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-badge-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.admin-mini-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  font-size: 13px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  touch-action: manipulation;
  transition: all 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

.admin-mini-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

/* Mapping Preset Buttons & Grid (Requirement 2) */
.mapping-presets-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .mapping-presets-row {
    width: 100%;
  }
  .mapping-presets-row .admin-btn-secondary {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
    padding: 7px 4px;
    font-size: 11.5px;
  }
}

.mapping-sizes-grid-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px;
}

@media (max-width: 400px) {
  .mapping-sizes-grid-box {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px;
  }
  .mapping-checkbox-item {
    font-size: 11px;
    padding: 5px 6px;
  }
}

.mapping-checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: #f8fafc;
  user-select: none;
  touch-action: manipulation;
}

.mapping-checkbox-item.is-selected {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.mapping-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

/* Suggestions tab responsive overrides */
@media (max-width: 640px) {
  #tab-suggestions .stock-grid-2col,
  #tab-suggestions .stock-grid-3col {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* Fabric Sub Cards */
.admin-sub-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px;
}

.admin-sub-title {
  font-size: 13px;
  font-weight: 800;
  color: #0b345e;
  margin-bottom: 10px;
}

.admin-mini-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 3px 8px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: #1e293b;
}

.admin-mini-badge button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: #ef4444;
}

.admin-mini-badge.is-inactive {
  opacity: 0.5;
  text-decoration: line-through;
}

@media (max-width: 768px) {
  #tab-fabrics .stock-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

/* Modal Window */
.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.admin-modal-card {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.2s ease;
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.admin-modal-header {
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.admin-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 480px) {
  .admin-modal-body {
    padding: 14px 14px;
  }
}

/* Size item hidden state for dynamic product-to-size filtering */
.size-qty-item.size-hidden {
  display: none !important;
}

/* Responsive Toast Notifications */
@media (max-width: 600px) {
  .toast-container {
    bottom: calc(72px + env(safe-area-inset-bottom, 12px));
    left: 12px;
    right: 12px;
  }
  .toast-message {
    max-width: 100%;
    min-width: 0;
    font-size: 12.5px;
    padding: 10px 14px;
  }
}

/* ============================================================
   GLOBAL MOBILE DEVICE OPTIMIZATIONS (IOS ZOOM PREVENTION & TOUCH SIZING)
   ============================================================ */
@media (max-width: 768px) {
  /* Prevent iOS Safari automatic form zoom when font-size < 16px */
  .stock-input,
  .stock-select,
  .admin-search-input,
  .admin-select-input,
  .report-filter-input {
    font-size: 16px !important;
  }

  .stock-select-wrapper::after {
    right: 12px;
  }

  .btn-stock-submit {
    height: 48px;
    font-size: 16px;
  }
}

/* ============================================================
   REPORTS: STOCK MONITORING & PRODUCT NO. IDENTIFIER BADGES
   ============================================================ */
.stock-monitoring-bar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: none;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-radius: 0 0 6px 6px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.stock-monitoring-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.monitoring-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #047857;
  background: #ecfdf5;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid #a7f3d0;
  letter-spacing: 0.5px;
  width: fit-content;
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.monitoring-subtitle {
  font-size: 12px;
  color: #475569;
}

.stock-monitoring-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-monitoring-action {
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.btn-monitoring-view {
  background: #ffffff;
  border: 1px solid #0b345e;
  color: #0b345e;
}

.btn-monitoring-view:hover {
  background: #f0f7ff;
  border-color: #082848;
}

.btn-monitoring-download {
  background: #0b345e;
  border: 1px solid #0b345e;
  color: #ffffff;
}

.btn-monitoring-download:hover {
  background: #082848;
}

.btn-monitoring-csv {
  background: #059669;
  border: 1px solid #059669;
  color: #ffffff;
}

.btn-monitoring-csv:hover {
  background: #047857;
}

.fabric-stock-table {
  min-width: 1400px;
}

/* Prominent Numeric Identifier Badge on Product Cards (01, 02, 03, 207) */
.product-avatar-circle.product-no-badge {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: #ffffff;
  color: #0b345e;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: -0.3px;
  border: 2px solid #94a3b8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   PDF PREVIEW MODAL & PRINTABLE DOCUMENT STYLES
   ============================================================ */
.pdf-modal-dialog {
  max-width: 960px;
  width: 95%;
  max-height: 92vh;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.btn-pdf-print-action {
  background: #059669;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.btn-pdf-print-action:hover {
  background: #047857;
}

.pdf-modal-body {
  padding: 20px;
  background: #475569;
  overflow-y: auto;
  max-height: calc(92vh - 65px);
}

.pdf-document-paper {
  max-width: 860px;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  padding: 32px 36px;
  min-height: 600px;
  border-radius: 4px;
}

.pdf-header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0b345e;
  padding-bottom: 14px;
  margin-bottom: 16px;
  gap: 16px;
}

.pdf-header-branding {
  display: flex;
  gap: 14px;
  align-items: center;
}

.pdf-logo {
  height: 48px;
  object-fit: contain;
}

.pdf-company-title {
  margin: 0;
  font-size: 20px;
  color: #0b345e;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.pdf-doc-subtitle {
  font-size: 12px;
  color: #334155;
  font-weight: 700;
  margin-top: 2px;
}

.pdf-sheet-source {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
}

.pdf-header-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pdf-meta-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 4px 10px;
  border-radius: 4px;
  text-align: right;
}

.pdf-meta-label {
  font-size: 9.5px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
  display: block;
}

.pdf-meta-val {
  font-size: 11.5px;
  color: #0f172a;
  font-weight: 800;
}

.pdf-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.pdf-summary-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  border-radius: 4px;
}

.pdf-sum-label {
  font-size: 9px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 2px;
}

.pdf-sum-value {
  font-size: 13.5px;
  font-weight: 900;
  color: #0f172a;
}

.pdf-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 20px;
}

.pdf-stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.pdf-stock-table th {
  background: #0b345e;
  color: #ffffff;
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
}

.pdf-stock-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.pdf-stock-table tr:nth-child(even) {
  background: #f8fafc;
}

.pdf-badge-circle {
  display: inline-flex;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.pdf-status-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.pdf-status-in {
  background: #d1fae5;
  color: #065f46;
}

.pdf-status-low {
  background: #fef3c7;
  color: #92400e;
}

.pdf-status-out {
  background: #fee2e2;
  color: #991b1b;
}

.pdf-footer-wrapper {
  margin-top: 24px;
  border-top: 1px solid #cbd5e1;
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.pdf-footer-notes {
  font-size: 10.5px;
  color: #64748b;
  line-height: 1.4;
  max-width: 60%;
}

.pdf-footer-signatures {
  display: flex;
  gap: 24px;
}

.pdf-sig-line {
  width: 130px;
  border-top: 1px solid #475569;
  text-align: center;
  padding-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
}

/* ============================================================
   @MEDIA PRINT RULES (PERFECT A4 PRINT / SAVE AS PDF)
   ============================================================ */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Hide app navigation, buttons, search, filters, modals, toasts */
  .global-nav-container,
  .report-page-container,
  .stock-page-container,
  .admin-modal-overlay,
  .dynamic-add-modal-overlay,
  .stock-modal-overlay,
  .toast-container {
    display: none !important;
  }

  /* Standalone print container replaces the whole document */
  .standalone-print-wrapper {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .pdf-report-sheet {
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }

  .pdf-stock-table th {
    background: #0b345e !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .pdf-badge-circle {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    border: 1px solid #0284c7 !important;
  }

  .pdf-status-badge {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    border: 1px solid #94a3b8 !important;
  }

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

/* ============================================================
   LIVE SELECTED PRODUCT STOCK BANNER (ON READYMADE FORM)
   ============================================================ */
.live-product-stock-panel {
  background: #f0f7ff;
  border: 1px solid #bae6fd;
  border-left: 4px solid #0284c7;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(11, 52, 94, 0.06);
  animation: fadeInPanel 0.2s ease-in-out;
}

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

.live-stock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.live-stock-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.live-pulse-badge {
  font-size: 10px;
  font-weight: 800;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid #7dd3fc;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.live-product-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #0b345e;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-stock-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: #475569;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}

.live-total-stock {
  font-weight: 700;
  color: #0b345e;
}

.live-total-stock strong {
  font-size: 13.5px;
  color: #059669;
}

.live-calc-formula {
  font-size: 10.5px;
  color: #64748b;
  font-style: italic;
}

.live-sizes-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.live-size-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11.5px;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.live-size-chip strong {
  color: #0b345e;
  margin-right: 2px;
}

.live-size-chip.is-zero {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* ============================================================
   LIVE SELECTED PRODUCT SIZE STOCK TABLE
   ============================================================ */
.live-stock-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 10px;
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(11, 52, 94, 0.05);
}

.live-stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.live-stock-table thead tr {
  background: #e0f2fe;
  border-bottom: 2px solid #bae6fd;
}

.live-stock-table th {
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: #0b345e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.live-stock-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 12.5px;
  color: #1e293b;
}

.live-stock-table tbody tr.live-stock-data-row:nth-child(even) {
  background-color: #f8fafc;
}

.live-stock-table tbody tr.live-stock-data-row:hover {
  background-color: #f0f9ff;
}

.live-stock-table tbody tr.live-stock-data-row:last-child td {
  border-bottom: none;
}

/* Strict Column Alignment */
.live-table-col-num {
  text-align: center !important;
  width: 75px;
  color: #64748b;
  font-weight: 600;
}

.live-table-col-size {
  text-align: left !important;
  font-weight: 700;
  color: #0b345e;
  padding-left: 14px !important;
}

.live-table-col-qty {
  text-align: right !important;
  padding-right: 20px !important;
  font-weight: 700;
  color: #059669;
  font-variant-numeric: tabular-nums;
}

.live-table-col-qty.is-zero-stock {
  color: #94a3b8;
  font-weight: 600;
}

.live-table-col-unit {
  text-align: center !important;
  width: 85px;
  color: #475569;
  font-weight: 600;
  font-size: 11.5px;
}

.live-table-col-unit .unit-badge {
  display: inline-block;
  padding: 1px 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

.live-table-empty {
  text-align: center !important;
  padding: 16px 12px !important;
  color: #64748b;
  font-style: italic;
  font-size: 12px;
}

.live-table-empty.live-table-error {
  color: #dc2626;
  font-weight: 600;
}

@media (max-width: 640px) {
  .live-stock-table th,
  .live-stock-table td {
    padding: 6px 8px;
    font-size: 11.5px;
  }
  .live-table-col-num {
    width: 55px;
  }
  .live-table-col-size {
    padding-left: 8px !important;
  }
  .live-table-col-qty {
    padding-right: 12px !important;
  }
  .live-table-col-unit {
    width: 65px;
  }
}

/* ============================================================
   CURRENT READYMADE STOCK EXPLORER (MATCHING SCREENSHOT 2)
   ============================================================ */
#currentStockExplorerCard {
  margin-top: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.explorer-tabs-bar {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.explorer-tab-btn {
  padding: 10px 18px;
  font-size: 12.5px;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.explorer-tab-btn:hover {
  color: #0b345e;
  background: #f1f5f9;
}

.explorer-tab-btn.active {
  color: #0b345e;
  border-bottom-color: #0b345e;
  background: #ffffff;
  font-weight: 800;
}

.explorer-filter-panel {
  padding: 12px 16px;
  background: #fafbfc;
  border-bottom: 1px solid #e2e8f0;
}

.explorer-search-row {
  margin-bottom: 8px;
}

.explorer-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.table-sizes-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 260px;
}

.table-size-tag {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11px;
  color: #334155;
  white-space: nowrap;
}

.badge-size-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 800;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 12px;
}

.badge-txn-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.3px;
}

.badge-txn-in {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-txn-out {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-txn-adj {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-source {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}

.badge-source-order {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.badge-source-stock {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-source-adjust {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.badge-source-cancel {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.badge-source-import {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #d8b4fe;
}

.badge-source-sync {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.badge-order-card {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  color: #0b345e;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-stock-zero {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 700;
  font-size: 11px;
  border: 1px solid #fecaca;
  white-space: nowrap;
}

.explorer-table-footer {
  padding: 10px 16px;
  background: #fafafa;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.polling-indicator-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 4px 10px;
  border-radius: 14px;
}

/* ============================================================
   DYNAMIC DROPDOWN "+ ADD NEW" CONTROLS & MODAL
   ============================================================ */

/* Option inside select dropdown */
.select-add-new-option {
  font-weight: 700 !important;
  color: #1d4ed8 !important;
  background-color: #eff6ff !important;
}

/* Inline "+ Add" button next to field labels */
.label-add-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 1px 7px;
  margin-left: 6px;
  cursor: pointer;
  text-transform: none;
  transition: all 0.15s ease;
  vertical-align: middle;
  line-height: 1.4;
  font-family: inherit;
}

.label-add-new-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.label-add-new-btn:active {
  transform: translateY(1px);
}

/* Dynamic Add Modal Window */
.dynamic-add-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  z-index: 10100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.dynamic-add-modal-card {
  background: #ffffff;
  border-radius: 10px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid #e2e8f0;
}

.dynamic-add-modal-header {
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dynamic-add-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.dynamic-add-modal-icon {
  font-size: 16px;
}

.dynamic-add-modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.dynamic-add-modal-close:hover {
  background: #fee2e2;
  color: #ef4444;
}

.dynamic-add-modal-body {
  padding: 18px 20px;
}

.dynamic-add-modal-desc {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 14px 0;
  line-height: 1.45;
}

.dynamic-add-error {
  display: block;
  font-size: 12px;
  color: #ef4444;
  margin-top: 6px;
  font-weight: 500;
}

.dynamic-add-modal-footer {
  padding: 12px 18px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-modal-cancel {
  padding: 8px 16px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-modal-cancel:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.btn-modal-save {
  padding: 8px 18px;
  border: none;
  background: #2563eb;
  color: #ffffff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-modal-save:hover {
  background: #1d4ed8;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

@media (max-width: 480px) {
  .dynamic-add-modal-card {
    max-width: 95vw;
  }
  .dynamic-add-modal-body {
    padding: 14px 16px;
  }
}

/* ============================================================
   STOCK MANAGEMENT TABLE ACTIONS & VIEW/EDIT/DELETE MODALS
   ============================================================ */

.tbl-actions-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}

.btn-tbl-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.2;
}

.btn-tbl-view {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}
.btn-tbl-view:hover {
  background: #166534;
  color: #ffffff;
}

.btn-tbl-edit {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}
.btn-tbl-edit:hover {
  background: #1e40af;
  color: #ffffff;
}

.btn-tbl-pdf {
  background: #faf5ff;
  color: #6b21a8;
  border-color: #e9d5ff;
}
.btn-tbl-pdf:hover {
  background: #6b21a8;
  color: #ffffff;
}

.btn-tbl-delete {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}
.btn-tbl-delete:hover {
  background: #991b1b;
  color: #ffffff;
}

.btn-tbl-add {
  background: #f8fafc;
  color: #0b345e;
  border-color: #cbd5e1;
}
.btn-tbl-add:hover {
  background: #0b345e;
  color: #ffffff;
}

/* Generic Stock Modals (View, Edit, Delete) */
.stock-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  overscroll-behavior: contain;
}

body.modal-open {
  overflow: hidden !important;
}

.stock-modal-card {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 620px;
  max-height: min(90vh, 90dvh, 780px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid #e2e8f0;
  position: relative;
}

/* Ensure forms inside modal card take full flex height and do not push footer out */
.stock-modal-card > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  margin: 0;
}

.stock-modal-header {
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  z-index: 5;
}

.stock-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #0b345e;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stock-modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.stock-modal-close:hover {
  background: #fee2e2;
  color: #ef4444;
}

.stock-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 22px 28px 22px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

/* Accessible focus ring when modal body receives keyboard focus */
.stock-modal-body:focus-visible {
  outline: 2px solid #0b345e;
  outline-offset: -2px;
}

/* Rangoli theme clean, visible scrollbar */
.stock-modal-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.stock-modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.stock-modal-body::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
  border: 2px solid #f1f5f9;
}

.stock-modal-body::-webkit-scrollbar-thumb:hover {
  background: #0b345e;
}

.stock-modal-footer {
  padding: 13px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  z-index: 5;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.04);
}

/* Floating smooth-scroll assist button */
.stock-modal-floating-scroll {
  position: absolute;
  bottom: 68px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #0b345e;
  box-shadow: 0 4px 12px rgba(11, 52, 94, 0.16);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 15;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.stock-modal-floating-scroll:hover {
  background: #0b345e;
  color: #ffffff;
  border-color: #0b345e;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(11, 52, 94, 0.25);
}

.stock-modal-floating-scroll .scroll-fab-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.stock-modal-floating-scroll.pointing-up .scroll-fab-icon {
  transform: rotate(180deg);
}

/* Responsive adjustments for desktop, tablet, and mobile */
@media (max-width: 640px) {
  .stock-modal-overlay {
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .stock-modal-card {
    max-width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 10px;
  }

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

  .stock-modal-body {
    padding: 16px 16px 24px 16px;
  }

  .stock-modal-footer {
    padding: 11px 16px;
  }

  .stock-modal-floating-scroll {
    bottom: 62px;
    right: 12px;
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 520px) {
  .stock-modal-card .stock-grid-2col {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
  }
}

/* Reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .stock-modal-card {
    animation: none !important;
  }
  .stock-modal-body {
    scroll-behavior: auto !important;
  }
  .stock-modal-floating-scroll {
    transition: none !important;
  }
  .stock-modal-floating-scroll .scroll-fab-icon {
    transition: none !important;
  }
}

/* Specifications Grid in View Modal */
.spec-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: #f8fafc;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-top: 14px;
}

@media (max-width: 500px) {
  .spec-grid-2col {
    grid-template-columns: 1fr;
  }
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spec-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.spec-value {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
}

/* Voucher Metrics Grid */
.voucher-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.voucher-metric-card {
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.voucher-metric-in {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.voucher-metric-out {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.voucher-metric-avail {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.voucher-metric-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.voucher-metric-val {
  font-size: 18px;
  font-weight: 800;
  margin-top: 2px;
}

/* ============================================================
   INDIVIDUAL RECORD PRINT VOUCHER
   ============================================================ */

.individual-print-voucher {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  font-family: inherit;
}

.voucher-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0b345e;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.voucher-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.voucher-title-main {
  font-size: 18px;
  font-weight: 800;
  color: #0b345e;
  margin: 0;
}

.voucher-subtitle {
  font-size: 11px;
  color: #64748b;
  margin: 0;
}

.voucher-meta-box {
  text-align: right;
  font-size: 11.5px;
  color: #475569;
}

.voucher-specs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}

.voucher-specs-table th,
.voucher-specs-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
  font-size: 12px;
}

.voucher-specs-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #334155;
  width: 30%;
}

.voucher-specs-table td {
  font-weight: 600;
  color: #0f172a;
}

.voucher-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 10px;
}

.voucher-sig-box {
  width: 180px;
  text-align: center;
  border-top: 1px solid #334155;
  padding-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}

/* ============================================================
   DBMS ENHANCEMENTS: FORM ACTIONS, SORTING & PAGINATION
   ============================================================ */

.form-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  width: 100%;
}

.btn-stock-save {
  flex: 1 1 100%;
  width: 100%;
  height: 44px;
  background: var(--stock-red);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(185, 28, 28, 0.25);
}

.btn-stock-save:hover {
  background: var(--stock-red-hover);
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.35);
}

.btn-stock-update {
  flex: 2;
  height: 44px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.btn-stock-update:hover {
  background: #1d4ed8;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

/* Reset button removed from visible layout across all screen sizes */
.btn-stock-reset {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.btn-stock-cancel {
  flex: 1;
  height: 44px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-stock-cancel:hover {
  background: #fecaca;
  color: #7f1d1d;
}

/* Sortable Table Headers */
.sortable-th {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background 0.15s ease;
}

.sortable-th:hover {
  background: #f1f5f9 !important;
  color: #0b345e !important;
}

.sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.6;
}

.sortable-th.sorted-asc .sort-icon,
.sortable-th.sorted-desc .sort-icon {
  opacity: 1;
  color: #0b345e;
  font-weight: 800;
}

/* Table Pagination Bar */
.table-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 12.5px;
  color: #64748b;
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.pagination-btn.active {
  background: #0b345e;
  border-color: #0b345e;
  color: #ffffff;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-page-size {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #475569;
}

.pagination-page-size select {
  height: 30px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  background: #ffffff;
  color: #1e293b;
}

/* ============================================================
   EXECUTIVE DASHBOARD STYLING (dashboard.html)
   ============================================================ */
.dashboard-page-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px 16px 80px 16px;
}

.dashboard-header-banner {
  background: linear-gradient(135deg, #0b345e 0%, #1e40af 100%);
  color: #ffffff;
  padding: 20px 24px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(11, 52, 94, 0.15);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.dashboard-header-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.3px;
  margin: 0;
}

.dashboard-header-subtitle {
  font-size: 13px;
  color: #cbd5e1;
  margin-top: 4px;
}

.dashboard-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-action-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.dashboard-action-primary {
  background: var(--stock-red);
  color: #ffffff;
}

.dashboard-action-primary:hover {
  background: var(--stock-red-hover);
}

.dashboard-action-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.dashboard-action-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.dashboard-kpi-card {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.dashboard-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-blue::before { background: #2563eb; }
.kpi-green::before { background: #059669; }
.kpi-amber::before { background: #d97706; }
.kpi-indigo::before { background: #4f46e5; }
.kpi-red::before { background: #dc2626; }
.kpi-purple::before { background: #7c3aed; }

.dashboard-kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-kpi-val {
  font-size: 28px;
  font-weight: 900;
  color: #0f172a;
  margin: 6px 0 2px 0;
}

.dashboard-kpi-sub {
  font-size: 11.5px;
  color: #94a3b8;
}

.dashboard-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .dashboard-two-col {
    grid-template-columns: 1fr;
  }
}

.dashboard-panel-card {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.dashboard-panel-header {
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-panel-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #0b345e;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-panel-body {
  padding: 18px;
}

/* Simple Responsive CSS Bar Charts */
.chart-bar-row {
  margin-bottom: 12px;
}

.chart-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.chart-bar-track {
  height: 10px;
  background: #f1f5f9;
  border-radius: 5px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease;
}

.chart-bar-blue { background: #2563eb; }
.chart-bar-green { background: #059669; }
.chart-bar-amber { background: #d97706; }
.chart-bar-indigo { background: #6366f1; }
.chart-bar-rose { background: #e11d48; }

/* Activity Feed Table in Dashboard */
.dashboard-activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.dashboard-activity-table th {
  background: #f8fafc;
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}

.dashboard-activity-table td {
  padding: 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.badge-entity-rm {
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
}

.badge-entity-fb {
  background: #fef3c7;
  color: #b45309;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
}

/* Module Switcher Tabs for Reports & Dashboard */
.module-switcher-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.module-tab-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.module-tab-btn:hover {
  transform: translateY(-1px);
}

.module-dashboard-section {
  transition: opacity 0.2s ease;
}

/* ============================================================
   ACCESSIBLE COMBOBOX CONTROLS & SUGGESTION LISTS
   ============================================================ */

.combobox-control-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.combobox-input {
  width: 100%;
  height: 38px;
  padding: 6px 52px 6px 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid var(--stock-border, #cbd5e1);
  border-radius: var(--radius-sm, 6px);
  box-sizing: border-box;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.combobox-input:focus {
  border-color: var(--stock-border-focus, #2563eb);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.combobox-control-wrapper.has-selected-value .combobox-input {
  color: #0f172a;
  font-weight: 600;
  border-color: #94a3b8;
}

.combobox-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.combobox-clear-btn {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  background: #f1f5f9;
  border: none;
  color: #64748b;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, color 0.15s;
  z-index: 2;
}

.combobox-clear-btn:hover {
  background-color: #fee2e2;
  color: #dc2626;
}

.combobox-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #64748b;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  border-radius: 4px;
  transition: background-color 0.15s, color 0.15s, transform 0.2s ease;
  z-index: 2;
}

.combobox-arrow:hover {
  background-color: #f1f5f9;
  color: #0b345e;
}

.combobox-control-wrapper.is-open .combobox-arrow {
  transform: translateY(-50%) rotate(180deg);
  color: #2563eb;
}

.combobox-dropdown {
  position: fixed;
  background: #ffffff;
  border: 1.5px solid #94a3b8;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.12);
  z-index: 999999;
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  font-family: inherit;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  animation: comboboxDropdownFadeIn 0.12s ease-out;
}

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

.combobox-dropdown.open-upward {
  animation: comboboxDropdownFadeInUp 0.12s ease-out;
}

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

.combobox-options-list {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
  margin: 0;
  list-style: none;
}

.combobox-option {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.12s ease, color 0.12s ease;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

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

.combobox-option:hover,
.combobox-option.highlighted {
  background-color: #f0f9ff;
  color: #0284c7;
}

.combobox-option.selected {
  background-color: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.combobox-option.selected::after {
  content: "✓";
  font-weight: bold;
  font-size: 12px;
  color: #2563eb;
  margin-left: 8px;
  flex-shrink: 0;
}

.combobox-option.select-add-new-option {
  color: #059669;
  background-color: #f0fdf4;
  font-weight: 600;
  border-top: 1px dashed #86efac;
}

.combobox-option.select-add-new-option:hover,
.combobox-option.select-add-new-option.highlighted {
  background-color: #dcfce7;
  color: #047857;
}

.combobox-option-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.combobox-variant-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  width: 100%;
}

.combobox-code-badge {
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
}

.combobox-context-label {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combobox-status-item {
  padding: 12px 14px;
  font-size: 12.5px;
  color: #64748b;
  font-style: italic;
  text-align: center;
}

.combobox-status-item.warning {
  color: #d97706;
  background: #fffbeb;
}

.combobox-load-error-banner {
  background: #fef2f2;
  border: 1px solid #f87171;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}

.unresolved-size-notice {
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  color: #92400e;
  padding: 10px 14px;
  border-radius: 6px;
  margin: 12px 0;
  font-size: 12.5px;
  line-height: 1.4;
}

/* ============================================================
   FABRIC STOCK ENTRY - LANDSCAPE 3-COLUMN GRID & RICH DROPDOWN
   ============================================================ */
.fabric-stock-grid-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
  width: 100%;
  box-sizing: border-box;
}

.fabric-grid-full {
  grid-column: 1 / -1 !important;
}

.fabric-grid-span-2 {
  grid-column: span 2;
}

.fabric-stock-grid-form .stock-form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.fabric-stock-grid-form .stock-form-group .stock-label {
  margin-bottom: 5px;
}

.fabric-selector-box {
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  grid-column: 1 / -1;
  box-sizing: border-box;
}

.fabric-actions-full {
  grid-column: 1 / -1 !important;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  width: 100%;
}

.fabric-actions-full .btn-stock-save {
  flex: 0 0 auto;
  min-width: 240px;
  width: auto;
  padding: 0 28px;
  height: 44px;
}

/* Rich Combobox Option for Fabric */
.combobox-selected-view {
  width: 100%;
  min-height: 52px;
  padding: 6px 54px 6px 14px;
  background: #ffffff;
  border: 1px solid var(--stock-border, #cbd5e1);
  border-radius: var(--radius-sm, 6px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.15s;
  overflow: hidden;
  text-align: left;
}

.combobox-selected-view:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
}

.combobox-selected-view:focus,
.combobox-selected-view:focus-visible {
  outline: none;
  border-color: var(--stock-border-focus, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.combobox-selected-line1 {
  font-size: 14.5px;
  font-weight: 800;
  color: #0b345e;
  line-height: 1.35;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combobox-selected-line2 {
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combobox-option.fabric-combobox-option {
  display: block !important;
  padding: 10px 14px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-left: 4px solid transparent !important;
  transition: background-color 0.12s ease, border-left-color 0.12s ease !important;
  cursor: pointer;
  text-align: left;
}

.combobox-option.fabric-combobox-option:hover,
.combobox-option.fabric-combobox-option.highlighted {
  background-color: #f0f7ff !important;
  border-left-color: #0284c7 !important;
  color: #0f172a !important;
}

.combobox-option.fabric-combobox-option.selected {
  background-color: #eff6ff !important;
  border-left-color: #1d4ed8 !important;
  color: #0b345e !important;
}

.combobox-option.fabric-combobox-option.selected::after {
  display: none !important;
}

.fabric-option-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  text-align: left;
}

.fabric-option-main {
  font-size: 14.5px;
  font-weight: 800;
  color: #0b345e;
  line-height: 1.35;
  letter-spacing: 0.2px;
  white-space: normal;
  word-break: break-word;
}

.fabric-option-sub {
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

/* Tablet adjustments (<= 992px) */
@media (max-width: 992px) {
  .fabric-stock-grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
  }
  .fabric-grid-span-2 {
    grid-column: span 1;
  }
}

/* Mobile adjustments (<= 640px) */
@media (max-width: 640px) {
  .stock-page-container.fabric-page-container {
    width: 96%;
    padding: 0 4px;
  }
  .stock-card.fabric-stock-card {
    padding: 18px 12px;
  }
  .fabric-stock-grid-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .fabric-actions-full {
    flex-direction: column;
    width: 100%;
  }
  .fabric-actions-full button {
    width: 100%;
  }
  .combobox-selected-view {
    min-height: 56px;
    padding: 6px 44px 6px 10px;
  }
  .combobox-selected-line1 {
    font-size: 13.5px;
    white-space: normal;
    word-break: break-word;
  }
  .combobox-selected-line2 {
    font-size: 11.5px;
    white-space: normal;
    word-break: break-word;
  }
}

/* ============================================================
   READYMADE STOCK ENTRY - WIDE LANDSCAPE LAYOUT (~1200px)
   ============================================================ */

.readymade-stock-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

/* Section 1: Top Controls (Date/Time, Transaction Type, Company Name) */
.readymade-top-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
  width: 100%;
  box-sizing: border-box;
  align-items: start;
}

.readymade-radio-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  min-height: 38px;
  height: 38px;
  background: #f8fafc;
  border: 1px solid var(--stock-border);
  border-radius: 4px;
  padding: 0 14px;
  box-sizing: border-box;
}

.readymade-radio-row .stock-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--stock-label-blue);
  cursor: pointer;
  margin: 0;
  padding: 0;
  user-select: none;
}

.readymade-radio-row .stock-radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--stock-blue);
}

/* Section 2: Product Specifications Grid (3 Columns on Desktop, 2 on Tablet, 1 on Mobile) */
.readymade-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
  width: 100%;
  box-sizing: border-box;
}

.readymade-stock-form .stock-form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.readymade-stock-form .stock-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--stock-label-blue);
  line-height: 1.3;
}

.readymade-stock-form .label-add-new-btn {
  margin-left: 2px;
  flex-shrink: 0;
}

.readymade-stock-form .stock-select-wrapper {
  width: 100%;
  position: relative;
}

.readymade-stock-form .stock-select {
  width: 100%;
}

.readymade-stock-form .combobox-control-wrapper {
  width: 100%;
}

/* Available-stock section: live product stock panel */
.readymade-stock-form .live-product-stock-panel {
  width: 100%;
  box-sizing: border-box;
  margin: 4px 0 6px 0;
}

.readymade-stock-form .live-stock-table-container {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid #bae6fd;
}

.readymade-stock-form .live-stock-table thead th {
  position: sticky;
  top: 0;
  background: #e0f2fe;
  z-index: 2;
}

/* Size / Quantity Section: Compact Multi-column Grid */
.readymade-size-qty-group {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.readymade-size-qty-container {
  width: 100%;
  max-width: 100%;
  background-color: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 4px 0 8px;
  box-sizing: border-box;
  overflow: visible;
}

.readymade-size-qty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.readymade-size-qty-grid .size-qty-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 4px 6px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.readymade-size-qty-grid .size-qty-item:focus-within {
  border-color: var(--stock-blue);
  box-shadow: 0 0 0 2px rgba(11, 52, 94, 0.12);
}

.readymade-size-qty-grid .size-tag-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--stock-blue);
  min-width: 28px;
  text-align: left;
  user-select: none;
}

.readymade-size-qty-grid .size-qty-input {
  width: 48px;
  flex: 1 1 44px;
  min-width: 0;
  max-width: 56px;
  height: 30px;
  padding: 2px 4px;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: #ffffff;
  text-align: center;
  outline: none;
}

.readymade-size-qty-grid .size-qty-input:focus {
  border-color: var(--stock-blue);
}

/* Save / Actions Row at the Bottom */
.readymade-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 8px;
  width: 100%;
}

.readymade-actions-row .btn-stock-save {
  flex: 0 0 auto;
  max-width: 380px;
  width: 100%;
  height: 46px;
  background: var(--stock-red);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(211, 7, 42, 0.28);
  transition: all 0.15s ease;
}

.readymade-actions-row .btn-stock-save:hover {
  background: var(--stock-red-hover);
  box-shadow: 0 4px 12px rgba(211, 7, 42, 0.38);
  transform: translateY(-1px);
}

.readymade-actions-row .btn-stock-save:active {
  transform: translateY(1px);
}

.readymade-actions-row .btn-stock-update {
  flex: 0 0 auto;
  width: 100%;
  max-width: 240px;
  height: 46px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}

.readymade-actions-row .btn-stock-cancel {
  flex: 0 0 auto;
  width: 100%;
  max-width: 140px;
  height: 46px;
  background: #64748b;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}

/* Tablet adjustments (<= 992px) */
@media (max-width: 992px) {
  .stock-page-container.readymade-page-container {
    width: 95%;
    max-width: 960px;
  }
  .stock-card.readymade-stock-card {
    padding: 20px 20px;
  }
  .readymade-top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
  }
  .readymade-top-grid > :nth-child(3) {
    grid-column: span 2;
  }
  .readymade-specs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
  }
  .readymade-size-qty-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px 8px;
  }
}

/* Mobile adjustments (<= 640px) */
@media (max-width: 640px) {
  .stock-page-container.readymade-page-container {
    width: 96%;
    padding: 0 4px;
  }
  .stock-card.readymade-stock-card {
    padding: 16px 14px;
  }
  .readymade-top-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .readymade-top-grid > :nth-child(3) {
    grid-column: 1;
  }
  .readymade-radio-row {
    height: auto;
    min-height: 40px;
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .readymade-specs-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .readymade-size-qty-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 6px 6px;
  }
  .readymade-size-qty-grid .size-tag-label {
    min-width: 26px;
    font-size: 11px;
  }
  .readymade-size-qty-grid .size-qty-input {
    width: 44px;
    flex: 1 1 40px;
    min-width: 0;
    max-width: 52px;
    height: 28px;
    font-size: 12.5px;
  }
  .readymade-actions-row {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }
  .readymade-actions-row .btn-stock-save,
  .readymade-actions-row .btn-stock-update,
  .readymade-actions-row .btn-stock-cancel {
    width: 100% !important;
    max-width: 100% !important;
    height: 46px !important;
    flex: 0 0 46px !important;
  }
}

/* Extra small mobile adjustments (<= 420px) */
@media (max-width: 420px) {
  .readymade-size-qty-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}









