 :root {
  --primary-blue: #0078d7;
  --medium-blue: #005a9e;
  --light-blue: #e6f3ff;
  --neu-bg: #e8ecf3;
  --neu-shadow-dark: #d1d9e6;
  --neu-shadow-light: #ffffff;
}
.typeahead-wrapper:focus{
        outline: 2px solid black; 
    outline-offset: 2px;
}
input:focus { background-color: rgb(216, 235, 240) !important; }
    #loading-wrapper {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 5000;
        background: rgba(0, 0, 0, .95); color: #ffffff;
        display: flex; align-items: center; justify-content: center; flex-direction: column;
        font-size: 1rem;
    }
    #loading-wrapper .spinner-border {
        width: 5rem; height: 5rem; color: #1273eb; border-width: .7em; margin-bottom: 10px;
    }
    input:focus, select:focus, textarea:focus { background-color: #e6ffe6; }
    .form-column-3 .input-row input:focus { background-color: #e6ffe6; }
    .form-column-1 .input-row input:focus { background-color: #e6ffe6; }
    .typeahead-wrapper input:focus { background-color: #e6ffe6; }
    
    .nav-grid {
        border-top: 1px solid #ccc; border-bottom: 1px solid #ccc;
        background: #fff; display: flex; position: relative;
    }
    .nav-item { position: relative; flex: 1; }
    .nav-item > a {
        display: flex; flex-direction: row; align-items: center;
        justify-content: center; gap: 8px; padding: 12px 0;
        color: black; text-decoration: none; font-weight: 500;
        border-right: 1px solid #ddd; transition: background 0.2s;
        white-space: nowrap; width: 100%;
    }
    .nav-item:last-child > a { border-right: none; }
    .nav-item > a:hover { background-color: #f1f1f1; }
    .nav-grid i { font-size: 18px; color: #0a73c6; }
    
    .dropdown-menu {
        position: absolute; top: 100%; left: 0; right: 0;
        background: white; border: 1px solid #ddd;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        display: none; z-index: 1000; min-width: 200px;
    }
    .nav-item:hover .dropdown-menu { display: block; }
    .dropdown-menu a {
        display: flex; align-items: center; gap: 8px;
        padding: 10px 15px; color: #333; text-decoration: none;
        font-size: 14px; font-weight: 400; transition: background 0.2s;
        border-bottom: 1px solid #eee;
    }
    .dropdown-menu a:last-child { border-bottom: none; }
    .dropdown-menu a:hover { background-color: #f8f9fa; color: #0a73c6; }
    .dropdown-menu i { font-size: 14px; color: #666; width: 16px; }
    .dropdown-menu a:hover i { color: #0a73c6; }
    
    .main-content {
        padding: 20px;
        background: linear-gradient(to bottom, #e6f3ff 0%, #cce7ff 100%);
        min-height: 500px;
    }
    .content-box {
        background: white; border: 1px solid #ddd;
        border-radius: 4px; padding: 20px; text-align: center;
    }

    /* Typeahead Styling */
    .typeahead {
        background-image: url('data:image/svg+xml;utf8,<svg fill="gray" height="100" viewBox="0 0 24 24" width="100" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') !important;
        background-repeat: no-repeat !important;
        background-position: right 10px center !important;
        background-size: 24px 24px !important;
        padding-right: 40px !important;
        cursor: pointer !important;
        border: 2px solid #7e9db9;
        border-radius: 2px;
        height: 30px;
        font-size: 14px;
    }
    .typeahead:focus { background-color: #e6ffe6; border-color: #28a745; }
    .typeahead-wrapper { position: relative; display: inline-block; }
    
    .tt-menu {
        width: 250px; max-height: 170px; overflow-y: auto;
        background-color: lightcyan; border-radius: 0px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        margin-top: -6px; position: absolute; top: 100%;
        left: 0; z-index: 9999; padding: 0;
        transition: none !important;
        overflow-x: hidden; visibility: visible;
    }
    .typeahead:focus + .twitter-typeahead .tt-menu,
    .typeahead-wrapper .typeahead:focus ~ .tt-menu {
        display: block !important; visibility: visible !important;
    }
    .tt-wrapper-150 .tt-menu { width: 150px !important; }
    .tt-wrapper-250 .tt-menu { width: 370px !important; }
    
    .tt-menu::-webkit-scrollbar { width: 8px; }
    .tt-menu::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
    .tt-menu::-webkit-scrollbar-thumb {
        background-color: #7e7e7e; border-radius: 4px; border: 2px solid #f1f1f1;
    }
    .tt-menu::-webkit-scrollbar-thumb:hover { background-color: #7e7e7e; }
    
    .tt-suggestion {
        padding: 5px 6px; cursor: pointer; font-size: 15px;
        color: #333; background-color: lightcyan;
        border-bottom: 1px solid #05050554 !important;
        transition: background-color 0.2s, color 0.2s;
    }
    .tt-suggestion:last-child { border-bottom: none; }
    .tt-suggestion:hover, .tt-suggestion.tt-cursor {
        background-color: #7e7e7e; color: #ffffff; font-weight: 700;
        border-left: 5px solid #7e7e7e; padding-left: 2px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }
    .tt-suggestion:active { background: #7e7e7e; transform: translateX(2px); }
    
    .form-group { position: relative; }
    .form-group .typeahead-wrapper { width: 100%; }
    .product-input-row .typeahead-wrapper { position: relative; z-index: 1000; }
    .product-input-row .tt-menu {
        position: absolute; z-index: 9999; top: 100%; left: 0; min-width: 200px;
    }
    .toolbar-btn { padding: 4px 12px !important; font-size: 12px !important; }
  body {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
     /*background: linear-gradient(to bottom, #e6f3ff 0%, #cce7ff 100%); */
     }

     .top-header {
            background-color: #0a73c6;
            color: white;
            padding: 10px 20px;
        }
        .logo-text {
            font-size: 24px;
            font-weight: bold;
        }
        .user-info img {
            width: 30px;
        }
        .user-info span {
            color: lightgreen;
            font-weight: 500;
        }
      .app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.main-content-wrapper {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 8px solid var(--primary-blue);
  height: calc(100vh - 0px);
  overflow-y: auto;
  padding: 2px;
}

.main-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

/* Header & Navigation Bar */
.top-header {
  background: linear-gradient(135deg, var(--primary-blue), var(--medium-blue));
  color: white;
  padding: 8px 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-icons-container {
  background: white;
  border-bottom: 2px solid #e0e0e0;
  padding: 2px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  padding: 0 15px;
}

.nav-icon-wrapper {
  position: relative;
}

.nav-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 8px;
  min-width: 64px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
  text-decoration: none;
  background-color: var(--primary-blue);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 120, 215, 0.2);
}

.nav-icon-item:hover {
  background-color: var(--medium-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 120, 215, 0.4);
}

.nav-icon-item i {
  font-size: 24px;
  color: white;
  margin-bottom: 4px;
}

.nav-icon-item span {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1px solid #ddd;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  display: none;
  z-index: 1000;
  border-radius: 8px;
  min-width: 150px;
}

.nav-icon-wrapper:hover .dropdown-menu {
  display: block;
  animation: slideDown 0.3s ease;
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
}

.dropdown-menu a:hover {
  background-color: var(--light-blue);
  color: var(--primary-blue);
}

.dropdown-menu a:last-child {
  border-bottom: none;
}
 

        .main-container {
            flex-grow: 1;
            /* background: linear-gradient(to bottom, #e6f3ff 0%, white 100%); */
            padding: 2px;
        }
.toolbar-section {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 1px 15px;
    margin-bottom: 2px;
    border-radius: 4px;
    /* Updated for layout */
    display: flex; 
    justify-content: space-between; /* Pushes btn-group and h3 to the edges */
    align-items: center; 
    /* Existing styles */
    font-size: 14px;
    font-weight: 500;
    gap: 10px; /* Keep the existing gap for internal elements */
}

/* New CSS for the Sales Dashboard title */
.dashboard-title {
margin: 0;
    padding: 2px 15px;
    border-radius: 4px;
    color: white;
    font-size: 2.0em;
    width: 300px;
    display: flex;
    justify-content: center;
    font-weight: 700;
    background: linear-gradient(to right, #0078d7 0%, #2575fc 100%);
    border: 1px solid #0078d7;
    flex-shrink: 0;
}

   .toolbar-btn {
    background: #ffe9d8;
    color: black;
    padding: 2px 12px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 0px;
    cursor: pointer;
    text-transform: uppercase;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;


}
        .toolbar-btn.active {
            background: #0a73c6;
            border-color: #085a9c;
            width: 340px;
        }
        .sale-header {
            background: linear-gradient(135deg, #dc3545, #c82333);
            color: white;
            text-align: center;
            padding: 8px;
            font-weight: bold;
            font-size: 16px;
            letter-spacing: 1px;
            margin-bottom: 15px;
            border-radius: 4px;
        }

        .left-content {
            background:white;
            border: 1px solid #ccc;
            border-radius: 4px;
            padding: 4px;
            height: 100%;
        }

        .right-content {
            background: #f8f9fa;
            border: 1px solid #ccc;
            border-radius: 4px;
            padding: 10px;
        }

        .top-form-section {
            display: flex;
            gap: 8px;
            margin-bottom: 4px;
            background:#ffffff;
            padding: 5px;
            border-radius: 4px;
            border: 2px solid #7aa3c1;
            height: 190px;
        }
        .form-column-1, .form-column-2, .form-column-3 {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: #9fc1d9;
            border: 1px solid #7aa3c1;
            padding: 8px;
            border-radius: 3px;
        }
        .form-column-1 {
            flex: 0 0 140px;
            font-size: 14px;
            font-weight: 500;
        }
        .form-column-1 .form-input-box {
            background: #fff3cd;
            border: 1px solid #f39c12;
            font-weight: bold;
            font-size: 14px;
            height: 32px;
            text-align: center;
            margin-bottom: 8px;
            padding: 2px 4px;
        }
        .form-column-1 .input-row {
            display: flex;
            align-items: center;
            gap: 5px;
            margin-bottom: 3px;
        }
        .form-column-1 .input-label {
            font-size: 12px;
            font-weight: bold;
            color: #333;
            min-width: 50px;
        }
        .form-column-1 .input-small {
            background: white;
            border: 1px solid #999;
            font-size: 14px;
            height: 28px;
            padding: 1px 3px;
            border-radius: 2px;
            flex: 1;
        }
        .form-column-2 .form-select-main, .form-column-2 input {
            background: #ffe9d8;
            border: 1px solid #999;
            font-weight: bold;
            font-size: 14px;
            height: 34px;
            margin-bottom: 2px;
            border-radius: 2px;
        }
        .form-column-2 input {
            background: white;
            font-weight: normal;
            height:28px;
        }
        /* Restored styles for Form Column 3 */
        .form-column-3 .input-row {
            display: flex;
            align-items: center;
            gap: 5px;
            margin-bottom: 3px;
        }
        .form-column-3 .input-label {
            font-size: 11px;
            font-weight: bold;
            color: #333;
            min-width: 50px;
            flex: 0 0 auto;
        }
        .form-column-3 .input-small {
            background: white;
            border: 1px solid #999;
            font-size: 14px;
            height: 28px;
            padding: 1px 3px;
            border-radius: 2px;
            flex: 1;
        }
        .form-column-3 .rate-display {
            background: white;
            border: 1px solid #999;
            font-size: 14px;
            height: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            border-radius: 2px;
            padding: 1px 3px;
            min-width: 60px;
        }
        .form-column-3 .input-small.select {
            background: #ffe9d8;
            height: 32px;
        }
        /* Typeahead and Scrollable Dropdown Styles */
        #scrollable-dropdown-menu .tt-dropdown-menu {
            max-height: 150px;
            overflow-y: auto;
            background: white;
            border: 1px solid #ccc;
            padding: 5px;
            border-radius: 4px;
        }
        #scrollable-dropdown-menu .tt-suggestion {
            padding: 5px 10px;
            font-size: 14px;
            cursor: pointer;
        }
        #scrollable-dropdown-menu .tt-suggestion:hover,
        #scrollable-dropdown-menu .tt-suggestion.tt-cursor {
            background-color: #f1f1f1;
        }
        .form-column-3 .typeahead-wrapper {
            position: relative;
            flex: 1;
        }
        .form-column-3 .typeahead-wrapper .typeahead {
            background: #ffe9d8;
            border: 1px solid #999;
            font-weight: bold;
            font-size: 14px;
            height: 34px;
            padding: 2px 5px;
            border-radius: 2px;
            width: 100%;
        }

        /* Product Entry Table */
        .product-table {
            width: 100%;
            border-collapse: collapse;
            margin: 4px 0;
            background: white;
            border: 1px solid #999;
            font-size: 14px;
        }
        .product-table th {
            background: linear-gradient(135deg, #6c757d, #495057);
            color: white;
            padding: 8px 4px;
            text-align: center;
            border: 1px solid #999;
            font-size: 14px;
            font-weight: bold;
        }
        .product-table td {
            padding: 4px;
            border: 1px solid #ccc;
            text-align: center;
            height: 30px;
        }
        .product-table input {
            width: 100%;
            border: none;
            background: transparent;
            padding: 0px 4px;
            font-size: 14px;
            text-align: center;
        }
        .product-table input:focus {
            background: #fff3cd;
            outline: 1px solid #f39c12;
        }
        /* New Input Row */
        .product-input-row {
            display: flex;
            flex-wrap: nowrap;
            justify-content: space-between;
            align-items: flex-end;
            background: #fff;
            border: 1px solid #ccc;
            margin-bottom: 4px;
            border-radius: 4px;
            font-size: 14px;
            font-weight: bold;
            padding: 5px;
            gap: 5px;
        }
        .product-input-row .input-group {
            display: flex;
            flex-direction: column;
            box-sizing: border-box;
            border: 1px solid #ddd;
            border-radius: 3px;
            padding: 5px;
            background: #f8f9fa;
        }
        .product-input-row label {
            text-align: center;
            margin-bottom: 3px;
            white-space: nowrap;
        }
        .product-input-row input, .product-input-row select {
            border: 1px solid #999;
            height: 25px;
            padding: 2px 5px;
            font-size: 10px;
            box-sizing: border-box;
            min-width: 0;
            width: 100%;
        }
        .product-input-row select {
            background: #fff3cd;
        }
        
        .product-input-row .input-group:nth-child(1) { width: 12%; }
        .product-input-row .input-group:nth-child(2) { width: 25%; }
        .product-input-row .input-group:nth-child(3) { width: 6%; }
        .product-input-row .input-group:nth-child(4) { width: 6%; }
        .product-input-row .input-group:nth-child(5) { width: 6%; }
        .product-input-row .input-group:nth-child(6) { width: 6%; }
        .product-input-row .input-group:nth-child(7) { width: 8%; }
        .product-input-row .input-group:nth-child(8) { width: 9%; }
        .product-input-row .input-group:nth-child(9) { width: 10%; }
        .product-input-row .input-group:nth-child(10) { width: 12%; }
        
        .bottom-section {
            background: #9fc1d9;
            border: 1px solid #ccc;
            border-radius: 4px;
            padding: 10px;
            margin-top: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .bottom-section .left-side,
        .bottom-section .right-side {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .bottom-section .left-side .btn {
            padding: 8px 12px;
            font-size: 14px;
            background: #fff;
            border: 1px solid #999;
            border-radius: 3px;
        }
        .bottom-section .left-side input {
            height: 30px;
            border: 1px solid #999;
            border-radius: 3px;
        }
        .bottom-section .right-side span {
            font-size: 14px;
            font-weight: bold;
            color: #333;
        }
        .bottom-section .right-side input {
            width: 60px;
            height: 25px;
            border: 1px solid #999;
            border-radius: 2px;
            padding: 2px 5px;
        }
        .bottom-section .right-side input[type="text"] {
            width: 80px;
        }
        .bottom-section .right-side input[type="text"][disabled] {
            background-color: #e9ecef;
        }

        /* Right Panel - Sales List (New) */
        .sales-list-container {
            max-height: 400px;
            overflow-y: auto;
            border: 1px solid #999;
            border-radius: 4px;
            margin-bottom: 15px;
            background: white;
            padding: 10px;
        }
        .sales-list-top {
            display: flex;
            gap: 5px;
            margin-bottom: 5px;
        }
        .sales-list-top button {
            flex: 1;
            background-color: #ccc;
            color: black;
            border: 1px solid #999;
            font-size: 14px;
            padding: 5px 0;
            border-radius: 3px;
        }
        .sales-list-top button.active {
            background-color: #0a73c6;
            color: white;
            border-color: #085a9c;
        }
        .sales-list-table-wrapper {
            border: 1px solid #999;
            height: 250px;
            overflow-y: auto;
        }
        .sales-list-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 14px;
        }
        .sales-list-table th,
        .sales-list-table td {
            border: 1px solid #ccc;
            padding: 2px;
            text-align: center;
        }
        .sales-list-table th {
            background-color: #a8c8e0;
            font-weight: bold;
            position: sticky;
            top: 0;
        }
        .sales-list-table tbody tr:nth-child(even) {
            background-color: #f2f2f2;
        }

        /* Totals Section */
        .totals-section {
            background: #e9ecef;
            border: 1px solid #ccc;
            padding: 5px;
            border-radius: 4px;
        }
        .total-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 5px;
            font-size: 14px;
        }
        .total-label {
            background: #f7b2a7;
            padding: 1px 8px;
            border-radius: 2px;
            font-weight: bold;
            min-width: 131px;
            text-align: center;
            font-size: 14px;
        }
        .total-input {
            background: #ffe9d8;
            border: 1px solid #999;
            padding: 1px 6px;
            width: 130px;
            text-align: right;
            font-size: 14px;
            border-radius: 2px;
        }
        .total-input.readonly {
            background: #f8f9fa;
            color: #495057;
            font-weight: bold;
        }
        .footer-shortcuts {
            background-color: #f1f1f1;
            border-top: 1px solid #ccc;
            padding: 10px 0;
            text-align: center;
            margin-top: auto;
        }
        .footer-shortcuts span {
            background-color: #ffffff;
            border: 1px solid #ccc;
            padding: 6px 12px;
            border-radius: 5px;
            margin: 5px;
            display: inline-block;
            font-size: 14px;
        }
        /* Responsive */
        @media (max-width: 767px) {
            .top-header .logo-text, .top-header .user-info {
                width: 100%;
                text-align: center;
                margin-bottom: 5px;
            }
            .nav-grid a {
                font-size: 13px;
                padding: 10px 0;
            }
            .footer-shortcuts span {
                font-size: 14px;
                padding: 4px 8px;
            }
            .content-row {
                flex-direction: column;
            }
            .right-content {
                width: 100%;
            }
        }
    

        .sidebar-button {
  width: 100%;
  padding: 2px 10px;
  border: none;
  background: white;
      margin-left: 9px;

  color: #333;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 6px;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.1), -4px -4px 8px #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sidebar-button:hover {
  background: var(--primary-blue);
  color: white;
  transform: translateY(-2px);
  box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.2), -6px -6px 12px #fff;
}

.sidebar-button:active {
  transform: translateY(0);
  box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.2), inset -2px -2px 5px #fff;
}

/* Sidebar Button Icons */
.sidebar-button span {
  font-size: 12px;
}
.sidebar-button::before {
  content: "";
  font-size: 20px;
}

.sidebar-button[onclick="updateRow()"]::before {
  content: "🔄";
}
.sidebar-button[onclick="saveProduct()"]::before {
  content: "💾";
}
.sidebar-button[onclick="deleteRow()"]::before {
  content: "🗑️";
}
.sidebar-button[onclick="findProduct()"]::before {
  content: "🔍";
}
.sidebar-button[onclick="refreshTable()"]::before {
  content: "🔃";
}
.sidebar-button[onclick="closeForm()"]::before {
  content: "❌";
}
