/* RMS Custom CSS - RAM-YUM Store */
/* NO GRADIENTS - SOLID COLORS ONLY */

:root {
    --primary-red: #7b8b00;
    --muted-red: #DC143C;
    --white: #FFFFFF;
    --off-white: #FAFAFA;
    --light-gray: #F5F5F5;
    --gray: #E5E5E5;
    --dark-gray: #6B7280;
    --black: #1F2937;
    --success: #059669;
    --warning: #D97706;
    --error: #DC2626;
    --info: #2563EB;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--off-white);
    color: var(--black);
    line-height: 1.6;
}

/* Layout Structure */
.rms-layout {
    display: flex;
    min-height: 100vh;
    overflow-x: clip;
}

.rms-sidebar {
    width: 280px;
    background-color: var(--primary-red);
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    transition: width 0.3s ease;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding-bottom: 60px; /* Space for fixed footer */
}

.rms-sidebar.collapsed {
    width: 64px;
}

.rms-main {
    flex: 1;
    min-width: 0;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 60px; /* Space for fixed footer */
}

.rms-main.sidebar-collapsed {
    margin-left: 64px;
}

.rms-topbar {
    background: #FFFFFF;
    border-bottom: 1px solid var(--gray);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    min-width: 0;
}

.rms-content {
    flex: 1;
    padding: 1.5rem;
    background-color: var(--off-white);
    overflow-y: auto;
}

.rms-footer-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: var(--primary-red);
    padding: 0;
    z-index: 100; /* Lower than modals but higher than content */
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Sidebar Styles */
.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-footer-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    min-height: 60px;
}

.rms-sidebar.collapsed .sidebar-footer-img {
    object-fit: contain;
    height: 60px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    background-color: var(--white);
}

.sidebar-title {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--white);
    white-space: normal;
    overflow: visible;
    line-height: 1.2;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    padding: 0 1rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.nav-item {
    display: block;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border-left: 4px solid var(--white);
}

.nav-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-text {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
}

.nav-arrow {
    margin-left: auto;
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.nav-item.expanded .nav-arrow {
    transform: rotate(90deg);
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-submenu.show {
    max-height: 500px;
}

.nav-subitem {
    display: block;
    padding: 0.5rem 1rem 0.5rem 3rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.nav-subitem:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-subitem.active {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: var(--white) !important;
    font-weight: 500;
    border-left: 4px solid var(--white);
}

/* Collapsed Sidebar Styles */
.rms-sidebar.collapsed .sidebar-title,
.rms-sidebar.collapsed .nav-section-title,
.rms-sidebar.collapsed .nav-text,
.rms-sidebar.collapsed .nav-arrow {
    display: none;
}

.rms-sidebar.collapsed .nav-item {
    padding: 0.75rem;
    position: relative;
}

.rms-sidebar.collapsed .nav-item-content {
    justify-content: center;
}

.rms-sidebar.collapsed .nav-submenu {
    display: none;
}

/* Tooltip for collapsed sidebar */
.nav-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--black);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    margin-left: 0.5rem;
}

.nav-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: var(--black);
}

.rms-sidebar.collapsed .nav-item:hover .nav-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Topbar Styles */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.375rem;
    color: var(--dark-gray);
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background-color: var(--light-gray);
    color: var(--primary-red);
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--black);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-description {
    font-size: 0.875rem;
    color: var(--dark-gray);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
    min-width: 0;
}

.search-container {
    position: relative;
}

.search-input {
    width: 300px;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 1px solid var(--gray);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background-color: var(--white);
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-red);
}

.search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--dark-gray);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-dropdown.show {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--light-gray);
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-result-item:hover {
    background-color: var(--light-gray);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-red);
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
}

.search-result-title {
    font-weight: 500;
    color: var(--black);
    font-size: 0.875rem;
}

.search-result-subtitle {
    font-size: 0.75rem;
    color: var(--dark-gray);
    margin-top: 0.125rem;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--dark-gray);
    font-size: 0.875rem;
}

.search-loading {
    padding: 1rem;
    text-align: center;
    color: var(--dark-gray);
    font-size: 0.875rem;
}

.notification-btn,
.theme-toggle {
    position: relative;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.375rem;
    color: var(--dark-gray);
    transition: all 0.2s ease;
}

.profile-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: var(--dark-gray);
    pointer-events: none;
}

.notification-btn:hover,
.theme-toggle:hover {
    background-color: var(--light-gray);
    color: var(--primary-red);
}

/* Notification Badge - Updated for better visibility */
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 20px;
    height: 20px;
    background-color: #DC2626;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0 5px;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
    line-height: 1;
    z-index: 10;
}

.notification-badge.has-notifications {
    display: flex !important;
    animation: notificationPulse 2s ease-in-out infinite;
}

@keyframes notificationPulse {
    0%, 100% {
        box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
    }
    50% {
        box-shadow: 0 2px 12px rgba(220, 38, 38, 0.8);
    }
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    background-color: var(--primary-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
}

.profile-details {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.profile-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--black);
}

.profile-role {
    font-size: 0.75rem;
    color: var(--dark-gray);
}

.profile-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.profile-btn.active .profile-arrow {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.profile-dropdown.show {
    display: flex;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--dark-gray);
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.profile-dropdown-item:hover {
    background-color: var(--light-gray);
    color: var(--primary-red);
}

.profile-dropdown-item i {
    width: 18px;
    height: 18px;
}

.profile-dropdown-divider {
    height: 1px;
    background-color: var(--gray);
    margin: 0.25rem 0;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-red);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--black);
}

.modal-body {
    padding: 1rem 1.5rem;
}

.modal-message {
    color: var(--dark-gray);
    line-height: 1.5;
}

.modal-footer {
    padding: 0 1.5rem 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.modal-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.modal-btn-cancel {
    background-color: #E5E7EB !important;
    color: #6B7280 !important;
    border: 1px solid #D1D5DB;
}

.modal-btn-cancel:hover {
    background-color: #D1D5DB !important;
    color: #374151 !important;
}

.modal-btn-confirm {
    background-color: #8F1717 !important;
    color: #FFFFFF !important;
}

.modal-btn-confirm:hover {
    background-color: #A61D1D !important;
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background-color: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    min-width: 320px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--success);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--error);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.info {
    border-left-color: var(--info);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--error);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast.info .toast-icon {
    color: var(--info);
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--black);
}

.toast-close {
    background: none;
    border: none;
    color: var(--dark-gray);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.toast-close:hover {
    background-color: var(--light-gray);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .search-input {
        width: 200px;
    }
    
    .profile-details {
        display: none;
    }
}

@media (max-width: 768px) {
    .rms-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .rms-sidebar.mobile-show {
        transform: translateX(0);
    }
    
    .rms-main {
        margin-left: 0;
    }
    
    .search-container {
        display: none;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .modal-container {
        margin: 1rem;
        width: auto;
    }
}

@media (max-width: 640px) {
    .rms-content {
        padding: 1rem;
    }
    
    .topbar-left {
        gap: 0.5rem;
    }

    .rms-topbar {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .page-description {
        display: none;
    }
    
    .topbar-right {
        gap: 0.5rem;
    }
    
    .toast {
        min-width: 280px;
        margin: 0 1rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Highlight Effect for Clicked Items */
@keyframes highlightPulse {
    0%, 100% { 
        background-color: transparent; 
        box-shadow: none;
    }
    50% { 
        background-color: rgba(5, 150, 105, 0.2);
        box-shadow: 0 0 20px rgba(5, 150, 105, 0.4);
    }
}

.highlight-row {
    animation: highlightPulse 1s ease-in-out 3;
    background-color: rgba(5, 150, 105, 0.1) !important;
    transition: all 0.3s ease;
}

.highlight-card {
    animation: highlightPulse 1s ease-in-out 3;
    border: 2px solid #059669 !important;
    box-shadow: 0 0 20px rgba(5, 150, 105, 0.3) !important;
}

/* Button Styles */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-red);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--muted-red);
}

.btn-secondary {
    background-color: var(--light-gray);
    color: var(--dark-gray);
}

.btn-secondary:hover {
    background-color: var(--gray);
}

/* Card Styles */
.card {
    background-color: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray);
    background-color: var(--off-white);
}

/* Location Dropdown Styling */
.location-dropdown {
    font-size: 0.875rem;
    line-height: 1.4;
    padding: 0.625rem 0.75rem;
    max-height: 200px;
}

.location-dropdown option {
    padding: 0.5rem;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
}

.location-dropdown option:hover {
    background-color: var(--light-gray);
}

/* Fix for clickable action buttons in tables */
table button,
table a.btn,
.card-body button,
table td button,
table .p-1 {
    position: relative;
    z-index: 10 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

table tbody tr {
    position: relative;
    z-index: 1;
}

table tbody tr:hover {
    z-index: 2;
}

/* Ensure footer doesn't overlap content */
.rms-content {
    position: relative;
    z-index: 1;
    padding-bottom: 80px; /* Extra space for footer */
}

.rms-footer-fixed {
    z-index: 1100 !important;
}

/* Make sure modals are above everything */
.modal-overlay,
.rms-modal-overlay {
    z-index: 2000 !important;
}
/* Additional button styles for modal types */
.modal-btn.btn-danger {
    background-color: var(--error);
}

.modal-btn.btn-danger:hover {
    background-color: #B91C1C;
}

.modal-btn.btn-warning {
    background-color: var(--warning);
}

.modal-btn.btn-warning:hover {
    background-color: #B45309;
}

/* Quick action buttons */
.btn.btn-primary.flex.flex-col {
    background-color: transparent;
    color: var(--dark-gray);
    border: 2px solid var(--gray);
}

.btn.btn-primary.flex.flex-col:hover {
    border-color: var(--primary-red);
    background-color: rgba(139, 0, 0, 0.05);
    color: var(--primary-red);
}

/* Login page gradient override */
.login-gradient {
    background: var(--primary-red);
}

/* Theme selection styling */
.theme-option {
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.theme-option.active {
    border-width: 3px !important;
}

/* Ensure no gradients are used anywhere */
/* Removed global background-image: none to allow background images */

/* Override any potential gradient usage */
.bg-gradient-to-r,
.bg-gradient-to-l,
.bg-gradient-to-t,
.bg-gradient-to-b,
.bg-gradient-to-br,
.bg-gradient-to-bl,
.bg-gradient-to-tr,
.bg-gradient-to-tl {
    background-image: none !important;
    background: var(--primary-red) !important;
}