/* 
    Estilos dedicados ao Super Painel Administrativo
    Depende das variáveis de cor definidas em styles.css
*/

:root {
    --sidebar-width: 260px;
    --admin-bg: #121212;
    --admin-surface: #1e1e1e;
    --admin-border: rgba(255, 255, 255, 0.12);
    --admin-text-primary: #ffffff;
    --admin-text-secondary: rgba(255, 255, 255, 0.7);
    --admin-accent: var(--md-sys-color-primary, #ffb4a1);
    --admin-danger: #ff5252;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--admin-bg);
    color: var(--admin-text-primary);
    font-family: 'Inter', Roboto, sans-serif;
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

button, a, .nav-item, .btn-icon, .menu-toggle, .close-modal {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Foco visível para navegação por teclado (acessibilidade) */
.nav-item:focus-visible,
.btn:focus-visible,
.btn-icon:focus-visible,
.close-modal:focus-visible,
.menu-toggle:focus-visible,
.logout-btn:focus-visible,
.voltar-app-link:focus-visible,
.admin-input:focus-visible {
    outline: 2px solid var(--admin-accent);
    outline-offset: 2px;
}

/* Reutilizado nas tabelas de usuários, churrascos e preços */
.table-empty-state {
    text-align: center;
    padding: 40px;
    color: var(--admin-text-secondary);
}

.table-empty-state .material-symbols-outlined {
    font-size: 40px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.4;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background-color: var(--admin-surface);
    border-right: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: calc(24px + env(safe-area-inset-top)) 24px 24px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--admin-border);
}

.sidebar-header .material-symbols-outlined {
    font-size: 32px;
    color: var(--admin-accent);
    flex-shrink: 0;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

/* Botão usado tanto no sidebar (desktop) quanto no topbar mobile, ambos abrindo o mesmo painel (#notifPanel). */
.notif-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--admin-border);
    color: var(--admin-text-primary);
    cursor: pointer;
    transition: background-color 0.2s;
}

.notif-bell-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #ff5252;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid var(--admin-surface);
}

.notif-badge[hidden] {
    display: none;
}

.topbar-end {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notif-panel {
    position: fixed;
    top: calc(70px + env(safe-area-inset-top));
    right: 16px;
    width: min(360px, calc(100vw - 32px));
    max-height: 420px;
    overflow-y: auto;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    z-index: 200;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.notif-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.notif-panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--admin-border);
    font-weight: 700;
    font-size: 14px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--admin-border);
    border-left: 3px solid transparent;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item > .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
    margin-top: 1px;
    color: var(--admin-text-secondary);
}

/* Diferenciação visual entre os dois tipos de evento (só o ícone principal, não o botão de lixeira). */
.notif-item.notif-cadastro {
    border-left-color: #2ecc71;
}

.notif-item.notif-cadastro > .material-symbols-outlined {
    color: #2ecc71;
}

.notif-item.notif-exclusao {
    border-left-color: #FF4E00;
}

.notif-item.notif-exclusao > .material-symbols-outlined {
    color: #FF4E00;
}

.notif-item-texto {
    flex: 1;
    min-width: 0;
}

.notif-item-remover {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 4px;
    margin: -4px -4px -4px 0;
    border-radius: 6px;
    color: var(--admin-text-secondary);
    cursor: pointer;
}

.notif-item-remover .material-symbols-outlined {
    font-size: 18px;
    color: inherit;
}

.notif-item-remover:hover {
    color: #ff4d4f;
    background: rgba(255, 77, 79, 0.12);
}

.notif-panel-footer {
    padding: 10px 16px;
    text-align: center;
}

.notif-clear-all-btn {
    background: none;
    border: none;
    color: var(--admin-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
}

.notif-clear-all-btn:hover {
    text-decoration: underline;
}

.notif-item-texto strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
}

.notif-item-texto span {
    color: var(--admin-text-secondary);
    font-size: 12px;
}

.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--admin-text-secondary);
    font-size: 13px;
}

/* No desktop o sino fica no canto superior esquerdo (dentro do sidebar); ancora o painel do mesmo lado, perto do botão. */
@media (min-width: 769px) {
    .notif-panel {
        top: 90px;
        left: 16px;
        right: auto;
    }
}

/* nav + rodapé rolam juntos como um bloco só; sem isso, um rodapé fixo fora da rolagem
   sobrava espaço fixo e quebrava a navegação em telas baixas (celular deitado). */
.sidebar-scroll-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    padding: 16px 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    color: var(--admin-text-secondary);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--admin-text-primary);
}

.nav-item.active {
    background-color: rgba(255, 180, 161, 0.15); /* var(--admin-accent) com opacidade */
    color: var(--admin-accent);
    font-weight: 500;
}

.sidebar-footer {
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom)) 16px;
    border-top: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.voltar-app-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--admin-border);
    color: var(--admin-text-secondary);
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.voltar-app-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--admin-text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background-color: rgba(255, 82, 82, 0.05);
    border: 1px solid rgba(255, 82, 82, 0.2);
    color: var(--admin-danger);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background-color: rgba(255, 82, 82, 0.15);
    border-color: rgba(255, 82, 82, 0.4);
    box-shadow: 0 4px 12px rgba(255, 82, 82, 0.1);
}

.admin-main {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    box-sizing: border-box;
}

.topbar-mobile {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: calc(16px + env(safe-area-inset-top)) 16px 16px 16px;
    background-color: var(--admin-surface);
    border-bottom: 1px solid var(--admin-border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
}

.menu-toggle {
    background: transparent;
    border: none;
    color: var(--admin-text-primary);
    cursor: pointer;
    padding: 10px; /* tap target ~44x44px */
    border-radius: 8px;
    display: flex;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 17px;
    background: var(--md-sys-color-primary-gradient, linear-gradient(135deg, #FF4E00 0%, #FFA000 100%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.3px;
}

.topbar-brand .material-symbols-outlined {
    -webkit-text-fill-color: initial;
    color: var(--admin-accent);
    font-size: 22px;
}

.topbar-brand-suffix {
    -webkit-text-fill-color: var(--admin-text-secondary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.admin-section.active {
    display: block;
}

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

.section-header {
    margin-bottom: 32px;
}

.section-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
}

.section-header p {
    margin: 0;
    color: var(--admin-text-secondary);
    font-size: 15px;
}

/* Só pras seções com um botão de atualizar à direita do título; Dicas e Monitor já tinham
   botões próprios e mantêm a estrutura em flex inline, sem usar essa classe. */
.section-header-flex {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header-flex .section-header-text {
    flex: 1 1 240px;
    min-width: 0;
}

.section-refresh-btn {
    border: 1px solid var(--admin-border);
    flex-shrink: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.metric-card {
    background-color: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.metric-card.clickable {
    cursor: pointer;
}

.metric-card.clickable:hover {
    border-color: var(--admin-accent);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.metric-icon.users {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(33, 150, 243, 0.05));
    color: #64b5f6;
}

.metric-icon.bbqs {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.2), rgba(255, 152, 0, 0.05));
    color: #ffb74d;
}

.metric-icon.future {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.05));
    color: #81c784;
}

.metric-icon.past {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.2), rgba(156, 39, 176, 0.05));
    color: #ba68c8;
}

.metric-icon.meat {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.2), rgba(244, 67, 54, 0.05));
    color: #e57373;
}

.metric-icon.guests {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.2), rgba(0, 188, 212, 0.05));
    color: #4dd0e1;
}

.metric-icon.value {
    background: linear-gradient(135deg, rgba(255, 235, 59, 0.2), rgba(255, 235, 59, 0.05));
    color: #fff176;
}

.metric-info {
    min-width: 0; /* permite encolher/truncar em vez de estourar o card (item flex de .metric-card) */
}

.metric-info h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--admin-text-secondary);
    font-weight: 500;
}

.metric-info .value {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-container {
    background-color: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    overflow-x: auto;
    margin-bottom: 24px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.admin-table th, .admin-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.admin-table th {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--admin-text-secondary);
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.02);
    white-space: nowrap;
}

.admin-table tbody tr {
    transition: background-color 0.2s ease;
}

.admin-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* Usuário com atividade recente na API (ver UltimaAtividade/middleware no backend): no
   desktop marca a borda esquerda da linha; no mobile (regra no @media abaixo) a borda
   verde contorna o card inteiro. */
@media (min-width: 769px) {
    .admin-table tbody tr.usuario-online {
        border-left: 3px solid #2ecc71;
    }
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--admin-accent);
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0; /* permite encolher/quebrar em vez de estourar a linha (item flex de .user-cell) */
}

.user-name {
    font-weight: 500;
    font-size: 15px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.user-email {
    font-size: 13px;
    color: var(--admin-text-secondary);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background-color: var(--admin-border);
    white-space: nowrap;
}

/* Trava de preço na tabela de Preços dos Itens: liga = scraper para de mexer no valor. */
.preco-lock-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    vertical-align: middle;
    flex-shrink: 0;
}

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

.preco-lock-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background-color: var(--admin-border);
    border-radius: 22px;
    transition: background-color 0.15s ease;
}

.preco-lock-slider::before {
    content: "";
    position: absolute;
    left: 3px;
    bottom: 3px;
    width: 16px;
    height: 16px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.15s ease;
}

.preco-lock-switch input:checked + .preco-lock-slider {
    background-color: var(--admin-accent);
}

.preco-lock-switch input:checked + .preco-lock-slider::before {
    transform: translateX(16px);
}

.preco-lock-switch input:focus-visible + .preco-lock-slider {
    outline: 2px solid var(--admin-accent);
    outline-offset: 2px;
}

.badge.primary {
    background-color: rgba(255, 180, 161, 0.2);
    color: var(--admin-accent);
}

.feedback-estrelas {
    color: #FFA000;
    font-size: 16px;
    letter-spacing: 1px;
    white-space: nowrap;
}

.feedback-sem-mensagem {
    color: var(--admin-text-secondary);
}

.feedback-icone-editado {
    color: #FFA000;
}

.badge-editado {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 160, 0, 0.15);
    color: #FFA000;
    border: 1px solid rgba(255, 160, 0, 0.3);
    margin-left: 6px;
    white-space: nowrap;
}

.feedback-data-cell {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
}

/* Histórico de edições de um feedback (modal via SweetAlert2) */
.historico-lista {
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.historico-item {
    border-left: 3px solid var(--admin-border);
    padding-left: 12px;
    margin-bottom: 16px;
}

.historico-item.atual {
    border-left-color: #81C784;
}

.historico-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 12px;
}

.historico-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    color: var(--admin-text-secondary);
    white-space: nowrap;
}

.historico-tag.atual {
    background: #2E7D32;
    color: #fff;
}

.historico-estrelas {
    color: #FFA000;
    font-size: 16px;
    margin: 4px 0;
}

.historico-mensagem {
    font-size: 13px;
    color: var(--admin-text-primary);
    white-space: pre-wrap;
}

.log-categoria-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background-color: var(--admin-border);
    white-space: nowrap;
}

.log-voce-tag {
    color: var(--admin-accent);
    font-weight: 600;
    font-size: 13px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--admin-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--admin-text-primary);
}

.btn-icon.danger:hover {
    background-color: rgba(255, 82, 82, 0.1);
    color: var(--admin-danger);
}

.btn-icon.info:hover {
    background-color: rgba(77, 208, 225, 0.1);
    color: #4dd0e1;
}

.btn-icon .material-symbols-outlined {
    font-size: 18px;
}

.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.admin-modal {
    background-color: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.admin-modal-overlay.active .admin-modal {
    transform: scale(1);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--admin-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px; /* tap target ~44x44px */
    border-radius: 50%;
    transition: background 0.2s;
}

.close-modal:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--admin-text-primary);
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--admin-text-secondary);
}

.admin-input {
    width: 100%;
    padding: 12px 16px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    color: var(--admin-text-primary);
    font-size: 16px; /* evita zoom automático ao focar em inputs no iOS (mínimo 16px) */
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.admin-input:focus {
    outline: none;
    border-color: var(--admin-accent);
}

select.admin-input option {
    background-color: var(--admin-surface);
    color: var(--admin-text-primary);
}

select.admin-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 42px;
    cursor: pointer;
}

.admin-password-wrapper {
    position: relative;
}

.admin-password-wrapper .admin-input {
    padding-right: 48px;
}

.admin-password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--admin-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px; /* tap target ~44x44px */
    border-radius: 50%;
    transition: color 0.2s, background-color 0.2s;
}

.admin-password-toggle:hover {
    color: var(--admin-text-primary);
    background-color: rgba(255, 255, 255, 0.06);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--admin-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--admin-border);
    color: var(--admin-text-primary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-primary {
    background-color: var(--admin-accent);
    color: #000;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-danger {
    background-color: var(--admin-danger);
    color: #fff;
}

.btn-danger:hover {
    filter: brightness(1.1);
}

.filters-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-input {
    flex: 1;
    min-width: 200px;
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
        padding: calc(80px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)) 16px;
        width: 100vw;
        max-width: 100%;
        overflow-x: hidden;
    }

    .topbar-mobile {
        display: flex;
    }

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

    .table-container {
        border-radius: 0;
        margin: 0 -16px;
        padding: 0 16px;
        width: calc(100% + 32px);
        background: transparent;
        border: none;
    }

    .admin-table, .admin-table thead, .admin-table tbody, .admin-table th, .admin-table td, .admin-table tr {
        display: block;
    }

    .admin-table {
        min-width: 100%;
    }

    .admin-table thead tr {
        display: none;
    }

    .admin-table tr {
        background-color: var(--admin-surface);
        border: 1px solid var(--admin-border);
        border-radius: 12px;
        margin-bottom: 16px;
        padding: 8px 16px;
    }

    .admin-table tr.usuario-online {
        border: 1px solid #2ecc71;
    }

    .admin-table td {
        border: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        position: relative;
        padding: 12px 0 12px 45%;
        text-align: right;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        min-height: 48px;
    }

    .admin-table td:last-child {
        border-bottom: none;
    }

    .admin-table td:before {
        content: attr(data-label);
        position: absolute;
        top: 12px;
        left: 0;
        width: 40%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        text-align: left;
        color: var(--admin-text-secondary);
        font-size: 12px;
        text-transform: uppercase;
    }

    /* Linha de estado vazio ou de erro (td com colspan, sem rótulo): ocupa o cartão inteiro, centralizada, sem o recuo de 45% das células de dados */
    .admin-table td[colspan] {
        display: block;
        padding: 32px 16px;
        text-align: center;
    }

    .admin-table td[colspan]:before {
        display: none;
    }

    .user-cell {
        justify-content: flex-end;
    }

    .user-avatar {
        display: none;
    }

    .user-cell .user-details {
        text-align: right;
    }
}

div:where(.swal2-container) div:where(.swal2-popup) {
    background-color: var(--admin-surface) !important;
    color: var(--admin-text-primary) !important;
    border: 1px solid var(--admin-border) !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4) !important;
}

div:where(.swal2-container) h2:where(.swal2-title) {
    color: var(--admin-text-primary) !important;
    font-size: 24px !important;
}

div:where(.swal2-container) div:where(.swal2-html-container) {
    color: var(--admin-text-secondary) !important;
    font-size: 15px !important;
}

div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm {
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
}

div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel {
    background-color: transparent !important;
    border: 1px solid var(--admin-border) !important;
    color: var(--admin-text-primary) !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
}

div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.monitor-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 8px;
}

.monitor-card {
    background-color: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.monitor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
    background: var(--admin-border);
    transition: background 0.3s ease;
}

.monitor-card.status-ok::before   { background: linear-gradient(90deg, #4caf50, #81c784); }
.monitor-card.status-aviso::before { background: linear-gradient(90deg, #ff9800, #ffb74d); }
.monitor-card.status-erro::before  { background: linear-gradient(90deg, #f44336, #e57373); }
.monitor-card.status-pendente::before { background: linear-gradient(90deg, #9e9e9e, #bdbdbd); }

.monitor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.monitor-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.monitor-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    transition: background 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.monitor-icon.status-ok    { background: rgba(76, 175, 80, 0.15); color: #81c784; }
.monitor-icon.status-aviso  { background: rgba(255, 152, 0, 0.15);  color: #ffb74d; }
.monitor-icon.status-erro   { background: rgba(244, 67, 54, 0.15);  color: #e57373; }
.monitor-icon.status-pendente { background: rgba(158,158,158,0.15); color: #bdbdbd; }

.monitor-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.monitor-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    background: rgba(255,255,255,0.07);
    color: var(--admin-text-secondary);
    transition: all 0.3s ease;
}

.monitor-badge.status-ok    { background: rgba(76,175,80,0.15);  color: #81c784; }
.monitor-badge.status-aviso  { background: rgba(255,152,0,0.15);  color: #ffb74d; }
.monitor-badge.status-erro   { background: rgba(244,67,54,0.15);  color: #e57373; }
.monitor-badge.status-pendente { background: rgba(158,158,158,0.12); color: #bdbdbd; }

.monitor-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.monitor-kv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 14px;
}

.monitor-kv:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.monitor-kv span {
    color: var(--admin-text-secondary);
    flex-shrink: 0;
}

.monitor-kv strong {
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

.sentry-issue-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sentry-issue-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sentry-issue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.sentry-issue-nivel {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(244, 67, 54, 0.15);
    color: #e57373;
}

.sentry-issue-nivel.nivel-warning { background: rgba(255, 152, 0, 0.15); color: #ffb74d; }
.sentry-issue-nivel.nivel-info    { background: rgba(33, 150, 243, 0.15); color: #64b5f6; }
.sentry-issue-nivel.nivel-fatal   { background: rgba(183, 28, 28, 0.2); color: #ff8a80; }

.sentry-issue-count {
    font-size: 12px;
    color: var(--admin-text-secondary);
    flex-shrink: 0;
}

.sentry-issue-titulo {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--admin-text-primary);
    text-decoration: none;
    word-break: break-word;
}

a.sentry-issue-titulo:hover {
    color: var(--admin-accent);
    text-decoration: underline;
}

.sentry-issue-culprit {
    font-size: 12px;
    color: var(--admin-text-secondary);
    word-break: break-word;
    margin-top: 2px;
}

.sentry-issue-data {
    font-size: 11px;
    color: var(--admin-text-secondary);
    margin-top: 4px;
}

.monitor-alert {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: rgba(33, 150, 243, 0.08);
    border: 1px solid rgba(33, 150, 243, 0.2);
    border-radius: 12px;
    margin-top: 20px;
    color: #64b5f6;
}

.monitor-alert .material-symbols-outlined {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.monitor-alert strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.monitor-alert p {
    margin: 0;
    font-size: 14px;
    color: var(--admin-text-secondary);
    line-height: 1.5;
}

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

.cat-badge.bovino  { background: rgba(244,67,54,0.15);  color: #ef9a9a; }
.cat-badge.suino   { background: rgba(255,152,0,0.15);  color: #ffcc80; }
.cat-badge.frango  { background: rgba(255,235,59,0.15); color: #fff176; }
.cat-badge.petisco { background: rgba(33,150,243,0.15); color: #90caf9; }
.cat-badge.bebida  { background: rgba(0,188,212,0.15);  color: #4dd0e1; }
.cat-badge.outros  { background: rgba(158,158,158,0.15); color: #e0e0e0; }
.cat-badge.molho    { background: rgba(156,39,176,0.15); color: #ce93d8; }
.cat-badge.tempero  { background: rgba(76,175,80,0.15);  color: #a5d6a7; }
.cat-badge.cordeiro { background: rgba(121,85,72,0.15);  color: #bcaaa4; }

/* Filtro por categoria na tabela de Preços dos Itens — reaproveita as cores do cat-badge
   pra cada chip já indicar visualmente a categoria que filtra. */
.filtro-categoria {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filtro-chip {
    border: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.6;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}

.filtro-chip .material-symbols-outlined {
    font-size: 16px;
}

.filtro-chip:not(.cat-badge) {
    background: var(--admin-border);
    color: var(--admin-text-secondary);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.filtro-chip.ativo {
    opacity: 1;
    border-color: currentColor;
}

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

.spinning {
    animation: spin 0.8s linear infinite;
}

@media (max-width: 768px) {
    .monitor-status-grid {
        grid-template-columns: 1fr;
    }
}

/* Classe propria (nao reaproveita .metric-card) -- styles.css (carregado nesta pagina so pelas
   variaveis) tem seu proprio .metric-card com override mobile pra o home do usuario comum
   (empilha em coluna, centralizado), que vazava pra cá e desmontava o layout no admin. */
.admin-highlight-card {
    background-color: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.admin-highlight-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(255, 235, 59, 0.2), rgba(255, 235, 59, 0.05));
    color: #fff176;
}

.admin-highlight-icon .material-symbols-outlined {
    font-size: 24px;
}

.admin-highlight-info {
    min-width: 0;
}

.admin-highlight-info h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--admin-text-secondary);
    font-weight: 500;
}

.admin-highlight-info .value {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

@media (max-width: 480px) {
    .admin-highlight-info .value {
        font-size: 18px;
    }
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination-info {
    color: var(--admin-text-secondary);
    font-size: 13px;
    white-space: nowrap;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--admin-border);
    background-color: var(--admin-surface);
    color: var(--admin-text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--admin-accent);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn .material-symbols-outlined {
    font-size: 18px;
}

@media (max-width: 480px) {
    .pagination-bar {
        gap: 8px;
    }

    .pagination-btn {
        padding: 0;
        width: 40px;
        height: 40px;
        justify-content: center;
    }

    .pagination-btn-label {
        display: none;
    }

    .pagination-info {
        font-size: 12px;
        text-align: center;
    }
}

.combo-sel-grupo { border: 1px solid var(--admin-border); border-radius: 10px; margin: 0 0 12px; padding: 8px 12px 12px; text-align: left; min-width: 0; }
.combo-sel-grupo legend { font-size: 13px; font-weight: 600; padding: 0 6px; color: var(--admin-accent); }
.combo-sel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; }
.combo-sel-item { min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; text-align: left; }
.combo-sel-item input { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--admin-accent); }
.combo-editor-campos { display: flex; gap: 12px; margin-bottom: 14px; text-align: left; flex-wrap: wrap; }
.combo-editor-campos label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; flex: 1 1 160px; }
.combo-editor-campos input { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--admin-border); background: transparent; color: inherit; font-size: 14px; }
.combo-editor-scroll { max-height: 55vh; overflow-y: auto; padding-right: 4px; }
.combo-sel-item span { min-width: 0; overflow-wrap: anywhere; }
.combo-editor-campos select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--admin-border); background: var(--admin-surface); color: inherit; font-size: 14px; }
.combo-editor-campos textarea { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--admin-border); background: transparent; color: inherit; font-size: 14px; font-family: inherit; resize: vertical; }
.novidade-campos { flex-direction: column; flex-wrap: nowrap; }
.novidade-campos label { flex: 0 0 auto; }
.novidade-campos input[type="datetime-local"] { color-scheme: dark; }
.novidade-previa { margin-top: 14px; text-align: left; }
.novidade-previa-rotulo { display: block; margin-bottom: 6px; font-size: 12px; color: var(--admin-text-secondary); }
.novidade-previa-card { max-width: 380px; overflow: hidden; border-radius: 16px; border: 1px solid var(--md-sys-color-outline); background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); font-family: var(--md-sys-typescale-font); pointer-events: none; }
.novidade-previa .sino-acao[hidden] { display: none; }
.novidade-previa-vazio { opacity: 0.5; }
.novidade-dica { font-size: 12px; color: var(--admin-text-secondary); }
.novidade-data-cell { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.novidade-agendada-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(255, 78, 0, 0.18); color: var(--admin-accent); }
.novidade-alcance { display: flex; flex-direction: column; gap: 2px; min-width: 130px; }
.novidade-alcance-linha, .novidade-nowrap { white-space: nowrap; }
.combo-editor-campos input:focus, .combo-editor-campos textarea:focus, .combo-editor-campos select:focus { outline: none; border-color: var(--admin-accent); box-shadow: 0 0 0 2px rgba(255, 78, 0, 0.25); }
.novidade-alcance-info { display: block; font-size: 12px; color: var(--admin-text-secondary); }
.combo-oculto-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, 0.12); color: var(--admin-text-secondary); vertical-align: middle; }
.combo-linha-oculta td:not(:last-child) { opacity: 0.6; }

/* Editor de produto (Produtos novos): grade de 2 colunas, campos do mesmo tamanho, 1 coluna no celular */
.produto-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; text-align: left; }
.pf-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; }
.pf-cheio { grid-column: 1 / -1; }
.pf-campo > span { font-size: 13px; font-weight: 600; color: var(--admin-text-secondary); }
.pf-campo small { font-size: 12px; color: var(--admin-text-secondary); opacity: 0.85; }
.produto-form input[type="text"], .produto-form select {
    width: 100%; height: 44px; box-sizing: border-box; padding: 0 12px; margin: 0;
    border-radius: 10px; border: 1px solid var(--admin-border); background-color: rgba(255, 255, 255, 0.04);
    color: var(--admin-text-primary); font-family: inherit; font-size: 15px;
}
.produto-form select {
    appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23bbbbbb' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
.produto-form select option { background: var(--admin-surface); color: var(--admin-text-primary); }
.produto-form input[type="text"]:focus, .produto-form select:focus { outline: none; border-color: var(--admin-accent); box-shadow: 0 0 0 3px rgba(255, 78, 0, 0.22); }
.pf-entrada { position: relative; }
.pf-entrada input[type="text"] { padding-right: 70px; }
.pf-entrada em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; color: var(--admin-text-secondary); pointer-events: none; }
.pf-entrada-prefixo input[type="text"] { padding-left: 40px; padding-right: 12px; }
.pf-entrada-prefixo em { right: auto; left: 14px; }
.pf-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--admin-text-primary); }
.pf-check input[type="checkbox"] { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--admin-accent); cursor: pointer; }
.pf-check small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--admin-text-secondary); opacity: 0.85; }
@media (max-width: 520px) { .produto-form { grid-template-columns: 1fr; gap: 16px; } }

.drawer-overlay {
    display: none;
}

.admin-sidebar {
    height: 100vh;
    height: 100dvh;
}

.sidebar-scroll-area {
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: contain;
}

.sidebar-scroll-area::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    .drawer-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 99;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

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

    body.sidebar-aberta {
        overflow: hidden;
    }

    .sidebar-header {
        padding: calc(16px + env(safe-area-inset-top)) 20px 16px 20px;
    }

    .sidebar-nav {
        padding: 8px;
    }

    .nav-item {
        padding: 9px 16px;
        margin-bottom: 2px;
    }

    .sidebar-footer {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom)) 16px;
    }
}
