:root {
    --background-color: #f8f9fa;
    --surface-color: #ffffff;
    --primary-color: #e85d04;
    --primary-hover-color: #f48c06;
    --text-color: #343a40;
    --secondary-text-color: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --status-pending: #ffc107;
    --status-cooking: #007bff;
    --status-ready: #28a745;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Disable scrolling only for admin pages if needed - but allow it for home page */
body:has(.admin-page) {
    overflow: auto;
}

body {
    font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

#root {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Ensure scrollbar is visible on homepage */
body:not(:has(.admin-page)) {
    overflow-y: auto !important;
    overflow-x: hidden;
}

/* Make scrollbar always visible when content overflows */
html {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

html::-webkit-scrollbar {
    width: 12px;
}

html::-webkit-scrollbar-track {
    background: #f1f1f1;
}

html::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
}

html::-webkit-scrollbar-thumb:hover {
    background: #555;
}

body::-webkit-scrollbar {
    width: 12px;
}

body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
}

body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Header Styles */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.app-header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
}

.header-logo {
    height: 4rem;
    width: auto;
    object-fit: contain;
}

.nav-buttons {
    display: flex;
    background-color: var(--background-color);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--border-color);
    /* Use auto margins to center it in the available space between logo and right section */
    margin: 0 auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-nav-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-text-color);
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    position: relative;
    white-space: nowrap;
}

.header-nav-btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid var(--surface-color);
}


.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    color: var(--secondary-text-color);
}

.admin-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-color: var(--primary-color);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.admin-nav-btn:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-1px);
}

.admin-nav-btn svg {
    font-size: 1rem;
}

.admin-nav-label {
    line-height: 1;
}

.logout-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--secondary-text-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.logout-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Modern User Profile Card */
.user-profile-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.75rem 0.4rem 0.4rem;
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.08), rgba(244, 140, 6, 0.05));
    border: 1px solid rgba(232, 93, 4, 0.2);
    border-radius: 999px;
    transition: all 0.2s ease;
}

.user-profile-card:hover {
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.12), rgba(244, 140, 6, 0.08));
    border-color: rgba(232, 93, 4, 0.3);
    box-shadow: 0 2px 8px rgba(232, 93, 4, 0.15);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(232, 93, 4, 0.3);
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.user-details .user-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-details .user-role {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--primary-color);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.ai-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--secondary-text-color);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked+.slider:before {
    -webkit-transform: translateX(22px);
    -ms-transform: translateX(22px);
    transform: translateX(22px);
}

.slider.round {
    border-radius: 28px;
}

.slider.round:before {
    border-radius: 50%;
}


.app-container {
    display: grid;
    grid-template-columns: 1.4fr 1fr 0.9fr;
    gap: 1.5rem;
    padding: 1.5rem;
    flex-grow: 1;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    min-height: 0;
}

.app-container.ai-disabled {
    grid-template-columns: 1.4fr 1fr;
    max-width: 1200px;
}

.column {
    background-color: var(--surface-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.column-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.virtual-menu-header-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    background-color: var(--surface-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 150px;
}

.virtual-menu-header-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.virtual-menu-header-select:hover {
    border-color: var(--primary-color);
    background-color: var(--background-color);
}

.custom-sort-open-btn {
    border: none;
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    font-weight: 600;
    font-size: 0.9rem;
    background-color: rgba(232, 93, 4, 0.12);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.custom-sort-open-btn:hover,
.custom-sort-open-btn:focus {
    background-color: rgba(232, 93, 4, 0.22);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.12);
    outline: none;
}

.custom-sort-open-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.custom-sort-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1000;
}

.custom-sort-modal {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
    width: min(420px, 92vw);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.75rem;
}

.custom-sort-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.custom-sort-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.custom-sort-close-btn {
    border: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-text-color);
    cursor: pointer;
    transition: color 0.2s ease-in-out, transform 0.2s;
}

.custom-sort-close-btn:hover,
.custom-sort-close-btn:focus {
    color: var(--primary-color);
    transform: scale(1.1);
    outline: none;
}

.custom-sort-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--secondary-text-color);
}

.custom-sort-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.custom-sort-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.6rem 0.85rem;
    border-radius: 12px;
    border: 1px dashed rgba(232, 93, 4, 0.35);
    background-color: rgba(232, 93, 4, 0.07);
    cursor: grab;
    transition: background-color 0.2s ease-in-out, border-color 0.2s;
}

.custom-sort-item:hover {
    background-color: rgba(232, 93, 4, 0.12);
    border-color: rgba(232, 93, 4, 0.6);
}

.custom-sort-item.dragging {
    opacity: 0.6;
    border-style: solid;
    background-color: rgba(232, 93, 4, 0.18);
    cursor: grabbing;
}

.custom-sort-grip {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    position: relative;
}

.custom-sort-grip::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(to bottom,
            var(--primary-color),
            var(--primary-color) 2px,
            transparent 2px,
            transparent 4px);
    opacity: 0.6;
}

.custom-sort-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-color);
}

.custom-sort-empty {
    padding: 1rem;
    border-radius: 12px;
    border: 1px dashed var(--border-color);
    text-align: center;
    color: var(--secondary-text-color);
    font-size: 0.95rem;
}

.custom-sort-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.custom-sort-btn {
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.custom-sort-btn.secondary {
    background-color: rgba(52, 58, 64, 0.08);
    color: var(--text-color);
}

.custom-sort-btn.secondary:hover,
.custom-sort-btn.secondary:focus {
    background-color: rgba(52, 58, 64, 0.15);
    outline: none;
}

.custom-sort-btn.primary {
    background-color: var(--primary-color);
    color: #ffffff;
}

.custom-sort-btn.primary:hover,
.custom-sort-btn.primary:focus {
    background-color: var(--primary-hover-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.18);
}

.custom-sort-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.menu-category-order-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.menu-category-order-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.custom-sort-list-wrapper {
    border: 1px dashed rgba(232, 93, 4, 0.25);
    border-radius: 16px;
    padding: 1.25rem;
    background-color: rgba(232, 93, 4, 0.05);
}

.settings-error-banner,
.settings-success-banner {
    padding: 0.85rem 1.1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}

.settings-error-banner {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.35);
}

.settings-success-banner {
    background: rgba(40, 167, 69, 0.12);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.35);
}

/* Virtual Menu Settings Styles */
.menu-settings-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.virtual-menu-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.menu-settings-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.menu-settings-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--secondary-text-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.menu-settings-tab:hover {
    color: var(--text-color);
    background-color: rgba(232, 93, 4, 0.05);
}

.menu-settings-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.virtual-menu-actions {
    display: flex;
    justify-content: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.virtual-menu-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.virtual-menu-item {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.virtual-menu-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.virtual-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.virtual-menu-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.virtual-menu-info h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 600;
}

.virtual-menu-count {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

.virtual-menu-actions-item {
    display: flex;
    gap: 0.5rem;
}

.custom-sort-btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.menu-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.select-all-btn {
    padding: 0.5rem 1rem;
    background-color: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-all-btn:hover:not(:disabled) {
    background-color: var(--surface-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.select-all-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.menu-items-list {
    max-height: 450px;
    overflow-y: auto;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    background-color: white;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

.menu-items-list::-webkit-scrollbar {
    width: 8px;
}

.menu-items-list::-webkit-scrollbar-track {
    background: var(--surface-color);
    border-radius: 4px;
}

.menu-items-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.menu-items-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
    opacity: 0.6;
}

.menu-category-group {
    margin-bottom: 1.5rem;
    background-color: white;
    border-radius: 12px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.menu-category-group:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(232, 93, 4, 0.3);
}

.menu-category-group:last-child {
    margin-bottom: 0;
}

.menu-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    margin: -1rem -1rem 1rem -1rem;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.08) 0%, rgba(232, 93, 4, 0.03) 100%);
    border-bottom: 2px solid rgba(232, 93, 4, 0.2);
}

.menu-category-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    font-weight: 600;
    color: var(--primary-color);
}

.select-category-btn {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(232, 93, 4, 0.2);
}

.select-category-btn:hover:not(:disabled) {
    background-color: var(--primary-hover-color);
    box-shadow: 0 2px 8px rgba(232, 93, 4, 0.3);
    transform: translateY(-1px);
}

.select-category-btn:active:not(:disabled) {
    transform: translateY(0);
}

.select-category-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.menu-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.875rem;
}

.menu-item-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background-color: #fafafa;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.menu-item-checkbox:hover {
    border-color: var(--primary-color);
    background-color: rgba(232, 93, 4, 0.05);
    box-shadow: 0 2px 8px rgba(232, 93, 4, 0.15);
    transform: translateY(-1px);
}

.menu-item-checkbox input[type="checkbox"]:checked+.menu-item-name {
    color: var(--primary-color);
    font-weight: 600;
}

.menu-item-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.menu-item-checkbox input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.menu-item-name {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
    flex: 1;
    line-height: 1.4;
}

.menu-item-base-price {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    font-weight: 500;
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    background-color: rgba(232, 93, 4, 0.1);
    border-radius: 4px;
    white-space: nowrap;
}

.menu-item-with-price {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.menu-item-with-price:hover {
    border-color: var(--primary-color);
    box-shadow: 0 3px 10px rgba(232, 93, 4, 0.12);
    transform: translateY(-1px);
}

.menu-item-price-input {
    margin-left: 0;
    padding: 0.75rem;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.menu-item-price-input label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.menu-item-price-input .price-input {
    width: 100%;
    padding: 0.65rem;
    font-size: 0.95rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.menu-item-price-input .price-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.menu-item-price-input .price-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    font-style: italic;
    margin-top: 0.25rem;
}

.menu-item-price-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color);
}

.menu-item-variations-prices {
    margin-top: 0.5rem;
    padding: 1rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.menu-item-variations-prices .variations-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.variation-price-input {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background-color: white;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.variation-price-input:last-child {
    margin-bottom: 0;
}

.variation-price-input label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.variation-price-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.variation-base-price {
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    min-width: 90px;
    padding: 0.25rem 0.5rem;
    background-color: rgba(232, 93, 4, 0.08);
    border-radius: 4px;
    font-weight: 500;
}

.variation-price-input .price-input.small {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.9rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
}

.variation-price-input .price-input.small:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-text-color);
    font-size: 0.95rem;
}

/* Menu Search Styles */
.menu-search-container {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.menu-filters-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.menu-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.menu-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.menu-search::placeholder {
    color: var(--secondary-text-color);
}

.virtual-menu-select {
    min-width: 150px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background-color: var(--surface-color);
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.virtual-menu-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.virtual-menu-select:hover {
    border-color: var(--primary-color);
}

.search-results-count {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    font-weight: 500;
}

.column-content {
    padding: 1.25rem;
    overflow-y: auto;
    flex-grow: 1;
}

/* Thumbnail Styles */
.thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.thumbnail:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}


/* Menu Column */
.menu-category h3 {
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.25rem;
    display: inline-block;
}

.menu-category:first-child h3 {
    margin-top: 0;
}

.menu-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0.5rem;
}

.menu-item-name {
    font-weight: 600;
}

.menu-item-price {
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

.menu-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100vh;
}

/* Strict booking mode indicator strip */
.menu-column--strict .column-header::after {
    content: '🔒 Strict Booking ON';
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    background: #ef4444;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.menu-column-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
    scrollbar-gutter: stable;
    max-height: calc(100vh - 200px);
    position: relative;
}

/* Ensure scrollbar is visible */
.menu-column-scroll::-webkit-scrollbar {
    width: 8px;
}

.menu-column-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.menu-column-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.menu-column-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.menu-layout {
    display: flex;
    gap: 0.9rem;
    padding: 0.9rem;
    flex: 1;
    min-height: 0;
}

.menu-category-sidebar {
    width: 180px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: #fff7f0;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow-y: auto;
}

.menu-category-pill {
    border: none;
    border-radius: 999px;
    padding: 0.5rem 0.7rem;
    background-color: transparent;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--secondary-text-color);
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
    text-align: left;
    line-height: 1.2;
}

.menu-category-pill span:first-child {
    flex: 1;
    text-align: left;
    white-space: normal;
}

.menu-category-pill:hover {
    border-color: rgba(232, 93, 4, 0.4);
    background-color: rgba(232, 93, 4, 0.08);
    color: var(--primary-color);
}

.menu-category-pill.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(232, 93, 4, 0.35);
}

.menu-category-count {
    font-size: 0.9rem;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.3);
}

.menu-category-pill:not(.active) .menu-category-count {
    background-color: rgba(232, 93, 4, 0.15);
    color: var(--primary-color);
}

.virtual-menu-dropdown-container {
    margin: 0.5rem 0;
    padding: 0.25rem 0;
}

.virtual-menu-category-select {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    background-color: var(--surface-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    appearance: menulist;
}

.virtual-menu-category-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.virtual-menu-category-select:hover:not(:disabled) {
    border-color: var(--primary-color);
    background-color: var(--background-color);
}

.virtual-menu-category-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.virtual-menu-dropdown-container {
    margin: 0.5rem 0;
    padding: 0.25rem 0;
    position: relative;
    z-index: 10;
}

/* ── Sidebar section labels & dividers (outlet / category separation) ── */
.sidebar-section {
    display: contents; /* children flow directly into the parent flex column */
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
    padding: 0.1rem 0.4rem;
    margin-top: 0.15rem;
}

.sidebar-section-divider {
    height: 1px;
    background: var(--border-color, #e5e7eb);
    margin: 0.35rem 0.2rem;
}

/* Outlet pills rendered inside the category sidebar stack vertically */
.outlet-filter-pills-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* Outlet pills in the sidebar match category-pill shape but use blue accent */
.outlet-filter-pills-row .outlet-pill {
    width: 100%;
    border-radius: 999px;
    padding: 0.5rem 0.7rem;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    color: #475569;
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
    text-align: left;
}

.outlet-filter-pills-row .outlet-pill:hover {
    border-color: rgba(37, 99, 235, 0.4);
    background-color: rgba(37, 99, 235, 0.08);
    color: #2563eb;
}

.outlet-filter-pills-row .outlet-pill.active {
    background-color: #2563eb;
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.outlet-filter-pills-row .outlet-pill.active:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

/* ── VirtualOutletFilter — restriction badge & scoped styling ── */
.virtual-outlet-filter-label-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}

.outlet-restriction-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.25);
    white-space: nowrap;
    cursor: help;
}

.outlet-filter-restricted {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1) !important;
}

.outlet-filter-restricted:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2) !important;
}

.outlet-filter-locked {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #374151;
    cursor: not-allowed;
    user-select: none;
    min-width: 160px;
}

/* Outlet picker — expandable pill selector */
.outlet-picker-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    background-color: var(--surface-color);
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.outlet-picker-header:hover {
    border-color: var(--primary-color);
    background-color: var(--background-color);
}

.outlet-picker-header.expanded {
    border-color: var(--primary-color);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.outlet-picker-label {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.outlet-picker-caret {
    font-size: 0.65rem;
    margin-left: 0.4rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.outlet-picker-pills {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--primary-color);
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    overflow: hidden;
    background-color: var(--surface-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.outlet-pill {
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    background: none;
    border: none;
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.outlet-pill:first-child {
    border-top: none;
}

.outlet-pill:hover {
    background-color: rgba(232, 93, 4, 0.08);
    color: var(--primary-color);
}

.outlet-pill.active {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.outlet-pill.active:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.menu-items-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-height: 0;
}

.menu-items-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(200px, auto);
    gap: 0.9rem;
    padding: 0 0.25rem 1rem 0;
    flex: 1;
    align-content: flex-start;
    width: 100%;
}

@media (max-width: 768px) {
    .menu-items-grid {
        grid-template-columns: 1fr;
    }
}

.menu-item-tile {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.5rem;
    background-color: #fff;
    min-height: 160px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.menu-item-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.menu-item-photo {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #fafafa;
    cursor: pointer;
}

.menu-item-photo.compact {
    width: 75%;
    height: 55px;
    border-radius: 6px;
    margin: 0 auto;
    display: block;
}

.menu-item-tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.menu-item-preview-btn {
    border: none;
    background: rgba(232, 93, 4, 0.12);
    color: var(--primary-color);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.menu-item-preview-btn:hover {
    background: rgba(232, 93, 4, 0.2);
}

.menu-item-tile-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.menu-item-tile .menu-item-price {
    font-weight: 700;
    color: var(--primary-color);
}

.menu-item-tile .add-btn {
    margin-top: 0;
}

.loading-state.compact,
.empty-state.compact {
    min-height: auto;
    padding: 0.5rem;
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .menu-layout {
        flex-direction: column;
    }

    .menu-category-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        border-radius: 12px;
    }

    .menu-category-pill {
        flex: 1 0 calc(50% - 0.5rem);
    }
}

.add-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 600;
    white-space: nowrap;
    align-self: flex-start;
    margin-top: 0.25rem;
}

.add-btn:hover {
    background-color: var(--primary-hover-color);
}

.add-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.variation-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.5rem;
}

.menu-item-tile .variation-selector {
    margin-top: 0.25rem;
}

.menu-item-tile .variation-dropdown {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
}

.variation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: 100%;
}

.variation-btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
}

.variation-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(232, 93, 4, 0.06);
}

.variation-btn.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 1px 6px rgba(232, 93, 4, 0.3);
}

.variation-size {
    font-weight: 600;
    font-size: 0.78rem;
    line-height: 1.2;
    color: var(--text-color);
}

.variation-btn.selected .variation-size {
    color: white;
}

.variation-price {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-color);
    opacity: 1;
}

.variation-price::before {
    content: '·';
    margin-right: 3px;
    opacity: 0.5;
}

.variation-btn.selected .variation-price {
    color: rgba(255, 255, 255, 0.9);
}

.variation-hint {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    font-style: italic;
    margin-top: 0.25rem;
}


.variation-dropdown {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s;
    width: 100%;
}

.variation-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(232, 93, 4, 0.1);
}

.variation-info {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    font-style: italic;
    margin-left: 0.5rem;
}

.order-variation-selector {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.order-variation-selector .variation-dropdown {
    font-size: 0.85rem;
    padding: 0.4rem;
}

/* Order Column */
.order-items {
    min-height: 0;
}

.order-column {
    align-self: flex-start;
    overflow: visible;
}

.order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.order-header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.order-mode-control {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary-text-color);
}

.order-mode-select {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.25rem 0.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    background-color: rgba(232, 93, 4, 0.08);
    color: var(--primary-color);
    cursor: pointer;
}

.order-mode-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.2);
}

.order-mode-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: rgba(232, 93, 4, 0.04);
}

.discount-lock-note {
    margin: -0.25rem 0 0.5rem 0;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}

.order-column .column-content {
    flex-grow: 0;
    overflow: visible;
    max-height: none;
    padding-bottom: 0;
}

.order-column .order-summary {
    margin-top: 1.25rem;
}

.order-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    background-color: #e9ecef;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-text-color);
    transition: background-color 0.2s, color 0.2s;
}

.quantity-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.order-item-total {
    font-weight: 600;
    text-align: right;
    width: 70px;
}

.order-summary {
    margin-top: auto;
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.summary-line.discount-line,
.summary-line.customer-name-line {
    align-items: center;
}

.discount-input {
    width: 70px;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: right;
    font-size: 1rem;
    font-family: inherit;
    appearance: textfield;
    -moz-appearance: textfield;
    /* Firefox */
}

.customer-name-input {
    width: 150px;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: right;
    font-size: 1rem;
    font-family: inherit;
}

.discount-input::-webkit-outer-spin-button,
.discount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


.summary-line.total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 1rem;
}

.print-options-summary {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
}

.print-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.print-option label {
    font-weight: 600;
    color: var(--secondary-text-color);
    cursor: pointer;
}

.print-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}


.finalize-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 700;
}

.finalize-btn:hover {
    background-color: #218838;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-spinner {
    position: absolute;
    right: 8px;
    width: 18px;
    height: 18px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* AI Assistant Column */
.suggestion-card {
    background-color: #fff9f2;
    border: 1px solid #ffe8cc;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.suggestion-details {
    flex-grow: 1;
    margin-right: 1rem;
}

.suggestion-details p {
    margin: 0;
}

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
}

.suggestion-name {
    font-weight: 600;
    color: var(--primary-color);
}

.suggestion-price {
    font-weight: 600;
    color: var(--text-color);
}

.suggestion-reason {
    font-style: italic;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

.ai-suggestions-wrapper {
    position: relative;
    min-height: 220px;
}

.suggestions-list {
    display: flex;
    flex-direction: column;
}

.suggestions-list.dimmed {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.2);
}

.ai-loading-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-loading-grid.overlay {
    position: absolute;
    inset: 0;
    padding: 1.25rem;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(2px);
    border-radius: 12px;
    pointer-events: none;
}

.suggestion-card.loading {
    border-color: #f0f0f0;
    background-color: #ffffff;
}

.shimmer-block {
    position: relative;
    overflow: hidden;
    background-color: #f2f2f2;
    border-radius: 8px;
}

.shimmer-block::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: shimmer 1.3s infinite;
}

.shimmer-line {
    height: 12px;
    border-radius: 999px;
    margin-bottom: 0.4rem;
}

.shimmer-line:last-child {
    margin-bottom: 0;
}

.shimmer-line.w-60 {
    width: 60%;
}

.shimmer-line.w-80 {
    width: 80%;
}

.shimmer-chip {
    width: 64px;
    height: 36px;
    border-radius: 999px;
    margin-left: auto;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Kitchen & History Views */
.app-container.screen-mode {
    display: flex;
    max-width: 1000px;
    min-height: 0;
}

.kitchen-view,
.history-view {
    width: 100%;
}

.kitchen-toolbar,
.history-toolbar {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.kitchen-search,
.history-search {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    min-width: 150px;
}

.date-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-filter {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
}

.clear-filters-btn {
    background-color: var(--secondary-text-color);
    color: white;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.clear-filters-btn:hover {
    background-color: #5a6268;
}

.kitchen-order-card,
.history-order-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: #fff;
}

.kitchen-order-card .card-header,
.history-order-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.card-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.order-source {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    font-weight: 600;
    background-color: #e9ecef;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
}

.kitchen-order-card .card-header h3,
.history-order-card .card-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.kitchen-order-card .card-body,
.history-order-card .card-body {
    padding: 1rem;
}

.kitchen-order-card .card-body ul,
.history-order-card .card-body ul {
    list-style-type: none;
    padding-left: 0;
}

.kitchen-order-card .card-body li,
.history-order-card .card-body li {
    padding: 0.25rem 0;
}

.kitchen-order-card .card-footer,
.history-order-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--background-color);
    border-top: 1px solid var(--border-color);
    gap: 1rem;
}

.card-footer-left,
.card-footer-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.order-total {
    font-weight: 600;
    white-space: nowrap;
}

.order-total.big {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.order-details {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

.order-details strong {
    color: var(--text-color);
}

.card-action-btn {
    background: linear-gradient(135deg, #ffffff, #f4f6fb);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-color);
    padding: 0.65rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.card-action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(230, 90, 12, 0.2);
}

.kitchen-order-card .card-footer-right {
    display: flex;
    width: 100%;
}

.order-action-row {
    display: flex;
    align-items: stretch;
    gap: 0.6rem;
    width: 100%;
}

.order-action-row>* {
    flex: 1;
}

.status-pill {
    background: linear-gradient(135deg, #f5f7fa, #e4ebf5);
    border-radius: 10px;
    padding: 0.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), inset 0 -1px 4px rgba(15, 23, 42, 0.12);
}

.status-select {
    width: 100%;
    padding: 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    font-weight: 600;
    background-color: transparent;
    box-shadow: none;
}

.delete-btn {
    background: linear-gradient(135deg, #ff6b6b, #f63854);
    color: #fff;
    border-color: transparent;
}

.delete-btn:hover {
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 30px rgba(246, 56, 84, 0.4);
}

.refund-btn {
    background: linear-gradient(135deg, #89f7fe, #66a6ff);
    color: #0c2a52;
    border-color: transparent;
}

.refund-btn:hover {
    color: #fff;
    border-color: transparent;
    box-shadow: 0 15px 30px rgba(102, 166, 255, 0.4);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
}

.status-badge.status-pending {
    background-color: var(--status-pending);
    color: var(--text-color);
}

.status-badge.status-cooking {
    background-color: var(--status-cooking);
}

.status-badge.status-ready-for-delivery {
    background-color: var(--status-ready);
}

.status-badge.status-delivered {
    background-color: var(--secondary-text-color);
}

.refunded-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    background-color: #dc3545;
    display: inline-block;
    margin-right: 0.5rem;
}

.refund-btn {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.refund-btn:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: white;
}

.refunded-order {
    opacity: 0.7;
    border-color: #dc3545;
}

.refunded-order .card-header {
    background-color: #fff5f5;
}

/* Utility classes */
.empty-state,
.loading-state {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 100%;
    color: var(--secondary-text-color);
    text-align: center;
    font-size: 1.1rem;
}

/* Loading Icon Animation */
.orange-loading-icon {
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Legacy spin animation - kept for compatibility */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Image Modal Styles */
.image-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.image-modal-content {
    position: relative;
    background-color: var(--surface-color);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 90vw;
    max-height: 90vh;
    animation: zoomIn 0.3s ease;
}

.image-modal-content img {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 2rem);
    border-radius: 8px;
}

.image-modal-close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.8rem;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background-color 0.2s;
    z-index: 10;
}

.image-modal-close-btn:hover {
    background-color: var(--primary-hover-color);
    transform: scale(1.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Payment Modal Styles */
.payment-modal-content {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 450px;
    animation: zoomIn 0.3s ease;
    position: relative;
}

.payment-modal-content h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.payment-total-due {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed var(--border-color);
}

.payment-total-due strong {
    color: var(--primary-color);
    font-size: 2rem;
}

.split-payment-toggle {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.payment-method-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.payment-select,
.payment-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
}

.payment-input {
    padding-left: 2rem;
    appearance: textfield;
    -moz-appearance: textfield;
}

.payment-input::-webkit-outer-spin-button,
.payment-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.payment-input:read-only {
    background-color: var(--background-color);
    color: var(--secondary-text-color);
}

.payment-modal-content .input-wrapper .currency-symbol {
    position: absolute;
    left: 12px;
    color: var(--secondary-text-color);
    font-weight: 600;
}

.payment-error {
    color: #dc3545;
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
}

.payment-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border-color);
}

.confirm-payment-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    background-color: var(--status-ready);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.confirm-payment-btn:hover:not(:disabled) {
    background-color: #218838;
}

.confirm-payment-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.payment-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Refund Confirmation Modal */
.refund-modal-content {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
    animation: zoomIn 0.3s ease;
    position: relative;
}

.refund-modal-content h2 {
    text-align: center;
    color: #dc3545;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.refund-order-details {
    background-color: var(--background-color);
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.refund-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.refund-detail-row:last-child {
    border-bottom: none;
}

.refund-label {
    color: var(--secondary-text-color);
    font-size: 0.95rem;
}

.refund-detail-row strong {
    color: var(--text-color);
    font-size: 1rem;
}

.refund-amount {
    color: #dc3545;
    font-size: 1.25rem;
}

.refund-warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.refund-warning p {
    margin: 0;
    color: #856404;
    font-size: 0.95rem;
    line-height: 1.5;
}

.refund-confirmation-input {
    margin-bottom: 1.5rem;
}

.refund-confirmation-input label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.refund-confirmation-input label strong {
    color: #dc3545;
    font-size: 1.1rem;
}

.refund-confirmation-input input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.2s;
    box-sizing: border-box;
}

.refund-confirmation-input input:focus {
    outline: none;
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.refund-confirmation-input input.refund-input-error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.refund-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.refund-cancel-btn,
.refund-confirm-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.refund-cancel-btn {
    background-color: var(--background-color);
    color: var(--secondary-text-color);
    border: 1px solid var(--border-color);
}

.refund-cancel-btn:hover {
    background-color: #f8f9fa;
    border-color: var(--secondary-text-color);
}

.refund-confirm-btn {
    background-color: #dc3545;
    color: white;
}

.refund-confirm-btn:hover:not(:disabled) {
    background-color: #c82333;
}

.refund-confirm-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Sales Analytics Modal */
.sales-analytics-modal-content {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    animation: zoomIn 0.3s ease;
    position: relative;
}

.sales-analytics-modal-content h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.analytics-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-shortcuts-group {
    grid-column: 1 / -1;
}

.date-shortcuts {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.date-shortcut-btn {
    padding: 0.5rem 1rem;
    background-color: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.date-shortcut-btn:hover {
    background-color: var(--surface-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.date-shortcut-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.date-shortcut-btn.active:hover {
    background-color: #4a90e2;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.filter-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: all 0.2s;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.analytics-error {
    background-color: #fff5f5;
    border: 1px solid #dc3545;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #dc3545;
    text-align: center;
    font-weight: 600;
}

.analytics-loading {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-text-color);
    font-size: 1.1rem;
}

.analytics-results {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.analytics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-card {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.summary-card h3 {
    margin: 0 0 0.75rem 0;
    color: var(--secondary-text-color);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-value {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.75rem;
    font-weight: 700;
}

.analytics-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.breakdown-section {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.breakdown-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--surface-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.breakdown-label {
    color: var(--text-color);
    font-weight: 500;
}

.breakdown-value {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.05rem;
}

.no-data {
    text-align: center;
    color: var(--secondary-text-color);
    padding: 1rem;
    font-style: italic;
}

/* Orders Table Section */
.orders-table-section {
    margin-top: 2rem;
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.orders-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    width: 100%;
}

.orders-table-section h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 600;
}

.export-excel-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.export-excel-btn:hover {
    background-color: #4a90e2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.export-excel-btn:active {
    transform: translateY(0);
}

.orders-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: flex;
    justify-content: center;
}

.orders-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin: 0 auto;
}

.orders-table thead {
    background-color: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.orders-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

/* Align numeric columns to center/right in Menu Report */
.orders-table th:nth-child(3) {
    text-align: center;
}

.orders-table th:nth-child(4),
.orders-table th:nth-child(5) {
    text-align: right;
}

.orders-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    vertical-align: top;
}

.orders-table tbody tr:hover {
    background-color: var(--surface-color);
}

.orders-table tbody tr:last-child td {
    border-bottom: none;
}

.order-id-cell {
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

.order-date-cell {
    white-space: nowrap;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

.order-customer-cell {
    font-weight: 500;
}

.order-items-cell {
    min-width: 200px;
}

.order-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.order-item-entry {
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.order-item-entry:last-child {
    border-bottom: none;
}

.item-name {
    font-weight: 500;
    color: var(--text-color);
}

.item-variation {
    color: var(--secondary-text-color);
    font-size: 0.9em;
    font-weight: normal;
}

.order-quantity-cell {
    text-align: center;
}

.order-quantities-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.order-quantities-list li {
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.order-quantities-list li:last-child {
    border-bottom: none;
}

.order-status-cell {
    white-space: nowrap;
}

.status-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-cooking {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-ready-for-delivery {
    background-color: #d4edda;
    color: #155724;
}

.status-delivered {
    background-color: #cce5ff;
    color: #004085;
}

.status-refunded {
    background-color: #f8d7da;
    color: #721c24;
}

.order-total-cell {
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
    text-align: right;
}

.no-items {
    color: var(--secondary-text-color);
    font-style: italic;
}

/* Sales Analytics Page */
.sales-analytics-page {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.sales-analytics-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sales-analytics-header h1 {
    margin: 0;
    color: var(--primary-color);
    font-size: 2rem;
    flex: 1;
}

.back-button {
    padding: 0.75rem 1.5rem;
    background-color: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-button:hover {
    background-color: var(--surface-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    /* Hide on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.nav-btn {
    flex-grow: 1;
    background-color: transparent;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-text-color);
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn.active {
    color: var(--primary-color);
}

.nav-btn:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.order-badge {
    position: absolute;
    top: 8px;
    right: 12px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.08), rgba(255, 189, 89, 0.18));
}

.auth-card {
    width: min(420px, 100%);
    background: var(--surface-color);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
}

.auth-brand img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.auth-brand h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.auth-brand p {
    color: var(--secondary-text-color);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--secondary-text-color);
}

.auth-form input {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(232, 93, 4, 0.15);
}

.auth-form button {
    margin-top: 0.5rem;
    padding: 0.85rem;
    border-radius: 10px;
    border: none;
    background-color: var(--primary-color);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.auth-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-form button:not(:disabled):hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-1px);
}

.auth-error {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #dc3545;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
}

.auth-hint {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

.auth-loading-state {
    background: var(--background-color);
}

.auth-mode-toggle {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.auth-mode-toggle button {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    background: transparent;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-mode-toggle button.active {
    background-color: rgba(232, 93, 4, 0.12);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(232, 93, 4, 0.2);
}

.auth-info {
    background-color: rgba(25, 135, 84, 0.12);
    border: 1px solid rgba(25, 135, 84, 0.4);
    color: #198754;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
}

.auth-resend {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.auth-resend button {
    border: none;
    background-color: transparent;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
}

.auth-resend small {
    color: var(--secondary-text-color);
}


/* Admin Page Styles */
.admin-page {
    min-height: 100vh;
    background-color: var(--background-color);
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-header {
    background-color: var(--surface-color);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.admin-header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--primary-color);
}

.back-to-pos-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.back-to-pos-btn:hover {
    background-color: var(--primary-hover-color);
}

.admin-sidebar {
    width: 250px;
    background-color: var(--surface-color);
    padding: 1rem;
    margin-top: 80px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.2s ease;
}

.admin-sidebar.collapsed {
    width: 64px;
    padding: 0.75rem 0.5rem;
}

.sidebar-collapse-btn {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sidebar-collapse-btn:hover {
    background-color: var(--background-color);
    border-color: var(--primary-color);
}

.sidebar-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: left;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-btn.collapsed {
    justify-content: center;
    padding: 0.85rem 0;
    gap: 0;
}

.sidebar-btn-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-btn:hover {
    background-color: var(--background-color);
    border-color: var(--primary-color);
}

.sidebar-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.admin-content {
    margin-left: 250px;
    margin-top: 80px;
    padding: 2rem;
    width: calc(100% - 250px);
    min-height: calc(100vh - 80px);
    overflow-y: visible;
    transition: margin-left 0.2s ease, width 0.2s ease;
}

.admin-content.sidebar-collapsed {
    margin-left: 64px;
    width: calc(100% - 64px);
}

.dashboard-section h2,
.menu-section h2,
.orders-section h2,
.inventory-section h2,
.analytics-section h2,
.settings-section h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--primary-color);
}

.settings-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.settings-option-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    border-radius: 14px;
    border: 1px solid rgba(232, 93, 4, 0.16);
    background: var(--surface-color);
    color: var(--text-color);
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow);
}

.settings-option-card h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.settings-option-card p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--secondary-text-color);
}

.settings-option-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(232, 93, 4, 0.18);
    border-color: rgba(232, 93, 4, 0.36);
}

.settings-detail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.settings-back-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    border: 1px solid rgba(232, 93, 4, 0.3);
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.settings-back-btn:hover {
    background: rgba(232, 93, 4, 0.08);
    border-color: rgba(232, 93, 4, 0.5);
}

.settings-detail-card {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

/* Team filter controls */
.team-filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.team-filter-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
    white-space: nowrap;
}

.team-filter-select {
    flex: 1;
    max-width: 300px;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background-color: var(--surface-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.team-filter-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.team-filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.15);
}

/* Team table */
.team-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 1.5rem;
}

.team-table-wrapper.bordered {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background-color: var(--surface-color);
    box-shadow: var(--shadow);
}

.team-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.team-table.bordered th,
.team-table.bordered td {
    border-bottom: 1px solid var(--border-color);
}

.team-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--secondary-text-color);
    background-color: rgba(0, 0, 0, 0.02);
}

.team-table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

.team-table tbody tr:last-child td {
    border-bottom: none;
}

.team-table-name {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.team-table-plan {
    font-size: 0.85rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background-color: rgba(232, 93, 4, 0.1);
    color: var(--primary-color);
    width: fit-content;
}

.team-table-actions {
    text-align: right;
    white-space: nowrap;
}

.team-actions-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.team-actions-row.centered {
    justify-content: center;
}

.team-invite-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-color: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1.4rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-invite-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(124, 58, 237, 0.32);
}

.team-invite-icon {
    font-size: 1.1rem;
}

.team-invite-btn.small {
    padding: 0.5rem 1.1rem;
    font-size: 0.95rem;
}

.team-invite-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.team-invite-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    margin-left: 0.35rem;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.15);
    color: #7c3aed;
    font-size: 0.75rem;
    font-weight: 600;
}

.team-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.team-status-chip.status-pending {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

.team-status-chip.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.team-status-chip.status-suspended {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.team-status-chip.status-accepted {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.team-invite-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 1.5rem;
}

.team-invite-modal {
    width: 100%;
    max-width: 420px;
    background: var(--surface-color);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.team-invite-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-invite-modal-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.team-invite-modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.team-invite-modal-body label {
    font-weight: 600;
    color: var(--secondary-text-color);
}

.team-invite-modal-body .form-input,
.team-invite-modal-body select.form-input {
    width: 100%;
}

.team-invite-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Team Delete List Styles */
.team-delete-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.team-delete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.team-delete-item:hover {
    border-color: #dc3545;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15);
    transform: translateY(-2px);
}

.team-delete-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.team-delete-info strong {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 700;
}

.team-delete-meta {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

.custom-sort-btn.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.custom-sort-btn.danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.custom-sort-btn.danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tax-settings-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tax-country-selector {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 340px;
}

.tax-country-selector label {
    font-weight: 600;
    color: var(--text-color);
}

.tax-country-selector select {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background-color: var(--surface-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tax-country-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.12);
}

.tax-country-selector .field-hint {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
}

.tax-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.tax-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid rgba(232, 93, 4, 0.2);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.8));
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.04);
}

.tax-field span {
    font-weight: 600;
    color: var(--text-color);
}

.tax-field input {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tax-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.12);
}

.tax-field .field-hint {
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    font-style: italic;
}

.tax-settings-status {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-weight: 600;
}

.tax-settings-status.success {
    background: rgba(40, 167, 69, 0.12);
    color: #198754;
    border: 1px solid rgba(40, 167, 69, 0.35);
}

.tax-settings-status.error {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.35);
}

.tax-settings-actions {
    display: flex;
    justify-content: flex-end;
}

.secondary-btn {
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background-color: var(--background-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.secondary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.documents-section {
    margin-top: 2rem;
}

.documents-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.add-document-form {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.document-form-field {
    margin-bottom: 1rem;
}

.document-form-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.document-form-field input[type="text"],
.document-form-field input[type="date"],
.document-form-field input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.document-form-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.document-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.document-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.document-item button {
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: #dc3545;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.document-item button:hover {
    color: #c82333;
    transform: scale(1.1);
}

.billing-settings-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.billing-settings-description {
    margin: 0;
    color: var(--secondary-text-color);
}

.billing-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.billing-settings-row:last-of-type {
    border-bottom: none;
}

.billing-settings-label {
    margin: 0;
    font-weight: 600;
}

.billing-settings-hint {
    margin: 0.25rem 0 0;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

.billing-discount-input {
    width: 90px;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    text-align: right;
}

.billing-settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.settings-save-btn {
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--primary-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.settings-save-btn:hover {
    background-color: var(--primary-hover-color);
}

.settings-error {
    background-color: #ffe3e3;
    color: #721c24;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
}

.stat-icon {
    font-size: 3rem;
}

.stat-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--secondary-text-color);
    font-weight: 500;
}

.stat-value {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.chart-card h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.3rem;
    color: var(--text-color);
}

.chart-placeholder {
    height: 250px;
    background-color: var(--background-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-color);
    color: var(--secondary-text-color);
    font-size: 1.1rem;
}

/* Recent Orders - single line layout */
.recent-orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recent-order-line {
    display: grid;
    grid-template-columns: 120px 120px 1fr 140px auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.recent-order-line:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

.rol-id {
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.95rem;
}

.rol-customer {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.rol-items {
    color: var(--secondary-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

.rol-time {
    color: var(--secondary-text-color);
    font-size: 0.85rem;
    text-align: right;
}

.rol-total {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.top-items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.top-item-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.top-item-row:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.top-item-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.top-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.top-item-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-item-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

.trend-up-icon {
    color: #28a745;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.top-item-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

.top-item-quantity,
.top-item-revenue {
    display: flex;
    align-items: center;
}

.top-item-revenue {
    font-weight: 600;
    color: var(--primary-color);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 2rem;
    height: 2rem;
}

/* Variation Toggle Styles */
.variations-toggle-row {
    margin: 1rem 0;
}

.full-width {
    width: 100%;
}

.variation-toggle-wrapper {
    width: 100%;
}

.variation-toggle-card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.75rem;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    background: linear-gradient(120deg, rgba(232, 93, 4, 0.08), rgba(232, 93, 4, 0.01));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.variation-toggle-card.active {
    border-color: var(--primary-color);
    background: linear-gradient(120deg, rgba(232, 93, 4, 0.12), rgba(232, 93, 4, 0.03));
    box-shadow: 0 10px 20px rgba(232, 93, 4, 0.15);
}

.variation-toggle-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(232, 93, 4, 0.18);
}

.variation-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: var(--text-color);
}

.variation-toggle-info h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.variation-toggle-info span {
    font-size: 0.95rem;
    color: var(--text-muted-color);
}

.variation-toggle-eyebrow {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-color);
}

.variation-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 0.4rem;
}

.variation-toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.variation-switch-track {
    width: 64px;
    height: 32px;
    background: var(--border-color);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    transition: background 0.25s ease, box-shadow 0.25s ease;
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.2);
}

.variation-switch-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.25);
    transition: transform 0.25s ease, background 0.25s ease;
}

.variation-switch.checked .variation-switch-track {
    background: linear-gradient(120deg, var(--primary-color), var(--primary-hover-color));
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.variation-switch.checked .variation-switch-thumb {
    transform: translateX(32px);
    background: #fff;
}

.manage-variations-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.manage-variations-btn:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Variations Preview */
.variations-preview {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.variations-preview h4 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1rem;
}

.variations-preview-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.variation-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: var(--surface-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.variation-preview-name {
    font-weight: 600;
    color: var(--text-color);
    flex: 1;
}

.variation-preview-details {
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    margin: 0 1rem;
}

.variation-preview-price {
    font-weight: 700;
    color: var(--primary-color);
}

/* Variation Modal Styles */
.variation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.variation-modal-content {
    background-color: white;
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    animation: slideUp 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(232, 93, 4, 0.1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.variation-modal-header {
    padding: 2rem 2rem 1.5rem 2rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.05) 0%, rgba(232, 93, 4, 0.02) 100%);
}

.variation-modal-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.variation-modal-subtitle {
    margin: 0;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

.modal-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-text-color);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background-color: var(--background-color);
    color: var(--text-color);
}

.variation-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    background-color: #fafafa;
}

.variation-modal-body .form-group {
    margin-bottom: 1.75rem;
}

.variation-modal-body .form-group:last-child {
    margin-bottom: 0;
}

.variation-modal-body .form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.pricing-toggle-group {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem !important;
}

.pricing-toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.pricing-toggle-info {
    flex: 1;
}

.pricing-toggle-info label {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.pricing-toggle-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    line-height: 1.4;
}

.pricing-switch {
    flex-shrink: 0;
}

/* ── Virtual Outlet Panel — 3-column workspace ─────────────────────── */
.virtual-outlet-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vop-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Existing outlet cards row */
.vop-outlet-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.vop-outlet-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface-color);
    transition: border-color 0.15s;
}

.vop-outlet-card.editing {
    border-color: var(--primary-color);
    background: rgba(232, 93, 4, 0.04);
}

.vop-outlet-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.vop-outlet-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    white-space: nowrap;
}

.vop-outlet-meta {
    font-size: 0.78rem;
    color: var(--secondary-text-color);
}

.vop-outlet-card-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* 3-column workspace */
.vop-workspace {
    display: grid;
    grid-template-columns: 280px 220px 1fr;
    gap: 0;
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    min-height: 540px;
}

.vop-col {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.vop-col + .vop-col {
    border-left: 1.5px solid var(--border-color);
}

.vop-col-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary-text-color);
    background: var(--surface-color);
    border-bottom: 1.5px solid var(--border-color);
    flex-shrink: 0;
}

/* Column 1 — Details */
.vop-col-details {
    padding: 1rem;
    gap: 0;
    background: var(--background-color);
    overflow-y: auto;
}

.vop-col-details .form-group {
    margin-bottom: 1rem;
}

.vop-col-details .form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.vop-col-details .form-input {
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
}

.vop-selection-summary {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.vop-col-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.vop-col-actions .custom-sort-btn {
    flex: 1;
}

/* Column 2 — Categories */
.vop-col-categories {
    background: var(--background-color);
}

.vop-category-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem 0;
}

.vop-category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.65rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: background 0.12s;
    gap: 0.5rem;
}

.vop-category-item:hover {
    background: rgba(232, 93, 4, 0.06);
}

.vop-category-item.active {
    background: rgba(232, 93, 4, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.vop-cat-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vop-cat-badge {
    font-size: 0.78rem;
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
    background: var(--border-color);
    color: var(--secondary-text-color);
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

.vop-cat-badge.has-selection {
    background: var(--primary-color);
    color: white;
}

/* Column 3 — Items */
.vop-col-items {
    background: #fff;
    padding: 0.75rem;
    gap: 0;
}

.vop-items-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.vop-item-row {
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.vop-item-row:hover {
    border-color: var(--primary-color);
    background: rgba(232, 93, 4, 0.03);
}

.vop-item-row.selected {
    border-color: var(--primary-color);
    background: rgba(232, 93, 4, 0.05);
}

.vop-item-row-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.vop-item-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 0.1rem;
}

.vop-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.vop-item-cat {
    font-size: 0.75rem;
    color: var(--secondary-text-color);
}

.vop-item-price {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    font-weight: 600;
    flex-shrink: 0;
    padding: 0.2rem 0.45rem;
    background: rgba(232, 93, 4, 0.08);
    border-radius: 4px;
}

.vop-item-pricing {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border-color);
}

/* Danger btn variant */
.custom-sort-btn.danger {
    background-color: transparent;
    color: #d32f2f;
    border: 1.5px solid #d32f2f;
}

.custom-sort-btn.danger:hover:not(:disabled) {
    background-color: #d32f2f;
    color: white;
}

@media (max-width: 900px) {
    .vop-workspace {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
    }
    .vop-col + .vop-col {
        border-left: none;
        border-top: 1.5px solid var(--border-color);
    }
    .vop-col-categories { max-height: 200px; }
}

.variation-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--secondary-text-color);
}

.variation-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.variation-item-card {
    background-color: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.variation-item-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.variation-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.variation-number {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.variation-remove-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.variation-remove-btn:hover {
    background-color: #c82333;
    transform: scale(1.1);
}

.variation-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.variation-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.variation-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.variation-field input,
.variation-field select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.variation-field input:focus,
.variation-field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.add-variation-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.add-variation-btn:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.variation-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.add-item-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.add-item-btn:hover {
    background-color: var(--primary-hover-color);
}

.menu-form-card {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.menu-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.menu-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    border: 1px solid rgba(232, 93, 4, 0.2);
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.menu-tab-btn .menu-tab-icon {
    font-size: 1.1rem;
}

.menu-tab-btn:hover {
    background: rgba(232, 93, 4, 0.1);
    border-color: rgba(232, 93, 4, 0.35);
    box-shadow: 0 12px 22px rgba(232, 93, 4, 0.16);
}

.menu-tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: white;
    border-color: transparent;
    box-shadow: 0 18px 30px rgba(232, 93, 4, 0.26);
}

.menu-form-card.is-editing {
    border-color: rgba(232, 93, 4, 0.35);
    box-shadow: 0 20px 45px rgba(232, 93, 4, 0.18);
}

.form-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-card-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.form-card-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
    color: var(--secondary-text-color);
    max-width: 600px;
}

.status-badge.editing {
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.18), rgba(244, 140, 6, 0.12));
    color: var(--primary-color);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(232, 93, 4, 0.22);
}

.menu-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
    gap: 2rem;
    align-items: flex-start;
}

.menu-form-fields {
    display: flex;
    flex-direction: column;
}

.form-section {
    padding: 1.75rem;
    border-radius: 16px;
    border: 1px solid rgba(232, 93, 4, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 249, 250, 0.82));
    box-shadow: 0 12px 30px rgba(17, 24, 39, 0.06);
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-section-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color);
    font-weight: 700;
}

.form-section-header p {
    margin: 0.35rem 0 0;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

.form-section-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.full-width-row {
    grid-template-columns: 1fr;
}

.menu-edit-preview {
    position: sticky;
    top: 110px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.75rem;
    border-radius: 18px;
    border: 1px solid rgba(232, 93, 4, 0.18);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.75));
    box-shadow: 0 16px 35px rgba(17, 24, 39, 0.08);
}

.preview-image-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(232, 93, 4, 0.18);
    box-shadow: 0 18px 30px rgba(232, 93, 4, 0.16);
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-title {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-color);
    font-weight: 700;
}

.preview-category {
    margin: 0;
    font-size: 0.95rem;
    color: var(--secondary-text-color);
}

.preview-price-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: rgba(232, 93, 4, 0.08);
    border: 1px solid rgba(232, 93, 4, 0.16);
}

.preview-price-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-price-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.preview-variations {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-variations-label {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-variations ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.preview-variations li {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(232, 93, 4, 0.12);
    font-size: 0.9rem;
    color: var(--text-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.image-input-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.image-input-wrapper input[type="url"] {
    flex: 1 1 260px;
    min-width: 220px;
}

.image-preview {
    width: 110px;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 20px rgba(17, 24, 39, 0.08);
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.1), rgba(244, 140, 6, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-preview-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clear-image-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.clear-image-btn:hover {
    transform: scale(1.05);
    background: rgba(232, 93, 4, 0.75);
}

.input-hint {
    margin-top: 0.65rem;
    font-size: 0.85rem;
    color: var(--secondary-text-color);
}

.category-chip-row {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-chip {
    border: 1px solid rgba(232, 93, 4, 0.25);
    background: rgba(232, 93, 4, 0.08);
    color: var(--primary-color);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-chip.active,
.category-chip:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 18px rgba(232, 93, 4, 0.24);
}

@media (max-width: 1024px) {
    .menu-edit-grid {
        grid-template-columns: 1fr;
    }

    .menu-edit-preview {
        position: static;
        order: -1;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.create-category-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.create-category-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.create-category-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.create-category-input:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.create-category-actions {
    display: flex;
    gap: 0.5rem;
}

.save-category-btn,
.cancel-category-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.save-category-btn {
    background-color: var(--primary-color);
    color: white;
}

.save-category-btn:hover:not(:disabled) {
    background-color: var(--primary-hover-color);
}

.save-category-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.cancel-category-btn {
    background-color: var(--secondary-text-color);
    color: white;
}

.cancel-category-btn:hover:not(:disabled) {
    background-color: #5a6268;
}

.cancel-category-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Custom Category Dropdown */
.custom-category-dropdown {
    position: relative;
}

.category-dropdown-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.category-dropdown-trigger:hover {
    border-color: var(--primary-color);
}

.category-dropdown-trigger .placeholder-text {
    color: var(--secondary-text-color);
}

.dropdown-arrow {
    font-size: 0.75rem;
    color: var(--secondary-text-color);
    transition: transform 0.2s;
}

.category-dropdown-trigger.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 998;
}

.category-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}

.dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.selected {
    background-color: rgba(232, 93, 4, 0.1);
    font-weight: 600;
}

.dropdown-item.empty {
    color: var(--secondary-text-color);
    cursor: default;
    justify-content: center;
}

.dropdown-item.empty:hover {
    background-color: transparent;
}

.dropdown-item.add-new {
    color: var(--primary-color);
    font-weight: 600;
    border-top: 2px solid var(--border-color);
}

.dropdown-item.add-new:hover {
    background-color: rgba(232, 93, 4, 0.1);
}

.category-name {
    flex: 1;
}

.category-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    border: none;
    background-color: transparent;
    color: #dc3545;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.category-delete-btn:hover {
    background-color: #f8d7da;
    color: #721c24;
}

.category-delete-btn:active {
    transform: scale(0.95);
}

.category-delete-btn svg {
    width: 16px;
    height: 16px;
}

.form-actions {
    display: flex;
    gap: 1rem;
}

.save-btn,
.cancel-btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
}

.save-btn {
    background-color: #28a745;
    color: white;
}

.save-btn:hover {
    background-color: #218838;
}

.cancel-btn {
    background-color: var(--secondary-text-color);
    color: white;
}

.cancel-btn:hover {
    background-color: #5a6268;
}

.menu-items-list {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.menu-items-list h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    color: var(--text-color);
}

.menu-items-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.menu-items-search input {
    flex: 1;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.menu-items-search input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(232, 93, 4, 0.15);
    outline: none;
}

.menu-items-search .clear-search-btn {
    border: none;
    background: rgba(232, 93, 4, 0.12);
    color: var(--primary-color);
    padding: 0.55rem 0.95rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.menu-items-search .clear-search-btn:hover {
    background: rgba(232, 93, 4, 0.2);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
    padding: 0.5rem 0.25rem 0 0.25rem;
}

.menu-item-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--background-color);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.menu-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.item-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: var(--border-color);
}

.item-details {
    padding: 1rem;
}

.item-details h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.item-category {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

.item-price {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.item-visibility-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.item-visibility-status.active {
    background: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
}

.item-visibility-status.inactive {
    background: rgba(220, 53, 69, 0.15);
    color: #b71c1c;
}

.item-visibility-toggle {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--surface-color);
}

.item-visibility-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.item-visibility-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-color);
}

.item-visibility-subtext {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
}

.item-visibility-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 0.3rem;
}

.item-visibility-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.item-visibility-track {
    width: 60px;
    height: 28px;
    background: var(--border-color);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    padding: 0 3px;
    transition: background 0.25s ease, box-shadow 0.25s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
}

.item-visibility-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.25);
    transition: transform 0.25s ease, background 0.25s ease;
}

.item-visibility-switch.checked .item-visibility-track {
    background: linear-gradient(120deg, var(--primary-color), var(--primary-hover-color));
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.12);
}

.item-visibility-switch.checked .item-visibility-thumb {
    transform: translateX(30px);
}

.item-visibility-switch.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.edit-btn,
.delete-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.edit-btn {
    background-color: #007bff;
    color: white;
}

.edit-btn:hover {
    background-color: #0056b3;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
}

.delete-btn:hover {
    background-color: #c82333;
}

.orders-filters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
    border-color: var(--primary-color);
    color: #fff;
    background-color: var(--primary-color);
}

.custom-date-range {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.custom-date-range label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

.custom-date-range input {
    margin-top: 0.25rem;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.orders-error {
    padding: 0.75rem 1rem;
    background: #fff5f5;
    border: 1px solid #f5c2c7;
    border-radius: 8px;
    color: #842029;
    margin-bottom: 1rem;
}

.orders-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.order-stat-card {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    text-align: center;
}

.order-stat-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    color: var(--secondary-text-color);
    font-weight: 500;
}

.stat-number {
    margin: 0;
    font-size: 3rem;
    font-weight: 700;
}

.order-stat-card.pending .stat-number {
    color: var(--status-pending);
}

.order-stat-card.delivered .stat-number {
    color: var(--status-ready);
}

.order-stat-card.total .stat-number {
    color: var(--primary-color);
}

.recent-orders,
.orders-placeholder,
.inventory-features,
.report-cards {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.recent-orders h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    color: var(--text-color);
}

.orders-placeholder {
    text-align: center;
    color: var(--secondary-text-color);
    font-size: 1.2rem;
}

.placeholder-note {
    font-size: 1rem;
    margin-top: 0.5rem;
}

.inventory-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    position: relative;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(248, 249, 250, 0.7));
    border-radius: 18px;
    border: 1px solid rgba(232, 93, 4, 0.15);
    box-shadow: 0 20px 35px rgba(17, 24, 39, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.feature-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.08) 0%, rgba(255, 255, 255, 0) 60%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.feature-card:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow: 0 28px 45px rgba(232, 93, 4, 0.18);
}

.feature-card:hover::after {
    opacity: 1;
}

.feature-icon {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.18), rgba(244, 140, 6, 0.08));
    border: 1px solid rgba(232, 93, 4, 0.25);
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.6), 0 10px 18px rgba(232, 93, 4, 0.24);
    animation: iconPulse 2.6s ease-in-out infinite;
    z-index: 1;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.6), 0 10px 18px rgba(232, 93, 4, 0.24);
    }

    50% {
        transform: scale(1.08);
        box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.8), 0 14px 24px rgba(232, 93, 4, 0.32);
    }
}

.feature-card h3 {
    margin: 0;
    font-size: 1.35rem;
    color: var(--text-color);
    font-weight: 700;
}

.feature-card p {
    margin: 0;
    color: var(--secondary-text-color);
}

.placeholder-box {
    width: 100%;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 14px;
    color: rgba(52, 58, 64, 0.75);
    border: 1px dashed rgba(232, 93, 4, 0.35);
    font-weight: 600;
}

.report-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 400px));
    gap: 1.75rem;
    justify-content: start;
}

.report-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
    padding: 2rem 1.75rem;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.75));
    border-radius: 20px;
    border: 1px solid rgba(232, 93, 4, 0.12);
    box-shadow: 0 18px 40px rgba(17, 24, 39, 0.08);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    overflow: hidden;
}

.report-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(232, 93, 4, 0.12), transparent 55%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.report-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 30px 48px rgba(232, 93, 4, 0.2);
}

.report-card:hover::before {
    opacity: 1;
}

.report-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.22), rgba(244, 140, 6, 0.1));
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    border: 1px solid rgba(232, 93, 4, 0.25);
    box-shadow: 0 12px 20px rgba(232, 93, 4, 0.22);
    z-index: 1;
}

.report-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1;
}

.report-card-body h3 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--text-color);
    font-weight: 700;
}

.report-card-body p {
    margin: 0;
    color: var(--secondary-text-color);
}

.generate-btn {
    align-self: flex-start;
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    border: none;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 22px rgba(232, 93, 4, 0.26);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 1;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(232, 93, 4, 0.32);
}

/* EOD Report Preview Modal */
.eod-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    animation: fadeIn 0.25s ease;
}

.eod-modal {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
    animation: zoomIn 0.3s ease;
    overflow: hidden;
}

.eod-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.eod-modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: #1e293b;
    font-weight: 700;
}

.eod-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.eod-modal-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.eod-modal-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
}

.eod-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.eod-action-view {
    background: #eff6ff;
    color: #2563eb;
}

.eod-action-view:hover {
    background: #dbeafe;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.eod-action-pdf {
    background: #fef2f2;
    color: #dc2626;
}

.eod-action-pdf:hover {
    background: #fee2e2;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

.eod-action-print {
    background: #f0fdf4;
    color: #16a34a;
}

.eod-action-print:hover {
    background: #dcfce7;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15);
}

.eod-modal-preview {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8fafc;
}

.eod-preview-content {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 11pt;
    color: #000;
}

.eod-preview-content h1 {
    font-size: 18pt;
    text-align: center;
    margin: 0 0 12px;
}

.eod-preview-content p {
    margin: 4px 0;
}

.eod-preview-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.eod-preview-content th,
.eod-preview-content td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.eod-preview-content th {
    background: #f8fafc;
    font-weight: 600;
}

.eod-preview-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 12px 0;
}

.eod-preview-content .right {
    text-align: right;
}

.eod-preview-content .footer {
    text-align: center;
    font-style: italic;
    margin-top: 16px;
    color: #64748b;
}

@media (max-width: 640px) {
    .eod-modal {
        width: 95%;
        max-height: 90vh;
    }

    .eod-modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .eod-action-btn {
        flex: unset;
    }
}

/* Settings Section */
.settings-description {
    margin-bottom: 2rem;
    color: var(--secondary-text-color);
    font-size: 1.1rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.settings-category-card {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.settings-category-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.settings-category-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.settings-category-icon {
    font-size: 2rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.settings-category-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    color: var(--text-color);
}

.settings-category-info p {
    margin: 0;
    color: var(--secondary-text-color);
    font-size: 0.95rem;
    line-height: 1.5;
}

.settings-category-items {
    flex: 1;
    margin-bottom: 1.5rem;
}

.settings-category-items ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-category-items li {
    padding: 0.5rem 0;
    color: var(--text-color);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-category-items li:last-child {
    border-bottom: none;
}

.settings-category-items li::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-right: 0.5rem;
}

.settings-category-footer {
    margin-top: auto;
}

.settings-edit-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.settings-edit-btn:hover {
    background-color: var(--primary-hover-color);
}

/* Settings Section */
.settings-main-header {
    margin-bottom: 2rem;
}

.settings-main-header h2 {
    margin-bottom: 0.5rem;
}

.settings-main-description {
    color: var(--secondary-text-color);
    font-size: 1.1rem;
}

/* Currency Management Section */
.currency-management-section {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.currency-section-content {
    min-height: 100px;
}

.currency-selector-wrapper {
    position: relative;
    max-width: 500px;
}

.currency-selector-wrapper label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.currency-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.currency-dropdown-trigger:hover {
    border-color: var(--primary-color);
    background-color: rgba(232, 93, 4, 0.05);
}

.currency-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.currency-symbol-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.currency-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.currency-name-display {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.currency-country-display {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
}

.currency-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.currency-search-wrapper {
    position: relative;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.currency-search-wrapper .search-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-text-color);
    width: 1.2rem;
    height: 1.2rem;
}

.currency-search-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: var(--background-color);
    color: var(--text-color);
}

.currency-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.currency-dropdown-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.currency-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.currency-item:hover {
    background-color: rgba(232, 93, 4, 0.1);
    border-color: var(--primary-color);
}

.currency-item.selected {
    background-color: rgba(232, 93, 4, 0.15);
    border-color: var(--primary-color);
}

.currency-item-symbol {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 35px;
    text-align: center;
}

.currency-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.currency-item-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.currency-item-country {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
}

.currency-item-code {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background-color: var(--background-color);
    border-radius: 4px;
}

/* Variations Tab Wrapper + Sub-tabs */
.variations-tab-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.variations-sub-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 0 0;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.variations-sub-tab-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    border-radius: 6px 6px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
}

.variations-sub-tab-btn:hover {
    color: var(--primary-color, #6366f1);
    background: rgba(99, 102, 241, 0.06);
}

.variations-sub-tab-btn.active {
    color: var(--primary-color, #6366f1);
    border-bottom: 2px solid var(--primary-color, #6366f1);
    font-weight: 600;
}

/* Variation Management Section */
.variation-management-section {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.variation-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.variation-section-title h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.variation-section-description {
    margin: 0;
    color: var(--secondary-text-color);
    line-height: 1.6;
    max-width: 600px;
}

.variation-section-content {
    min-height: 200px;
}

.add-variation-btn-header {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
    height: fit-content;
}

.add-variation-btn-header:hover {
    background-color: var(--primary-hover-color);
}

.variations-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.variation-card {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.variation-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.variation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.variation-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 600;
}

.variation-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.variation-measurement {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

.variation-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.variation-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-variation-btn,
.delete-variation-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-variation-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.delete-variation-btn:hover {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* ── Variation Group — Assign Items Panel ─────────── */
.vgp-assign-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    color: var(--text-color);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.vgp-assign-btn:hover,
.vgp-assign-btn--open {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.vgp-assign-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.vgp-assign-btn--open .vgp-assign-count {
    background: rgba(255,255,255,0.3);
}

.vgp-assign-panel {
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vgp-assign-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.vgp-assign-panel-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.vgp-loading-dot {
    font-weight: 400;
    color: var(--secondary-text-color);
}

.vgp-assigned-count-label {
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    background: var(--background-color, #f3f4f6);
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
}

.vgp-assign-search {
    position: relative;
    display: flex;
    align-items: center;
}

.vgp-search-icon {
    position: absolute;
    left: 10px;
    color: var(--secondary-text-color);
    font-size: 14px;
    pointer-events: none;
}

.vgp-assign-search input {
    width: 100%;
    padding: 7px 10px 7px 32px;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    font-size: 0.85rem;
    background: var(--surface-color);
    color: var(--text-color);
    outline: none;
    transition: border-color 0.15s;
}

.vgp-assign-search input:focus {
    border-color: var(--primary-color);
}

.vgp-items-list {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
}

.vgp-no-items {
    padding: 16px;
    text-align: center;
    color: var(--secondary-text-color);
    font-size: 0.85rem;
    margin: 0;
}

.vgp-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.1s;
}

.vgp-item-row:last-child {
    border-bottom: none;
}

.vgp-item-row:hover {
    background: var(--background-color, #f9fafb);
}

.vgp-item-row--assigned {
    background: rgba(232, 93, 4, 0.04);
}

.vgp-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.vgp-item-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vgp-item-cat {
    font-size: 0.75rem;
    color: var(--secondary-text-color);
    margin-top: 2px;
}

/* Toggle switch */
.vgp-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.vgp-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.vgp-toggle-track {
    display: inline-block;
    width: 36px;
    height: 20px;
    background: #d1d5db;
    border-radius: 999px;
    position: relative;
    transition: background 0.2s;
}

.vgp-toggle input:checked + .vgp-toggle-track {
    background: var(--primary-color);
}

.vgp-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.vgp-toggle input:checked + .vgp-toggle-track .vgp-toggle-thumb {
    transform: translateX(16px);
}

.vgp-toggle--loading {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.vgp-assign-note {
    font-size: 0.78rem;
    color: var(--secondary-text-color);
    margin: 0;
    font-style: italic;
}

/* Variation Dropdown in Menu Management */
.variation-dropdown-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.variation-dropdown-container label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.variation-dropdown {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background-color: var(--surface-color);
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.2s;
}

.variation-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
}

.variation-dropdown-hint {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    margin: 0.5rem 0 0 0;
    font-style: italic;
}

/* Variation Prices Section */
.variation-prices-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: var(--background-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.variation-prices-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.variation-prices-hint {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    font-style: italic;
}

.variation-prices-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.variation-price-input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.variation-size-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.variation-size-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.variation-size-type {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
}

.variation-size-optional {
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.variation-price-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.variation-price-input-container label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.variation-price-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
}

.variation-price-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.remove-variation-btn {
    background-color: transparent;
    border: none;
    color: var(--secondary-text-color);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-variation-btn:hover {
    background-color: #dc3545;
    color: white;
}

.variation-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.variation-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.variation-form label {
    font-weight: 600;
    color: var(--text-color);
}

.variation-form input,
.variation-form select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.variation-form input:focus,
.variation-form select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Variation Group Sizes Input */
.sizes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.add-size-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.add-size-btn:hover {
    background-color: var(--primary-hover-color);
}

.sizes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    background-color: var(--background-color);
    border-radius: 6px;
}

.size-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.size-name-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.size-option-select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    min-width: 120px;
}

.remove-size-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--secondary-text-color);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-size-btn:hover {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.variation-sizes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.size-badge {
    background-color: var(--background-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.variation-sizes-count {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .admin-sidebar {
        position: static;
        width: 100%;
        margin-top: 0;
    }

    .admin-content {
        margin-left: 0;
        margin-top: 0;
        width: 100%;
    }

    .admin-container {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .dashboard-charts {
        grid-template-columns: 1fr;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .admin-header {
        padding: 1rem;
    }

    .admin-header h1 {
        font-size: 1.3rem;
    }

    .admin-content {
        padding: 1rem;
    }

    .settings-options {
        grid-template-columns: 1fr;
    }

    .settings-option-card {
        padding: 1.25rem;
    }

    .settings-detail {
        margin-top: 1rem;
    }

    .settings-detail-card {
        padding: 1.5rem;
    }

    .settings-detail {
        margin-top: 1rem;
    }

    .settings-detail-card {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 1fr 1fr;
    }

    .app-container.ai-disabled {
        grid-template-columns: 1fr 1fr;
    }

    .ai-column {
        grid-column: 1 / 3;
    }
}

@media (max-width: 768px) {
    .app-header h1 {
        font-size: 1.2rem;
    }

    .user-info span {
        display: none;
    }

    .nav-buttons {
        position: static;
        transform: none;
        order: -1;
        /* Move to the left on mobile */
    }

    .header-nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .app-header {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .user-info {
        flex-basis: 100%;
        justify-content: flex-end;
    }

    .variation-btn {
        min-width: 80px;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .variation-size {
        font-size: 1rem;
    }

    .variation-price {
        font-size: 0.9rem;
    }

    .app-container {
        display: block;
        padding: 0;
        padding-bottom: 60px;
        /* Space for mobile nav */
        height: 100%;
    }

    .column {
        display: none;
        border-radius: 0;
        box-shadow: none;
        height: 100%;
    }

    .column.active,
    .app-container.screen-mode .column {
        display: flex;
    }

    .column-header {
        font-size: 1.25rem;
    }

    .mobile-nav {
        display: flex;
    }

    .app-container.screen-mode {
        padding-bottom: 0;
    }

    .ai-column {
        grid-column: auto;
    }
}

/* Category Management Section */
.category-management-section {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.category-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.category-section-title {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.category-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: rgba(232, 93, 4, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.category-section-title h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.category-section-description {
    margin: 0;
    color: var(--secondary-text-color);
    max-width: 520px;
    line-height: 1.6;
}

.category-section-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
}

.category-form {
    background-color: var(--background-color);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-form-fields {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.category-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.add-category-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.add-category-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.add-category-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(232, 93, 4, 0.3);
}

.category-hint {
    margin: 0;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

.category-list-card {
    background-color: var(--background-color);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.category-list-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.category-search input {
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    min-width: 180px;
}

.category-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.category-empty-state {
    padding: 1rem;
    border-radius: 8px;
    background-color: rgba(232, 93, 4, 0.08);
    color: var(--secondary-text-color);
    text-align: center;
    font-weight: 600;
}

.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.category-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background-color: #fff;
    border: 1px solid var(--border-color);
}

.category-name-text {
    font-weight: 600;
    color: var(--text-color);
}

.category-delete-button {
    border: none;
    background-color: transparent;
    color: #dc3545;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.category-delete-button:hover {
    background-color: rgba(220, 53, 69, 0.12);
    color: #a71d2a;
}

/* Restaurant Print Settings Panel */
.restaurant-print-settings-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.restaurant-print-fields {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.restaurant-print-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.restaurant-print-field label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.restaurant-print-field input,
.restaurant-print-field textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.restaurant-print-field input:focus,
.restaurant-print-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.restaurant-print-field textarea {
    resize: vertical;
    min-height: 100px;
}

.restaurant-print-field .field-hint {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    margin: 0;
}

.restaurant-print-field .toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.restaurant-print-field .toggle-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.tax-field-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
}

.tax-field-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.tax-field-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.tax-field-checkbox-label span {
    user-select: none;
}

.restaurant-print-settings-status {
    padding: 0.85rem 1.1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}

.restaurant-print-settings-status.success {
    background: rgba(40, 167, 69, 0.12);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.35);
}

.restaurant-print-settings-status.error {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.35);
}

.restaurant-print-settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

@media (max-width: 1024px) {
    .category-section-content {
        grid-template-columns: 1fr;
    }
}

.menu-management-body {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
}

.menu-tab-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 220px;
    position: sticky;
    top: 120px;
}

.menu-tab-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.menu-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    border: 1px solid rgba(232, 93, 4, 0.2);
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.menu-tab-btn .menu-tab-icon {
    font-size: 1.1rem;
}

.menu-tab-btn:hover {
    background: rgba(232, 93, 4, 0.1);
    border-color: rgba(232, 93, 4, 0.35);
    box-shadow: 0 12px 22px rgba(232, 93, 4, 0.16);
}

.menu-tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: white;
    border-color: transparent;
    box-shadow: 0 18px 30px rgba(232, 93, 4, 0.26);
}

@media (max-width: 1024px) {
    .menu-tabs {
        gap: 0.5rem;
    }
}

/* =========================================
   Sales Analytics Page Styles
   ========================================= */

.sales-analytics-page {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text-color);
    animation: fadeIn 0.5s ease-out;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.header-title h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.header-subtitle {
    color: var(--secondary-text-color);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.back-btn-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    font-weight: 600;
    color: var(--secondary-text-color);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.back-btn-modern:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
    transform: translateX(-4px);
}

.export-btn-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.export-btn-modern:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 93, 4, 0.15);
}

/* Glass Panels & Cards */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.05);
}

.filters-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.filter-row {
    display: flex;
    gap: 2rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group-modern {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group-modern label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-group {
    display: flex;
    background-color: rgba(0, 0, 0, 0.04);
    padding: 4px;
    border-radius: 10px;
}

.toggle-btn {
    padding: 0.5rem 1.2rem;
    border: none;
    background: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    background-color: #fff;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.date-inputs-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-inputs-row input,
.filter-group-modern select {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.date-inputs-row input:focus,
.filter-group-modern select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    color: #fff;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
}

.metric-card:hover {
    transform: translateY(-5px) scale(1.02);
}

.metric-card.gradient-1 {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.3);
}

.metric-card.gradient-2 {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3);
}

.metric-card.gradient-3 {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.metric-card.glass-card {
    background: #fff;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.metric-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.75rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon.secondary {
    background: rgba(232, 93, 4, 0.1);
    color: var(--primary-color);
}

.metric-info h3 {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-info p {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}

.metric-info .sub-text {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    min-height: 380px;
    display: flex;
    flex-direction: column;
}

.chart-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

/* Modern Table Styles */
.table-container {
    overflow: hidden;
}

.section-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
}

.custom-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.custom-table th {
    background-color: #f8f9fa;
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--secondary-text-color);
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr {
    transition: background-color 0.2s;
}

.custom-table tr:hover {
    background-color: rgba(232, 93, 4, 0.02);
}

.font-mono {
    font-family: 'DM Mono', monospace;
    color: var(--primary-color);
    font-weight: 600;
}

.date-time-cell {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.time-sub {
    font-size: 0.8rem;
    color: var(--secondary-text-color);
}

.items-preview {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.item-pill {
    background-color: #f1f3f5;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-color);
}

.status-pill {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-pill.pending {
    background: #fff3cd;
    color: #856404;
}

.status-pill.cooking {
    background: #cce5ff;
    color: #004085;
}

.status-pill.ready-for-delivery {
    background: #d4edda;
    color: #155724;
}

.status-pill.delivered {
    background: #d1e7dd;
    color: #0f5132;
}

.status-pill.refunded {
    background: #f8d7da;
    color: #721c24;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--primary-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.animate-fade-in-delayed {
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 1rem;
    color: var(--secondary-text-color);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(232, 93, 4, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .sales-analytics-page {
        padding: 1rem;
    }

    .filter-row {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .date-inputs-row {
        flex-direction: column;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Info Icon with Tooltip */
.info-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.info-icon {
    font-size: 1.25rem;
    color: var(--primary-color);
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.info-icon-wrapper:hover .info-icon {
    opacity: 1;
    transform: scale(1.1);
}

.info-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.5rem);
    transform: translateX(-50%);
    background-color: #2d3748;
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: normal;
    max-width: 320px;
    width: max-content;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 1000;
    text-align: left;
}

.info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2d3748;
}

.info-icon-wrapper:hover .info-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* Responsive tooltip positioning */
@media (max-width: 768px) {
    .info-tooltip {
        max-width: 250px;
        font-size: 0.8rem;
        padding: 0.6rem 0.85rem;
    }
}

/* =====================================================
   BRANCH MANAGEMENT STYLES
   ===================================================== */

/* Branch Selector Component */
.branch-selector {
    position: relative;
}

.branch-selector-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
}

.branch-selector-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.2rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.95rem;
}

.branch-selector-button:hover {
    background: var(--background-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.branch-selector-button .branch-icon {
    color: var(--primary-color);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.branch-info-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.branch-info-compact .branch-name {
    font-weight: 600;
    color: var(--text-color);
}

.branch-info-compact .branch-code {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    font-weight: 500;
}

.branch-selector-button .chevron {
    color: var(--secondary-text-color);
    font-size: 1rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.branch-selector-button .chevron.open {
    transform: rotate(180deg);
}

.branch-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    overflow: hidden;
}

.branch-dropdown-header {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--background-color);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.branch-dropdown-list {
    max-height: 320px;
    overflow-y: auto;
}

.branch-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.branch-option:last-child {
    border-bottom: none;
}

.branch-option:hover {
    background: var(--background-color);
}

.branch-option.active {
    background: rgba(232, 93, 4, 0.08);
}

.branch-option-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

.branch-option-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.branch-option-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.branch-option-code {
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    font-weight: 500;
}

.branch-option-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-badge {
    background: rgba(40, 167, 69, 0.12);
    color: #28a745;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.branch-option .current-check {
    color: var(--primary-color);
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* =====================================================
   TEAM SWITCHER STYLES
   ===================================================== */

/* Team Switcher Component - Blue theme to differentiate from Branch (Orange) */
.team-switcher {
    position: relative;
}

.team-switcher-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
}

.team-switcher-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.2rem;
    background: var(--surface-color);
    border: 1px solid #3b82f6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.95rem;
}

.team-switcher-button:hover {
    background: #eff6ff;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.team-switcher-button .team-icon {
    color: #3b82f6;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.team-info-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-info-compact .team-name {
    font-weight: 600;
    color: var(--text-color);
}

.team-info-compact .team-role {
    font-size: 0.85rem;
    color: #3b82f6;
    font-weight: 600;
}

.team-switcher-button .chevron {
    color: var(--secondary-text-color);
    font-size: 1rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.team-switcher-button .chevron.open {
    transform: rotate(180deg);
}

.team-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 320px;
    background: var(--surface-color);
    border: 1px solid #3b82f6;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
    z-index: 1000;
    overflow: hidden;
}

.team-dropdown-header {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #3b82f6;
    background: #eff6ff;
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.team-dropdown-list {
    max-height: 320px;
    overflow-y: auto;
}

.team-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.team-option:last-child {
    border-bottom: none;
}

.team-option:hover {
    background: #eff6ff;
}

.team-option.active {
    background: rgba(59, 130, 246, 0.12);
}

.team-option-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

.team-option-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.team-option-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.team-option-role {
    font-size: 0.8rem;
    color: #3b82f6;
    font-weight: 600;
}

.team-option-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.owner-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #1e40af;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.team-option .current-check {
    color: #3b82f6;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Team Switching Loading Overlay */
.team-switching-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.team-switching-content {
    background: white;
    padding: 3rem 4rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s ease;
    max-width: 400px;
}

.team-switching-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.5rem;
}

.team-switching-content h3 {
    font-size: 1.5rem;
    color: #1e293b;
    margin: 0 0 0.75rem 0;
    font-weight: 700;
}

.team-switching-content p {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Branch Switching Loading Overlay (reuses team switching styles) */
.branch-switching-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.branch-switching-content {
    background: white;
    padding: 3rem 4rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s ease;
    max-width: 400px;
}

.branch-switching-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
}

/* Orange fruit for branch switching */
.branch-switching-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff8c00, #ff6600);
    border-radius: 50%;
    box-shadow:
        inset -5px -5px 15px rgba(0, 0, 0, 0.2),
        inset 5px 5px 15px rgba(255, 255, 255, 0.3),
        0 0 25px rgba(255, 140, 0, 0.5);
    animation: orangeToLiquid 2s ease-in-out infinite;
}

/* Orange leaf for branch switching */
.branch-switching-spinner::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 15px;
    height: 10px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 50% 50% 0 0;
    animation: leafWiggle 2s ease-in-out infinite;
    z-index: 1;
}

.branch-switching-content h3 {
    font-size: 1.5rem;
    color: #1e293b;
    margin: 0 0 0.75rem 0;
    font-weight: 700;
}

.branch-switching-content p {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Branch Settings Page */

.branch-settings-page {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.branch-settings-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 2rem;
}

.branch-settings-page .page-header-content h1 {
    font-size: 2rem;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

.branch-settings-page .page-description {
    color: var(--secondary-text-color);
    font-size: 1rem;
    margin: 0;
}

.create-branch-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.create-branch-button:hover {
    background: var(--primary-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 93, 4, 0.25);
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
    background: var(--surface-color);
    border-radius: 16px;
    border: 2px dashed var(--border-color);
}

.empty-state .empty-icon {
    font-size: 4rem;
    color: var(--border-color);
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0;
}

.empty-state p {
    color: var(--secondary-text-color);
    margin: 0;
}

.branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.branch-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.branch-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.branch-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
}

.branch-card-icon {
    width: 48px;
    height: 48px;
    background: rgba(232, 93, 4, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.branch-card-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.branch-card-title h3 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin: 0;
    font-weight: 700;
}

.branch-card-title .branch-code {
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    font-weight: 600;
}

.branch-card-header .main-badge {
    position: absolute;
    top: 0;
    right: 0;
}

.branch-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.branch-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.branch-detail strong {
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.branch-detail span {
    font-size: 0.95rem;
    color: var(--text-color);
}

.access-badge {
    display: inline-block;
    background: rgba(232, 93, 4, 0.12);
    color: var(--primary-color);
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: capitalize;
}

.current-branch-indicator {
    padding: 0.75rem;
    background: rgba(232, 93, 4, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(232, 93, 4, 0.2);
}

.current-badge {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.current-badge::before {
    content: "✓";
    font-size: 1.1rem;
}

.branch-card-footer {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.edit-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-button:hover:not(:disabled) {
    background: var(--surface-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.edit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Branch Creation Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1.5rem;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface-color);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: min(540px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--background-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--secondary-text-color);
    font-size: 1.2rem;
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group .required {
    color: #dc3545;
    margin-left: 0.25rem;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--surface-color);
    color: var(--text-color);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.form-group input:disabled,
.form-group textarea:disabled {
    background: var(--background-color);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.cancel-button,
.submit-button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.cancel-button {
    background: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.cancel-button:hover:not(:disabled) {
    background: var(--border-color);
}

.submit-button {
    background: var(--primary-color);
    color: white;
}

.submit-button:hover:not(:disabled) {
    background: var(--primary-hover-color);
    box-shadow: 0 4px 12px rgba(232, 93, 4, 0.25);
}

.cancel-button:disabled,
.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .branch-settings-page {
        padding: 1rem;
    }

    .branch-settings-page .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .create-branch-button {
        width: 100%;
        justify-content: center;
    }

    .branches-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .branch-dropdown {
        min-width: 260px;
    }
}

/* Feature Action Button */
.feature-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
    width: 100%;
}

.feature-action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.feature-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}


/* ========================================
   PRINTER SETTINGS STYLES
   ======================================== */

.printer-settings-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.printer-hardware-section {
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.03), rgba(244, 140, 6, 0.02));
    border: 1px solid rgba(232, 93, 4, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
}

.printer-hardware-section h4 {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.restaurant-print-field {
    margin-bottom: 1.5rem;
}

.restaurant-print-field label {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.restaurant-print-field input[type="text"],
.restaurant-print-field input[type="number"],
.restaurant-print-field select,
.restaurant-print-field textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: var(--surface-color);
}

.restaurant-print-field input[type="text"]:focus,
.restaurant-print-field input[type="number"]:focus,
.restaurant-print-field select:focus,
.restaurant-print-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.restaurant-print-field input[type="number"] {
    max-width: 150px;
}

.restaurant-print-field textarea {
    resize: vertical;
    min-height: 100px;
}

.restaurant-print-field .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.restaurant-print-field .checkbox-label:hover {
    background-color: rgba(232, 93, 4, 0.05);
}

.restaurant-print-field .checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.restaurant-print-field .checkbox-label span {
    font-weight: 600;
    color: var(--text-color);
}

.field-hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--secondary-text-color);
    line-height: 1.4;
}

.printer-options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.printer-option-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--surface-color);
}

.printer-option-card:hover {
    border-color: var(--primary-color);
    background-color: rgba(232, 93, 4, 0.03);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.printer-option-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.08), rgba(244, 140, 6, 0.05));
    box-shadow: 0 4px 12px rgba(232, 93, 4, 0.15);
}

.printer-option-card input[type="radio"] {
    margin-top: 0.25rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.printer-option-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.printer-option-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-color);
}

.printer-option-description {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    line-height: 1.5;
}

.tax-field-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.tax-field-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tax-field-checkbox-label:hover {
    background-color: rgba(232, 93, 4, 0.05);
}

.tax-field-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.tax-field-checkbox-label span {
    font-weight: 500;
    color: var(--text-color);
}

.restaurant-print-settings-status {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.restaurant-print-settings-status.success {
    background: rgba(40, 167, 69, 0.12);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.35);
}

.restaurant-print-settings-status.error {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.35);
}

.printer-settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.secondary-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background-color: var(--surface-color);
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.secondary-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background-color: rgba(232, 93, 4, 0.05);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.secondary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Design for Printer Settings */
@media (max-width: 768px) {
    .printer-hardware-section {
        padding: 1rem;
    }

    .printer-option-card {
        padding: 1rem;
    }

    .printer-settings-actions {
        flex-direction: column;
    }

    .printer-settings-actions button {
        width: 100%;
    }

    .restaurant-print-field input[type="number"] {
        max-width: 100%;
    }
}/* Stock Allocation Modal */

.sam-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    backdrop-filter: blur(3px);
    animation: sam-fadeIn 0.2s ease;
}

@keyframes sam-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes sam-slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.sam-modal {
    background: white;
    border-radius: 16px;
    max-width: 780px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    animation: sam-slideUp 0.3s ease;
}

/* Header */
.sam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.04), rgba(245, 158, 11, 0.01));
}

.sam-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sam-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fef3c7;
    border-radius: 10px;
    color: #d97706;
    font-size: 1.1rem;
}

.sam-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.sam-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    margin: 2px 0 0 0;
}

.sam-order-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ede9fe;
    color: #6d28d9;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 3px 10px;
    border-radius: 6px;
    margin-left: 8px;
}

.sam-close-btn {
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.sam-close-btn:hover {
    color: #64748b;
    background: #f1f5f9;
}

/* Body */
.sam-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* Progress summary */
.sam-progress-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 20px;
}

.sam-progress-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
}

.sam-progress-text strong {
    color: #16a34a;
}

.sam-progress-track {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.sam-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Ingredient group card */
.sam-group {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: visible;
    transition: border-color 0.2s;
}

.sam-group:hover {
    border-color: #cbd5e1;
}

.sam-group.sam-group-done {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.sam-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0;
}

.sam-group-done .sam-group-header {
    background: #f0fdf4;
    border-bottom-color: #bbf7d0;
    border-radius: 12px 12px 0 0;
}

.sam-group-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sam-group-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sam-group-name svg {
    color: #d97706;
    width: 15px;
    height: 15px;
}

.sam-group-done .sam-group-name svg {
    color: #16a34a;
}

.sam-group-meta {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sam-group-menu-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.sam-group-qty-badge {
    font-weight: 700;
    color: #d97706;
    background: #fef3c7;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.82rem;
}

.sam-group-done .sam-group-qty-badge {
    color: #16a34a;
    background: #dcfce7;
}

.sam-group-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #16a34a;
}

/* Group body */
.sam-group-body {
    padding: 16px 18px;
    border-radius: 0 0 12px 12px;
}

/* Balance bar */
.sam-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 10px;
}

.sam-balance-need {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
}

.sam-balance-status {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.sam-balance-status.sam-status-partial {
    color: #d97706;
    background: #fef3c7;
}

.sam-balance-status.sam-status-full {
    color: #16a34a;
    background: #dcfce7;
}

.sam-balance-status.sam-status-over {
    color: #dc2626;
    background: #fee2e2;
}

.sam-balance-progress {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 14px;
}

.sam-balance-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.sam-balance-progress-fill.sam-fill-full {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.sam-balance-progress-fill.sam-fill-over {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Recommendations */
.sam-recommendations {
    margin-bottom: 12px;
}

.sam-rec-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.sam-rec-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sam-rec-btn {
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #7c3aed;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.sam-rec-btn:hover {
    background: #ede9fe;
    border-color: #c4b5fd;
}

/* Main ingredient badge — blue tint */
.sam-rec-btn--main {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
    font-weight: 600;
}

.sam-rec-btn--main:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

/* Alternative badge — green tint */
.sam-rec-btn--alt {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #065f46;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.sam-rec-btn--alt:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.sam-rec-main-tag,
.sam-rec-alt-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 999px;
}

.sam-rec-main-tag {
    background: #dbeafe;
    color: #1e40af;
}

.sam-rec-alt-tag {
    background: #d1fae5;
    color: #065f46;
}

/* Source rows */
.sam-sources {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sam-source {
    position: relative;
}

.sam-source-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sam-source-search-row .smart-ingredient-search {
    flex: 1;
}

.sam-source-remove {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.sam-source-remove:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* Filled source (selected stock) */
.sam-source-filled {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.sam-source-filled.sam-source-over {
    border-color: #fca5a5;
    background: #fef2f2;
}

.sam-source-stock-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sam-source-stock-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.88rem;
}

.sam-source-stock-avail {
    font-size: 0.75rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.sam-source-clear {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s;
}

.sam-source-clear:hover {
    color: #ef4444;
    background: #fee2e2;
}

.sam-source-qty-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sam-qty-input {
    width: 100px;
    padding: 8px 10px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: white;
}

.sam-qty-input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.sam-qty-input.sam-input-over {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.sam-unit-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

.sam-over-warn {
    font-size: 0.75rem;
    font-weight: 600;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Add source button */
.sam-add-source-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6d28d9;
    background: #f5f3ff;
    border: 1px dashed #c4b5fd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 8px;
}

.sam-add-source-btn:hover {
    background: #ede9fe;
    border-color: #a78bfa;
}

/* Confirm button per group */
.sam-confirm-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    margin-top: 14px;
    font-size: 0.88rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.2);
}

.sam-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.sam-confirm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sam-confirm-btn.sam-confirm-disabled {
    background: #94a3b8;
    box-shadow: none;
}

.sam-confirm-partial {
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.25);
    padding: 1px 7px;
    border-radius: 4px;
    margin-left: 4px;
}

/* Spinner */
.sam-btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: sam-spin 0.6s linear infinite;
}

@keyframes sam-spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.sam-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: #fafafa;
    border-radius: 0 0 16px 16px;
}

.sam-footer-status {
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sam-footer-status strong {
    color: #16a34a;
}

.sam-footer-actions {
    display: flex;
    gap: 10px;
}

.sam-cancel-btn {
    padding: 9px 20px;
    background: white;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sam-cancel-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* Loading state */
.sam-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    gap: 14px;
    color: #64748b;
    font-size: 0.9rem;
}

.sam-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e2e8f0;
    border-top-color: #d97706;
    border-radius: 50%;
    animation: sam-spin 0.6s linear infinite;
}

/* Empty state */
.sam-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 10px;
    color: #64748b;
}

.sam-empty-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dcfce7;
    border-radius: 50%;
    color: #16a34a;
    font-size: 1.3rem;
}

.sam-empty h3 {
    margin: 0;
    font-size: 1rem;
    color: #1e293b;
}

.sam-empty p {
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .sam-modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .sam-header {
        padding: 16px 18px;
    }

    .sam-body {
        padding: 16px 18px;
    }

    .sam-group-body {
        padding: 14px 14px;
    }

    .sam-source-qty-row {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .sam-overlay {
        padding: 10px;
    }

    .sam-modal {
        max-height: 100vh;
        border-radius: 10px;
    }

    .sam-source-filled {
        padding: 10px;
    }

    .sam-source-stock-info {
        flex-wrap: wrap;
    }
}
.aim-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.aim-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.aim-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f3f4f6;
  background: linear-gradient(135deg, #fff7ed, #fffbeb);
}

.aim-header-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f97316;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.aim-title {
  font-size: 15px;
  font-weight: 700;
  color: #92400e;
  margin: 0 0 3px;
}

.aim-subtitle {
  font-size: 12.5px;
  color: #6b7280;
  margin: 0;
}

.aim-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.aim-item {
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  overflow: hidden;
}

.aim-item-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 12px;
  background: #fafafa;
  border-bottom: 1px solid #f3f4f6;
}

.aim-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.aim-item-stock {
  font-size: 12px;
  color: #6b7280;
}

.aim-item-low {
  color: #dc2626;
}

.aim-item-note {
  font-size: 11.5px;
  color: #92400e;
  background: #fffbeb;
  border-bottom: 1px solid #fef3c7;
  padding: 6px 12px;
}

/* Badge grid for ingredient options */
.aim-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
}

.aim-badge {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 220px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aim-badge:hover {
  border-color: #a5b4fc;
  background: #f5f3ff;
}

.aim-badge--selected {
  border-color: #6366f1;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.aim-badge--ok {
  /* available stock — neutral border unless selected */
}

.aim-badge--low {
  /* insufficient stock — amber tint */
  background: #fffbeb;
  border-color: #fde68a;
}

.aim-badge--low:hover {
  border-color: #f59e0b;
  background: #fef3c7;
}

.aim-badge--selected.aim-badge--low {
  border-color: #f59e0b;
  background: #fef3c7;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

.aim-badge-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.aim-badge-name {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  flex: 1;
  line-height: 1.3;
}

.aim-badge-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.aim-badge-tag--main {
  background: #dbeafe;
  color: #1d4ed8;
}

.aim-badge-tag--alt {
  background: #d1fae5;
  color: #065f46;
}

.aim-badge-deduct {
  font-size: 11.5px;
  color: #4b5563;
}

.aim-badge-ratio {
  font-size: 10.5px;
  color: #9ca3af;
}

.aim-badge-avail {
  font-size: 11px;
  font-weight: 500;
}

.aim-badge-avail--ok {
  color: #059669;
}

.aim-badge-avail--low {
  color: #d97706;
}

.aim-no-option {
  font-size: 12px;
  color: #991b1b;
  background: #fef2f2;
  border-top: 1px solid #fee2e2;
  padding: 8px 12px;
}

.aim-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid #f3f4f6;
  background: #fafafa;
}

.aim-cancel-btn {
  padding: 8px 16px;
  font-size: 13px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.12s;
}

.aim-cancel-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.aim-confirm-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 7px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  transition: background 0.12s;
}

.aim-confirm-btn:hover {
  background: #1d4ed8;
}

.aim-confirm-btn:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}
/* =====================================================
   NAVBAR VISIBILITY - SMOOTH LAYOUT ADJUSTMENTS
   ===================================================== */

/* 
   Add these styles to your main CSS file (App.css or index.css)
   to ensure smooth transitions when navbar items are hidden/shown
*/

/* Main POS Header - Smooth rearrangement */
.app-header .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: gap 0.3s ease;
}

/* Smooth fade-in for header items */
.header-right>* {
    animation: fadeInItem 0.3s ease;
}

@keyframes fadeInItem {
    from {
        opacity: 0;
        transform: scale(0.95) translateX(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

/* User info section - flexible layout */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: gap 0.3s ease;
}

/* Ensure smooth transitions for all navbar elements */
.admin-nav-btn,
.ai-toggle,
.user-profile-card,
.logout-btn {
    transition: all 0.3s ease;
}

/* Admin Header Actions - Already updated in AdminHeader.css */
.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: gap 0.3s ease;
}

.admin-header-actions>* {
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Branch Selector - Smooth appearance */
.branch-selector-container {
    transition: all 0.3s ease;
}

/* Notification Container - Smooth appearance */
.notification-container {
    transition: all 0.3s ease;
}

/* Back to POS Button - Smooth appearance */
.back-to-pos-btn {
    transition: all 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-right {
        gap: 0.5rem;
    }

    .user-info {
        gap: 0.5rem;
    }

    .admin-header-actions {
        gap: 0.5rem;
    }
}

/* Ensure no layout shift when items disappear */
.app-header,
.admin-header {
    min-height: 60px;
}

/* Flexbox will automatically adjust spacing when items are hidden */
/* No need for complex JavaScript - CSS Flexbox handles it! */

/* =====================================================
   ADDITIONAL ENHANCEMENTS
   ===================================================== */

/* Smooth hover effects */
.admin-nav-btn:hover,
.notification-bell-btn:hover,
.back-to-pos-btn:hover {
    transform: translateY(-1px);
}

/* Prevent layout shift on hover */
.admin-nav-btn,
.notification-bell-btn,
.back-to-pos-btn {
    will-change: transform;
}

/* Loading state for navbar visibility (optional) */
.navbar-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Fade out animation when items are being removed */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Apply to items being removed (if needed) */
.navbar-item-removing {
    animation: fadeOut 0.2s ease forwards;
}.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.admin-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: gap 0.3s ease;
}

/* Smooth fade-in animation for navbar items */
.admin-header-actions>* {
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Notification Bell */
.notification-container {
    position: relative;
}

.notification-bell-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-bell-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    background: #ff4444;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Notifications Dropdown */
.notifications-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    animation: dropdownSlideIn 0.2s ease;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e0e0e0;
}

.notifications-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.unread-count {
    font-size: 0.85rem;
    color: #ff4444;
    font-weight: 600;
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.no-notifications {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #999;
    text-align: center;
}

.no-notifications p {
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-avatar {
    flex-shrink: 0;
}

.notification-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f48c06 0%, #e85d04 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-sender {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.notification-message {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.25rem;
}

.notification-time {
    font-size: 0.8rem;
    color: #999;
}

.notification-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background: #ff4444;
    border-radius: 50%;
    margin-top: 0.5rem;
}

.notifications-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e0e0e0;
}

.view-all-btn {
    width: 100%;
    padding: 0.625rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 93, 4, 0.3);
}

.back-to-pos-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-to-pos-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 93, 4, 0.3);
}

/* Scrollbar Styling */
.notifications-list::-webkit-scrollbar {
    width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
    background: transparent;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header {
        padding: 0.75rem 1rem;
    }

    .admin-header h1 {
        font-size: 1.25rem;
    }

    .notifications-dropdown {
        width: 320px;
        right: -1rem;
    }

    .admin-header-actions {
        gap: 0.5rem;
    }
}/* ─────────────────────────────────────────────────────────────────────────────
   Portion Manager Page — unified portion + recipe editor
   ───────────────────────────────────────────────────────────────────────────── */

/* Layout */
.pm-container {
  display: flex;
  height: calc(100vh - 120px);
  min-height: 500px;
  overflow: hidden;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

/* ── LEFT SIDEBAR ──────────────────────────────────────────────────────────── */

.pm-sidebar {
  width: 220px;
  min-width: 180px;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.pm-sidebar-top {
  padding: 14px 12px 10px;
  border-bottom: 1px solid #f3f4f6;
}

.pm-sidebar-title {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
}

.pm-search-wrap {
  position: relative;
}
.pm-search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}
.pm-search-input {
  width: 100%;
  padding: 6px 8px 6px 26px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
  color: #374151;
}
.pm-search-input:focus { border-color: #6366f1; }

.pm-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.pm-sidebar-loading,
.pm-sidebar-empty {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  padding: 16px 12px;
}

.pm-cat-group { margin-bottom: 4px; }

.pm-cat-label {
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 12px 3px;
}

.pm-menu-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 12px;
  font-size: 12.5px;
  color: #374151;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.12s;
  line-height: 1.35;
}
.pm-menu-btn:hover { background: #f3f4f6; }
.pm-menu-btn--active {
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 600;
}

/* ── MAIN AREA ─────────────────────────────────────────────────────────────── */

.pm-main {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.pm-loading-main {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  font-size: 13px;
  color: #9ca3af;
}

/* Placeholder */
.pm-placeholder {
  padding: 36px 40px;
  max-width: 640px;
}
.pm-placeholder-icon {
  font-size: 40px;
  margin-bottom: 14px;
}
.pm-placeholder h3 {
  font-size: 17px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px;
}
.pm-placeholder > p {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 24px;
  line-height: 1.6;
}

.pm-how-it-works {
  background: #f8faff;
  border: 1px solid #e0e7ff;
  border-radius: 10px;
  padding: 18px 20px;
}
.pm-how-it-works h4 {
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pm-how-steps { display: flex; flex-direction: column; gap: 14px; }
.pm-how-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.pm-how-num {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  margin-top: 1px;
}
.pm-how-step > div:not(.pm-how-num) { flex: 1; }
.pm-how-step strong { font-size: 13px; color: #1f2937; display: block; margin-bottom: 3px; }
.pm-how-step p { font-size: 12px; color: #6b7280; margin: 0 0 3px; line-height: 1.5; }
.pm-how-step em { font-size: 11.5px; color: #9ca3af; }

/* Item header */
.pm-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.pm-item-name { font-size: 16px; font-weight: 700; color: #1f2937; margin: 0 0 3px; }
.pm-item-subtitle { font-size: 12px; color: #9ca3af; margin: 0; }

/* Variation tabs */
.pm-var-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 20px 0;
  border-bottom: 2px solid #f3f4f6;
  background: #fff;
  flex-wrap: wrap;
}
.pm-var-tab {
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.15s;
}
.pm-var-tab:hover { color: #4f46e5; }
.pm-var-tab--active { color: #4f46e5; border-bottom-color: #4f46e5; font-weight: 600; }

/* ── Portion items section ─────────────────────────────────────────────────── */

.pm-portion-section {
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.pm-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.pm-section-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pm-section-title span:first-child {
  font-size: 13.5px;
  font-weight: 600;
  color: #1f2937;
}
.pm-section-hint {
  font-size: 11.5px !important;
  color: #9ca3af !important;
  font-weight: 400 !important;
}

.pm-empty-portion {
  text-align: center;
  padding: 24px;
  color: #9ca3af;
  font-size: 13px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px dashed #e5e7eb;
  line-height: 1.7;
}

/* Portion table */
.pm-portion-list {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: visible;
}

.pm-portion-hdr,
.pm-portion-row {
  display: grid;
  grid-template-columns: 2fr 90px 80px 150px 1fr 36px;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
}

.pm-portion-hdr {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #f3f4f6;
  background: #f9fafb;
  border-radius: 8px 8px 0 0;
}

.pm-portion-row {
  border-bottom: 1px solid #f9fafb;
  background: #fff;
}
.pm-portion-row:last-child { border-bottom: none; }
.pm-portion-row:hover { background: #fafafa; }

.pm-pi-name {
  width: 100%;
  padding: 5px 8px;
  font-size: 12.5px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  color: #1f2937;
  box-sizing: border-box;
}
.pm-pi-name:focus { border-color: #6366f1; }

.pm-pi-qty {
  width: 100%;
  padding: 5px 6px;
  font-size: 12.5px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  color: #1f2937;
  box-sizing: border-box;
  text-align: right;
}
.pm-pi-qty:focus { border-color: #6366f1; }

.pm-pi-sel {
  width: 100%;
  padding: 5px 6px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  color: #374151;
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
}
.pm-pi-sel:focus { border-color: #6366f1; }

.pm-pi-na {
  font-size: 11px;
  color: #d1d5db;
  font-style: italic;
}

/* Stock link cell */
.pm-pi-link-cell { position: relative; }

.pm-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  font-size: 11.5px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.pm-link-btn:hover { border-color: #6366f1; color: #4f46e5; }
.pm-link-btn--linked {
  border-color: #10b981;
  color: #059669;
  background: #f0fdf4;
}

/* Delete button */
.pm-del-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 5px;
  background: none;
  color: #d1d5db;
  cursor: pointer;
  transition: all 0.12s;
}
.pm-del-btn:hover { background: #fef2f2; color: #ef4444; }

/* Recipe toggle row */
.pm-recipe-toggle-row {
  grid-column: 1 / -1;
  padding: 2px 10px 6px 10px;
  background: #fff;
  border-bottom: 1px solid #f3f4f6;
}
.pm-recipe-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px dashed #d1d5db;
  background: #f9fafb;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.12s;
}
.pm-recipe-toggle:hover { background: #eef2ff; border-color: #6366f1; color: #4f46e5; }
.pm-recipe-toggle--open { background: #eef2ff; border-color: #6366f1; color: #4f46e5; border-style: solid; }
.pm-recipe-toggle--has-recipe {
  border-color: #10b981;
  color: #059669;
  background: #f0fdf4;
  border-style: solid;
}
.pm-recipe-toggle--open.pm-recipe-toggle--has-recipe {
  background: #ecfdf5;
  border-color: #059669;
}

/* ── Dropdown (shared) ─────────────────────────────────────────────────────── */

.pm-dropdown {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  min-width: 240px;
  max-width: 320px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 200;
  overflow: hidden;
}
.pm-dropdown-search {
  width: 100%;
  padding: 8px 12px;
  font-size: 12.5px;
  border: none;
  border-bottom: 1px solid #f3f4f6;
  outline: none;
  box-sizing: border-box;
  color: #374151;
}
.pm-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #374151;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
.pm-dropdown-item:hover { background: #f5f3ff; }
.pm-dropdown-empty { padding: 10px 12px; font-size: 12px; color: #9ca3af; }
.pm-dropdown-clear {
  display: block;
  width: 100%;
  padding: 7px 12px;
  font-size: 12px;
  color: #ef4444;
  background: none;
  border: none;
  border-top: 1px solid #fef2f2;
  cursor: pointer;
  text-align: left;
}
.pm-dropdown-clear:hover { background: #fef2f2; }

.pm-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  flex-shrink: 0;
}
.pm-badge--custom { background: #ede9fe; color: #6d28d9; }
.pm-badge--global { background: #dbeafe; color: #1d4ed8; }

/* ── Type dropdown (coloured by type) ─────────────────────────────────────── */

.pm-pi-type-sel {
  width: 100%;
  padding: 5px 6px;
  font-size: 12.5px;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: #374151;
  cursor: pointer;
  font-weight: 600;
  box-sizing: border-box;
}
.pm-pi-type-sel:focus { border-color: #6366f1; }
.pm-pi-type-sel--ingredient { border-color: #10b981; color: #065f46; background: #f0fdf4; }
.pm-pi-type-sel--recipe     { border-color: #6366f1; color: #3730a3; background: #eef2ff; }
.pm-pi-type-sel--commodity  { border-color: #d1d5db; color: #6b7280; background: #f9fafb; }

/* ── Status badges ─────────────────────────────────────────────────────────── */

.pm-pi-status { display: flex; align-items: center; min-width: 0; }

.pm-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.pm-status--linked   { background: #d1fae5; color: #065f46; }
.pm-status--auto     { background: #fef9c3; color: #92400e; }
.pm-status--recipe   { background: #ede9fe; color: #4c1d95; }
.pm-status--warn     { background: #fee2e2; color: #991b1b; }
.pm-status--commodity{ background: #f3f4f6; color: #6b7280; }

/* ── Save status message ─────────────────────────────────────────────────────*/

.pm-item-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pm-save-status {
  font-size: 12px;
  color: #059669;
  font-weight: 500;
  background: #d1fae5;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Auto-register notice ────────────────────────────────────────────────────*/

.pm-auto-register-notice {
  font-size: 12px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* ── Recipe ing link status ─────────────────────────────────────────────────*/

.pm-link-status--auto { color: #b45309; font-size: 11.5px; }

/* ── Add / Save buttons ──────────────────────────────────────────────────────*/

.pm-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: all 0.12s;
}
.pm-add-btn:hover { border-color: #6366f1; color: #4f46e5; background: #f5f3ff; }

.pm-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  border-radius: 7px;
  background: #4f46e5;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
}
.pm-save-btn:hover { background: #4338ca; }
.pm-save-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.pm-save-btn--ok { background: #10b981; }
.pm-save-btn--ok:hover { background: #059669; }

.pm-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #c4b5fd;
  border-radius: 6px;
  background: #ede9fe;
  color: #6d28d9;
  cursor: pointer;
  transition: all 0.12s;
}
.pm-ai-btn:hover:not(:disabled) { background: #ddd6fe; border-color: #8b5cf6; }
.pm-ai-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Recipe Editor ─────────────────────────────────────────────────────────── */

.pm-recipe-editor {
  margin: 0 20px 12px;
  background: #fff;
  border: 1.5px solid #c7d2fe;
  border-radius: 10px;
  overflow: hidden;
}

.pm-recipe-editor-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 18px 10px;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  border-bottom: 1px solid #e0e7ff;
}
.pm-recipe-title {
  font-size: 14px;
  font-weight: 700;
  color: #3730a3;
  margin: 0 0 4px;
}
.pm-recipe-title em { font-style: normal; color: #4f46e5; }
.pm-recipe-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}
.pm-recipe-close {
  background: none;
  border: none;
  font-size: 15px;
  color: #9ca3af;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
}
.pm-recipe-close:hover { color: #374151; }

/* Yield row */
.pm-yield-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid #f3f4f6;
  flex-wrap: wrap;
}
.pm-yield-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}
.pm-yield-hint {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
}
.pm-yield-input {
  width: 100px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid #c7d2fe;
  border-radius: 6px;
  outline: none;
  color: #1f2937;
  text-align: right;
}
.pm-yield-input:focus { border-color: #6366f1; }
.pm-yield-unit {
  padding: 5px 8px;
  font-size: 12.5px;
  border: 1.5px solid #c7d2fe;
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: #374151;
  cursor: pointer;
}
.pm-yield-unit:focus { border-color: #6366f1; }
.pm-yield-scale {
  font-size: 12px;
  color: #4f46e5;
  background: #eef2ff;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
}

/* Warning */
.pm-warn {
  margin: 0;
  padding: 10px 18px;
  font-size: 12.5px;
  color: #b45309;
  background: #fffbeb;
  border-bottom: 1px solid #fef3c7;
}

/* Raw ingredients */
.pm-recipe-ings { padding: 14px 18px; }
.pm-recipe-ings-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pm-recipe-ings-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
}
.pm-recipe-ings-title em { font-style: normal; color: #9ca3af; font-weight: 400; }

.pm-recipe-empty {
  text-align: center;
  padding: 20px;
  color: #9ca3af;
  font-size: 12.5px;
  background: #f9fafb;
  border-radius: 7px;
  border: 1px dashed #e5e7eb;
}

.pm-recipe-ing-list { border: 1px solid #e5e7eb; border-radius: 7px; overflow: visible; }

.pm-recipe-ing-hdr,
.pm-recipe-ing-row {
  display: grid;
  grid-template-columns: 2fr 130px 80px 1fr 36px;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
}
.pm-recipe-ing-hdr {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #f3f4f6;
  background: #f9fafb;
  border-radius: 7px 7px 0 0;
}
.pm-recipe-ing-row {
  border-bottom: 1px solid #f9fafb;
}
.pm-recipe-ing-row:last-child { border-bottom: none; }
.pm-recipe-ing-row:hover { background: #fafafa; }

.pm-recipe-ing-name-wrap { position: relative; }

.pm-recipe-ing-name {
  width: 100%;
  padding: 5px 8px;
  font-size: 12.5px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  color: #1f2937;
  box-sizing: border-box;
}
.pm-recipe-ing-name:focus { border-color: #6366f1; }
.pm-recipe-ing-name--linked {
  border-color: #10b981;
  background: #f0fdf4;
  color: #065f46;
}

.pm-recipe-ing-qty {
  width: 100%;
  padding: 5px 8px;
  font-size: 12.5px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  color: #1f2937;
  text-align: right;
  box-sizing: border-box;
}
.pm-recipe-ing-qty:focus { border-color: #6366f1; }

.pm-link-status { font-size: 11.5px; white-space: nowrap; }
.pm-link-status--linked { color: #059669; }
.pm-link-status--auto  { color: #b45309; font-size: 11px; }
.pm-link-status--none { color: #d1d5db; }
.pm-link-status--none em { font-style: italic; }

/* Stock status + alternatives toggle cell */
.pm-ing-status-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

/* Alt toggle button (inside status cell) */
.pm-alt-toggle-btn {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px dashed #d1d5db;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.pm-alt-toggle-btn:hover { background: #f3f4f6; border-color: #9ca3af; color: #374151; }
.pm-alt-toggle-btn--open { border-style: solid; background: #eff6ff; border-color: #6366f1; color: #4338ca; }
.pm-alt-toggle-btn--has  { border-color: #6366f1; color: #4338ca; background: #eff6ff; }

/* ── Alternatives panel ──────────────────────────────────────────────────── */

.pm-alt-panel {
  grid-column: 1 / -1;
  background: #faf5ff;
  border-top: 1px solid #e9d5ff;
  border-bottom: 1px solid #e9d5ff;
  padding: 10px 14px 12px;
}

.pm-alt-panel-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.pm-alt-panel-title {
  font-size: 12px;
  color: #4b5563;
}
.pm-alt-panel-title strong { color: #1f2937; }

.pm-alt-panel-note {
  font-size: 11px;
  color: #7c3aed;
  background: #f3e8ff;
  border-radius: 5px;
  padding: 5px 9px;
  margin-bottom: 8px;
  line-height: 1.5;
}
.pm-alt-panel-note em { font-style: normal; font-weight: 600; }

.pm-alt-empty {
  font-size: 12px;
  color: #9ca3af;
  padding: 6px 0;
  font-style: italic;
}

.pm-alt-row {
  display: grid;
  grid-template-columns: 1fr 80px 170px 32px;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid #f3e8ff;
}
.pm-alt-row:last-child { border-bottom: none; }

.pm-alt-name-wrap { position: relative; }

.pm-alt-name {
  width: 100%;
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  color: #1f2937;
  box-sizing: border-box;
  background: #fff;
}
.pm-alt-name:focus { border-color: #7c3aed; }
.pm-alt-name--linked { border-color: #7c3aed; background: #faf5ff; color: #4c1d95; }

.pm-alt-unit-sel { width: 100%; }

.pm-alt-ratio-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  padding: 3px 7px;
}
.pm-alt-ratio-lbl  { font-size: 11px; color: #6b7280; white-space: nowrap; }
.pm-alt-ratio-input {
  width: 54px;
  border: none;
  outline: none;
  font-size: 12px;
  font-weight: 600;
  color: #4c1d95;
  text-align: center;
  background: transparent;
}
.pm-alt-ratio-unit { font-size: 11px; color: #6b7280; white-space: nowrap; }

/* Recipe footer */
.pm-recipe-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid #f3f4f6;
  background: #fafafa;
}
.pm-unsaved {
  font-size: 11.5px;
  color: #f59e0b;
  font-style: italic;
}

/* ── Deduction Preview ─────────────────────────────────────────────────────── */

.pm-preview {
  margin: 16px 20px 20px;
  background: #fff;
  border: 1.5px solid #d1fae5;
  border-radius: 10px;
  overflow: hidden;
}

.pm-preview-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #064e3b;
  margin: 0;
  padding: 12px 16px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border-bottom: 1px solid #d1fae5;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.pm-preview-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
}
.pm-preview-subtitle em { font-style: normal; color: #374151; font-weight: 500; }

.pm-preview-component {
  padding: 10px 16px;
  border-bottom: 1px solid #f3f4f6;
}
.pm-preview-component:last-child { border-bottom: none; }
.pm-preview-component--direct { border-left: 3px solid #10b981; }
.pm-preview-component--recipe { border-left: 3px solid #6366f1; }
.pm-preview-component--purchased { border-left: 3px solid #f59e0b; }
.pm-preview-component--no_recipe { border-left: 3px solid #ef4444; background: #fff7f7; }
.pm-preview-component--commodity { border-left: 3px solid #d1d5db; background: #f9fafb; }
.pm-preview-component--loading { border-left: 3px solid #e5e7eb; }

.pm-preview-comp-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.pm-preview-comp-name { font-size: 13px; color: #1f2937; }
.pm-preview-comp-qty {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
}
.pm-preview-comp-method { font-size: 12px; color: #6b7280; margin-left: auto; }

.pm-preview-warn {
  font-size: 12px;
  color: #b45309;
  background: #fffbeb;
  padding: 5px 10px;
  border-radius: 5px;
  margin-bottom: 6px;
}

.pm-preview-lines { padding-left: 8px; }
.pm-preview-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 12.5px;
}
.pm-preview-arrow { color: #9ca3af; font-size: 11px; flex-shrink: 0; }
.pm-preview-ing { color: #374151; min-width: 120px; }
.pm-preview-calc { color: #6b7280; font-size: 12px; }
.pm-preview-calc strong { color: #1f2937; }

.pm-preview-action {
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
  font-style: italic;
}

/* ── Missing-recipe banner ───────────────────────────────────────────────────*/

.pm-missing-recipe-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 16px 12px;
  flex-shrink: 0;
}

.pm-missing-recipe-text {
  font-size: 13px;
  color: #92400e;
  line-height: 1.4;
}

.pm-missing-recipe-names {
  font-size: 11px;
  color: #b45309;
  margin-left: 6px;
}

.pm-register-missing-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.pm-register-missing-btn:hover:not(:disabled) { background: #d97706; }
.pm-register-missing-btn:disabled { opacity: 0.6; cursor: not-allowed; }
/* ─────────────────────────────────────────────────────────────────────────────
   Recipe Manager Page
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Layout ──────────────────────────────────────────────────────────────── */

.rm-container {
  display: flex;
  height: calc(100vh - 120px);
  min-height: 500px;
  overflow: hidden;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

/* ── LEFT SIDEBAR ─────────────────────────────────────────────────────────── */

.rm-sidebar {
  width: 220px;
  min-width: 180px;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.rm-sidebar-top {
  padding: 14px 12px 10px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rm-sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rm-sidebar-title {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.rm-sidebar-count {
  font-size: 11px;
  font-weight: 600;
  background: #e0e7ff;
  color: #4338ca;
  border-radius: 10px;
  padding: 1px 7px;
}

.rm-search-wrap {
  position: relative;
}

.rm-search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.rm-search-input {
  width: 100%;
  padding: 6px 8px 6px 26px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
  color: #374151;
}
.rm-search-input:focus { border-color: #6366f1; }

.rm-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.rm-sidebar-bottom {
  padding: 10px 12px;
  border-top: 1px solid #f3f4f6;
  background: #fff;
}

.rm-new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 10px;
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.rm-new-btn:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.rm-sidebar-loading,
.rm-sidebar-empty {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  padding: 16px 12px;
  white-space: pre-line;
  line-height: 1.6;
}

.rm-recipe-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
  gap: 2px;
}
.rm-recipe-btn:hover { background: #f3f4f6; }
.rm-recipe-btn--active { background: #eef2ff; }

.rm-recipe-btn-name {
  font-size: 12.5px;
  color: #374151;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.rm-recipe-btn--active .rm-recipe-btn-name { color: #4f46e5; font-weight: 600; }

.rm-recipe-btn-meta {
  font-size: 11px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 5px;
}

.rm-ing-count-badge {
  font-size: 10px;
  font-weight: 600;
  background: #e0e7ff;
  color: #4338ca;
  border-radius: 10px;
  padding: 1px 6px;
}

/* ── MAIN AREA ────────────────────────────────────────────────────────────── */

.rm-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ── Placeholder ─────────────────────────────────────────────────────────── */

.rm-placeholder {
  padding: 36px 40px;
  max-width: 620px;
}

.rm-placeholder-icon {
  font-size: 40px;
  margin-bottom: 14px;
}

.rm-placeholder h3 {
  font-size: 17px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px;
}

.rm-placeholder > p {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 24px;
  line-height: 1.6;
}

.rm-how-it-works {
  background: #f8faff;
  border: 1px solid #e0e7ff;
  border-radius: 10px;
  padding: 18px 20px;
}

.rm-how-it-works h4 {
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
  margin: 0 0 14px;
}

.rm-how-steps { display: flex; flex-direction: column; gap: 14px; }

.rm-how-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.rm-how-num {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  margin-top: 1px;
}

.rm-how-step > div:not(.rm-how-num) { flex: 1; }
.rm-how-step strong { font-size: 13px; color: #1f2937; display: block; margin-bottom: 3px; }
.rm-how-step p { font-size: 12px; color: #6b7280; margin: 0; line-height: 1.5; }

/* ── Recipe header ───────────────────────────────────────────────────────── */

.rm-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f3f4f6;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}

.rm-header-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.rm-recipe-name-input {
  font-size: 17px;
  font-weight: 700;
  color: #1f2937;
  border: none;
  border-bottom: 2px solid #e5e7eb;
  outline: none;
  padding: 2px 0 4px;
  background: transparent;
  width: 100%;
  max-width: 380px;
  transition: border-color 0.15s;
}
.rm-recipe-name-input:focus { border-bottom-color: #6366f1; }
.rm-recipe-name-input::placeholder { color: #d1d5db; font-weight: 400; font-size: 15px; }

.rm-yield-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.rm-yield-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

.rm-yield-input {
  width: 80px;
  padding: 4px 7px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid #c7d2fe;
  border-radius: 6px;
  outline: none;
  color: #1f2937;
  text-align: right;
}
.rm-yield-input:focus { border-color: #6366f1; }

.rm-yield-unit {
  padding: 4px 7px;
  font-size: 12.5px;
  border: 1.5px solid #c7d2fe;
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: #374151;
  cursor: pointer;
}
.rm-yield-unit:focus { border-color: #6366f1; }

.rm-yield-hint {
  font-size: 11px;
  color: #6366f1;
  font-style: italic;
  margin-top: 3px;
  display: block;
}

.rm-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 4px;
}

.rm-save-msg {
  font-size: 12px;
  color: #059669;
  font-weight: 500;
  background: #d1fae5;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.rm-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #c4b5fd;
  border-radius: 7px;
  background: #ede9fe;
  color: #6d28d9;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.rm-ai-btn:hover:not(:disabled) { background: #ddd6fe; border-color: #8b5cf6; }
.rm-ai-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.rm-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  border-radius: 7px;
  background: #4f46e5;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.rm-save-btn:hover:not(:disabled) { background: #4338ca; }
.rm-save-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Instructions ────────────────────────────────────────────────────────── */

.rm-instructions-wrap {
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid #f3f4f6;
}

.rm-instructions {
  width: 100%;
  padding: 8px 10px;
  font-size: 12.5px;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.5;
  background: #fafafa;
}
.rm-instructions:focus { border-color: #6366f1; background: #fff; }

/* ── Ingredients section ─────────────────────────────────────────────────── */

.rm-ings-section {
  padding: 14px 20px 20px;
  background: #fff;
  flex: 1;
}

.rm-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.rm-section-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1f2937;
}

.rm-section-hint {
  font-size: 12px;
  color: #9ca3af;
}

.rm-loading,
.rm-empty {
  text-align: center;
  padding: 28px 20px;
  font-size: 13px;
  color: #9ca3af;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px dashed #e5e7eb;
  line-height: 1.7;
}

.rm-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.rm-add-btn:hover { border-color: #6366f1; color: #4f46e5; background: #f5f3ff; }

/* ── Ingredient table ────────────────────────────────────────────────────── */

.rm-ing-list {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: visible;
}

.rm-ing-hdr,
.rm-ing-row {
  display: grid;
  grid-template-columns: 22px 1fr 80px 80px 90px 100px 44px 30px;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
}

.rm-ing-hdr {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #f3f4f6;
  background: #f9fafb;
  border-radius: 8px 8px 0 0;
}

.rm-ing-row {
  border-bottom: 1px solid #f9fafb;
  background: #fff;
}
.rm-ing-row:last-child { border-bottom: none; }
.rm-ing-row:hover { background: #fafafa; }

.rm-ing-num {
  font-size: 11px;
  color: #d1d5db;
  text-align: center;
  font-weight: 500;
}

/* Name + dropdown */
.rm-ing-name-wrap { position: relative; }

.rm-ing-name {
  width: 100%;
  padding: 5px 8px;
  font-size: 12.5px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  color: #1f2937;
  box-sizing: border-box;
  transition: border-color 0.12s;
}
.rm-ing-name:focus { border-color: #6366f1; }
.rm-ing-name--linked { border-color: #10b981; background: #f0fdf4; color: #065f46; }

.rm-dropdown {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  min-width: 240px;
  max-width: 320px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 200;
  overflow: hidden;
}

.rm-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #374151;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 8px;
}
.rm-dropdown-item:hover { background: #f5f3ff; }

.rm-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  flex-shrink: 0;
}
.rm-badge--custom { background: #ede9fe; color: #6d28d9; }
.rm-badge--global { background: #dbeafe; color: #1d4ed8; }

/* Qty */
.rm-ing-qty {
  width: 100%;
  padding: 5px 6px;
  font-size: 12.5px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  color: #1f2937;
  text-align: right;
  box-sizing: border-box;
}
.rm-ing-qty:focus { border-color: #6366f1; }

/* Unit */
.rm-ing-unit {
  width: 100%;
  padding: 5px 4px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  color: #374151;
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
}
.rm-ing-unit:focus { border-color: #6366f1; }

/* Per serving column */
.rm-per-serving-col {
  font-size: 11px;
  color: #6366f1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rm-ing-hdr .rm-per-serving-col {
  color: #9ca3af;
  font-weight: 600;
  font-size: 11px;
}
.rm-per-serving-val {
  font-size: 11.5px;
  color: #4f46e5;
  background: #eef2ff;
  border-radius: 4px;
  padding: 2px 6px;
  text-align: center;
}

/* Stock link status */
.rm-link-status {
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rm-link-status--linked { color: #059669; }
.rm-link-status--none { color: #d1d5db; }
.rm-link-status--none em { font-style: italic; }

/* Delete */
.rm-del-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 5px;
  background: none;
  color: #d1d5db;
  cursor: pointer;
  transition: all 0.12s;
}
.rm-del-btn:hover { background: #fef2f2; color: #ef4444; }

/* ── Alts toggle button ───────────────────────────────────────────────────── */

.rm-alts-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
  border: 1.5px solid #e5e7eb;
  border-radius: 5px;
  background: #fff;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.rm-alts-btn:hover:not(:disabled) { border-color: #a78bfa; color: #7c3aed; background: #f5f3ff; }
.rm-alts-btn--has  { border-color: #a78bfa; color: #6d28d9; background: #ede9fe; }
.rm-alts-btn--open { border-color: #7c3aed; background: #ede9fe; color: #5b21b6; }
.rm-alts-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Alternatives panel ───────────────────────────────────────────────────── */

.rm-alt-panel {
  grid-column: 1 / -1;
  background: #f8f5ff;
  border-top: 1px solid #ede9fe;
  border-bottom: 1px solid #ede9fe;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rm-alt-panel-hdr {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rm-alt-panel-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #5b21b6;
}

.rm-alt-panel-hint {
  font-size: 11.5px;
  color: #7c3aed;
  opacity: 0.75;
  line-height: 1.5;
}

.rm-alt-empty {
  font-size: 12px;
  color: #9ca3af;
  margin: 0;
  font-style: italic;
}

.rm-alt-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #e9d5ff;
  border-radius: 7px;
  overflow: visible;
  background: #fff;
}

.rm-alt-hdr {
  display: grid;
  grid-template-columns: 1fr 80px 1fr 28px;
  gap: 6px;
  padding: 5px 10px;
  font-size: 10.5px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #faf5ff;
  border-radius: 7px 7px 0 0;
  border-bottom: 1px solid #e9d5ff;
}

.rm-alt-hdr em { font-style: normal; font-weight: 400; }

.rm-alt-row {
  display: grid;
  grid-template-columns: 1fr 80px 1fr 28px;
  gap: 6px;
  padding: 6px 10px;
  align-items: center;
  border-bottom: 1px solid #f3e8ff;
}
.rm-alt-row:last-child { border-bottom: none; }

.rm-alt-name-wrap { position: relative; }

.rm-alt-name-input {
  width: 100%;
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  box-sizing: border-box;
  color: #1f2937;
  transition: border-color 0.12s;
}
.rm-alt-name-input:focus { border-color: #8b5cf6; }
.rm-alt-name--linked { border-color: #10b981; background: #f0fdf4; color: #065f46; }

.rm-alt-dropdown { min-width: 220px; }

.rm-alt-unit-select {
  width: 100%;
  padding: 5px 4px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  background: #fff;
  color: #374151;
  box-sizing: border-box;
}
.rm-alt-unit-select:focus { border-color: #8b5cf6; }

.rm-alt-ratio-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rm-alt-ratio-input {
  width: 80px;
  padding: 5px 6px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  text-align: right;
  box-sizing: border-box;
}
.rm-alt-ratio-input:focus { border-color: #8b5cf6; }

.rm-alt-ratio-eg {
  font-size: 10px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rm-alt-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1.5px dashed #c4b5fd;
  border-radius: 6px;
  background: #faf5ff;
  color: #7c3aed;
  cursor: pointer;
  transition: all 0.12s;
  align-self: flex-start;
}
.rm-alt-add-btn:hover { background: #ede9fe; border-color: #8b5cf6; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 700px) {
  .rm-sidebar { width: 170px; min-width: 140px; }

  .rm-ing-hdr,
  .rm-ing-row {
    grid-template-columns: 18px 1fr 64px 68px 80px 80px 36px 26px;
    gap: 4px;
    padding: 5px 8px;
  }

  .rm-alt-hdr,
  .rm-alt-row {
    grid-template-columns: 1fr 68px 1fr 26px;
    gap: 4px;
    padding: 5px 8px;
  }
}
/* ─────────────────────────────────────────────────────────────────────────────
   DishCompositionManager — 3-panel layout
   Layer 1: Menu item list (left)
   Layer 2: Dish Composition (centre)
   Layer 3: Recipe panel (right, slides in)
───────────────────────────────────────────────────────────────────────────── */

/* ── Root ───────────────────────────────────────────────────────────────────── */

.dcm-root {
  display: flex;
  height: calc(100vh - 172px);
  min-height: 460px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

/* ── Layer 1: Menu list ─────────────────────────────────────────────────────── */

.dcm-menu-list {
  width: 220px;
  min-width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e7eb;
  background: #f8fafc;
}

.dcm-menu-list-top {
  padding: 12px 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.dcm-list-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin: 0 0 8px;
}

.dcm-search-wrap {
  position: relative;
}

.dcm-search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.dcm-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 8px 5px 26px;
  font-size: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #111;
  outline: none;
}

.dcm-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.dcm-menu-items {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.dcm-menu-item-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 7px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
  gap: 1px;
}

.dcm-menu-item-btn:hover {
  background: #eff6ff;
}

.dcm-menu-item-btn--active {
  background: #dbeafe;
  border-right: 2px solid #3b82f6;
}

.dcm-mi-name {
  font-size: 12.5px;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.dcm-mi-cat {
  font-size: 10.5px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.dcm-menu-item-btn--active .dcm-mi-name {
  color: #1d4ed8;
}

/* ── Layer 2: Dish Composition ──────────────────────────────────────────────── */

.dcm-composition {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Placeholder (no item selected) */
.dcm-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  padding: 40px 24px;
  text-align: center;
  gap: 8px;
}

.dcm-ph-icon {
  font-size: 48px;
  margin-bottom: 4px;
}

.dcm-placeholder h3 {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 4px;
}

.dcm-placeholder p {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 16px;
}

.dcm-how {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 18px;
}

.dcm-how-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #374151;
}

.dcm-how-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #3b82f6;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Composition header */
.dcm-comp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  gap: 10px;
  flex-wrap: wrap;
}

.dcm-comp-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 1px;
}

.dcm-comp-subtitle {
  font-size: 11px;
  color: #6b7280;
}

.dcm-comp-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dcm-save-msg {
  font-size: 12px;
  color: #16a34a;
  font-weight: 500;
}

/* ── Commodities toggle ──────────────────────────────────────────────────── */

.dcm-commodity-wrap {
  position: relative;
}

.dcm-commodity-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: #f1f5f9;
  color: #64748b;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.dcm-commodity-btn:hover {
  background: #e2e8f0;
  color: #475569;
}

.dcm-commodity-btn--on {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fb923c;
}

.dcm-commodity-btn--on:hover {
  background: #ffedd5;
}

.dcm-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #7c3aed;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.dcm-ai-btn:hover:not(:disabled) {
  background: #6d28d9;
}

.dcm-ai-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dcm-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.dcm-save-btn:hover:not(:disabled) {
  background: #1d4ed8;
}

.dcm-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Variation tabs */
.dcm-var-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  overflow-x: auto;
}

.dcm-var-tab {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}

.dcm-var-tab:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.dcm-var-tab--active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

/* Copy & Scale bar */
.dcm-copy-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.dcm-copy-label,
.dcm-copy-at {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}
.dcm-copy-select {
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  color: #374151;
  cursor: pointer;
}
.dcm-copy-btn {
  font-size: 12px;
  padding: 3px 10px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.dcm-copy-btn:hover { background: #1d4ed8; }

/* Variation usage preview inside recipe panel */
.dcm-rp-var-preview {
  margin: 8px 0 4px;
  padding: 8px 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
}
.dcm-rp-var-preview-title {
  font-size: 11px;
  font-weight: 600;
  color: #166534;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dcm-rp-var-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.dcm-rp-var-table th {
  text-align: left;
  padding: 3px 8px;
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
  white-space: nowrap;
}
.dcm-rp-var-table td {
  padding: 3px 8px;
  border-bottom: 1px solid #d1fae5;
  color: #374151;
  white-space: nowrap;
}
.dcm-rp-var-table tr:last-child td { border-bottom: none; }

/* Loading */
.dcm-loading {
  padding: 20px 16px;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}

/* Composition table */
.dcm-comp-table {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 16px;
}

/* Table header */
.dcm-comp-hdr {
  display: grid;
  grid-template-columns: 28px 1fr 106px 64px 90px 120px 30px;
  gap: 6px;
  padding: 4px 14px 6px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  border-bottom: 1px solid #f3f4f6;
}

/* Composition rows */
.dcm-comp-row {
  display: grid;
  grid-template-columns: 28px 1fr 106px 64px 90px 120px 30px;
  gap: 6px;
  padding: 5px 14px;
  align-items: center;
  border-bottom: 1px solid #f9fafb;
}

.dcm-comp-row:hover {
  background: #fafafa;
}

.dcm-row-num {
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
}

/* Name input + dropdown */
.dcm-name-wrap {
  position: relative;
}

.dcm-name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 8px;
  font-size: 12.5px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  background: #fff;
  color: #111;
}

.dcm-name-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

/* Shared dropdown */
.dcm-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 100;
  max-height: 180px;
  overflow-y: auto;
}

.dcm-drop-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 10px;
  font-size: 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  text-align: left;
  color: #111;
}

.dcm-drop-item:last-child {
  border-bottom: none;
}

.dcm-drop-item:hover {
  background: #eff6ff;
}

.dcm-drop-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 6px;
  background: #f3f4f6;
  border-radius: 10px;
  color: #6b7280;
  white-space: nowrap;
}

/* Type toggle */
.dcm-type-wrap {
  display: flex;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  overflow: hidden;
}

.dcm-type-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 5px;
  font-size: 10.5px;
  font-weight: 600;
  background: #fff;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.dcm-type-btn + .dcm-type-btn {
  border-left: 1px solid #e5e7eb;
}

.dcm-type-btn--active {
  background: #eff6ff;
  color: #2563eb;
}

.dcm-type-btn:nth-child(2).dcm-type-btn--active {
  background: #fffbeb;
  color: #d97706;
}

/* Qty / Unit */
.dcm-qty-input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 6px;
  font-size: 12.5px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  text-align: right;
}

.dcm-qty-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.dcm-unit-select {
  width: 100%;
  padding: 5px 4px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  background: #fff;
  outline: none;
  color: #374151;
}

.dcm-unit-select:focus {
  border-color: #3b82f6;
}

/* Recipe "Existing" badge variant */
.dcm-drop-badge--recipe {
  background: #fef3c7;
  color: #92400e;
}

/* Recipe link button */
.dcm-recipe-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #d97706;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
}

.dcm-recipe-link-btn:hover {
  background: #fef3c7;
}

/* Linked recipe button — already has a DB record */
.dcm-recipe-link-btn--linked {
  color: #059669;
  background: #f0fdf4;
  border-color: #86efac;
}

.dcm-recipe-link-btn--linked:hover {
  background: #dcfce7;
}

/* Delete button (shared) */
.dcm-del-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  cursor: pointer;
  color: #9ca3af;
  transition: color 0.12s, border-color 0.12s;
}

.dcm-del-btn:hover {
  color: #ef4444;
  border-color: #fca5a5;
  background: #fff5f5;
}

/* Add row button (shared) */
.dcm-add-row-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  margin: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px dashed #93c5fd;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}

.dcm-add-row-btn:hover {
  background: #dbeafe;
}

/* Empty hint */
.dcm-empty-hint {
  font-size: 12.5px;
  color: #9ca3af;
  margin: 0;
}

/* ── Layer 3: Recipe panel ───────────────────────────────────────────────────── */

.dcm-recipe-panel {
  width: 0;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e5e7eb;
  background: #fff;
  transition: width 0.22s ease;
}

.dcm-root--panel-open .dcm-recipe-panel {
  width: 390px;
  min-width: 340px;
  overflow-y: auto;
}

/* Recipe panel header */
.dcm-rp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  background: #fffbeb;
  gap: 8px;
}

.dcm-rp-title {
  font-size: 14px;
  font-weight: 700;
  color: #92400e;
  margin: 0 0 2px;
}

.dcm-rp-subtitle {
  font-size: 11px;
  color: #b45309;
  margin: 0;
}

.dcm-rp-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 2px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 4px;
}

.dcm-rp-close:hover {
  color: #374151;
  background: #f3f4f6;
}

/* Yield section */
.dcm-rp-yield {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
  background: #fffbeb;
}

.dcm-rp-yield-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dcm-rp-yield-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

.dcm-rp-yield-qty {
  width: 64px;
  padding: 5px 6px;
  font-size: 12.5px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  text-align: right;
  outline: none;
  background: #fff;
}

.dcm-rp-yield-qty:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

.dcm-rp-yield-unit {
  padding: 5px 6px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  background: #fff;
  outline: none;
  min-width: 56px;
}

.dcm-rp-yield-unit:focus {
  border-color: #f59e0b;
}

.dcm-rp-yield-for {
  font-size: 11.5px;
  color: #9ca3af;
  white-space: nowrap;
  padding: 0 2px;
}

.dcm-rp-yield-serves {
  width: 52px;
  padding: 5px 6px;
  font-size: 12.5px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  text-align: center;
  outline: none;
  background: #fff;
}

.dcm-rp-yield-serves:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

.dcm-rp-yield-serves-label {
  font-size: 11.5px;
  color: #6b7280;
  white-space: nowrap;
}

/* Fixed unit label next to per-plate input (shows "g", "ml", or "piece") */
.dcm-rp-yield-unit-fixed {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 4px 8px;
  white-space: nowrap;
  min-width: 32px;
  text-align: center;
}

/* "= 4 servings" green badge */
.dcm-rp-yield-servings-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #059669;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  border-radius: 10px;
  padding: 3px 8px;
  white-space: nowrap;
}

.dcm-rp-per-serving {
  font-size: 11px;
  color: #d97706;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 4px 8px;
  line-height: 1.4;
}

.dcm-rp-per-serving strong {
  font-weight: 700;
}

/* Ingredients section */
.dcm-rp-ings {
  display: flex;
  flex-direction: column;
  padding: 0 0 6px;
}

.dcm-rp-ings-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.dcm-rp-ings-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dcm-rp-ings-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dcm-rp-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  background: #7c3aed;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s;
}

.dcm-rp-ai-btn:hover:not(:disabled) {
  background: #6d28d9;
}

.dcm-rp-ai-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dcm-rp-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s;
}

.dcm-rp-save-btn:hover:not(:disabled) {
  background: #15803d;
}

.dcm-rp-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Save All button — saves composition + recipe in one click */
.dcm-save-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  background: #7c3aed;
  color: #fff;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
}
.dcm-save-all-btn:hover:not(:disabled) { background: #6d28d9; }
.dcm-save-all-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.dcm-save-all-btn--sm {
  padding: 5px 9px;
  font-size: 11.5px;
  border-radius: 6px;
}

/* Ingredient list header */
.dcm-rp-ing-hdr {
  display: grid;
  grid-template-columns: 1fr 56px 68px 70px 30px 26px;
  gap: 4px;
  padding: 4px 14px 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  border-bottom: 1px solid #f3f4f6;
}

/* Ingredient rows */
.dcm-rp-ing-row {
  display: grid;
  grid-template-columns: 1fr 56px 68px 70px 30px 26px;
  gap: 4px;
  padding: 4px 14px;
  align-items: center;
  border-bottom: 1px solid #f9fafb;
}

.dcm-rp-per1 {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dcm-rp-ing-row:hover {
  background: #fafafa;
}

.dcm-rp-ing-name {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  background: #fff;
}

.dcm-rp-ing-name:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.12);
}

.dcm-rp-ing-name--linked {
  border-color: #86efac;
  background: #f0fdf4;
}

.dcm-rp-ing-qty {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  text-align: right;
  outline: none;
}

.dcm-rp-ing-qty:focus {
  border-color: #f59e0b;
}

.dcm-rp-ing-unit {
  width: 100%;
  padding: 4px 4px;
  font-size: 11px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  background: #fff;
  outline: none;
  color: #374151;
}

.dcm-rp-ing-unit:focus {
  border-color: #f59e0b;
}

/* Instructions textarea */
.dcm-rp-instructions {
  margin: 8px 14px 4px;
  padding: 8px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  resize: vertical;
  outline: none;
  color: #374151;
  background: #fafafa;
}

.dcm-rp-instructions:focus {
  border-color: #f59e0b;
  background: #fff;
}

/* ── ⚡ Alts toggle button ────────────────────────────────────────────────────── */

.dcm-rp-alts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  font-size: 11px;
  font-weight: 700;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  cursor: pointer;
  color: #9ca3af;
  transition: all 0.12s;
  white-space: nowrap;
}

.dcm-rp-alts-btn:hover:not(:disabled) {
  background: #fef9c3;
  border-color: #fde68a;
  color: #92400e;
}

.dcm-rp-alts-btn--has {
  background: #fffbeb;
  border-color: #fde68a;
  color: #d97706;
}

.dcm-rp-alts-btn--open {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.dcm-rp-alts-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Alternative ingredient panel ──────────────────────────────────────────── */

.dcm-alt-panel {
  background: #fffdf0;
  border-left: 3px solid #f59e0b;
  border-bottom: 1px solid #fde68a;
  padding: 8px 14px 10px 16px;
  margin: 0;
}

.dcm-alt-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}

.dcm-alt-hdr-title {
  font-size: 12px;
  color: #374151;
  margin: 0 0 2px;
}

.dcm-alt-hdr-sub {
  font-size: 10.5px;
  color: #9ca3af;
  margin: 0;
}

/* Column header for alt rows */
.dcm-alt-col-hdr {
  display: grid;
  grid-template-columns: 1fr 72px 64px 26px;
  gap: 5px;
  padding: 3px 0 4px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b45309;
  border-bottom: 1px solid #fde68a;
  margin-bottom: 3px;
}

.dcm-alt-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  background: #fff;
  border: 1px solid #f59e0b;
  border-radius: 5px;
  color: #d97706;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.dcm-alt-add-btn:hover {
  background: #fef3c7;
}

.dcm-alt-empty {
  font-size: 11.5px;
  color: #9ca3af;
  margin: 0;
  padding: 4px 0 2px;
}

/* Alt row — name | qty-needed | unit | "for X unit" | del */
.dcm-alt-row {
  display: grid;
  grid-template-columns: 1fr 72px 64px auto 26px;
  gap: 5px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #fef3c7;
}

.dcm-alt-row:last-child {
  border-bottom: none;
}

.dcm-alt-name-col {
  /* the name search wrapper inside the grid */
}

.dcm-alt-name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 7px;
  font-size: 11.5px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  outline: none;
  background: #fff;
}

.dcm-alt-name-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.12);
}

/* Concrete qty input (how much of the alt to use for this batch) */
.dcm-alt-qty-input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  text-align: right;
  outline: none;
  background: #fff;
}

.dcm-alt-qty-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.12);
}

.dcm-alt-unit {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 3px;
  font-size: 11px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  background: #fff;
  outline: none;
  color: #374151;
}

.dcm-alt-unit:focus {
  border-color: #f59e0b;
}

/* "for X unit" contextual label */
.dcm-alt-for-label {
  font-size: 10.5px;
  color: #b45309;
  white-space: nowrap;
  font-style: italic;
}

/* Empty ingredients card */
.dcm-rp-empty-card {
  margin: 14px 14px 4px;
  padding: 14px 16px;
  background: #fffbeb;
  border: 1px dashed #fbbf24;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dcm-rp-empty-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #92400e;
  margin: 0;
}

.dcm-rp-empty-body {
  font-size: 12px;
  color: #78350f;
  margin: 0;
  line-height: 1.55;
}

.dcm-rp-empty-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.dcm-rp-empty-close-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  background: #fff;
  color: #d97706;
  border: 1.5px solid #f59e0b;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}

.dcm-rp-empty-close-btn:hover {
  background: #fef3c7;
}

.dcm-rp-empty-or {
  font-size: 11px;
  color: #9ca3af;
}

.dcm-rp-empty-ai-hint {
  font-size: 11.5px;
  color: #78350f;
}

/* No-result hint dropdown */
.dcm-dropdown--hint {
  padding: 10px 12px;
  pointer-events: none;
}

.dcm-drop-noresult {
  font-size: 12px;
  color: #374151;
  margin: 0 0 4px;
}

.dcm-drop-noresult-sub {
  font-size: 11.5px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

/* ── Scrollbar styling ────────────────────────────────────────────────────────── */

.dcm-menu-items::-webkit-scrollbar,
.dcm-comp-table::-webkit-scrollbar,
.dcm-rp-ings::-webkit-scrollbar,
.dcm-recipe-panel::-webkit-scrollbar {
  width: 4px;
}

.dcm-menu-items::-webkit-scrollbar-track,
.dcm-comp-table::-webkit-scrollbar-track,
.dcm-rp-ings::-webkit-scrollbar-track,
.dcm-recipe-panel::-webkit-scrollbar-track {
  background: transparent;
}

.dcm-menu-items::-webkit-scrollbar-thumb,
.dcm-comp-table::-webkit-scrollbar-thumb,
.dcm-rp-ings::-webkit-scrollbar-thumb,
.dcm-recipe-panel::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 2px;
}

/* ── Save-confirmation modal ──────────────────────────────────────────────── */

.dcm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.dcm-modal {
  background: #fff;
  border-radius: 14px;
  padding: 2rem 2rem 1.75rem;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.dcm-modal-icon {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.dcm-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.75rem;
}

.dcm-modal-body {
  font-size: 0.92rem;
  color: #4b5563;
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.dcm-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dcm-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
}

.dcm-modal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dcm-modal-btn--primary {
  background: #2563eb;
  color: #fff;
}

.dcm-modal-btn--primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.dcm-modal-btn--secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.dcm-modal-btn--secondary:hover {
  background: #e5e7eb;
}

.dcm-modal-btn--ghost {
  background: transparent;
  color: #9ca3af;
  font-weight: 400;
  font-size: 0.85rem;
}

.dcm-modal-btn--ghost:hover {
  color: #6b7280;
}
.pexels-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.pexels-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pexels-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.pexels-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pexels-subtitle {
    margin: 4px 0 0 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.pexels-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pexels-close-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.pexels-search-form {
    padding: 20px 28px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
}

.pexels-search-input-wrapper {
    flex: 1;
    position: relative;
}

.pexels-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.1rem;
}

.pexels-search-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.pexels-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pexels-search-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pexels-search-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.pexels-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pexels-error-message {
    padding: 16px 28px;
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    margin: 0 28px;
    border-radius: 8px;
}

.pexels-error-message p {
    margin: 0;
    color: #991b1b;
    font-size: 0.9rem;
}

.pexels-images-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    min-height: 400px;
}

.pexels-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6b7280;
}

.pexels-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.pexels-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.pexels-image-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
    aspect-ratio: 4/3;
}

.pexels-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.pexels-image-card:hover img {
    transform: scale(1.05);
}

.pexels-image-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.pexels-image-card.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.pexels-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.pexels-image-card:hover .pexels-image-overlay {
    opacity: 1;
}

.pexels-photographer {
    margin: 0;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
}

.pexels-selected-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #3b82f6;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pexels-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #9ca3af;
    text-align: center;
}

.pexels-empty-state p {
    margin: 12px 0 0 0;
    font-size: 1rem;
}

.pexels-hint {
    font-size: 0.875rem !important;
    color: #d1d5db !important;
}

.pexels-modal-footer {
    padding: 20px 28px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.pexels-cancel-btn,
.pexels-select-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.pexels-cancel-btn {
    background: #f3f4f6;
    color: #374151;
}

.pexels-cancel-btn:hover {
    background: #e5e7eb;
}

.pexels-select-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.pexels-select-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.pexels-attribution {
    padding: 12px 28px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.pexels-attribution p {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
}

.pexels-attribution a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
}

.pexels-attribution a:hover {
    text-decoration: underline;
}

/* Scrollbar styling */
.pexels-images-container::-webkit-scrollbar {
    width: 8px;
}

.pexels-images-container::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.pexels-images-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.pexels-images-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Responsive */
@media (max-width: 768px) {
    .pexels-modal-content {
        max-height: 95vh;
    }

    .pexels-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .pexels-search-form {
        flex-direction: column;
    }

    .pexels-search-btn {
        width: 100%;
    }
}/* Copy Order Number Button Styles */
.payment-confirm-section {
  margin: 20px 0;
}

.payment-confirm-section label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #333;
}

.order-number-with-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}

.copy-order-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  margin-left: 4px;
}

.copy-order-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.copy-order-btn:active {
  transform: translateY(0);
}

.copy-order-btn.copied {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  box-shadow: 0 2px 8px rgba(56, 239, 125, 0.3);
}

.copy-order-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.copy-order-btn span {
  font-size: 13px;
  font-weight: 600;
}

/* Animation for copied state */
@keyframes checkmark {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.copy-order-btn.copied svg {
  animation: checkmark 0.3s ease;
}

/* Payment edit order info styles */
.payment-edit-order-info {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 2px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.payment-edit-order-info p {
  margin: 0;
  font-size: 15px;
  color: #495057;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-edit-order-info strong {
  color: #212529;
  font-weight: 700;
  font-size: 16px;
}

.payment-edit-order-info .order-number-with-copy {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-left: 8px;
}

.order-id-value {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: 700;
  color: #e8852a;
  letter-spacing: 0.5px;
  background: white;
  padding: 6px 12px;
  border-radius: 6px;
  border: 2px solid #e8852a;
  display: inline-block;
}

/* Edit payment button in orders list */
.rol-edit-payment-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.rol-edit-payment-btn:hover {
  background: linear-gradient(135deg, #5568d3 0%, #654391 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.rol-edit-payment-btn:active {
  transform: translateY(0);
}

.rol-payment {
  font-weight: 500;
  color: #495057;
  font-size: 0.85rem;
  white-space: nowrap;
  text-align: center;
}

/* Verification Modal Actions */
.verification-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
}

.verification-cancel-btn {
  padding: 12px 28px;
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
  min-width: 120px;
}

.verification-cancel-btn:hover {
  background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.verification-cancel-btn:active {
  transform: translateY(0);
}

.verification-confirm-btn {
  padding: 12px 28px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
  min-width: 160px;
}

.verification-confirm-btn:hover {
  background: linear-gradient(135deg, #218838 0%, #1da088 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.verification-confirm-btn:active {
  transform: translateY(0);
}

.verification-confirm-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
/* ================================================
   SALES ANALYTICS PAGE - EXPORT BUTTONS
   ================================================ */

/* Export buttons group container */
.export-buttons-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Modern export button base styles */
.export-btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Primary export button (Export Details) */
.export-btn-modern:not(.secondary) {
    background: linear-gradient(135deg, #f48c06 0%, #e85d04 100%);
    color: white;
}

.export-btn-modern:not(.secondary):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 93, 4, 0.4);
}

/* Secondary export button (Export Summary) */
.export-btn-modern.secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.export-btn-modern.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
}

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

.export-btn-modern svg {
    font-size: 1.1rem;
}

/* Page header layout for sales analytics */
.sales-analytics-page .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.sales-analytics-page .back-btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #f3f4f6;
    border: none;
    border-radius: 10px;
    color: #374151;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sales-analytics-page .back-btn-modern:hover {
    background: #e5e7eb;
    transform: translateX(-4px);
}

.sales-analytics-page .header-title {
    flex: 1;
}

.sales-analytics-page .header-title h1 {
    margin: 0;
    font-size: 1.75rem;
    color: #111827;
}

.sales-analytics-page .header-subtitle {
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
    color: #6b7280;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .sales-analytics-page .page-header {
        flex-wrap: wrap;
    }

    .export-buttons-group {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
    }
}

@media (max-width: 768px) {
    .sales-analytics-page .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .sales-analytics-page .back-btn-modern {
        align-self: flex-start;
    }

    .export-buttons-group {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .export-btn-modern {
        width: 100%;
        justify-content: center;
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .sales-analytics-page .page-header {
        padding: 1rem;
    }

    .sales-analytics-page .header-title h1 {
        font-size: 1.5rem;
    }

    .export-btn-modern {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .export-btn-modern svg {
        font-size: 1rem;
    }
}/* Sales Comparison Report - Robust Styles */

.profit-loss-page {
    padding: 32px;
    background-color: #f8fafc;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background-color: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.back-btn:hover {
    background-color: #f1f5f9;
}

/* Filters */
.filters-section {
    background-color: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 32px;
    display: flex;
    gap: 24px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.date-presets {
    display: flex;
    gap: 8px;
    background-color: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
}

.preset-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.preset-btn.active {
    background-color: white;
    color: #4f46e5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.date-inputs {
    display: flex;
    gap: 16px;
}

.input-field input {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

/* --- Comparison Card Layout (Replacing Tailwind) --- */
.report-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.comparison-card {
    background-color: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.comparison-grid {
    display: grid;
    grid-template-columns: 25% 25% 30% 20%;
    /* Fixed Proportions */
    width: 100%;
}

@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }
}

.metric-col {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid #f1f5f9;
}

.metric-col:last-child {
    border-right: none;
}

/* Col 1: Title */
.metric-col.col-title {
    background-color: #f8fafc;
    flex-direction: row;
    /* Icon + Text */
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
}

.metric-icon-box {
    padding: 12px;
    background-color: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
}

.metric-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

/* Table Typography */
.trigger-table td.font-medium {
    font-weight: 600;
    color: #1e293b;
    text-transform: capitalize;
}

/* Col 2 & 3 & 4: Data Columns */
.metric-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 8px;
    display: block;
    /* Ensure block display to prevent inline merging */
}

.metric-date {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #334155;
    display: block;
}

/* Current Period Highlight */
.metric-col.col-current {
    background-color: #eff6ff;
    /* Indigo-50 ish */
    border-left: 2px solid #6366f1;
    /* Indigo-500 indicator */
}

.metric-col.col-current .metric-label {
    color: #6366f1;
}

.metric-col.col-current .metric-value {
    color: #1e1b4b;
    /* Indigo-950 */
    font-size: 28px;
    /* Slightly larger */
}

/* Change Column */
.metric-col.col-change {
    align-items: center;
    text-align: center;
}

.change-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
}

.text-green {
    color: #059669;
}

.bg-green {
    background-color: #d1fae5;
}

.text-red {
    color: #e11d48;
}

.bg-red {
    background-color: #ffe4e6;
}

.text-gray {
    color: #64748b;
}

.bg-gray {
    background-color: #f1f5f9;
}

.change-value {
    font-size: 13px;
    font-weight: 600;
}

/* Detailed Table Styles */
.detail-card {
    background-color: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-top: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.table-header-box {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.table-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Detailed Ingredient Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
}

/* Column Widths */
.comparison-table th:nth-child(1) {
    width: 40%;
}

.comparison-table th:nth-child(2) {
    width: 20%;
}

.comparison-table th:nth-child(3) {
    width: 20%;
}

.comparison-table th:nth-child(4) {
    width: 20%;
}

/* Header Formatting */
.comparison-table thead th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px 24px;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
    vertical-align: middle;
}

.comparison-table thead th.right {
    text-align: right;
}

/* Row & Cell Formatting */
.comparison-table tbody tr {
    background-color: white;
    transition: background-color 0.15s ease;
}

.comparison-table tbody tr:hover {
    background-color: #f8fafc;
}

.comparison-table tbody tr:not(:last-child) td {
    border-bottom: 1px solid #f1f5f9;
}

.comparison-table td {
    padding: 16px 24px;
    color: #334155;
    font-size: 14px;
    vertical-align: middle;
    text-align: left;
}

.comparison-table td.right {
    text-align: right;
}

.comparison-table td.font-medium {
    font-weight: 600;
    color: #1e293b;
    text-transform: capitalize;
}

/* Difference Colors */
.diff-positive {
    color: #059669;
    font-weight: 700;
}

.diff-negative {
    color: #e11d48;
    font-weight: 700;
}

.diff-neutral {
    color: #cbd5e1;
}

/* Unit Badge */
.unit-badge {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
}

/* Toggle Switch */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-checkbox {
    position: relative;
    width: 48px;
    height: 24px;
    appearance: none;
    background-color: #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-checkbox:checked {
    background-color: #4f46e5;
}

.toggle-checkbox::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-checkbox:checked::before {
    transform: translateX(24px);
}

.toggle-text {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-wastage {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.status-normal {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.status-not-tracked {
    background-color: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* Center alignment for table cells */
.comparison-table td.center,
.comparison-table th.center {
    text-align: center;
}

/* AI Report Modal */
.report-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.report-modal {
    background-color: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.report-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid #e2e8f0;
}

.report-modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
}

.close-modal-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #64748b;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal-btn:hover {
    color: #0f172a;
}

.report-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    line-height: 1.8;
}

.report-modal-footer {
    padding: 20px 32px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.close-btn {
    padding: 10px 24px;
    background-color: #f1f5f9;
    border: none;
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: #e2e8f0;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 64px 32px;
    color: #64748b;
    font-size: 16px;
    font-weight: 500;
}/* Profit & Loss Report Specific Styles */
.gradient-loss {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.text-success {
  color: #10b981 !important;
}

.text-danger {
  color: #ef4444 !important;
}

.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  color: #92400e;
  transition: all 0.2s ease;
}

.warning-banner.clickable:hover {
  background-color: #fde68a;
  border-color: #d97706;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.warning-banner svg {
  flex-shrink: 0;
  margin-top: 0.2rem;
  font-size: 1.2rem;
  color: #f59e0b;
}

.warning-banner strong {
  color: #78350f;
}

.error-banner {
  background-color: #fee2e2;
  border: 1px solid #ef4444;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  color: #991b1b;
  text-align: center;
  font-weight: 600;
}

/* Recipe status indicators */
.status-pill.delivered {
  background-color: #d1fae5;
  color: #065f46;
}

.status-pill.refunded {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #111827;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-description {
  margin: 0 0 1.5rem 0;
  color: #6b7280;
  font-size: 0.95rem;
  line-height: 1.6;
}

.missing-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.missing-item-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  transition: all 0.2s;
}

.missing-item-card:hover {
  background-color: #fef3c7;
  border-color: #fbbf24;
  transform: translateX(4px);
}

.missing-item-name {
  font-weight: 600;
  color: #92400e;
  font-size: 1rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.btn-primary,
.btn-secondary {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background-color: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
  background-color: #f3f4f6;
  color: #374151;
}

.btn-secondary:hover {
  background-color: #e5e7eb;
}

/* Responsive */
@media (max-width: 640px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .modal-header h2 {
    font-size: 1.25rem;
  }

  .modal-footer {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
}/* Inventory Report Page Styles */

.inventory-report-page {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.report-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.report-type-toggle {
    display: flex;
    background: #f0f0f0;
    padding: 0.35rem;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.toggle-btn {
    padding: 0.6rem 1.25rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: white;
    color: #eb5939;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.export-actions {
    display: flex;
    gap: 0.75rem;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    color: white;
}

.export-btn.excel {
    background: linear-gradient(135deg, #1d6f42 0%, #185c37 100%);
    box-shadow: 0 4px 8px rgba(24, 92, 55, 0.2);
}

.export-btn.excel:hover:not(:disabled) {
    background: linear-gradient(135deg, #185c37 0%, #144b2d 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(24, 92, 55, 0.3);
}

.export-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #ccc;
    box-shadow: none;
}

.header-content h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.header-icon {
    color: #eb5939;
}

.header-description {
    color: #666;
    font-size: 1rem;
}

/* Duplicate Warning Banner */
.duplicate-warning-banner {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.warning-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.warning-icon {
    font-size: 2rem;
    color: #f57c00;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.warning-text h3 {
    margin: 0 0 0.5rem 0;
    color: #e65100;
    font-size: 1.25rem;
}

.warning-text p {
    margin: 0;
    color: #5d4037;
    line-height: 1.6;
}

.normalize-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #eb5939 0%, #d84315 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(235, 89, 57, 0.3);
}

.normalize-btn:hover {
    background: linear-gradient(135deg, #d84315 0%, #bf360c 100%);
    box-shadow: 0 6px 12px rgba(235, 89, 57, 0.4);
    transform: translateY(-2px);
}

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


/* Filter Section */
.filter-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.date-filter-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #eb5939;
    color: #eb5939;
}

.filter-btn.active {
    background: #eb5939;
    color: white;
    border-color: #eb5939;
}

.custom-date-range {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-input-group label {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.date-input-group input[type="date"] {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card-icon.ingredient {
    background: #e3f2fd;
    color: #1976d2;
}

.card-icon.commodity {
    background: #fff3e0;
    color: #f57c00;
}

.card-icon.cost {
    background: #fce4ec;
    color: #c2185b;
}

.card-content h3 {
    font-size: 1.75rem;
    margin: 0;
    color: #1a1a1a;
}

.card-content p {
    margin: 0.25rem 0 0 0;
    color: #666;
    font-size: 0.9rem;
}

/* Search and Filter */
.search-filter-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: #eb5939;
}

.category-filter {
    display: flex;
    gap: 0.5rem;
}

.category-btn {
    padding: 0.75rem 1.25rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.category-btn:hover {
    border-color: #eb5939;
    color: #eb5939;
}

.category-btn.active {
    background: #eb5939;
    color: white;
    border-color: #eb5939;
}

/* Table */
.consumption-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

.consumption-table thead {
    background: #f5f5f5;
}

.consumption-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.consumption-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.consumption-table tbody tr:hover {
    background: #fafafa;
}

.usage-count {
    color: #666;
    font-size: 0.85rem;
    background: #f5f5f5;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
}

.consumption-table td {
    padding: 1rem;
    color: #333;
}

.ingredient-name {
    font-weight: 500;
    color: #1a1a1a;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.category-badge.ingredient {
    background: #e3f2fd;
    color: #1976d2;
}

.category-badge.commodity {
    background: #fff3e0;
    color: #f57c00;
}

.quantity-cell {
    font-family: 'Courier New', monospace;
}

.cost-cell {
    font-weight: 600;
    color: #c2185b;
}

.used-in-cell {
    max-width: 300px;
}

.usage-details summary {
    cursor: pointer;
    color: #eb5939;
    font-weight: 500;
    user-select: none;
}

.usage-details summary:hover {
    text-decoration: underline;
}

.usage-list {
    list-style: none;
    padding: 0.75rem 0 0 0;
    margin: 0;
}

.usage-list li {
    padding: 0.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.usage-list li:last-child {
    border-bottom: none;
}

.usage-stats {
    color: #666;
    font-size: 0.9rem;
}

/* Unit Selector */
.unit-selector {
    padding: 0.5rem 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

.unit-selector:hover {
    border-color: #eb5939;
}

.unit-selector:focus {
    outline: none;
    border-color: #eb5939;
    box-shadow: 0 0 0 3px rgba(235, 89, 57, 0.1);
}

.unit-selector optgroup {
    font-weight: bold;
    font-style: normal;
    color: #eb5939;
    background: #fff3e0;
    padding: 0.5rem 0;
}

.unit-selector option {
    padding: 0.5rem;
    font-weight: normal;
    color: #333;
    background: white;
}

/* Loading and Empty States */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #eb5939;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.loading-state p {
    color: #666;
    font-size: 1.1rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-icon {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #666;
    margin-bottom: 0.5rem;
}

.empty-state .help-text {
    color: #999;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .inventory-report-page {
        padding: 1rem;
    }

    .header-content h1 {
        font-size: 1.5rem;
    }

    .duplicate-warning-banner {
        padding: 1rem;
    }

    .warning-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .warning-icon {
        font-size: 1.5rem;
    }

    .warning-text h3 {
        font-size: 1.1rem;
    }

    .warning-text p {
        font-size: 0.9rem;
    }

    .normalize-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .search-filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        width: 100%;
    }

    .category-filter {
        width: 100%;
        justify-content: stretch;
    }

    .category-btn {
        flex: 1;
    }

    .consumption-table-container {
        overflow-x: auto;
    }

    .consumption-table {
        min-width: 800px;
    }

    .custom-date-range {
        flex-direction: column;
    }
}

/* Generate Report Button */
.generate-report-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
    white-space: nowrap;
}

.generate-report-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.4);
    transform: translateY(-2px);
}

.generate-report-btn:active:not(:disabled) {
    transform: translateY(0);
}

.generate-report-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.generate-report-btn svg {
    font-size: 1.25rem;
}

/* AI Report Modal */
.report-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.report-modal {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.report-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.report-modal-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.5rem;
    color: #1a1a1a;
}

.report-modal-header h2 svg {
    color: #4CAF50;
    font-size: 1.75rem;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.report-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.ai-report-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.report-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 2px solid #f0f0f0;
}

.download-report-btn,
.download-pdf-btn,
.close-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.download-pdf-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.download-pdf-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.4);
    transform: translateY(-2px);
}

.download-report-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
}

.download-report-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.4);
    transform: translateY(-2px);
}

.close-btn {
    background: #f5f5f5;
    color: #333;
}

.close-btn:hover {
    background: #e0e0e0;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .report-modal {
        max-height: 95vh;
        margin: 0.5rem;
    }

    .report-modal-header {
        padding: 1rem 1.5rem;
    }

    .report-modal-header h2 {
        font-size: 1.25rem;
    }

    .report-modal-content {
        padding: 1.5rem;
    }

    .ai-report-text {
        font-size: 0.9rem;
    }

    .report-modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }

    .download-report-btn,
    .close-btn {
        width: 100%;
    }

    .generate-report-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Charts Section */
.charts-section {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.charts-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.chart-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #4CAF50;
}

.chart-container {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container canvas {
    max-height: 100%;
    max-width: 100%;
}

/* Responsive Charts */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 280px;
    }
}

@media (max-width: 768px) {
    .charts-section {
        padding: 1.5rem;
    }

    .charts-title {
        font-size: 1.5rem;
    }

    .chart-card {
        padding: 1rem;
    }

    .chart-title {
        font-size: 1rem;
    }

    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .chart-container {
        height: 220px;
    }
}/* Simplified Stock Management Integration Styles */

/* Excess Usage Row - Red Background */
.status-excess_usage {
    background-color: #fee2e2 !important;
}

.status-excess_usage:hover {
    background-color: #fecaca !important;
}

/* Normal Stock Row */
.status-normal {
    background-color: #ffffff !important;
}

/* Not Tracked Row */
.status-not_tracked {
    background-color: #f9fafb !important;
}

/* Stock Columns */
.stock-column {
    font-weight: 600;
    text-align: center;
    padding: 0.75rem;
}

.stock-column.excess {
    color: #dc2626;
    position: relative;
    cursor: help;
}

.stock-column.normal {
    color: #059669;
}

.stock-column.not-tracked {
    color: #9ca3af;
    font-style: italic;
}

/* Tooltip for Excess Usage */
.stock-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    margin-bottom: 0.5rem;
}

.stock-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.stock-column.excess:hover .stock-tooltip {
    opacity: 1;
}

/* Table Headers for Stock Columns */
.stock-header {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    font-weight: 700;
    padding: 1rem;
    text-align: center;
}

/* Excess Usage Badge */
.excess-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background-color: #fecaca;
    color: #991b1b;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid #f87171;
}

/* Stock Value Display */
.stock-value {
    font-size: 1rem;
    font-weight: 600;
}

.stock-value.positive {
    color: #059669;
}

.stock-value.zero {
    color: #dc2626;
}

.stock-value.dash {
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stock-column {
        font-size: 0.875rem;
        padding: 0.5rem;
    }

    .stock-tooltip {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }

    .excess-badge {
        font-size: 0.75rem;
        padding: 0.125rem 0.5rem;
    }
}

/* Print Styles */
@media print {
    .status-excess_usage {
        background-color: #fee2e2 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .stock-tooltip {
        display: none;
    }
}/* Production Report Page Styles */

.production-report-page {
    padding: 32px;
    background-color: #f8fafc;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Header ── */
.pr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.pr-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pr-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background-color: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.pr-back-btn:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}

.pr-title-block h1 {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 2px 0;
    line-height: 1.2;
}

.pr-title-block .pr-branch-name {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.pr-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pr-export-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background-color: #e85d04;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pr-export-btn:hover {
    background-color: #c94f03;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 93, 4, 0.3);
}

.pr-export-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Filters ── */
.pr-filters {
    background-color: white;
    padding: 20px 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.pr-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pr-filter-group label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pr-date-presets {
    display: flex;
    gap: 6px;
    background-color: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
}

.pr-preset-btn {
    padding: 7px 14px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.pr-preset-btn.active {
    background-color: white;
    color: #e85d04;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.pr-date-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pr-date-inputs input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
    background: white;
    outline: none;
    transition: border-color 0.15s;
}

.pr-date-inputs input[type="date"]:focus {
    border-color: #e85d04;
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

.pr-date-sep {
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
}

.pr-generate-btn {
    padding: 9px 22px;
    background-color: #0f172a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pr-generate-btn:hover {
    background-color: #1e293b;
    transform: translateY(-1px);
}

.pr-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── Summary Cards ── */
.pr-summary-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.pr-summary-card {
    flex: 1;
    min-width: 160px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    transition: box-shadow 0.2s;
}

.pr-summary-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.pr-summary-card .pr-card-value {
    font-size: 32px;
    font-weight: 800;
    color: #e85d04;
    line-height: 1;
    margin-bottom: 6px;
}

.pr-summary-card .pr-card-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pr-summary-card .pr-card-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* ── Tabs ── */
.pr-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    width: fit-content;
}

.pr-tab {
    padding: 9px 22px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
}

.pr-tab.active {
    background: white;
    color: #e85d04;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* ── Search Bar ── */
.pr-search-bar {
    margin-bottom: 16px;
}

.pr-search-bar input {
    width: 100%;
    max-width: 340px;
    padding: 9px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
    outline: none;
    background: white;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.pr-search-bar input:focus {
    border-color: #e85d04;
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.1);
}

/* ── Table ── */
.pr-table-container {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.pr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pr-table thead th {
    padding: 14px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.pr-table thead th.right {
    text-align: right;
}

.pr-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.pr-table tbody td.right {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pr-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Dish Rows (accordion) ── */
.pr-dish-row {
    cursor: pointer;
    transition: background-color 0.15s;
}

.pr-dish-row:hover {
    background-color: #f8fafc;
}

.pr-dish-row.expanded {
    background-color: #fff7f0;
}

.pr-dish-row td:first-child {
    font-weight: 600;
    color: #0f172a;
}

.pr-expand-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    color: #94a3b8;
    transition: transform 0.2s;
    font-size: 12px;
    vertical-align: middle;
}

.pr-dish-row.expanded .pr-expand-icon {
    transform: rotate(90deg);
    color: #e85d04;
}

.pr-qty-sold-badge {
    display: inline-block;
    padding: 2px 10px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

/* ── Ingredient Expansion Rows ── */
.pr-ingredient-header-row td {
    background: #f1f5f9;
    padding: 8px 16px 8px 36px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.pr-ingredient-row td {
    background: #fafafa;
    padding: 10px 16px 10px 36px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    font-size: 13px;
}

.pr-ingredient-row:last-child td {
    border-bottom: 1px solid #e2e8f0;
}

.pr-ingredient-row .ing-name {
    font-weight: 500;
    color: #334155;
}

.pr-ingredient-row .ing-qty {
    font-variant-numeric: tabular-nums;
    color: #0f172a;
    font-weight: 600;
}

.pr-ingredient-row .ing-unit {
    color: #64748b;
    font-size: 12px;
}

/* ── Badges ── */
.pr-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pr-badge.no-recipe {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.pr-badge.has-recipe {
    background-color: #d1fae5;
    color: #065f46;
}

/* ── Dishes without recipes section ── */
.pr-no-recipe-section {
    margin-top: 24px;
    background: white;
    border: 1px solid #fde68a;
    border-radius: 12px;
    overflow: hidden;
}

.pr-no-recipe-section-header {
    padding: 14px 20px;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    font-size: 14px;
    font-weight: 700;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pr-no-recipe-list {
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pr-no-recipe-chip {
    padding: 5px 14px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #78350f;
}

/* ── Empty / Loading States ── */
.pr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 32px;
    gap: 16px;
    color: #64748b;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.pr-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #e85d04;
    border-radius: 50%;
    animation: pr-spin 0.8s linear infinite;
}

@keyframes pr-spin {
    to { transform: rotate(360deg); }
}

.pr-loading p {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: #475569;
}

.pr-no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 32px;
    gap: 12px;
    color: #94a3b8;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
}

.pr-no-data svg {
    opacity: 0.4;
}

.pr-no-data h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #475569;
}

.pr-no-data p {
    margin: 0;
    font-size: 14px;
    color: #94a3b8;
}

.pr-initial-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 32px;
    gap: 14px;
    background: white;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    text-align: center;
}

.pr-initial-state svg {
    opacity: 0.3;
    color: #e85d04;
}

.pr-initial-state h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #475569;
}

.pr-initial-state p {
    margin: 0;
    font-size: 14px;
    color: #94a3b8;
    max-width: 300px;
}

/* ── Used-in chips ── */
.pr-dish-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.pr-dish-chip {
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 12px;
    font-size: 11px;
    color: #475569;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Dish Card (composition view) ── */
.pr-dish-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pr-dish-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.pr-dish-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.pr-dish-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s;
    gap: 12px;
}

.pr-dish-header:hover {
    background-color: #f8fafc;
}

.pr-dish-header.expanded {
    background-color: #fff7f0;
    border-bottom: 1px solid #fed7aa;
}

.pr-dish-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.pr-expand-chevron {
    display: flex;
    align-items: center;
    color: #94a3b8;
    flex-shrink: 0;
    transition: color 0.15s;
}

.pr-dish-header.expanded .pr-expand-chevron {
    color: #e85d04;
}

.pr-dish-name {
    font-weight: 700;
    font-size: 15px;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pr-composition-badge {
    flex-shrink: 0;
    padding: 2px 9px;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pr-qty-sold-badge {
    flex-shrink: 0;
    display: inline-block;
    padding: 4px 12px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

/* ── Dish body (expanded) ── */
.pr-dish-body {
    padding: 12px 18px 16px;
    background: #fafafa;
}

.pr-no-portions-msg {
    font-size: 13px;
    color: #94a3b8;
    font-style: italic;
    padding: 8px 0;
    margin: 0;
}

/* ── Portions list ── */
.pr-portions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pr-portion-row {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.pr-portion-row.pr-portion-recipe {
    border-color: #bfdbfe;
}

.pr-portion-row.pr-portion-stock {
    border-color: #bbf7d0;
}

.pr-portion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    gap: 12px;
    flex-wrap: wrap;
}

.pr-portion-header.clickable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s;
}

.pr-portion-header.clickable:hover {
    background-color: #f8fafc;
}

.pr-portion-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.pr-expand-chevron-sm {
    display: flex;
    align-items: center;
    color: #94a3b8;
    flex-shrink: 0;
}

.pr-portion-type-badge {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pr-type-recipe {
    background: #eff6ff;
    color: #1d4ed8;
}

.pr-type-stock {
    background: #f0fdf4;
    color: #15803d;
}

.pr-portion-name {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pr-portion-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    font-size: 13px;
}

.pr-portion-qty {
    color: #475569;
    font-variant-numeric: tabular-nums;
}

.pr-portion-per {
    font-size: 11px;
    color: #94a3b8;
}

.pr-portion-total {
    color: #e85d04;
    font-weight: 700;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

/* ── Raw ingredients for recipe portions ── */
.pr-raw-ings {
    border-top: 1px solid #e2e8f0;
    padding: 10px 14px 12px;
    background: #f8fafc;
}

.pr-raw-ings-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.pr-raw-ing-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    flex-wrap: wrap;
}

.pr-raw-ing-row:last-child {
    border-bottom: none;
}

.pr-raw-ing-name {
    font-weight: 600;
    color: #334155;
    flex: 1;
    min-width: 120px;
}

.pr-raw-ing-qty {
    color: #475569;
    font-variant-numeric: tabular-nums;
}

.pr-ing-unit {
    color: #94a3b8;
    font-size: 11px;
}

.pr-raw-ing-total {
    color: #e85d04;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pr-no-ing-hint {
    padding: 8px 14px;
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* ── Legacy ingredient list (non-composition dishes) ── */
.pr-legacy-ings {
    padding: 4px 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .production-report-page {
        padding: 16px;
    }

    .pr-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .pr-summary-cards {
        flex-direction: column;
    }

    .pr-summary-card {
        min-width: unset;
    }

    .pr-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .pr-date-inputs {
        flex-wrap: wrap;
    }

    .pr-table-container {
        overflow-x: auto;
    }
}
/* Ingredient Combination Modal Styles */

.ingredient-combination-modal {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1a1a1a;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.modal-body {
    padding: 1.5rem;
}

.error-banner {
    background: #ffebee;
    color: #c62828;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instruction-text {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Duplicate Groups */
.duplicate-groups {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.group-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.group-card:hover {
    border-color: #eb5939;
    box-shadow: 0 4px 12px rgba(235, 89, 57, 0.1);
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.group-header h4 {
    margin: 0;
    color: #1a1a1a;
    font-size: 1.1rem;
}

.usage-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.variant-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.variant-list li {
    background: #f5f5f5;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #333;
}

.usage-info {
    color: #999;
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

/* Combination Form */
.combination-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.back-btn {
    align-self: flex-start;
    background: none;
    border: none;
    color: #eb5939;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    transition: opacity 0.2s;
}

.back-btn:hover {
    opacity: 0.8;
}

.selected-group-info {
    background: #f9f9f9;
    padding: 1.25rem;
    border-radius: 8px;
}

.selected-group-info h3 {
    margin: 0 0 1rem 0;
    color: #1a1a1a;
}

.name-selection {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.name-selection label {
    font-weight: 500;
    color: #333;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover {
    border-color: #eb5939;
    background: #fff5f3;
}

.radio-option input[type="radio"] {
    cursor: pointer;
}

.radio-option input[type="radio"]:checked+span {
    color: #eb5939;
    font-weight: 600;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-option:hover {
    border-color: #eb5939;
    background: #fff5f3;
}

.checkbox-option input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.checkbox-option input[type="checkbox"]:checked+span {
    color: #eb5939;
    font-weight: 600;
}

.custom-name-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.custom-name-input:focus {
    outline: none;
    border-color: #eb5939;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Confirmation Dialog */
.confirmation-dialog {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.confirmation-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.warning-icon {
    font-size: 2rem;
    color: #ff9800;
}

.confirmation-header h3 {
    margin: 0;
    color: #1a1a1a;
}

.confirmation-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.warning-text {
    color: #666;
    margin: 0;
}

.affected-items {
    list-style: none;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.affected-items li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.affected-items li:last-child {
    border-bottom: none;
}

.affected-items .more-items {
    color: #999;
    font-style: italic;
}

.name-change-summary {
    background: #fff3e0;
    padding: 1.25rem;
    border-radius: 8px;
    text-align: center;
}

.name-change-summary p {
    margin: 0.5rem 0;
    color: #666;
    font-size: 0.9rem;
}

.old-names {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.old-names li {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #666;
}

.arrow {
    font-size: 1.5rem;
    color: #eb5939;
    margin: 0.5rem 0;
}

.new-name {
    background: #eb5939;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    display: inline-block;
}

.note {
    background: #fff9c4;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #fbc02d;
    color: #666;
    font-size: 0.9rem;
}

.confirmation-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary {
    background: #eb5939;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #d94d2f;
}

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

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

.btn-danger {
    background: #d32f2f;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #b71c1c;
}

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

/* Loading and Empty States */
.loading-state {
    text-align: center;
    padding: 3rem 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #eb5939;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.loading-state p {
    color: #666;
    font-size: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.success-icon {
    font-size: 4rem;
    color: #4caf50;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #666;
    margin-bottom: 0.5rem;
}

.empty-state .help-text {
    color: #999;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .ingredient-combination-modal {
        max-width: 95vw;
        margin: 1rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .form-actions,
    .confirmation-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        width: 100%;
    }
}/* Ingredient Management Page Styles */

.ingredient-management-page {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 2rem;
}

.back-btn {
    background: none;
    border: none;
    color: #eb5939;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    transition: opacity 0.2s;
}

.back-btn:hover {
    opacity: 0.8;
}

.header-content h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.header-icon {
    color: #eb5939;
}

.header-description {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

/* Management Cards */
.management-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.management-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.management-card:not(.disabled):hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.management-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #eb5939 0%, #ff7659 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    margin-bottom: 1.5rem;
}

.card-content h3 {
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.card-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.feature-list li {
    color: #333;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

.action-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn.primary {
    background: #eb5939;
    color: white;
}

.action-btn.primary:hover {
    background: #d94d2f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(235, 89, 57, 0.3);
}

.coming-soon-badge {
    display: inline-block;
    background: #f5f5f5;
    color: #999;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .ingredient-management-page {
        padding: 1rem;
    }

    .header-content h1 {
        font-size: 1.5rem;
    }

    .management-cards {
        grid-template-columns: 1fr;
    }

    .management-card {
        padding: 1.5rem;
    }
}/* Settings Visibility Container */
.settings-visibility-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.settings-visibility-header {
  margin-bottom: 2rem;
}

.settings-visibility-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.settings-visibility-description {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.5;
}

/* Message Banner */
.message-banner {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-weight: 500;
  animation: slideDown 0.3s ease-out;
}

.message-banner.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message-banner.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Table Container */
.settings-visibility-table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 2rem;
}

/* Table Styles */
.settings-visibility-table {
  width: 100%;
  border-collapse: collapse;
}

.settings-visibility-table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.settings-visibility-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settings-visibility-table th:nth-child(3),
.settings-visibility-table th:nth-child(4),
.settings-visibility-table th:nth-child(5),
.settings-visibility-table th:nth-child(6) {
  text-align: center;
  width: 100px;
}

.settings-visibility-table tbody tr {
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.2s ease;
}

.settings-visibility-table tbody tr:hover {
  background-color: #f9fafb;
}

.settings-visibility-table tbody tr.inactive-row {
  opacity: 0.5;
}

.settings-visibility-table td {
  padding: 1.25rem 1rem;
  font-size: 0.9rem;
  color: #374151;
}

.settings-visibility-table td:nth-child(3),
.settings-visibility-table td:nth-child(4),
.settings-visibility-table td:nth-child(5),
.settings-visibility-table td:nth-child(6) {
  text-align: center;
}

.description-cell {
  color: #6b7280;
  font-size: 0.85rem;
  line-height: 1.4;
  max-width: 400px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  border-radius: 24px;
  transition: all 0.3s ease;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-switch input:disabled + .toggle-slider:before {
  cursor: not-allowed;
}

/* Legend */
.settings-visibility-legend {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
}

.settings-visibility-legend h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 1rem;
}

.settings-visibility-legend ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.settings-visibility-legend li {
  padding: 0.5rem 0;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.5;
}

.settings-visibility-legend li strong {
  color: #1a1a1a;
  font-weight: 600;
}

/* Loading and Access Denied States */
.loading-state,
.access-denied {
  text-align: center;
  padding: 3rem 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.access-denied h2 {
  font-size: 1.5rem;
  color: #dc2626;
  margin-bottom: 0.5rem;
}

.access-denied p {
  color: #6b7280;
  font-size: 1rem;
}

.loading-state {
  color: #6b7280;
  font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .settings-visibility-container {
    padding: 1rem;
  }

  .settings-visibility-table-container {
    overflow-x: auto;
  }

  .settings-visibility-table {
    min-width: 700px;
  }

  .settings-visibility-header h2 {
    font-size: 1.5rem;
  }

  .description-cell {
    max-width: 250px;
  }
}
.restaurant-settings-page {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.settings-header {
    margin-bottom: 2rem;
}

.settings-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.settings-header p {
    color: #6b7280;
    font-size: 1rem;
}

.loading-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.message-banner {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.message-banner.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.message-banner.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.settings-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.settings-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f3f4f6;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Team Switcher Section */
.team-switcher-section {
    margin-bottom: 2rem;
}

.team-switcher-section .section-description {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.team-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.team-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.team-card:hover:not(:disabled) {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.team-card.active {
    border-color: #3b82f6;
    background: #eff6ff;
}

.team-card:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.team-card-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.team-card-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.team-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.current-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.team-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.detail-value {
    font-size: 0.875rem;
    color: #1f2937;
    font-weight: 600;
}

.role-badge {
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    text-transform: capitalize;
    color: #3b82f6;
    font-weight: 700;
}

/* Tab Navigation Styles */
.team-settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
    overflow-x: auto;
    scrollbar-width: thin;
}

.team-settings-tab {
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    margin-bottom: -2px;
}

.team-settings-tab:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.team-settings-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.team-settings-tab-content {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .restaurant-settings-page {
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .settings-header h2 {
        font-size: 1.5rem;
    }

    .team-cards-grid {
        grid-template-columns: 1fr;
    }

    .team-settings-tab {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .team-settings-tabs {
        gap: 0.25rem;
    }
}.branch-visibility-settings {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.visibility-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.visibility-header h2 {
    margin: 0;
    font-size: 1.75rem;
    color: #1a1a1a;
}

.branch-name-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

.visibility-actions {
    display: flex;
    gap: 1rem;
}

.refresh-button,
.save-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.refresh-button {
    background: #f5f5f5;
    color: #333;
}

.refresh-button:hover:not(:disabled) {
    background: #e8e8e8;
}

.save-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.save-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.save-button:disabled,
.refresh-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.visibility-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.tab-button {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-button:hover {
    color: #667eea;
    background: #f8f9ff;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8f9ff;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: #666;
}

.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.visibility-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.visibility-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.visibility-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.visibility-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.visibility-table th:nth-child(3),
.visibility-table th:nth-child(4),
.visibility-table th:nth-child(5),
.visibility-table th:nth-child(6),
.visibility-table th:nth-child(7) {
    text-align: center;
}

.visibility-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.visibility-table tbody tr:hover {
    background-color: #f8f9ff;
}

.visibility-table tbody tr.inactive-row {
    opacity: 0.5;
    background-color: #fafafa;
}

.visibility-table td {
    padding: 1rem;
}

.item-name {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-name strong {
    color: #1a1a1a;
    font-size: 0.95rem;
}

.item-key {
    font-size: 0.8rem;
    color: #999;
    font-family: 'Courier New', monospace;
}

.item-description {
    color: #666;
    font-size: 0.85rem;
    max-width: 300px;
}

.active-cell {
    text-align: center;
}

.toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.toggle-button.active {
    background: #e8f5e9;
    color: #4caf50;
}

.toggle-button.inactive {
    background: #ffebee;
    color: #f44336;
}

.toggle-button:hover {
    transform: scale(1.1);
}

.role-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.visibility-table td:nth-child(3),
.visibility-table td:nth-child(4),
.visibility-table td:nth-child(5),
.visibility-table td:nth-child(6),
.visibility-table td:nth-child(7) {
    text-align: center;
}

.empty-state {
    padding: 3rem;
    text-align: center;
    color: #999;
}

.visibility-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
}

.close-button {
    padding: 0.75rem 2rem;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.close-button:hover {
    background: #e8e8e8;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .visibility-table {
        font-size: 0.85rem;
    }

    .visibility-table th,
    .visibility-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 768px) {
    .branch-visibility-settings {
        padding: 1rem;
    }

    .visibility-header {
        flex-direction: column;
        gap: 1rem;
    }

    .visibility-actions {
        width: 100%;
        flex-direction: column;
    }

    .refresh-button,
    .save-button {
        width: 100%;
        justify-content: center;
    }

    .visibility-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab-button {
        white-space: nowrap;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .visibility-table-container {
        overflow-x: scroll;
    }

    .visibility-table {
        min-width: 800px;
    }
}/* ============================================================
   Branch Settings Page
   ============================================================ */

.branch-settings-page {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ---- Page Header ---- */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    gap: 1rem;
}

.page-header-content h1 {
    margin: 0 0 0.3rem 0;
    font-size: 1.6rem;
    color: #1a1a1a;
    font-weight: 700;
}

.page-description {
    margin: 0 0 0.6rem 0;
    color: #888;
    font-size: 0.9rem;
}

.branches-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #f0f0ff;
    color: #667eea;
    border: 1px solid #d4d4ff;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.create-branch-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.create-branch-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(102, 126, 234, 0.45);
}

/* ---- Error Banner ---- */

.error-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.5rem;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-left: 4px solid #f56565;
    border-radius: 8px;
    color: #c53030;
    font-size: 0.88rem;
}

/* ---- Branches Grid ---- */

.branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
    gap: 1.25rem;
}

/* ---- Branch Card ---- */

.branch-card {
    background: #fff;
    border: 1.5px solid #e8e8f0;
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.branch-card:hover {
    box-shadow: 0 8px 28px rgba(102, 126, 234, 0.13);
    transform: translateY(-2px);
}

.branch-card.is-current {
    border-color: #667eea;
}

/* Accent bar */
.branch-card-accent {
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.branch-card.is-current .branch-card-accent {
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
}

/* Header */
.branch-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.1rem 1.25rem 0.85rem;
}

.branch-card-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.branch-card-title {
    flex: 1;
    min-width: 0;
}

.branch-card-title h3 {
    margin: 0 0 0.2rem 0;
    font-size: 1.05rem;
    color: #1a1a1a;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-code {
    font-size: 0.75rem;
    color: #aaa;
    font-family: 'Courier New', monospace;
    background: #f5f5f8;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    display: inline-block;
}

.branch-badges {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: flex-end;
    flex-shrink: 0;
}

.main-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 0.18rem 0.55rem;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.current-badge {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: #065f46;
    padding: 0.18rem 0.55rem;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Card Body – Detail Grid */

.branch-card-body {
    padding: 0 1.25rem 1.1rem;
    flex: 1;
}

.branch-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1.5px solid #f0f0f5;
    border-radius: 10px;
    overflow: hidden;
}

.branch-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f0f0f5;
    border-right: 1px solid #f0f0f5;
}

.branch-detail-item:nth-child(even) {
    border-right: none;
}

/* Remove bottom border from last row */
.branch-detail-item:nth-last-child(-n+2):not(.full-width),
.branch-detail-item.full-width:last-child {
    border-bottom: none;
}

.branch-detail-item.full-width {
    grid-column: 1 / -1;
    border-right: none;
}

.detail-icon {
    color: #a78bfa;
    font-size: 0.88rem;
    margin-top: 0.18rem;
    flex-shrink: 0;
}

.detail-content {
    min-width: 0;
    flex: 1;
}

.detail-label {
    display: block;
    font-size: 0.68rem;
    color: #bbb;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.08rem;
}

.detail-value {
    display: block;
    font-size: 0.86rem;
    color: #222;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-value.wrap {
    white-space: normal;
}

/* Status */
.status-active {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #059669;
    font-size: 0.86rem;
    font-weight: 600;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #059669;
    display: inline-block;
}

/* Access badge */
.access-badge {
    background: #ede9fe;
    color: #6d28d9;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: capitalize;
}

/* Card Footer */

.branch-card-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1.5px solid #f0f0f5;
    display: flex;
    gap: 0.5rem;
    background: #fafafa;
}

.btn-card {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    border: 1.5px solid transparent;
}

.btn-card-secondary {
    background: #fff;
    border-color: #e0e0e8;
    color: #999;
}

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

.btn-card-amber {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #b45309;
}

.btn-card-amber:hover:not(:disabled) {
    background: #fef3c7;
    border-color: #f59e0b;
}

.btn-card-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.btn-card-primary:hover:not(:disabled) {
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

/* ---- Empty State ---- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 5rem 2rem;
}

.empty-state-icon {
    width: 68px;
    height: 68px;
    background: #f5f3ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.2rem;
    font-size: 1.85rem;
    color: #a78bfa;
}

.empty-state h3 {
    margin: 0 0 0.45rem 0;
    font-size: 1.1rem;
    color: #555;
    font-weight: 600;
}

.empty-state p {
    margin: 0;
    color: #aaa;
    font-size: 0.88rem;
}

/* ---- Loading ---- */

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Access Denied ---- */

.access-denied-card {
    max-width: 460px;
    margin: 4rem auto;
    text-align: center;
    background: #fff;
    border: 1.5px solid #e8e8e8;
    border-radius: 14px;
    padding: 3rem 2rem;
}

.access-denied-icon {
    width: 60px;
    height: 60px;
    background: #fff5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.6rem;
    color: #f56565;
}

.access-denied-card h2 {
    margin: 0 0 0.65rem 0;
    font-size: 1.2rem;
    color: #1a1a1a;
}

.access-denied-card p {
    color: #888;
    font-size: 0.88rem;
    margin: 0;
    line-height: 1.6;
}

/* ============================================================
   Modals
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    border-radius: 14px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
}

.modal-content-large {
    max-width: 1400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1.5px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    gap: 1rem;
}

.modal-header-inner {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.modal-header h2 {
    margin: 0 0 0.15rem 0;
    font-size: 1.15rem;
    color: #1a1a1a;
    font-weight: 700;
}

.modal-header-subtitle {
    font-size: 0.8rem;
    color: #aaa;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 1rem;
    color: #666;
    flex-shrink: 0;
}

.modal-close:hover {
    background: #e8e8e8;
}

.modal-body {
    padding: 1.5rem;
}

/* ---- Create Branch Form ---- */

.form-section {
    margin-bottom: 1.5rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 0.85rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0ff;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.83rem;
    font-weight: 600;
    color: #444;
}

.required {
    color: #f44336;
}

.form-group input,
.form-group textarea {
    padding: 0.6rem 0.85rem;
    border: 1.5px solid #e0e0e8;
    border-radius: 8px;
    font-size: 0.88rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: #1a1a1a;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.form-group input:disabled,
.form-group textarea:disabled {
    background: #f8f8fa;
    cursor: not-allowed;
    color: #aaa;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1.1rem 1.5rem;
    border-top: 1.5px solid #f0f0f0;
    justify-content: flex-end;
}

.cancel-button {
    padding: 0.6rem 1.2rem;
    border: 1.5px solid #e0e0e8;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    color: #555;
}

.cancel-button:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #ccc;
}

.submit-button {
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cancel-button:disabled,
.submit-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* ---- Stock Setting Card Icon & Status Pill ---- */

.stock-setting-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.stock-setting-icon-wrap.strict {
    background: #fff3cd;
    color: #b45309;
}

.stock-setting-card.enabled .stock-setting-icon-wrap.strict {
    background: #fee2e2;
    color: #dc2626;
}

.stock-setting-icon-wrap.popup {
    background: #ede9fe;
    color: #7c3aed;
}

.setting-status-pill {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.08rem 0.45rem;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.setting-status-pill.on {
    background: #dcfce7;
    color: #15803d;
}

.setting-status-pill.off {
    background: #f3f4f6;
    color: #9ca3af;
}

/* ---- Stock Settings Cards ---- */

.stock-setting-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s, background 0.2s;
}

.stock-setting-card:last-child {
    margin-bottom: 0;
}

.stock-setting-card.enabled {
    border-color: #a5b4fc;
    background: #fafbff;
}

.stock-setting-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stock-setting-info {
    flex: 1;
    min-width: 0;
}

.stock-setting-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.92rem;
    color: #1a1a1a;
    font-weight: 700;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.stock-setting-info p {
    margin: 0;
    font-size: 0.82rem;
    color: #888;
    line-height: 1.55;
}

/* Toggle Switch */

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d5db;
    border-radius: 24px;
    transition: 0.25s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ============================================================
   Strict Mode Confirmation Modal
   ============================================================ */

.strict-confirm-overlay {
    z-index: 1100; /* above the stock settings modal */
}

.strict-confirm-modal {
    border-radius: 14px;
    overflow: hidden;
}

/* Coloured header band */
.strict-confirm-header {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1.5px solid transparent;
}

.strict-confirm-header.enabling {
    background: #fff7ed;
    border-bottom-color: #fed7aa;
}

.strict-confirm-header.disabling {
    background: #f0fdf4;
    border-bottom-color: #bbf7d0;
}

.strict-confirm-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.enabling .strict-confirm-icon {
    background: #fed7aa;
    color: #c2410c;
}

.disabling .strict-confirm-icon {
    background: #bbf7d0;
    color: #15803d;
}

.strict-confirm-header h3 {
    margin: 0 0 0.2rem 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.enabling .strict-confirm-header h3 { color: #9a3412; }
.disabling .strict-confirm-header h3 { color: #14532d; }

.strict-confirm-header p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
}

.enabling .strict-confirm-header p { color: #c2410c; }
.disabling .strict-confirm-header p { color: #15803d; }

.strict-confirm-header > div:last-of-type {
    flex: 1;
    min-width: 0;
}

/* Body */
.strict-confirm-body {
    padding: 1.25rem 1.5rem;
}

.strict-confirm-lead {
    margin: 0 0 1rem 0;
    font-size: 0.88rem;
    color: #444;
    line-height: 1.6;
}

/* Impact list */
.strict-impact-list {
    list-style: none;
    margin: 0 0 1rem 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.strict-impact-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.86rem;
    color: #333;
    line-height: 1.55;
}

.impact-icon {
    flex-shrink: 0;
    margin-top: 0.18rem;
    font-size: 0.9rem;
}

.impact-icon.block { color: #dc2626; }
.impact-icon.warn  { color: #d97706; }
.impact-icon.safe  { color: #16a34a; }

/* Bottom note */
.strict-confirm-note {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.5;
}

.strict-confirm-note.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.strict-confirm-note.info {
    background: #ede9fe;
    color: #4c1d95;
    border: 1px solid #ddd6fe;
}

.strict-confirm-note svg {
    flex-shrink: 0;
    margin-top: 0.15rem;
    font-size: 0.88rem;
}

/* Confirm action button variants */
.strict-confirm-btn {
    display: inline-flex;
    align-items: center;
}

.strict-confirm-btn.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: none;
}

.strict-confirm-btn.btn-danger:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    transform: translateY(-1px);
}

.strict-confirm-btn.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: none;
}

.strict-confirm-btn.btn-success:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
    transform: translateY(-1px);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
    .branch-settings-page {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .create-branch-button {
        width: 100%;
        justify-content: center;
    }

    .branches-grid {
        grid-template-columns: 1fr;
    }

    .branch-details-grid {
        grid-template-columns: 1fr;
    }

    .branch-detail-item {
        border-right: none !important;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .branch-card-footer {
        flex-wrap: wrap;
    }

    .btn-card {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
    }
}
.onboarding-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.onboarding-container {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
    padding: 3rem;
}

.onboarding-header {
    text-align: center;
    margin-bottom: 2rem;
}

.onboarding-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.step-indicator {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Choice Step Styles */
.choice-step {
    text-align: center;
}

.choice-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.choice-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.choice-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.choice-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.choice-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.choice-card p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.choice-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.choice-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

.choice-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.invite-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.invite-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.invite-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}


.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

.checkbox-label:hover {
    border-color: #667eea;
    background: #f9fafb;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked+span,
.checkbox-label:has(input[type="checkbox"]:checked) {
    color: #667eea;
}

.onboarding-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Responsive */
@media (max-width: 768px) {
    .onboarding-page {
        padding: 1rem;
    }

    .onboarding-container {
        padding: 2rem 1.5rem;
    }

    .onboarding-header h1 {
        font-size: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .onboarding-actions {
        flex-direction: column-reverse;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}/* Glassmorphism Widget */
.sales-widget {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 16px;
    animation: fadeIn 0.5s ease;
}

.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Widget Header */
.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.widget-icon {
    font-size: 1.5rem;
    color: #667eea;
}

.widget-title h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
    font-weight: 600;
}

.view-dashboard-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.view-dashboard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Sales Stats */
.sales-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(31, 38, 135, 0.1);
}

.stat-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 24px rgba(31, 38, 135, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.stat-card.highlight {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(102, 126, 234, 0.5);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-value.positive {
    color: #4CAF50;
}

.stat-value.negative {
    color: #f44336;
}

.stat-meta {
    font-size: 0.8rem;
    color: #999;
}

/* Mini Chart */
.mini-chart {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.chart-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    font-weight: 600;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 120px;
    padding: 0.5rem 0;
}

.chart-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.chart-bar {
    width: 100%;
    min-height: 20px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.chart-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
}

.bar-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: #667eea;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-bar:hover .bar-value {
    opacity: 1;
}

.chart-label-x {
    font-size: 0.7rem;
    color: #999;
    text-align: center;
    white-space: nowrap;
}

/* Loading State */
.widget-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 1rem;
}

.loading-spinner-small {
    width: 32px;
    height: 32px;
    border: 3px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.widget-loading p {
    color: #999;
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .sales-widget {
        padding: 1rem;
    }

    .widget-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .view-dashboard-btn {
        width: 100%;
        justify-content: center;
    }

    .sales-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .chart-bars {
        height: 100px;
    }

    .chart-label-x {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .widget-title h3 {
        font-size: 1.1rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .chart-bars {
        height: 80px;
        gap: 0.25rem;
    }
}.messaging-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Header */
.messaging-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.back-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-button:hover {
    background-color: #f0f0f0;
    color: #333;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.user-details h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.status-indicator {
    font-size: 0.85rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-indicator.online {
    color: #4CAF50;
}

.status-indicator.online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    display: inline-block;
}

.more-button {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.more-button:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* Toggle Widget Button */
.toggle-widget-button {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #667eea;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-widget-button:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #764ba2;
    transform: scale(1.1);
}

/* Content Wrapper for Sales Widget */
.messaging-content-wrapper {
    padding: 1.5rem;
    background: transparent;
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: transparent;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.no-messages {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #999;
}

.no-messages-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-messages p {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #666;
}

.no-messages span {
    font-size: 0.95rem;
    color: #999;
}

/* Message Bubbles */
.message-bubble {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble.sent {
    align-self: flex-end;
}

.message-bubble.received {
    align-self: flex-start;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    word-wrap: break-word;
}

.message-bubble.sent .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble.received .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-content p {
    margin: 0;
    line-height: 1.4;
    font-size: 0.95rem;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    color: #999;
}

.message-bubble.sent .message-meta {
    justify-content: flex-end;
}

.message-bubble.received .message-meta {
    justify-content: flex-start;
}

.message-status {
    display: flex;
    align-items: center;
}

.read-icon {
    color: #4CAF50;
}

.sent-icon {
    color: #999;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 18px;
    width: fit-content;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

/* Message Input */
.message-input-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.message-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.message-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.message-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.send-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.send-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.send-button:active:not(:disabled) {
    transform: scale(0.95);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.messaging-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 80px);
    gap: 1rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.messaging-loading p {
    color: #999;
    font-size: 1rem;
}

/* Error State */
.messaging-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 80px);
    gap: 1.5rem;
    text-align: center;
    padding: 2rem;
}

.messaging-error p {
    color: #e74c3c;
    font-size: 1.1rem;
    max-width: 400px;
}

.messaging-error button {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.messaging-error button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .messaging-header {
        padding: 0.75rem 1rem;
    }

    .user-details h2 {
        font-size: 1rem;
    }

    .status-indicator {
        font-size: 0.75rem;
    }

    .messages-container {
        padding: 1rem;
    }

    .message-bubble {
        max-width: 85%;
    }

    .message-content {
        padding: 0.625rem 0.875rem;
    }

    .message-input-container {
        padding: 0.75rem 1rem;
    }

    .send-button {
        width: 44px;
        height: 44px;
    }
}

/* Scrollbar Styling */
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}.stock-management-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    padding: 2rem;
}

.stock-management-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.page-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-4px);
}

.back-button svg {
    font-size: 1.25rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.header-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.page-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0.25rem 0 0 0;
}

/* Form Card */
.stock-form-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.form-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.form-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.required {
    color: #ef4444;
}

.form-input,
.form-textarea,
.form-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 45px;
}

.form-select {
    cursor: pointer;
    background-color: white;
}

.form-select optgroup {
    font-weight: bold;
    font-style: normal;
    color: #f97316;
    background: #fff3e0;
    padding: 0.5rem 0;
}

.form-select option {
    font-weight: normal;
    color: #374151;
    background: white;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-submit,
.btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.6);
}

.btn-cancel {
    background: #f3f4f6;
    color: #374151;
}

.btn-cancel:hover {
    background: #e5e7eb;
}

/* Stock List Card */
.stock-list-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.7s ease-out;
}

.list-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.list-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

/* Text Alignment Utilities */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

/* Table */
.stock-table-wrapper {
    overflow-x: auto;
}

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

.stock-table thead {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.stock-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Allow utility classes to override th alignment */
.stock-table th.text-right { text-align: right; }
.stock-table th.text-center { text-align: center; }
.stock-table th.text-left  { text-align: left; }

.stock-table th:first-child {
    border-top-left-radius: 12px;
}

.stock-table th:last-child {
    border-top-right-radius: 12px;
}

.stock-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.3s ease;
}

.stock-table tbody tr:hover {
    background: rgba(249, 115, 22, 0.05);
}

.stock-table td {
    padding: 0.85rem 1rem;
    color: #374151;
    font-size: 0.9rem;
    vertical-align: middle;
}

.stock-table .item-name {
    font-weight: 600;
    color: #111827;
}

.stock-table .quantity,
.stock-table .unit {
    font-weight: 500;
}

.stock-table .price {
    font-weight: 600;
    color: #059669;
}

.stock-table .actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit,
.btn-delete {
    padding: 0.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-edit {
    background: #dbeafe;
    color: #1e40af;
}

.btn-edit:hover {
    background: #bfdbfe;
    transform: scale(1.1);
}

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

.btn-delete:hover {
    background: #fecaca;
    transform: scale(1.1);
}

/* Empty State */
.empty-state {
    background: white;
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.7s ease-out;
}

.empty-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.empty-state p {
    color: #6b7280;
    font-size: 1rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stock-management-page {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-content {
        width: 100%;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .stock-form-card,
    .stock-list-card {
        padding: 1.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn-submit,
    .btn-cancel {
        width: 100%;
        justify-content: center;
    }

    .stock-table-wrapper {
        overflow-x: scroll;
    }

    .stock-table {
        min-width: 800px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.5rem;
    }

    .header-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .stock-form-card,
    .stock-list-card,
    .empty-state {
        padding: 1.25rem;
    }

    .form-header h2 {
        font-size: 1.25rem;
    }

    .form-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}.combobox-container {
    position: relative;
    width: 100%;
}

.combobox-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.combobox-input-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.combobox-input {
    width: 100%;
    padding: 10px 12px;
    padding-right: 35px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.btn-input-add {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-input-add:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-input-add:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

.combobox-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.combobox-arrow {
    position: absolute;
    right: 12px;
    color: #64748b;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.combobox-container.is-open .combobox-arrow {
    transform: rotate(180deg);
}

.combobox-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: 4px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 250px;
    overflow-y: auto;
}

.combobox-list {
    list-style: none;
    padding: 4px 0;
    margin: 0;
}

.combobox-item {
    padding: 10px 12px;
    font-size: 14px;
    color: #1e293b;
    cursor: pointer;
    transition: background 0.1s ease;
}

.combobox-item:hover,
.combobox-item.is-selected {
    background-color: #f1f5f9;
}

.combobox-item.is-active {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.combobox-no-results {
    padding: 12px;
    font-size: 14px;
    color: #64748b;
    text-align: center;
}

.combobox-add-new {
    border-top: 1px solid #e2e8f0;
    padding: 8px;
    background: #f8fafc;
}

.btn-add-new {
    width: 100%;
    padding: 8px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s ease;
}

.btn-add-new:hover {
    background: #2563eb;
}

/* Custom scrollbar for dropdown */
.combobox-dropdown::-webkit-scrollbar {
    width: 6px;
}

.combobox-dropdown::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.combobox-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.combobox-dropdown::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}/* Autocomplete Styles */
.autocomplete-wrapper {
    position: relative;
}

.search-input-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.1rem;
    pointer-events: none;
}

.search-input {
    padding-left: 3rem !important;
}

.searching-indicator {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: #f97316;
    font-weight: 500;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #f97316;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin: 0;
    padding: 0;
    list-style: none;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(249, 115, 22, 0.1);
}

.suggestion-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.suggestion-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

.suggestion-category {
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

.suggestion-unit {
    color: #f97316;
    font-weight: 500;
}

.no-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 1rem;
    color: #6b7280;
    text-align: center;
    font-size: 0.9rem;
    z-index: 1000;
}

.no-suggestions--nav {
    text-align: left;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.no-suggestions-title {
    font-size: 12.5px;
    color: #374151;
    margin: 0;
}

.no-suggestions-body {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.no-suggestions-nav-btn {
    align-self: flex-start;
    margin-top: 2px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    background: #eff6ff;
    color: #2563eb;
    border: 1.5px solid #93c5fd;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s;
    white-space: nowrap;
}

.no-suggestions-nav-btn:hover {
    background: #dbeafe;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid #f3f4f6;
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    color: #6b7280;
    font-size: 1rem;
    margin: 0;
}/* Stock Batches Page Styles */
.stock-batches-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    padding: 2rem;
}

.stock-batches-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.page-header {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.back-button:hover {
    background: #e0e0e0;
    transform: translateX(-4px);
}

.header-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.page-subtitle {
    font-size: 0.95rem;
    color: #666;
    margin: 0.25rem 0 0 0;
}

.refresh-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.refresh-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.refresh-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.stat-content p {
    font-size: 0.9rem;
    color: #666;
    margin: 0.25rem 0 0 0;
}

/* Controls Section */
.controls-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    background: #f5f5f5;
    padding: 0.25rem;
    border-radius: 8px;
}

.view-toggle button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.view-toggle button.active {
    background: white;
    color: #f97316;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filters {
    display: flex;
    gap: 1rem;
    flex: 1;
    justify-content: flex-end;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f5f5f5;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    flex: 1;
    max-width: 400px;
}

.search-box svg {
    color: #999;
    font-size: 1.2rem;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: #333;
    outline: none;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f5f5f5;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
}

.filter-group svg {
    color: #999;
    font-size: 1.2rem;
}

.filter-group select {
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: #333;
    outline: none;
    cursor: pointer;
    font-weight: 500;
}

/* Tables */
.summary-table-card,
.batches-table-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.summary-table-card h2,
.batches-table-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 1.5rem 0;
}

.table-wrapper {
    overflow-x: auto;
}

.summary-table,
.batches-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-table thead,
.batches-table thead {
    background: #f8f9fa;
}

.summary-table th,
.batches-table th {
    padding: 1rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e0e0;
}

.summary-table td,
.batches-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
    color: #333;
}

.summary-table tbody tr:hover,
.batches-table tbody tr:hover {
    background: #f8f9fa;
}

.ingredient-name {
    font-weight: 600;
    color: #1a1a1a;
}

.quantity,
.value,
.total-cost {
    font-weight: 600;
    color: #f97316;
}

.batch-count {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 500;
    font-size: 0.85rem;
}

.expiry-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

.batch-number {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #f97316;
}

.remaining {
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #45a049 100%);
    border-radius: 2px;
    transition: width 0.3s;
}

.expiry-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.expiry-warning {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.batches-table tr.depleted {
    opacity: 0.6;
}

.batches-table tr.expired {
    background: #ffebee;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem !important;
    color: #999;
}

.empty-state svg {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f0f0f0;
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-state p {
    color: #666;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .stock-batches-page {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .controls-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filters {
        flex-direction: column;
    }

    .search-box {
        max-width: none;
    }

    .table-wrapper {
        overflow-x: scroll;
    }
}/* ============================================
   STOCK ALLOCATION PAGE — Production CSS
   ============================================ */

/* --- Page Layout --- */
.stock-allocation-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #5b21b6 100%);
    padding: 2rem;
    font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
}

.stock-allocation-container {
    max-width: 1440px;
    margin: 0 auto;
}

/* --- Header --- */
.sa-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.sa-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.sa-back-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateX(-3px);
}

.sa-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.sa-header-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.sa-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sa-pending-badge {
    font-size: 0.7rem;
    font-weight: 700;
    background: #f59e0b;
    color: #1e293b;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: sa-pulse 2s ease-in-out infinite;
}

@keyframes sa-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.65;
    }
}

.sa-subtitle {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0.2rem 0 0 0;
}

.sa-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sa-date-picker {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 0.45rem 0.9rem;
    color: white;
}

.sa-date-picker label {
    font-weight: 500;
    font-size: 0.85rem;
}

.sa-date-picker input {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
}

.sa-date-picker input::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.sa-refresh-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.sa-refresh-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
    transform: rotate(90deg);
}

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

.sa-spinning svg {
    animation: sa-spin 0.8s linear infinite;
}

/* --- Stats Bar --- */
.sa-stats-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.sa-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.82rem;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    white-space: nowrap;
}

.sa-stat-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fef3c7;
}

.sa-stat-ok {
    background: rgba(34, 197, 94, 0.15);
    color: #dcfce7;
}

.sa-stat-info {
    background: rgba(99, 102, 241, 0.15);
    color: #e0e7ff;
}

.sa-stat-muted {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
}

/* --- Loading --- */
.sa-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 5rem;
    color: white;
    font-size: 1.05rem;
}

.sa-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: white;
    border-radius: 50%;
    animation: sa-spin 0.7s linear infinite;
}

@keyframes sa-spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Sections --- */
.sa-section {
    background: white;
    border-radius: 18px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    animation: sa-cardIn 0.3s ease;
}

@keyframes sa-cardIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sa-section-completed {
    background: #fafff8;
    border: 1px solid #e6f4e0;
}

.sa-section-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.sa-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.sa-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0;
    width: 100%;
    margin-bottom: 0.5rem;
    color: #64748b;
    font-size: 1rem;
    transition: color 0.2s;
}

.sa-section-toggle:hover {
    color: #1e293b;
}

.sa-section-toggle .sa-section-title {
    pointer-events: none;
}

.sa-count-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    margin-left: 0.25rem;
}

.sa-count-warning {
    background: #fef3c7;
    color: #92400e;
}

.sa-count-ok {
    background: #dcfce7;
    color: #166534;
}

/* --- Filter Bar --- */
.sa-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sa-filter-input-wrap {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.sa-filter-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    width: 15px;
    height: 15px;
    pointer-events: none;
}

.sa-filter-input {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 2rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.82rem;
    background: #f8fafc;
    color: #334155;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.sa-filter-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.08);
    background: white;
}

.sa-filter-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
}

.sa-filter-clear:hover {
    color: #ef4444;
}

/* --- Empty State --- */
.sa-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 3rem 2rem;
    text-align: center;
}

.sa-empty-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.sa-empty h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 600;
}

.sa-empty p {
    margin: 0;
    font-size: 0.9rem;
    color: #94a3b8;
}

.sa-today-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 1.2rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #6d28d9;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sa-today-btn:hover {
    background: #ede9fe;
    border-color: #c4b5fd;
}

/* --- Table --- */
.sa-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sa-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

.sa-table thead th {
    text-align: left;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.sa-table thead th:first-child {
    border-radius: 8px 0 0 0;
}

.sa-table thead th:last-child {
    border-radius: 0 8px 0 0;
}

.sa-table tbody td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.sa-table tfoot td {
    padding: 0.75rem;
    border-top: 2px solid #e2e8f0;
    background: #f8fafc;
}

.sa-table-row {
    transition: background 0.2s, opacity 0.3s;
}

.sa-table-row:hover {
    background: #faf5ff;
}

.sa-row-processing {
    opacity: 0.6;
    pointer-events: none;
}

/* --- Ingredient cell --- */
.sa-ingredient-cell {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sa-ingredient-cell strong {
    font-size: 0.92rem;
    color: #1e293b;
}

.sa-meta {
    font-size: 0.75rem;
    color: #94a3b8;
}

.sa-meta-time {
    font-size: 0.7rem;
    color: #c084fc;
    font-weight: 500;
}

/* --- Required qty --- */
.sa-required-qty {
    font-weight: 600;
    color: #6d28d9;
    font-size: 0.9rem;
    white-space: nowrap;
}

.sa-completed-qty {
    font-weight: 500;
    color: #475569;
    font-size: 0.85rem;
}

/* --- Search cell --- */
.sa-search-cell {
    min-width: 200px;
    position: relative;
}

.sa-stock-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    margin-top: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
    animation: sa-fadeIn 0.2s ease;
}

@keyframes sa-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-2px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sa-stock-ok {
    background: #f0fdf4;
    color: #166534;
}

.sa-stock-low {
    background: #fef2f2;
    color: #991b1b;
}

/* --- Qty input --- */
.sa-qty-input {
    width: 75px;
    padding: 0.45rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.88rem;
    background: white;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sa-qty-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.08);
}

.sa-qty-input:disabled {
    background: #f8fafc;
    cursor: not-allowed;
}

/* --- Unit select --- */
.sa-unit-select {
    padding: 0.45rem 0.35rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.82rem;
    background: white;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.sa-unit-select:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.08);
}

.sa-unit-select:disabled {
    background: #f8fafc;
    cursor: not-allowed;
}

/* --- Deduct button --- */
.sa-deduct-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(109, 40, 217, 0.15);
}

.sa-deduct-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.3);
}

.sa-deduct-btn:active:not(:disabled) {
    transform: translateY(0);
}

.sa-deduct-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sa-btn-loading {
    min-width: 80px;
    justify-content: center;
}

.sa-btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: sa-spin 0.6s linear infinite;
}

/* --- Completed table --- */
.sa-table-completed tbody td {
    background: #fafff8;
}

.sa-table-completed tbody tr:hover td {
    background: #f0fdf4;
}

.sa-detail-line {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #475569;
    padding: 2px 0;
}

.sa-detail-qty {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-left: auto;
}

.sa-no-detail {
    color: #cbd5e1;
}

.sa-cost {
    color: #166534;
    font-weight: 600;
    font-size: 0.85rem;
}

/* --- Warning rows --- */
.sa-row-warning {
    background: #fffbeb !important;
}

.sa-row-warning:hover {
    background: #fef3c7 !important;
}

/* --- Selected row --- */
.sa-row-selected {
    background: #f5f3ff !important;
    border-left: 3px solid #7c3aed;
}

.sa-row-selected:hover {
    background: #ede9fe !important;
}

/* --- Deduction Form --- */
.sa-deduct-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sa-deduct-selected {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border: 1px solid #ddd6fe;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.sa-deduct-selected-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sa-deduct-selected-info strong {
    font-size: 1.05rem;
    color: #1e293b;
}

.sa-deduct-clear {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.sa-deduct-clear:hover {
    color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;
}

.sa-deduct-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.sa-deduct-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sa-deduct-field label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sa-deduct-field-full {
    grid-column: 1 / -1;
}

.sa-deduct-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

/* =============================================
   DIALOGS (Confirm + Insufficient)
   ============================================= */
.sa-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: sa-overlayIn 0.2s ease;
}

@keyframes sa-overlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.sa-dialog {
    background: white;
    border-radius: 20px;
    padding: 2rem 2.25rem;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    animation: sa-dialogIn 0.25s ease;
}

@keyframes sa-dialogIn {
    from {
        transform: scale(0.95) translateY(12px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.sa-dialog-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.sa-dialog-icon-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
}

.sa-dialog-icon-confirm {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #7c3aed;
}

.sa-dialog-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.4rem 0;
}

.sa-dialog-message {
    font-size: 0.88rem;
    color: #64748b;
    margin: 0 0 1.25rem 0;
    line-height: 1.5;
}

.sa-dialog-details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    text-align: left;
    margin-bottom: 1rem;
}

.sa-dialog-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: #475569;
}

.sa-dialog-row+.sa-dialog-row {
    border-top: 1px solid #f1f5f9;
}

.sa-dialog-required {
    color: #6d28d9;
}

.sa-dialog-available {
    color: #dc2626;
}

.sa-dialog-deficit {
    background: #fef2f2;
    margin: 0.5rem -1rem -0.85rem;
    padding: 0.6rem 1rem !important;
    border-radius: 0 0 12px 12px;
    font-weight: 600;
    color: #991b1b !important;
}

.sa-dialog-deficit strong {
    color: #dc2626;
}

.sa-dialog-help {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0 0 1.25rem 0;
    line-height: 1.5;
}

.sa-dialog-actions {
    display: flex;
    gap: 0.75rem;
}

.sa-dialog-btn {
    flex: 1;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.sa-dialog-btn-full {
    width: 100%;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
}

.sa-dialog-btn-full:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.3);
}

.sa-dialog-btn-cancel {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.sa-dialog-btn-cancel:hover {
    background: #e2e8f0;
}

.sa-dialog-btn-confirm {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
}

.sa-dialog-btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.3);
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.sa-toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.sa-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    pointer-events: auto;
    animation: sa-toastIn 0.35s ease;
    border-left: 4px solid transparent;
}

@keyframes sa-toastIn {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.sa-toast-success {
    border-left-color: #22c55e;
}

.sa-toast-error {
    border-left-color: #ef4444;
}

.sa-toast-warning {
    border-left-color: #f59e0b;
}

.sa-toast-info {
    border-left-color: #6366f1;
}

.sa-toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.sa-toast-success .sa-toast-icon {
    background: #f0fdf4;
    color: #22c55e;
}

.sa-toast-error .sa-toast-icon {
    background: #fef2f2;
    color: #ef4444;
}

.sa-toast-warning .sa-toast-icon {
    background: #fffbeb;
    color: #f59e0b;
}

.sa-toast-info .sa-toast-icon {
    background: #eef2ff;
    color: #6366f1;
}

.sa-toast-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sa-toast-content strong {
    font-size: 0.82rem;
    color: #1e293b;
}

.sa-toast-content span {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
}

.sa-toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    display: flex;
    font-size: 0.9rem;
    transition: color 0.15s;
    flex-shrink: 0;
}

.sa-toast-close:hover {
    color: #ef4444;
}

/* =============================================
   MOBILE RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
    .sa-search-cell {
        min-width: 180px;
    }
}

@media (max-width: 768px) {
    .sa-deduct-fields {
        grid-template-columns: 1fr;
    }

    .stock-allocation-page {
        padding: 1rem 0.75rem;
    }

    .sa-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .sa-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .sa-title {
        font-size: 1.35rem;
    }

    .sa-stats-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .sa-stat {
        font-size: 0.75rem;
        padding: 0.4rem 0.7rem;
    }

    .sa-section {
        padding: 1rem;
        border-radius: 14px;
    }

    .sa-filter-input-wrap {
        max-width: 100%;
    }

    /* Mobile card view for table */
    .sa-table thead {
        display: none;
    }

    .sa-table,
    .sa-table tbody,
    .sa-table tr,
    .sa-table td {
        display: block;
        width: 100%;
    }

    .sa-table tbody tr {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    }

    .sa-table tbody tr:hover {
        border-color: #c4b5fd;
    }

    .sa-table tbody td {
        padding: 0.35rem 0;
        border-bottom: none;
    }

    .sa-table tbody td:before {
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 600;
        color: #94a3b8;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        display: block;
        margin-bottom: 2px;
    }

    .sa-search-cell {
        min-width: unset;
    }

    .sa-qty-input {
        width: 100%;
    }

    .sa-unit-select {
        width: 100%;
    }

    .sa-deduct-btn {
        width: 100%;
        justify-content: center;
        padding: 0.65rem;
    }

    /* Completed table mobile */
    .sa-table-completed tbody tr {
        background: #fafff8;
    }

    .sa-table tfoot {
        display: block;
    }

    .sa-table tfoot tr {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem;
        background: #f8fafc;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
    }

    .sa-table tfoot td {
        padding: 0;
        border: none;
    }

    .sa-dialog {
        padding: 1.5rem;
        max-width: 95vw;
    }

    .sa-dialog-actions {
        flex-direction: column;
    }

    .sa-toast-container {
        top: auto;
        bottom: 1rem;
        right: 0.75rem;
        left: 0.75rem;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .stock-allocation-page {
        padding: 0.75rem 0.5rem;
    }

    .sa-title {
        font-size: 1.15rem;
    }

    .sa-header-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        border-radius: 10px;
    }

    .sa-back-btn {
        padding: 0.45rem 0.8rem;
        font-size: 0.82rem;
    }
}

/* --- NEW CSS for Allocation System --- */
.sa-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.sa-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
    white-space: nowrap;
}

.sa-tab:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.sa-tab.active {
    background: white;
    color: #6d28d9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sa-badge-count {
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
}

/* --- CARD GRID --- */
.sa-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.sa-allocation-card {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e2e8f0;
}

.sa-allocation-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}

.sa-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.sa-order-badge {
    background: #ede9fe;
    color: #6d28d9;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
}

.sa-time-badge {
    font-size: 0.75rem;
    color: #94a3b8;
}

.sa-card-body h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: #1e293b;
}

.sa-menu-usage {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.sa-req-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.sa-allocate-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.sa-allocate-btn:hover {
    opacity: 0.9;
}

/* --- MODAL --- */
.sa-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: sa-fadeIn 0.2s;
}

.sa-modal {
    background: white;
    width: 90%;
    max-width: 550px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: sa-slideUp 0.3s;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.sa-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sa-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #1e293b;
}

.sa-close-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #94a3b8;
}

.sa-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.sa-allocation-info {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.sa-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #475569;
}

.sa-info-row:last-child {
    margin-bottom: 0;
}

.sa-text-danger {
    color: #dc2626;
}

.sa-source-selection h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #1e293b;
}

.sa-alt-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sa-alt-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.sa-alt-option:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.sa-alt-option.selected {
    background: #f5f3ff;
    border-color: #7c3aed;
    box-shadow: 0 0 0 1px #7c3aed inset;
}

.sa-alt-details {
    flex: 1;
}

.sa-alt-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e293b;
}

.sa-alt-meta {
    font-size: 0.8rem;
    color: #64748b;
}

.sa-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.sa-btn-text {
    background: none;
    border: none;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
}

.sa-btn-primary {
    background: #7c3aed;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.sa-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Manual --- */
.sa-manual-layout {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 200px);
}

.sa-manual-form {
    flex: 1;
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.sa-stock-list-panel {
    width: 350px;
    background: white;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.sa-search-bar {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sa-search-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
}

.sa-stock-list {
    flex: 1;
    overflow-y: auto;
}

.sa-stock-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}

.sa-stock-item:hover {
    background: #f8fafc;
}

@keyframes sa-fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes sa-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   3-COLUMN ALLOCATION LAYOUT
   ============================================= */

.sa-alloc-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sa-alloc-header-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 1rem;
    padding: 0.65rem 1rem;
    background: #f8fafc;
    border-radius: 10px 10px 0 0;
    border-bottom: 2px solid #e2e8f0;
}

.sa-alloc-header-row .sa-alloc-col {
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748b;
}

.sa-alloc-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
    align-items: flex-start;
}

.sa-alloc-row:hover {
    background: #faf5ff;
}

.sa-alloc-row:last-child {
    border-bottom: none;
}

/* Column 1: Ingredient */
.sa-alloc-ing-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}

.sa-alloc-ing-name strong {
    font-size: 0.92rem;
    color: #1e293b;
}

.sa-alloc-ing-icon {
    color: #7c3aed;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sa-alloc-ing-qty {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6d28d9;
    margin-bottom: 0.3rem;
}

.sa-alloc-alt-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sa-alloc-alt-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.68rem;
    font-weight: 500;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
    width: fit-content;
}

/* Column 2: Recipe / Food Item */
.sa-alloc-recipe-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.2rem;
}

.sa-alloc-menu-item {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.sa-alloc-recipe-qty {
    font-size: 0.78rem;
    color: #94a3b8;
}

.sa-alloc-recipe-qty strong {
    color: #6d28d9;
}

/* Column 3: Stock search + deduction */
.sa-alloc-search-wrap {
    width: 100%;
    position: relative;
}

.sa-alloc-deduct-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.sa-alloc-selected-stock {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    flex-wrap: wrap;
}

.sa-alloc-stock-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #166534;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sa-alloc-stock-avail {
    font-size: 0.7rem;
    color: #15803d;
    font-weight: 500;
    white-space: nowrap;
}

.sa-alloc-clear-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.sa-alloc-clear-btn:hover {
    color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;
}

.sa-alloc-deduct-inputs {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sa-alloc-qty-input {
    width: 70px;
    padding: 0.4rem 0.45rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.82rem;
    background: white;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sa-alloc-qty-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.08);
}

.sa-alloc-qty-input:disabled {
    background: #f8fafc;
    cursor: not-allowed;
}

.sa-alloc-unit-select {
    padding: 0.4rem 0.3rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.78rem;
    background: white;
    outline: none;
    transition: border-color 0.2s;
    min-width: 60px;
}

.sa-alloc-unit-select:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.08);
}

.sa-alloc-unit-select:disabled {
    background: #f8fafc;
    cursor: not-allowed;
}

.sa-alloc-deduct-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(109, 40, 217, 0.15);
}

.sa-alloc-deduct-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.3);
}

.sa-alloc-deduct-btn:active:not(:disabled) {
    transform: translateY(0);
}

.sa-alloc-deduct-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =============================================
   RESPONSIVE OVERRIDES
   ============================================= */
@media (max-width: 1024px) {

    .sa-alloc-header-row,
    .sa-alloc-row {
        grid-template-columns: 1fr 1fr;
    }

    .sa-alloc-col-deduct {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .sa-manual-layout {
        flex-direction: column;
        height: auto;
    }

    .sa-stock-list-panel {
        width: 100%;
        max-height: 400px;
    }

    .sa-alloc-header-row {
        display: none;
    }

    .sa-alloc-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
        border: 1px solid #f1f5f9;
        border-radius: 12px;
        margin-bottom: 0.5rem;
        background: white;
    }

    .sa-alloc-row:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .sa-alloc-col-ingredient::before {
        content: 'Alternative Ingredient';
        display: block;
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #94a3b8;
        font-weight: 600;
        margin-bottom: 0.3rem;
    }

    .sa-alloc-col-recipe::before {
        content: 'Used In';
        display: block;
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #94a3b8;
        font-weight: 600;
        margin-bottom: 0.3rem;
    }

    .sa-alloc-col-deduct::before {
        content: 'Deduct from Stock';
        display: block;
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #94a3b8;
        font-weight: 600;
        margin-bottom: 0.3rem;
    }

    .stock-allocation-page {
        padding: 1rem;
    }

    .sa-alloc-deduct-inputs {
        flex-wrap: wrap;
    }
}

/* ============================================
   ALTERNATIVE INGREDIENT RECOMMENDATIONS
   ============================================ */

.sa-alloc-recommendations {
    margin-bottom: 0.5rem;
}

.sa-alloc-rec-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.35rem;
}

.sa-alloc-rec-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}

.sa-alloc-rec-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    background: #ede9fe;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    color: #6d28d9;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sa-alloc-rec-btn:hover {
    background: #ddd6fe;
    border-color: #c4b5fd;
    transform: translateY(-1px);
}

/* Alt buttons with quantity badge */
.sa-alloc-rec-btn--alt {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #92400e;
}
.sa-alloc-rec-btn--alt:hover {
    background: #fde68a;
    border-color: #f59e0b;
}

.sa-alt-qty-badge {
    display: inline-block;
    background: #f59e0b;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 2px;
}

.sa-alloc-rec-ratio {
    font-size: 0.68rem;
    color: #8b5cf6;
    font-weight: 400;
}

/* Read-only quantity/unit styles */
.sa-alloc-qty-input[readonly],
.sa-alloc-qty-input:disabled {
    background: #f5f3ff;
    border-color: #ede9fe;
    color: #6d28d9;
    font-weight: 600;
    cursor: default;
    opacity: 1;
}

.sa-alloc-unit-select:disabled {
    background: #f5f3ff;
    border-color: #ede9fe;
    color: #6d28d9;
    font-weight: 600;
    cursor: default;
    opacity: 1;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* =============================================
   MULTI-SOURCE ALLOCATION — NEW CLASSES
   ============================================= */

/* Balance bar */
.sa-alloc-balance-bar {
    margin-bottom: 0.6rem;
}

.sa-alloc-balance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.sa-alloc-balance-required {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sa-alloc-balance-remaining {
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
}

.sa-balance-partial {
    background: #fffbeb;
    color: #b45309;
}

.sa-balance-full {
    background: #f0fdf4;
    color: #15803d;
}

.sa-balance-over {
    background: #fef2f2;
    color: #dc2626;
}

.sa-alloc-progress-track {
    height: 5px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
}

.sa-alloc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.sa-alloc-progress-fill.sa-progress-full {
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

.sa-alloc-progress-fill.sa-progress-over {
    background: linear-gradient(90deg, #dc2626, #f87171);
}

/* Sources list */
.sa-alloc-sources-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sa-alloc-source-item {
    /* container per source */
}

/* Search state (no stock selected yet) */
.sa-alloc-source-search-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sa-alloc-source-search-row {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
}

.sa-alloc-source-search-row > :first-child {
    flex: 1;
    min-width: 0;
}

.sa-alloc-source-remove-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 7px;
    color: #ef4444;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    align-self: center;
}

.sa-alloc-source-remove-btn:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #dc2626;
}

/* Filled state (stock selected) */
.sa-alloc-source-filled {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    transition: border-color 0.2s;
}

.sa-alloc-source-filled.sa-source-over {
    border-color: #fca5a5;
    background: #fef2f2;
}

.sa-alloc-source-qty-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sa-alloc-source-qty-row .sa-alloc-qty-input {
    width: 80px;
    background: white;
    cursor: text;
    opacity: 1;
}

.sa-alloc-qty-input.sa-input-over {
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
    color: #dc2626;
}

.sa-source-unit-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.sa-source-over-warn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #dc2626;
    white-space: nowrap;
}

/* Add another source button */
.sa-alloc-add-source-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: #f5f3ff;
    border: 1px dashed #c4b5fd;
    border-radius: 8px;
    color: #7c3aed;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
    margin-bottom: 0.4rem;
}

.sa-alloc-add-source-btn:hover {
    background: #ede9fe;
    border-color: #a78bfa;
    border-style: solid;
}

/* Confirm allocation button */
.sa-alloc-confirm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: white;
    border: none;
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    width: 100%;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
    letter-spacing: 0.2px;
}

.sa-alloc-confirm-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}

.sa-alloc-confirm-btn:disabled,
.sa-alloc-confirm-btn.sa-confirm-btn-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sa-confirm-partial-tag {
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 5px;
    padding: 0.1rem 0.35rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}