/* Avrina POS - Rich Professional Red/White Theme */

/* Avrina Layout Overrides */
html,
body {
    height: 100%;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

.wrapper {
    /* Ensure wrapper doesn't constrain width */
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    box-sizing: border-box;
}

.container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    /* Padding managed by inline style or defaults */
}

:root {
    /* Brand Colors */
    --brand-red: #D62828;
    /* Rich Red */
    --brand-red-dark: #A41616;
    /* Hover/Active Red */
    --brand-red-light: #FDECEC;
    /* Light Red Backgrounds */
    --brand-white: #FFFFFF;
    --brand-dark: #212529;
    /* Deep Grey for Text */
    --brand-gray: #F4F6F7;
    /* Background Gray */

    /* Functional Colors */
    --primary: var(--brand-red);
    --secondary: #6c757d;
    --success: #28a745;
    /* Keep standard success green for contrast */
    --brand-green: #5cb85c;
    /* Bootstrap success green for Pay button */
    --danger: #dc3545;

    /* Modern UI Tokens */
    --glass-bg: rgba(255, 255, 255, 0.95);
    /* High opacity for professional look */
    --glass-border: rgba(214, 40, 40, 0.1);
    /* Subtle red tint on borders */
    --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --backdrop-blur: 8px;
    --radius-small: 6px;
    --radius-medium: 12px;
    --radius-large: 16px;
    --transition-speed: 0.25s;
    --font-main: 'Poppins', sans-serif;
}

/* 1. Global Reset & Typography */
@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

body {
    background: linear-gradient(-45deg, #f8f9fa, #e9ecef, #f0f3f6, #ffffff);
    background-size: 400% 400%;
    animation: gradient-flow 15s ease infinite;
    /* Subtle living background */
    font-family: var(--font-main);
    color: var(--brand-dark);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-main);
    font-weight: 600;
    color: var(--brand-dark);
}

a {
    color: var(--brand-red);
    text-decoration: none;
}

a:hover {
    color: var(--brand-red-dark);
}

/* 2. Top Navigation (Clean White with Red Highlights) */
.navbar {
    background: var(--brand-white) !important;
    border-bottom: 2px solid var(--brand-red) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    min-height: 80px;
    /* Taller navbar */
    display: flex;
    align-items: center;
}

.navbar-brand {
    color: var(--brand-red) !important;
    font-weight: 700;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    /* Use Flexbox for alignment */
    align-items: center;
    /* Center vertically */
    height: 100%;
    /* Full height of parent */
    padding: 12px 15px 0 15px;
    /* Push down slightly for visual balance */
}

/* Header Icons Styling */
.navbar-nav>li>a {
    color: var(--brand-dark) !important;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
    padding-top: 10px !important;
    padding-bottom: 5px !important;
}

.navbar-nav>li>a i {
    font-size: 24px;
    /* Proper header icon size */
    display: block;
    margin-bottom: 2px;
    /* Tighter gap */
    color: var(--secondary);
    transition: all 0.2s;
}

.menu-label {
    display: block;
    line-height: 1.2;
}

.navbar-nav>li>a:hover {
    background: var(--brand-red-light) !important;
    border-radius: var(--radius-small);
}

.navbar-nav>li>a:hover i,
.navbar-nav>li.active>a i {
    color: var(--brand-red);
    transform: translateY(-2px);
}

.navbar-nav>li.active>a {
    color: var(--brand-red) !important;
}

/* 3. Cards & Panels (Professional White) */
.card,
.panel,
.jumbotron {
    background: var(--brand-white) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: var(--radius-medium) !important;
    box-shadow: var(--glass-shadow) !important;
    margin-bottom: 20px;
}

/* 4. Buttons (Vibrant Red) */
.btn {
    border-radius: var(--radius-small) !important;
    font-family: var(--font-main);
    font-weight: 500;
    padding: 10px 22px;
    letter-spacing: 0.3px;
    border: none !important;
    transition: all var(--transition-speed) ease;
    text-transform: uppercase;
    font-size: 13px;
}

/* Primary Button (Solid Red) */
.btn-primary,
.btn-info {
    background: var(--brand-red) !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(214, 40, 40, 0.3);
}

.btn-primary:hover,
.btn-info:hover {
    background: var(--brand-red-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(214, 40, 40, 0.4);
}

/* Secondary Button (Outline Red/Gray) */
.btn-default {
    background: white !important;
    color: var(--brand-dark) !important;
    border: 1px solid #ddd !important;
}

.btn-default:hover {
    border-color: var(--brand-red) !important;
    color: var(--brand-red) !important;
}

/* 5. Inputs (Clean & Accessible) */
.form-control {
    height: 45px;
    border-radius: var(--radius-small) !important;
    border: 1px solid #e0e0e0;
    padding: 10px 15px;
    background: var(--brand-white);
    font-family: var(--font-main);
    font-size: 14px;
}

.form-control:focus {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px var(--brand-red-light);
}

/* 6. Module Icons (Home Grid) */
#home_module_list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    /* Significant gap for professional spacing */
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.module_item {
    background: var(--brand-white);
    border-radius: var(--radius-medium);
    padding: 30px 20px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    /* Softer, deeper shadow */
    width: 160px;
    /* Fixed width for uniformity */
    height: 160px;
    /* Fixed height for squares */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 !important;
    /* Override default Bootstrap margins */
}

.module_item:hover {
    transform: translateY(-8px);
    border-color: var(--brand-red-light);
    box-shadow: 0 20px 40px rgba(214, 40, 40, 0.15);
    /* Red glow on hover */
}

/* Icon Styling */
.module-icon {
    font-size: 48px;
    color: var(--brand-dark);
    margin-bottom: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.module_item:hover .module-icon {
    color: var(--brand-red);
    transform: scale(1.2) rotate(5deg);
    /* Professional Pop & Tilt */
}

.module_item a {
    text-decoration: none;
    /* Ensure no underline on icon */
}

.module-label {
    color: var(--brand-dark);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

.module_item:hover .module-label {
    color: var(--brand-red);
}

/* 7. Tables (Modern Data) */
.table {
    border-radius: var(--radius-medium);
    overflow: hidden;
    background: white;
}

.table thead th {
    background-color: var(--brand-red) !important;
    color: white !important;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border: none;
    padding: 15px !important;
}

.table tbody tr:hover {
    background-color: var(--brand-red-light) !important;
}

.table td {
    vertical-align: middle !important;
    border-color: #f1f1f1 !important;
    border-color: #f1f1f1 !important;
    color: #444;
}

/* Allow dropdowns to overflow table container */
.table-responsive {
    overflow: visible !important;
    padding-bottom: 150px !important;
    /* Extra space for last row dropdown */
    margin-bottom: 0 !important;
}

.fixed-table-body {
    overflow: visible !important;
    min-height: 500px;
    /* Ensure space, but mainly overflow visible handles it */
}

/* Ensure parents don't clip */
.bootstrap-table,
.fixed-table-container,
.table,
.table tbody {
    overflow: visible !important;
}

/* Standard Dropdown Adjustment */
.table .dropdown-menu {
    margin-top: 5px !important;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15) !important;
}

/* SMART DROPUP: For the last 3 rows, open upwards to avoid clipping */
.table tbody tr:nth-last-child(-n+3) .dropdown-menu {
    top: auto !important;
    bottom: 100% !important;
    margin-bottom: 5px !important;
    margin-top: 0 !important;
    transform-origin: bottom right;
}

/* OVERRIDE: First row MUST always open downwards (avoid header/search bar) */
.table tbody tr:first-child .dropdown-menu {
    top: 100% !important;
    bottom: auto !important;
    margin-top: 5px !important;
    margin-bottom: 0 !important;
    transform-origin: top left;
}

.dropdown-menu {
    border: none !important;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15) !important;
    border-radius: var(--radius-small) !important;
    margin-top: 5px !important;
    z-index: 10000 !important;
    /* Float above everything */
}

/* 8. Sticky Footer */
html,
body {
    height: 100%;
}

.wrapper {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
}

#footer {
    margin-top: auto;
    width: 100%;
    background: var(--brand-white);
    /* White footer */
    border-top: 1px solid #eee;
    text-align: center;
    padding: 20px 0;
    color: #888;
    font-size: 13px;
}

/* 10. Modern Modals */
.modal-content {
    border-radius: var(--radius-medium) !important;
    border: none !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3) !important;
    overflow: hidden;
}

.modal-header {
    background: var(--brand-red) !important;
    color: white !important;
    padding: 20px !important;
    border-bottom: none !important;
}

.modal-title {
    font-weight: 600 !important;
    letter-spacing: 0.5px;
    font-size: 18px;
    text-transform: uppercase;
    color: white !important;
}

.modal-header .close {
    color: white !important;
    opacity: 0.8;
    text-shadow: none !important;
    font-size: 28px;
    font-weight: 300;
    margin-top: -5px;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-body {
    padding: 30px !important;
    background: var(--brand-gray) !important;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Custom Tab Styling for Modals */
.nav-tabs {
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.nav-tabs>li>a {
    color: #555 !important;
    /* Inactive text color: Grey */
    font-weight: 600;
    border: none;
    background: transparent;
    border-radius: 4px 4px 0 0;
    margin-right: 5px;
    padding: 10px 20px;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.nav-tabs>li>a:hover {
    background-color: var(--brand-red-light) !important;
    /* Light red hover */
    color: var(--brand-red) !important;
    border: none;
}

.nav-tabs>li.active>a,
.nav-tabs>li.active>a:hover,
.nav-tabs>li.active>a:focus {
    color: var(--brand-red) !important;
    /* Active text: Brand Red */
    background-color: white !important;
    border: 1px solid #ddd;
    border-bottom-color: transparent;
    cursor: default;
    border-top: 3px solid var(--brand-red) !important;
    /* Active accent */
}

.modal-footer {
    background: white !important;
    padding: 20px !important;
    border-top: 1px solid #eee !important;
}

/* Modal Form Specifics */
.modal-body .form-group label {
    font-weight: 500;
    color: #555;
    font-size: 13px;
    margin-bottom: 8px;
}

.modal-body .form-control {
    background: white !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
}

.modal-body .form-control:focus {
    border-color: var(--brand-red) !important;
    box-shadow: 0 0 0 3px var(--brand-red-light) !important;
}

.modal-body .input-group-addon {
    background: white;
    border: 1px solid #ddd;
    color: #888;
}

/* 
========================================
   11. Cafe Sales Interface (PetPooja Style)
========================================
*/

/* Category Bar (Horizontal Scroll) */
.cafe-category-bar {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
    margin-bottom: 20px;
    margin-top: 10px;
    border-bottom: 2px solid #ddd;
    /* Custom Scrollbar for sleekness */
    scrollbar-width: thin;
    scrollbar-color: var(--brand-red) #f1f1f1;
}

.cafe-category-bar::-webkit-scrollbar {
    height: 6px;
}

.cafe-category-bar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cafe-category-bar::-webkit-scrollbar-thumb {
    background-color: var(--brand-red);
    border-radius: 10px;
}

.cafe-category-btn {
    overflow-y: auto;
    padding-right: 5px;
}

.cafe-category-btn {
    display: block;
    width: 100%;
    margin-right: 0;
    margin-bottom: 8px;
    /* Vertical Spacing */
    padding: 12px 15px;
    background: white;
    border: 1px solid #eee;
    border-radius: var(--radius-small);
    /* Square with slight radius */
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    color: #555;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-align: left;
    /* Align text left */
}

.cafe-category-btn:hover {
    background: #fdfdfd;
    border-color: var(--brand-red);
    color: var(--brand-red);
    transform: translateX(2px);
    /* Slide right instead of lift */
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.cafe-category-btn.active {
    background: var(--brand-red);
    color: white;
    border-color: var(--brand-red);
    box-shadow: 0 2px 8px rgba(217, 83, 79, 0.3);
    border-right: 5px solid #a61c1c;
    /* Accent border on active */
}

.cafe-category-btn:focus {
    outline: none;
}

/* Item Grid */
#cafe-grid-wrapper {
    padding-right: 5px;
}

.cafe-item-card {
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
    border: none;
    border-radius: var(--radius-medium);
    overflow: hidden;
    background: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    /* Soft shadow */
    position: relative;
}

.cafe-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    /* Lift effect */
}

/* Add an overlay effect on hover */
.cafe-item-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: var(--radius-medium);
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.cafe-item-card:hover::after {
    border-color: var(--brand-red);
}

.cafe-item-card .panel-body {
    padding: 15px;
    text-align: center;
    height: 200px;
    /* Taller for better spacing */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.cafe-item-img {
    height: 100px;
    /* Fixed height for consistency */
    width: auto;
    max-width: 100%;
    margin-bottom: 12px;
    object-fit: contain;
    transition: transform 0.2s;
}

.cafe-item-card:hover .cafe-item-img {
    transform: scale(1.1);
}

.cafe-item-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Standard property */
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
    color: #444;
}

.cafe-item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-red);
    background: rgba(217, 83, 79, 0.1);
    /* Light red background */
    padding: 4px 12px;
    border-radius: 12px;
}

/* Cart / Register (Right Column) */
#register_wrapper {
    background: white;
    padding: 20px;
    border-radius: var(--radius-medium);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-top: 5px solid var(--brand-red);
    /* Branding accent */
    height: calc(100vh - 100px);
    /* Fill screen height minus header */
    display: flex;
    flex-direction: column;
}

/* Make table text cleaner */
#register tr td {
    border-bottom: 1px solid #f9f9f9;
}

#register tr th {
    background: #fafafa;
    color: #888;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
}

/* Totals Area */
#sale_totals {
    background: #fbfbfb;
    border-radius: var(--radius-small);
    padding: 10px;
    margin-top: auto;
    /* Push to bottom if flex layout used properly, but here handled by layout structure */
}

/* Fix for sidebar constraint */
#overall_sale {
    width: 100% !important;
    float: none !important;
    max-width: 100% !important;
}

#register_wrapper {
    width: 100% !important;
    float: none !important;
    max-width: 100% !important;
}

#sale_total {
    font-size: 26px;
    font-weight: 800;
    color: var(--brand-red);
    letter-spacing: -0.5px;
}

/* Pay Button */
/* Pay Button */
#add_payment_button {
    background: var(--brand-green);
    border: none;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
    height: 46px !important;
    /* Matched to input-group-lg */
    line-height: normal;
    /* remove hardcoded line-height */
    display: flex;
    /* Centering */
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border-radius: 0 4px 4px 0 !important;
    /* Fix radius for input group */
    margin: 0 !important;
    /* Force alignment */
}

#add_payment_button:hover {
    background: #4cae4c;
    /* Darker green */
    transform: none;
    box-shadow: 0 5px 15px rgba(76, 174, 76, 0.4);
}

/* Fix Amount Tendered Input Group */
#payment_details .input-group-lg .form-control {
    height: 46px !important;
    font-size: 18px;
    border-radius: 4px 0 0 4px !important;
    border: 1px solid #ddd;
    box-shadow: none;
    z-index: 0;
}

#payment_details .input-group-addon {
    font-size: 14px;
    background: #f8f9fa;
    color: #555;
    border: 1px solid #ddd;
    border-right: none;
}

/* Cart Table Inputs (Quantity/Price) */
#register_wrapper input.form-control {
    border: 1px solid #eee;
    box-shadow: none;
    text-align: center;
    font-weight: 600;
    color: #333;
    border-radius: 4px;
}

#register_wrapper input.form-control:focus {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 2px rgba(217, 83, 79, 0.1);
}

/* Bottom Action Buttons (Suspend/Cancel) */
#buttons_form .btn-group {
    display: flex;
    gap: 15px;
    /* Spacing between buttons */
    width: 100%;
}

#buttons_form .btn-group .btn-group {
    flex: 1;
    /* Equal width */
    width: auto !important;
    /* Override standard btn-group width */
}

/* Modern Action Dropdown */
.action-dropdown-menu {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
    padding: 8px !important;
    min-width: 180px;
    margin-top: 5px !important;
    background: white !important;
    animation: fadeUp 0.2s ease-out;
}

.action-dropdown-menu li {
    margin-bottom: 2px;
}

.action-dropdown-menu>li>a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 15px !important;
    border-radius: 8px;
    color: #444 !important;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none !important;
}

.action-dropdown-menu>li>a:hover {
    background-color: #FFF0F0 !important;
    color: var(--brand-red) !important;
    transform: translateX(5px);
}

.action-dropdown-menu>li>a i {
    width: 20px;
    text-align: center;
    margin-right: 5px;
}

/* Enhanced Header Card Gradient */
.manage-container .card h4 {
    background: linear-gradient(90deg, #333, #666);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 24px;
    letter-spacing: -0.5px;
}

/* Button Upgrades */
.btn-primary.shadow-sm {
    background: var(--brand-red) !important;
    border: none;
    box-shadow: 0 4px 15px rgba(214, 40, 40, 0.3) !important;
}

.btn-primary.shadow-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(214, 40, 40, 0.4) !important;
}

.manage-container .table-responsive {
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

#suspend_sale_button,
#cancel_sale_button {
    width: 100%;
    border-radius: 4px !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    height: 40px;
    /* Consistent height */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Customer Input Group Alignment */
#select_customer_form .input-group-lg {
    display: flex !important;
    align-items: center;
    width: 100% !important;
}

#select_customer_form .input-group-lg .input-group-addon {
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    line-height: 44px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 0;
    flex: 0 0 auto;
    /* Do not shrink/grow */
    width: 46px;
    /* Fixed width */
}

#select_customer_form .input-group-lg .form-control {
    height: 46px !important;
    font-size: 16px;
    margin: 0 !important;
    z-index: 2;
    flex: 1 1 auto;
    /* Grow and shrink */
    width: 1% !important;
    /* Standard bootstrap flex fix */
    min-width: 0;
}

#select_customer_form .input-group-lg .input-group-btn {
    width: auto !important;
    flex: 0 0 auto;
    /* Do not shrink */
    display: block;
}

#select_customer_form .input-group-lg .btn {
    height: 46px !important;
    margin: 0 !important;
    width: 46px !important;
    /* Fixed button width */
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 4px 4px 0 !important;
}



#select_customer_form .input-group-btn {
    height: 46px !important;
    vertical-align: top;
}

#suspend_sale_button {
    background: #f0ad4e;
    color: white;
}

#suspend_sale_button:hover {
    background: #ec971f;
}

#cancel_sale_button {
    background: white;
    color: #d9534f;
    border: 1px solid #d9534f;
}

#cancel_sale_button:hover {
    background: #fee;
}

/* Complete Sale Button */
#finish_sale_button {
    background: var(--brand-red);
    border: none;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 18px;
    padding: 15px;
    border-radius: var(--radius-small);
    box-shadow: 0 5px 20px rgba(217, 83, 79, 0.4);
    transition: all 0.2s;
}

#finish_sale_button:hover {
    background: #c9302c;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(217, 83, 79, 0.5);
}

/* =========================================
   12. ADVANCED POS STYLING (Impressive UI)
========================================= */

/* --- 1. Category Sidebar (Left) --- */
.cafe-category-bar {
    padding: 10px 5px;
    height: calc(100vh - 100px);
    overflow-y: auto;
    background: transparent;
    /* Clean bg */
}

/* Scrollbar polish */
.cafe-category-bar::-webkit-scrollbar {
    width: 4px;
}

.cafe-category-bar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.cafe-category-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 12px;
    padding: 15px 20px;
    padding-right: 40px;
    /* Extra space for active dot */
    background: white;
    border: none;
    border-radius: 15px;
    /* Softer pill shape */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    color: #555;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    text-transform: capitalize;
}

.cafe-category-btn:hover {
    transform: translateX(5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    color: var(--brand-red);
}

.cafe-category-btn.active {
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
    color: white;
    box-shadow: 0 8px 25px rgba(214, 40, 40, 0.4);
}

.cafe-category-btn.active::after {
    content: '';
    position: absolute;
    right: 15px;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* --- 2. Search Bar (Omnibar) --- */
#top_bar_search .panel-body {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

#top_bar_search .input-group {
    background: white;
    border-radius: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    padding: 5px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.3s;
}

#top_bar_search .input-group:hover,
#top_bar_search .input-group:focus-within {
    box-shadow: 0 10px 30px rgba(214, 40, 40, 0.15);
    border-color: rgba(214, 40, 40, 0.2);
}

#top_bar_search .form-control {
    border: none;
    box-shadow: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    height: 45px;
}

#top_bar_search .input-group-addon {
    background: transparent;
    border: none;
    color: var(--brand-red);
    font-size: 18px;
    padding-left: 20px;
}

#new_item_button {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-red-light);
    color: var(--brand-red);
    border: none;
    margin-right: 5px;
    transition: all 0.3s;
}

#new_item_button:hover {
    background: var(--brand-red);
    color: white;
    transform: rotate(90deg);
}

/* --- 3. Item Grid (Center) --- */
#item-grid {
    padding: 10px;
}

/* Ensure Grid items have card look even if generated structurally */
#item-grid>div {
    /* Assuming col-md-3 or similar */
    margin-bottom: 25px;
}

.item-card-wrapper {
    /* Put this class on item container if possible, or target generic */
    background: white;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.02);
    cursor: pointer;
}

.item-card-wrapper:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.item-image {
    height: 160px;
    width: 100%;
    object-fit: contain;
    /* or cover */
    padding: 15px;
    background: #fdfdfd;
    transition: transform 0.4s;
}

.item-card-wrapper:hover .item-image {
    transform: scale(1.1);
}

.item-info {
    padding: 15px;
    background: white;
    text-align: center;
    border-top: 1px solid #f5f5f5;
}

.item-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 5px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-price {
    display: inline-block;
    padding: 5px 15px;
    background: var(--brand-red-light);
    color: var(--brand-red);
    border-radius: 20px;
    font-weight: 800;
    font-size: 14px;
}

/* --- 4. Receipt Panel (Right) - Fixed Professional Layout --- */
#register_wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    /* Adjust based on header/footer */
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.cart-header {
    background: white;
    z-index: 20;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    background: white;
}

/* Custom Scrollbar for Cart */
.cart-body::-webkit-scrollbar {
    width: 6px;
}

.cart-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cart-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.cart-body::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.cart-footer {
    background: white;
    z-index: 20;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
}

/* Refined Table Styles for Cart */
#register thead tr th {
    background: #f9f9f9;
    color: #888;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 12px 8px;
    border-bottom: 2px solid #eee;
}

#register tbody tr td {
    border-bottom: 1px solid #fcfcfc;
    padding: 12px 8px;
    vertical-align: middle;
    font-size: 13px;
    color: #444;
}

#register tbody tr:hover {
    background-color: #fefefe;
}

/* Qty Inputs Refined */
.btn-decrease-qty,
.btn-increase-qty {
    width: 24px;
    height: 24px;
    line-height: 24px;
    font-size: 10px;
    background: #f0f0f0;
    color: #666;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-decrease-qty:hover {
    color: var(--brand-red);
    background: #ffebeb;
}

.btn-increase-qty:hover {
    color: var(--brand-green);
    background: #ebfbee;
}

/* Quantity Input Field - Corrected Visibility */
#register tbody tr td input[name="quantity"] {
    font-size: 16px !important;
    font-weight: 800 !important;
    text-align: center;
    border: 1px solid #ddd;
    background: #fff;
    width: 60px;
    color: #333;
    padding: 0;
    margin: 0 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    outline: none;
    height: 32px;
    line-height: 32px;
    border-radius: 6px;
}

#register tbody tr td input[name="quantity"]:focus {
    color: var(--brand-red);
}

/* Totals Area */
#sale_totals {
    background: transparent;
    box-shadow: none;
    padding: 0;
    border-top: none;
    margin-top: 0;
}

/* Action Buttons Grid */
/* Complete Sale Button */
#finish_sale_button {
    background: var(--brand-green);
    color: white;
    font-size: 18px;
    font-weight: 800;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(92, 184, 92, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    margin-top: 10px;
    transition: all 0.3s;
}

#finish_sale_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(92, 184, 92, 0.4);
    background: #398439;
}

/* =========================================
   13. CONFIGURATION PAGE PREMIUM STYLES
========================================= */

/* --- 1. Modern Nav Tabs --- */
.nav-tabs {
    border-bottom: none !important;
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
}

.nav-tabs>li {
    margin-bottom: 5px;
}

.nav-tabs>li>a {
    color: #555;
    background: transparent;
    border: none !important;
    border-radius: 30px !important;
    /* Pill shape */
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.nav-tabs>li>a:hover {
    background: #f0f0f0;
    color: var(--brand-red);
    transform: translateY(-2px);
}

.nav-tabs>li.active>a,
.nav-tabs>li.active>a:hover,
.nav-tabs>li.active>a:focus {
    background: var(--brand-red) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(214, 40, 40, 0.3);
    cursor: default;
}

/* --- 2. Tab Content Card Wrapper --- */
.tab-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    /* Premium soft shadow */
    border: 1px solid rgba(0, 0, 0, 0.02);
    min-height: 500px;
    /* Ensure visual weight */
    margin-bottom: 40px;
}

/* --- 3. Form Refinement inside Config --- */
.form-horizontal .control-label {
    text-align: left !important;
    /* Align labels left for cleanliness */
    font-weight: 600;
    color: var(--brand-red);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 12px;
    /* Center with input */
}

/* Specific fix for inputs in config to match premium inputs */
.form-horizontal .form-control {
    height: 45px;
    border-radius: 8px !important;
    border: 1px solid #e0e0e0;
    box-shadow: none !important;
    font-size: 14px;
    background: #fdfdfd;
    transition: all 0.2s;
}

.form-horizontal .form-control:focus {
    border-color: var(--brand-red);
    background: white;
    box-shadow: 0 0 0 3px rgba(214, 40, 40, 0.1) !important;
}

/* Input Groups (Icons) */
.form-horizontal .input-group-addon {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-right: none;
    color: #888;
    border-radius: 8px 0 0 8px !important;
}

/* Fix input corner radius when next to addon */
.form-horizontal .input-group .form-control {
    border-radius: 0 8px 8px 0 !important;
}

/* Section Dividers */
fieldset legend {
    border-bottom: 2px solid #f0f0f0;
    font-weight: 700;
    color: #333;
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-size: 18px;
}

/* Required Fields Message */
#required_fields_message {
    font-style: italic;
    color: var(--secondary);
    margin-bottom: 20px;
    text-align: center;
    font-size: 13px;
}

/* Submit Button Placement */
input[type='submit'],
#submit_info,
#submit_general,
#submit_tax,
#submit_barcode,
#submit_stock,
#submit_receipt,
#submit_invoice,
#submit_reward,
#submit_table {
    padding: 12px 30px !important;
    font-size: 14px !important;
    margin-top: 20px;
    border-radius: 30px !important;
    letter-spacing: 1px;
}

/* Fix for Pagination Text Cutoff */
.fixed-table-pagination {
    padding: 0 20px 20px 20px !important;
}

/* Ensure pagination info doesn't touch the edge */
.fixed-table-pagination .pagination-detail {
    margin-left: 10px;
}

/* Ensure pagination buttons don't touch the edge */
.fixed-table-pagination .pagination {
    margin-right: 10px;
}

/* =========================================
   14. PREMIUM SALES REGISTER BUTTONS
========================================= */

/* COMPLETE SALE BUTTON (Premium Vibrant Green) */
#finish_sale_button {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 16px;
    padding: 18px 20px !important;
    border-radius: 50px !important;
    /* Full pill shape */
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 100%;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
}

#finish_sale_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.5);
    filter: brightness(1.05);
}

/* Add a subtle shine to the finish button */
#finish_sale_button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

#finish_sale_button:hover::after {
    left: 100%;
}

/* SECONDARY ACTION BUTTONS (Hold, Cancel, etc.) */
#buttons_form .btn {
    border-radius: 8px !important;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    padding: 12px 10px;
    border: none !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Suspend/Hold - Warm Orange/Yellow */
#suspend_sale_button {
    background: #fff3cd !important;
    color: #856404 !important;
}

#suspend_sale_button:hover {
    background: #ffeeba !important;
    transform: translateY(-2px);
}

/* Cancel - Soft Grey/Red */
#cancel_sale_button {
    background: #f8f9fa !important;
    color: #dc3545 !important;
    border: 1px solid #eee !important;
}

#cancel_sale_button:hover {
    background: white !important;
    color: #a71d2a !important;
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.15);
    transform: translateY(-2px);
}

/* Complementary - Purple/Brand */
#customer_rewards_button {
    background: linear-gradient(135deg, #6f42c1, #5a32a3) !important;
    color: white !important;
}

/* General button polish in register */
#register_wrapper .btn {
    letter-spacing: 0.5px;
}

@media print {

    /* Hide Everything by Default */
    body * {
        visibility: hidden;
        margin: 0;
        padding: 0;
        background: white !important;
    }

    /* Show Print Header */
    .print-header,
    .print-header * {
        visibility: visible;
        display: block !important;
    }

    .print-header {
        display: flex !important;
        align-items: center;
        border-bottom: 2px solid #000;
        padding-bottom: 20px;
        margin-bottom: 20px;
        width: 100%;
        position: relative;
        left: 0;
        top: 0;
    }

    .print-header-left {
        flex: 0 0 auto;
        margin-right: 20px;
    }

    .print-header-logo {
        max-height: 60px;
        /* Resize Logo Smaller */
        width: auto;
    }

    .print-header-info {
        flex: 1;
        text-align: left;
    }

    .print-header-title {
        font-size: 20px;
        font-weight: 800;
        text-transform: uppercase;
        margin: 0 0 5px 0;
        color: #000;
    }

    .print-header-meta {
        font-size: 11px;
        color: #333;
        margin-bottom: 2px;
    }

    /* Show Table */
    .fixed-table-container,
    .fixed-table-body,
    table,
    table * {
        visibility: visible;
    }

    /* Explicitly positioning the table container */
    .fixed-table-container {
        position: relative;
        top: 0;
        width: 100%;
        border: none !important;
    }

    /* Table Styling */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 10px;
        /* Smaller font to fit */
        table-layout: fixed;
        /* Force column widths to respect table width */
        margin-top: 0 !important;
    }

    /* Override Main Theme Specificity */
    .table thead th,
    th {
        background: transparent !important;
        background-color: transparent !important;
        color: #000 !important;
        font-weight: bold;
        text-transform: uppercase;
        padding: 4px !important;
        /* Smaller padding */
        border: 1px solid #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        word-wrap: break-word;
    }

    /* Ensure rows don't have hover colors */
    .table tbody tr:hover {
        background-color: transparent !important;
    }

    td {
        padding: 4px !important;
        /* Smaller padding */
        border: 1px solid #000 !important;
        vertical-align: middle;
        word-wrap: break-word;
        overflow-wrap: break-word;
        color: #000 !important;
    }

    /* Specific Column Corrections */
    /* ID Column - Small */
    .table thead th:first-child,
    th:first-child,
    td:first-child {
        width: 40px !important;
        text-align: center;
    }

    /* Hide Actions/Checkboxes/Search/Pagination */
    .print_hide,
    .bs-checkbox,
    .print-hide,
    .fixed-table-toolbar,
    /* Hides Search Bar & Buttons */
    .fixed-table-pagination,
    /* Hides "Showing x of y rows" */
    .search,
    .columns,
    .btn-group {
        display: none !important;
        visibility: hidden !important;
    }

    /* Hide Navbar/Footer/Buttons */
    .navbar,
    #footer,
    .btn-toolbar,
    #toolbar,
    .modal {
        display: none !important;
    }

    @page {
        margin: 1cm;
        size: auto;
    }
}