/* Import a calligraphy-style font (you can change to your favorite later) */
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Poppins:wght@300;400;600&display=swap');

/* --- COLOR PALETTE & MODERN STYLES --- */
/* PRIMARY ACCENT: Deep Green (#095d40) */
/* SECONDARY ACCENT: Gold/Mustard (#c9a227) */
/* BACKGROUND: Pure White (#ffffff) */

body {
  font-family: "Poppins", sans-serif;
  background: #ffffff; /* PURE WHITE background */
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 80vh;
  color: #095d40; /* PRIMARY ACCENT: Deep Green text */
  padding-top: 90px;
}

/* Header */
header {
  background: #095d40; /* Solid Deep Green header */
  color: white;
  padding: 1rem 1.5rem; /* Increased padding */
  box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Lighter shadow */
  
  position: fixed; /* Fixes the element relative to the viewport */
  top: 0;           /* Positions it at the very top */
  left: 0;          /* Positions it at the very left */
  width: 97%;       /* Ensures it spans the full width of the screen */
  z-index: 1000;    /* Ensures the header stays above all other content */
  
  /* CRITICAL FIX: Force GPU Acceleration */
  transform: translateZ(0); /* Or translate3d(0, 0, 0) */
  backface-visibility: hidden; /* Recommended alongside translateZ */
}

/* Main title */
header h1 {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 2.7rem; 
  line-height: 1.2;
}

/* 'by Vanie' - MODERN CHANGE: Aligned with main title, lighter font */
header h1 .by-vanie {
  display: block;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  font-weight: 400; /* Lighter weight */
  color: #f5f5f5;
  /* Removed unused padding-left: 190px; */
  margin-top: -5px; 
  padding-left: 200px; /* REMOVED: No more right shift */
}

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

.header-title {
  /* CRITICAL: Use Flexbox to align the logo and title horizontally */
  display: flex;
  align-items: center; /* Vertically centers the logo with the h1 text */
  gap: 15px; /* Adds space between the logo and the text */
  
  text-align: left; /* Ensures the text is left-aligned within the title area */
  flex: 1; 
}

/* New CSS to style the Logo Image */
.header-logo {
  /* Adjust these values to control the size of your logo */
  width: 55px; 
  height: 55px; 
  object-fit: contain; /* Ensures the image scales without cropping */
  border-radius: 50%; /* Optional: Makes the logo round */
  flex-shrink: 0; /* Prevents the image from shrinking on smaller screens */
}

#admin-label {
  font-size: 0.9rem;
  color: #f5f5f5; /* Contrast on green header */
  margin-bottom: 4px;
  vertical-align: bottom;
}

/* Account Menu Container (For MyAccount button + Dropdown) */
.account-menu-container {
  /* CRITICAL: Set to relative for dropdown positioning */
  position: relative;
  display: flex;
  flex-direction: column;  
  align-items: flex-end;   
  gap: 0.3rem; 
  /* Ensures the button and dropdown are aligned to the right */
}

/* --- My Account Button Styles (reusing old logout styles) --- */
#myaccount-btn {
  padding: 6px 14px;
  font-size: 0.9rem;
  border: 1px solid white; 
  border-radius: 8px; 
  background-color: transparent; 
  color: white; 
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

#myaccount-btn:hover,
#myaccount-btn.active { /* Add active class for visual feedback when open */
  background-color: white; 
  color: #095d40; 
}

/* --- Dropdown Menu Styles --- */
.account-dropdown {
  /* CRITICAL: Positioning */
  position: absolute;
  top: 100%; /* Position below the button */
  right: 0; 
  
  /* Styling */
  background-color: #ffffff; /* White background */
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 1001; /* Above the header (1000) */
  
  /* Layout */
  display: none; /* CRITICAL: Hidden by default */
  flex-direction: column;
  padding: 5px 0;
  margin-top: 5px; /* Small gap between button and menu */
}

.account-dropdown a {
  cursor: pointer;
}

/* Individual Dropdown Items */
.dropdown-item {
  color: #095d40; /* Deep Green text */
  padding: 10px 15px;
  text-decoration: none; /* Remove underline */
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.15s;
}

.dropdown-item:hover {
  background-color: #f0f0f0; /* Light gray hover */
}

/* Logout Item specific styling (to make it stand out) */
.logout-item {
  border-top: 1px solid #eee;
  color: #e74c3c; /* Red for logout */
  margin-top: 5px;
  padding-top: 10px;
}

.logout-item:hover {
  background-color: #f9e3e3; /* Light red background on hover */
}

/* Class to show the dropdown (controlled by JavaScript) */
.account-dropdown.show {
  display: flex;
}

#myaccount-btn {
  padding: 6px 14px; /* Slightly larger button */
  font-size: 0.9rem;
  border: 1px solid white; /* White border for contrast */
  border-radius: 8px; /* More rounded */
  background-color: transparent; /* Transparent background */
  color: white; /* White text */
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

#myaccount-btn:hover {
  background-color: white; /* White background on hover */
  color: #095d40; /* Deep Green text on hover */
}

/* --- TABS (STICKY) --- */
.tabs {
  display: flex;
  gap: 15px;

  /* CRITICAL STICKY PROPERTIES */
  position: sticky; /* Makes the element sticky */
  top: 100px;        /* CRITICAL: Must be greater than the header's height (~100px) */
  z-index: 999;     /* Keeps the tabs above the scrolling content */

  /* Original styling, slightly adjusted for sticky behavior */
  background: #ffffff; /* Must have a background to hide scrolling content */
  margin: 0 2rem;       /* Adjusted margin to work with sticky positioning */
  padding: 0.3rem 0;      /* Added vertical padding for spacing */
  
  /* CRITICAL FIX: Force GPU Acceleration */
  transform: translateZ(0); /* Or translate3d(0, 0, 0) */
  backface-visibility: hidden;
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background: #f0f0f0;
  color: #095d40;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tab-btn.active {
  background: #095d40;
  color: white;
  box-shadow: 0 4px 8px rgba(9, 93, 64, 0.2);
}

.tab-btn:hover:not(.active) {
  background: #e0e0e0;
}

.tab-content {
  /* This margin ensures content aligns below the sticky tabs */
  margin: 1.5rem 2rem;
}

/* --- PRODUCTS SECTION --- */
.products-section {
  padding: 1.5rem;
  background: #ffffff; /* PURE WHITE background */
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* Clean container shadow */
}

.product-header {
    display: flex; /* Aligns h2 and controls side-by-side */
    align-items: center; 
    justify-content: space-between; /* Pushes h2 left, controls right */
}

.JP#product-store-btn {
  padding: 10px 15px;
  font-size: 1rem;
  cursor: pointer;
  background-color: #095d40; /* Example: A primary action color */
  color: white;
  border: none;
  border-radius: 10px;
  transition: background-color 0.3s, transform 0.3s; /* Ensure transform transition is here */
  width: 60px;
}

.PH#product-store-btn {
  padding: 10px 15px;
  font-size: 1rem;
  cursor: pointer;
  background-color: white; /* Example: A primary action color */
  color: #095d40;
  border: 1px solid #095d40; /* Light grey border */
  border-radius: 10px;
  transition: background-color 0.3s, transform 0.3s; /* Ensure transform transition is here */
  width: 60px;
}

#product-grid {
  display: grid;
  /* Retaining your grid setup, but simplifying the minmax and gap for better flow */
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
  gap: 1.5rem; 
  justify-items: center;
  padding-top: 0.5rem;
}

.status-banner {
    /* Position the banner in the top right corner */
    position: absolute;
    top: 10px;        /* Distance from the top edge */
    left: 10px;      /* Distance from the right edge */
    
    /* Styling for the tag */
    background-color: black; /* Warm color for seasonal items */
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 5px; /* Soft rounded corners */
    z-index: 10;        /* Ensure it sits above the image/content */
    
    /* Subtle visual effect to help it stand out */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Product Cards */
.product-card,
.add-product-card {
  background: #ffffff; /* PURE WHITE card background */
  border: none; /* Removed border */
  border-radius: 12px;
  width: 95%; /* Use full grid space */
  display: flex;
  flex-direction: row; 
  align-items: center;
  padding: 0.8rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05); /* Lighter, cleaner shadow */
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-height: 115px; 
  height: auto; 
  position: relative;
}

/* Green hover shadow */
.product-card:hover,
.add-product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(9, 93, 64, 0.2); /* Green shadow on hover */
}

/* Image square and fixed size */
.product-card img,
.add-product-card img {
  width: 90px; /* Slightly larger image */
  height: 90px;
  object-fit: cover;
  border-radius: 8px; /* Slightly more rounded image */
  border: 1px solid #e0e0e0; /* Light grey border */
  margin-right: 1rem; /* More space */
}

/* Product details stacked vertically */
.product-card .details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  word-wrap: break-word; 
}

.product-card .details h3 {
  font-size: 1.1rem; /* Slightly larger title */
  margin: 0 0 0.2rem 0;
  word-wrap: break-word;
}

.product-card .details p {
  font-size: 0.9rem;
  margin: 0.1rem 0;
}

/* "+" tile */
.add-product-card {
  font-size: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: #c9a227; /* Gold for the plus sign */
  border: 2px dashed #c9a227; /* Dashed gold border */
  background-color: #fcfcfc;
}

/* --- DASHBOARD SALES --- */
/* -------------------- Sales Grid Layout -------------------- */
/* This container dictates how the cards are arranged */
#running-sales.sales-grid {
    display: flex;
    gap: 30px; /* Space between the cards */
    flex-wrap: wrap; /* Allows cards to wrap on smaller screens */
    margin-bottom: 30px; /* Space below the sales figures */
}

/* -------------------- Individual Sales Card -------------------- */
.sales-card {
    background: #ffffff; /* White background */
    border-radius: 12px; /* Rounded corners */
    padding: 20px 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Subtle lift */
    flex: 1 1 300px; /* Allows the card to grow/shrink, taking at least 300px width */
    min-width: 250px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sales-card:hover {
    transform: translateY(-3px); /* Slight lift on hover */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* -------------------- Text Styling -------------------- */
.sales-card .card-title {
    font-size: 1rem;
    color: #6c757d; /* Gray text for the title */
    margin-bottom: 5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sales-card .card-value {
    font-size: 2.2rem;
    font-weight: 700; /* Bold and big for the main number */
    color: #095d40; /* Strong focus color (your Kookie Krumbs green) */
    line-height: 1.2;
}

/* Optional: Slight color change for locale differentiation */
.sales-card-ph .card-value {
    color: #007bff; /* Philippine Sales in a different blue accent */
}

/* --- DASHBOARD TABLE --- */
/* Style for the action button column */
.dashboard-table .action-cell {
    text-align: center;
}

/* Style for the print button */
.print-order-btn {
    background-color: #095d40;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.print-order-btn:hover {
    background-color: #0b7550;
}

/* Ensure the grid item is sized well */
.dashboard-graph {
    /* Example size */
    width: 97%;
    height: 200px; /* Give it enough height to be visible */
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.dashboard-section,
.stocks-section,
.orders-section,
.change-password-section,
.myaccount-section {
  background: #ffffff;
  padding: 1.5rem; /* Increased padding */
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow-x: auto; /* Ensure table is scrollable on small screens */
}

.products-section h2,
.dashboard-section h2,
.stocks-section h2,
.orders-section h2 {
  text-align: left;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

#dashboard-table,
#stocks-table,
#orders-table {
  width: 100%;
  min-width: 800px; /* Ensure table is wide enough for data */
  border-collapse: collapse;
  display: block; /* Allows table to cooperate with max-height/overflow */
}

#dashboard-table th,
#stocks-table th,
#orders-table th {
  padding: 1rem 0.8rem; /* Increased vertical padding */
  border-bottom: 2px solid #095d40; /* Deep Green bottom border for header */
  border-top: none;
  border-left: none;
  border-right: none;
  text-align: left; /* Align header text left */
  font-size: 1rem;
  font-weight: 600;
  color: #095d40;
}

#dashboard-table td,
#stocks-table td,
#orders-table td {
  padding: 0.8rem;
  border-bottom: 1px solid #eee; /* Light line separator */
  border-top: none;
  border-left: none;
  border-right: none;
  text-align: left; /* Align cell text left */
  font-size: 0.95rem;
  color: #333;
}

.table-wrapper {
    /* CRITICAL: Set a maximum height before scrolling starts */
    max-height: calc(90vh - 258px);
    overflow-y: auto; /* Enable vertical scrollbar */
    overflow-x: hidden; /* Prevent horizontal scrollbars from appearing unnecessarily */
    
    /* Ensure the table layout is correct within the wrapper */
    display: block; 
    width: 100%;
}

#dashboard-table thead,
#dashboard-table tbody tr {
    display: table; /* Ensures the header and rows are treated as table elements */
    width: 100%;
    table-layout: fixed; /* Ensures column widths are uniform */
}

/* 3. Keep the header fixed at the top of the scroll container */
#stocks-table thead,
#stocks-table tbody tr {
    display: table; /* Ensures the header and rows are treated as table elements */
    width: 100%;
    table-layout: fixed; /* Ensures column widths are uniform */
}

.store-column {
    display: none !important; 
}

.order-header {
    display: flex; /* Aligns h2 and controls side-by-side */
    align-items: center; 
    justify-content: space-between; /* Pushes h2 left, controls right */
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.orders-section h2 {
    /* Ensures H2 takes minimal width and aligns neatly */
    margin: 0;
    font-size: 1.5rem;
    white-space: nowrap;
    /* Optional: Add a small gap between the H2 and the right edge of the window/controls */
    margin-right: 20px; 
}

/* -------------------- Controls Container -------------------- */
.controls-container {
    display: flex;
    align-items: center;
    gap: 20px; /* Clean space between search and filters */
    /* Allows the controls to shrink or grow as needed */
}

/* -------------------- Search Group Styles -------------------- */
.search-group {
    position: relative;
    display: flex;
    align-items: center;
    /* REMOVE the hardcoded padding: */
    /* padding-right: 750px; <--- GONE! */
    
    /* Make the search group a fixed, reasonable width so the filters are visible */
    width: 300px; 
    flex-shrink: 0; /* Prevents the search bar from shrinking too much on small screens */
}

#orderSearchInput {
    width: 100%;
    padding: 10px 10px 10px 40px; /* Left padding for the icon */
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

#orderSearchInput:focus {
    border-color: #095d40;
    outline: none;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #888;
    font-size: 1rem;
}

/* -------------------- Filters Group Styles -------------------- */
.filters-group {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between filter controls */
}

.filters-group label,
.filters-group select {
    font-size: 1rem;
}

.filters-group select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: white;
    cursor: pointer;
}

/* 3. Keep the header fixed at the top of the scroll container */
#orders-table thead,
#orders-table tbody tr {
    display: table; /* Ensures the header and rows are treated as table elements */
    width: 100%;
    table-layout: fixed; /* Ensures column widths are uniform */
}

/* 3. Keep the header fixed at the top of the scroll container */
#accounts-table thead,
#accounts-table tbody tr {
    display: table; /* Ensures the header and rows are treated as table elements */
    width: 100%;
    table-layout: fixed; /* Ensures column widths are uniform */
}

/* 4. Keep the header visible even when the body scrolls */
#dashboard-table thead,
#sccounts-table thead,
#orders-table thead,
#stocks-table thead {
    /* CRITICAL: This positions the header at the top of the scrolling area */
    position: sticky; 
    top: 0;
    background: #ffffff; /* Ensure the header background is solid white to cover content when scrolling */
    z-index: 10;
}

/* Status Buttons */
.accntStatus-btn,
.status-btn {
  width: 110px; /* Slightly wider button */
  height: 38px;
  line-height: 38px;
  text-align: center;
  padding: 0;
  border: none;
  border-radius: 6px; 
  cursor: pointer;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s ease, transform 0.15s ease;
}

/* MODERNIZED COLORS */
.status-pending   { background-color: #7f8c8d; }  /* gray */
.status-confirmed { background-color: #f9e79f; color:#333; } /* pastel yellow w/dark text */
.status-ready     { background-color: #3498db; }  /* blue */
.status-completed, .status-active { background-color: #2ecc71; }  /* green */


.accntStatus-btn:disabled,
.status-btn:disabled {
  cursor: default; 
  opacity: 0.7; /* Slight fade when disabled */
}

.accntStatus-btn:not(:disabled):hover,
.status-btn:not(:disabled):hover {
  transform: scale(1.05); /* Smaller hover scale */
}

.status-completed:disabled {
  background-color: #27ae60;
  color: white;
  opacity: 1; 
}
/* --- FIX: Constrain the width of the Trash Button column --- */

#orders-table th:nth-child(1),
#orders-table td:nth-child(1) {
  /* Set a fixed, small width for the first column */
  width: 30px; /* Adjust this value if you need slightly more space */
  /* Prevent the column from being allocated extra space */
  min-width: 30px; 
  max-width: 30px;
  /* Ensure text doesn't wrap unnecessarily (though it's just a button) */
  white-space: nowrap; 
}

#orders-table th:nth-child(6),
#orders-table td:nth-child(6),
#orders-table th:nth-child(3),
#orders-table td:nth-child(3) {
  /* Set a fixed, small width to hold 'JP' or 'PH' comfortably */
  width: 50px; /* Adjust this value if needed, but 50px should be enough */
  min-width: 50px; 
  max-width: 50px;
}

#orders-table th:nth-child(7),
#orders-table td:nth-child(7) {
  /* Set a fixed, small width to hold 'JP' or 'PH' comfortably */
  width: 60px; /* Adjust this value if needed, but 50px should be enough */
  min-width: 60px; 
  max-width: 60px;
}

#dashboard-table th:nth-child(9),
#dashboard-table td:nth-child(9) {
  /* Set a fixed, small width for the first column */
  width: 30px; /* Adjust this value if you need slightly more space */
  /* Prevent the column from being allocated extra space */
  min-width: 30px; 
  max-width: 30px;
  /* Ensure text doesn't wrap unnecessarily (though it's just a button) */
  white-space: nowrap;
}

.trash-btn {
  cursor: pointer; 
  background: transparent;
  border: none; 
  font-size: 1.1rem; 
  color: #e74c3c; 
  transition: transform 0.2s;
  padding: 0;
  /* Existing styles... */
  display: inline-block; /* Helps prevent margin/padding issues */
}

.trash-btn:not(:disabled):hover {
  transform: scale(1.15);
}

.trash-icon {
  width: 20px; 
  height: 20px;
  object-fit: contain;
}

.trash-btn:disabled {
  cursor: default; 
  opacity: 0.3; 
}

.status-deleted, .status-disabled {
  background-color: #e74c3c; 
  color: white;
}

.status-deleted:disabled {
  background-color: #e74c3c; 
  color: white;
  opacity: 1;
  cursor: default;
}

/* --- ACCOUNTS TABLE --- */
.accounts-section {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow-x: auto;
}

.accounts-section h2 {
  text-align: left;
  margin-bottom: 1rem;
}

#accounts-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

#accounts-table th {
  padding: 1rem 0.8rem;
  border-bottom: 2px solid #095d40; 
  border-top: none;
  border-left: none;
  border-right: none;
  text-align: left; 
  font-size: 1rem;
  font-weight: 600;
  color: #095d40;
}

#accounts-table td {
  padding: 0.8rem;
  border-bottom: 1px solid #eee; 
  border-top: none;
  border-left: none;
  border-right: none;
  text-align: left; 
  font-size: 0.95rem;
  color: #333;
}

#accounts-table th:nth-child(1),
#accounts-table td:nth-child(1) {
  /* Set a fixed, small width for the first column */
  width: 30px; /* Adjust this value if you need slightly more space */
  /* Prevent the column from being allocated extra space */
  min-width: 30px; 
  max-width: 30px;
  /* Ensure text doesn't wrap unnecessarily (though it's just a button) */
  white-space: nowrap; 
}

#accounts-table th:nth-child(2),
#accounts-table td:nth-child(2) {
  /* Set a fixed, small width for the first column */
  width: 130px; /* Adjust this value if you need slightly more space */
  /* Prevent the column from being allocated extra space */
  min-width: 130px; 
  max-width: 130px;
  /* Ensure text doesn't wrap unnecessarily (though it's just a button) */
  white-space: nowrap; 
}

#accounts-table th:nth-child(4),
#accounts-table td:nth-child(4)  {
  /* Set a fixed, small width for the first column */
  width: 275px; /* Adjust this value if you need slightly more space */
  /* Prevent the column from being allocated extra space */
  min-width: 275px; 
  max-width: 275px;
  /* Ensure text doesn't wrap unnecessarily (though it's just a button) */
  white-space: nowrap; 
}

#accounts-table th:nth-child(5),
#accounts-table td:nth-child(5),
#accounts-table th:nth-child(6),
#accounts-table td:nth-child(6)  {
  /* Set a fixed, small width for the first column */
  width: 75px; /* Adjust this value if you need slightly more space */
  /* Prevent the column from being allocated extra space */
  min-width: 75px; 
  max-width: 75px;
  /* Ensure text doesn't wrap unnecessarily (though it's just a button) */
  white-space: nowrap; 
}

#accounts-table th:nth-child(8),
#accounts-table td:nth-child(8)  {
  /* Set a fixed, small width for the first column */
  width: 120px; /* Adjust this value if you need slightly more space */
  /* Prevent the column from being allocated extra space */
  min-width: 120px; 
  max-width: 120px;
  /* Ensure text doesn't wrap unnecessarily (though it's just a button) */
  white-space: nowrap; 
}

/* Admin Link Generation */
#create-admin-link-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

#generate-link-btn {
  background-color: #c9a227; /* Gold button for link generation */
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  width: 20%; /* Keep width restricted */
  min-width: 150px;
  font-weight: 600;
}

#generate-link-btn:hover {
  background-color: #b18f20;
  transform: scale(1.02);
}

#generated-link-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

#admin-link {
  flex: 1; 
  padding: 0.6rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
  width: 80%;
  background: #fcfcfc;
}

#copy-link-btn {
  background-color: #095d40; /* Deep Green copy button */
  color: #fff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  font-weight: 600;
}

#copy-link-btn:hover {
  background-color: #0b6d50;
  transform: scale(1.02);
}

#copy-link-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* --- Change Password Form Styles --- */

.form-wrapper {
    max-width: 400px; 
    
    /* REMOVE margin: 0 auto; */
    /* Use margin-top/bottom for spacing and margin-left: 0 for explicit left alignment */
    margin: 0 0 0 0; /* Sets all margins to 0 */
    /* OR: */
    /* margin: 0; */
    
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.form-wrapper-accounts {
    max-width: 600px; 
    
    /* REMOVE margin: 0 auto; */
    /* Use margin-top/bottom for spacing and margin-left: 0 for explicit left alignment */
    margin: 0 0 0 0; /* Sets all margins to 0 */
    /* OR: */
    /* margin: 0; */
    
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #f9f9f9;
}

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

.form-group-accounts {
    margin-bottom: 15px;
    text-align: left;
	gap:20px;
	
	display:flex;
	align-items:center;
	justify-content:space-between;
}

.form-group label,
.form-group-accounts label {
    display: block; /* Makes the label take its own line */
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-wrapper-accounts input[type="text"] {
    width: 400px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-wrapper-accounts input[type="text"]:focus {
    border-color: #095d40; /* Deep Green focus highlight */
    outline: none;
}

/* CORRECTED CSS (Targets both password and text types) */
.form-wrapper input[type="password"],
.form-wrapper input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-wrapper input[type="password"]:focus,
.form-wrapper input[type="text"]:focus {
    border-color: #095d40; /* Deep Green focus highlight */
    outline: none;
}
/* --- Show Password Styles --- */

/* 1. Make the wrapper relative for absolute positioning of the toggle */
.password-input-wrapper {
  position: relative;
  display: flex; 
  align-items: center;
}

/* Reusing your existing button style for the submit button */
#submit-password-change-btn {
    width: 100%; /* Make the button full width of the form */
    margin-top: 10px;
}

.edit-account-actions{
  position: relative;
  display: flex; 
  align-items: center;
  gap:20px;
  justify-content:space-between;
}

/* --- MODAL STYLES (Add/Edit Product) --- */

/* Modal Overlay */
.modal {
  display: none; 
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.45); 
  justify-content: center;
  align-items: center;
}

/* Modal Content Box (Used for both add and edit) */
.modal-content {
  background: #ffffff; /* PURE WHITE background */
  border: 1px solid #e0e0e0; /* Light border */
  border-radius: 12px;
  width: 380px; /* Slightly wider modal */
  max-width: 90%;
  margin: auto;
  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  word-wrap: break-word; 
  max-height: 90vh; 
  overflow-y: auto; 
}

/* Close (X) button */
.modal-content .close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.5rem;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-content .close:hover {
  color: #e74c3c; /* Red close button on hover */
}

/* Modal Header */
.modal-content h3 {
  margin-top: 0.5rem;
  color: #095d40;
  font-size: 1.4rem;
  text-align: center;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
  width: 100%;
}

/* Form styling */
#add-product-form,
#edit-product-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  /*margin-top: 1rem;*/
}

/* --- CONSOLIDATED MODAL INPUT ROW STYLES (Price/Stock) --- */

/* Base Flex container for both Add and Edit modals */
#add-product-form .input-row,
#edit-product-form .input-row {
  display: flex; 
  align-items: center; 
  width: 100%; 
  margin: 0.2rem 0; 
  font-size: 0.95rem; 
  font-weight: 500;
  gap:10px;
  
  /* CRITICAL: Justifies content to force label to left and input to right (Full-width look) */
  justify-content: space-between; 
}

/* 2. Style the SPAN wrapper (label text/info) to keep elements close */
#add-product-form .input-row > span,
#edit-product-form .input-row > span {
  display: flex; 
  align-items: center;
  gap: 15px; /* Space between text and currency/stock value */
  flex-shrink: 0;
  flex-grow: 0; 
}

/* 3. Style and enforce FIXED, UNIFORM width on number inputs for EDIT MODAL */
#edit-product-form .input-row input[type="number"] {
  /* This uses the desired width for the Edit Modal */
  width: 150px; /* Use a fixed width for uniform size (Edit Modal's preferred size) */
  flex-shrink: 0; /* Prevents input from shrinking */
  flex-grow: 0; /* Prevents input from growing, letting space-between handle justification */
  margin: 0; /* Ensure no vertical or horizontal margin conflicts */
  box-sizing: border-box;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
}


/* 4. OVERRIDE: ADD MODAL SPECIFIC INPUT WIDTH (Your fixed 300px size) */
#add-modal #add-product-form .input-row input[type="number"] {
  width: 300px !important; /* CRITICAL: Fixed, uniform, wider width for Add Modal */
  flex-shrink: 0 !important; 
  flex-grow: 0 !important;
  margin: 0 !important; 
}

/* 5. Cleaned generic rule for label currency/stock info */
#add-product-form label p,
#edit-product-form label p {
  margin: 0; /* Ensures no extra margin interferes */
  font-weight: 600;
  color: #095d40;
}

/* Removed redundant block: The two blocks below were duplicates or contained old logic
#add-product-form .input-row { ... }
#add-product-form .input-row > span { ... }
#add-product-form .input-row input[type="number"] { ... }
*/

/* Removed conflicting block: The block below was for the Add Modal specific layout but used
a less efficient selector and repeated styles. We merged the CRITICAL parts into a specific rule above.
#add-modal #add-product-form .input-row { ... }
#add-modal #add-product-form .input-row > span { ... }
#add-modal #add-product-form .input-row input[type="number"] { ... }
*/

.enable-product {
  background: #2196F3;
  color: white;
}

.disable-product {
  background: #000000;
  color: white;
}

.enable-product:hover {
  background: #1976D2;
  transform: scale(1.01);
}

.disable-product:hover {
  opacity: .8;
  transform: scale(1.01);
}

#add-product-form input[type="file"] {
  margin-bottom: 0.8rem;
}

/* --- CONSOLIDATED GENERAL INPUT STYLES (Text and Number) --- */
#add-product-form input[type="text"],
#add-product-form input[type="number"],
#edit-product-form input[type="text"],
#edit-product-form input[type="number"] {
  /* CRITICAL FIX: Include padding/border within the width */
  box-sizing: border-box; 
  
  /* Use 0 horizontal margin for full-width alignment with buttons */
  margin: 0.5rem 0;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  
  /* Ensures the single text input spans the full width of the form (100% minus padding/border) */
  width: 100%; 
}
/* Removed redundant block: The block below was a confusing generic rule
#add-product-form input[type="text"], #add-product-form input[type="number"], ... { ... }
*/

#add-product-form input:focus,
#edit-order-form input:focus,
#edit-product-form input:focus {
  outline: none;
  border-color: #095d40;
  box-shadow: 0 0 5px rgba(9,93,64,0.4);
}

/* Buttons in forms (General) */
#add-product-form button,
#edit-order-form button,
#edit-product-form button {
  margin-top: 0.7rem;
  padding: 0.7rem; /* Larger padding for better click area */
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s ease, transform 0.1s;
}

/* Submit/Update button */
#add-product-form button[type="submit"],
#update-order-btn,
#update-product-btn {
  background: #095d40;
  color: white;
}

#add-product-form button[type="submit"]:hover,
#update-order-btn:hover,
#update-product-btn:hover {
  background: #0b7550;
  transform: scale(1.01);
}

/* Delete button */
#delete-product-btn {
  background: #e74c3c;
  color: white;
  margin-bottom: 1rem; /* Space before cancel button */
}
#delete-product-btn:hover {
  background: #c0392b;
  transform: scale(1.01);
}

/* Cancel button */
#cancel-btn,
#cancel-update-btn,
#cancel-edit-btn {
  background: #f0f0f0;
  color: #333;
}

#cancel-btn:hover,
#cancel-update-btn:hover,
#cancel-edit-btn:hover {
  background: #e0e0e0;
  transform: scale(1.01);
}

/* --- Image Upload Box --- */
#image-upload-label,
#edit-image-upload-label {
  width: 150px;
  height: 150px;
  border: 2px dashed #c9a227; /* Gold dashed border */
  border-radius: 10px;
  background-color: #fdfaf3;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  margin: 0 auto 1rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
/* --- CSS for Edit Modal Preview --- */
/* This rule is crucial for SHOWING the image */
#edit-image-upload-label.has-image #edit-image-preview {
    display: block !important; 
}

/* This rule is crucial for HIDING the '+' placeholder */
#edit-image-upload-label.has-image #image-placeholder {
    display: none !important;
}

/* Ensure the placeholder is visible by default when no image is loaded */
#image-placeholder {
    display: block; 
}

#image-upload-label:hover,
#edit-image-upload-label:hover {
  border-color: #095d40; /* Deep Green on hover */
  background-color: #fffdf5;
}

/* The plus sign placeholder */
#image-placeholder {
  font-size: 3rem;
  color: #c9a227; /* Gold plus sign */
  font-weight: bold;
  pointer-events: none;
}

/* The preview image */
#image-preview,
#edit-image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 10px;
}

/* Filename */
#image-filename,
#edit-image-filename {
  font-size: 0.85rem;
  color: #444;
  text-align: center;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
}

.locale-radio {
  /* 1. Use Flexbox to align items inside */
  display: flex;
  
  /* 2. Center the entire container horizontally within its parent */
  justify-content: center; 
  
  /* 3. Add some spacing below the radio buttons before the next input field */
  margin-bottom: 1rem; 
  
  /* 4. Add space between the 'JP' and 'PH' options */
  gap: 20px; 
}

.locale-radio label {
  /* Ensure the label content (radio button and text) is aligned */
  display: flex;
  align-items: center;
  gap: 5px; /* Small space between the radio circle and the text */
  font-size: 1rem;
  color: #555; /* Subtle color for text */
}

/* Optional: Style the radio button itself */
.locale-radio input[type="radio"] {
  width: auto; /* Prevent it from taking 100% width like other inputs */
  margin: 0;
  cursor: pointer;
  /* You can add a specific color to the accent if desired: */
  accent-color: #095d40; 
}

/* ORDER DETAILS MODAL */
#order-details-body {
  width: 100%;
  font-size: 0.95rem;
  color: #333;
}

#order-details-body p {
  margin: 0.4rem 0;
  line-height: 1.5;
}

#order-details-body .order-items {
  margin-top: 1rem;
  border-top: 1px solid #ccc;
  padding-top: 0.8rem;
}

/* Style for the container holding the button */
.modal-actions {
    /* Ensures the content inside is centered horizontally */
    text-align: center; 
    /* Adds a little space between the order details and the button */
    padding-top: 20px; 
    /* Pushes the button to the bottom if the modal content is smaller than the screen */
    margin-top: auto; 
}
/* Optional: Basic styling for the new button */
#edit-order-btn {
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    background-color: #095d40; /* Example: A primary action color */
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.3s; /* Ensure transform transition is here */
}

/* Hover state: Only applies when NOT disabled */
#edit-order-btn:not(:disabled):hover {
    background: #0b7550;
    transform: scale(1.01);
}

/* ------------------------------------- DISABLED STATE FIX ------------------------------------- */

/* Style when the button is DISABLED */
#edit-order-btn:disabled {
    /* 1. Set the gray color */
    background-color: #ccc; 
    color: #666;
    
    /* 2. Reset cursor to default (or not-allowed, which is better) */
    cursor: default; /* or cursor: not-allowed; */

    /* 3. Reset transforms/animations */
    transform: none; 
    
    /* 4. Disable pointer events so hover cannot trigger if cursor somehow overrides */
    pointer-events: none;
}

/* IMPORTANT: Ensure the hover effect is NOT applied to the disabled state */
/* This specific selector is often needed to override any general hover rules */
#edit-order-btn:disabled:hover {
    background-color: #ccc; /* Maintain the disabled color */
    transform: none; /* Keep the button static */
}

/* ------------------------------------- GLOBAL MODAL & FORM LAYOUT -------------------------------------*/

/* --- Modal Content Container --- */
.modal-content-edit {
  max-width: 700px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  width: 90%;
  margin: auto;
  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  word-wrap: break-word;
  max-height: 90vh;
  overflow-y: auto;
}

/* Modal Header */
.modal-content-edit h3 {
  margin-top: 0.5rem;
  color: #095d40;
  font-size: 1.4rem;
  text-align: center;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
  width: 100%;
}

/* Close (X) button */
.modal-content-edit .close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.5rem;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
}
.modal-content-edit .close:hover {
  color: #e74c3c;
}

/* --- Two-Column Grid Setup (Main body) --- */
#edit-order-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-bottom: 15px;
  width: 100%;
}

/* --- Standard Form Group Styling (Horizontal Label + Input) --- */
.form-group-edit {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

/* Standard Label Styling (Fixed Width) */
.form-group-edit > label {
  font-weight: bold;
  color: #095d40;
  font-size: 1em;
  /* Fixed width for consistent horizontal alignment */
  width: 120px;
  flex-shrink: 0;
  margin-right: 10px;
}

/* Standard Input Styling (Take remaining space) */
.form-group-edit input[type="text"],
.form-group-edit input[type="date"] {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  flex-grow: 1;
  box-sizing: border-box;
  max-width: 250px;
}
.form-group-edit input:disabled {
  color: #666;
}

/* ------------------------------------- ORDER TYPE SECTION (Custom Layout) -------------------------------------*/

/* Order Type Container (Stacks header and conditional wrapper) */
#editOrderType {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 0;
  border: none;
  width: 100%;
}

/* 1. Order Type Header (OrderType: Pickup Delivery) */
.order-type-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 5px;
  width: 100%; 
}
.order-type-label {
  width: 120px; /* Aligns with all other fixed-width labels */
  flex-shrink: 0;
  font-weight: bold;
  text-align: left;
  margin-right: 0;
  color: #095d40;
}
.radio-option-label {
  font-weight: normal;
  margin-right: 0;
  display: inline-flex;
  align-items: center;
  width: auto;
}

/* 2. Conditional Fields Wrapper (The CSS Grid Container with Indentation Fix) */
.conditional-fields-wrapper {
  display: grid;
  row-gap: 8px;
  column-gap: 10px;
  padding-left: 0;
  width: 100%;
}

/* --- TEXTAREA ALIGNMENT FIX (Using the .textarea-group wrapper) --- */

/* 1. Container for Stacked Fields (.textarea-group) */
.conditional-fields-wrapper .textarea-group {
  /* Start in column 2 and span the remaining two columns (2 and 3) */
  
  /* Use flexbox internally to stack the label and textarea */
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 8px;
}

/* 2. Style the Label inside the Stacked Container */
.conditional-fields-wrapper .textarea-group label {
  /* Aligns the stacked label text to the left */
  text-align: left;
  padding: 0;
  margin-bottom: 5px;
  width: 100%;
  font-weight: bold;
  color: #095d40;
}

/* 3. Style the Textarea inside the Stacked Container */
.conditional-fields-wrapper .textarea-group textarea {
  /* Fills the 100% width of the spanned container */
  width: 100%;
  height: 80px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  resize: vertical;
}

/* --- NEW FIX: Indentation for Pickup Date (Bypassing Grid Conflicts) --- */

.conditional-fields-wrapper .indented-field {
  /* Force the new wrapper to start in column 2 and span the remaining two columns (2 and 3) */
  
  /* Use Flexbox to align the label and input side-by-side */
  display: flex;
  align-items: center;
  gap: 10px; /* Spacing between label and input */
  width: 100%;
}

.conditional-fields-wrapper .indented-field label {
  /* Fixed width for the label to align with the indented Pickup Point label */
  width: 120px; 
  flex-shrink: 0;
  /* Style consistency */
  text-align: right; 
  font-weight: bold;
  color: #095d40;
  margin-right: 0;
}

.conditional-fields-wrapper .indented-field input[type="date"] {
  /* Input takes remaining space and adheres to max-width */
  flex-grow: 1;
  max-width: 250px; 
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
}


/* ------------------------------------- RIGHT COLUMN ELEMENTS -------------------------------------*/

/* --- Order Items Container (Override standard flex flow) --- */
.form-group-edit:has(.edit-order-items) {
  flex-direction: column;
  align-items: flex-start;
}

.form-group-edit:has(.edit-order-items) > label {
  width: auto;
  margin-right: 0;
}

/* --- Items List and Pencil Icon --- */
.edit-order-items {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-grow: 1; 
  min-width: 200px; 
    
    /* CRITICAL FIX: Enforce the standard 250px max width */
  max-width: 320px; 
  width: 100%;
  border: 1px dashed #ccc;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
}

/* NEW STYLES: Style and position for the promo text */
.editOrderPromo {
    /* Forces the element to the next line in the wrapped flex container */
    flex-basis: 100%; 
    
    /* Pushes the content to the right edge */
    text-align: right; 
    
    /* Adjusts the left margin to align the text properly under the input column */
    /* 120px (label width) + 10px (gap) = 130px offset from the left */
    margin-left: 130px; 
    
    padding-top: 5px;
    width: calc(100% - 130px); /* Ensures it doesn't push the container past the edge */
}

/* Style the label inside the promo div */
#editPromoLabel {
    /* Smaller font as requested */
    font-size: 0.85rem; 
    color: #666; /* Slightly darker gray for subtlety */
    font-weight: normal; /* Do not bold the promo text */
}

.edit-items-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #095d40;
  font-size: 1.1em;
}
/*=================================== EDIT ORDER ITEMS MODAL =================================*/

/* ------------------------------------- ITEM ROW STYLES -------------------------------------*/

.order-items-list {
  max-height: 40vh;
  overflow-y: auto;
  padding-right: 5px;
  margin-bottom: 15px;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed #eee;
}

.item-image {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  margin-right: 10px;
}

.item-name {
  flex-grow: 1; /* Allows name to take up middle space */
  font-weight: 500;
  color: #333;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.qty-btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-weight: bold;
}
.qty-btn:hover {
  background: #e0e0e0;
}

.qty-input {
  width: 40px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 5px;
  -moz-appearance: textfield; /* Hide arrows in Firefox */
}
/* Hide arrows in Chrome/Safari */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#okRemarksBtn,
#applyItemsBtn {
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  background-color: #095d40; /* Example: A primary action color */
  color: white;
  border: none;
  border-radius: 5px;
  transition: background-color 0.3s, transform 0.3s; /* Ensure transform transition is here */
  font-weight:600;
}

#cancelRemarksBtn,
#cancelItemsBtn {
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  background-color: #f0f0f0; /* Example: A primary action color */
  color: #333;
  border: none;
  border-radius: 5px;
  transition: background-color 0.3s, transform 0.3s; /* Ensure transform transition is here */
  font-weight:600;
}

/* Hover state: Only applies when NOT disabled */
#okRemarksBtn:hover,
#applyItemsBtn:hover {
  background: #0b7550;
  transform: scale(1.01);
}

/* Hover state: Only applies when NOT disabled */
#cancelRemarksBtn:hover,
#cancelItemsBtn:hover {
  background: #e0e0e0;
  transform: scale(1.01);
}  /* Cart item adjustments */

/* Product Item Row - MODIFIED */
.product-item {
  display: flex;
  align-items: center;
  
  /* FIX: Increase the gap between the three main elements (Image, Details, Controls) */
  gap: 1.5rem; /* Increased from 0.5rem for better spacing */
  
  margin-bottom: 10px;
  word-break: break-word;
  /* Ensure there's space on the far ends */
  padding: 0 5px; 
}

.product-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
}

/* Product Item Details - MODIFIED */
.product-item-details {
  /* flex: 1; is good, but let's give it a min-width to ensure it doesn't get squished */
  flex: 1;
  min-width: 250px; /* Ensures text has room, especially for longer names */
}
#stocksLabel {
  font-size: 12px;
  font-weight: 600;
}

/* Quantity Controls Container - Keep as is, but ensure alignment */
.quantity-controls {
  display: flex;
  align-items: center;
  
  /* Reduce gap slightly for a more compact control group */
  gap: 2px; 
  
  /* Ensure this group doesn't shrink */
  flex-shrink: 0; 
}

/* Quantity Control Buttons - MODIFIED */
.quantity-controls button {
  background: #095d40;
  color: white;
  border: none;
  border-radius: 4px; /* Use smaller radius to match span */
  
  /* FIX: Reduce padding to make buttons smaller (less width consumed) */
  padding: 0.25rem 0.5rem; 
  
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}

/* Quantity Display (The span with the number) - NEW STYLE */
.quantity-controls span {
  /* Style the quantity number to stand out and align with buttons */
  display: block;
  min-width: 25px; /* Ensures two digits fit without collapsing */
  text-align: center;
  font-weight: 700;
  color: #333;
}

.quantity-controls button:hover {
  background: #074a34; 
  transform: scale(1.02); 
}

/* Modal Content Box - MODIFIED FOR WIDTH */
.modal-content-order {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  
  /* FIX: Increased width for a wider modal */
  width: 450px; 
  
  max-width: 90%;
  /* REMOVE margin: auto; if you are using Flexbox centering in the parent */
  /* margin: auto; */

  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  
  /* CRITICAL: Set a taller maximum height */
  max-height: 90vh; 
  
  /* Ensure the list content can scroll if needed */
  overflow-y: hidden; /* Set to hidden here, let the list component scroll */
}

/* CRITICAL: Allow the content list to take available space and scroll */
#orderItemsList {
  /* Allows the item list to grow and fill vertical space */
  flex-grow: 1; 
  
  /* Set a maximum height for the list itself */
  max-height: 100%; 
  
  /* Ensure only the list scrolls, not the whole modal */
  overflow-y: auto; 
  padding-right: 5px; 
  margin-bottom: 15px;
}

/* Close (X) button */
.modal-content-order .close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.5rem;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-content-order .close:hover {
  color: #e74c3c; /* Red close button on hover */
}

/* Modal Header */
.modal-content-order h3 {
  margin-top: 0.5rem;
  color: #095d40;
  font-size: 1.4rem;
  text-align: center;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
  width: 100%;
}
/*=================================== EDIT ORDER ITEMS MODAL =================================*/

#editOrderTotal {
  /* Aligns the text content to the right side of the input box */
  /* Add padding on the left to create space for the symbol */
  padding-left: 40px; /* Adjust this value based on the symbol width */
  /* Standard input styles */
  height: 34px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: right;
}

/* Container to group the symbol and input */
.input-group {
  display: flex;
  align-items: center;
  position: relative; /* Essential for positioning the symbol */
  max-width: 250px; /* Optional: Match your form's standard input width */
}

/* Style the actual input field */
#amount-input {
  /* Add padding on the left to create space for the symbol */
  padding-left: 20px; /* Adjust this value based on the symbol width */
  /* Standard input styles */
  height: 34px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Position and style the currency symbol */
.currency-symbol {
  position: absolute; /* Take it out of the normal flow */
  left: 8px; /* Position it slightly inside the input box */
  font-size: 0.9rem;
  color: #666;
  /* Ensure the symbol doesn't interfere with clicking/typing */
  pointer-events: none; 
}

/* --- Mode of Payment (Stacked Label, Horizontal Radios) --- */

/* Targets ONLY the container with ID="form-group-edit" */
#form-group-edit {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: center;
  padding: 8px 0;
  margin-bottom: 10px;
  border-top: 1px solid #eee;
  padding-top: 15px;
  width: 100%;
}
/* Main "Mode of Payment:" label (Stacks above radios) */
#form-group-edit > label:first-child {
  font-weight: bold;
  color: #095d40;
  flex-basis: 100%; /* Forces it to take full width */
  margin-bottom: 10px;
  width: auto;
  text-align: left;
}
/* Individual payment radio button labels */
#form-group-edit label:not(:first-child) {
  font-weight: normal;
  margin-right: 25px;
  margin-left: 0;
  width: auto;
}

/* --- Remarks Section (Label Above Textarea) --- */
.form-group-edit:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}
.form-group-edit:last-child label {
  width: auto;
  margin-bottom: 5px;
  margin-right: 0;
}
.form-group-edit:last-child textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  height: 100px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
}
/*---------------------------------------------------------------------------------*/

/* --- CONFIRMATION MODAL SPECIFIC STYLES --- */
/* Modal Overlay */
.modal-confirm {
  display: none; 
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.45); 
  justify-content: center;
  align-items: center;
}

/* Style for the confirmation message text */
.confirmation-message-text {
  margin: 1.5rem 0 1.5rem 0; /* Add top/bottom spacing */
  font-size: 1.05rem;
  font-weight: 500;
  color: #333;
  white-space: pre-wrap;
}

/* Container for the Yes/No buttons */
.confirmation-buttons {
  display: flex;
  gap: 15px; /* Space between Yes and No buttons */
  width: 100%; /* Ensure buttons span the width of the modal content */
  justify-content: center; /* Center the button group */
}

/* Base style for Yes/No buttons */
.modal-btn {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s ease, transform 0.1s;
  flex-grow: 1; /* Makes the buttons equally wide */
}

/* YES Button (Primary Action - Deep Green) */
.confirm-yes-btn {
  background: #095d40;
  color: white;
}

.confirm-yes-btn:hover {
  background: #0b7550;
  transform: scale(1.02);
}

/* NO Button (Secondary Action - Light Gray) */
.confirm-no-btn {
  background: #f0f0f0;
  color: #333;
}

.confirm-no-btn:hover {
  background: #e0e0e0;
  transform: scale(1.02);
}

/* Ensure the close button is visible and styled like the others */
.confirmation-close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
}

.confirmation-close:hover {
    color: #e74c3c; /* Red close button on hover */
}

/* ------------------------------------- REMARKS MODAL STYLES -------------------------------------*/

/* Modal Content (Simple) */
.modal-content-simple {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px; /* Keep it narrow for a simple input */
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Textarea and Error */
.remarks-body {
    margin-bottom: 20px;
}

#remarksTextarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical; /* Allow vertical resizing only */
    font-size: 1rem;
    box-sizing: border-box;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 5px;
    display: none; /* Hidden by default */
}

/*----------------------- NOTIFICATION -----------------------*/
/* --- 1. Container Positioning (Bottom-Right) --- */
#notification-container {
    position: fixed;
    bottom: 20px;       /* Distance from the bottom edge */
    right: 20px;        /* Distance from the right edge */
    z-index: 2000;      /* Ensure it's above everything else */
    display: flex;
    flex-direction: column; /* Stack multiple notifications vertically */
    gap: 10px;          /* Space between queued notifications */
    pointer-events: none; /* Allows clicks to pass through empty space */
}

/* --- 2. Individual Notification Styling --- */
.toast-notification {
    background-color: #095d40; /* Your deep green color */
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    min-width: 250px;
    max-width: 350px;
    font-size: 0.95rem;
    font-weight: 500;
    pointer-events: auto; /* Re-enable clicks on the notification itself */
    opacity: 0;           /* Hidden by default, controlled by animation */
    transform: translateY(100%); /* Initial position off-screen (below) */
}

/* --- 3. Animation Keyframes --- */

/* Keyframes for sliding up and fading in */
@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Keyframes for sliding down and fading out */
@keyframes slide-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

/* Classes to apply the animations */
.toast-notification.show {
    animation: slide-in 0.3s ease-out forwards;
}

.toast-notification.hide {
    animation: slide-out 0.5s ease-in forwards;
}