/* ==========================================================================
   NEURMEK KOSANA - DESIGN SYSTEM & STYLESHEET (COMPLETE MOBILE & DESKTOP VERSION)
   ========================================================================== */

:root {
  /* Color Palette - Vibrant Modern Theme */
  --primary-blue: #1d4ed8;
  --primary-blue-hover: #1e40af;
  --primary-blue-light: #eff6ff;
  --brand-red: #dc2626;
  --brand-red-dark: #b91c1c;
  --kbank-green: #16a34a;
  
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-light: #f8fafc;
  
  --border-color: #e2e8f0;
  --border-dark: #cbd5e1;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

body {
  font-family: 'Prompt', 'Kanit', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Navigation */
.sidebar {
  width: 270px;
  background-color: var(--bg-sidebar);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.brand-header {
  padding: 20px 18px;
  border-bottom: 1px solid #1e293b;
}

.brand-logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo-text {
  font-family: 'Kanit', sans-serif;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.brand-logo-red {
  color: var(--brand-red);
}

.brand-logo-black {
  color: #ffffff;
}

.brand-tag-badge {
  background-color: var(--primary-blue);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.brand-subtext {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.nav-menu {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px 4px 12px;
  margin-top: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  cursor: pointer;
}

.nav-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background-color: var(--primary-blue);
  color: #ffffff;
  font-weight: 700;
}

.user-profile-widget {
  padding: 14px 18px;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #0b1324;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-left: 270px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 64px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title {
  font-family: 'Kanit', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sync-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #dcfce7;
  color: #15803d;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #16a34a;
}

.content-area {
  padding: 24px 28px;
  flex: 1;
}

/* UI Cards & Utilities */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-blue-hover);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-primary);
  border-color: var(--border-dark);
}

.btn-secondary:hover {
  background-color: #f1f5f9;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-dark);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-primary);
  background-color: #ffffff;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

/* Table Overflow Wrapper for Mobile Responsive Scrolling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  background-color: #f8fafc;
  color: var(--text-secondary);
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.data-table tbody tr:hover {
  background-color: #f1f5f9;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge-prod { background-color: #fef3c7; color: #b45309; }
.badge-qc { background-color: #dcfce7; color: #15803d; }

/* MODAL OVERLAY STYLES */
body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal-content-box {
  background: #ffffff;
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

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

/* DRAG & DROP UPLOAD DROPZONE */
.dropzone-container {
  border: 2px dashed #93c5fd;
  background-color: #f0f9ff;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

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

.dropzone-container.drag-active {
  border-color: #16a34a !important;
  background-color: #dcfce7 !important;
  transform: scale(1.01);
  box-shadow: 0 0 15px rgba(22, 163, 74, 0.2);
}

.dropzone-icon {
  font-size: 32px;
  color: var(--primary-blue);
  margin-bottom: 8px;
}

.dropzone-text-main {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.dropzone-text-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.dropzone-paste-badge {
  display: inline-block;
  background-color: #dbeafe;
  color: var(--primary-blue);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 8px;
}

.dropzone-preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #ffffff;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-top: 12px;
}

.dropzone-preview-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

/* STEPPED HORIZONTAL TIMELINE WORKFLOW STYLES */
.stepped-timeline-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  width: 100%;
  padding: 10px 0 5px 0;
}

.timeline-connecting-line {
  position: absolute;
  top: 24px;
  left: 40px;
  right: 40px;
  height: 4px;
  background-color: #cbd5e1;
  z-index: 1;
}

.timeline-connecting-line-progress {
  height: 100%;
  background-color: var(--primary-blue);
  transition: width 0.3s ease;
}

.timeline-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  flex: 1;
  cursor: pointer;
}

.timeline-step-node {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 3px solid #cbd5e1;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  transition: all 0.25s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.timeline-step-item.active .timeline-step-node {
  border-color: var(--primary-blue);
  background-color: var(--primary-blue);
  color: #ffffff;
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(29, 78, 216, 0.4);
}

.timeline-step-item.completed .timeline-step-node {
  border-color: #16a34a;
  background-color: #16a34a;
  color: #ffffff;
}

.timeline-step-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 8px;
  text-align: center;
  white-space: nowrap;
}

.timeline-step-item.active .timeline-step-label {
  color: var(--primary-blue);
  font-weight: 800;
}

.timeline-step-item.completed .timeline-step-label {
  color: #16a34a;
}

/* VISUAL CARD MENU STYLES */
.visual-job-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.visual-job-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.job-card-image-box img {
  transition: transform 0.3s ease;
}

.job-card-image-box:hover img {
  transform: scale(1.05);
}

/* A5 PRINTABLE INVOICE TEMPLATE STYLES */
.a5-print-container {
  width: 148mm;
  min-height: 210mm;
  background: #ffffff;
  margin: 0 auto;
  padding: 8mm 10mm;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
  font-size: 11px;
  color: #0f172a;
  border-radius: var(--radius-md);
}

.a5-header-wrapper {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  margin-bottom: 8px !important;
}

.a5-logo-title {
  font-family: 'Kanit', sans-serif;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.a5-logo-title .brand-logo-black {
  color: #0f172a !important;
}

.a5-sub-services {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.35;
}

.a5-phone {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-blue);
  margin-top: 3px;
}

.a5-company-address-box {
  text-align: right !important;
  font-size: 10.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.a5-job-no-box {
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 800;
}

.a5-job-no-label {
  color: var(--text-secondary);
}

.a5-job-no-value {
  color: var(--primary-blue);
  font-family: 'Kanit', sans-serif;
  font-weight: 900;
  margin-left: 4px;
}

.a5-blue-separator {
  border: 0;
  border-top: 2px solid var(--primary-blue);
  margin: 8px 0;
}

.a5-customer-box {
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  margin-bottom: 10px;
}

.a5-cust-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.a5-cust-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.a5-cust-value {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
}

.a5-date-pill {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--primary-blue);
}

.a5-table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-bottom: 10px !important;
  font-size: 11px !important;
}

.a5-table th {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  padding: 6px 8px !important;
  text-align: center !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

.a5-table td {
  border: 1px solid #cbd5e1 !important;
  padding: 6px 8px !important;
  color: #0f172a !important;
}

.a5-table-tfoot td {
  border: 1px solid #cbd5e1 !important;
  padding: 6px 8px !important;
}

.a5-payment-grid {
  display: flex !important;
  gap: 12px !important;
  margin-top: 8px !important;
  margin-bottom: 10px !important;
}

.a5-payment-left {
  flex: 1 !important;
  background: #f8fafc !important;
  padding: 8px 10px !important;
  border-radius: 6px !important;
  border: 1px solid #cbd5e1 !important;
}

.a5-payment-right {
  flex: 1.4 !important;
  background: #f8fafc !important;
  padding: 8px 10px !important;
  border-radius: 6px !important;
  border: 1px solid #cbd5e1 !important;
  position: relative !important;
}

.a5-bank-content-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.a5-bank-info-col {
  font-size: 10.5px;
  line-height: 1.4;
}

.a5-kbank-title {
  font-weight: 800;
  color: var(--kbank-green);
  font-size: 11px;
}

.a5-kbank-account {
  font-weight: 800;
  color: #0f172a;
}

.a5-kbank-owner {
  color: var(--text-secondary);
}

.a5-qr-code-img {
  width: 24mm !important;
  height: 24mm !important;
  max-width: 24mm !important;
  max-height: 24mm !important;
  object-fit: contain !important;
  border: 1px solid #0f172a !important;
  border-radius: 4px !important;
}

.a5-stamp-watermark {
  position: absolute;
  right: 10px;
  bottom: 6px;
  font-size: 9px;
  color: rgba(220, 38, 38, 0.35);
  border: 1px dashed rgba(220, 38, 38, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.a5-signatures-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 20px !important;
  margin-top: 10px !important;
  margin-bottom: 10px !important;
}

.a5-sig-box {
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 8px !important;
  text-align: center !important;
  font-size: 10.5px !important;
}

.a5-sig-header {
  font-weight: 800;
  color: var(--text-secondary);
}

.a5-sig-space {
  height: 28px;
}

.a5-sig-date {
  color: var(--text-muted);
  font-size: 9.5px;
}

.a5-bottom-banner {
  background: var(--bg-sidebar);
  color: #ffffff;
  text-align: center;
  padding: 6px;
  border-radius: 4px;
  margin-top: 8px;
}

.a5-doc-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  margin-top: 4px;
}

.a5-doc-badge-green { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.a5-doc-badge-amber { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.a5-doc-badge-blue { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.a5-doc-badge-purple { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }

/* PARCEL SHIPPING LABEL THERMAL PRINT STYLES */
.shipping-label-card {
  background: #ffffff;
  border: 2px solid #0f172a;
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  color: #0f172a;
}

.shipping-section-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.shipping-carrier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shipping-cod-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 900;
  font-size: 12px;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.shipping-cod-badge.cod-active {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.shipping-title-sm {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 2px;
}

/* FLOATING ACTION BUTTONS (FAB) */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 999;
}

.fab-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease;
}

.fab-btn:hover {
  transform: scale(1.1);
}

.fab-btn-camera { background-color: #0f172a; }
.fab-btn-confirm { background-color: #10b981; }
.fab-btn-print { background-color: #2563eb; }

.fab-tooltip {
  position: absolute;
  right: 60px;
  background-color: #0f172a;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.fab-btn:hover .fab-tooltip {
  opacity: 1;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE DESIGN (รองรับการเปิดบนมือถือและแท็บเล็ต 100%)
   ========================================================================== */

/* Mobile Menu Toggle Button (Hidden on Desktop) */
.mobile-menu-toggle {
  display: none;
}

/* Sidebar Overlay Backdrop for Mobile */
.sidebar-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

/* Responsive Media Queries (< 992px & < 768px) */
@media screen and (max-width: 992px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media screen and (max-width: 768px) {
  .mobile-menu-toggle {
    display: inline-flex !important;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .topbar {
    padding: 0 14px !important;
    height: 56px !important;
  }

  .page-title {
    font-size: 14.5px !important;
  }

  .topbar-actions .sync-badge span:not(.sync-dot) {
    display: none;
  }

  .content-area {
    padding: 14px !important;
  }

  .grid-4, .grid-3, .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .card {
    padding: 14px !important;
    margin-bottom: 14px !important;
  }

  .data-table {
    min-width: 580px;
  }

  .stepped-timeline-wrapper {
    overflow-x: auto;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .timeline-step-label {
    font-size: 10.5px !important;
  }

  .modal-content-box {
    width: 95% !important;
    max-height: 92vh !important;
    padding: 16px !important;
    margin: 10px auto !important;
  }

  .fab-container {
    bottom: 16px !important;
    right: 16px !important;
  }

  .fab-btn {
    width: 42px !important;
    height: 42px !important;
  }

  /* A5 Invoice Mobile Preview */
  .a5-print-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px !important;
    overflow-x: auto;
  }
}

/* ===== RESPONSIVE MOBILE 480px (Small Phone) ===== */
@media screen and (max-width: 480px) {
  .content-area {
    padding: 8px !important;
  }

  .card {
    padding: 10px !important;
    border-radius: 10px !important;
  }

  .card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .card-title {
    font-size: 13px !important;
  }

  .form-control, .form-select, select.form-control {
    font-size: 14px !important;
    min-height: 44px !important;
    padding: 8px 12px !important;
  }

  .btn {
    min-height: 44px !important;
    font-size: 13px !important;
    padding: 8px 14px !important;
  }

  .topbar {
    padding: 0 10px !important;
    height: 50px !important;
    gap: 6px !important;
  }

  .page-title {
    font-size: 13px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
  }

  .topbar-actions {
    gap: 6px !important;
  }

  .topbar-actions .btn span {
    display: none;
  }

  .data-table th, .data-table td {
    padding: 6px 8px !important;
    font-size: 11px !important;
  }

  .sidebar {
    width: 260px !important;
  }

  .nav-item {
    padding: 10px 14px !important;
    font-size: 13px !important;
  }

  /* Stats cards on mobile - big numbers smaller */
  .grid-4 > .card div[style*='font-size: 28px'] {
    font-size: 22px !important;
  }
}

/* ===== RESPONSIVE LOGIN CARD ===== */
@media screen and (max-width: 500px) {
  .neon-login-card {
    width: 95vw !important;
    padding: 24px 18px !important;
    border-radius: 18px !important;
  }

  .neon-logo-banner-3d {
    padding: 12px 16px !important;
    border-radius: 14px !important;
  }

  .neon-logo-banner-3d img {
    max-height: 56px !important;
  }

  .neon-tab-container {
    flex-direction: column !important;
    gap: 4px !important;
  }

  .neon-tab-btn {
    font-size: 12px !important;
    padding: 10px !important;
  }

  .neon-select-metallic, .neon-input-metallic {
    height: 44px !important;
    font-size: 14px !important;
  }

  .neon-submit-btn {
    min-height: 44px !important;
    font-size: 14px !important;
  }

  .neon-input-button-row {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .neon-input-button-row .neon-submit-btn {
    width: 100% !important;
  }
}

/* ===== RESPONSIVE TABLE HORIZONTAL SCROLL ===== */
@media screen and (max-width: 768px) {
  .table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -14px;
    padding: 0 14px;
  }

  /* Card header search inputs */
  .card-header input[type='text'] {
    width: 100% !important;
    min-width: unset !important;
  }

  /* Job tracking search bar */
  #view-job_tracking .card-header > div {
    flex-direction: column !important;
    width: 100% !important;
  }

  #trackSearchInput {
    width: 100% !important;
  }

  #trackStatusFilter {
    width: 100% !important;
  }

  /* Daily queue controls */
  #view-daily_queue .card-header {
    flex-direction: column !important;
    align-items: stretch !important;
  }
}

/* PRINT MEDIA STYLES - GUARANTEED EXACT 1-PAGE PRINTING FOR ALL PRINT MODES */
@media print {
  @page {
    size: A5 portrait;
    margin: 0 !important;
  }

  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide navigation, sidebar, topbar, fab, unneeded UI elements */
  .sidebar, .topbar, .fab-container, .btn-print-hide, .nav-menu, .user-profile-widget, .sync-badge, .mobile-menu-toggle, .sidebar-overlay {
    display: none !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .content-area {
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Hide ALL view panels by default during print */
  .view-panel {
    display: none !important;
  }

  /* Mode 1: Print A5 Invoice (Default) */
  body:not(.printing-daily):not(.printing-shipping-label) #view-billing_a5 {
    display: block !important;
  }

  body:not(.printing-daily):not(.printing-shipping-label) #view-billing_a5 .card.btn-print-hide {
    display: none !important;
  }

  /* Mode 2: Print Daily Queue Sheet */
  body.printing-daily #view-daily_queue {
    display: block !important;
  }

  body.printing-daily #view-daily_queue .card.btn-print-hide {
    display: none !important;
  }

  /* Mode 3: Print Thermal Shipping Label (Fix: Fits 100% on 1 Single Page) */
  body.printing-shipping-label #view-billing_a5 {
    display: none !important;
  }

  body.printing-shipping-label #shippingLabelModal {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #ffffff !important;
    opacity: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 99999 !important;
  }

  body.printing-shipping-label #shippingLabelModal .modal-content-box {
    max-width: 100% !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
    background: transparent !important;
    overflow: hidden !important;
  }

  body.printing-shipping-label #printableShippingLabel {
    width: 120mm !important;
    max-width: 120mm !important;
    margin: 8mm auto 0 auto !important;
    padding: 6mm 8mm !important;
    border: 2px solid #0f172a !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
    page-break-after: avoid !important;
    overflow: hidden !important;
    display: block !important;
  }

  .a5-print-container {
    width: 148mm !important;
    height: 208mm !important;
    max-height: 208mm !important;
    padding: 5mm 6mm !important;
    margin: 0 auto !important;
    border: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
    overflow: hidden !important;
    display: block !important;
  }

  .brand-logo-red {
    color: #dc2626 !important;
    -webkit-text-fill-color: #dc2626 !important;
    font-weight: 900 !important;
  }

  .brand-logo-black {
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    font-weight: 900 !important;
  }
}

/* LOGIN MODAL & PIN KEYPAD STYLES */
.pin-box {
  width: 44px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid #334155;
  background: #1e293b;
  color: #38bdf8;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
}

.pin-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 260px;
  margin: 0 auto;
}

.pin-key-btn {
  height: 48px;
  border-radius: 10px;
  background: #1e293b;
  color: #ffffff;
  border: 1px solid #334155;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pin-key-btn:hover {
  background: #334155;
  transform: scale(1.05);
}

.pin-key-btn:active {
  transform: scale(0.95);
}

.pin-key-btn-danger {
  background: #7f1d1d;
  color: #fca5a5;
  border-color: #991b1b;
}

.pin-key-btn-primary {
  background: var(--primary-blue);
  color: #ffffff;
  border-color: #2563eb;
}

/* ==========================================================================
   NEON PINK CYBERPUNK EMPLOYEE LOGIN PORTAL (100% MATCH SPECIFICATION IMAGE)
   ========================================================================== */

.neon-login-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  background: #080914; /* Dark theme background */
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Kanit', sans-serif;
}

.neon-login-page.active {
  display: flex !important;
}

.neon-login-card {
  width: 440px;
  max-width: 92vw;
  background: #111322;
  border-radius: 24px;
  border: 1.5px solid #ff2a85;
  box-shadow: 0 0 45px rgba(255, 42, 133, 0.45);
  padding: 34px 28px;
  text-align: center;
  color: #ffffff;
  position: relative;
}

.neon-logo-banner-3d {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 16px 28px;
  border-radius: 20px;
  border: 2px solid #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.9);
  display: inline-block;
  margin-bottom: 14px;
  max-width: 340px;
  width: 100%;
}

.neon-select-metallic, .neon-input-metallic {
  width: 100%;
  height: 48px;
  padding: 8px 18px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: 'Kanit', sans-serif;
  color: #0f172a;
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 40%, #cbd5e1 100%);
  border: 1px solid #94a3b8;
  border-radius: 12px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.9), 0 4px 10px rgba(0, 0, 0, 0.3);
  outline: none;
  cursor: pointer;
}

.neon-select-metallic:focus, .neon-input-metallic:focus {
  border-color: #ff2a85;
  box-shadow: 0 0 15px rgba(255, 42, 133, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.9);
}

.neon-login-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 24px;
}

.neon-tab-container {
  display: flex;
  gap: 8px;
  background: #181a2e;
  padding: 4px;
  border-radius: 30px;
  margin-bottom: 24px;
  border: 1px solid #282b4a;
}

.neon-tab-btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.neon-tab-btn.active {
  background: linear-gradient(135deg, #ff2a85, #fe0066);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 42, 133, 0.5);
}

.neon-form-group {
  text-align: left;
  margin-bottom: 18px;
}

.neon-label {
  display: block;
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 600;
  margin-bottom: 6px;
}

.neon-select {
  width: 100%;
  height: 46px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  background: #181a2e;
  color: #ffffff;
  border: 1px solid #333761;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
}

.neon-select:focus {
  border-color: #ff2a85;
  box-shadow: 0 0 10px rgba(255, 42, 133, 0.3);
}

.neon-input-button-row {
  display: flex;
  gap: 10px;
}

.neon-input {
  flex: 1;
  height: 46px;
  padding: 8px 16px;
  font-size: 14px;
  background: #181a2e;
  color: #ffffff;
  border: 1px solid #333761;
  border-radius: 10px;
  outline: none;
}

.neon-input:focus {
  border-color: #ff2a85;
  box-shadow: 0 0 10px rgba(255, 42, 133, 0.3);
}

.neon-submit-btn {
  height: 46px;
  padding: 0 20px;
  background: linear-gradient(135deg, #ff2a85, #fe0066);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 15px rgba(255, 42, 133, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.neon-submit-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(255, 42, 133, 0.6);
}

.neon-footnote {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 20px;
  line-height: 1.5;
}

