/* ============================== Root Variables ============================== */
:root {
    --primary: #717954;
    --secondary: #717954;
    --accent: #d7ccc8;
    --light: #ffffff;
    --dark: #717954;
    --gold: #d4af37;

    --primary-bg: rgb(113, 121, 84);
    --secondary-bg: rgb(90, 96, 67);
    --accent-color: #d35400;
    --text-color: #fff;

    --border-color: rgba(255, 255, 255, 0.2);
    --hover-bg: rgba(255, 255, 255, 0.1);
    --primary-dark: #69714e;
    --primary-light: #7e8564;
    --hover-dark: #5a6043;
    --coffee-bg: #6f775260;

    /* Add these for status colors */
    --status-active: #788b5c;
    --status-inactive: #fff3cd;
    --status-pending: #fff3cd;
    --status-completed: #d4edda;
    --status-processing: #cce5ff;

    /* Text colors for status */
    --status-text-active: #ffffff;
    --status-text-inactive: #856404;
    --status-text-pending: #856404;
    --status-text-completed: #155724;
    --status-text-processing: #004085;

    /* New variables for login/register and buttons */
    --login-bg: #717954;
    --login-primary: #4e342e;
    --login-secondary: #795548;
    --login-light: #efebe9;
    --login-dark: #3e2723;
    --login-gradient-start: #6a4e42;
    --login-gradient-end: #4d471e;
    --register-gradient-start: #6a4e42;
    --register-gradient-end: #795548;
    --button-hover-dark: #46312e;
}

.sidebar-divider {
    /* Resets default <hr> styles */
    border: none;
    height: 1px;
    margin: 1rem 0;
    background-color: #7e8564;
    opacity: 0.65;
}

/* ============================== Font Definitions ============================== */
@font-face {
    font-family: "Nokora";
    src: url("/admins/font/Nokora-Regular.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "Nokora";
    src: url("/admins/font/Nokora-Bold.ttf") format("truetype");
    font-weight: bold;
    font-style: normal;
}

/* Font Classes */
.kh-font {
    font-family: "Nokora", "Source Sans Pro", sans-serif;
}

.en-font {
    font-family: "Source Sans Pro", sans-serif;
}

/* ============================== General Body Styling ============================== */
body {
    font-family: "Nokora", "Source Sans Pro", sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f8f9fa;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 200 200'%3E%3Cpath fill='%23d4b885' fill-opacity='0.1' d='M42.7,57.7L27.2,73.2l15.5,15.5L58.2,73.2L42.7,57.7z M73.2,27.2L57.7,42.7L73.2,58.2l15.5-15.5L73.2,27.2z M104.5,57.7L89,73.2l15.5,15.5l15.5-15.5L104.5,57.7z M73.2,89L57.7,104.5L73.2,120l15.5-15.5L73.2,89z'%3E%3C/path%3E%3C/svg%3E");
    background-size: 400px;
}

/* ============================== Navbar Styling ============================== */
.navbar {
    background: linear-gradient(135deg, var(--primary-bg), var(--secondary-bg));
    border-bottom: 2px solid var(--border-color);
    height: 70px;
    padding: 0.4rem 0;
    flex-wrap: nowrap;
}

.navbar .container-fluid {
    flex-wrap: nowrap;
    align-items: center;
    height: 100%;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--light) !important;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-left: 0 !important;
    flex-shrink: 0;
    white-space: nowrap;
}

.navbar-brand i {
    color: var(--gold);
    margin-right: 8px;
}

.navbar-brand:hover {
    background-color: var(--hover-bg);
}

#navbarNav {
    flex-grow: 1;
    justify-content: flex-end;
    margin-left: auto;
    gap: 0.5rem;
}

.navbar-nav .nav-link {
    color: var(--text-color) !important;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.navbar-nav .nav-link:hover {
    background-color: var(--hover-bg);
    border: 1px solid var(--border-color);
}

.navbar-nav .nav-item .nav-link.position-relative {
    margin-right: 0;
    padding: 0.5rem;
}

/* ============================== Custom Number Badge Styling ============================== */
.number-badge {
    background-color: var(--primary-bg);
    color: var(--light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 3px 5px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 28px;
    height: 24px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-item:hover .number-badge {
    background-color: var(--hover-bg);
    color: var(--light);
    border-color: var(--border-color);
    border: 1px solid var(--border-color);
}

.dropdown-item.active .number-badge {
    background-color: var(--primary-light);
    color: var(--light);
    border-color: var(--dark);
    border: 1px solid var(--border-color);
}

/* Ensure proper spacing for dropdown items with number badges */
.dropdown-item {
    padding: 10px 16px;
    position: relative;
}

/* ============================== End Custom Number Badge Styling ============================== */

/* ============================== Navbar Mobile Fix ============================== */
@media (max-width: 768px) {
    .navbar-nav {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .navbar-nav .nav-link {
        padding: 0.5rem !important;
        font-size: 0.9rem;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        height: 40px;
    }

    .navbar-nav .nav-link.position-relative {
        padding: 0.5rem !important;
        margin-right: 0;
    }

    /* Ensure all icons have consistent size */
    .navbar-nav .nav-link i {
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Specific fix for save icon */
    #save-orders-btn i {
        font-size: 1.2rem !important;
    }

    /* Specific fix for bell icon */
    .fa-bell {
        font-size: 1.2rem !important;
    }

    /* ============================== Notification Badge Styling ============================== */

    /* User dropdown adjustments */
    #navbarDropdown {
        padding: 0.5rem !important;
        min-width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #navbarDropdown .fa-chevron-down {
        margin-left: 0.25rem !important;
        font-size: 0.8rem;
    }

    /* Hide text in user dropdown on mobile */
    #navbarDropdown span:not([class]) {
        display: none !important;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
}

/* Extra small mobile optimization */
@media (max-width: 576px) {
    .navbar-nav {
        gap: 0.3rem;
    }

    .navbar-nav .nav-link {
        padding: 0.4rem !important;
        min-width: 36px;
        height: 36px;
    }

    #navbarDropdown {
        padding: 0.4rem !important;
        min-width: 36px;
        height: 36px;
    }
}

/* Ensure consistent hover states */
.navbar-nav .nav-link:hover {
    background-color: var(--hover-bg);
    transition: all 0.3s ease;
}

/* Active state for better visual feedback */
.navbar-nav .nav-link:active {
    transform: scale(0.95);
}

/* ============================== Sidebar Styling ============================== */
#sidebar {
    width: 270px;
    background: linear-gradient(180deg, var(--primary-bg), var(--secondary-bg));
    color: var(--text-color);
    padding: 1.5rem 1rem;
    border-right: 2px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 70px;
    left: 0;
    height: calc(100% - 70px);
    z-index: 1000;
    overflow-y: auto;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

#sidebar::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Webkit browsers */
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
}

.sidebar {
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary));
    color: white;
    /* min-height: calc(100vh - 70px); */
    box-shadow: 3px 0 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    position: sticky;
    top: 70px;

    /* Ensure sidebar has proper height and scrolling */
    overflow-y: auto; /* Explicitly enable scrolling */
}

.sidebar-sticky {
    position: sticky;
    top: 0;
}

body.sidebar-collapsed #sidebar {
    margin-left: -270px;
    opacity: 0;
    pointer-events: none;
}

body.sidebar-collapsed #mainContent {
    margin-left: 0 !important;
}

@media (max-width: 768px) {
    #sidebar {
        top: 60px;
        height: calc(100vh - 60px);
        width: 250px;
    }

    .sidebar {
        min-height: calc(100vh - 60px);
        top: 60px;
    }

    body.sidebar-collapsed #sidebar {
        margin-left: -250px;
    }

    #mainContent {
        margin-left: 0 !important; /* On mobile, no margin when expanded, full when collapsed */
    }
}

/* ============================== Hide Scrollbar but Allow Scrolling ============================== */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow-y: auto; /* ធានា scroll នៅពេញ */
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ============================== End Hide Scrollbar but Allow Scrolling ============================== */

/* ============================== Sidebar Navigation Links ============================== */
.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    border-left: 3px solid transparent;
    padding: 12px 20px;
    margin: 5px 0;
    transition: all 0.2s;
    font-size: 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1),
        var(--primary)
    );
    color: var(--light);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    background-color: var(--hover-bg);
    border-color: rgba(255, 255, 255, 0.4);
}

.sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 10px;
    color: var(--accent);
}

/* ============================== Nav Badge Positioning & Styling ============================== */
.nav-badge {
    background-color: var(--primary-bg);
    color: var(--light);
    border: 1px solid var(--border-color);
    border-radius: 8px !important;
    padding: 3px 5px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 28px;
    height: 24px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Positioning */
    position: absolute;
    top: -8px;
    right: -5px;
    z-index: 1;
}

/* Wrapper for positioning */
.nav-item.dropdown .nav-link {
    position: relative;
}

/* Hover effect for badge */
.custom-dropdown-toggle:hover .nav-badge {
    background: var(--primary-bg);
}

/* Active state for badge */
.custom-dropdown-toggle.active .nav-badge {
    background: var(--primary);
    color: var(--light) !important;
    border-color: var(--border-color);
}

/* Remove left margin since we're using absolute positioning */
.nav-badge.ms-2 {
    margin-left: 0 !important;
}

/* ============================== Custom Dropdown Icon Positioning ============================== */
.custom-dropdown-toggle .fa-chevron-down {
    margin-left: 8px;
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.custom-dropdown-toggle[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-badge {
        top: -8px;
        right: -5px;
        font-size: 0.75rem;
        padding: 3px 8px;
        min-width: 28px;
        height: 24px;
    }

    .custom-dropdown-toggle .fa-chevron-down {
        margin-left: 6px;
        font-size: 0.7rem;
    }
}

/* ============================== End Nav Badge Positioning & Styling ============================== */

/* ============================== Dropdown Menus ============================== */
.dropdown-menu {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    min-width: 200px;
    padding: 12px;
    margin-top: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
    z-index: 1050;
}

.dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.dropdown-menu .btn {
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.dropdown-menu .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    color: var(--text-color) !important;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--hover-bg);
    border: 1px solid var(--border-color);
    transform: none;
    outline: none;
}

.dropdown-item:active {
    background-color: rgba(255, 255, 255, 0.15);
}

.sidebar .dropdown-menu {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-left: 10px;
    width: calc(100% - 20px);
    padding: 12px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
}

.sidebar .dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.sidebar .dropdown-item {
    color: var(--text-color);
    font-size: 0.9rem;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.sidebar .dropdown-item.active {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1),
        var(--primary)
    );
    color: var(--light);
    border-left: 3px solid var(--gold);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transform: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.sidebar .dropdown-item:hover,
.sidebar .dropdown-item:focus {
    background-color: var(--hover-bg);
    border: 1px solid var(--border-color);
    transform: none;
    outline: none;
}

.custom-dropdown-toggle .fa-chevron-down,
#navbarDropdown .fa-chevron-down {
    transition: transform 0.3s ease;
}

.custom-dropdown-toggle[aria-expanded="true"] .fa-chevron-down,
#navbarDropdown[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.navbar .user-avatar {
    transition: transform 0.3s ease;
}

.navbar .dropdown-menu.show .user-avatar {
    transform: none;
}

.dropdown-menu .dropdown-item {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dropdown-menu.show .dropdown-item {
    opacity: 1;
    transform: translateX(0);
}

.dropdown-menu .dropdown-item:nth-child(1) {
    transition-delay: 0.1s;
}

.dropdown-menu .dropdown-item:nth-child(2) {
    transition-delay: 0.2s;
}

.dropdown-menu .dropdown-item:nth-child(3) {
    transition-delay: 0.3s;
}

.dropdown-menu .dropdown-item:nth-child(4) {
    transition-delay: 0.4s;
}

.custom-dropdown-toggle:hover,
#navbarDropdown:hover {
    background: var(--hover-bg);
    color: var(--light);
}

@media (max-width: 768px) {
    .dropdown-menu {
        min-width: 160px;
        padding: 8px;
        margin-top: 6px;
    }

    .sidebar .dropdown-menu {
        margin-left: 8px;
        width: calc(100% - 16px);
        padding: 8px;
    }

    .sidebar .dropdown-item {
        font-size: 0.85rem;
        padding: 8px 12px;
        margin-bottom: 6px;
    }

    .dropdown-menu-end {
        right: 0;
        left: auto;
        margin-right: 0;
    }

    .dropdown-menu.dropup {
        margin-bottom: 6px;
    }
}

/* ============================== Modal Styling ============================== */
.modal-content {
    border-radius: 15px; /* 12px border-radius as requested */
    border: 2px solid var(--border-color);
    color: var(--primary);
}

.modal-header {
    border-radius: 12px; /* Rounded top corners */
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding: 15px 20px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-radius: 12px; /* Rounded bottom corners */
    border-top: 2px solid var(--border-color);
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================== Coffee Theme Modal Body Styles ============================== */
.modal.coffee-theme .modal-body {
    background-color: #ffffff;
    padding: 25px;
    color: #3e2723;
}

.modal.coffee-theme .modal-body .container-fluid {
    padding: 0;
}

.modal.coffee-theme .modal-body .row {
    margin-bottom: 15px;
}

.modal.coffee-theme .modal-body .form-label {
    color: #69714e;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.modal.coffee-theme .modal-body .form-label i {
    color: #717954;
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.modal.coffee-theme .modal-body p {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background-color: rgba(113, 121, 84, 0.05);
    border-left: 3px solid #d7ccc8;
    color: #3e2723;
    font-weight: 500;
    line-height: 1.5;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.modal.coffee-theme .modal-body img {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    border: 1px solid #e0e0e0;
}

/* Specific styling for image section */
.modal.coffee-theme .modal-body .col-12:first-child {
    margin-bottom: 20px;
}

.modal.coffee-theme .modal-body .col-12:first-child .form-label {
    font-size: 1rem;
    margin-bottom: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal.coffee-theme .modal-body {
        padding: 20px 15px;
    }

    .modal.coffee-theme .modal-body p {
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .modal.coffee-theme .modal-body .form-label {
        font-size: 0.9rem;
    }
}

/* ============================== End Modal Styling ============================== */
/*  */
/* ============================== Logout Item Styling ============================== */
.logout-item {
    color: var(--accent-color) !important;
    background: linear-gradient(
        135deg,
        var(--hover-bg),
        rgba(255, 255, 255, 0.15)
    );
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.logout-item:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0.3)
    );
    border: 1px solid var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.logout-item:active,
.logout-item:focus {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15),
        rgba(255, 255, 255, 0.2)
    );
    border: 1px solid var(--accent-color);
    outline: none;
    transform: translateY(0);
}

.logout-item i {
    font-size: 1.3rem;
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.logout-item:hover i {
    transform: none;
}

.logout-item:active i {
    animation: rotateIcon 0.4s ease;
}

@media (max-width: 768px) {
    .logout-item {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .logout-item i {
        font-size: 1.1rem;
        margin-right: 8px;
    }
}

/* ============================== Sidebar Toggle Styling ============================== */
#sidebarToggle {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    background-color: var(--hover-bg);
    color: white;
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
    margin-right: 0.4rem;
    margin-left: 0.4rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sidebarToggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#sidebarToggle i {
    transition: transform 0.3s ease;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    #sidebarToggle {
        width: 38px;
        height: 38px;
        margin-right: 0.4rem;
        margin-left: 0.4rem;
    }

    #sidebarToggle i {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    #sidebarToggle {
        width: 36px;
        height: 36px;
        margin-right: 0.4rem;
        margin-left: 0.4rem;
    }

    #sidebarToggle i {
        font-size: 0.9rem;
    }
}

/* ============================== Main Content Styling ============================== */
#mainContent {
    margin-left: 270px;
    flex-grow: 1;
    padding: 2rem 0.5rem 2rem 0.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    min-height: calc(100vh - 70px - 1rem);
}

.main-content {
    padding: 22px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
    margin-top: 5px;
}

@media (max-width: 768px) {
    #mainContent {
        margin-left: 0;
        padding: 1rem 1rem 3rem 1rem;
    }
}

/* ============================== Wrapper Styling ============================== */
#wrapper {
    display: flex;
    min-height: calc(100vh - 70px);
    overflow: hidden;
}

.page-wrapper {
    flex: 1;
}

/* ============================== Dashboard Card Styling ============================== */
.dashboard-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    height: 100%;
}

.dashboard-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(
        135deg,
        var(--secondary) 0%,
        var(--primary) 100%
    );
    color: white;
    font-weight: 600;
    padding: 15px 20px;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--secondary);
    font-weight: 600;
}

@media (max-width: 768px) {
    .stat-number {
        font-size: 1.8rem;
    }
}

/* ============================== User Welcome Styling ============================== */
.user-welcome {
    background: var(--primary);
    color: var(--light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.user-welcome h2 {
    font-weight: 600;
    font-size: 1.75rem;
    color: var(--light);
    margin-bottom: 0;
}
.welcome-text {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--light);
}

.user-position {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    display: inline-block;
}

/* ============================== Dashboard Title ============================== */
.dashboard-title {
    color: var(--primary-dark);
    font-weight: 700;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: inline-block;
}

/* ============================== Button Styling ============================== */
.btn-primary {
    background-color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--hover-dark);
    border-color: var(--hover-dark);
    transform: translateY(-2px);
}

.btn-light {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 8px 12px;
    background-color: var(--hover-bg);
    transition: all 0.3s ease;
}

.btn-light:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-custom {
    font-family: "Kantumruy Pro", "Segoe UI", Tahoma, Geneva, Verdana,
        sans-serif;
    border: 1px solid transparent;
    text-decoration: none;
    border-radius: 12px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(105, 113, 78, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.btn-custom:before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: all 0.6s ease;
}

.btn-custom:hover {
    box-shadow: 0 6px 12px rgba(105, 113, 78, 0.25);
}

.btn-custom:hover:before {
    left: 100%;
}

.btn-custom:active,
.btn-custom:focus {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(105, 113, 78, 0.2);
}

.btn-custom i {
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-custom:hover i {
    transform: none;
}

/* Solid Button Color Variations */
.btn-custom-primary {
    background: linear-gradient(
        135deg,
        var(--primary-dark),
        var(--primary-light)
    );
    color: var(--text-color);
    border-color: var(--primary-dark);
}

.btn-custom-primary:hover {
    background: linear-gradient(135deg, var(--hover-dark), var(--primary-dark));
    color: var(--text-color);
}

.btn-custom-secondary {
    background: linear-gradient(135deg, #8a7f64, #a6997a);
    color: var(--text-color);
    border-color: #8a7f64;
}

.btn-custom-secondary:hover {
    background: linear-gradient(135deg, #766b52, #8a7f64);
    color: var(--text-color);
}

.btn-custom-success {
    background: linear-gradient(135deg, #636b46, #829966);
    color: var(--text-color);
    border-color: #636b46;
}

.btn-custom-success:hover {
    background: linear-gradient(135deg, #525a38, #636b46);
    color: var(--text-color);
}

.btn-custom-danger {
    background: linear-gradient(135deg, #8b4e4e, #a16363);
    color: var(--text-color);
    border-color: #8b4e4e;
}

.btn-custom-danger:hover {
    background: linear-gradient(135deg, #723f3f, #8b4e4e);
    color: var(--text-color);
}

.btn-custom-warning {
    background: linear-gradient(135deg, #d4a537, #e8bd5b);
    color: #4a4a4a;
    border-color: #d4a537;
}

.btn-custom-warning:hover {
    background: linear-gradient(135deg, #c59425, #d4a537);
    color: #4a4a4a;
}

.btn-custom-info {
    background: linear-gradient(135deg, #4e6b71, #63858b);
    color: var(--text-color);
    border-color: #4e6b71;
}

.btn-custom-info:hover {
    background: linear-gradient(135deg, #3d565b, #4e6b71);
    color: var(--text-color);
}

.btn-custom-light {
    background: linear-gradient(135deg, #f8f9fa, #e8e9eb);
    color: #5a6043;
    border-color: #f8f9fa;
}

.btn-custom-light:hover {
    background: linear-gradient(135deg, #e2e3e5, #f8f9fa);
    color: #5a6043;
}

.btn-custom-dark {
    background: linear-gradient(135deg, #4a4e3b, #5c614b);
    color: var(--text-color);
    border-color: #4a4e3b;
}

.btn-custom-dark:hover {
    background: linear-gradient(135deg, #3a3d2e, #4a4e3b);
    color: var(--text-color);
}

.btn-custom-danger-modal {
    background: linear-gradient(135deg, #dc3545, #c02929);
    color: var(--text-color);
    border-color: #d19a9a;
}

.btn-custom-danger-modal:hover {
    background: linear-gradient(135deg, #dc3545, #c02929);
    color: var(--text-color);
}

.btn-custom-restore {
    background: linear-gradient(135deg, #198754, #106e43);
    color: var(--text-color);
    border-color: #198754;
}

.btn-custom-restore:hover {
    background: linear-gradient(135deg, #106e43, #198754);
    color: var(--text-color);
}

/* Outline Button Variations */
.btn-custom-outline-primary {
    background: transparent;
    color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-custom-outline-primary:hover {
    background: var(--primary-dark);
    color: var(--text-color);
}

.btn-custom-outline-secondary {
    background: transparent;
    color: #8a7f64;
    border-color: #8a7f64;
}

.btn-custom-outline-secondary:hover {
    background: #8a7f64;
    color: var(--text-color);
}

.btn-custom-outline-success {
    background: transparent;
    color: #636b46;
    border-color: #636b46;
}

.btn-custom-outline-success:hover {
    background: #636b46;
    color: var(--text-color);
}

.btn-custom-outline-danger {
    background: transparent;
    color: #8b4e4e;
    border-color: #8b4e4e;
}

.btn-custom-outline-danger:hover {
    background: #8b4e4e;
    color: var(--text-color);
}

.btn-custom-outline-warning {
    background: transparent;
    color: #d4a537;
    border-color: #d4a537;
}

.btn-custom-outline-warning:hover {
    background: #d4a537;
    color: #4a4a4a;
}

.btn-custom-outline-info {
    background: transparent;
    color: #4e6b71;
    border-color: #4e6b71;
}

.btn-custom-outline-info:hover {
    background: #4e6b71;
    color: var(--text-color);
}

.btn-custom-outline-light {
    background: transparent;
    color: #5a6043;
    border-color: #e2e3e5;
}

.btn-custom-outline-light:hover {
    background: #e2e3e5;
    color: #5a6043;
}

.btn-custom-outline-dark {
    background: transparent;
    color: #4a4e3b;
    border-color: #4a4e3b;
}

.btn-custom-outline-dark:hover {
    background: #4a4e3b;
    color: var(--text-color);
}

.btn-gradient-light {
    background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
    color: #2c3e50;
    border: none;
    border-radius: 12px;
    padding: 10px 18px;
    font-weight: 600;
    transition: all 0.5s ease;
}

.btn-gradient-light:hover {
    background: linear-gradient(135deg, #dfe6e9, #b2bec3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.btn-gradient-gold {
    background: linear-gradient(135deg, rgb(212, 175, 55), rgb(198, 160, 40));
    border: none;
    border-radius: 12px;
    padding: 10px 18px;
    font-weight: 600;
    transition: all 0.5s ease;
}

.btn-gradient-gold:hover {
    background: linear-gradient(135deg, rgb(198, 160, 40), rgb(180, 140, 35));
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.btn i {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover i {
    transform: none;
}

.action-btn {
    font-family: "en-oswald";
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.action-btn:hover {
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.action-btn:hover i {
    transform: none;
}

.btn-custom-outline-view {
    background-color: transparent;
    color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-custom-outline-view:hover {
    background-color: var(--primary-dark);
    color: var(--text-color);
}

.btn-custom-outline-edit {
    background-color: transparent;
    color: var(--gold);
    border-color: var(--gold);
}

.btn-custom-outline-edit:hover {
    background-color: var(--gold);
    color: #4a4a4a;
}

.btn-custom-outline-delete {
    background-color: transparent;
    color: #8b4e4e;
    border-color: #8b4e4e;
}

.btn-custom-outline-delete:hover {
    background-color: #8b4e4e;
    color: var(--text-color);
}

@media (max-width: 768px) {
    .btn-custom {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .btn-custom i {
        font-size: 0.9rem;
    }

    .action-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}

/* ============================== Form Styling ============================== */
.form-control,
.form-select,
textarea {
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 0.75rem;
    background-color: var(--light);
    box-shadow: none;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: var(--gold);
    outline: none;
    background-color: white;
    box-shadow: none;
}

.form-label {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.form-label i {
    margin-right: 8px;
    color: var(--secondary);
    font-size: 0.9rem;
}

.form-group {
    opacity: 1;
}

/* ============================== Custom Checkbox Styling ============================== */
.form-check-input {
    accent-color: var(--gold);
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid var(--accent);
    border-radius: 6px !important;
    margin-top: -2px;
}

.form-check-input:checked {
    background-color: var(--gold) !important;
    border-color: var(--gold) !important;
}

.form-check-input:focus {
    box-shadow: none !important;
    outline: none !important;
}

.form-check-label {
    margin-left: 0; /* remove extra left margin since we use flex gap */
}

/* Center checkbox and label vertically and provide spacing */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ============================== Input Group Fix ============================== */
.input-group {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group-text {
    background-color: var(--light);
    border: 1px solid var(--accent);
    color: var(--secondary);
    border-radius: 12px 0 0 12px !important;
    border-right: none !important;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.input-group .form-control,
.input-group textarea {
    border-radius: 0 12px 12px 0 !important;
    border-left: none !important;
    flex: 1 1 auto;
    width: 1%;
    box-shadow: none;
}

/* Ensure seamless connection between icon and input */
.input-group .form-control:focus + .input-group-text,
.input-group .form-control:focus ~ .input-group-text,
.input-group textarea:focus + .input-group-text,
.input-group textarea:focus ~ .input-group-text {
    border-color: var(--gold);
    background-color: var(--light);
    box-shadow: none;
}

/* Fix for password toggle button */
.input-group.has-toggle .form-control,
.input-group.has-toggle textarea {
    padding-right: 50px;
    border-radius: 0 12px 12px 0 !important;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--light);
    border: 1px solid var(--secondary);
    border-radius: 12px !important;
    color: var(--dark);
    cursor: pointer;
    font-size: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.toggle-password:hover {
    background: var(--secondary);
    color: #fff;
}

/* Fix for input group focus states */
.input-group:focus-within .input-group-text {
    border-color: var(--gold);
    background-color: var(--light);
}

.input-group:focus-within .form-control,
.input-group:focus-within textarea {
    border-color: var(--gold);
    box-shadow: none;
}

/* Ensure consistent heights */
.input-group-text,
.input-group .form-control,
.input-group textarea {
    height: auto;
    min-height: 48px;
}

@media (max-width: 768px) {
    .form-control,
    .form-select,
    textarea {
        padding: 10px;
    }

    .input-group-text {
        padding: 10px 12px;
    }

    .toggle-password {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* ============================== Password Strength Indicator ============================== */
.password-strength {
    height: 4px;
    width: 0;
    background: #ddd;
    margin-top: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.password-strength.weak {
    width: 30%;
    background: #ff6b6b;
}

.password-strength.medium {
    width: 60%;
    background: #feca57;
}

.password-strength.strong {
    width: 100%;
    background: #1dd1a1;
}

/* ============================== Login Container Styling ============================== */
.login-container {
    background: var(--login-bg);
    border-radius: 25px;
    padding: 2rem 3rem;
    max-width: 450px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-size: 200px;
    background-position: right bottom;
    background-repeat: no-repeat;
    z-index: 0;
}

.login-container > * {
    position: relative;
    z-index: 1;
}
@media (max-width: 576px) {
    .login-container {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* ============================== Login Header Styling ============================== */
.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-header i {
    color: var(--gold);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.login-header h2 {
    color: var(--light);
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.login-header h2::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--light);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease;
}

.login-header:hover h2::after {
    transform: scaleX(1);
    transform-origin: left;
}

.login-header p {
    color: var(--accent);
    font-size: 0.9rem;
}
@media (max-width: 576px) {
    .login-header i {
        font-size: 2rem;
    }

    .login-header h2 {
        font-size: 1.5rem;
    }
}

/* ============================== Login Button Styling ============================== */
.btn-login {
    font-family: "en-oswald", sans-serif;
    background: linear-gradient(
        135deg,
        var(--login-gradient-start),
        var(--login-gradient-end)
    );
    background-size: 200% 200%;
    color: var(--light);
    border: none;
    padding: 0.9rem 1.8rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* effect ពេល hover */
.btn-login:hover {
    /* remove continuous animation; just shift the gradient position on hover (instant change) */
    background-position: 100% 50%;
    color: var(--light);
}

/* បង្កើតចលនា gradient */
@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.btn-login i {
    z-index: 2;
}

/* ============================== Register Container Styling ============================== */
.register-container {
    background: var(--login-bg);
    border-radius: 25px;
    padding: 2rem 3rem;
    max-width: 450px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.register-container::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-size: 200px;
    background-position: right bottom;
    background-repeat: no-repeat;
    z-index: 0;
}

.register-container > * {
    position: relative;
    z-index: 1;
}
@media (max-width: 576px) {
    .register-container {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* ============================== Register Header Styling ============================== */
.register-header {
    text-align: center;
    margin-bottom: 1rem;
}

.register-header i {
    color: var(--gold);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.register-header h2 {
    color: var(--light);
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.register-header h2::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--light);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease;
}

.register-header:hover h2::after {
    transform: scaleX(1);
    transform-origin: left;
}

.register-header p {
    color: var(--accent);
    font-size: 0.9rem;
}
@media (max-width: 576px) {
    .register-header i {
        font-size: 2rem;
    }

    .register-header h2 {
        font-size: 1.5rem;
    }
}

/* ============================== Register Button Styling ============================== */
.btn-register {
    font-family: "en-oswald", sans-serif;
    background: linear-gradient(
        135deg,
        var(--login-gradient-start),
        var(--login-gradient-end)
    );
    background-size: 200% 200%;
    color: var(--light);
    border: none;
    padding: 0.9rem 1.8rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.btn-register:hover {
    /* remove continuous animation; just shift the gradient position on hover */
    background-position: 100% 50%;
    color: var(--light);
}

.btn-register i {
    font-size: 1.1rem;
}

/* ============================== Forgot Password and Error Message ============================== */
.forgot-password {
    display: block;
    text-align: right;
    color: var(--accent);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    text-decoration: none;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: var(--gold);
}

.error-message {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: none;
}

/* ============================== Login and Register Link Styling ============================== */

.login-link {
    display: inline-block;
    color: var(--light);
    text-decoration: none;
    font-family: "en-oswald", sans-serif;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.login-link:hover {
    color: var(--gold);
    background-color: var(--hover-bg);
    border: 1px solid var(--gold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================== Table Styling ============================== */
.table {
    background: var(--light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.table-responsive table {
    border-radius: 12px;
    border: 1px solid var(--accent); /* Updated from #ddd to --accent (#d7ccc8) for consistency, or define a new root variable if needed */
    overflow: hidden;
}

.table thead {
    background: linear-gradient(
        135deg,
        var(--secondary) 0%,
        var(--primary) 100%
    );
    color: var(--text-color); /* Updated from white to --text-color (#fff) */
}

.table th {
    background-color: var(--primary);
    color: var(--text-color); /* Updated from #fff to --text-color (#fff) */
}

.table th,
.table td {
    vertical-align: middle;
    padding: 12px;
}

@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* ============================== Status and Order Styling ============================== */
.status-active {
    background-color: var(--status-active);
    color: var(--status-text-active);
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: 600;
}

.status-inactive {
    background-color: var(--status-inactive);
    color: var(--status-text-inactive);
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.order-item {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    transition: background 0.2s;
}

.order-item:hover {
    background-color: #f9f9f9;
}

.order-status {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pending {
    background-color: var(--status-pending);
    color: var(--status-text-pending);
}

.status-completed {
    background-color: var(--status-completed);
    color: var(--status-text-completed);
}

.status-processing {
    background-color: var(--status-processing);
    color: var(--status-text-processing);
}

/* ============================== Image Upload Component ============================== */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 30px 20px;
    margin: 20px 0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: rgba(212, 175, 55, 0.3);
    background-color: #f7f7f7;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #6c757d;
    transition: opacity 0.4s ease;
}

.upload-icon {
    font-size: 3rem;
    color: #717954cc;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.upload-subtext {
    font-size: 0.95rem;
    color: #6c757d;
    font-style: italic;
}

.preview-container {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 12px;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    position: relative;
}

.file-info {
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.95rem;
    color: #495057;
    margin-top: 5px;
    width: 100%;
    word-break: break-word;
}

.file-info div {
    margin-bottom: 3px;
    width: 100%;
}

.file-info .value {
    display: block;
    overflow-wrap: break-word;
    word-break: break-all;
}

.preview-container.show {
    display: flex;
}

.empty-placeholder {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-style: italic;
}
.empty-placeholder i {
    font-size: 1.1rem;
    color: #adb5bd;
}

/* សម្រាប់កំណត់ទំហំឱ្យ រូបភាពដែលបង្ហាញនៅក្នុង Upload Image */
.image-wrapper {
    position: relative;
    width: 100px;
    height: auto;
    flex-shrink: 0;
}

.image-preview {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    border: 1px solid var(--accent);
    object-fit: cover;
}

.clear-btn {
    position: absolute;
    top: -8px;
    right: -8px; /* ប្តូរ left → right ដើម្បីឲ្យសមជាមួយ corner */
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background-color: #ff4d4f;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.clear-btn:hover {
    background-color: #d9363e;
}

.clear-btn i {
    pointer-events: none;
}

.hidden {
    display: none !important;
}
.flex {
    display: flex !important;
}

@media (max-width: 768px) {
    .upload-area {
        padding: 20px 15px;
    }

    .image-wrapper {
        width: 80px;
        height: 80px;
        flex-shrink: 0;
    }

    .image-preview {
        width: 100%;
        height: 100%;
        border-radius: 8px;
        object-fit: cover;
    }

    .file-info {
        font-size: 0.85rem;
        margin-top: 0;
    }

    .file-info .value {
        font-size: 0.85rem;
    }

    .preview-text-content {
        display: none;
        flex-direction: column;
        align-items: flex-start; /* Align text to left */
        justify-content: center;
        flex: 1;
        padding: 0;
    }

    .preview-title {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--primary);
        margin-bottom: 3px;
        text-align: left;
    }

    .preview-description {
        font-size: 0.85rem;
        color: var(--secondary);
        line-height: 1.3;
        text-align: left;
    }
}

/* ============================== Category and Page Title Styling ============================== */
.category-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.page-title {
    color: var(--primary);
    font-weight: 700;
    padding-bottom: 15px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--gold);
    display: flex;
    align-items: center;
}

.page-title i {
    margin-right: 15px;
    color: var(--gold);
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .category-image {
        width: 40px;
        height: 40px;
    }
}

/* ============================== Breadcrumb Styling ============================== */

.custom-breadcrumb {
    background-color: #f8f9fa;
    border: 1px solid var(--coffee-bg);
    border-radius: 12px;
    padding: 8px 10px;
    margin: 13px 0;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
}

.custom-breadcrumb .breadcrumb {
    margin: 0;
    background: transparent;
    padding: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.custom-breadcrumb .breadcrumb-item {
    display: inline-flex;
    align-items: center;
    font-size: 0.93rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

.custom-breadcrumb .breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.custom-breadcrumb .breadcrumb-item a:hover {
    color: #5a6043;
    border-color: var(--coffee-bg);
    background-color: rgba(111, 119, 82, 0.08);
}

.custom-breadcrumb .breadcrumb-item.active {
    color: var(--primary);
    font-weight: 600;
}
.custom-breadcrumb .upload-icon {
    font-size: 1.06rem;
    color: #717954;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    margin-right: 0;
    vertical-align: middle;
    transform: translateY(3px);
}

.custom-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-weight: 600;
    color: #717954;
    margin: 0 6px;
    font-size: 1rem;
    display: inline-block;
    vertical-align: middle;
}

/* Tablets */
@media (max-width: 991px) {
    .custom-breadcrumb {
        padding: 6px 7px;
        margin: 10px 0;
    }
    .custom-breadcrumb .breadcrumb-item {
        font-size: 0.87rem;
    }
    .custom-breadcrumb .breadcrumb-item a {
        padding: 2px 4px;
        gap: 4px;
    }
    .custom-breadcrumb .upload-icon {
        font-size: 0.98rem;
    }
    .custom-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
        margin: 0 5px;
        font-size: 0.95rem;
    }
}

/* Mobiles */
@media (max-width: 767px) {
    .custom-breadcrumb {
        padding: 5px 6px;
        margin: 7px 0;
        border-radius: 8px;
    }
    .custom-breadcrumb .breadcrumb-item {
        font-size: 0.77rem;
    }
    .custom-breadcrumb .breadcrumb-item a {
        padding: 1px 3px;
        gap: 3px;
    }
    .custom-breadcrumb .upload-icon {
        font-size: 0.92rem;
    }
    .custom-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
        margin: 0 4px;
        font-size: 0.9rem;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .custom-breadcrumb {
        padding: 4px 4px;
        margin: 5px 0;
        border-radius: 6px;
    }
    .custom-breadcrumb .breadcrumb-item {
        font-size: 0.7rem;
    }
    .custom-breadcrumb .breadcrumb-item a {
        padding: 0px 2px;
        gap: 2px;
    }
    .custom-breadcrumb .upload-icon {
        font-size: 0.88rem;
    }
    .custom-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
        margin: 0 3px;
        font-size: 0.85rem;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .custom-breadcrumb {
        padding: 10px 12px;
    }
    .custom-breadcrumb .breadcrumb-item {
        font-size: 1rem;
    }
    .custom-breadcrumb .breadcrumb-item a {
        padding: 3px 8px;
        gap: 8px;
    }
    .custom-breadcrumb .upload-icon {
        font-size: 1.15rem;
    }
    .custom-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
        font-size: 1.12rem;
    }
}

/* ============================== End Breadcrumb Styling ============================== */

/* ============================== Form Section Styling ============================== */
.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--accent);
}

.form-section-title {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.form-section-title i {
    margin-right: 10px;
    color: var(--gold);
}

/* ============================== Notification Badge Styling ============================== */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-color);
    color: white;
    border-radius: 8px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    padding: 0;
    min-width: auto;
    border: 1px solid var(--hover-bg);
    box-sizing: border-box;
}

#saved-orders-badge {
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
}

@media (max-width: 768px) {
    .notification-badge {
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
        top: -6px;
        right: -6px;
    }
}

@media (max-width: 576px) {
    .notification-badge {
        width: 17px;
        height: 17px;
        font-size: 0.6rem;
        top: -5px;
        right: -5px;
        border-width: 1px;
    }
}

/* ============================== User Avatar Styling ============================== */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--secondary) 0%,
        var(--primary) 100%
    );
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

/* ============================== Coffee Background Styling ============================== */
.coffee-bg {
    background-size: 200px;
    background-position: right bottom;
    background-repeat: no-repeat;
    border: 1px solid var(--coffee-bg);
}

/* ============================== Recent Orders Styling ============================== */
.recent-orders {
    margin-top: 30px;
}

/* ============================== Footer Styling ============================== */
.footer {
    position: sticky;
    top: 0;
}

/* ============================== Pagination Styling ============================== */
.button-preview {
    background: #ffffff;
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 10px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 200px;
    width: 100%;
    animation: fadeIn 1s ease-in-out;
}

.preview-title {
    color: var(--primary-dark);
    margin-bottom: 40px;
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: 2px;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.pagination .page-item {
    margin: 0 4px;
}

.pagination .page-link {
    border-radius: 12px !important;
    padding: 8px 16px;
    color: var(--primary);
    border: 1px solid var(--primary);
    background: transparent;
    box-shadow: none;
    transition: all 0.4s ease;
    text-decoration: none;
    display: block;
    font-weight: 600;
}

.pagination .page-link:hover {
    color: var(--light);
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 20px rgba(113, 121, 84, 0.4);
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    color: var(--light);
    border-color: var(--primary);
    background: var(--primary);
    font-weight: bold;
    box-shadow: 0 0 25px rgba(113, 121, 84, 0.6),
        inset 0 0 10px rgba(0, 0, 0, 0.3);
    transform: none;
}

.pagination .page-item.disabled .page-link {
    color: #666;
    cursor: not-allowed;
    background: transparent;
    border-color: #ccc;
    box-shadow: none;
    transform: none;
}

/* ============================== Animation Keyframes ============================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    20%,
    60% {
        transform: translateX(-5px);
    }
    40%,
    80% {
        transform: translateX(5px);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes rotateIcon {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
/* ============================== End Animation Keyframes ============================== */

/* Default state: sidebar hidden */
#sidebar {
    width: 270px;
    margin-left: -270px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    position: fixed;
    top: 70px;
    left: 0;
    height: calc(100% - 70px);
    z-index: 1000;
    overflow-y: auto;
    scrollbar-width: none;
}

#sidebar::-webkit-scrollbar {
    display: none;
}

/* Show sidebar when expanded */
body.sidebar-expanded #sidebar,
html.sidebar-will-expand body #sidebar {
    margin-left: 0;
    opacity: 1;
    pointer-events: auto;
}

body.sidebar-expanded #mainContent,
html.sidebar-will-expand body #mainContent {
    margin-left: 270px !important;
}

/* Default state: main content full width */
#mainContent {
    margin-left: 0 !important;
    transition: all 0.3s ease;
    flex-grow: 1;
    padding: 2rem 0.5rem 2rem 0.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: calc(100vh - 70px - 1rem);
}

/* Mobile responsive */
@media (max-width: 768px) {
    #sidebar {
        width: 250px;
        margin-left: -250px;
        top: 60px;
        height: calc(100vh - 60px);
    }

    body.sidebar-expanded #sidebar,
    html.sidebar-will-expand body #sidebar {
        margin-left: 0;
    }

    body.sidebar-expanded #mainContent,
    html.sidebar-will-expand body #mainContent {
        margin-left: 0 !important;
    }

    .navbar {
        height: 60px;
    }
}

/* Wrapper styling */
#wrapper {
    display: flex;
    min-height: calc(100vh - 70px);
    overflow: hidden;
}

@media (max-width: 768px) {
    #wrapper {
        min-height: calc(100vh - 60px);
    }
}
