/* ============================================
   RESET E BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Paleta MCD Food - Teal + Laranja */
    --primary: #099695;        /* Teal principal */
    --primary-light: #0cb5b4;  /* Teal claro */
    --primary-dark: #076e6d;   /* Teal escuro */
    --secondary: #082526;      /* Teal muito escuro (header/bg) */
    --accent: #F0A71E;         /* Laranja/amber (CTAs, destaques) */
    --accent-dark: #d48f15;    /* Laranja escuro */
    
    --success: #4CAF50;
    --danger: #c0392b;
    --warning: #F0A71E;        /* Amarelo/laranja do logo */
    --info: #224546;           /* Teal info */
    
    --light: #f0f7f7;          /* Fundo claro com tom teal */
    --dark: #082526;           /* Texto escuro teal */
    --border: #b8d8d8;         /* Borda teal claro */
    
    /* Backgrounds */
    --bg-gradient: linear-gradient(135deg, #041213 0%, #082526 50%, #041213 100%);
    --bg-card: #f8fcfc;        /* Cards com tom levemente teal */
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 12px rgba(8, 37, 38, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

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

.header-logo {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
}

.header h1 {
    font-size: 24px;
    color: var(--accent);
}

.btn-logout {
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-logout:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* ============================================
   CONTAINER PRINCIPAL
   ============================================ */
.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

/* ============================================
   ESTATÍSTICAS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(45, 24, 16, 0.1);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(45, 24, 16, 0.2);
    border-color: var(--primary-light);
}

.stat-icon {
    font-size: 40px;
    opacity: 0.8;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    gap: 10px;
    background: var(--bg-card);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(45, 24, 16, 0.1);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--info);
    white-space: nowrap;
    transition: all 0.3s;
}

.tab:hover {
    background: var(--accent);
    color: var(--secondary);
}

.tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tab-content {
    display: none;
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(45, 24, 16, 0.1);
    border: 1px solid var(--border);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.tab-header h2 {
    font-size: 24px;
    color: var(--dark);
}

/* ============================================
   FILTROS
   ============================================ */
.filtros {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filtros select,
.filtros input {
    padding: 10px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    min-width: 200px;
}

.filtros select:focus,
.filtros input:focus {
    outline: none;
    border-color: var(--primary);
}

.checkbox-filtro {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #e3f2fd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #1976d2;
    user-select: none;
    transition: background 0.2s;
}

.checkbox-filtro:hover {
    background: #bbdefb;
}

.checkbox-filtro input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================================
   BOTÕES
   ============================================ */
.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--accent-dark);
    color: var(--secondary);
}

.btn-success {
    background: var(--success);
    color: white;
}

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

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-primary:hover, .btn-secondary:hover, .btn-success:hover, 
.btn-danger:hover, .btn-warning:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-primary:active, .btn-secondary:active, .btn-success:active,
.btn-danger:active, .btn-warning:active {
    transform: translateY(0);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* ============================================
   LISTA DE ITEMS
   ============================================ */
.lista-items {
    display: grid;
    gap: 15px;
}

.item-card {
    background: var(--light);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: all 0.3s;
}

.item-card:hover {
    background: #e8e8e8;
}

.item-foto {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.item-info {
    flex: 1;
}

.item-titulo {
    font-size: 18px;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 5px;
}

.item-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.item-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.tag-categoria {
    background: var(--primary);
    color: white;
}

.tag-status {
    background: var(--success);
    color: white;
}

.tag-status.indisponivel {
    background: #999;
}

.tag-promo {
    background: var(--warning);
    color: white;
}

.tag-vegetariano {
    background: #8BC34A;
    color: white;
}

.tag-vegano {
    background: #4CAF50;
    color: white;
}

.tag-sem-gluten {
    background: #FFC107;
    color: white;
}

.tag-apimentado {
    background: #f44336;
    color: white;
}

.item-preco {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 10px;
}

.preco-promo {
    text-decoration: line-through;
    color: #999;
    font-size: 16px;
    margin-left: 10px;
}

.item-acoes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================
   LISTA DE MESAS
   ============================================ */
.lista-mesas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.mesa-card {
    background: var(--light);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s;
}

.mesa-card.inativa {
    opacity: 0.6;
    background: #f5f5f5;
}

.mesa-card:hover {
    background: #e8e8e8;
    transform: translateY(-3px);
}

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

.mesa-numero {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary);
}

.mesa-capacidade {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.mesa-obs {
    font-size: 12px;
    color: #999;
    font-style: italic;
    margin: 10px 0;
}

.tag-disponivel {
    background: #4caf50;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
    margin-bottom: 10px;
}

.tag-indisponivel {
    background: #f44336;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
    margin-bottom: 10px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #4caf50;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.mesa-acoes {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(45, 24, 16, 0.3);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.modal-header h2 {
    font-size: 22px;
    color: var(--dark);
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.btn-close:hover {
    background: var(--light);
    color: var(--dark);
}

.modal form {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 2px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ============================================
   FORMULÁRIOS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 69, 19, 0.15);
}

textarea {
    resize: vertical;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

input[type="file"] {
    padding: 8px;
    border: 2px dashed var(--border);
}

.required {
    color: var(--danger);
}

small {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tags-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.tags-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    margin-bottom: 0;
}

/* ============================================
   PREVIEW DE FOTOS
   ============================================ */
.preview-foto {
    margin-top: 10px;
    display: none;
}

.preview-foto.active {
    display: block;
}

.preview-foto img {
    width: 100%;
    max-width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border);
}

/* ============================================
   SELEÇÃO DE MESAS/ADJACENTES
   ============================================ */
.selecao-mesas,
.selecao-adjacentes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.mesa-checkbox {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.mesa-checkbox:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 53, 0.05);
}

.mesa-checkbox.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.mesa-checkbox input {
    display: none;
}

/* ============================================
   OVERLAY
   ============================================ */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* ============================================
   LOADING
   ============================================ */
.loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.loading.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--light);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   RESPONSIVIDADE
   ============================================ */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .tab {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .item-card {
        flex-direction: column;
    }
    
    .item-foto {
        width: 100%;
        height: 200px;
    }
    
    .modal-content {
        margin: 10px;
    }
    
    .lista-mesas {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* ============================================
   UTILITÁRIOS
   ============================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* ============================================
   MODAL ADJACÊNCIAS
   ============================================ */

.modal-wide {
    max-width: 800px;
}

.adjacencias-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
}

.adjacencias-info p {
    margin: 0;
    color: #1976d2;
}

.grid-adjacencias {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.card-mesa-adjacencia {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.card-mesa-adjacencia:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-mesa-adjacencia.selecionada {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.card-mesa-adjacencia.mesa-atual {
    background: #f5f5f5;
    border-color: #bdbdbd;
    border-width: 3px;
    cursor: default;
}

.card-mesa-adjacencia.mesa-atual:hover {
    transform: none;
}

.mesa-numero-grande {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
}

.mesa-capacidade {
    font-size: 14px;
    opacity: 0.8;
}

.card-mesa-adjacencia.selecionada .mesa-capacidade {
    opacity: 1;
}

.card-mesa-adjacencia .check-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    display: none;
}

.card-mesa-adjacencia.selecionada .check-icon {
    display: block;
}

.mesa-atual-badge {
    background: #757575;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 8px;
    display: inline-block;
}

/* ============================================
   SUGESTÃO DE MESAS (RESERVAS)
   ============================================ */

.sugestao-mesas-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 15px;
}

.aviso-disponibilidade {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    color: #856404;
    text-align: center;
}

.aviso-disponibilidade strong {
    color: #664d03;
}

.info-sugestao {
    flex: 1;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

.info-sugestao.show {
    display: block;
}

.info-sugestao.success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 3px solid #4caf50;
}

.info-sugestao.warning {
    background: #fff3e0;
    color: #e65100;
    border-left: 3px solid #ff9800;
}

.info-sugestao.error {
    background: #ffebee;
    color: #c62828;
    border-left: 3px solid #f44336;
}

/* ========================================
   VISUALIZAÇÃO DE MESAS - TOGGLE
======================================== */

.view-toggle {
    display: flex;
    gap: 8px;
    margin: 15px 0 10px 0;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.toggle-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: none;
    position: relative;
    top: 2px;
}

.toggle-btn:hover {
    background: #f5f5f5;
    border-color: #bdbdbd;
}

.toggle-btn.active {
    background: #ff5722;
    color: white;
    border-color: #ff5722;
}

/* ========================================
   TABELA COMPACTA DE MESAS
======================================== */

.tabela-mesas-container {
    margin-top: 15px;
}

.tabela-controles {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    margin-bottom: 15px;
}

.tabela-controles input[type="text"] {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.tabela-controles select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.tabela-wrapper {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.tabela-mesas-compacta {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.tabela-mesas-compacta thead {
    position: sticky;
    top: 0;
    background: #f5f5f5;
    z-index: 10;
}

.tabela-mesas-compacta th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
    font-size: 14px;
}

.tabela-mesas-compacta tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.tabela-mesas-compacta tbody tr:hover {
    background: #f9f9f9;
}

.tabela-mesas-compacta tbody tr.ocupada {
    opacity: 0.5;
    background: #fafafa;
}

.tabela-mesas-compacta tbody tr.ocupada:hover {
    background: #f5f5f5;
}

.tabela-mesas-compacta tbody tr.sugerida {
    background: #fff9c4;
}

.tabela-mesas-compacta tbody tr.sugerida:hover {
    background: #fff59d;
}

.tabela-mesas-compacta tbody tr.selecionada {
    background: #e3f2fd;
}

.tabela-mesas-compacta td {
    padding: 12px;
    font-size: 14px;
}

.tabela-mesas-compacta td input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.tabela-mesas-compacta td input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.badge-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-sugerida {
    background: #fbc02d;
    color: #000;
}

.badge-disponivel {
    background: #4caf50;
    color: white;
}

.badge-ocupada {
    background: #9e9e9e;
    color: white;
}

.info-selecao-tabela {
    margin-top: 15px;
    padding: 12px;
    background: #e3f2fd;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.info-selecao-tabela strong {
    color: #1976d2;
}

/* ========================================
   FIM TABELA COMPACTA
======================================== */


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

.grid-aviso-inicial {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 2px dashed #ff9800;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.grid-aviso-inicial .icone-aviso {
    font-size: 48px;
    margin-bottom: 15px;
}

.grid-aviso-inicial h3 {
    color: #e65100;
    margin: 0 0 15px 0;
    font-size: 20px;
}

.grid-aviso-inicial p {
    color: #bf360c;
    margin: 10px 0;
    line-height: 1.6;
}

.grid-aviso-inicial .aviso-secundario {
    font-size: 14px;
    color: #6d4c41;
    margin-top: 15px;
}

.mesa-checkbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.mesa-checkbox:hover {
    border-color: #bdbdbd;
    background: #fafafa;
}

.mesa-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.mesa-checkbox input[type="checkbox"]:checked + div {
    font-weight: bold;
}

.mesa-checkbox.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.mesa-checkbox.sugerida {
    background: #fff9c4;
    border-color: #fbc02d;
    animation: pulse-suggestion 2s ease-in-out;
}

.mesa-checkbox.sugerida::after {
    content: "✨ SUGERIDA";
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 9px;
    background: #fbc02d;
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

.mesa-checkbox.indisponivel {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f5f5f5;
}

.mesa-checkbox.indisponivel::after {
    content: "OCUPADA";
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 9px;
    background: #f44336;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

@keyframes pulse-suggestion {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ============================================
   RESERVATION DETAILS
   ============================================ */

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #e8f5e9;
    border: 1px solid #4caf50;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-label:hover {
    background: #c8e6c9;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 15px;
    font-weight: 500;
    color: #2e7d32;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

#container-idades-criancas {
    padding: 15px;
    background: #fff3e0;
    border: 1px solid #ff9800;
    border-radius: 8px;
    margin-bottom: 15px;
}

#container-idades-criancas .form-row {
    margin-bottom: 0;
}

/* ============================================
   BOTÕES DE STATUS DE PEDIDOS
   ============================================ */

.status-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    margin-top: 10px;
}

.btn-status {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid;
    font-weight: 500;
    white-space: nowrap;
}

.btn-status:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    opacity: 0.9;
}

.btn-status:disabled {
    cursor: default;
    transform: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Responsivo - botões menores em mobile */
@media (max-width: 600px) {
    .status-buttons {
        gap: 6px;
    }
    
    .btn-status {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ============================================
   MODAL DE DETALHES DO PEDIDO
   ============================================ */

.modal-large {
    max-width: 700px;
    width: 95%;
}

.modal-header {
    display: flex;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    flex: 1;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0 10px;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 2px solid var(--border);
    margin-top: 20px;
    flex-wrap: wrap;
}

.pedido-section {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.pedido-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: var(--dark);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.pedido-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

.info-item span {
    font-size: 14px;
    color: var(--dark);
}

.info-item input,
.info-item textarea,
.info-item select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
}

.info-item textarea {
    resize: vertical;
    min-height: 60px;
}

/* Tabela de itens */
.tabela-itens {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tabela-itens th,
.tabela-itens td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.tabela-itens th {
    background: #f0f0f0;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.tabela-itens tfoot td {
    border-top: 2px solid var(--dark);
    background: #f9f9f9;
}

.obs-row td {
    background: #fff9e6;
    color: #856404;
    font-style: italic;
    padding: 5px 8px;
}

/* Botões de quantidade mini */
.btn-qtd-mini {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-qtd-mini:hover {
    background: var(--light);
}

.item-qtd-display {
    min-width: 20px;
    text-align: center;
    font-weight: bold;
}

.btn-remover-item {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
}

.btn-remover-item:hover {
    opacity: 1;
}

/* Responsivo */
@media (max-width: 600px) {
    .modal-large {
        max-height: 90vh;
    }
    
    .modal-body {
        max-height: 50vh;
    }
    
    .pedido-info-grid {
        grid-template-columns: 1fr;
    }
    
    .tabela-itens {
        font-size: 12px;
    }
    
    .tabela-itens th,
    .tabela-itens td {
        padding: 8px 5px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
}


/* ============================================
   PAINEL DE DISPONIBILIDADE DE MESAS
   ============================================ */

.painel-disponibilidade {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.painel-disponibilidade h3 {
    margin-bottom: 15px;
    color: #333;
}

.filtros-disponibilidade {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filtros-disponibilidade .form-group {
    margin: 0;
}

.filtros-disponibilidade label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.filtros-disponibilidade input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.legenda-mesas {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 13px;
}

.legenda-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legenda-cor {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legenda-cor.livre {
    background: #4CAF50;
}

.legenda-cor.ocupada {
    background: #f44336;
}

.legenda-cor.inativa {
    background: #9e9e9e;
}

.mapa-mesas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.mesa-card {
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mesa-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mesa-card.livre {
    border-color: #4CAF50;
    background: #e8f5e9;
}

.mesa-card.ocupada {
    border-color: #f44336;
    background: #ffebee;
}

.mesa-card.inativa {
    border-color: #9e9e9e;
    background: #f5f5f5;
    opacity: 0.6;
    cursor: not-allowed;
}

.mesa-numero {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.mesa-capacidade {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.mesa-status {
    font-size: 11px;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.mesa-card.livre .mesa-status {
    background: #4CAF50;
    color: white;
}

.mesa-card.ocupada .mesa-status {
    background: #f44336;
    color: white;
}

.mesa-card.inativa .mesa-status {
    background: #9e9e9e;
    color: white;
}

.info-reserva-mesa {
    margin-top: 20px;
    padding: 15px;
    background: #fff3e0;
    border: 1px solid #FF9800;
    border-radius: 8px;
}

.info-reserva-mesa h4 {
    margin: 0 0 10px 0;
    color: #e65100;
}

.info-reserva-mesa p {
    margin: 5px 0;
    font-size: 14px;
}

@media (max-width: 600px) {
    .filtros-disponibilidade {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filtros-disponibilidade .form-group {
        width: 100%;
    }
    
    .mapa-mesas {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .mesa-card {
        padding: 10px;
        min-height: 80px;
    }
    
    .mesa-numero {
        font-size: 22px;
    }
}
/* Pacotes de reserva */
.pacote-config {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.pacote-config .form-row {
    margin-bottom: 10px;
}

.pacote-config .form-group {
    margin-bottom: 10px;
}

/* Dias de funcionamento */
.dias-semana-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dia-semana-check {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.dia-semana-check:hover {
    border-color: #FF6B35;
}

.dia-semana-check input {
    margin-bottom: 5px;
}

.dia-semana-check input:checked + span {
    color: #FF6B35;
    font-weight: bold;
}

.dia-semana-check:has(input:checked) {
    border-color: #FF6B35;
    background: #fff3e0;
}

/* Fechamento temporário */
.fechamento-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fechamento-badge {
    background: #e0e0e0;
    color: #666;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.2s;
}

.fechamento-toggle input:checked + .fechamento-badge {
    background: #f44336;
    color: white;
}

#fechamento-detalhes {
    margin-top: 15px;
    padding: 15px;
    background: #ffebee;
    border-radius: 8px;
    border: 1px solid #f44336;
}

/* ============================================
   DATEPICKER (Flatpickr)
   ============================================ */
.datepicker-br {
    max-width: 160px;
    min-width: 130px;
    cursor: pointer;
}

/* Nos filtros, datepicker pode ser menor */
.filtros .datepicker-br,
.filtro-grupo .datepicker-br {
    max-width: 140px;
}

/* Modal de reserva - campos mais compactos */
#modal-reserva .form-row {
    grid-template-columns: repeat(auto-fit, minmax(140px, 200px));
    justify-content: start;
}

#modal-reserva .form-row:nth-child(2) {
    grid-template-columns: repeat(3, minmax(100px, 150px));
}

#form-reserva .datepicker-br {
    max-width: 100%;
    width: 100%;
}

/* Calendário do Flatpickr - garantir que flutue acima de tudo */
.flatpickr-calendar {
    font-family: inherit;
    z-index: 99999 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.flatpickr-calendar.open {
    z-index: 99999 !important;
}

.flatpickr-day.selected {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.flatpickr-day:hover {
    background: rgba(255, 107, 53, 0.1);
}

/* Item selecionado */
.item-card.item-selecionado {
    background: linear-gradient(135deg, #f9f3eb 0%, #f5efe8 100%);
    border: 2px solid #5a3921;
}


/* ============================================
   CAIXA/PDV
   ============================================ */
.caixa-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    background: var(--bg-card);
    font-size: 13px;
}
.caixa-stat .num { font-weight: 700; font-size: 16px; }
.caixa-stat.total { background: var(--primary); color: #fff; }

.caixa-filtro {
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: transparent;
    color: #888;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.caixa-filtro.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.caixa-filtro .badge { background: rgba(0,0,0,0.15); padding: 1px 6px; border-radius: 8px; font-size: 10px; margin-left: 4px; }

.caixa-pedido {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}
.caixa-pedido.urgente { border-left: 3px solid #FF9800; }
.caixa-pedido-top { padding: 12px; display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.caixa-pedido-id { font-weight: 700; font-size: 14px; }
.caixa-pedido-tipo { font-size: 10px; padding: 2px 8px; border-radius: 8px; font-weight: 600; text-transform: uppercase; color: #fff; display: inline-block; }
.caixa-pedido-meta { font-size: 12px; color: #888; margin-top: 4px; }
.caixa-pedido-total { font-size: 18px; font-weight: 700; color: var(--accent); white-space: nowrap; }

.caixa-pedido-acoes { padding: 8px 12px; border-top: 1px solid var(--border); display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.caixa-status-btn {
    font-size: 11px; padding: 4px 8px; border-radius: 6px; font-weight: 600; cursor: pointer;
    border: none; font-family: 'Poppins', sans-serif; opacity: 0.45; transition: opacity 0.15s;
}
.caixa-status-btn:hover { opacity: 0.75; }
.caixa-status-btn.current { opacity: 1; box-shadow: 0 0 0 2px var(--primary); }

.caixa-pedido-extra { padding: 8px 12px; border-top: 1px solid var(--border); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.caixa-mini-select { padding: 4px 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; color: var(--dark); font-family: 'Poppins', sans-serif; font-size: 11px; }
.caixa-mini-btn { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-card); font-family: 'Poppins', sans-serif; font-size: 11px; cursor: pointer; }
.caixa-mini-btn:hover { border-color: var(--primary); }
.caixa-mini-btn.print { color: var(--accent); border-color: var(--accent); }

/* Print */
#print-area { display: none; }
@media print {
    @page { margin: 0; }
    html, body { margin: 0 !important; padding: 0 !important; width: auto !important; height: auto !important; }
    body > * { display: none !important; }
    #print-area { display: block !important; position: static !important; width: 72mm; font-family: 'Courier New', monospace; font-size: 13px; font-weight: 600; color: #000 !important; background: #fff !important; padding: 4mm; margin: 0; }
    #print-area * { color: #000 !important; visibility: visible !important; }
    #print-area .print-header { text-align: center; border-bottom: 1px dashed #000; padding-bottom: 4px; margin-bottom: 6px; }
    #print-area .print-title { font-weight: bold; font-size: 15px; }
    #print-area .print-line { display: flex; justify-content: space-between; padding: 1px 0; font-weight: 600; }
    #print-area .print-sep { border-top: 1px dashed #000; margin: 4px 0; }
    #print-area .print-total { font-weight: bold; font-size: 15px; }
    #print-area .print-obs { font-style: italic; font-size: 12px; font-weight: 600; margin-top: 4px; }
    #print-area .print-footer { text-align: center; margin-top: 8px; font-size: 11px; font-weight: 600; }
}
