/* ============================================================================
   GREY CORNER — WAITER HUB STYLING (DARK LUXURY THEME)
   ============================================================================ */

:root {
    --bg: #0A0F1A;
    --card: #121A2A;
    --card-accent: #172237;
    --gold: #C9A84C;
    --gold-dark: #A48332;
    --sc-gold-light: #E2C97E;
    --text: #F8F9FA;
    --muted: rgba(240, 234, 216, 0.45);
    --border: rgba(201, 168, 76, 0.15);
    --success: #2ecc71;
    --alert: #e74c3c;
    --water: #3498db;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.02);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Helper scroll lock class */
.no-scroll {
    overflow: hidden;
}

/* ============================================================================
   1. WAITER LOGIN OVERLAY
   ============================================================================ */
.waiter-login-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #162035 0%, #0A0F1A 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.waiter-login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.login-card {
    background: rgba(18, 26, 42, 0.75);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    border-radius: 24px;
    width: 100%;
    max-width: 360px;
    padding: 36px 28px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 1px 1px rgba(201, 168, 76, 0.1);
}

.logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--gold);
}

.logo-subtext {
    font-family: 'DM Sans', sans-serif;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.3em;
    color: var(--muted);
    margin-top: 4px;
}

.login-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 8px;
}

.login-card p {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.4;
}

.login-select-wrapper {
    width: 100%;
    margin-bottom: 24px;
    position: relative;
}

.login-select-wrapper select {
    width: 100%;
    height: 48px;
    background: rgba(10, 15, 26, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #FFFFFF;
    font-family: 'Poppins', sans-serif;
    font-size: 0.92rem;
    padding: 0 16px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.2s;
}

.login-select-wrapper select:focus {
    border-color: var(--gold);
}

/* Arrow indicator for custom select */
.login-select-wrapper::after {
    content: "▼";
    font-size: 9px;
    color: var(--gold);
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.login-btn {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #0A0F1A;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(201, 168, 76, 0.25);
    transition: filter 0.2s, transform 0.2s;
    outline: none;
}

.login-btn:hover {
    filter: brightness(1.1);
}

.login-btn:active {
    transform: scale(0.98);
}

/* ============================================================================
   2. MAIN LAYOUT
   ============================================================================ */
.app-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
}

/* App Header */
.app-header {
    height: 64px;
    background: rgba(18, 26, 42, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.brand-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--gold);
}

.hub-badge {
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid var(--border);
    color: var(--sc-gold-light);
    font-family: 'DM Sans', sans-serif;
    font-size: 7.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

.active-profile-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: #FFFFFF;
}

.logout-icon-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    outline: none;
}

.logout-icon-btn:hover {
    background: rgba(255,255,255,0.05);
    color: var(--alert);
}

.logout-icon-btn svg {
    width: 18px;
    height: 18px;
}

/* --- Stats Bar --- */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 14px 16px;
}

.stat-card {
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 9px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1;
}

.stat-card.alert-state.pulse-active {
    border-color: rgba(231, 76, 60, 0.4);
    box-shadow: 0 0 12px rgba(231, 76, 60, 0.15);
    animation: statAlertPulse 1.5s infinite ease-in-out;
}

.stat-card.alert-state.pulse-active .stat-value {
    color: var(--alert);
}

.stat-card.order-state.pulse-active {
    border-color: rgba(201, 168, 76, 0.4);
}

.stat-card.order-state.pulse-active .stat-value {
    color: var(--sc-gold-light);
}

@keyframes statAlertPulse {
    0%, 100% { border-color: rgba(231, 76, 60, 0.2); }
    50% { border-color: rgba(231, 76, 60, 0.55); }
}

/* --- Hub Navigation Tabs --- */
.hub-tabs {
    display: flex;
    background: rgba(18, 26, 42, 0.4);
    border-top: 1px solid rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    height: 48px;
    position: sticky;
    top: 64px;
    z-index: 998;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    transition: all 0.24s ease;
    outline: none;
}

.tab-btn.active {
    color: var(--sc-gold-light);
    border-bottom-color: var(--gold);
    background: rgba(201, 168, 76, 0.03);
}

.tab-badge {
    background: var(--alert);
    color: #FFFFFF;
    font-family: 'Poppins', sans-serif;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.tab-btn.active .tab-badge {
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
}

/* --- Viewport Panels --- */
.hub-viewport {
    flex: 1;
    padding: 16px;
}

.tab-panel {
    display: none;
    animation: panelFade 0.25s ease-out;
}

.tab-panel.active {
    display: block;
}

@keyframes panelFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-section {
    margin-bottom: 24px;
}

.section-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    padding-left: 2px;
    border-left: 2px solid var(--gold);
    padding-left: 8px;
}

.feed-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================================================
   3. ALERTS & CALL CARDS DESIGN
   ============================================================================ */
.alert-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.25s;
}

/* Card pulsations depending on alert type */
.alert-card.call-pending {
    border-color: rgba(231, 76, 60, 0.25);
    animation: cardPulsePending 2s infinite ease-in-out;
}

@keyframes cardPulsePending {
    0%, 100% { border-color: rgba(231, 76, 60, 0.25); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
    50% { border-color: rgba(231, 76, 60, 0.55); box-shadow: 0 4px 16px rgba(231, 76, 60, 0.08); }
}

.alert-card.call-accepted {
    border-color: rgba(46, 204, 113, 0.35);
    background: rgba(18, 26, 42, 0.5);
}

/* Alert Top Row */
.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid var(--border);
    color: var(--gold);
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-card.call-accepted .table-circle {
    background: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.25);
    color: var(--success);
}

.request-badge {
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Custom request type colors */
.request-badge.badge-waiter {
    background: rgba(231, 76, 60, 0.12);
    color: var(--alert);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.request-badge.badge-water {
    background: rgba(52, 152, 219, 0.12);
    color: var(--water);
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.request-badge.badge-bill {
    background: rgba(46, 204, 113, 0.12);
    color: var(--success);
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.request-badge.badge-order {
    background: rgba(201, 168, 76, 0.12);
    color: var(--sc-gold-light);
    border: 1px solid rgba(201, 168, 76, 0.3);
}

.time-elapsed {
    font-size: 0.8rem;
    color: var(--muted);
}

/* Pre-orders list presentation inside cards */
.order-items-list {
    background: rgba(10, 15, 26, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 10px 14px;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.order-item-row:last-child {
    border-bottom: none;
}

.item-qty-lbl {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--sc-gold-light);
    margin-right: 8px;
}

.item-name-lbl {
    color: #FFFFFF;
}

.item-price-lbl {
    color: var(--muted);
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
}

.order-comments {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--sc-gold-light);
    font-style: italic;
    background: rgba(201, 168, 76, 0.05);
    border-left: 2px solid var(--gold);
    padding: 4px 10px;
    border-radius: 0 6px 6px 0;
}

.order-total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.order-total-price {
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    color: var(--gold);
}

/* Actions Row Buttons */
.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.card-actions button {
    flex: 1;
    height: 40px;
    border: none;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: filter 0.2s, opacity 0.2s, background 0.2s;
    outline: none;
}

.action-btn-accept {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #0A0F1A;
    box-shadow: 0 4px 10px rgba(201, 168, 76, 0.15);
}

.action-btn-accept:hover {
    filter: brightness(1.1);
}

.action-btn-complete {
    background: #27ae60;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.2);
}

.action-btn-complete:hover {
    background: #2ecc71;
}

.action-btn-claim {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08) !important;
    color: #FFFFFF;
}

.action-btn-claim:hover {
    background: rgba(255,255,255,0.1);
}

/* Accepted alert styling status indicator */
.accepted-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--success);
}

.mini-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: miniGlow 1.2s infinite ease-in-out;
}

@keyframes miniGlow {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
}

/* Unassigned card indicators */
.alert-card.unassigned-card {
    background: rgba(255,255,255,0.02);
    border: 1px dashed rgba(255,255,255,0.1);
}

.alert-card.unassigned-card .table-circle {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.06);
    color: var(--muted);
}

/* Empty State feeds */
.feed-empty-state {
    text-align: center;
    color: var(--muted);
    padding: 30px 10px;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.01);
    border: 1px dashed rgba(255,255,255,0.04);
    border-radius: 14px;
}

/* Responsive Grid columns for tablets/wider screens */
@media (min-width: 680px) {
    .stats-bar {
        max-width: 700px;
        margin: 0 auto;
    }
    .hub-tabs {
        max-width: 700px;
        margin: 0 auto;
        border-radius: 12px 12px 0 0;
    }
    .hub-viewport {
        max-width: 700px;
        margin: 0 auto;
        width: 100%;
    }
    .feed-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .panel-section.unassigned-section {
        grid-column: span 2;
    }
    .alert-card {
        justify-content: space-between;
    }
}
