/* -------------------------------------------------------------
   GLOBAL STYLES
   ------------------------------------------------------------- */
   html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
  }
  
  body {
    background-color: #273459 !important;
    color: #F0F2F6 !important;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow: scroll;
  }
  
  /* -------------------------------------------------------------
     HEADER & FOOTER
     ------------------------------------------------------------- */
  header {
    background-color: #3D518C;
    padding: 20px;
    text-align: center;
  }
  header h1 {
    margin: 0;
    color: #F0F2F6;
  }
  footer {
    display: none !important;
  }
  
  /* -------------------------------------------------------------
     NAVIGATION LINKS
     ------------------------------------------------------------- */
  nav {
    margin-top: 10px;
    text-align: center;
  }
  nav a {
    margin: 0 15px;
    text-decoration: none;
    color: #F2F4FF;
    font-weight: bold;
  }
  nav a:hover {
    color: #F6F8FA;
  }
  
  /* -------------------------------------------------------------
     DROPDOWN STYLING
     ------------------------------------------------------------- */
  .dropdown {
    display: inline-block;
    position: relative;
  }
  
  .dropdown-toggle {
    background: none;
    border: none;
    color: #F2F4FF;
    font-weight: bold;
    margin: 0 15px;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }
  
  .dropdown-toggle:hover {
    color: #F6F8FA;
  }
  
  .arrow {
    transition: transform 0.3s;
  }
  
  .arrow.rotate {
    transform: rotate(180deg);
  }
  
  .dropdown-menu {
    display: none;                     /* hide by default */
    position: absolute;
    background-color: #F0F2F6;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-top: 5px;
    padding: 10px 0;
    list-style: none;
    text-align: left;
    min-width: 200px;
    z-index: 1000;
  }
  
  .dropdown-menu.show {
    display: block;                    /* show only when .show is toggled */
  }
  
  .dropdown-item {
    padding: 10px 20px;
    color: #273459;
    text-decoration: none;
    display: block;
  }
  
  .dropdown-item:hover {
    background-color: #DEE2E6;
  }
  
  /* -------------------------------------------------------------
     MAIN CONTENT
     ------------------------------------------------------------- */
  main {
    padding: 20px;
    height: calc(100% - 160px);
    overflow: auto;
  }
  
  /* -------------------------------------------------------------
     TABULATOR (TABLE) STYLING
     ------------------------------------------------------------- */
  .tabulator {
    background-color: #F6F8FA;
    border: 1px solid #DEE2E6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    color: #273459;
  }
  
  .tabulator .tabulator-header {
    background-color: #F2F4FF;
    border-bottom: 1px solid #DEE2E6;
    padding: 4px;
  }
  
  .tabulator .tabulator-header .tabulator-col {
    background-color: #F2F4FF;
    border-right: 1px solid #DEE2E6;
    padding: 8px;
  }
  
  .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {
    background-color: #DEE2E6;
  }
  
  .tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    padding: 6px;
  }
  
  .tabulator .tabulator-header .tabulator-col .tabulator-col-title {
    font-weight: 600;
    color: #273459;
  }
  
  .tabulator .tabulator-row {
    border-bottom: 1px solid #DEE2E6;
  }
  
  .tabulator .tabulator-row.tabulator-row-even {
    background-color: #F6F8FA;
  }
  
  .tabulator .tabulator-row.tabulator-row-odd {
    background-color: #FFFFFF;
  }
  
  .tabulator .tabulator-row:hover {
    background-color: #F0F2F6 !important;
  }
  
  .discrepancy {
    background-color: #ffe6e6 !important;
    position: relative;
  }
  .discrepancy::before {
    content: "⚠️";
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #d32f2f;
  }
  .discrepancy .tabulator-cell {
    background-color: #ffe6e6 !important;
    color: #d32f2f !important;
    font-weight: bold;
  }
  
  .selected-row {
    background-color: #273459 !important;
    color: #F0F2F6 !important;
  }
  .selected-row:hover {
    background-color: #273459 !important;
  }
  
  /* -------------------------------------------------------------
     METRICS STYLING (FOR SMALL INFO BOXES)
     ------------------------------------------------------------- */
  .metrics-container {
    position: absolute;
    right: 60px;
    top: 160px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
  }
  
  .metric {
    padding: 8px 20px;
    border-radius: 6px;
    min-width: 200px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    margin-left: auto;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .total-items {
    background-color: rgba(40, 167, 69, 0.1);
    border: 1.5px solid #28a745;
    color: #28a745;
  }
  .total-errors {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1.5px solid #dc3545;
    color: #dc3545;
  }
  .correct-cleanup {
    background-color: rgba(23, 162, 184, 0.1);
    border: 1.5px solid #17a2b8;
    color: #17a2b8;
  }
  
  .metric:hover {
    transform: translateX(-5px);
    transition: transform 0.2s ease;
  }
  
  #combinedTable {
    overflow: auto;
  }
  
  .tabulator-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .tabulator-cell:focus {
    outline: 2px solid #2196f3;
    background-color: #e3f2fd !important;
    color: #000000 !important;
  }
  
  /* -------------------------------------------------------------
     TABLE (BOOTSTRAP-LIKE) STYLING
     ------------------------------------------------------------- */
  .table thead th {
    background-color: #3D518C !important;
    color: #F0F2F6 !important;
    padding: 8px 6px !important;
    font-size: 11px !important;
    text-align: center !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    white-space: nowrap !important;
  }
  
  .table thead th:nth-child(1),
  .table thead th:nth-child(2) {
    min-width: 60px !important;
    width: 60px !important;
  }
  .table thead th:nth-child(3) {
    min-width: 300px !important;
    width: 300px !important;
  }
  .table thead th:nth-child(4),
  .table thead th:nth-child(5),
  .table thead th:nth-child(6),
  .table thead th:nth-child(7) {
    min-width: 80px !important;
    width: 80px !important;
  }
  .table thead th:nth-child(8) {
    min-width: 250px !important;
    width: 250px !important;
  }
  
  .table thead th {
    min-width: 100px !important;
    width: 100px !important;
  }
  
  .table tbody td {
    background-color: #F6F8FA !important;
    color: #273459 !important;
    padding: 8px 6px !important;
    text-align: center !important;
    white-space: nowrap !important;
  }
  
  table.table tbody td.mismatch-cell {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    font-weight: bold;
  }
  
  .table-responsive {
    overflow-x: auto !important;
    overflow-y: auto !important;
    max-width: none !important;
    height: calc(100vh - 150px) !important;
  }
  
  .table {
    width: max-content !important;
    table-layout: fixed !important;
    margin-bottom: 0 !important;
  }
  
  .container {
    max-width: none !important;
    width: auto !important;
    padding: 0 !important;
  }
  
  .mismatch-ds {
    background-color: #ff000033 !important;
  }
  .mismatch-qa {
    background-color: #ff000066 !important;
  }
  
  /* -------------------------------------------------------------
     RESPONSIVE ADJUSTMENTS FOR DROPDOWN
     ------------------------------------------------------------- */
  @media (max-width: 768px) {
    nav a, .dropdown-toggle {
      display: block;
      margin: 10px 0;
    }
    .dropdown-menu {
      position: static;
      box-shadow: none;
      border-radius: 0;
      padding: 0;
      min-width: 100%;
    }
    .dropdown-menu.show {
      display: block;
    }
  }
  
  /* -------------------------------------------------------------
     CUSTOM BUTTON SPACING FOR FILTER BAR
     ------------------------------------------------------------- */
  .mb-3 > .btn {
    margin-right: 10px;
  }
  
  /* -------------------------------------------------------------
     COMPACT STATUS COLUMN WIDTH (Overrides for 3rd Table Column)
     ------------------------------------------------------------- */
  .table thead th:nth-child(3),
  .table tbody td:nth-child(3) {
    min-width: 40px !important;
    width: 40px !important;
    padding: 2px 4px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  /* -------------------------------------------------------------
     SET WIDTH FOR 4TH COLUMN (Mx Provided Item Name)
     ------------------------------------------------------------- */
  .table thead th:nth-child(4),
  .table tbody td:nth-child(4) {
    min-width: 350px !important;
    width: 350px !important;
  }
  
  /* -------------------------------------------------------------
     FREEZE FIRST 4 DATA CELLS (ONLY BODY CELLS MOVE HORIZONTALLY)
     ------------------------------------------------------------- */
  .table tbody td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #F6F8FA;
  }
  .table tbody td:nth-child(2) {
    position: sticky;
    left: 60px;
    z-index: 1;
    background: #F6F8FA;
  }
  .table tbody td:nth-child(3) {
    position: sticky;
    left: 120px;
    z-index: 1;
    background: #F6F8FA;
  }
  .table tbody td:nth-child(4) {
    position: sticky;
    left: 160px; /* Updated left offset based on real widths */
    z-index: 1;
    background: #F6F8FA;
  }
  
  /* -------------------------------------------------------------
     FREEZE FIRST FOUR HEADER COLUMNS (Source, Counter, Status, Item Name)
     ------------------------------------------------------------- */
  .table thead th:nth-child(-n+4) {
    position: sticky !important;
    top: 0 !important;
    z-index: 11 !important;
    background-color: #3D518C !important;
  }
  .table thead th:nth-child(1) { left:   0 !important; }
  .table thead th:nth-child(2) { left:  60px !important; }
  .table thead th:nth-child(3) { left: 120px !important; }
  .table thead th:nth-child(4) { left: 160px !important; }
  
  /* -------------------------------------------------------------
     OVERRIDE FOR BRAND PATH COLUMN (5th):
     FIXED WIDTH + WRAPPING + NO OVERFLOW + TOP ALIGN
     ------------------------------------------------------------- */
  /* Body cells wrap & grow vertically */
  .table tbody td:nth-child(5) {
    min-width: 200px !important;
    width:     200px !important;
    white-space: normal !important;
    word-wrap:   break-word !important;
    word-break:  break-word !important;
    overflow:    hidden !important;
    vertical-align: top !important;
  }
  /* Header stays single-line and ellipsizes */
  .table thead th:nth-child(5) {
    min-width: 200px !important;
    width:     200px !important;
    white-space: nowrap !important;
    overflow:    hidden !important;
    text-overflow: ellipsis !important;
  }
  
  /* -------------------------------------------------------------
     OVERRIDE FOR CATEGORY PATH COLUMN (6th):
     FIXED WIDTH + WRAPPING + NO OVERFLOW + TOP ALIGN
     ------------------------------------------------------------- */
  .table thead th:nth-child(6),
  .table tbody td:nth-child(6) {
    min-width: 250px !important;
    width:     250px !important;
    /* wrap long text only in body cells */
    white-space: normal !important;
    word-wrap:   break-word !important;
    word-break:  break-word !important;
    /* hide overflow and grow vertically */
    overflow:    hidden !important;
    vertical-align: top !important;
  }
  /* keep header single-line and ellipsize if too long */
  .table thead th:nth-child(6) {
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }
  
  /* -------------------------------------------------------------
     WRAP BODY TEXT FOR ALL COLUMNS FROM 7th ONWARD
     (keep their widths as-is, but allow multi-line)
     ------------------------------------------------------------- */
  .table tbody td:nth-child(n+7) {
    white-space: normal !important;
    word-wrap:   break-word !important;
    word-break:  break-word !important;
    overflow:    hidden !important;
    vertical-align: top !important;
  }
  
  /* KEEP TH HEADERS SINGLE LINE WITH ELLIPSIS */
  .table thead th:nth-child(n+7) {
    white-space: nowrap !important;
    overflow:    hidden !important;
    text-overflow: ellipsis !important;
  }
  
  /* -------------------------------------------------------------
     ADJUST STATUS COLUMN (3rd) WIDTH & STICKY OFFSETS
     ------------------------------------------------------------- */
  /* 3rd column: fixed 80px, no wrap, middle align */
  .table thead th:nth-child(3),
  .table tbody td:nth-child(3) {
    min-width: 80px !important;
    width:     80px !important;
    white-space: nowrap !important;
    overflow:    hidden !important;
    text-overflow: ellipsis !important;
    vertical-align: middle !important;
  }
  /* reposition the sticky “left” values */
  /* col1: 0, col2: 60 (unchanged) => col3 left: 60+60=120 */
  .table tbody td:nth-child(3) {
    left: 120px;
  }
  .table thead th:nth-child(3) {
    left: 120px !important;
  }
  /* col4 now sits after col3’s 80px: 120+80=200 */
  .table tbody td:nth-child(4) {
    left: 200px;
  }
  .table thead th:nth-child(4) {
    left: 200px !important;
  }
  
  /* -------------------------------------------------------------
     FIXED WIDTH FOR TABULATOR “GROUP” ROWS (YOUR SUMMARY TOGGLE)
     ------------------------------------------------------------- */
  .tabulator-row-group,
  .tabulator .tabulator-group {
    width: 100% !important;
  }
  .tabulator-row-group .tabulator-col,
  .tabulator .tabulator-group .tabulator-col {
    width: 100% !important;
    box-sizing: border-box;
  }
  
  /* -------------------------------------------------------------
   FORCE ERROR TABLE TO FULL WIDTH
   ------------------------------------------------------------- */
  .table-responsive {
    /* fill its parent container */
    width: 100% !important;
  }
  .table {
    /* override max-content shrink */
    width: 100% !important;
    /* let browser distribute column widths automatically */
    table-layout: auto !important;
  }
  

  /* -------------------------------------------------------------
   BRAND PATH TOOL SELECTION HIGHLIGHT
   ------------------------------------------------------------- */
.brand-card.selected {
  background-color: #cceeff !important;
  font-weight: bold;
}
/* -------------------------------------------------------------
   TOAST NOTIFICATION FOR COPY CONFIRMATION
   ------------------------------------------------------------- */
   #toast {
    visibility: hidden;
    min-width: 200px;
    margin-left: -100px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 10px 16px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    bottom: 30px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.5s ease, bottom 0.5s ease;
  }
  
  #toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 60px;
  }

  