/* === ROOT VARIABLES & GLOBAL STYLES === */
:root {
    --primary: #6C63FF;
    --primary-light: rgba(108, 99, 255, 0.15);
    --primary-lighter: rgba(108, 99, 255, 0.05);
    --primary-dark: #5a53e0;
    --secondary: #4CC9F0;
    --background: #121212;
    --card-bg: #1E1E1E;
    /* Solid, slightly lighter than background */
    --input-bg: #2a2a35;
    --border: rgba(255, 255, 255, 0.1);
    --text: #E9E9E9;
    --text-muted: #9E9E9E;
    --shadow-glow: 0 0 20px rgba(108, 99, 255, 0.3);
    --transition-fast: 0.2s ease-in-out;
    --transition-medium: 0.3s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--background);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* === HEADER & NAVIGATION === */
header {
    background-color: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 1.75rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 1.6rem;
    font-weight: 600;
}

nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 1px solid transparent;
}

nav a.active {
    color: var(--text);
    background-color: var(--input-bg);
    border-color: var(--border);
}

nav a:not(.active):hover {
    color: var(--text);
}

.logout-btn {
    padding: 0.6rem;
}

.logout-btn:hover {
    color: #F94144;
    background-color: transparent;
}

/* === MAIN CONTENT === */
main {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.dashboard-title {
    font-size: 1.8rem;
    font-weight: 700;
    position: relative;
    padding-left: 0.5rem;
    margin-bottom: 0.5rem;
}

.dashboard-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 4px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 4px;
}

/* === COMPACT INLINE FILTERS (OVERLAY FIXED) === */
.filters-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Changed from flex-end to flex-start */
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Reduced from 0.75rem */
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* Restaurant Checkboxes (Horizontal Scroll) */
.filter-group:first-child {
    flex: 1 1 auto;
    min-width: 200px;
}

#restaurant-checkboxes {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 10px;
}

.checkbox-item {
    flex-shrink: 0;
}

.checkbox-item label {
    width: auto;
    min-width: 180px;
    padding: 0.8rem 1rem;
    text-align: center;
    justify-content: center;
}

/* Date Filters - More Compact Layout */
.date-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
    min-width: 320px;
    /* Set a fixed min-width for consistency */
}

.date-filter-group .filter-label {
    margin-bottom: 0.5rem;
}

.date-inputs-row {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

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

.date-input-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-left: 0.25rem;
}

input[type="date"] {
    background-color: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    color-scheme: dark;
    min-width: 130px;
    /* Ensure consistent width */
}

input[type="date"]:focus,
input[type="date"]:hover {
    outline: none;
    border-color: var(--primary);
}

.apply-btn {
    padding: 0.6rem 1rem;
    /* Slightly smaller padding */
    white-space: nowrap;
    font-size: 0.85rem;
    /* Slightly smaller font */
    align-self: flex-end;
    /* Align to bottom of the flex container */
}

/* === GENERIC & REPEATED STYLES === */
.apply-btn,
.hourly-tab.active {
    background: linear-gradient(95deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    cursor: pointer;
    transition: all var(--transition-medium);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.apply-btn:hover,
.hourly-tab.active:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.checkbox-item {
    position: relative;
    display: flex;
    align-items: center;
}

.checkbox-item input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.checkbox-item label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 8px;
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.checkbox-item label::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.checkbox-item input[type="checkbox"]:checked+label {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--text);
}

.checkbox-item input[type="checkbox"]:checked+label::before {
    background-color: var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='white' d='M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z'/%3e%3c/svg%3e");
    background-position: center;
    background-repeat: no-repeat;
}

.checkbox-item:hover label {
    border-color: var(--primary);
}

/* === GRID & CARDS === */
.grid-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-medium);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.span-12 {
    grid-column: span 12;
}

.span-6 {
    grid-column: span 6;
}

.h-large {
    min-height: 450px;
}

.h-medium {
    min-height: 380px;
}

.card-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
}

.card-title i {
    color: var(--primary);
}

.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chart-container {
    position: relative;
    flex-grow: 1;
    min-height: 250px;
}

/* === HOURLY PREDICTION TABS & TABLE === */
.hourly-prediction-tabs {
    display: flex;
    gap: 0.5rem;
    background-color: var(--input-bg);
    padding: 0.4rem;
    border-radius: 10px;
}

.hourly-tab {
    background-color: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hourly-tab:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.filter-item select {
    background-color: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239E9E9E' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 2.5rem;
}

.table-container {
    flex-grow: 1;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.8rem 1.rem;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table th {
    background-color: var(--card-bg, #2a2a2a);
    color: var(--text);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 20;
}

.data-table tbody tr:hover {
    background-color: var(--primary-lighter);
}

.data-table td:first-child,
.data-table th:first-child {
    font-weight: 600;
    color: var(--text);
    position: sticky;
    left: 0;
    background-color: var(--card-bg, #2a2a2a);
    border-right: 1px solid var(--border);
    z-index: 10;
}

.data-table th:first-child {
    z-index: 30;
}


.data-table tbody tr:hover td:first-child {
    background-color: var(--primary-lighter);
}

/* --- ✅ NEW: Menu Engineering Table Specific Tweaks --- */

/* Allow the text in the strategy column's data cells to wrap */
.data-table td.strategy-cell {
    white-space: normal;
    min-width: 350px;
    /* Give it enough space to wrap nicely */
    max-width: 400px;
}

/* Keep the strategy header itself from wrapping */
.data-table th.strategy-cell {
    white-space: nowrap;
}


/* === FOOTER & CHATBOT (Unchanged) === */
footer {
    background-color: transparent;
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 2rem;
}

.footer-logo {
    color: var(--primary);
    font-weight: 600;
}

.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000
}

.chatbot-toggle-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5c39ba 0%, #2b579f 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all .3s ease
}

.chatbot-toggle-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .4)
}

.chatbot-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 500px;
    background-color: #1d1e22;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all .3s cubic-bezier(.68, -.55, .27, 1.55)
}

.chatbot-panel.active {
    transform: scale(1);
    opacity: 1
}

.chatbot-header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 15px
}

.chatbot-header .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between
}

.close-button {
    background: transparent;
    color: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease
}

.close-button:hover {
    transform: scale(1.2)
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    background-color: #1d1e22;
    scrollbar-width: thin;
    scrollbar-color: #6a11cb #1d1e22
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #1d1e22
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background-color: #6a11cb;
    border-radius: 20px
}

.user-message,
.bot-message {
    max-width: 80%;
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: 18px;
    position: relative;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .1)
}

.user-message {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px
}

.bot-message {
    background-color: #2d2e36;
    color: #f0f0f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px
}

.message-content {
    margin-bottom: 5px
}

.message-time {
    font-size: 10px;
    color: rgba(255, 255, 255, .7);
    text-align: right
}

.chatbot-input {
    display: flex;
    padding: 12px;
    background-color: #2d2e36;
    border-top: 1px solid #3a3b45
}

.chatbot-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #3a3b45;
    border-radius: 24px;
    margin-right: 10px;
    background-color: #1d1e22;
    color: #f0f0f0;
    font-size: 14px;
    transition: all .3s ease
}

.chatbot-input input:focus {
    outline: none;
    border-color: #6a11cb;
    box-shadow: 0 0 0 2px rgba(106, 17, 203, .3)
}

.chatbot-input button {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .3s ease
}

.chatbot-input button:hover {
    transform: scale(1.1)
}

.chatbot-input button:disabled {
    background: #3a3b45;
    cursor: not-allowed;
    transform: scale(1)
}

/* === RESPONSIVENESS === */
@media (max-width: 1200px) {
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    .span-6 {
        grid-column: span 1;
    }

    .date-filter-group {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    main {
        padding: 1rem;
    }

    header {
        padding: 1rem;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

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

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}


.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background: radial-gradient(circle at center, rgba(50, 50, 60, 0.3), rgba(20, 20, 25, 0.8)),
        url('https://via.placeholder.com/1920x1080') center/cover no-repeat;
}

.login-card {
    background: rgba(31, 41, 55, 0.3);
    /* A semi-transparent dark gray/blue */
    backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid var(--border);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    position: relative;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.login-header {
    padding: 2rem 2rem 1.5rem;
    text-align: center;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.login-body {
    padding: 0 2rem 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group .form-input {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text);
    border: 1px solid var(--border);

    /* The padding fix is the same, but the selector is stronger */
    padding: 1rem 1rem 1rem 3rem;
    /* Top, Right, Bottom, Left */

    border-radius: 12px;
    font-size: 1rem;
    transition: all var(--transition-fast) ease;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    font-size: 0.85rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.remember-checkbox {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.checkbox-label {
    color: var(--text-muted);
    font-weight: 500;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-fast) ease;
}

.forgot-link:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-medium) ease;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.4);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.5);
    background: linear-gradient(135deg, var(--primary), var(--primary));
}

.error-message {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    padding-left: 0.5rem;
    font-weight: 500;
    display: none;
}

.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-3px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(3px, 0, 0);
    }
}

.logout-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-medium) ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    background-color: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* If using as nav link */
nav .logout-btn {
    color: var(--text-muted);
    background: transparent;
    border: none;
    margin-left: auto;
}

nav .logout-btn:hover {
    color: var(--danger);
    background-color: rgba(249, 65, 68, 0.1);
}

.admin-tabs {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    border-bottom: 2px solid #333;
}

.admin-tab {
    padding: 0.75rem 1.5rem;
    background: #2a2a2a;
    color: #e9e9e9;
    border: none;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-tab.active {
    background: linear-gradient(135deg, #6C63FF, #4CC9F0);
    color: white;
}

.admin-tab:hover:not(.active) {
    background: #3a3a3a;
}

.tab-content {
    display: none;
    padding: 2rem 0;
}

.tab-content.active {
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.form-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #e9e9e9;
    font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #e9e9e9;
    font-size: 0.95rem;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #6C63FF;
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.2);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #6C63FF, #4CC9F0);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
}

.btn-secondary {
    background: #444;
    color: #e9e9e9;
}

.btn-secondary:hover {
    background: #555;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.data-table {
    width: 100%;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #333;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #333;
    color: #e9e9e9;
}

.data-table th {
    background: #2a2a2a;
    font-weight: 600;
}

.data-table tr:hover {
    background: rgba(108, 99, 255, 0.1);
}

.data-table .action-cell {
    display: flex;
    flex-direction: row;
    /* Arrange side-by-side */
    gap: 0.5rem;
    align-items: center;
    /* Vertically align them */
    white-space: nowrap;
}

.btn-action {
    /* Layout & Sizing */
    display: inline-flex;
    /* Use inline-flex for perfect icon/text alignment */
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    /* Make the button smaller */
    height: 36px;
    /* Enforce a consistent height */

    /* Text & Font */
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    /* Prevent text from wrapping */

    /* Appearance */
    border: none;
    border-radius: 6px;
    /* Softer corners */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

/* Edit Button Specific Style (Primary Color) */
.btn-action.btn-edit {
    background-color: var(--primary, #6c63ff);
    color: white;
}

.btn-action.btn-edit:hover {
    background-color: var(--primary-dark, #5a52d1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

/* Delete Button Specific Style (Danger/Red Color) */
.btn-action.btn-delete {
    background-color: var(--danger, #ef4444);
    color: white;
}

.btn-action.btn-delete:hover {
    background-color: var(--danger-dark, #dc2626);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}


.ingredient-list {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.ingredient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin: 0.5rem 0;
    background: #1a1a1a;
    border-radius: 6px;
    border: 1px solid #444;
}

.ingredient-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.ingredient-inputs input {
    width: 80px;
    padding: 0.25rem 0.5rem;
}

.recipe-builder {
    border: 2px dashed #444;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 1rem 0;
}

.profit-indicator {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.profit-positive {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid #10b981;
}

.profit-negative {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.profit-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a1a;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #333;
}

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

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e9e9e9;
}

.close-modal {
    background: none;
    border: none;
    color: #999;
    font-size: 1.5rem;
    cursor: pointer;
}

.close-modal:hover {
    color: #e9e9e9;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #10b981;
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #ef4444;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid #f59e0b;
    color: #f59e0b;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #333;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.stat-label {
    color: #999;
    font-size: 0.9rem;
}

.loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
}

.search-box i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}


stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: #2a2a2a;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #333;
}

.stat-card i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.9rem;
    color: #999;
}

.profit-positive {
    color: #10B981;
    font-weight: bold;
}

.profit-warning {
    color: #F59E0B;
    font-weight: bold;
}

.profit-negative {
    color: #EF4444;
    font-weight: bold;
}


.tabs {
    display: flex;
    flex-wrap: wrap;
    /* Allows tabs to wrap on smaller screens */
    gap: 0.5rem;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* Subtle separator line */
}

/* Individual tab button styling */
.tab-button {
    /* Layout & Sizing */
    padding: 0.65rem 1.25rem;

    /* Text & Font */
    font-size: 0.9rem;
    font-weight: 500;
    color: #a0aec0;
    /* Lighter grey for inactive text */
    text-align: center;

    /* Appearance */
    background-color: transparent;
    /* Makes it feel integrated */
    border: 1px solid transparent;
    /* Keeps size consistent */
    border-radius: 8px;
    /* Softer corners */
    cursor: pointer;

    /* Smooth transition for hover effects */
    transition: all 0.2s ease-in-out;
}

/* Hover effect for inactive tabs */
.tab-button:hover {
    background-color: rgba(255, 255, 255, 0.05);
    /* Very subtle hover highlight */
    color: #e2e8f0;
    /* Slightly brighter text on hover */
}

/* Active tab styling */
.tab-button.active {
    /* Use your brand's primary color */
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    /* White text for contrast */
    box-shadow: 0 4px 14px 0 rgba(108, 99, 255, 0.3);
    /* Optional: a subtle glow for the active tab */
}

/* Optional: Add a focus style for accessibility */
.tab-button:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/*
   If you have icons inside your buttons, like:
   <button class="tab-button"><i class="fas fa-list"></i> Item Management</button>
   This CSS will add a nice spacing.
*/
.tab-button i {
    margin-right: 0.5rem;
}


.data-table tr.status-mismatch {
    background-color: rgba(239, 68, 68, 0.1);
    /* Subtle red highlight */
}

.data-table tr.status-no-data {
    color: #9ca3af;
    /* Grey out text for items with no data */
}


.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 4px 8px;
    max-width: 400px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.search-box:hover {
    border-color: #555;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-box:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgb(62, 39, 146);
}

.search-box i {
    color: #888;
    margin-right: 12px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.search-box:focus-within i {
    color: #007bff;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 400;
}

.search-box input::placeholder {
    color: #888;
    font-weight: 300;
}

.search-box input:focus::placeholder {
    color: #666;
}

/* Alternative darker variant */
.search-box.dark-variant {
    background-color: #1e1e1e;
    border-color: #333;
}

.search-box.dark-variant:hover {
    border-color: #444;
}

/* Alternative with subtle glow */
.search-box.glow {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.search-box.glow:focus-within {
    box-shadow: 0 0 0 2px rgba(255, 0, 128, 0.25), 0 4px 16px rgba(0, 123, 255, 0.1);
}


.matrix-filters-grid {
    display: grid;
    /* Create a flexible grid. The last column is only as wide as its content. */
    grid-template-columns: 1fr 1fr 2fr auto;
    align-items: end;
    /* Vertically align all items to the bottom */
    gap: 1.5rem;
    /* Space between all grid items */
    padding: 1.5rem 0;
}

/* A single filter group (label + input) */
.matrix-filters-grid .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Shared style for all labels */
.matrix-filters-grid .filter-group label {
    font-size: 0.875rem;
    /* 14px */
    font-weight: 500;
    color: var(--text-secondary, #a0aec0);
}

/* Styling for the scrollable outlets container */
.matrix-filters-grid .outlets-group .checkbox-container.scrollable {
    background-color: var(--background-secondary, #1c1c1c);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    padding: 0.75rem;
    height: 90px;
    /* Set a fixed height */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Placeholder text for when the checkbox list is empty */
.checkbox-item-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-style: italic;
    font-size: 0.9rem;
}

/* The 'Generate Report' button */
.matrix-filters-grid .action-group .apply-btn {
    width: 100%;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* A clean divider line */
hr.section-divider {
    border: none;
    height: 1px;
    background-color: var(--border-color, #333);
    margin: 1rem 0 2rem 0;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1024px) {
    .matrix-filters-grid {
        grid-template-columns: 1fr 1fr;
        /* Switch to a 2-column layout */
    }

    .matrix-filters-grid .outlets-group {
        grid-column: 1 / -1;
        /* Make outlets span the full width */
    }
}

@media (max-width: 768px) {
    .matrix-filters-grid {
        grid-template-columns: 1fr;
        /* Stack everything in a single column */
    }

    .matrix-filters-grid .outlets-group {
        grid-column: auto;
        /* Reset span */
    }
}

/* Custom scrollbar for a polished look (WebKit browsers like Chrome/Safari) */
.checkbox-container.scrollable::-webkit-scrollbar {
    width: 8px;
}

.checkbox-container.scrollable::-webkit-scrollbar-track {
    background: transparent;
}

.checkbox-container.scrollable::-webkit-scrollbar-thumb {
    background-color: var(--primary-dark, #4a4e69);
    border-radius: 10px;
    border: 2px solid var(--background-secondary, #1c1c1c);
}

.checkbox-container.scrollable::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary, #6c63ff);
}


/* Styling for the Generate Report button to align it nicely */
.matrix-filters .apply-btn {
    height: 100%;
    /* Make the button match the input height */
    align-self: flex-end;
    /* Push the button itself to the bottom of its container */
}

/* Add a clean divider line */
.matrix-filters+hr {
    border: none;
    height: 1px;
    background-color: var(--border-color, #333);
    margin: 1rem 0 2rem 0;
}


.table-container.scrollable-table {
    /* Set a maximum height for the table area */
    max-height: 450px;
    /* Adjust this value as needed */

    /* This is the magic part: add a vertical scrollbar when content overflows */
    overflow-y: auto;

    /* Ensures the container has its own positioning context */
    position: relative;
}

/* Make the table header (thead) "sticky" */
.scrollable-table thead th {
    position: sticky;
    top: 0;
    /* Stick to the top of the scrollable container */

    /* Set a background color to prevent text from showing through during scroll */
    background-color: var(--background-secondary, #1c1c1c);

    /* Add a subtle border to separate header from scrolling content */
    border-bottom: 2px solid var(--primary, #6c63ff);

    /* Ensure it appears above the scrolling body content */
    z-index: 10;
}


/* --- Custom Scrollbar Styling (for a premium feel) --- */
/* Works in WebKit browsers like Chrome, Safari, Edge */

.scrollable-table::-webkit-scrollbar {
    width: 10px;
    /* Width of the scrollbar */
}

.scrollable-table::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    /* A slightly visible track */
    border-radius: 10px;
}

.scrollable-table::-webkit-scrollbar-thumb {
    background-color: var(--primary-dark, #4a4e69);
    /* Color of the scroll handle */
    border-radius: 10px;
    border: 2px solid var(--background-secondary, #1c1c1c);
    /* Creates a nice padding effect */
}

.scrollable-table::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary, #6c63ff);
    /* Brighter color on hover */

}

.table-container.horizontal-scroll {
    overflow-x: auto;
    /* Optional: add a subtle shadow to indicate scrollability */
    -webkit-mask-image: linear-gradient(to right, transparent, black 20px, black 95%, transparent);
    mask-image: linear-gradient(to right, transparent, black 20px, black 95%, transparent);
}


.tenant-badge {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #a0aec0;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 1.5rem;
    white-space: nowrap;
}

.tenant-badge .verified-icon {
    color: #8688d4;
    /* A nice, vibrant green */
    font-size: 0.9rem;
    /* Keep the smaller size for the badge */

}

.slot-editor-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}

.slot-editor-row span {
    text-align: center;
    color: #999;
}


.outlet-global-actions {
    background-color: var(--background-secondary, #1c1c1c);
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color, #333);
}

.shared-url-input-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.shared-url-input-group input {
    flex-grow: 1;
}

/* New Grid Layout for each restaurant item */
.outlet-item-grid {
    display: grid;
    /* Create 3 columns: Info | URL Input | Actions */
    grid-template-columns: 1fr 2fr auto;
    gap: 1.5rem;
    align-items: center;
    /* Vertically center all items in the row */
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color, #333);
}

/* Last item in the list should not have a bottom border */
.outlet-item-grid:last-child {
    border-bottom: none;
    padding-bottom: 0.5rem;
}

/* Container for the restaurant name and location */
.outlet-info {
    display: flex;
    flex-direction: column;
}

.outlet-info strong {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text, #e9e9e9);
}

.outlet-info small {
    color: var(--text-muted, #999);
}

/* Container for the action buttons */
.outlet-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    /* Align buttons to the right of their cell */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .outlet-item-grid {
        /* Stack everything on top of each other on mobile */
        grid-template-columns: 1fr;
        gap: 1rem;
        align-items: stretch;
    }

    .outlet-actions {
        justify-content: flex-start;
        /* Align buttons to the left on mobile */
    }
}

.card-header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-tabs {
    display: flex;
    gap: 0.5rem;
    background-color: var(--input-bg);
    padding: 0.4rem;
    border-radius: 10px;
}