/* ==========================================================================
   Estilos específicos para o Painel Administrativo TapMesa
   ========================================================================== */

/* Layout Geral */
body {
    display: block;
    /* Desativa centralização vertical do body herdada */
    padding: 0;
    margin: 0;
    width: 100%;
    overflow-y: auto !important;
    scrollbar-width: none;
    /* Oculta barra de rolagem no Firefox */
    -ms-overflow-style: none;
    /* Oculta no IE/Edge */
}

body::-webkit-scrollbar {
    display: none;
    /* Oculta no Chrome/Safari */
}

.admin-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 1.2rem 1rem;
    /* Ajustado para caber melhor no mockup */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Header Administrativo */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(196, 172, 146, 0.3);
    transition: border-color 0.3s ease;
}

.header-brand-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-divider {
    color: var(--color-muted);
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.4;
}

.admin-header .restaurant-name {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    letter-spacing: -0.01em;
}

.admin-header .logo {
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.admin-header .brand-logo-img {
    max-height: 28px;
    height: 22px;
    width: auto;
    object-fit: contain;
}

.brand-logo-desktop {
    display: block;
}

.logo-dark {
    display: none;
}

body.dark .logo-light {
    display: none !important;
}

body.dark .brand-logo-desktop.logo-dark {
    display: block;
}

.brand-logo-mobile {
    display: none;
}

body.dark .brand-logo-mobile {
    filter: brightness(0) invert(1);
}

@media (max-width: 640px) {

    .brand-logo-desktop,
    body.dark .brand-logo-desktop,
    body.dark .brand-logo-desktop.logo-dark {
        display: none !important;
    }

    .brand-logo-mobile {
        display: block !important;
        max-height: 36px;
        height: 22px;
        width: auto;
        object-fit: contain;
    }

    .header-brand-group {
        gap: 0.5rem;
    }

    .admin-header .restaurant-name {
        font-size: 0.95rem;
    }
}

body.view-mobile .brand-logo-desktop,
body.view-mobile.dark .brand-logo-desktop,
body.view-mobile.dark .brand-logo-desktop.logo-dark {
    display: none !important;
}

body.view-mobile .brand-logo-mobile {
    display: block !important;
    max-height: 27px;
    height: 22px;
    width: auto;
    object-fit: contain;
}

body.view-mobile .header-brand-group {
    gap: 1.2rem;
}

body.view-mobile .admin-header .restaurant-name {
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Botões do Header */
.theme-toggle-btn-static {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle-btn-static:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

body.dark .theme-toggle-btn-static:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: #f7f7f4;
    color: var(--color-text);
    box-shadow:
        -2px -2px 6px rgba(255, 255, 255, 0.95),
        3px 4px 8px rgba(0, 0, 0, 0.08),
        1px 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.btn-logout:hover {
    background: #f1f1ed;
    box-shadow:
        -3px -3px 8px rgba(255, 255, 255, 0.95),
        4px 5px 10px rgba(0, 0, 0, 0.09),
        1px 1px 4px rgba(0, 0, 0, 0.04);
}

.btn-logout:active {
    transform: translateY(1px);
    box-shadow:
        inset -1px -1px 3px rgba(255, 255, 255, 0.95),
        inset 1px 1px 3px rgba(0, 0, 0, 0.06);
}

/* Área de Título e Subtítulos */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.25rem;
    width: 100%;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.15rem;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--color-muted);
    font-weight: 400;
}

.counter-badge {
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--color-muted);
    font-weight: 500;
    box-shadow:
        inset -1px -1px 2px rgba(255, 255, 255, 0.8),
        inset 1px 1px 2px rgba(0, 0, 0, 0.03);
}

#counter-number {
    font-weight: 600;
    color: var(--color-primary);
}

/* Grid de Chamados */
.calls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    /* Reduzido para caber melhor no mockup */
    gap: 1rem;
    width: 100%;
}

/* Card de Chamado */
.call-card {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-left: 5px solid transparent;
    border-radius: 1.2rem;
    padding: 1.2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 150px;
    box-shadow:
        -3px -3px 8px rgba(255, 255, 255, 0.8),
        4px 5px 12px rgba(0, 0, 0, 0.05);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background-color 0.3s ease,
        border-color 0.3s ease;
}

.call-card.type-waiter {
    border-left-color: var(--color-primary);
}

.call-card.type-bill {
    border-left-color: #b45309;
}

body.dark .call-card.type-bill {
    border-left-color: #f59e0b;
}

.call-card:hover {
    box-shadow:
        -4px -4px 10px rgba(255, 255, 255, 0.9),
        5px 6px 14px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
}

/* Cabeçalho do Card */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.card-table-number {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text);
}

.card-time {
    font-size: 0.8rem;
    color: var(--color-muted);
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background-color: var(--color-disabled-bg);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.call-card.priority-medium .card-time {
    background-color: rgba(22, 101, 52, 0.08);
    color: var(--color-primary);
    font-weight: 600;
}

.call-card.priority-high .card-time {
    background-color: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    font-weight: 600;
}

/* Corpo do Card */
.card-body {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.8rem 0;
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.95rem;
}

.card-body svg {
    color: var(--color-primary);
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Observação no cartão */
.card-note {
    margin-bottom: 0.8rem;
    padding: 0.6rem 0.8rem;
    background-color: var(--color-background);
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--color-text);
    border-left: 3px solid var(--color-primary);
    font-style: italic;
    line-height: 1.3;
    word-break: break-word;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.02);
}

body.dark .card-note {
    background-color: #27272a;
}

/* Rodapé do Card / Botão Atender */
.card-footer {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.btn-card-action {
    height: 36px;
    padding: 0 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: #c7ab70;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(199, 171, 112, 0.25);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-card-action:hover {
    background: #b5995e;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(199, 171, 112, 0.35);
}

.btn-card-action:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(199, 171, 112, 0.2);
}

/* Efeito de saída (fade out) */
.call-card.removing {
    opacity: 0;
    transform: scale(0.9);
}

/* Estado Vazio */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    width: 100%;
}

.empty-icon-container {
    color: var(--color-primary);
    margin-bottom: 1rem;
    opacity: 0.85;
}

.empty-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.35rem;
}

.empty-subtitle {
    font-size: 0.95rem;
    color: var(--color-muted);
    font-weight: 400;
}

/* Modo Escuro (Dark Mode) */
body.dark .admin-header {
    border-bottom-color: var(--color-disabled-bg);
}

body.dark .btn-logout {
    background: #202023;
    box-shadow:
        -2px -2px 6px rgba(255, 255, 255, 0.03),
        3px 4px 10px rgba(0, 0, 0, 0.45),
        1px 1px 3px rgba(0, 0, 0, 0.2);
}

body.dark .btn-logout:hover {
    background: #29292d;
    box-shadow:
        -3px -3px 8px rgba(255, 255, 255, 0.04),
        4px 5px 12px rgba(0, 0, 0, 0.5),
        1px 1px 4px rgba(0, 0, 0, 0.22);
}

body.dark .btn-logout:active {
    box-shadow:
        inset -1px -1px 3px rgba(255, 255, 255, 0.03),
        inset 1px 1px 3px rgba(0, 0, 0, 0.35);
}

body.dark .counter-badge {
    border-color: var(--color-disabled-bg);
    box-shadow:
        inset -1px -1px 2px rgba(255, 255, 255, 0.02),
        inset 1px 1px 2px rgba(0, 0, 0, 0.2);
}

body.dark .call-card {
    background-color: #202023;
    border-color: rgba(255, 255, 255, 0.04);
    box-shadow:
        -3px -3px 10px rgba(255, 255, 255, 0.02),
        4px 5px 12px rgba(0, 0, 0, 0.4);
}

body.dark .call-card:hover {
    box-shadow:
        -4px -4px 12px rgba(255, 255, 255, 0.03),
        5px 6px 16px rgba(0, 0, 0, 0.45);
}

body.dark .btn-card-action {
    background: #c7ab70 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(199, 171, 112, 0.25);
}

body.dark .btn-card-action:hover {
    background: #b5995e !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(199, 171, 112, 0.35);
}

body.dark .btn-card-action:active {
    background: #b5995e !important;
    box-shadow: 0 1px 3px rgba(199, 171, 112, 0.2);
}

body.dark .call-card.priority-medium .card-time {
    background-color: rgba(199, 171, 112, 0.15);
    color: var(--color-primary);
}

body.dark .call-card.priority-high .card-time {
    background-color: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

/* Responsividade (Breakpoints) */
@media (max-width: 900px) {
    .admin-wrapper {
        padding: 1rem 0.75rem;
        gap: 1.25rem;
    }

    .admin-header .restaurant-name {
        font-size: 1.1rem;
    }
}

@media (max-width: 600px) {
    .admin-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: space-between;
    }

    .restaurant-name-container {
        order: 3;
        flex: none;
        width: 100%;
        text-align: left;
        margin-top: 0.35rem;
    }

    .admin-header .restaurant-name {
        font-size: 1.1rem;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .counter-badge {
        align-self: flex-start;
    }

    .calls-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.btn-finish {
    background: transparent !important;
    border: 1.5px solid #c7ab70 !important;
    color: #c7ab70 !important;
    box-shadow: none !important;
}

body.dark .btn-finish {
    border-color: #c7ab70 !important;
    color: #c7ab70 !important;
}

.btn-finish:hover {
    background: #c7ab70 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(199, 171, 112, 0.25) !important;
}

body.dark .btn-finish:hover {
    background: #c7ab70 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(199, 171, 112, 0.25) !important;
}