@import url('https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css');

/* Força largura total para containers do Bootstrap */
.container, .container-fluid {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 15px;
    padding-right: 15px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: sans-serif; 
    background: #f4f7f6; 
    margin: 0; 
    padding: 0;
    overflow-x: hidden;
}

/* --- CABEÇALHO ADMINISTRATIVO --- */
.admin-header { 
    background: white; 
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin: -20px -15px 20px -15px; /* Margem negativa ajustada para novo padding */
    padding: 0;
    border-radius: 0;
    display: block;
    position: sticky; /* Garante que fique fixa ao rolar */
    top: 0; /* Cola no topo */
    z-index: 990; /* Fica acima do conteúdo da página */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* Sombra para efeito "suspenso" */
}

.admin-header-top {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 10px 15px; /* Alinhado com o conteúdo da página */
    border-bottom: 1px solid #eee;
}

/* --- MENU SUPERIOR (Estilo Ribbon) --- */
.admin-header-menu {
    display: flex;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 15px; /* Alinhamento com o resto */
    font-size: 14px;
    gap: 2px;
    justify-content: center; /* Centraliza os menus */
}

.admin-menu-item {
    position: relative;
}

.admin-menu-link {
    display: block;
    padding: 8px 15px;
    color: #444;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    transition: background 0.2s;
}

.admin-menu-link:hover {
    background: #f1f1f1;
    color: #000;
    border-radius: 4px 4px 0 0;
}

/* Submenu Dropdown */
.admin-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    border: 1px solid #ccc;
    min-width: 200px;
    z-index: 1000;
    border-radius: 0 4px 4px 4px;
}

.admin-menu-item:hover .admin-submenu {
    display: block;
}

.admin-submenu a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}

.admin-submenu a:hover {
    background: #f8f9fa;
    color: #2c3e50;
    padding-left: 20px; /* Efeito visual */
    transition: padding 0.2s;
}

/* Ajuste para a busca global */
#resultados-busca-global a {
    cursor: pointer;
}

.admin-header-toolbar {
    display: flex;
    gap: 5px;
    padding: 5px 15px; /* Alinhado com o conteúdo da página */
    background: #f8f9fa;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto; /* Garante scroll em telas pequenas */
}

.toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    color: #555;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75em;
    text-decoration: none;
    transition: all 0.2s;
    min-width: 70px;
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #2c3e50;
}

.toolbar-btn button {
    color: var(--text-main) !important; /* Força a cor do texto do tema */
    border-color: var(--border);
}

.toolbar-btn i {
    font-size: 1.4em;
    margin-bottom: 4px;
    color: #2c3e50;
}

/* --- CALCULADORA --- */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}
.calc-grid button {
    padding: 15px;
    font-size: 1.2em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #34495e;
    color: white;
}
.calc-grid button:hover { background: #2c3e50; }
.calc-grid button.op { background: #e67e22; }
.calc-grid button.equal { background: #27ae60; }
.calc-grid button.clear { background: #c0392b; }

.grid-chamados {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

/* --- DASHBOARD CARDS (KPIs) --- */
.cards { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 20px; 
    margin-bottom: 30px; 
}
.card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.card h3 { margin: 0; color: #7f8c8d; font-size: 14px; }
.card p { font-size: 24px; font-weight: bold; margin: 10px 0 0; }

/* Painéis lado a lado (Chamados e Cozinha) */
.dashboard-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* --- CARD DE CHAMADO (GARÇOM) --- */
.card-chamado {
    background: white;
    border-left: 8px solid #e67e22; /* Laranja para atenção */
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: flash 1s;
}

.mesa-numero { font-size: 1.5em; font-weight: bold; color: #2c3e50; }
.motivo-texto { font-size: 1.1em; margin: 10px 0; color: #333; }
.hora { font-size: 0.8em; color: #999; }

.btn-atender {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}

@keyframes flash {
    from { background: #fff3e0; }
    to { background: white; }
}






/* --- ITENS DE PEDIDO E STATUS --- */
.chamado-item {
    background: #fff9f4;
    border: 1px solid #ffe0b2;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pedido-item {
    background: #f4fff8;
    border: 1px solid #c8e6c9;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}
.btn-ok { background: #27ae60; color: white; border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; }
.status-badge { padding: 3px 8px; border-radius: 12px; font-size: 12px; font-weight: bold; }
.status-pendente { background: #ffeaa7; color: #d35400; }
.status-preparando { background: #81ecec; color: #008b8b; }






/****************************************************/
/* --- MONITOR DE COZINHA E BAR (KDS) --- */

.pedido-card {
    background: #ffffff;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 6px solid #3498db; /* Azul para Pendente */
    transition: transform 0.2s ease;
}

/* Estado quando o item entra em preparo */
.pedido-card.em-preparo {
    border-left-color: #f1c40f; /* Amarelo */
    background: #fffdf5;
}

.pedido-header {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 12px;
    display: block;
}

.produto-nome {
    color: #2980b9;
    text-transform: uppercase;
}

/* Container dos botões */
.pedido-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Estilo Base dos Botões */
.btn-cozinha {
    border: none;
    padding: 10px 14px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.btn-preparar { background-color: #f1c40f; color: #000; }
.btn-entregue { background-color: #27ae60; color: #fff; }
.btn-cancelar { background-color: #e74c3c; color: #fff; }

/* Feedback Visual de Hover */
.btn-cozinha:hover:not(:disabled) {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.btn-cancelar {
    background-color: #e74c3c;
    color: #fff;
    cursor: pointer;
    opacity: 1; /* Garante que ele pareça ativo */
}

.btn-cancelar:hover {
    background-color: #c0392b;
}
/***********************************************************************/



.pedido-header {
    display: block; /* Garante que o texto ocupe a linha toda */
    font-size: 15px;
    margin-bottom: 8px; /* Aumenta o espaço entre texto e botões */
}

.status-atual {
    display: block;
    margin-bottom: 20px; /* Isso empurra os botões para baixo */
    font-style: italic;
    color: #666;
}

.pedido-acoes {
    margin-top: auto; /* Garante que fiquem no final do card */
    display: flex;
    gap: 8px;
}


/* --- RESPONSIVIDADE GERAL --- */
@media (max-width: 768px) {
    /* Ajuste para grids no mobile */
    .grid-chamados, .cards {
        grid-template-columns: 1fr; /* Uma coluna por vez */
    }

    .dashboard-panels {
        grid-template-columns: 1fr;
    }

    /* Tabelas com scroll horizontal */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* --- TELA DE LOGIN --- */
.login-body { background: #ecf0f1; display: flex; align-items: center; justify-content: center; height: 100vh; padding: 0; }
.login-container {
    background: white;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    text-align: center;
}
.login-container h2 { color: #2c3e50; margin-bottom: 20px; }
.login-input { width: 100%; padding: 12px; margin: 10px 0; border: 1px solid #ddd; border-radius: 5px; box-sizing: border-box; font-size: 16px; }
.btn-login { width: 100%; padding: 12px; background: #2980b9; color: white; border: none; border-radius: 5px; font-size: 16px; font-weight: bold; cursor: pointer; margin-top: 10px; transition: background 0.3s; }
.password-wrapper {
    position: relative;
    width: 100%;
    margin: 10px 0; /* Pega a margem que antes era do input */
}
.password-wrapper .login-input {
    margin: 0; /* Reseta a margem do input para evitar duplicidade */
    padding-right: 45px; /* Cria um espaço à direita para o ícone */
}
.toggle-password-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
}
.btn-login:hover { background: #2471a3; }
.login-link { display: block; margin-top: 15px; color: #7f8c8d; text-decoration: none; }
.login-link:hover { color: #2980b9; text-decoration: underline; }
.alert-box { padding: 10px; border-radius: 5px; margin-bottom: 15px; font-size: 0.9em; }
.alert-error { background: #ffeded; color: #c0392b; border: 1px solid #e74c3c; }
.alert-success { background: #e8f8f5; color: #27ae60; border: 1px solid #2ecc71; }

/* --- MAPA DE MESAS (VISUALIZAÇÃO) --- */
.grid-mesas { 
    display: grid !important; 
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Responsivo e lado a lado */
    gap: 15px; 
    margin-top: 15px;
    width: 100%;
}

.mesa-box { 
    padding: 10px; 
    border-radius: 12px; 
    text-align: center; 
    color: white; 
    font-weight: bold; 
    cursor: pointer; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
    display: flex; 
    flex-direction: column;
    justify-content: space-between; 
    align-items: center;
    min-height: 160px; /* Altura maior para caber todas as infos */
    transition: transform 0.1s;
}
.mesa-box:active { transform: scale(0.95); }
.mesa-livre { background: #2ecc71; }
.mesa-ocupada { background: #e74c3c; }
.mesa-reservada { background: #9b59b6; border: 2px solid #8e44ad; } /* Roxo para reservada */
.mesa-fechando { 
    background: linear-gradient(135deg, #f39c12 0%, #d35400 100%) !important; 
    border: 2px solid #f1c40f !important; 
    box-shadow: 0 0 14px rgba(243, 156, 18, 0.7); 
    animation: piscar-dourado 2s infinite alternate;
}

@keyframes piscar-dourado {
    0% { box-shadow: 0 0 5px rgba(241, 196, 15, 0.5); transform: scale(1); }
    100% { box-shadow: 0 0 18px rgba(241, 196, 15, 1); transform: scale(1.02); }
}

/* Áreas internas da mesa */
.mesa-top { height: 25px; width: 100%; display: flex; align-items: center; justify-content: center; }
.mesa-center { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    width: 100%; 
    margin: 4px 0;
}
.mesa-center .mesa-nome-sub { 
    font-size: 0.82em; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 0.8px; 
    opacity: 0.95; 
    color: #ffffff; 
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    max-width: 95%; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    line-height: 1.2;
    margin-bottom: 2px;
}
.mesa-center .mesa-numero { 
    font-size: 2.5em; 
    font-weight: 800; 
    line-height: 1; 
    color: #ffeb3b; /* Amarelo ouro de alta visibilidade */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}
.mesa-fechando .mesa-center .mesa-numero {
    color: #ffffff !important; /* Branco em mesas fechando/douradas */
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}
.mesa-bottom {
    height: auto; min-height: 40px; font-size: 0.85em; font-weight: normal; width: 100%;
    display: flex; flex-direction: column; justify-content: flex-end;
}

/* --- EXTRATO DE CONTA --- */
.lista-itens { max-height: 500px; overflow-y: auto; margin-bottom: 20px; font-size: 0.95em; }
.item-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f9f9f9; }

.resumo-conta { background: #f8f9fa; padding: 15px; border-radius: 10px; margin-bottom: 20px; }
.resumo-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.95em; color: #555; }
.resumo-row.total { font-size: 1.3em; color: #2c3e50; border-top: 1px solid #ddd; padding-top: 10px; margin-top: 10px; font-weight: 700; }

.acoes-conta { display: flex; gap: 10px; }
.btn-pagar { flex: 1; background: #27ae60; color: white; border: none; padding: 15px; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 1em; }
.btn-pagar:disabled { background: #95a5a6; cursor: not-allowed; }

.alert-box { background: #fff5f5; color: #c0392b; padding: 12px; border-radius: 8px; margin-bottom: 20px; font-weight: bold; text-align: center; border: 1px solid #feb2b2; display: flex; align-items: center; justify-content: center; gap: 10px; }

.btn-acao { border: none; padding: 12px; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 0.9em; width: 100%; text-transform: uppercase; transition: opacity 0.2s; }
.btn-acao:hover { opacity: 0.9; }

/* --- ANIMAÇÕES --- */
@keyframes piscar-laranja { 0% { opacity: 1; } 50% { opacity: 0.8; background: #e67e22; color: white; transform: scale(1.05); } 100% { opacity: 1; } }
@keyframes piscar-vermelho { 0% { opacity: 1; } 50% { opacity: 0.8; background: #c0392b; color: white; } 100% { opacity: 1; } }
@keyframes piscar-amarelo { 0% { opacity: 1; } 50% { opacity: 0.8; background: #f1c40f; color: #333; } 100% { opacity: 1; } }
@keyframes sino-balanco { 0% { transform: rotate(0deg); } 20% { transform: rotate(15deg); } 40% { transform: rotate(-10deg); } 60% { transform: rotate(5deg); } 80% { transform: rotate(-5deg); } 100% { transform: rotate(0deg); } }

/* --- MODAL (Adicionado para Produtos/Geral) --- */
.modal-overlay { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.6); 
    z-index: 2000; 
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(2px); 
}

.modal-content { 
    background: white; 
    width: 95%; 
    max-width: 600px; /* Mais largo para caber tudo */
    border-radius: 12px; 
    padding: 25px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
    animation: popIn 0.3s; 
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

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

.modal-header h3 { margin: 0; color: #2c3e50; }

.btn-fechar-modal {
    background: #e74c3c;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-fechar-modal:hover {
    background: #c0392b;
}

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

/* Fix para inputs e selects dentro do modal não quebrarem o layout */
.modal-content input, 
.modal-content select {
    box-sizing: border-box;
}

/* --- SISTEMA DE CHAT INTERNO --- */
#chat-icon {
    position: relative;
    font-size: 1.5em;
    cursor: pointer;
    color: #555;
    margin-left: 20px; /* Espaço entre ele e outros ícones */
}

#chat-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: popIn 0.3s;
}

/* Estilo para o spinner do botão */
.spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    border: .2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
    margin-right: 5px;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* --- TEMAS (GLOBAL) --- */
:root {
    --bg-body: #f4f7f6;
    --bg-card: #ffffff;
    --text-main: #333333;
    --text-muted: #7f8c8d;
    --primary: #3498db;
    --header-text: #2c3e50;
    --border: #ddd;
}

html[data-theme="dark"] {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #b0b0b0;
    --primary: #bb86fc;
    --header-text: #ffffff;
    --border: #333;
}

html[data-theme="blue"] {
    --bg-body: #e3f2fd;
    --bg-card: #ffffff;
    --text-main: #1565c0;
    --text-muted: #546e7a;
    --primary: #1976d2;
    --header-text: #0d47a1;
    --border: #bbdefb;
}

html[data-theme="green"] {
    --bg-body: #e8f5e9;
    --bg-card: #ffffff;
    --text-main: #2e7d32;
    --text-muted: #66bb6a;
    --primary: #43a047;
    --header-text: #1b5e20;
    --border: #c8e6c9;
}

html[data-theme="purple"] {
    --bg-body: #f3e5f5;
    --bg-card: #ffffff;
    --text-main: #4a148c;
    --text-muted: #7b1fa2;
    --primary: #8e24aa;
    --header-text: #4a148c;
    --border: #e1bee7;
}

html[data-theme="orange"] {
    --bg-body: #fff3e0;
    --bg-card: #ffffff;
    --text-main: #e65100;
    --text-muted: #ff9800;
    --primary: #fb8c00;
    --header-text: #e65100;
    --border: #ffe0b2;
}

html[data-theme="red"] {
    --bg-body: #ffebee;
    --bg-card: #ffffff;
    --text-main: #c62828;
    --text-muted: #ef5350;
    --primary: #e53935;
    --header-text: #b71c1c;
    --border: #ffcdd2;
}

html[data-theme="yellow"] {
    --bg-body: #fffde7;
    --bg-card: #ffffff;
    --text-main: #f57f17;
    --text-muted: #f9a825;
    --primary: #fbc02d;
    --header-text: #f57f17;
    --border: #fff9c4;
}

html[data-theme="gray"] {
    --bg-body: #eceff1;
    --bg-card: #ffffff;
    --text-main: #37474f;
    --text-muted: #78909c;
    --primary: #607d8b;
    --header-text: #37474f;
    --border: #cfd8dc;
}

html[data-theme="pink"] {
    --bg-body: #fce4ec;
    --bg-card: #ffffff;
    --text-main: #880e4f;
    --text-muted: #ec407a;
    --primary: #e91e63;
    --header-text: #880e4f;
    --border: #f8bbd0;
}

html[data-theme="lilac"] {
    --bg-body: #f3e5f5;
    --bg-card: #ffffff;
    --text-main: #4a148c;
    --text-muted: #ab47bc;
    --primary: #9c27b0;
    --header-text: #4a148c;
    --border: #e1bee7;
}

html[data-theme="mustard"] {
    --bg-body: #fff8e1;
    --bg-card: #ffffff;
    --text-main: #5d4037;
    --text-muted: #8d6e63;
    --primary: #ffb300;
    --header-text: #fbc02d;
    --border: #ffe082;
}

html[data-theme="brown"] {
    --bg-body: #efebe9;
    --bg-card: #ffffff;
    --text-main: #3e2723;
    --text-muted: #5d4037;
    --primary: #795548;
    --header-text: #4e342e;
    --border: #d7ccc8;
}

html[data-theme="high-contrast"] {
    --bg-body: #000000;
    --bg-card: #000000;
    --text-main: #ffffff;
    --text-muted: #ffff00;
    --primary: #ffff00;
    --header-text: #ffffff;
    --border: #ffffff;
}

html[data-theme="high-contrast"] .card, 
html[data-theme="high-contrast"] .admin-header, 
html[data-theme="high-contrast"] .form-box, 
html[data-theme="high-contrast"] .modal-content {
    border: 2px solid #ffffff !important;
}

body { background-color: var(--bg-body); color: var(--text-main); transition: background 0.3s, color 0.3s; }
.card, .admin-header, .sidebar-wrapper, .box-compra, .form-box, .modal-content { background-color: var(--bg-card) !important; color: var(--text-main) !important; }
h1, h2, h3, h4, h5, h6, th { color: var(--header-text) !important; }
.admin-header-menu, .admin-header-toolbar { background-color: var(--bg-card) !important; border-color: var(--border) !important; }
.admin-menu-link, .toolbar-btn { color: var(--text-main) !important; }
.admin-menu-link:hover, .toolbar-btn:hover { background-color: var(--bg-body) !important; }
.sidebar-wrapper .sidebar-menu ul li a { color: var(--text-main) !important; }
.sidebar-wrapper .sidebar-brand > a { color: var(--header-text) !important; }

/* --- BOTÃO VOLTAR AO TOPO --- */
#btn-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: none; /* Oculto por padrão */
    background-color: var(--primary, #3498db);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 9999;
    transition: opacity 0.3s, transform 0.3s;
}
#btn-back-to-top:hover {
    background-color: var(--header-text, #2c3e50);
    transform: translateY(-3px);
}

th { background-color: var(--bg-body) !important; }

/* --- SISTEMA DE ABAS (MULTI-TABS) --- */
.custom-tabs-header {
    display: flex;
    background: #e0e0e0;
    padding: 5px 5px 0 5px;
    border-bottom: 1px solid #ccc;
    gap: 5px;
    overflow-x: auto;
    position: sticky;
    top: 70px; /* Fica logo abaixo do menu superior */
    z-index: 980;
}

.custom-tab-item {
    padding: 8px 15px;
    background: #d6d6d6;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #ccc;
    border-bottom: none;
    white-space: nowrap;
    max-width: 200px;
    overflow:   hidden;
    text-overflow: ellipsis;
}

.custom-tab-item.active {
    background: #fff;
    font-weight: bold;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
}

.custom-tab-close {
    margin-left: auto;
    font-size: 10px;
    color: white;
    background: #e74c3c;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.custom-tab-close:hover { background: #c0392b; color: white; }

.custom-tab-pane { display: none; width: 100%; min-height: 400px; padding-bottom: 30px; }
.custom-tab-pane.active { display: block; }

/* Esconde sidebar e topo se estiver dentro de um iframe (aba) */
body.in-iframe .sidebar-wrapper, 
body.in-iframe .admin-header, 
body.in-iframe .admin-footer { display: none !important; }
body.in-iframe .page-content { padding: 15px !important; margin: 0 !important; height: auto !important; }

/* --- MODAL DE AÇÕES DA MESA (ADMIN) --- */
.grid-acoes-mesa {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.btn-mesa-admin {
    padding: 20px;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    text-decoration: none;
}

.btn-mesa-admin:hover { transform: translateY(-3px); box-shadow: 0 6px 12px rgba(0,0,0,0.15); }
.btn-mesa-admin:active { transform: scale(0.98); }

.btn-mesa-novo { background: linear-gradient(135deg, #3498db, #2980b9); }
.btn-mesa-chamados { background: linear-gradient(135deg, #e67e22, #d35400); }
.btn-mesa-aprovar { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.btn-mesa-conta { background: linear-gradient(135deg, #9b59b6, #8e44ad); }

.btn-mesa-admin i { font-size: 1.8em; margin-bottom: 5px; }

/* Animação Neon para Botões de Alerta */
@keyframes neon-blink {
    0%, 100% { box-shadow: 0 0 5px #ff0000, 0 0 10px #ff0000; border-color: #ff0000; transform: scale(1); }
    50% { box-shadow: 0 0 20px #ff0000, 0 0 30px #ff0000; border-color: #ff4d4d; transform: scale(1.03); }
}

.btn-alert {
    animation: neon-blink 0.8s infinite alternate !important;
    border: 3px solid #ff0000 !important;
    position: relative;
    z-index: 10;
}

/* ========================================================
   PAGINAÇÃO PRO (.docs/designer.md §4)
   Apenas Ícones + Salto Direto via Select + Topo & Rodapé
   ======================================================== */
.paginacao-pro-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 0;
    margin: 14px 0;
    user-select: none;
}
.paginacao-pro-container.pag-topo {
    margin-top: 4px;
    margin-bottom: 14px;
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 12px;
}
.paginacao-pro-container.pag-rodape {
    margin-top: 18px;
    margin-bottom: 8px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 14px;
}
.paginacao-pro-inner {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 4px 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.btn-pag-pro {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #475569;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}
.btn-pag-pro:hover:not(:disabled) {
    background: #f1f5f9;
    color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}
.btn-pag-pro:active:not(:disabled) {
    transform: scale(0.95);
}
.btn-pag-pro:disabled {
    opacity: 0.28;
    cursor: not-allowed;
    pointer-events: none;
}
.pag-pro-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0 2px;
}
.pag-pro-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 26px 6px 12px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    line-height: 1.4;
}
.pag-pro-select:hover {
    border-color: #94a3b8;
    background: #ffffff;
}
.pag-pro-select:focus {
    border-color: #10b981;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.pag-pro-select-caret {
    position: absolute;
    right: 9px;
    pointer-events: none;
    font-size: 0.72rem;
    color: #64748b;
}
.pag-pro-info {
    font-size: 0.83rem;
    color: #64748b;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pag-pro-info strong {
    color: #0f172a;
}

@media (max-width: 768px) {
    .btn-pag-pro {
        width: 42px;
        height: 42px;
    }
    .pag-pro-select {
        padding: 8px 28px 8px 12px;
        font-size: 0.92rem;
    }
}

/* ========================================================
   TOAST NOTIFICATION MODERNO NO CANTO INFERIOR DIREITO
   (.docs/designer.md §11)
   Com barra de tempo corrida e pausa ao passar o mouse
   ======================================================== */
#sys-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - 32px);
}
.sys-toast-card {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    padding: 14px 16px 16px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: toastSlideInRight 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.22s ease;
    user-select: none;
}
.sys-toast-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.16);
}
.sys-toast-card.closing {
    opacity: 0;
    transform: translateX(30px) scale(0.96);
    transition: all 0.2s ease;
}
.sys-toast-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.sys-toast-card.toast-success .sys-toast-icon-wrap { background: #ecfdf5; color: #059669; }
.sys-toast-card.toast-error .sys-toast-icon-wrap   { background: #fef2f2; color: #dc2626; }
.sys-toast-card.toast-warning .sys-toast-icon-wrap { background: #fffbeb; color: #d97706; }
.sys-toast-card.toast-info .sys-toast-icon-wrap    { background: #eff6ff; color: #2563eb; }

.sys-toast-body {
    flex: 1;
    min-width: 0;
}
.sys-toast-title {
    font-size: 0.93rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 3px 0;
    line-height: 1.25;
}
.sys-toast-message {
    font-size: 0.85rem;
    color: #475569;
    margin: 0;
    line-height: 1.35;
    word-break: break-word;
}
.sys-toast-btn-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    margin-left: 4px;
    transition: color 0.15s ease;
}
.sys-toast-btn-close:hover {
    color: #334155;
}

/* Linha de tempo corrida que se move no rodapé do balão */
.sys-toast-timer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left center;
}
.sys-toast-card.toast-success .sys-toast-timer-bar { background: linear-gradient(90deg, #10b981, #059669); }
.sys-toast-card.toast-error .sys-toast-timer-bar   { background: linear-gradient(90deg, #ef4444, #dc2626); }
.sys-toast-card.toast-warning .sys-toast-timer-bar { background: linear-gradient(90deg, #f59e0b, #d97706); }
.sys-toast-card.toast-info .sys-toast-timer-bar    { background: linear-gradient(90deg, #3b82f6, #2563eb); }

@keyframes toastSlideInRight {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}