/* SCD Procurement Monitoring & Tracking System Enterprise Stylesheet */

:root {
  --primary-color: #0f4c81;
  --primary-hover: #0b375d;
  --secondary-color: #64748b;
  --accent-color: #0284c7;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --dark-bg: #0f172a;
  --sidebar-width: 260px;
  --card-radius: 12px;
  --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);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Navbar */
.navbar-scd {
  background: linear-gradient(135deg, #0f4c81 0%, #1e293b 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  padding: 0.75rem 1.5rem;
}

.navbar-scd .navbar-brand {
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.navbar-scd .nav-link {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.925rem;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.navbar-scd .nav-link:hover,
.navbar-scd .nav-link.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.12);
}

/* Page Headers */
.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.page-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

/* Enterprise Metric Cards */
.metric-card {
  background: #ffffff;
  border-radius: var(--card-radius);
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.metric-card.primary::before { background-color: var(--primary-color); }
.metric-card.info::before { background-color: var(--accent-color); }
.metric-card.warning::before { background-color: var(--warning-color); }
.metric-card.danger::before { background-color: var(--danger-color); }
.metric-card.success::before { background-color: var(--success-color); }
.metric-card.purple::before { background-color: #8b5cf6; }

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
}

.metric-label {
  font-size: 0.825rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.metric-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

/* Custom Status Pills */
.custom-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  font-size: 0.775rem;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.pulse-badge {
  animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Modern Enterprise Tables */
.table-card {
  background: #ffffff;
  border-radius: var(--card-radius);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Responsive Desktop Table Container: Zero Horizontal Scrolling */
.table-responsive-desktop {
  width: 100%;
}

@media (min-width: 1200px) {
  .table-responsive-desktop {
    overflow-x: hidden !important; /* Disables horizontal scrollbar on desktop */
  }
}

.table-custom {
  margin-bottom: 0;
  width: 100% !important;
  font-size: 0.8125rem;
  vertical-align: middle;
}

.table-custom thead th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.3px;
  border-bottom: 2px solid #e2e8f0;
  padding: 0.65rem 0.5rem;
  white-space: nowrap;
}

.table-custom tbody tr {
  transition: background-color 0.15s ease;
}

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

.table-custom tbody td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

@media (max-width: 1366px) {
  .table-custom thead th {
    padding: 0.55rem 0.35rem;
    font-size: 0.7rem;
  }
  .table-custom tbody td {
    padding: 0.45rem 0.35rem;
    font-size: 0.785rem;
  }
  .custom-status-pill {
    padding: 0.2rem 0.45rem;
    font-size: 0.72rem;
  }
  .stepper-mini {
    padding: 2px 4px;
  }
}

/* Category Section Accordion / Header in Reports */
.category-report-group {
  background: #ffffff;
  border-radius: var(--card-radius);
  border: 1px solid #cbd5e1;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.category-report-header {
  background: linear-gradient(to right, #f8fafc, #edf2f7);
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-report-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}

/* Bulk Toolbar */
#bulkActionToolbar {
  position: sticky;
  top: 10px;
  z-index: 1020;
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  animation: slideDown 0.25s ease-out;
}

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

/* Filter Card */
.filter-card {
  background: #ffffff;
  border-radius: var(--card-radius);
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ====================================================================
   ENTERPRISE PRINT STYLESHEET (A4 Landscape & Compact Portrait)
   Zero column cutoff, automated page-fit, repeats table headers
   ==================================================================== */
@page {
  size: A4 landscape;
  margin: 8mm 6mm 8mm 6mm;
}

@media print {
  /* Dynamic Portrait Class if chosen */
  body.print-portrait-mode {
    font-size: 7.2pt !important;
  }
  
  html, body {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 8pt !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  main, 
  .container-fluid, 
  .main-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* 1. Prevent Container Clipping */
  .table-responsive {
    overflow: visible !important;
    overflow-x: visible !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .table-card,
  .category-report-group {
    overflow: visible !important;
    border: 1px solid #475569 !important;
    box-shadow: none !important;
    border-radius: 4px !important;
    margin-bottom: 14px !important;
    page-break-inside: auto !important;
    break-inside: auto !important;
  }

  .category-report-header {
    background: #f1f5f9 !important;
    border-bottom: 1.5px solid #334155 !important;
    padding: 5px 8px !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .category-report-title {
    font-size: 9.5pt !important;
    font-weight: 700 !important;
    color: #0f172a !important;
  }

  /* 2. Universal Report Tables: Fixed Layout Fits 100% Paper Width */
  table.table,
  .table-custom,
  .table-cat-report,
  .table-aging-report {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important; /* CRITICAL: Table mathematically forced into 100% width, zero overflow */
    border-collapse: collapse !important;
    margin-bottom: 0 !important;
    font-size: 7.5pt !important;
  }

  .table-custom thead {
    display: table-header-group !important; /* Table headers repeat at the top of every printed page */
  }

  .table-custom thead th {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-bottom: 1.5px solid #334155 !important;
    border-top: 1px solid #cbd5e1 !important;
    padding: 3.5px 3.5px !important;
    font-size: 7pt !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    width: auto !important; /* Overrides inline pixel styles */
  }

  .table-custom tbody tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .table-custom tbody td {
    padding: 3px 3.5px !important;
    border-bottom: 1px solid #cbd5e1 !important;
    font-size: 7.5pt !important;
    line-height: 1.22 !important;
    vertical-align: middle !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    width: auto !important; /* Overrides inline pixel styles */
  }

  /* 3. Proportional Column Widths for Category Report (Total = 100%) */
  .col-pr       { width: 7.5% !important; }
  .col-date     { width: 7.5% !important; }
  .col-aging    { width: 7.5% !important; text-align: center !important; }
  .col-deadline { width: 8.5% !important; }
  .col-desc     { width: 24.0% !important; }
  .col-code     { width: 7.0% !important; font-family: monospace !important; }
  .col-qty      { width: 6.5% !important; text-align: center !important; }
  .col-dept     { width: 10.0% !important; }
  .col-officer  { width: 10.5% !important; }
  .col-status   { width: 11.0% !important; }
  .col-action   { display: none !important; width: 0 !important; }

  /* Portrait Mode Column Adjustments */
  body.print-portrait-mode .table-cat-report th,
  body.print-portrait-mode .table-cat-report td {
    font-size: 6.8pt !important;
    padding: 2.5px 2px !important;
  }
  body.print-portrait-mode .col-desc { width: 22.0% !important; }
  body.print-portrait-mode .col-pr   { width: 7.0% !important; }

  /* Aging SLA Report Columns */
  .table-aging-report th.col-pr,       .table-aging-report td.col-pr       { width: 7.5% !important; }
  .table-aging-report th.col-date,     .table-aging-report td.col-date     { width: 7.5% !important; }
  .table-aging-report th.col-aging,    .table-aging-report td.col-aging    { width: 8.0% !important; text-align: center !important; }
  .table-aging-report th.col-deadline, .table-aging-report td.col-deadline { width: 8.5% !important; }
  .table-aging-report th.col-desc,     .table-aging-report td.col-desc     { width: 23.5% !important; }
  .table-aging-report th.col-category, .table-aging-report td.col-category { width: 10.0% !important; }
  .table-aging-report th.col-qty,      .table-aging-report td.col-qty      { width: 6.5% !important; text-align: center !important; }
  .table-aging-report th.col-dept,     .table-aging-report td.col-dept     { width: 9.5% !important; }
  .table-aging-report th.col-officer,  .table-aging-report td.col-officer  { width: 9.5% !important; }
  .table-aging-report th.col-status,   .table-aging-report td.col-status   { width: 10.0% !important; }
  .table-aging-report th.col-action,   .table-aging-report td.col-action   { display: none !important; width: 0 !important; }

  /* 4. Compact Badges & Status Pills in Print */
  .badge, 
  .custom-status-pill {
    font-size: 6.8pt !important;
    padding: 1px 3px !important;
    font-weight: 600 !important;
    border: 1px solid #64748b !important;
    background: transparent !important;
    color: #0f172a !important;
    white-space: normal !important;
    display: inline-block !important;
    line-height: 1.15 !important;
    box-shadow: none !important;
    border-radius: 3px !important;
  }

  /* Hide decorative icons inside badges and pills in print */
  .badge i, 
  .custom-status-pill i,
  .stepper-mini {
    display: none !important;
  }

  /* 5. Hide Screen Elements */
  .no-print,
  .navbar-scd,
  .filter-card,
  .page-header,
  .btn,
  .btn-group,
  .pagination,
  .mobile-fab,
  #bulkActionToolbar,
  .modal-backdrop,
  footer {
    display: none !important;
  }

  body.is-printing-report .table-card,
  body.is-printing-report .modal {
    display: none !important;
  }

  body.is-printing-report #printCategoryReportArea {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 6. Formal Enterprise Print Header */
  .print-header {
    display: block !important;
    border-bottom: 2px solid #0f172a !important;
    padding-bottom: 6px !important;
    margin-bottom: 12px !important;
  }
  .print-header h3 {
    font-size: 13pt !important;
    font-weight: 800 !important;
    margin: 0 0 2px 0 !important;
    color: #0f172a !important;
    letter-spacing: 0.5px !important;
  }
  .print-header h5 {
    font-size: 9.5pt !important;
    font-weight: 600 !important;
    margin: 0 0 4px 0 !important;
    color: #334155 !important;
  }
  .print-header-meta {
    font-size: 7.5pt !important;
    color: #475569 !important;
    display: flex !important;
    justify-content: space-between !important;
  }

  /* 7. Category-wise PDF Document Print Styles */
  .print-cat-group {
    page-break-inside: auto !important;
    break-inside: auto !important;
    margin-bottom: 14px !important;
  }
  .print-cat-title {
    font-size: 9.5pt !important;
    font-weight: 700 !important;
    background: #f1f5f9 !important;
    padding: 3px 6px !important;
    border-left: 4px solid #0f4c81 !important;
    border-top: 1px solid #cbd5e1 !important;
    border-right: 1px solid #cbd5e1 !important;
    border-bottom: 1px solid #cbd5e1 !important;
    margin-bottom: 3px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    color: #0f172a !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }
  .print-data-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 7.2pt !important;
    margin-bottom: 8px !important;
    page-break-inside: auto !important;
  }
  .print-data-table thead {
    display: table-header-group !important;
  }
  .print-data-table tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .print-data-table th,
  .print-data-table td {
    border: 1px solid #475569 !important;
    padding: 3px 4px !important;
    vertical-align: middle !important;
    color: #000 !important;
  }
  .print-data-table th {
    background-color: #f1f5f9 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 6.8pt !important;
  }
  .print-signatures {
    margin-top: 30px !important;
    padding-top: 10px !important;
    border-top: 1px dashed #94a3b8 !important;
    display: flex !important;
    justify-content: space-between !important;
    font-size: 7.5pt !important;
    page-break-inside: avoid !important;
  }
}

/* Category PDF Modal Preview Styles (Screen) */
#printPreviewContainer .print-doc-sheet {
  background: #ffffff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0f172a;
}
#printPreviewContainer .print-cat-title {
  font-size: 0.95rem;
  font-weight: 700;
  background: #f8fafc;
  padding: 6px 10px;
  border-left: 4px solid #0f4c81;
  border-radius: 4px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#printPreviewContainer .print-data-table {
  width: 100%;
  font-size: 0.8rem;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
}
#printPreviewContainer .print-data-table th,
#printPreviewContainer .print-data-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
  vertical-align: middle;
}
#printPreviewContainer .print-data-table th {
  background-color: #f1f5f9;
  font-weight: 700;
  color: #334155;
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* ====================================================================
   LIVE TRACKING & PIPELINE STEPPERS
   ==================================================================== */
.stepper-mini {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.stepper-mini .step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  transition: all 0.2s ease;
}

.stepper-mini .step-dot.completed {
  background-color: #10b981;
}

.stepper-mini .step-dot.active {
  background-color: #0284c7;
  transform: scale(1.3);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.3);
}

.stepper-mini .step-dot.pending {
  background-color: #cbd5e1;
}

.stepper-mini .step-text {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  margin-left: 2px;
}

/* Interactive Tracking Modal Stepper */
.tracking-stepper {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 2rem;
}

.tracking-stepper::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 30px;
  right: 30px;
  height: 3px;
  background-color: #e2e8f0;
  z-index: 1;
}

.tracking-step {
  position: relative;
  z-index: 2;
  text-align: center;
  flex: 1;
}

.tracking-step .step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem auto;
  font-weight: 700;
  font-size: 0.85rem;
  color: #64748b;
  transition: all 0.3s ease;
}

.tracking-step.completed .step-circle {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.tracking-step.current .step-circle {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.25);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(2, 132, 199, 0); }
  100% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); }
}

.tracking-step .step-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.2;
}

.tracking-step.current .step-title {
  color: #0284c7;
  font-weight: 700;
}

/* Live Pulse Sync Dot */
.live-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

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

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

/* ====================================================================
   LIVE SEARCH & FILTER CHIPS
   ==================================================================== */
.live-search-wrapper {
  position: relative;
  flex: 1;
}

.live-search-input {
  border-radius: 20px;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
  border: 1.5px solid #cbd5e1;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.live-search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.live-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.live-search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  display: none;
  padding: 0;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.live-search-clear:hover {
  color: #334155;
  background: #e2e8f0;
}

.search-highlight {
  background-color: #fef08a !important;
  color: #854d0e !important;
  font-weight: 700;
  padding: 0 2px;
  border-radius: 2px;
}

/* Quick Filter Chips */
.filter-chips-container {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}

.filter-chips-container::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  user-select: none;
}

.filter-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.filter-chip.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(15, 76, 129, 0.25);
}

/* ====================================================================
   MOBILE RESPONSIVE & ADAPTIVE CARD VIEW
   ==================================================================== */
.item-card {
  background: #ffffff;
  border-radius: var(--card-radius);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.item-card-header {
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.item-card-body {
  padding: 1rem;
}

.item-card-footer {
  padding: 0.75rem 1rem;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Mobile Floating Action Button (FAB) */
.mobile-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 6px 16px rgba(15, 76, 129, 0.35);
  z-index: 1030;
  border: none;
  transition: transform 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.mobile-fab:hover, .mobile-fab:focus {
  background: var(--primary-hover);
  color: #ffffff;
  transform: scale(1.08);
}

/* Mobile Breakpoint Adjustments */
@media (max-width: 991.98px) {
  .navbar-scd {
    padding: 0.5rem 1rem;
  }
  .page-header {
    margin-bottom: 1rem;
  }
  .page-title {
    font-size: 1.25rem;
  }
  .metric-value {
    font-size: 1.6rem;
  }
}

@media (max-width: 767.98px) {
  .mobile-fab {
    display: flex;
  }
  .tracking-stepper {
    flex-direction: column;
    gap: 1rem;
  }
  .tracking-stepper::before {
    display: none;
  }
  .tracking-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
  }
  .tracking-step .step-circle {
    margin: 0;
    flex-shrink: 0;
  }
  .metric-card {
    padding: 0.85rem;
  }
  .metric-value {
    font-size: 1.35rem;
  }
  .metric-icon-box {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
  .table-responsive-desktop {
    display: none !important;
  }
  .cards-mobile-view {
    display: block !important;
  }
}

@media (min-width: 768px) {
  .cards-mobile-view {
    display: none;
  }
  .cards-mobile-view.force-cards {
    display: block !important;
  }
  .table-responsive-desktop.force-hidden {
    display: none !important;
  }
}

/* Purple Badges & Button Utility */
.text-purple { color: #6f42c1 !important; }
.bg-purple-subtle { background-color: #f3e8ff !important; }
.border-purple-subtle { border-color: #d8b4fe !important; }
.btn-outline-purple {
    color: #6f42c1;
    border-color: #6f42c1;
}
.btn-outline-purple:hover {
    color: #ffffff;
    background-color: #6f42c1;
    border-color: #6f42c1;
}
