@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');


:root {
    /* Color Palette Update for Modern/Elegant Look */
    --primary: #132a13; /* Deep Blue-Gray - Primary action/branding */
    --accent: #00b894; /* Mint Green - Success/Pay button */
    --danger: #ff6b6b; /* Soft Red - Cancel/Danger */
    --info: #74b9ff; /* Light Blue - Secondary buttons/Highlight */
    --border-light: #e0e0e0; /* Subtle border color */
    --bg-main: #f5f7fa; /* Very light, modern background */
    --bg-card: #ffffff; /* White card background */
    --text-dark: #2c3e50; /* Dark text for readability */
    --text-light: #7f8c8d; /* Subtle secondary text */
    --total: #34495e; /* Darker Total bar */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Soft shadow for card depth */

    /* NEW: Modal-specific color for primary action focus */
    --modal-focus: rgba(0, 184, 148, 0.5); /* Semi-transparent Mint Green */
}

/* General Reset and Typography */
* {
    box-sizing: border-box;
}
html, body {
    height: 100%;
    margin: 0;
    /* font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;  */
    font-family: "Open Sans", sans-serif;
    color: var(--text-dark);
    background: var(--bg-main);
}

/* Force uppercase in the input fields */
#p-name, #p-sku, #inventory-search, #product-search {
    text-transform: uppercase;
}

/* ========================================================= */
/* POS TERMINAL STYLES */
/* ========================================================= */

/* --- MAIN CONTAINER FIX --- */
.pos-container {
    height: 100vh;
    width: 100vw;
    display: grid;
    grid-template-rows: auto 1fr auto; 
    max-width: 1500px; 
    margin: 0 auto;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    border-radius: 16px; 
    overflow: hidden; 
}

/* Header */
.pos-header {
    background: #132a13;
    color: var(--bg-card);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--accent);
}


.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #4f772d;
}

/* Cashier Info and Logout Link Container */
.status-bar-footer {
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 35px;
    align-items: center;
    border: 2px solid white;
    padding: 15px 25px 15px 25px;
    border-radius: 9px;
    background-color: #e7f3ff;
    color: black;
}


.status-bar-footer strong {
    font-weight: 700;
}
.status-bar-footer #cashier-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: black;
    font-weight: 600;
}

.pos-header-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border: 3px solid white;
    padding: 0 20px 0 13px;
    background: white;
    border-radius: 8px;
}

.pos-header-container img {
    height: 70px;
    width: 94px;
    background-color: white;
    border: 1px solid white;
    border-radius: 10px;

}

.toggle-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #f8f9fa;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Style for when Rx is selected */
.toggle-btn.rx-active {
    background-color: #fff5f5 !important;
    border-color: #feb2b2 !important;
    color: #c53030 !important;
    box-shadow: 0 0 0 2px rgba(254, 178, 178, 0.4);
}

/* Style for when OTC is selected */
.toggle-btn.otc-active {
    background-color: #f0fff4 !important;
    border-color: #9ae6b4 !important;
    color: #2f855a !important;
    box-shadow: 0 0 0 2px rgba(154, 230, 180, 0.4);
}

/* Logout Button (Fixed for POST form) */
#logout-form {
    margin: 0;
    padding: 0;
    line-height: 0;
}

.logout-link {
    color: #000000;
    text-decoration: none;
    font-weight: 600;
    padding: 5px 10px;
    border: 1px solid #000000;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: background 0.2s, color 0.2s;
    background: #00000000;
    cursor: pointer;
}

.logout-link:hover {
    background: #000000;
    color: var(--bg-card); 
    border-color: #f8f8f8;;
}

/* Main Grid */
.pos-main-grid {
    display: grid;
    grid-template-columns: 3fr 1.5fr; 
    height: 100%; 
    overflow: hidden; 
    background: var(--bg-main);
}

/* --- LEFT PANEL: Transaction & Cart --- */
.transaction-panel {
    padding: 25px;
    border-right: 1px solid var(--border-light);
    display: grid;
    grid-template-rows: auto auto 1fr auto; 
    gap: 15px;
    min-height: 0; 
}
.search-bar-area {
    position: relative;
    margin-bottom: 10px;
}
#product-search {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.15rem; 
    border: 2px solid var(--primary);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#product-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.2);
}

/* Suggestions */
.suggestions-list {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    z-index: 999;
    display: none;
    box-shadow: var(--shadow);
}
.suggestion-item {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    font-size: 1.05rem;
    transition: background-color 0.15s;
}
.suggestion-item:last-child {
    border-bottom: none;
}
.suggestion-item:hover, .suggestion-item.active {
    background: rgba(74, 111, 165, 0.1); 
}
.s-right {
    font-weight: 600;
    color: var(--primary);
}

/* Cart */
.cart-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    padding-bottom: 5px;
    border-bottom: 2px solid var(--border-light);
}
.cart-items-list {
    overflow-y: auto; 
    padding-right: 15px;
}
.cart-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr; 
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.1s;
}
.cart-item:hover {
    background-color: rgba(255, 255, 255, 0.9);
}
.cart-item .name {
    font-weight: 600;
    font-size: 1.1rem;
}
.cart-item .meta {
    font-size: 0.85rem;
    color: var(--text-light);
}
.qty-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.qty-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%; 
    border: none;
    background: var(--info);
    color: var(--bg-card);
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.15s;
}
.qty-btn:hover {
    background: var(--primary);
}
.qty-value {
    font-weight: 700;
    font-size: 1.1rem;
    width: 30px;
    text-align: center;
}
.subtotal {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: right;
    color: var(--total);
}

/* Total */
.total-amount-area {
    background: #000000;
    color: var(--bg-card);
    padding: 20px 25px;
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    justify-content: space-between;
    border-radius: 0 0 16px 16px;
}

.remove-item-btn {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s;
}

.remove-item-btn:hover {
    background: #c53030;
    color: white;
    border-color: #c53030;
}

/* --- RIGHT PANEL: Controls & Numpad --- */
.control-panel {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    background: var(--bg-card);
    height: 100%; 
    min-height: 0; 
}

.payment-numpad-area {
    order: 1; 
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto; 
    padding-bottom: 10px;
}

.function-buttons-grid {
    order: 2; 
    flex-shrink: 0; 
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: auto; 
}

.func-btn {
    padding: 18px 12px; 
    border-radius: 12px;
    color: var(--bg-card);
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    transition: background 0.2s, transform 0.1s;
}
.func-btn i {
    margin-right: 8px;
}
.func-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}
.primary-action {
    background: var(--accent);
}
.secondary-action {
    background: var(--info);
}

/* Payment Type */
.payment-type {
    display: flex;
    gap: 10px;
    align-items: center;
}
.type-label {
    font-weight: 600;
    color: var(--text-dark);
}
.payment-btn {
    padding: 10px 15px;
    border: 2px solid var(--border-light);
    background: var(--bg-main);
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.payment-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-card);
}

/* Payment Display (Amount Entered) */
.payment-info-area{
    display: flex;
    flex-direction: column;
    gap: 4px;


}

.payment-display {
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* --- CRITICAL FIX: Payment Display Focus/Hover Effect --- */
.payment-display:focus-within,
.payment-display:hover {
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.2);
    transition: border-color 0.2s, box-shadow 0.2s;
}
#payment-display:focus {
    outline: none;
}
/* --- END CRITICAL FIX --- */

.payment-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 4px;
}
#payment-display {
    font-size: 2rem; 
    font-weight: 800;
    color: var(--primary);
}

/* Balance/Change Display */
.balance-display {
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s;
}

.balance-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 4px;
    font-weight: 600;
}

.change-due {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--danger);
}

.balance-display.is-change-due {
    background: #e6fffb;
    border-color: var(--accent);
}
.balance-display.is-change-due .change-due {
    color: var(--accent);
}

.balance-display.is-zero-balance {
    background: #f0f7ff;
    border-color: var(--info);
}
.balance-display.is-zero-balance .change-due {
    color: var(--info);
}

/* Numpad (Restored and Corrected) */
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    flex-grow: 1; 
}
.num-btn {
    height: 60px; 
    font-size: 1.4rem; 
    border-radius: 10px;
    border: none;
    background: var(--bg-card);
    color: var(--text-dark);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background 0.1s, transform 0.1s;
}
.num-btn:active {
    transform: scale(0.98);
}
.num-btn.action-btn {
    color: var(--bg-card);
}
.num-btn.backspace-btn {
    background: var(--info);
}
.num-btn.clear-btn {
    background: var(--danger);
}
.num-btn.enter-btn {
    background: var(--accent);
    grid-row: span 2; 
    height: 125px;
    font-size: 1.8rem;
}
.num-btn.large-action-btn {
    grid-row: span 1;
    height: 60px;
}
.num-btn.span-two {
    grid-column: span 2;
}

/* Footer */
.pos-footer {
    padding: 10px;
    text-align: center;
    background: #132a13;
    color: var(--bg-card);
    font-size: 0.9rem;
}


.pos-footer span {
    background-color: black;
    padding: 10px;
    border-radius: 5px;
}
/* ==================================== */
/* Modal Styling (POS & Manager) */
/* ==================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none; 
    place-items: center; 
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.modal-overlay[aria-hidden="false"] {
    display: grid;
    opacity: 1;
}

.modal-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.2s ease-in-out;
}

.modal-overlay[aria-hidden="false"] .modal-card {
    transform: scale(1);
}

.modal-card.modal-small {
    max-width: 400px;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 5px;
}

.modal-product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.modal-input-group {
    margin-bottom: 30px;
}

#modal-qty-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1.3rem;
    font-weight: 700;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    margin-top: 8px;
    text-align: center;
    transition: border-color 0.2s;
}

#modal-qty-input:focus {
    border-color: var(--accent);
    outline: none;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.2s, box-shadow 0.15s; 
}

.modal-btn.primary {
    background: var(--accent);
    color: var(--bg-card);
}
.modal-btn.primary:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--modal-focus);
}

.modal-btn.secondary {
    background: var(--info);
    color: var(--bg-card);
}
.modal-btn.secondary:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--info);
}


.modal-btn:hover {
    opacity: 0.9;
}

.modal-message {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 25px;
    color: var(--text-dark);
    white-space: pre-wrap; 
}

.modal-center-actions {
    justify-content: center;
}

/* =========================================== */
/* HELD SALES MODAL STYLING */
/* =========================================== */

.held-sales-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
}

#no-held-sales {
    color: var(--text-light);
    text-align: center;
    padding: 20px;
}

.held-sale-item-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 5px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.held-sale-item-btn:hover {
    background: rgba(74, 111, 165, 0.1);
    border-color: var(--primary);
}

.held-id {
    font-weight: 800;
    color: var(--primary);
}

.held-meta {
    font-size: 0.9rem;
    color: var(--text-light);
    flex-grow: 1;
    text-align: center;
}

.held-total {
    font-size: 1.1rem;
    color: var(--accent);
}

.held-sale-item-btn:focus,
.held-sale-item-btn:active {
    outline: none; 
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.5); 
    background-color: #e6fffb;
}

/* =========================================== */
/* HELD ORDERS BUTTON BADGE STYLING */
/* =========================================== */

.func-btn[data-action="hold"] {
    position: relative; 
}

.held-count-badge {
    position: absolute;
    top: -8px; 
    right: -8px; 
    background: var(--danger); 
    color: var(--bg-card); 
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 900;
    padding: 2px;
    display: none; 
    transition: transform 0.2s;
}

.held-count-badge[aria-hidden="false"] {
    display: flex; 
    transform: scale(1);
}

/* ========================================================= */
/* MANAGER DASHBOARD & INVENTORY MANAGER STYLES */
/* ========================================================= */

.dashboard-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
    background: var(--bg-main);
    max-width: none; 
    margin: 0;
    box-shadow: none;
    border-radius: 0;
}

/* Ensure the base sidebar has a transition */
.sidebar {
    width: 260px; /* Default width */
    min-width: 260px;
    transition: all 0.3s ease-in-out;
    background-color: #2d3748; /* Matching your dark theme */
    display: flex;
    flex-direction: column;
}

/* This is the class your JavaScript will toggle */
.sidebar.collapsed {
    width: 80px;
    min-width: 80px;
}

/* Hide the text labels when collapsed */
.sidebar.collapsed .nav-link span, 
.sidebar.collapsed h2 {
    display: none;
}

/* Keep the icons visible and centered when collapsed */
.sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.5rem;
    width: 100%;
    text-align: center;
}

/* Adjust the content area when sidebar shrinks */
.dashboard-container {
    display: flex;
    width: 100%;
}

.content-area {
    flex: 1;
    overflow-x: hidden;
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.3rem;
    color: var(--accent);
}

.nav-link {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: background 0.2s;
}

.nav-link i {
    margin-right: 10px;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    border-left: 5px solid var(--accent);
}

.content-area {
    padding: 30px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 10px;
}

/* Logout Button on Manager Dashboard */
.logout-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}
.logout-btn:hover {
    background: #e65a5a;
}

/* Quick Stats Grid */
.quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--info);
}

.stat-card h3 {
    font-size: 1rem;
    color: var(--text-light);
    margin-top: 0;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

/* Inventory Alert Styles */
.alert-box {
    background: #ffe3e3; 
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: none; 
}
.alert-box h3 {
    color: var(--danger);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2rem;
}
.alert-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
}
.alert-item {
    padding: 5px 0;
    border-bottom: 1px dashed #ffb8b8;
}
.alert-item:last-child {
    border-bottom: none;
}


/* ========================================================= */
/* INVENTORY MANAGEMENT PAGE SPECIFIC STYLES (IM) */
/* ========================================================= */

.inventory-controls {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 25px;
}

.im-search-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
}

.im-primary-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.im-primary-btn:hover {
    background: #00a080;
}

/* Table Styles */
.inventory-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
}
.inventory-table {
    width: 100%;
    border-collapse: collapse;
}

.inventory-table th, .inventory-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
	text-transform: uppercase;
}

.inventory-table thead th {
    background: var(--primary);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.inventory-table tbody tr:hover {
    background: var(--bg-main);
    cursor: pointer;
}

.inventory-table td.rx-tag {
    font-weight: 700;
    color: var(--danger);
}

/* Action Buttons in Table */
.im-action-btn {
    background: var(--info);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    margin-right: 5px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
}
.im-action-btn.edit { background: var(--info); }
.im-action-btn.delete { background: var(--danger); }
.im-action-btn.batches { background: var(--primary); }

.delete-product-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    margin-right: 5px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
}



/* Batch Management Area */
#batch-details-area {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}
.im-info-message {
    color: var(--text-light);
    padding: 10px;
    text-align: center;
}
.batch-controls {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}
.batch-table-container {
    max-height: 400px;
    overflow-y: auto;
}
.batch-table {
    width: 100%;
    border-collapse: separate; 
    border-spacing: 0;
}
.batch-table th {
    background: #f0f7ff; 
    color: var(--primary);
}
.batch-table td {
    font-size: 0.95rem;
}

/* Modal Form Styles (Manager CRUD) */
.im-input-group {
    margin-bottom: 15px;
}
.im-input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary);
}
.im-input-group input[type="text"],
.im-input-group input[type="number"],
.im-input-group input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 1rem;
}
.im-input-group.half-width {
    width: calc(50% - 7.5px);
    display: inline-block;
}
.im-checkbox-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}
.im-checkbox-group input {
    margin-right: 10px;
    transform: scale(1.2);
}
.im-batch-title {
    color: var(--accent);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 5px;
    margin-top: 20px;
    margin-bottom: 15px;
}

/* Container for the Title and Add Button */
.batch-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 5px;
    border-bottom: 2px solid #f0f2f5;
}

.batch-title {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.batch-title span {
    color: #3498db; /* Highlights the product name */
    font-weight: 600;
}

/* Button Styling Fix */
#add-batch-btn {
    padding: 8px 16px;
    background-color: #10b981; /* Matches the green in your screenshot */
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

#add-batch-btn:hover {
    background-color: #059669;
}

/* Table Enhancements */
.batch-table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.expired-row {
    background-color: #fff1f2;
}

.status-badge.error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 8px;
}

.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.pag-btn {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.pag-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pag-btn:not(:disabled):hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.pag-info {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
}

/* ========================================================= */
/* SALES REPORT ANALYTICS STYLES */
/* ========================================================= */


.report-container {
    padding: 30px;
}

/* Report Summary Ribbon - Using your existing CSS Grid logic */
.report-summary-ribbon {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    width: 90%;
}

.report-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--primary);
    transition: transform 0.2s;
}

.report-card.revenue {
    border-left-color: var(--accent);
}

.report-card h4 {
    color: var(--text-light);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin: 0 0 10px 0;
}

.report-card .value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
}

/* Filter Bar */
.report-filter-bar {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    width: 90%;
}

.report-filter-bar input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-family: inherit;
    color: var(--text-dark);
}

/* Layout for Analytics Tables */
.reports-layout-grid {
    display: flex;
    /* grid-template-columns: 1.6fr 1fr;
    gap: 25px; */
    width: 90%;
}

.report-section {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 100%;
}

.report-section h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-data-table {
    width: 100%;
    border-collapse: collapse;
}

.report-data-table th {
    text-align: left;
    padding: 12px;
    color: var(--text-light);
    font-size: 0.85rem;
    border-bottom: 2px solid var(--bg-main);
}

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

.tx-id-badge {
    background: rgba(74, 111, 165, 0.1);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
}

.receipt-order-number {
    display: flex;
    flex-direction: row !important;
}

.recept-cashier-order-details{
    width: 100%; 
    text-align: left; 
    font-size: 12px;
     margin-bottom: 10px; 
     display:flex; 
     flex-direction: row; 
     justify-content: center; 
     align-items: flex-end; 
     border-bottom: 1px dashed #000; 
     padding-bottom: 5px;
}

.cashier-details p{
    margin: 0; 
    font-weight: 500;
}




#receipt-print-area {
        display: none;
}


@media print {
    @page {
        size: 80mm auto;
        margin: 0;
    }

    body * {
        display: none !important;
    }

    #receipt-print-area, 
    #receipt-print-area * {
        display: block !important;
        visibility: visible !important;
        /* This line ensures all fonts inside the receipt are equal */
        font-size: 12px !important; 
    }

    #receipt-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        padding: 4mm;
        background: white !important;
        color: black !important;
        font-family: 'Courier New', Courier, monospace;
        margin: 0 auto;
    }

    /* Keep the Title slightly larger if you want branding, otherwise 12px */
    #receipt-print-area h2 {
        font-size: 14px !important;
    }

    /* Force Table behavior for the item list */
    #receipt-print-area table {
        display: table !important;
        width: 100% !important;
    }

    #receipt-print-area thead { display: table-header-group !important; }
    #receipt-print-area tbody { display: table-row-group !important; }
    #receipt-print-area tr { display: table-row !important; }

    #receipt-print-area th, 
    #receipt-print-area td {
        display: table-cell !important;
        padding: 2px 0;
        font-size: 12px !important; /* Forces alignment and size consistency */
    }
    
    /* Small print for footer only */
    #receipt-print-area div p {
        font-size: 10px !important;
    }

    .recipt-header {
        display: flex;
        flex-direction: column;
        align-items: center; /* This centers children horizontally */
        justify-content: center;
        width: 100%; /* Critical for centering */
        text-align: center;
        
    }

.recipt-header img {
    height: 60px;
    width: 80px;
    display: block;      /* Crucial: Change from inline to block */
    margin-left: auto;   /* Force equal margins on both sides */
    margin-right: auto;
    margin-bottom: 5px;
}
}

.pagination-bar {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 20px;
            padding: 15px;
            background: #fff;
            border-top: 1px solid #e2e8f0;
        }
        .pag-btn {
            padding: 8px 16px;
            border: 1px solid #cbd5e1;
            background: white;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: 500;
        }
        .pag-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .pag-btn:not(:disabled):hover { background: #f1f5f9; border-color: #3498db; color: #3498db; }
        .pag-info { font-size: 0.9rem; font-weight: 600; color: #64748b; }
        
        .batch-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
        .batch-title span { color: #3498db; font-weight: bold; }
        .status-badge { padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; }
        .status-badge.success { background: #dcfce7; color: #166534; }
        .status-badge.error { background: #fee2e2; color: #991b1b; }
        .expired-row { background-color: #fff1f2 !important; }



/*======================================================================================*/
    /*LOGIN PAGE STYLE */
/*======================================================================================*/


.login-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 400px;
    text-align: center;
    border: 4px solid #afafaf80;
}
        .login-card h2 {
            color: var(--primary);
            margin-bottom: 25px;
            font-size: 1.8rem;
        }
        .form-input {
            width: 100%;
            padding: 12px;
            margin-bottom: 15px;
            border: 1px solid var(--border-light);
            border-radius: 6px;
            font-size: 1rem;
        }
        .form-btn {
            width: 100%;
            padding: 12px;
            border: none;
            border-radius: 6px;
            background: var(--primary);
            color: white;
            font-weight: bold;
            font-size: 1.1rem;
            cursor: pointer;
            transition: background 0.2s;
        }
        .form-btn:hover {
            background: #00a080;
        }
        .error-message {
            color: var(--danger);
            margin-bottom: 15px;
            font-weight: 600;
        }

        .login-header {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

.login-header img {
    width: 153px;
    height: 100px;
    max-width: 146px;
}


/* --- Expiry Alerts for POS Search Suggestions --- */

/* The main container for the alert inside the s-left div */
.pos-expiry-alert {
    display: block;
    background-color: #fff3cd; /* Soft yellow warning background */
    color: #856404;           /* Dark brown text for high contrast */
    border-left: 5px solid #ffcc00; /* Bright yellow indicator bar */
    padding: 6px 10px;
    margin-top: 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
    line-height: 1.4;
}

/* Critical state for items already expired */
.pos-expiry-critical {
    background-color: #f8d7da; /* Light red background */
    color: #721c24;           /* Deep red text */
    border-left: 5px solid #dc3545; /* Bright red indicator bar */
}

/* Stock Alerts for POS Search */
.pos-stock-warning {
    display: block;
    background-color: #fff4e5; /* Soft orange background */
    color: #b35900;           /* Dark orange text */
    border-left: 5px solid #ff8c00; /* Bold orange vertical bar */
    padding: 4px 8px;
    margin-top: 4px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
}

/* Specific styling for when items are completely empty */
.pos-out-of-stock {
    background-color: #f2f2f2; /* Light grey */
    color: #555555;           /* Dimmed text */
    border-left: 5px solid #999999; /* Grey bar */
}

.pos-ghosted {
    opacity: 0.5;
    background-color: #f9f9f9 !important;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.pos-ghosted:hover {
    background-color: #f9f9f9 !important; /* Prevent hover highlight */
}

.barcode-preview-img {
            height: 30px;
            width: auto;
            background: white;
            border: 1px solid #ddd;
            padding: 2px;
            display: block;
            margin: 2px auto;
        }

        .btn-print-sticker {
            background: #6c757d;
            color: white;
            border: none;
            padding: 8px 8px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
        }

        .btn-print-sticker:hover {
            background: #5a6268;
        }

        .barcode-cell {
            text-align: center;
            font-size: 0.85rem;
        }

        /* NEW STYLES FOR THE GENERATE BUTTON */
        .flex-input-group {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .btn-generate {
            background: #3498db;
            color: white;
            border: none;
            padding: 10px;
            border-radius: 4px;
            cursor: pointer;
            height: 38px;
            margin-top: 5px;
        }

        .btn-generate:hover {
            background: #2980b9;
        }

        /* Style for the Supplier Select Dropdown */
        #p-supplier {
            width: 100%;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 6px;
            background-color: #fff;
            font-size: 14px;
            color: #333;
            cursor: pointer;
            appearance: none;
            /* Removes default arrow in some browsers */
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 10px center;
            background-size: 1em;
            transition: border-color 0.2s, box-shadow 0.2s;
        }

        #p-supplier:focus {
            border-color: #3498db;
            box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
            outline: none;
        }

        #p-supplier option {
            padding: 10px;
        }

        /* Label styling for the group */
        .im-input-group label {
            font-weight: 600;
            margin-bottom: 8px;
            display: block;
            color: #2c3e50;
        }

        .row-expired {
            background-color: #ff4d4d !important;
            color: white !important;
            font-weight: bold;
        }

        .row-soon {
            background-color: #ffcc00 !important;
            color: black !important;
            font-weight: bold;
        }

        .badge-expired {
            background: #000;
            color: #fff;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 10px;
        }

        .badge-soon {
            background: #d9534f;
            color: #fff;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 10px;
        }

        .expired-row { 
    background-color: #ff4d4d !important; 
    color: white !important; 
}

.warning-row { 
    background-color: #ffcc00 !important; 
    color: black !important; 
}

.status-badge.warning {
    background-color: #856404;
    color: #fff;
}