/* Nexora Food & GastroPub - Estilos Globais */
:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-sidebar: #0b0f19;
    --border: #334155;
    --border-light: #475569;
    
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --text-amber: #f59e0b;
    
    --amber-main: #f59e0b;
    --amber-hover: #d97706;
    --amber-light: rgba(245, 158, 11, 0.15);
    
    --emerald-main: #10b981;
    --emerald-light: rgba(16, 185, 129, 0.15);
    
    --rose-main: #f43f5e;
    --rose-light: rgba(244, 63, 94, 0.15);
    
    --blue-main: #3b82f6;
    --blue-light: rgba(59, 130, 246, 0.15);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.food-body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.food-header {
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    height: 64px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.btn-menu-mobile {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 6px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.brand-icon {
    font-size: 1.8rem;
}

.brand-name {
    font-weight: 800;
    font-size: 1.15rem;
    color: #fff;
    letter-spacing: -0.5px;
}

.brand-badge {
    background: var(--amber-light);
    color: var(--amber-main);
    border: 1px solid var(--amber-main);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
}

/* Top Quick Nav */
.header-quick-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
}

.quick-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.quick-link.active {
    background: var(--amber-light);
    color: var(--amber-main);
    border-color: var(--amber-main);
}

.quick-link.quick-highlight {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

/* User Pill */
.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.04);
    padding: 5px 12px;
    border-radius: 9999px;
    border: 1px solid var(--border);
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.role-administrador, .role-admin { background: #6366f1; color: #fff; }
.role-gerente { background: #d97706; color: #fff; }
.role-caixa { background: #059669; color: #fff; }
.role-garcom { background: #0284c7; color: #fff; }
.role-cozinha { background: #dc2626; color: #fff; }

.btn-logout {
    font-size: 1.2rem;
    text-decoration: none;
    padding: 6px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-logout:hover {
    opacity: 1;
}

/* Layout Grid */
.food-container {
    display: flex;
    flex: 1;
}

.food-sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    padding: 12px 10px 4px 10px;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.sidebar-nav > .nav-divider:first-child {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.nav-item.active {
    background: var(--amber-light);
    color: var(--amber-main);
}

.food-main {
    flex: 1;
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* UI Cards & Buttons */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--amber-main);
    color: #000;
}
.btn-primary:hover {
    background: var(--amber-hover);
}

.btn-success {
    background: var(--emerald-main);
    color: #fff;
}
.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--rose-main);
    color: #fff;
}
.btn-danger:hover {
    background: #e11d48;
}

.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Formulários */
input, select, textarea {
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--border);
    color: #fff;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--amber-main);
}

/* Alertas Flash */
.flash-messages-container {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.alert-close {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.7;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 4px;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.alert-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.alert-success { background: #064e3b; color: #a7f3d0; border: 1px solid #059669; }
.alert-error { background: #881337; color: #fecdd3; border: 1px solid #e11d48; }
.alert-warning { background: #78350f; color: #fde68a; border: 1px solid #d97706; }
.alert-info { background: #1e3a8a; color: #bfdbfe; border: 1px solid #3b82f6; }

/* Grid de Mesas */
.mesas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.mesa-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.mesa-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Estados da Mesa */
.mesa-livre {
    border-color: #10b981;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, var(--bg-card) 100%);
}
.mesa-livre .status-dot { background: #10b981; }

.mesa-ocupada {
    border-color: #f43f5e;
    background: linear-gradient(180deg, rgba(244, 63, 94, 0.12) 0%, var(--bg-card) 100%);
}
.mesa-ocupada .status-dot { background: #f43f5e; }

.mesa-conta {
    border-color: #f59e0b;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.15) 0%, var(--bg-card) 100%);
}
.mesa-conta .status-dot { background: #f59e0b; animation: pulse 1.5s infinite; }

.mesa-reservada {
    border-color: #3b82f6;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.1) 0%, var(--bg-card) 100%);
}
.mesa-reservada .status-dot { background: #3b82f6; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

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

.mesa-numero {
    font-size: 1.4rem;
    font-weight: 800;
}

.mesa-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.mesa-info {
    margin: 10px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.mesa-valor {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    margin-top: auto;
}

/* Modais */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.modal-backdrop.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(0,0,0,0.2);
}

/* Responsivo para celular do garçom */
@media (max-width: 900px) {
    .btn-menu-mobile {
        display: block;
    }

    .header-quick-nav {
        display: none;
    }

    .food-sidebar {
        position: fixed;
        top: 64px;
        bottom: 0;
        left: -260px;
        z-index: 99;
        transition: left 0.3s ease;
    }

    .food-sidebar.open {
        left: 0;
    }

    .mobile-nav-backdrop {
        display: none;
        position: fixed;
        top: 64px; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.6);
        z-index: 98;
    }

    .mobile-nav-backdrop.active {
        display: block;
    }

    .food-main {
        padding: 14px;
    }

    .mesas-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
}
