/* ==========================================================================
   LABOUR BILL MANAGEMENT & GENERATOR MODULE STYLES
   Pixel-Perfect replica of modern clean dashboard design
   ========================================================================== */

/* Main Page Container - Full Width Live Editor View */
.labour-page-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  max-height: calc(100vh - 54px);
  overflow: hidden;
  background: #f1f5f9;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
}



html.dark .labour-page-wrapper,
[data-theme="dark"] .labour-page-wrapper {
  background: #0c1017 !important;
  color: #F3F5F7 !important;
}

/* ==========================================================================
   Horizontal Top Control Panel: Ultra-Premium Glassmorphism Toolbar
   ========================================================================== */
.labour-control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px;
  min-height: 56px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02);
  z-index: 25;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

html.dark .labour-control-panel,
[data-theme="dark"] .labour-control-panel {
  background: rgba(15, 23, 42, 0.88) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}

/* LEFT: Brand, Title with Badges, Period Pickers */
.labour-cp-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}

.labour-cp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.labour-cp-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #059669;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.12);
  transition: transform 0.2s ease;
}

.labour-cp-icon:hover {
  transform: scale(1.05);
}

html.dark .labour-cp-icon,
[data-theme="dark"] .labour-cp-icon {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.22) 0%, rgba(5, 150, 105, 0.1) 100%) !important;
  border-color: rgba(52, 211, 153, 0.3) !important;
  color: #34d399 !important;
}

.labour-cp-title-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.labour-cp-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

html.dark .labour-cp-title,
[data-theme="dark"] .labour-cp-title {
  color: #F3F5F7 !important;
}

.labour-cp-badges {
  display: flex;
  align-items: center;
  gap: 5px;
}

.lb-studio-badge {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.22);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
  line-height: 1.3;
  letter-spacing: 0.1px;
}

html.dark .lb-studio-badge,
[data-theme="dark"] .lb-studio-badge {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

.lb-studio-chip {
  background: rgba(5, 150, 105, 0.08);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.22);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
  line-height: 1.3;
  letter-spacing: 0.1px;
}

html.dark .lb-studio-chip,
[data-theme="dark"] .lb-studio-chip {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

/* Compact Period Selector Box */
.labour-period-box {
  display: inline-flex;
  align-items: center;
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 4px;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: all 0.15s ease;
}

.labour-period-box:hover {
  border-color: #94a3b8;
  background: #ffffff;
}

html.dark .labour-period-box,
[data-theme="dark"] .labour-period-box {
  background: rgba(30, 41, 59, 0.7) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html.dark .labour-period-box:hover,
[data-theme="dark"] .labour-period-box:hover {
  background: rgba(30, 41, 59, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.labour-period-inputs {
  display: inline-flex;
  align-items: center;
}

.lb-ctrl-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lb-range-row {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

#lbCtrlRange[style*="display: none"] {
  display: none !important;
}

.labour-range-sep {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  padding: 0 2px;
  user-select: none;
  flex-shrink: 0;
}

.labour-glass-select,
.labour-glass-input {
  height: 30px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 4px;
  background: #ffffff;
  color: #334155;
  outline: none;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.labour-glass-select.period-mode-select {
  font-size: 11px;
}

.labour-glass-select.month-select {
  min-width: 125px;
}

.labour-glass-input.date-input {
  width: 130px;
}

.labour-glass-input.range-input {
  width: 108px !important;
  min-width: 100px !important;
  max-width: 115px !important;
  height: 28px !important;
  padding: 2px 4px !important;
  font-size: 11px !important;
  box-sizing: border-box !important;
}

.labour-glass-select.year-select {
  width: 78px;
}

.labour-glass-select:hover,
.labour-glass-input:hover {
  border-color: #059669;
  background: #f8fafc;
}

.labour-glass-select:focus,
.labour-glass-input:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
  background: #ffffff;
}

html.dark .labour-glass-select,
html.dark .labour-glass-input,
[data-theme="dark"] .labour-glass-select,
[data-theme="dark"] .labour-glass-input {
  background: #171f2e !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #e2e8f0 !important;
}

html.dark .labour-glass-select:hover,
html.dark .labour-glass-input:hover,
[data-theme="dark"] .labour-glass-select:hover,
[data-theme="dark"] .labour-glass-input:hover {
  border-color: #10b981 !important;
  background: #1e293b !important;
}

.labour-range-sep {
  font-size: 11px;
  color: #64748b;
  padding: 0 2px;
  font-weight: 500;
}

/* CENTER: Segmented Switch: Only Bill / All */
.labour-cp-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.labour-filter-segmented {
  display: inline-flex;
  align-items: center;
  background: rgba(241, 245, 249, 0.85);
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2.5px;
  gap: 2px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

html.dark .labour-filter-segmented,
[data-theme="dark"] .labour-filter-segmented {
  background: rgba(30, 41, 59, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.labour-seg-pill {
  background: transparent;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.labour-seg-pill:hover {
  color: #0f172a;
  transform: translateY(-0.5px);
}

html.dark .labour-seg-pill:hover,
[data-theme="dark"] .labour-seg-pill:hover {
  color: #ffffff;
}

.labour-seg-pill.active {
  background: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.35) !important;
}

.labour-seg-pill:active {
  transform: scale(0.96);
}

/* RIGHT: Icon Tools + Trio Action Buttons */
.labour-cp-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.labour-icon-tools-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.labour-popover-anchor {
  position: relative;
}

/* Sleek Icon Buttons */
.labour-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  user-select: none;
}

.labour-icon-btn:hover {
  background: #ffffff;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.labour-icon-btn:active {
  transform: scale(0.94);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

html.dark .labour-icon-btn,
[data-theme="dark"] .labour-icon-btn {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

html.dark .labour-icon-btn:hover,
[data-theme="dark"] .labour-icon-btn:hover {
  background: #27354a !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

/* Sync Button Animation */
.btn-sync-icon:hover i {
  animation: lbSyncHoverRotate 0.6s ease forwards;
}

@keyframes lbSyncHoverRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(180deg); }
}

/* Saved Records Badge Counter */
.labour-badge-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #059669;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  line-height: 1;
}

html.dark .labour-badge-counter,
[data-theme="dark"] .labour-badge-counter {
  border-color: #1e293b !important;
}

/* Columns Visibility Dropdown Popover */
.labour-dropdown-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  width: 290px;
  z-index: 100;
  padding: 12px;
  animation: lbPopFadeIn 0.15s ease-out;
}

@keyframes lbPopFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

html.dark .labour-dropdown-popover,
[data-theme="dark"] .labour-dropdown-popover {
  background: #171f2e !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.6) !important;
  color: #F3F5F7 !important;
}

.lb-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

html.dark .lb-popover-header,
[data-theme="dark"] .lb-popover-header {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
  color: #F3F5F7 !important;
}

.lb-popover-close {
  background: transparent;
  border: none;
  font-size: 16px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}

.lb-popover-close:hover {
  color: #ef4444;
}

/* Density / Font Size Pill */
.labour-density-control {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 4px;
  gap: 2px;
  height: 32px;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

html.dark .labour-density-control,
[data-theme="dark"] .labour-density-control {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.labour-size-btn {
  width: 22px;
  height: 24px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  transition: all 0.15s ease;
}

.labour-size-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.labour-size-btn:active {
  transform: scale(0.92);
}

html.dark .labour-size-btn:hover,
[data-theme="dark"] .labour-size-btn:hover {
  background: #27354a !important;
  color: #ffffff !important;
}

.labour-size-val {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  min-width: 26px;
  text-align: center;
}

html.dark .labour-size-val,
[data-theme="dark"] .labour-size-val {
  color: #e2e8f0 !important;
}

/* Vertical Toolbar Divider */
.labour-toolbar-divider {
  width: 1px;
  height: 24px;
  background: #e2e8f0;
  margin: 0 4px;
}

html.dark .labour-toolbar-divider,
[data-theme="dark"] .labour-toolbar-divider {
  background: rgba(255, 255, 255, 0.12);
}

/* Equal-Sized 3 Primary Action Buttons (Save, PDF, Print) */
.labour-action-buttons-trio {
  display: flex;
  align-items: center;
  gap: 6px;
}

.labour-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  min-width: 78px;
  padding: 0 13px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.labour-action-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.14);
}

.labour-action-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Save - Blue */
.labour-action-btn.btn-action-save {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: rgba(37, 99, 235, 0.3);
}

.labour-action-btn.btn-action-save:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

/* PDF - Rose / Red */
.labour-action-btn.btn-action-pdf {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #ffffff;
  border-color: rgba(225, 29, 72, 0.3);
}

.labour-action-btn.btn-action-pdf:hover {
  background: linear-gradient(135deg, #be123c 0%, #9f1239 100%);
}

/* Excel - Forest Green */
.labour-action-btn.btn-action-excel {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  border-color: rgba(22, 163, 74, 0.3);
}

.labour-action-btn.btn-action-excel:hover {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
}

/* Print - Emerald */
.labour-action-btn.btn-action-print {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border-color: rgba(5, 150, 105, 0.3);
}

.labour-action-btn.btn-action-print:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}

/* PDF Generation Background Progress Modal */
#lbPdfProgressBackdrop {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lbBackdropFadeIn 0.2s ease;
}

@keyframes lbBackdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lb-pdf-modal-card {
  background: #ffffff;
  border-radius: 4px;
  padding: 26px 32px;
  width: 380px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  text-align: center;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

html.dark .lb-pdf-modal-card,
[data-theme="dark"] .lb-pdf-modal-card {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #F3F5F7 !important;
}

.lb-pdf-modal-spinner {
  font-size: 34px;
  color: #e11d48;
  margin-bottom: 12px;
  animation: lbPdfPulse 1.2s infinite ease-in-out;
}

@keyframes lbPdfPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.85; }
}

.lb-pdf-modal-heading {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

html.dark .lb-pdf-modal-heading,
[data-theme="dark"] .lb-pdf-modal-heading {
  color: #f1f5f9 !important;
}

.lb-pdf-modal-sub {
  font-size: 12.5px;
  color: #64748b;
  margin-bottom: 16px;
}

html.dark .lb-pdf-modal-sub,
[data-theme="dark"] .lb-pdf-modal-sub {
  color: #94a3b8 !important;
}

.lb-pdf-progress-track {
  background: #e2e8f0;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  width: 100%;
}

html.dark .lb-pdf-progress-track,
[data-theme="dark"] .lb-pdf-progress-track {
  background: #334155 !important;
}

.lb-pdf-progress-fill {
  background: linear-gradient(90deg, #e11d48, #f43f5e);
  height: 100%;
  border-radius: 4px;
  transition: width 0.25s ease;
}

.lb-pdf-modal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  margin-top: 8px;
}

/* Full Width Table Workspace */
.labour-table-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 18px 10px 18px;
  box-sizing: border-box;
  background: transparent;
}

.labour-table-workspace .lb-editor-banner {
  margin-bottom: 10px;
  flex-shrink: 0;
}

.labour-table-workspace .lb-editor-table-wrap {
  flex: 1;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

html.dark .labour-table-workspace .lb-editor-table-wrap,
[data-theme="dark"] .labour-table-workspace .lb-editor-table-wrap {
  background: #131926 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4) !important;
}

.labour-table-workspace .lb-editor-bottom-bar {
  margin-top: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

html.dark .labour-table-workspace .lb-editor-bottom-bar,
[data-theme="dark"] .labour-table-workspace .lb-editor-bottom-bar {
  background: #131926 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Main Page Container - Fixed viewport, strictly non-scrollable */
.labour-dashboard-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  max-height: calc(100vh - 54px);
  overflow: hidden;
  background: #f4f6fa;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding: 18px 24px 16px 24px;
  box-sizing: border-box;
}

/* Top Header Bar */
.labour-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.labour-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.labour-header-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: #ecfdf5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.labour-header-icon-box i {
  color: #10b981;
  font-size: 22px;
}

.labour-header-titles {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.labour-header-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.3px;
  margin: 0;
  line-height: 1.2;
}

.labour-header-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  font-weight: 400;
}

/* Header Right: Date Range & Quick Filter Pills */
.labour-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Date Range Selector Container */
.labour-date-range-container {
  position: relative;
  display: inline-flex;
}

.labour-date-range-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  user-select: none;
}

.labour-date-range-selector:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.labour-date-range-selector i.calendar-icon {
  color: #64748b;
  font-size: 13px;
}

.labour-date-range-selector i.chevron-icon {
  color: #94a3b8;
  font-size: 10px;
  margin-left: 2px;
}

.labour-quick-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
}

.labour-quick-pill {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.labour-quick-pill:hover {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
}

.labour-quick-pill.active {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.25);
}

/* Header Labour Groups Button (Sleek side sheet trigger) */
.labour-btn-header-groups {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 4px 12px 4px 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  user-select: none;
}

.labour-btn-header-groups:hover {
  border-color: #a7f3d0;
  background: #f0fdf4;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(5, 150, 105, 0.15);
}

.labour-btn-header-groups:active {
  transform: translateY(0);
}

.lb-grp-btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
}

.labour-btn-header-groups:hover .lb-grp-btn-icon {
  background: #059669;
  color: #ffffff;
}

.lb-grp-btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.lb-grp-btn-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.lb-grp-btn-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: #059669;
}

/* Far-right Header "Generate Bill" CTA Button */
.labour-btn-header-generate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.labour-btn-header-generate:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.45);
}

.labour-btn-header-generate:active {
  transform: translateY(0);
}

.labour-btn-header-generate i {
  font-size: 13px;
  animation: lbSparkle 2.5s infinite;
}

@keyframes lbSparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.95; }
  50% { transform: scale(1.15) rotate(10deg); opacity: 1; }
}

/* Floating Date Selector Popover (Directly below date range button) */
.lb-date-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  z-index: 1200;
  width: 285px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.12), 0 8px 12px -6px rgba(0, 0, 0, 0.06);
  padding: 12px;
  animation: lbPopoverIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes lbPopoverIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.lb-date-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px 4px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 8px;
}

.lb-date-popover-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lb-date-popover-title i {
  color: #059669;
}

.lb-date-popover-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.lb-date-popover-close:hover {
  background: #f1f5f9;
  color: #334155;
}

.lb-date-popover-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lb-date-popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lb-date-popover-item:hover {
  background: #f1f5f9;
  color: #059669;
  font-weight: 600;
}

.lb-date-popover-item.active {
  background: #ecfdf5;
  color: #059669;
  font-weight: 700;
}

.lb-date-popover-day-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}

.lb-date-popover-day-input {
  width: 100%;
  height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: #0f172a;
  box-sizing: border-box;
}

.lb-date-popover-day-input:focus {
  border-color: #059669;
  outline: none;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}

.lb-date-popover-confirm {
  width: 100%;
  background: #059669;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lb-date-popover-confirm:hover {
  background: #047857;
}

/* Keyframe for soft smooth entrance */
@keyframes lbFadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   LABOUR GROUPS SLIDE-OVER SIDE SHEET (DRAWER) STYLES
   ========================================================================== */
.lb-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 2000;
  animation: lbFadeIn 0.25s ease forwards;
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lb-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50vw;
  min-width: 440px;
  max-width: 55vw;
  height: 100vh;
  background: #ffffff;
  z-index: 2005;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  animation: lbSlideInRight 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (max-width: 900px) {
  .lb-drawer-panel {
    width: 90vw;
    max-width: 100vw;
    min-width: 320px;
  }
}

@keyframes lbSlideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* Drawer Header */
.lb-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e8ecf4;
  background: #ffffff;
  flex-shrink: 0;
}

.lb-drawer-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lb-drawer-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.lb-drawer-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-drawer-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.2px;
}

.lb-drawer-count-chip {
  font-size: 11px;
  font-weight: 700;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 1px 8px;
  border-radius: 4px;
}

.lb-drawer-subtitle {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

.lb-drawer-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-drawer-btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #059669;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
}

.lb-drawer-btn-add:hover {
  background: #047857;
  transform: translateY(-1px);
}

.lb-drawer-btn-close {
  background: #f1f5f9;
  color: #64748b;
  border: none;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lb-drawer-btn-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Drawer Body */
.lb-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
}

/* Drawer Search Bar */
.lb-drawer-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.lb-drawer-search-bar i {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  font-size: 13px;
  pointer-events: none;
}

.lb-drawer-search-bar input {
  width: 100%;
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 12px 6px 36px;
  font-size: 12px;
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.labour-cp-icon.clickable:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

/* Empty State inside Drawer */
.lb-groups-empty-state {
  text-align: center;
  padding: 44px 20px;
  background: #ffffff;
  border: 1.5px dashed #cbd5e1;
  border-radius: 4px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lb-empty-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
}

.lb-empty-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.lb-empty-desc {
  font-size: 11.5px;
  color: #64748b;
  max-width: 320px;
  line-height: 1.5;
  margin: 0 0 16px 0;
}

.lb-btn-add-first-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #059669;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
  transition: all 0.15s ease;
}

.lb-btn-add-first-group:hover {
  background: #047857;
  transform: translateY(-1px);
}

/* Add / Edit Form Card */
.lb-group-form-card {
  background: #ffffff;
  border: 1px solid #a7f3d0;
  border-radius: 4px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: lbFadeInUp 0.25s ease;
}

.lb-group-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}

.lb-group-form-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lb-group-form-title i {
  color: #059669;
}

.lb-group-form-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lb-form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lb-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lb-field-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
}

.lb-field-label span.required {
  color: #ef4444;
}

.lb-field-label-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lb-field-hint {
  font-size: 10.5px;
  color: #94a3b8;
}

.lb-field-input,
.lb-field-select {
  width: 100%;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  color: #0f172a;
  background: #ffffff;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.lb-field-input:focus,
.lb-field-select:focus {
  border-color: #059669;
  outline: none;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.12);
}

/* Dynamic Member Row Editor in Form */
.lb-btn-add-member-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lb-btn-add-member-row:hover {
  background: #059669;
  color: #ffffff;
}

.lb-members-editor-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding: 2px;
}

.lb-member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 5px 8px;
  transition: all 0.15s ease;
}

.lb-member-row:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.lb-member-col {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.lb-member-col .lb-col-icon {
  position: absolute;
  left: 9px;
  font-size: 11px;
  color: #94a3b8;
  pointer-events: none;
}

.lb-member-col input {
  width: 100%;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 4px 8px 4px 26px;
  font-size: 11.5px;
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.lb-member-col input:focus {
  border-color: #059669;
  outline: none;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.12);
}

.lb-btn-remove-member {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.lb-btn-remove-member:hover {
  background: #fee2e2;
  color: #ef4444;
}

.lb-group-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}

.lb-btn-cancel {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
}

.lb-btn-cancel:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.lb-btn-save-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #059669;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lb-btn-save-group:hover {
  background: #047857;
}

/* Groups List Cards */
.lb-groups-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lb-group-card {
  background: #ffffff;
  border: 1px solid #e8ecf4;
  border-radius: 4px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  animation: lbFadeInUp 0.3s ease both;
}

.lb-group-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.lb-group-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lb-group-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lb-group-avatar {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.lb-group-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

.lb-group-plant-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
  margin-left: 6px;
}

.lb-group-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lb-group-btn-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lb-group-btn-edit:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #93c5fd;
}

.lb-group-btn-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lb-group-btn-del:hover {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fecaca;
}

/* Minimal Badges for Type & Status */
.lb-group-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.lb-group-type-badge.type-bill {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.lb-group-type-badge.type-salary {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}

.lb-group-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 6px;
}

.lb-group-status-badge.status-active {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.lb-group-status-badge.status-inactive {
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

/* Members Roster in Group Card */
.lb-group-members-box {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 4px;
  padding: 8px 10px;
}

.lb-group-members-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lb-members-roster-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px;
}

.lb-member-roster-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  gap: 6px;
}

.lb-roster-name {
  font-weight: 600;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-roster-name i {
  color: #94a3b8;
  font-size: 10px;
}

.lb-roster-phone {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #059669;
  text-decoration: none;
  font-weight: 500;
  font-size: 10.5px;
  white-space: nowrap;
}

.lb-roster-phone:hover {
  text-decoration: underline;
}

.lb-roster-phone i {
  font-size: 9.5px;
}

.lb-roster-no-phone {
  color: #94a3b8;
  font-size: 10px;
  font-style: italic;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.lb-roster-empty {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
  padding: 4px 0;
}

.lb-group-remarks-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #64748b;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}

.lb-group-remarks-row i {
  color: #94a3b8;
}

/* ==========================================================================
   MAIN WORKSPACE: FULL-WIDTH SUMMARY TABLE CARD
   ========================================================================== */
.labour-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.labour-main-grid.full-width {
  grid-template-columns: 1fr;
}

/* Full Width Summary Card */
.labour-summary-card {
  background: #ffffff;
  border: 1px solid #e8ecf4;
  border-radius: 4px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  animation: lbFadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.labour-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.labour-summary-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.labour-summary-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.labour-summary-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.2px;
}

.labour-summary-period-tag {
  font-size: 13px;
  font-weight: 400;
  color: #64748b;
}

.labour-summary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.labour-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.labour-btn-outline:hover {
  background: #f8fafc;
  color: #1e293b;
  border-color: #94a3b8;
}

.labour-btn-outline i {
  font-size: 12px;
  color: #64748b;
}

/* Summary Table Area - Only Rows Scrollable */
.labour-summary-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 4px;
  border: 1px solid #f1f5f9;
  position: relative;
}

.labour-summary-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  color: #1e293b;
  table-layout: auto;
}

.labour-summary-table thead tr {
  background: #f8fafc;
}

.labour-summary-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8fafc;
  padding: 12px 14px;
  font-weight: 700;
  color: #475569;
  font-size: 12px;
  white-space: nowrap;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 0 #e2e8f0;
}

.labour-summary-table th.th-left { text-align: left; }
.labour-summary-table th.th-center { text-align: center; }
.labour-summary-table th.th-right { text-align: right; }

.labour-summary-table tbody tr {
  transition: all 0.2s ease;
  height: 48px;
}

.labour-summary-table tbody tr:hover {
  background-color: #f8fafc;
}

.labour-summary-table tbody tr.lb-row-anim {
  animation: lbRowFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes lbRowFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.labour-summary-table td {
  padding: 11px 16px;
  vertical-align: middle;
  font-size: 12px;
  white-space: nowrap;
  border-bottom: 1px solid #f1f5f9;
}

.labour-summary-table td.td-date {
  font-weight: 600;
  color: #0f172a;
}

.labour-summary-table td.td-center {
  text-align: center;
  color: #475569;
}

.labour-summary-table td.td-cost {
  text-align: center;
  color: #059669;
  font-weight: 700;
  font-size: 12.5px;
}

/* Status Badge */
.lb-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.lb-status-badge.verified {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.lb-status-badge.verified::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.lb-dispatch-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  color: #334155;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
}

/* Premium Action View Button inside Table Row */
.labour-action-btn-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.labour-btn-action-view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.labour-btn-action-view:hover {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(5, 150, 105, 0.25);
}

.labour-btn-action-view i {
  font-size: 12px;
  transition: transform 0.15s ease;
}

.labour-btn-action-view:hover i {
  transform: scale(1.15);
}

/* Table Footer Summary Row - Sticky at bottom of table container */
.labour-summary-table tfoot tr {
  background: #ffffff;
  height: 48px;
}

.labour-summary-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: #ffffff;
  border-top: 2px solid #e2e8f0;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.02);
}

/* ==========================================================================
   RIGHT COLUMN: GENERATE LABOR BILL PANEL
   ========================================================================== */
.labour-generator-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 20px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
}

.labour-generator-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.labour-generator-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.labour-generator-desc {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Form Groups in Generator */
.labour-generator-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.labour-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.labour-form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
}

.labour-select-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.labour-select-icon-wrap i.prefix-icon {
  position: absolute;
  left: 11px;
  color: #64748b;
  font-size: 13px;
  pointer-events: none;
}

.labour-form-select {
  width: 100%;
  height: 38px;
  padding: 6px 30px 6px 34px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #1e293b;
  background: #ffffff url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center/12px;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.15s ease;
}

.labour-form-select:focus {
  border-color: #059669;
  outline: none;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}

/* Primary CTA Generate Preview Button */
.labour-btn-generate {
  width: 100%;
  height: 42px;
  margin-top: 10px;
  border: none;
  border-radius: 4px;
  background: #059669;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.25);
  transition: all 0.15s ease;
}

.labour-btn-generate:hover {
  background: #047857;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
}

.labour-btn-generate:active {
  transform: translateY(0);
}

/* Blue Info Callout Notice */
.labour-info-banner {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 4px;
  padding: 12px 14px;
  margin-top: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.labour-info-banner i {
  color: #2563eb;
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}

.labour-info-banner span {
  font-size: 11.5px;
  color: #1e40af;
  line-height: 1.45;
}

/* Bottom Quick Actions List */
.labour-quick-actions-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.labour-quick-action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
  user-select: none;
}

.labour-quick-action-item:hover {
  background: #f8fafc;
}

.labour-quick-action-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.labour-quick-action-text {
  display: flex;
  flex-direction: column;
}

.labour-quick-action-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
}

.labour-quick-action-sub {
  font-size: 11px;
  color: #64748b;
}

/* ==========================================================================
   MODAL WINDOWS & A4 PRINT VOUCHER ENGINE (PRESERVED)
   ========================================================================== */
.labour-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.labour-modal-overlay.hidden {
  display: none !important;
}

.labour-modal-card {
  background: #ffffff;
  border-radius: 4px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.labour-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.labour-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.labour-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.labour-modal-footer {
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.labour-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  height: 32px;
  border: 1px solid transparent;
}

.labour-btn-primary {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}

.labour-btn-primary:hover {
  background: #047857;
}

.labour-btn-secondary {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}

.labour-btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.labour-btn-accent {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.labour-btn-accent:hover {
  background: #1d4ed8;
}

/* Printable Bill Voucher */
.labour-voucher {
  background: #ffffff;
  color: #000000;
  padding: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-family: 'Hind Siliguri', 'Inter', -apple-system, sans-serif;
}

.labour-voucher-header {
  text-align: center;
  border-bottom: 2px solid #000000;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.voucher-company-name {
  font-size: 20px;
  font-weight: 800;
  color: #059669;
  letter-spacing: 0.5px;
}

.voucher-company-sub {
  font-size: 11px;
  color: #555555;
  margin-top: 3px;
}

.voucher-doc-title {
  display: inline-block;
  background: #000000;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 18px;
  border-radius: 4px;
  margin-top: 8px;
  text-transform: uppercase;
}

.voucher-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 12px;
}

.voucher-meta-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 10px 14px;
  border-radius: 4px;
}

.voucher-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  margin-bottom: 20px;
}

.voucher-table th, .voucher-table td {
  border: 1px solid #000000;
  padding: 6px 8px;
}

.voucher-table th {
  background: #f1f5f9;
  font-weight: 700;
  text-align: center;
}

.voucher-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 10px;
}

.voucher-sig-col {
  text-align: center;
  width: 140px;
  border-top: 1px dashed #555555;
  font-size: 11px;
  font-weight: 600;
  color: #333333;
  padding-top: 4px;
}

.editable-cell {
  outline: none;
  border-radius: 2px;
  padding: 2px 4px;
  transition: all 0.15s ease;
}

.editable-cell:hover {
  background: rgba(254, 240, 138, 0.3);
}

.editable-cell:focus {
  background: #fef08a;
  box-shadow: 0 0 0 2px #eab308;
}



/* Responsive adjustments */
@media (max-width: 1200px) {
  .labour-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .labour-main-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   LOADING BILL REPORT MODAL — FULLSCREEN LIVE STUDIO & DELIVERY SCHEDULE VIEW
   ============================================================================ */

.lb-fullscreen-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  background: #0b1120 !important;
  z-index: 99999 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

.lb-fullscreen-overlay.hidden {
  display: none !important;
}

.lb-studio-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  color: #0f172a;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  transition: background-color 0.2s ease, color 0.2s ease;
}

html.dark .lb-studio-container,
[data-theme="dark"] .lb-studio-container {
  background: #0f172a;
  color: #f8fafc;
}

/* Modal Top Header Bar */
.lb-studio-topbar {
  height: 52px;
  min-height: 52px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 20;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

html.dark .lb-studio-topbar,
[data-theme="dark"] .lb-studio-topbar {
  background: #0b1120;
  border-bottom: 1px solid #1e293b;
}

.lb-studio-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Topbar Back Button */
.lb-topbar-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.lb-topbar-back-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

html.dark .lb-topbar-back-btn,
[data-theme="dark"] .lb-topbar-back-btn {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

html.dark .lb-topbar-back-btn:hover,
[data-theme="dark"] .lb-topbar-back-btn:hover {
  background: #334155;
  color: #ffffff;
  border-color: #475569;
}

.lb-studio-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

html.dark .lb-studio-icon,
[data-theme="dark"] .lb-studio-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.lb-studio-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-studio-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
}

html.dark .lb-studio-title,
[data-theme="dark"] .lb-studio-title {
  color: #f8fafc;
}

.lb-studio-badge {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

html.dark .lb-studio-badge,
[data-theme="dark"] .lb-studio-badge {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.lb-studio-chip {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

html.dark .lb-studio-chip,
[data-theme="dark"] .lb-studio-chip {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.lb-studio-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

html.dark .lb-studio-sub,
[data-theme="dark"] .lb-studio-sub {
  color: #94a3b8;
}

.lb-studio-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-studio-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lb-studio-btn-print {
  background: #059669;
  color: #ffffff;
}
.lb-studio-btn-print:hover { background: #047857; }

.lb-studio-btn-pdf {
  background: #b91c1c;
  color: #ffffff;
}
.lb-studio-btn-pdf:hover { background: #991b1b; }

.lb-studio-btn-save {
  background: #2563eb;
  color: #ffffff;
}
.lb-studio-btn-save:hover { background: #1d4ed8; }

.lb-studio-btn-close {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.lb-studio-btn-close:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

html.dark .lb-studio-btn-close,
[data-theme="dark"] .lb-studio-btn-close {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
}

html.dark .lb-studio-btn-close:hover,
[data-theme="dark"] .lb-studio-btn-close:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Studio Workspace Layout */
.lb-studio-workspace {
  flex: 1;
  display: flex;
  flex-direction: row;
  height: calc(100vh - 52px);
  overflow: hidden;
}

/* Left Sidebar Controls */
.lb-studio-sidebar {
  width: 320px;
  min-width: 320px;
  max-width: 330px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

html.dark .lb-studio-sidebar,
[data-theme="dark"] .lb-studio-sidebar {
  background: #111827;
  border-right: 1px solid #1f2937;
}

.lb-side-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 12px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

html.dark .lb-side-section,
[data-theme="dark"] .lb-side-section {
  background: #1f2937;
  border: 1px solid #374151;
}

.lb-side-section-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

html.dark .lb-side-section-title,
[data-theme="dark"] .lb-side-section-title {
  color: #9ca3af;
}

.lb-side-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lb-side-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.lb-side-btn-add {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}
.lb-side-btn-add:hover {
  background: #059669;
  color: #fff;
}

html.dark .lb-side-btn-add,
[data-theme="dark"] .lb-side-btn-add {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}
html.dark .lb-side-btn-add:hover,
[data-theme="dark"] .lb-side-btn-add:hover {
  background: #059669;
  color: #fff;
}

.lb-side-btn-remove {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
.lb-side-btn-remove:hover {
  background: #dc2626;
  color: #fff;
}

html.dark .lb-side-btn-remove,
[data-theme="dark"] .lb-side-btn-remove {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}
html.dark .lb-side-btn-remove:hover,
[data-theme="dark"] .lb-side-btn-remove:hover {
  background: #dc2626;
  color: #fff;
}

.lb-period-select-wrap {
  display: flex;
  flex-direction: column;
}

.lb-ctrl-group {
  margin-top: 6px;
}

.lb-ctrl-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

html.dark .lb-ctrl-label,
[data-theme="dark"] .lb-ctrl-label {
  color: #9ca3af;
}

.lb-select, .lb-input {
  width: 100%;
  height: 34px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #0f172a;
  padding: 0 10px;
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.lb-select:focus, .lb-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

html.dark .lb-select,
html.dark .lb-input,
[data-theme="dark"] .lb-select,
[data-theme="dark"] .lb-input {
  background: #111827;
  border: 1px solid #374151;
  color: #f3f4f6;
}

html.dark .lb-select:focus,
html.dark .lb-input:focus,
[data-theme="dark"] .lb-select:focus,
[data-theme="dark"] .lb-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.lb-filter-switch-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.lb-radio-card.active, .lb-radio-card:hover {
  border-color: #10b981;
  background: #f0fdf4;
}

html.dark .lb-radio-card,
[data-theme="dark"] .lb-radio-card {
  background: #111827;
  border: 1px solid #374151;
}

html.dark .lb-radio-card.active,
html.dark .lb-radio-card:hover,
[data-theme="dark"] .lb-radio-card.active,
[data-theme="dark"] .lb-radio-card:hover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.lb-radio-card input {
  accent-color: #10b981;
  margin-top: 3px;
  cursor: pointer;
}

.lb-radio-content {
  display: flex;
  flex-direction: column;
}

.lb-radio-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
}

html.dark .lb-radio-title,
[data-theme="dark"] .lb-radio-title {
  color: #f3f4f6;
}

.lb-radio-desc {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}

html.dark .lb-radio-desc,
[data-theme="dark"] .lb-radio-desc {
  color: #9ca3af;
}

.lb-col-toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 4px;
}

.lb-col-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

html.dark .lb-col-check-item,
[data-theme="dark"] .lb-col-check-item {
  color: #d1d5db;
}

.lb-col-check-item input {
  accent-color: #2563eb;
  cursor: pointer;
}

.lb-text-size-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 12px;
}

html.dark .lb-text-size-control,
[data-theme="dark"] .lb-text-size-control {
  background: #111827;
  border: 1px solid #374151;
}

.lb-size-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.15s;
}

.lb-size-btn:hover { background: #e2e8f0; color: #0f172a; }

html.dark .lb-size-btn,
[data-theme="dark"] .lb-size-btn {
  background: #1f2937;
  border: 1px solid #374151;
  color: #e5e7eb;
}
html.dark .lb-size-btn:hover,
[data-theme="dark"] .lb-size-btn:hover { background: #374151; }

.lb-size-val {
  font-size: 12px;
  font-weight: 700;
  color: #0284c7;
  min-width: 40px;
  text-align: center;
}

html.dark .lb-size-val,
[data-theme="dark"] .lb-size-val {
  color: #38bdf8;
}

/* Right Studio Main Workspace */
.lb-studio-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  overflow: hidden;
  min-width: 0;
  position: relative;
}

html.dark .lb-studio-main,
[data-theme="dark"] .lb-studio-main {
  background: #0f172a;
}

/* Company Banner & Stats Header */
.lb-editor-banner {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 16px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

html.dark .lb-editor-banner,
[data-theme="dark"] .lb-editor-banner {
  background: #111827;
  border-bottom: 1px solid #1f2937;
}

.lb-banner-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lb-banner-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) saturate(100%);
}

html.dark .lb-banner-logo,
[data-theme="dark"] .lb-banner-logo {
  filter: brightness(0) invert(1);
}

.lb-banner-company {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

html.dark .lb-banner-company,
[data-theme="dark"] .lb-banner-company {
  color: #f8fafc;
}

.lb-banner-addr {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

html.dark .lb-banner-addr,
[data-theme="dark"] .lb-banner-addr {
  color: #94a3b8;
}

.lb-banner-duration {
  font-size: 11.5px;
  font-weight: 700;
  color: #047857;
  margin-top: 2px;
}

html.dark .lb-banner-duration,
[data-theme="dark"] .lb-banner-duration {
  color: #10b981;
}

.lb-banner-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lb-stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 5px 12px;
  text-align: right;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

html.dark .lb-stat-box,
[data-theme="dark"] .lb-stat-box {
  background: #1f2937;
  border: 1px solid #374151;
}

.lb-stat-label {
  display: block;
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
}

html.dark .lb-stat-label,
[data-theme="dark"] .lb-stat-label {
  color: #9ca3af;
}

.lb-stat-num {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
}

html.dark .lb-stat-num,
[data-theme="dark"] .lb-stat-num {
  color: #f8fafc;
}

.lb-stat-num.green {
  color: #059669;
}

html.dark .lb-stat-num.green,
[data-theme="dark"] .lb-stat-num.green {
  color: #10b981;
}

/* Animated Floating Action Bar when Rows are Marked */
/* Soft Light Gradient Floating Action Bar when Rows are Marked */
.lb-marked-row-bar {
  position: absolute;
  top: 68px;
  left: 20px;
  right: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 50%, #e0f2fe 100%);
  color: #1e293b;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.15), 0 4px 12px rgba(14, 165, 233, 0.1);
  z-index: 50;
  transform: translateY(-90px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

html.dark .lb-marked-row-bar,
[data-theme="dark"] .lb-marked-row-bar {
  background: linear-gradient(135deg, #1e293b 0%, #064e3b 50%, #0c4a6e 100%);
  border-color: #059669;
  color: #f8fafc;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
}

.lb-marked-row-bar.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.lb-marked-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #065f46;
}

html.dark .lb-marked-bar-left,
[data-theme="dark"] .lb-marked-bar-left {
  color: #34d399;
}

.lb-marked-count-badge {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
  padding: 3px 12px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

html.dark .lb-marked-count-badge,
[data-theme="dark"] .lb-marked-count-badge {
  background: rgba(16, 185, 129, 0.25);
  border-color: #059669;
  color: #a7f3d0;
}

.lb-marked-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-marked-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.lb-marked-btn-add {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.3);
}
.lb-marked-btn-add:hover { background: #047857; }

.lb-marked-btn-del {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}
.lb-marked-btn-del:hover { background: #dc2626; }

.lb-marked-btn-clear {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}
.lb-marked-btn-clear:hover { background: #e2e8f0; color: #0f172a; }

html.dark .lb-marked-btn-clear,
[data-theme="dark"] .lb-marked-btn-clear {
  background: #334155;
  border-color: #475569;
  color: #cbd5e1;
}
html.dark .lb-marked-btn-clear:hover,
[data-theme="dark"] .lb-marked-btn-clear:hover {
  background: #475569;
  color: #ffffff;
}

/* Table Wrapper and Capsule Scrollbars */
.lb-editor-table-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  background: #f8fafc;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
}

html.dark .lb-editor-table-wrap,
[data-theme="dark"] .lb-editor-table-wrap {
  background: #0f172a;
  scrollbar-color: rgba(100, 116, 139, 0.5) transparent;
}

/* Capsule (Pill) Scrollbars for both Vertical & Horizontal */
.lb-editor-table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.lb-editor-table-wrap::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
  margin: 4px;
}

.lb-editor-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.2s ease;
}

.lb-editor-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.75);
}

.lb-editor-table-wrap::-webkit-scrollbar-corner {
  background: transparent;
}

html.dark .lb-editor-table-wrap::-webkit-scrollbar-thumb,
[data-theme="dark"] .lb-editor-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.45);
}

html.dark .lb-editor-table-wrap::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .lb-editor-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.75);
}

/* Loading & Blur Overlay for heavy queries */
.lb-table-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(248, 250, 252, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

html.dark .lb-table-loading-overlay,
[data-theme="dark"] .lb-table-loading-overlay {
  background: rgba(15, 23, 42, 0.8);
}

.lb-table-loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lb-loading-spinner-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 24px 32px;
  border-radius: 4px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

html.dark .lb-loading-spinner-box,
[data-theme="dark"] .lb-loading-spinner-box {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.lb-spinner {
  width: 36px;
  height: 36px;
  border: 3.5px solid rgba(16, 185, 129, 0.2);
  border-top-color: #10b981;
  border-radius: 50%;
  animation: lbSpin 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes lbSpin {
  to { transform: rotate(360deg); }
}

.lb-loading-text {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}
html.dark .lb-loading-text,
[data-theme="dark"] .lb-loading-text {
  color: #f8fafc;
}

.lb-loading-sub {
  font-size: 11px;
  color: #64748b;
}
html.dark .lb-loading-sub,
[data-theme="dark"] .lb-loading-sub {
  color: #94a3b8;
}

/* Interactive Data Table */
.lb-editor-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  background: #ffffff;
  color: #0f172a;
  table-layout: fixed;
}

html.dark .lb-editor-table,
[data-theme="dark"] .lb-editor-table {
  background: #111827;
  color: #f8fafc;
}

.lb-editor-table thead th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 700;
  font-size: 11.5px;
  padding: 8px 8px;
  border-bottom: 1px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
  user-select: none;
  z-index: 5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

html.dark .lb-editor-table thead th,
[data-theme="dark"] .lb-editor-table thead th {
  background: #1e293b;
  color: #e2e8f0;
  border-bottom: 1px solid #334155;
  border-right: 1px solid #334155;
}

.lb-col-resizer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  user-select: none;
}
.lb-col-resizer:hover {
  background: #3b82f6;
}

.lb-editor-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.12s ease;
}

html.dark .lb-editor-table tbody tr,
[data-theme="dark"] .lb-editor-table tbody tr {
  border-bottom: 1px solid #1f2937;
}

.lb-editor-table tbody tr:hover {
  background: #f1f5f9;
}

html.dark .lb-editor-table tbody tr:hover,
[data-theme="dark"] .lb-editor-table tbody tr:hover {
  background: #1e293b;
}

.lb-editor-table tbody tr.row-checked {
  background: rgba(59, 130, 246, 0.08);
}

html.dark .lb-editor-table tbody tr.row-checked,
[data-theme="dark"] .lb-editor-table tbody tr.row-checked {
  background: rgba(59, 130, 246, 0.18);
}

.lb-editor-table tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #ffffff;
}

html.dark .lb-editor-table tbody td,
[data-theme="dark"] .lb-editor-table tbody td {
  background: #111827;
  color: #f8fafc;
  border-bottom: 1px solid #1f2937;
  border-right: 1px solid #1f2937;
}

.lb-editor-table tbody tr:hover td {
  background: #f1f5f9;
}
html.dark .lb-editor-table tbody tr:hover td,
[data-theme="dark"] .lb-editor-table tbody tr:hover td {
  background: #1e293b;
}

.lb-editor-table tbody tr.row-checked td {
  background: #eff6ff;
}
html.dark .lb-editor-table tbody tr.row-checked td,
[data-theme="dark"] .lb-editor-table tbody tr.row-checked td {
  background: rgba(59, 130, 246, 0.18);
}

/* Slim 1px focus and selection border */
.lb-editor-table tbody td[contenteditable="true"] {
  outline: none !important;
  border-radius: 2px;
  transition: all 0.1s ease;
}

.lb-editor-table tbody td[contenteditable="true"]:hover {
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #cbd5e1;
}

.lb-editor-table tbody td[contenteditable="true"]:focus,
.lb-editor-table tbody td[contenteditable="true"]:focus-visible,
.lb-editor-table tbody td:focus,
.lb-editor-table tbody td:focus-visible {
  background: #ffffff !important;
  box-shadow: inset 0 0 0 1px #3b82f6 !important;
  outline: none !important;
  border: none !important;
}

html.dark .lb-editor-table tbody td[contenteditable="true"]:hover,
[data-theme="dark"] .lb-editor-table tbody td[contenteditable="true"]:hover {
  background: #1e293b;
  box-shadow: inset 0 0 0 1px #475569;
}

html.dark .lb-editor-table tbody td[contenteditable="true"]:focus,
html.dark .lb-editor-table tbody td[contenteditable="true"]:focus-visible,
html.dark .lb-editor-table tbody td:focus,
html.dark .lb-editor-table tbody td:focus-visible,
[data-theme="dark"] .lb-editor-table tbody td[contenteditable="true"]:focus,
[data-theme="dark"] .lb-editor-table tbody td[contenteditable="true"]:focus-visible,
[data-theme="dark"] .lb-editor-table tbody td:focus,
[data-theme="dark"] .lb-editor-table tbody td:focus-visible {
  background: #0f172a !important;
  box-shadow: inset 0 0 0 1px #60a5fa !important;
  outline: none !important;
  border: none !important;
}

.lb-editor-table ::selection {
  background: rgba(59, 130, 246, 0.22);
  color: inherit;
}

.lb-editor-table .lb-row-unmatched td {
  background: #fee2e2 !important;
  color: #991b1b !important;
  font-weight: 600;
}

html.dark .lb-editor-table .lb-row-unmatched td,
[data-theme="dark"] .lb-editor-table .lb-row-unmatched td {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #fca5a5 !important;
}

.lb-editor-table tfoot td {
  position: sticky;
  bottom: 0;
  background: #e2f0d9;
  color: #1e4620;
  font-weight: 800;
  padding: 8px 10px;
  border-top: 1px solid #70ad47;
  z-index: 5;
}

html.dark .lb-editor-table tfoot td,
[data-theme="dark"] .lb-editor-table tfoot td {
  background: #143522;
  color: #86efac;
  border-top: 1px solid #166534;
}

/* Bottom Bar */
.lb-editor-footer-bar {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

html.dark .lb-editor-footer-bar,
[data-theme="dark"] .lb-editor-footer-bar {
  background: #111827;
  border-top: 1px solid #1f2937;
}

.lb-footer-words {
  font-size: 12px;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 4px 12px;
  border-radius: 4px;
}

html.dark .lb-footer-words,
[data-theme="dark"] .lb-footer-words {
  color: #f8fafc;
  background: #1f2937;
  border-color: #374151;
}

.lb-meta-hint {
  font-size: 11px;
  color: #64748b;
}

html.dark .lb-meta-hint,
[data-theme="dark"] .lb-meta-hint {
  color: #94a3b8;
}

/* Simple Light-Gray Minimalist Product Autocomplete Dropdown */
.lb-prod-autocomplete {
  position: fixed;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 99999;
  min-width: 250px;
  max-width: 380px;
  font-family: inherit;
  box-sizing: border-box;
  animation: lbPopIn 0.12s ease-out;
  scrollbar-width: thin;
}

@keyframes lbPopIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

html.dark .lb-prod-autocomplete,
[data-theme="dark"] .lb-prod-autocomplete {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.lb-prod-autocomplete.hidden {
  display: none !important;
}

.lb-prod-item {
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  font-size: 11.5px;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.1s ease;
  user-select: none;
}

html.dark .lb-prod-item,
[data-theme="dark"] .lb-prod-item {
  border-bottom-color: #293548;
  color: #e2e8f0;
}

.lb-prod-item:last-child {
  border-bottom: none;
}

.lb-prod-item:hover,
.lb-prod-item.active {
  background: #e2e8f0;
  color: #0f172a;
}

html.dark .lb-prod-item:hover,
html.dark .lb-prod-item.active,
[data-theme="dark"] .lb-prod-item:hover,
[data-theme="dark"] .lb-prod-item.active {
  background: #334155;
  color: #ffffff;
}

.lb-prod-empty {
  padding: 10px 12px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
}

/* Subtle keyword match highlight */
.lb-prod-highlight {
  font-weight: 700;
  color: #0f172a;
  text-decoration: underline;
}

html.dark .lb-prod-highlight,
[data-theme="dark"] .lb-prod-highlight {
  color: #ffffff;
}

/* ---- A4 LANDSCAPE PAGE (Horizontal 297mm x 210mm) ---- */
.lb-page {
  width: 297mm;
  min-height: 205mm;
  max-width: 297mm;
  background: #ffffff;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  padding: 8mm 12mm 7mm 12mm;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 8pt;
  color: #111111;
}

.lb-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 7px;
  margin-bottom: 8px;
  gap: 16px;
}

/* Left: Brand Logo + Company Details + Duration */
.lb-header-left-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lb-header-logo-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-logo {
  height: 46px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  display: block;
  margin: 0;
  filter: brightness(0) saturate(100%);
  -webkit-filter: brightness(0) saturate(100%);
}

.lb-header-company-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.lb-company-name {
  font-size: 13.5pt;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #0f172a;
  line-height: 1.2;
  text-transform: uppercase;
  margin: 0;
}

.lb-company-address {
  font-size: 8pt;
  color: #475569;
  margin-top: 2px;
  line-height: 1.25;
}

.lb-bill-duration {
  font-size: 8.5pt;
  color: #0f172a;
  margin-top: 3px;
  font-weight: 700;
  line-height: 1.25;
}

/* Right: LOADING BILL Title + Reference Number */
.lb-header-right-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  flex-shrink: 0;
}

.lb-doc-title {
  display: inline-block;
  font-size: 12.5pt;
  font-weight: 800;
  color: #0f172a;
  border: 2px solid #0f172a;
  padding: 3px 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: #f8fafc;
  line-height: 1.2;
  border-radius: 4px;
}

.lb-doc-ref {
  font-size: 8pt;
  color: #334155;
  margin-top: 4px;
  font-weight: 600;
}

.lb-doc-ref strong {
  color: #0f172a;
  font-weight: 800;
}

.lb-doc-sub {
  font-size: 7pt;
  color: #64748b;
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Page Body with Compact Table */
.lb-page-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

/* Table Architecture - compact height without stretching */
.lb-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 8.5pt;
  flex: none !important;
  height: auto !important;
  margin-bottom: 0 !important;
}

/* Soft ink-saving header with 1px larger font */
.lb-th {
  background: #f1f5f9;
  color: #0f172a;
  padding: 6px 5px;
  border: 1px solid #94a3b8;
  font-weight: 700;
  font-size: 8.2pt;
  text-align: center;
  vertical-align: middle;
  line-height: 1.25;
  word-break: break-word;
}

.lb-td {
  border: 1px solid #cbd5e1;
  padding: 4px 6px;
  vertical-align: middle;
  outline: none;
  min-height: 20px;
  line-height: 1.25;
  color: #1e293b;
  font-size: 8.5pt;
}

.lb-td:focus { background: #fef9c3; box-shadow: inset 0 0 0 2px #eab308; }
.lb-td[contenteditable]:hover { background: rgba(254,243,199,0.4); }

.lb-row:nth-child(even) .lb-td { background: #f8fafc; }
.lb-row:nth-child(even) .lb-td:focus { background: #fef9c3; }

/* Highlight unmatched / missing rate rows in soft red */
.lb-row.lb-row-unmatched .lb-td {
  background: #fee2e2 !important;
  color: #991b1b !important;
  font-weight: 600 !important;
}
.lb-row.lb-row-unmatched:hover .lb-td {
  background: #fecaca !important;
}

.lb-center { text-align: center; }
.lb-right  { text-align: right; }
.lb-bold   { font-weight: 700; }
.lb-nowrap { white-space: nowrap; }
.lb-sign   { height: 20px; }

/* Column Sizing in Preview (12 Columns) */
.col-sl       { width: 3%; }
.col-date     { width: 7.5%; }
.col-party    { width: 17.5%; white-space: normal; word-break: break-word; }
.col-prod     { width: 18%; white-space: normal; word-break: break-word; }
.col-challan  { width: 8%; white-space: normal; word-break: break-all; }
.col-veh      { width: 11%; white-space: nowrap !important; }
.col-qty      { width: 7%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.col-rate     { width: 6%; white-space: nowrap; }
.col-bill     { width: 7.5%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.col-group    { width: 5.5%; white-space: normal; }
.col-remarks  { width: 5%; white-space: normal; word-break: break-word; }
.col-sign     { width: 4%; }

.lb-subtotal-row .lb-td,
.lb-cumulative-row .lb-td,
.lb-grand-row td {
  font-size: 8.5pt;
  padding: 4px 6px;
  border: 1px solid #94a3b8;
  height: auto !important;
}

.lb-amount-words {
  margin-top: 6px;
  font-size: 8.5pt;
  border: 1.5px solid #0f172a;
  padding: 4px 10px;
  display: inline-block;
  border-radius: 4px;
  background: #f8fafc;
  color: #0f172a;
}

.lb-amount-words-label {
  font-weight: 700;
  margin-right: 6px;
}

/* Page Footer - Line above signatures removed, pinned to bottom with ample room */
.lb-page-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
  padding-top: 10px;
  margin-bottom: 2px;
  border-top: none !important;
  gap: 16px;
}

.lb-sig-block {
  flex: 1;
  text-align: center;
}

.lb-sig-line {
  border-bottom: 1px solid #0f172a;
  height: 32px;
  margin-bottom: 4px;
}

.lb-sig-name {
  font-size: 8pt;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.lb-page-no {
  text-align: right;
  font-size: 7pt;
  color: #64748b;
  margin-top: 3px;
}

/* ============================================================================
   PRINT MEDIA — A4 LANDSCAPE (INK-SAVING & ZERO BLANK PAGE)
   ============================================================================ */
@media print {
  @page labourBillLandscape {
    size: A4 landscape;
    margin: 0;
  }

  html:has(body.printing-labour-bill),
  body.printing-labour-bill {
    page: labourBillLandscape;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    width: 297mm !important;
    height: 210mm !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Solid black logo on print */
  .lb-logo {
    filter: brightness(0) saturate(100%) !important;
    -webkit-filter: brightness(0) saturate(100%) !important;
    height: 44px !important;
  }

  /* When printing Labour Bill: hide EVERYTHING else on body */
  body.printing-labour-bill > *:not(#labourPrintModal) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
  }

  /* Make modal container fill print canvas */
  body.printing-labour-bill #labourPrintModal {
    position: static !important;
    display: block !important;
    visibility: visible !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 297mm !important;
    height: auto !important;
    overflow: visible !important;
    z-index: auto !important;
  }

  #labourPrintModal .lb-report-toolbar {
    display: none !important;
  }

  #labourPrintModal .lb-report-modal-card {
    display: block !important;
    width: 297mm !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    background: transparent !important;
  }

  #labourPrintModal .lb-report-preview-area {
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    width: 297mm !important;
  }

  #labourPrintVoucherArea {
    display: block !important;
    position: static !important;
    visibility: visible !important;
    width: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  #labourPrintVoucherArea,
  #labourPrintVoucherArea * {
    visibility: visible !important;
  }

  /* Hide the 3 specific columns only on physical print */
  .lb-hide-print {
    display: none !important;
  }

  /* Page body keeps table compact at top without stretching */
  .lb-page-body {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
  }

  .lb-table {
    flex: none !important;
    height: auto !important;
    margin-bottom: 0 !important;
  }

  /* Proportional column widths for 9 columns during print */
  .col-sl       { width: 3.5% !important; text-align: center !important; }
  .col-date     { width: 8.5% !important; text-align: center !important; }
  .col-party    { width: 22% !important; }
  .col-prod     { width: 22% !important; }
  .col-challan  { width: 9% !important; text-align: center !important; }
  .col-veh      { width: 13% !important; text-align: center !important; white-space: nowrap !important; }
  .col-qty      { width: 7.5% !important; text-align: right !important; font-weight: 700 !important; }
  .col-rate     { width: 6.5% !important; text-align: right !important; }
  .col-bill     { width: 8% !important; text-align: right !important; font-weight: 700 !important; }

  /* Header row ink-saving with 1px larger font */
  .lb-th {
    background: #f1f5f9 !important;
    color: #000000 !important;
    border: 1px solid #475569 !important;
    font-size: 8pt !important;
    padding: 4px 5px !important;
    white-space: nowrap !important;
  }

  /* All cells compact 1-line with 1px larger font and wider padding */
  .lb-td {
    border: 1px solid #475569 !important;
    color: #000000 !important;
    font-size: 8.2pt !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding: 3.5px 5px !important;
    line-height: 1.25 !important;
  }

  /* Unmatched row on print */
  .lb-row-unmatched .lb-td {
    background: #fee2e2 !important;
    color: #991b1b !important;
    font-weight: 600 !important;
  }

  .lb-doc-title {
    background: transparent !important;
    border-color: #000000 !important;
    color: #000000 !important;
  }

  .lb-amount-words {
    background: #f8fafc !important;
    border: 1.5px solid #000000 !important;
    color: #000000 !important;
  }

  .lb-subtotal-row .lb-td,
  .lb-cumulative-row .lb-td,
  .lb-grand-row td {
    border: 1px solid #475569 !important;
    color: #000000 !important;
    padding: 3.5px 5px !important;
    font-size: 8.2pt !important;
    height: auto !important;
  }

  .lb-grand-row td {
    background: #eef5ea !important;
  }

  .lb-page-footer {
    border-top: none !important;
    margin-top: auto !important;
    padding-top: 10px !important;
    margin-bottom: 2px !important;
  }

  .lb-sig-line {
    border-bottom: 1px solid #000000 !important;
    height: 32px !important;
    margin-bottom: 4px !important;
  }

  .lb-sig-name {
    font-size: 8pt !important;
    font-weight: 700 !important;
  }

  .lb-page {
    width: 297mm !important;
    min-height: 205mm !important;
    max-height: 210mm !important;
    max-width: 297mm !important;
    padding: 6mm 10mm 5mm 10mm !important;
    box-shadow: none !important;
    margin: 0 !important;
    page-break-after: always !important;
    break-after: page !important;
    overflow: hidden !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    background: #ffffff !important;
  }

  .lb-page:last-child {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .lb-td[contenteditable]:focus,
  .lb-td[contenteditable]:hover {
    background: transparent !important;
    box-shadow: none !important;
  }
}

/* ==========================================================================
   SAVE RECORD DIALOG & SAVED BILLS ARCHIVE STYLING
   ========================================================================== */

/* Saved Record Card in Sidebar */
.lb-side-save-stat {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

html.dark .lb-side-save-stat,
[data-theme="dark"] .lb-side-save-stat {
  color: #94a3b8;
}

.lb-side-saved-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  color: #166534;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 6px;
}

.lb-side-saved-link:hover {
  background: #dcfce7;
  border-color: #86efac;
}

html.dark .lb-side-saved-link,
[data-theme="dark"] .lb-side-saved-link {
  background: rgba(16, 185, 129, 0.15);
  border-color: #059669;
  color: #a7f3d0;
}
html.dark .lb-side-saved-link:hover,
[data-theme="dark"] .lb-side-saved-link:hover {
  background: rgba(16, 185, 129, 0.25);
}

.lb-side-saved-badge {
  background: #10b981;
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
}

#lbSaveRecordModal,
#labourSavedBillsModal {
  z-index: 9999999 !important;
}

#lbSaveRecordModal.hidden,
#labourSavedBillsModal.hidden {
  display: none !important;
}

/* Save Record Dialog Modal Card */
.lb-save-dialog-card {
  width: 100%;
  max-width: 520px;
  position: relative;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  animation: lbSaveModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lbSaveModalPop {
  0% { transform: scale(0.94); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

html.dark .lb-save-dialog-card,
[data-theme="dark"] .lb-save-dialog-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.lb-save-dialog-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f0fdf4 100%);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

html.dark .lb-save-dialog-header,
[data-theme="dark"] .lb-save-dialog-header {
  background: linear-gradient(135deg, #1e293b 0%, #064e3b 100%);
  border-bottom-color: #334155;
}

.lb-save-dialog-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

html.dark .lb-save-dialog-title,
[data-theme="dark"] .lb-save-dialog-title {
  color: #f8fafc;
}

.lb-save-dialog-body {
  padding: 20px;
}

.lb-save-meta-card {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 16px;
}

html.dark .lb-save-meta-card,
[data-theme="dark"] .lb-save-meta-card {
  background: #0f172a;
  border-color: #334155;
}

.lb-save-meta-item {
  display: flex;
  flex-direction: column;
}

.lb-save-meta-lbl {
  font-size: 10px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
}

.lb-save-meta-val {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 2px;
}

html.dark .lb-save-meta-val,
[data-theme="dark"] .lb-save-meta-val {
  color: #f8fafc;
}

.lb-save-input-group {
  margin-bottom: 14px;
}

.lb-save-input-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

html.dark .lb-save-input-label,
[data-theme="dark"] .lb-save-input-label {
  color: #cbd5e1;
}

.lb-save-input {
  width: 100%;
  height: 40px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.lb-save-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

html.dark .lb-save-input,
[data-theme="dark"] .lb-save-input {
  background: #0f172a;
  border-color: #475569;
  color: #f8fafc;
}

html.dark .lb-save-input:focus,
[data-theme="dark"] .lb-save-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.lb-save-dialog-footer {
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

html.dark .lb-save-dialog-footer,
[data-theme="dark"] .lb-save-dialog-footer {
  background: #111827;
  border-top-color: #1f2937;
}

/* Green Tick Success Confirmation Animation in Dialog */
.lb-save-success-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
}

.lb-success-checkmark-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ecfdf5;
  border: 2px solid #86efac;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
  animation: lbCheckmarkPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

html.dark .lb-success-checkmark-circle,
[data-theme="dark"] .lb-success-checkmark-circle {
  background: rgba(16, 185, 129, 0.2);
  border-color: #059669;
}

.lb-success-checkmark-circle i {
  font-size: 32px;
  color: #059669;
  animation: lbCheckmarkScale 0.3s ease 0.15s both;
}

@keyframes lbCheckmarkPop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes lbCheckmarkScale {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.lb-save-success-title {
  font-size: 17px;
  font-weight: 800;
  color: #065f46;
  margin-bottom: 4px;
}

html.dark .lb-save-success-title,
[data-theme="dark"] .lb-save-success-title {
  color: #34d399;
}

.lb-save-success-desc {
  font-size: 12.5px;
  color: #64748b;
  max-width: 380px;
}

html.dark .lb-save-success-desc,
[data-theme="dark"] .lb-save-success-desc {
  color: #94a3b8;
}

/* Saved Archive Cards Design */
.lb-archive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.lb-archive-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.lb-archive-card:hover {
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
  transform: translateY(-1px);
}

html.dark .lb-archive-card,
[data-theme="dark"] .lb-archive-card {
  background: #1e293b;
  border-color: #334155;
}
html.dark .lb-archive-card:hover,
[data-theme="dark"] .lb-archive-card:hover {
  border-color: #059669;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.lb-archive-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lb-archive-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-archive-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

html.dark .lb-archive-name,
[data-theme="dark"] .lb-archive-name {
  color: #f8fafc;
}

.lb-archive-badge {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #059669;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
}

html.dark .lb-archive-badge,
[data-theme="dark"] .lb-archive-badge {
  background: rgba(16, 185, 129, 0.2);
  border-color: #059669;
  color: #a7f3d0;
}

.lb-archive-meta {
  font-size: 11.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

html.dark .lb-archive-meta,
[data-theme="dark"] .lb-archive-meta {
  color: #94a3b8;
}

.lb-archive-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ==========================================================================
   MINIMAL TABLE EYE VIEW BUTTON
   ========================================================================== */
.lb-table-eye-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: #f8fafc;
  color: #059669;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.lb-table-eye-btn:hover {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
  transform: translateY(-1px);
}

html.dark .lb-table-eye-btn,
[data-theme="dark"] .lb-table-eye-btn {
  background: #1e293b;
  border-color: #334155;
  color: #34d399;
}

html.dark .lb-table-eye-btn:hover,
[data-theme="dark"] .lb-table-eye-btn:hover {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}

/* ==========================================================================
   FLOATING DOCUMENT VIEWER MODAL (A4 SHEETS MODAL)
   ========================================================================== */
.lb-floating-doc-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  animation: lbFadeIn 0.2s ease forwards;
}

.lb-floating-doc-modal {
  background: #ffffff;
  border-radius: 4px;
  width: 95vw;
  max-width: 1200px;
  height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.12);
  animation: lbPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes lbPopIn {
  from {
    transform: scale(0.96) translateY(12px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.lb-floating-doc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #0f172a;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.lb-floating-doc-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lb-floating-doc-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: #059669;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}

.lb-floating-doc-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-floating-doc-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.lb-floating-doc-page-count {
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  color: #a7f3d0;
  padding: 1px 8px;
  border-radius: 4px;
  border: 1px solid rgba(167, 243, 208, 0.2);
}

.lb-floating-doc-sub {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 1px;
}

.lb-floating-doc-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-floating-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.lb-floating-btn-print {
  background: #059669;
  color: #ffffff;
}

.lb-floating-btn-print:hover {
  background: #047857;
  transform: translateY(-1px);
}

.lb-floating-btn-pdf {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.lb-floating-btn-pdf:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.lb-floating-btn-close {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lb-floating-btn-close:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Viewport with PDF Gray Canvas and Centered Paper Sheets */
.lb-floating-doc-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  background: #525659;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Single A4 Landscape Document Sheet */
.lb-a4-sheet {
  background: #ffffff;
  width: 1040px;
  min-height: 720px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
  border-radius: 3px;
  padding: 32px 36px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  position: relative;
  flex-shrink: 0;
}

/* Sheet Header */
.lb-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.lb-sheet-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lb-sheet-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.lb-sheet-company-title {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
}

.lb-sheet-company-addr {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}

.lb-sheet-date-line {
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  margin-top: 4px;
}

.lb-sheet-doc-meta {
  text-align: right;
}

.lb-sheet-doc-title {
  font-size: 18px;
  font-weight: 800;
  color: #059669;
  letter-spacing: 0.5px;
}

.lb-sheet-doc-ref {
  font-size: 10.5px;
  color: #475569;
  margin-top: 3px;
}

.lb-sheet-doc-sub {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sheet Table */
.lb-sheet-table-wrap {
  flex: 1;
}

.lb-sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.lb-sheet-table th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 9px;
  padding: 6px 7px;
  border: 1px solid #cbd5e1;
  text-align: left;
}

.lb-sheet-table th.th-c {
  text-align: center;
}

.lb-sheet-table th.th-r {
  text-align: right;
}

.lb-sheet-table td {
  padding: 5px 7px;
  border: 1px solid #e2e8f0;
  color: #1e293b;
}

.lb-sheet-table td.td-c {
  text-align: center;
}

.lb-sheet-table td.td-r {
  text-align: right;
}

.lb-sheet-table tr:nth-child(even) td {
  background: #f8fafc;
}

/* Subtotal & Grand Total Rows */
.lb-sheet-table tr.subtotal-row td {
  background: #f1f5f9;
  font-weight: 700;
  border-top: 1px solid #cbd5e1;
}

.lb-sheet-table tr.cumulative-row td {
  background: #e8f4e8;
  font-weight: 700;
  border-top: 1px solid #cbd5e1;
}

.lb-sheet-table tr.grand-row td {
  background: #ecfdf5;
  font-weight: 800;
  color: #065f46;
  border-top: 2px solid #059669;
  border-bottom: 2px solid #059669;
}

/* Amount in words */
.lb-sheet-words {
  font-size: 10.5px;
  color: #334155;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin-top: 10px;
}

/* Sheet Footer Signatures */
.lb-sheet-signatures {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 8px;
}

.lb-sheet-sig-item {
  text-align: center;
  width: 160px;
}

.lb-sheet-sig-line {
  border-top: 1px solid #0f172a;
  margin-bottom: 6px;
}

.lb-sheet-sig-label {
  font-size: 10px;
  font-weight: 700;
  color: #1e293b;
}

.lb-sheet-page-indicator {
  position: absolute;
  bottom: 8px;
  right: 16px;
  font-size: 9.5px;
  color: #94a3b8;
}



/* ---- Monthly Summary Row (used in "This Year" view) ---- */
.lb-month-row td {
  background: linear-gradient(90deg, #f0f9ff 0%, #ffffff 100%) !important;
  border-bottom: 1px solid #bae6fd !important;
}

.lb-month-row td.td-date {
  font-weight: 700;
  color: #0369a1;
  font-size: 12.5px;
}

.lb-month-row:hover td {
  background: linear-gradient(90deg, #e0f2fe 0%, #f8fafc 100%) !important;
}
/* =========================================================
   Floating Viewport Override: lb-page inside the dark canvas
   ========================================================= */
.lb-floating-doc-viewport .lb-page {
  width: 1100px !important;
  max-width: 1100px !important;
  min-height: auto !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55) !important;
  border-radius: 2px !important;
  flex-shrink: 0;
  padding: 40px 48px 36px 48px !important;
  font-size: 9.5pt !important;
}

.lb-floating-doc-viewport .lb-page-no {
  bottom: 10px;
  right: 20px;
  font-size: 10px;
  color: #94a3b8;
}

.lb-floating-doc-viewport .lb-company-name {
  font-size: 15pt !important;
}

.lb-floating-doc-viewport .lb-table {
  font-size: 9.5pt !important;
}
/* Print Rules for Floating Doc */
@media print {
  body.lb-printing-floating * {
    visibility: hidden;
  }
  body.lb-printing-floating #lbFloatingDocModal,
  body.lb-printing-floating #lbFloatingDocModal * {
    visibility: visible;
  }
  body.lb-printing-floating #lbFloatingDocModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    background: transparent !important;
    padding: 0 !important;
  }
  body.lb-printing-floating .lb-floating-doc-toolbar {
    display: none !important;
  }
  body.lb-printing-floating .lb-floating-doc-modal {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: transparent !important;
  }
  body.lb-printing-floating .lb-floating-doc-viewport {
    background: transparent !important;
    padding: 0 !important;
    gap: 0 !important;
  }
  body.lb-printing-floating .lb-a4-sheet {
    box-shadow: none !important;
    border-radius: 0 !important;
    page-break-after: always;
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 20px !important;
  }
  /* lb-page layout inside floating doc for printing */
  body.lb-printing-floating .lb-floating-doc-viewport .lb-page {
    box-shadow: none !important;
    border-radius: 0 !important;
    page-break-after: always;
    width: 297mm !important;
    max-width: 297mm !important;
    min-height: 205mm !important;
    margin: 0 !important;
    padding: 8mm 12mm 7mm 12mm !important;
    font-size: 8pt !important;
  }
  body.lb-printing-floating .lb-floating-doc-viewport .lb-company-name {
    font-size: 13.5pt !important;
  }
  body.lb-printing-floating .lb-floating-doc-viewport .lb-table {
    font-size: 8pt !important;
  }
}

/* ==========================================================================
   LABOUR HANDLING CHARGE RATE MASTER — PREMIUM REDESIGN
   Full-width, spacious, clean, modern UI/UX
   ========================================================================== */

/* ── Modal Card Shell ── */
.lb-rate-master-card {
  width: 96vw !important;
  max-width: 1400px !important;
  height: 92vh !important;
  max-height: 92vh !important;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 32px 64px -16px rgba(15, 23, 42, 0.30), 0 0 0 1px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
html.dark .lb-rate-master-card,
[data-theme="dark"] .lb-rate-master-card {
  background: #0c1222;
  box-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255,255,255,0.08);
}

/* ── Premium Header ── */
.lb-rm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  flex-shrink: 0;
}
.lb-rm-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.lb-rm-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #ffffff;
  flex-shrink: 0;
}
.lb-rm-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lb-rm-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.2px;
  line-height: 1.3;
}
.lb-rm-subtitle {
  margin: 0;
  font-size: 12.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.3;
}
.lb-rm-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lb-rm-btn-print {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1.5px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}
.lb-rm-btn-print:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.55);
  transform: translateY(-1px);
}
.lb-rm-btn-close {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}
.lb-rm-btn-close:hover {
  background: rgba(255,255,255,0.2);
  color: #ffffff;
}

/* ── Scrollable Body ── */
.lb-rm-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── Sections ── */
.lb-rm-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 24px 28px;
}
html.dark .lb-rm-section,
[data-theme="dark"] .lb-rm-section {
  background: #1a2236;
  border-color: #2d3a52;
}
.lb-rm-tariff-section {
  padding: 0;
  background: transparent;
  border: none;
}
.lb-rm-new-rev-section {
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-style: dashed;
}
html.dark .lb-rm-new-rev-section,
[data-theme="dark"] .lb-rm-new-rev-section {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}
.lb-rm-section-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 16px;
}
.lb-rm-section-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.lb-rm-section-icon {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.lb-rm-section-icon.blue {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #2563eb;
}
.lb-rm-section-icon.green {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #059669;
}
html.dark .lb-rm-section-icon.blue,
[data-theme="dark"] .lb-rm-section-icon.blue {
  background: rgba(37, 99, 235, 0.2);
}
html.dark .lb-rm-section-icon.green,
[data-theme="dark"] .lb-rm-section-icon.green {
  background: rgba(5, 150, 105, 0.2);
}
.lb-rm-section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}
html.dark .lb-rm-section-title,
[data-theme="dark"] .lb-rm-section-title {
  color: #f1f5f9;
}
.lb-rm-section-desc {
  margin: 4px 0 0 0;
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
  max-width: 700px;
}
.lb-rm-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #3730a3;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
html.dark .lb-rm-badge,
[data-theme="dark"] .lb-rm-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

/* ── Revision History Rows (keep existing classes + enhance) ── */
.lb-rate-revisions-table-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lb-rev-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 14px 20px;
  transition: all 0.18s ease;
  gap: 16px;
}
.lb-rev-item-row:hover {
  border-color: #94a3b8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}
.lb-rev-item-row.active-rev {
  border-color: #10b981;
  background: #f0fdf4;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
html.dark .lb-rev-item-row,
[data-theme="dark"] .lb-rev-item-row {
  background: #0f172a;
  border-color: #334155;
}
html.dark .lb-rev-item-row.active-rev,
[data-theme="dark"] .lb-rev-item-row.active-rev {
  background: rgba(16, 185, 129, 0.08);
  border-color: #059669;
}
.lb-rev-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}
.lb-rev-date-tag {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
}
html.dark .lb-rev-date-tag,
[data-theme="dark"] .lb-rev-date-tag {
  color: #f8fafc;
}
.lb-rev-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.lb-rev-title-text {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}
html.dark .lb-rev-title-text,
[data-theme="dark"] .lb-rev-title-text {
  color: #cbd5e1;
}
.lb-rev-note-text {
  font-size: 11.5px;
  color: #64748b;
}
.lb-rev-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.lb-rev-status-pill.active {
  background: #d1fae5;
  color: #065f46;
}
.lb-rev-status-pill.historical {
  background: #f1f5f9;
  color: #475569;
}
.lb-rev-status-pill.upcoming {
  background: #dbeafe;
  color: #1e40af;
}
.lb-rev-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lb-rev-btn {
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  transition: all 0.15s ease;
}
.lb-rev-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: translateY(-1px);
}
.lb-rev-btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}
.lb-rev-btn.primary:hover {
  background: #1d4ed8;
}

/* ── A4 Printable Tariff Sheet ── */
.lb-rate-sheet-a4 {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 28px 32px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
html.dark .lb-rate-sheet-a4,
[data-theme="dark"] .lb-rate-sheet-a4 {
  background: #0f172a;
  border-color: #334155;
}
.lb-rate-a4-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2.5px solid #0f172a;
  padding-bottom: 18px;
  margin-bottom: 22px;
}
html.dark .lb-rate-a4-header,
[data-theme="dark"] .lb-rate-a4-header {
  border-bottom-color: #94a3b8;
}
.lb-rate-a4-logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}
.lb-rate-a4-logo {
  height: 48px;
  object-fit: contain;
}
.lb-rate-a4-comp-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
}
html.dark .lb-rate-a4-comp-name,
[data-theme="dark"] .lb-rate-a4-comp-name {
  color: #f8fafc;
}
.lb-rate-a4-comp-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
}
.lb-rate-a4-doc-meta {
  text-align: right;
}
.lb-rate-a4-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
html.dark .lb-rate-a4-title,
[data-theme="dark"] .lb-rate-a4-title {
  color: #f8fafc;
}
.lb-rate-a4-ref {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  margin-top: 3px;
}
.lb-rate-a4-date {
  font-size: 11.5px;
  font-weight: 700;
  color: #059669;
  margin-top: 3px;
}

/* ── Filter & Live View Bar ── */
.lb-rate-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}
html.dark .lb-rate-filter-bar,
[data-theme="dark"] .lb-rate-filter-bar {
  background: #1e293b;
  border-color: #334155;
}
.lb-rate-search-box {
  position: relative;
  max-width: 420px;
  width: 100%;
}
.lb-rate-search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 13px;
}
.lb-rate-search-box input {
  padding-left: 38px !important;
  height: 38px !important;
  font-size: 13px !important;
  border-radius: 4px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
}
html.dark .lb-rate-search-box input,
[data-theme="dark"] .lb-rate-search-box input {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #f1f5f9 !important;
}
.lb-pill-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.lb-pill-badge.active {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

/* ── Rate Table (Spacious, clean, highly legible) ── */
.lb-rate-table-responsive {
  overflow-x: auto;
  margin-bottom: 28px;
}
.lb-rate-a4-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.lb-rate-a4-table thead th {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 11.5px;
  vertical-align: middle;
}
html.dark .lb-rate-a4-table thead th,
[data-theme="dark"] .lb-rate-a4-table thead th {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #475569;
}
.lb-rate-a4-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.12s ease;
}
.lb-rate-a4-table tbody tr:hover {
  background: #f0f4ff;
}
html.dark .lb-rate-a4-table tbody tr,
[data-theme="dark"] .lb-rate-a4-table tbody tr {
  border-bottom-color: #334155;
}
html.dark .lb-rate-a4-table tbody tr:hover,
[data-theme="dark"] .lb-rate-a4-table tbody tr:hover {
  background: #1e293b;
}
.lb-rate-a4-table tbody td {
  padding: 11px 14px;
  vertical-align: middle;
  border: 1px solid #e2e8f0;
}
html.dark .lb-rate-a4-table tbody td,
[data-theme="dark"] .lb-rate-a4-table tbody td {
  border-color: #334155;
}
.prod-handling-input {
  width: 100px;
  text-align: right;
  height: 34px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  color: #0f172a;
  background: #ffffff;
  transition: all 0.18s ease;
}
.prod-handling-input:focus {
  border-color: #667eea;
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
html.dark .prod-handling-input,
[data-theme="dark"] .prod-handling-input {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
}

/* ── Signatures ── */
.lb-rate-a4-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 42px;
  padding-top: 18px;
}
.lb-rate-sig-col {
  width: 28%;
  text-align: center;
}
.lb-rate-sig-line {
  border-top: 1.5px solid #0f172a;
  margin-bottom: 8px;
}
html.dark .lb-rate-sig-line,
[data-theme="dark"] .lb-rate-sig-line {
  border-top-color: #94a3b8;
}
.lb-rate-sig-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}
html.dark .lb-rate-sig-title,
[data-theme="dark"] .lb-rate-sig-title {
  color: #f1f5f9;
}
.lb-rate-sig-dept {
  font-size: 10.5px;
  color: #64748b;
  margin-top: 2px;
}

/* ── New Revision Form ── */
.lb-rm-new-rev-form {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.lb-rm-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}
.lb-rm-form-group label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.2px;
}
html.dark .lb-rm-form-group label,
[data-theme="dark"] .lb-rm-form-group label {
  color: #94a3b8;
}
.lb-rm-input {
  height: 40px !important;
  font-size: 13px !important;
  border-radius: 4px !important;
  padding: 8px 14px !important;
  border: 1.5px solid #cbd5e1 !important;
}
.lb-rm-input:focus {
  border-color: #667eea !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12) !important;
}
.lb-rm-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  height: 40px;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}
.lb-rm-btn-save:hover {
  background: linear-gradient(135deg, #047857, #065f46);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.4);
}

/* ── Footer ── */
.lb-rm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 36px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
  border-radius: 0 0 4px 4px;
}
html.dark .lb-rm-footer,
[data-theme="dark"] .lb-rm-footer {
  background: #111827;
  border-top-color: #1e293b;
}
.lb-rm-footer-info {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lb-rm-footer-info i {
  color: #3b82f6;
  font-size: 13px;
}
.lb-rm-btn-close-footer {
  padding: 8px 22px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lb-rm-btn-close-footer:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}
html.dark .lb-rm-btn-close-footer,
[data-theme="dark"] .lb-rm-btn-close-footer {
  background: #1e293b;
  border-color: #475569;
  color: #cbd5e1;
}

/* ── Legacy class compat (keep old section-box classes working) ── */
.lb-rate-section-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 24px 28px;
  margin-bottom: 0;
}
html.dark .lb-rate-section-box,
[data-theme="dark"] .lb-rate-section-box {
  background: #1a2236;
  border-color: #2d3a52;
}
.lb-rate-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 14px;
}
.lb-rate-section-heading {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
html.dark .lb-rate-section-heading,
[data-theme="dark"] .lb-rate-section-heading {
  color: #f8fafc;
}
.lb-rate-section-desc {
  margin: 4px 0 0 0;
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
}
.lb-revision-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #3730a3;
  white-space: nowrap;
}
.lb-rate-sheet-a4-wrap {
  margin-bottom: 0;
}
.lb-rate-new-rev-card {
  background: #f0fdf4;
  border: 1px dashed #bbf7d0;
  border-radius: 4px;
  padding: 24px 28px;
}
html.dark .lb-rate-new-rev-card,
[data-theme="dark"] .lb-rate-new-rev-card {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}
.lb-rate-new-rev-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
html.dark .lb-rate-new-rev-title,
[data-theme="dark"] .lb-rate-new-rev-title {
  color: #f8fafc;
}
.lb-rate-new-rev-subtitle {
  font-size: 12.5px;
  color: #64748b;
  margin: 4px 0 16px 0;
}
.lb-rate-new-rev-form {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}
.lb-rate-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}
.lb-rate-input-group label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}
html.dark .lb-rate-input-group label,
[data-theme="dark"] .lb-rate-input-group label {
  color: #94a3b8;
}

/* ==========================================================================
   PRINT STYLESHEET FOR A4 RATE SHEET
   ========================================================================== */
@media print {
  body.lb-printing-rate-sheet {
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.lb-printing-rate-sheet * {
    visibility: hidden !important;
  }

  body.lb-printing-rate-sheet #lbRateSheetA4Container,
  body.lb-printing-rate-sheet #lbRateSheetA4Container * {
    visibility: visible !important;
  }

  body.lb-printing-rate-sheet #lbRateSheetA4Container {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  body.lb-printing-rate-sheet .no-print {
    display: none !important;
  }

  body.lb-printing-rate-sheet .prod-handling-input {
    border: none !important;
    background: transparent !important;
    text-align: right !important;
    font-size: 10pt !important;
    padding: 0 !important;
  }

  body.lb-printing-rate-sheet .lb-rate-a4-table {
    font-size: 9pt !important;
  }

  body.lb-printing-rate-sheet .lb-rate-a4-table th,
  body.lb-printing-rate-sheet .lb-rate-a4-table td {
    padding: 4px 6px !important;
    border: 1px solid #475569 !important;
  }
}
