/* ==========================================
   KitchenBoard (Pastry Dept) - Premium Dark Coffee & Gold Stylesheet
   ========================================== */

:root {
    --bg-coffee-dark: #0B0A09;      /* Dark roasted coffee bean black */
    --bg-coffee-card: #151312;      /* Medium charcoal coffee card */
    --bg-coffee-input: #1F1B1A;     /* Light coffee input background */
    --gold: #D4AF37;                /* High-contrast Gold */
    --gold-dim: #A8862A;            /* Muted Gold */
    --gold-glow: rgba(212, 175, 55, 0.15);
    --gold-border: rgba(212, 175, 55, 0.3);
    --text-white: #F5F5F7;          /* High readability white */
    --text-muted: #9C9896;          /* Muted coffee gray */
    --border-color: rgba(255, 255, 255, 0.08);
    
    /* Alerts & Labels */
    --alert-red: #EF4444;           /* Gluten-free / critical */
    --alert-orange: #F97316;        /* Nut-free / warning */
    --alert-yellow: #EAB308;        /* Vegan / caution */
    --green-ready: #10B981;         /* Ready status */
    --blue-info: #3B82F6;
    
    /* Font Outfit is imported in HTML */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-coffee-dark);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
    /* Soft coffee glow effect background */
    background-image:
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 0% 100%, rgba(139, 90, 43, 0.08) 0%, transparent 40%),
        linear-gradient(var(--bg-coffee-dark), var(--bg-coffee-dark));
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-coffee-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Animations */
@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-1 { animation: slideUpFade 0.4s var(--ease-out-expo) 0.05s both; }
.stagger-2 { animation: slideUpFade 0.4s var(--ease-out-expo) 0.10s both; }
.stagger-3 { animation: slideUpFade 0.4s var(--ease-out-expo) 0.15s both; }

/* Global Header Layout */
#main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background: #100E0D;
    border-bottom: 2px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

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

.main-logo {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-white);
}

.brand-subtitle {
    font-size: 0.7rem;
    color: var(--gold);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 600;
}

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

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.3s;
    border-radius: 6px;
}

.nav-btn:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.03);
}

.nav-btn.active {
    color: var(--gold);
    background: var(--gold-glow);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.header-right {
    display: flex;
    align-items: center;
}

.role-badge {
    background: var(--bg-coffee-input);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.3s;
}

.role-badge:hover {
    border-color: var(--gold);
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-panel {
    display: none;
}

.page-panel.active {
    display: block;
    animation: slideUpFade 0.5s var(--ease-out-expo) both;
}

.section-header {
    border-left: 4px solid var(--gold);
    padding-left: 0.8rem;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.5px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

/* Glassmorphic Panel Cards */
.panel-card {
    background: var(--bg-coffee-card);
    border: 1px solid var(--border-color);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    margin-bottom: 1.5rem;
}

/* ==========================================
   Module 1: Daily Board Row Layout
   ========================================== */
.daily-board-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.function-row {
    display: grid;
    grid-template-columns: 200px 1fr 180px; /* Time/Pax | Desserts/Badges | Actions */
    align-items: center;
    background: var(--bg-coffee-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--gold);
    border-radius: 10px;
    padding: 1.2rem 1.8rem;
    transition: all 0.3s var(--ease-out-expo);
    position: relative;
    gap: 1.5rem;
}

.function-row:hover {
    transform: translateX(4px);
    border-color: var(--gold-border);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.function-row.ready-status {
    border-left-color: var(--green-ready);
}

/* Header Left: Time & Pax Count */
.function-header-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.function-time {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1.1;
    letter-spacing: 0.5px;
}

.function-pax {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--gold);
    opacity: 0.95;
    margin-top: 0.1rem;
}

/* Body Center: Dessert list, NOT wrapping horizontally */
.function-body-center {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: hidden;
}

.dessert-item-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dessert-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-white);
}

/* Alert tags badges */
.dietary-badge-container {
    display: inline-flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.dietary-pill {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
}

.dietary-pill.gluten-free {
    background: rgba(239, 68, 68, 0.18);
    color: #FCA5A5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.dietary-pill.nut-free {
    background: rgba(249, 115, 22, 0.18);
    color: #FDBA74;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.dietary-pill.vegan {
    background: rgba(234, 179, 8, 0.18);
    color: #FDE047;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.dietary-pill.other {
    background: rgba(59, 130, 246, 0.18);
    color: #93C5FD;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Footer Bottom Left: Room & Event details */
.function-footer-left {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.function-room {
    color: var(--gold-dim);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.function-event-name {
    font-style: italic;
    opacity: 0.8;
}

/* Actions Right */
.function-actions-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.status-badge.prep {
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold);
    border: 1px solid var(--gold-border);
}

.status-badge.ready {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green-ready);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-white);
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(212, 175, 55, 0.05);
}

.btn-primary {
    background: var(--gold);
    color: var(--bg-coffee-dark);
    border: 1px solid var(--gold);
}

.btn-primary:hover {
    background: var(--text-white);
    color: var(--bg-coffee-dark);
    border-color: var(--text-white);
    box-shadow: 0 0 12px var(--gold-glow);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--alert-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

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

/* ==========================================
   Module 2: Weekly Input Split Screen
   ========================================== */
.split-screen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    min-height: 500px;
}

/* Left panel: BEO PDF simulator */
.beo-viewer-panel {
    background: #1C1917; /* Slate dark paper tone */
    border: 2px dashed rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.6);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.beo-viewer-panel.dragover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.05);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15), inset 0 2px 10px rgba(0,0,0,0.6);
    transform: scale(1.008);
}

/* Loading Overlay Mask */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(28, 25, 23, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    text-align: center;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loading-overlay .spinner {
    font-size: 3rem;
    animation: rotateSpinner 2.5s linear infinite;
    margin-bottom: 1rem;
    display: inline-block;
}

.loading-overlay .loading-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.4rem;
}

.loading-overlay .loading-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
}

@keyframes rotateSpinner {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.beo-doc-container {
    flex-grow: 1;
    background: #F5F4F0; /* Soft paper color */
    color: #1C1917;
    border-radius: 8px;
    padding: 1.5rem;
    font-size: 0.8rem;
    line-height: 1.4;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace; /* Typographic courier invoice look */
    border: 1px solid rgba(0,0,0,0.15);
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    position: relative;
}

.beo-header {
    text-align: center;
    border-bottom: 2px dashed #1C1917;
    padding-bottom: 0.8rem;
    margin-bottom: 1rem;
}

.beo-title {
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.beo-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #1C1917;
    padding-bottom: 0.6rem;
}

.beo-meta-item strong {
    font-weight: bold;
}

.beo-content-section {
    margin-bottom: 1rem;
}

.beo-section-title {
    font-weight: bold;
    text-decoration: underline;
    margin-bottom: 0.4rem;
}

.beo-line-item {
    margin-bottom: 0.3rem;
}

.beo-line-item.highlight-whitelisted {
    background: rgba(212, 175, 55, 0.25);
    border-left: 2px solid var(--gold-dim);
    padding-left: 4px;
}

.beo-line-item.ignored-line {
    opacity: 0.45;
    text-decoration: line-through;
}

.beo-stamp {
    position: absolute;
    top: 20px;
    right: 20px;
    border: 3px double #EF4444;
    color: #EF4444;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 4px 8px;
    transform: rotate(15deg);
    border-radius: 4px;
    text-transform: uppercase;
}

/* Right Panel: Auto populated review form */
.intake-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--gold);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    background: var(--bg-coffee-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: var(--gold);
}

.desserts-dynamic-array {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    background: rgba(0,0,0,0.15);
    padding: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.dessert-form-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.dessert-placeholder-select {
    border: 1px solid var(--alert-orange);
    box-shadow: 0 0 5px rgba(249, 115, 22, 0.4);
}

/* Scan Simulation Controls */
.preset-selector-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.scan-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    margin: 0.5rem 0;
}

.scan-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--gold);
    transition: width 0.1s linear;
}

/* ==========================================
   Module 3: Special Ordering Two Column Layout
   ========================================== */
.workbench-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 1.5rem;
}

/* Upcoming feed scroll */
.upcoming-functions-feed {
    max-height: 520px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-right: 0.4rem;
}

.feed-event-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.feed-event-card:hover, .feed-event-card.selected {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.03);
}

.feed-event-title {
    font-weight: 600;
    color: var(--text-white);
    font-size: 0.9rem;
}

.feed-event-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    display: flex;
    justify-content: space-between;
}

/* Output view section */
.checklist-output-card {
    margin-top: 2rem;
}

/* ==========================================
   Module 4: Data Admin Layout
   ========================================== */
.admin-tab-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.admin-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
}

.admin-tab-btn:hover {
    color: white;
}

.admin-tab-btn.active {
    color: var(--bg-coffee-dark);
    background: var(--gold);
}

.admin-tab-panel {
    display: none;
}

.admin-tab-panel.active {
    display: block;
}

/* Data Tables */
.admin-table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.admin-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--gold);
    font-weight: 600;
    padding: 0.8rem 1rem;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-white);
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* ==========================================
   Global Overlay Modal & Toasts
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-coffee-card);
    border: 1px solid var(--border-color);
    border-top: 2px solid var(--gold);
    border-radius: 12px;
    width: 90%;
    max-width: 580px;
    padding: 1.8rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s var(--ease-out-expo);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}

.modal-close-btn:hover {
    color: white;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-full {
    grid-column: span 2;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

/* Toast System */
#toast-box {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 300;
}

.toast {
    background: var(--bg-coffee-card);
    border: 1px solid var(--gold-border);
    border-left: 4px solid var(--gold);
    color: var(--text-white);
    padding: 0.8rem 1.4rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    animation: slideUpFade 0.3s var(--ease-out-expo) both;
}

.toast.success {
    border-left-color: var(--green-ready);
}

.toast.error {
    border-left-color: var(--alert-red);
}

/* Dynamic Countdown Styles */
.function-countdown {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0.2rem 0;
    transition: color 0.3s;
}

.function-countdown.urgent {
    color: var(--alert-orange);
    font-weight: bold;
    animation: pulseText 1.5s infinite;
}

.function-countdown.overdue {
    color: var(--alert-red);
    font-weight: bold;
}

@keyframes pulseText {
    0% { opacity: 0.85; }
    50% { opacity: 1; }
    100% { opacity: 0.85; }
}

