/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Variáveis CSS */
:root {
    --color-primary: #8B4513;
    --color-secondary: #DAA520;
    --color-tertiary: #FFD700;
    --color-quaternary: #FFFFFF;
    --sidebar-width: 260px;
    --topbar-height: 60px;
}

/* === CONTAINER PRINCIPAL === */
.app-container {
    flex: 1;
    width: 100%;
}

/* === SELETOR DE IDIOMA === */
.language-switcher {
    position: fixed;
    top: max(0.5rem, env(safe-area-inset-top));
    right: 0.5rem;
    display: -webkit-flex;
    display: flex;
    gap: 0.4rem;
    z-index: 1100;
    background: rgba(255, 255, 255, 0.97);
    padding: 0.4rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    -webkit-box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.language-switcher button {
    background: white;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    padding: 0.2rem;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.language-switcher button svg {
    display: block;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    width: 30px;
    height: 22px;
}

.language-switcher button.active {
    border-color: var(--color-tertiary);
    background: rgba(255, 215, 0, 0.15);
    -webkit-transform: scale(1.05);
    transform: scale(1.05);
}

.language-switcher button:active {
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
}

/* ============================================================
   MOBILE FRONTEND — HAMBURGER DRAWER (smartphones Android)
   ============================================================ */

/* Tela inicial mobile — layout flexível centrado */
.home-screen-wrap {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    min-height: 100vh;
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Botão hamburguer (abre drawer) */
.hamburger-btn {
    position: fixed;
    top: max(0.75rem, env(safe-area-inset-top));
    left: 0.75rem;
    z-index: 1200;
    background: var(--color-tertiary);
    color: var(--color-quaternary);
    border: none;
    border-radius: 10px;
    width: 48px;
    height: 48px;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    -webkit-box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
    font-size: 1.2rem;
}

.hamburger-btn:active {
    -webkit-transform: scale(0.92);
    transform: scale(0.92);
}

/* Overlay escuro do drawer */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    z-index: 1300;
    opacity: 0;
    pointer-events: none;
    -webkit-transition: opacity 0.3s ease;
    transition: opacity 0.3s ease;
    /* iOS/Android fix */
    -webkit-overflow-scrolling: touch;
}

.drawer-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* Drawer lateral esquerdo — Android style */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(80vw, 280px);
    height: 100%;
    height: -webkit-fill-available;
    background: white;
    z-index: 1400;
    -webkit-transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 4px 0 20px rgba(0,0,0,0.25);
    -webkit-box-shadow: 4px 0 20px rgba(0,0,0,0.25);
}

.mobile-drawer.open {
    left: 0;
}

/* Cabeçalho do drawer */
.drawer-header {
    padding: 1.5rem 1rem 1rem;
    padding-top: max(1.5rem, env(safe-area-inset-top));
    background: var(--color-primary);
    color: white;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    gap: 0.5rem;
}

.drawer-header img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.3);
}

.drawer-header h3 {
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    color: var(--color-tertiary);
}

/* Itens do menu drawer */
.drawer-menu {
    -webkit-flex: 1;
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.drawer-menu-item {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.25rem;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    color: #333;
    font-size: 0.95rem;
    font-weight: 500;
    -webkit-transition: background-color 0.15s;
    transition: background-color 0.15s;
    min-height: 52px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    -webkit-user-select: none;
    user-select: none;
}

.drawer-menu-item i {
    width: 22px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-primary);
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.drawer-menu-item:active {
    background: rgba(0,0,0,0.07);
}

.drawer-menu-item:hover {
    background: rgba(0,0,0,0.04);
}

.drawer-separator {
    height: 1px;
    background: #e0e0e0;
    margin: 0.5rem 1rem;
}

/* Botão Fechar Aplicativo no drawer */
.drawer-menu-item.drawer-close-app {
    color: #dc2626;
    margin-top: auto;
    border-bottom: none;
}

.drawer-menu-item.drawer-close-app i {
    color: #dc2626;
}

/* Footer do drawer */
.drawer-footer {
    padding: 0.75rem 1.25rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    border-top: 1px solid #e0e0e0;
}

/* ============================================================
   TELA INICIAL FRONTEND (mobile-first)
   ============================================================ */
.home-logo-wrap {
    margin: 5rem auto 1.5rem;
    width: 160px;
    height: 160px;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
}

.home-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    -webkit-box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

/* Botões sociais na home (abaixo do logo) */
.home-social-btns {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 0.75rem;
    -webkit-justify-content: center;
    justify-content: center;
    padding: 0.5rem 0.75rem 1rem;
    width: 100%;
}

.btn-social-home {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(0,0,0,0.18);
    -webkit-box-shadow: 0 3px 8px rgba(0,0,0,0.18);
    -webkit-transition: all 0.15s;
    transition: all 0.15s;
    min-height: 44px;
    color: white;
}

.btn-social-home:active {
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
}

.btn-social-home.whatsapp { background: #25D366; }
.btn-social-home.instagram { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.btn-social-home.pix { background: #00BDAE; }

/* ============================================================
   DESKTOP ADMIN — TOP BAR + SIDEBAR
   ============================================================ */

/* Top bar do painel admin */
.admin-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--color-primary);
    color: white;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 900;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    -webkit-box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.admin-topbar .topbar-brand {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-tertiary);
}

.admin-topbar .topbar-brand i {
    font-size: 1.4rem;
}

.topbar-right {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 0.75rem;
}

.topbar-badge {
    background: var(--color-tertiary);
    color: var(--color-primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.topbar-logout-btn {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    -webkit-transition: all 0.15s;
    transition: all 0.15s;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 0.4rem;
    min-height: 36px;
    white-space: nowrap;
}

.topbar-logout-btn:active,
.topbar-logout-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* Layout admin com sidebar */
.admin-layout {
    display: -webkit-flex;
    display: flex;
    min-height: 100vh;
    padding-top: var(--topbar-height);
}

/* Sidebar esquerda desktop */
.admin-sidebar {
    width: var(--sidebar-width);
    background: #1e1e2e;
    color: white;
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    z-index: 800;
    box-shadow: 2px 0 8px rgba(0,0,0,0.2);
    -webkit-box-shadow: 2px 0 8px rgba(0,0,0,0.2);
    -webkit-transition: left 0.3s ease;
    transition: left 0.3s ease;
}

/* Itens do menu sidebar */
.sidebar-menu {
    -webkit-flex: 1;
    flex: 1;
    padding: 1rem 0;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
}

.sidebar-menu-item {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 500;
    -webkit-transition: all 0.15s;
    transition: all 0.15s;
    min-height: 48px;
    border-left: 3px solid transparent;
}

.sidebar-menu-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: var(--color-tertiary);
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    opacity: 0.8;
}

.sidebar-menu-item:hover {
    background: rgba(255,255,255,0.06);
    color: white;
    border-left-color: var(--color-tertiary);
}

.sidebar-menu-item:hover i {
    opacity: 1;
}

.sidebar-menu-item.active {
    background: rgba(255, 215, 0, 0.1);
    color: var(--color-tertiary);
    border-left-color: var(--color-tertiary);
}

.sidebar-menu-item.active i {
    opacity: 1;
}

.sidebar-separator {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 0.5rem 1rem;
}

/* Botão Fechar Aplicativo (sidebar) */
.sidebar-menu-item.close-app {
    color: #ff6b6b;
    margin-top: auto;
}

.sidebar-menu-item.close-app i {
    color: #ff6b6b;
    opacity: 1;
}

.sidebar-menu-item.close-app:hover {
    background: rgba(255, 107, 107, 0.1);
    border-left-color: #ff6b6b;
}

/* Área de conteúdo principal do admin */
.admin-content {
    margin-left: var(--sidebar-width);
    -webkit-flex: 1;
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    min-height: calc(100vh - var(--topbar-height));
    max-width: 900px;
}

/* ============================================================
   RESPONSIVIDADE: Mobile no Admin
   ============================================================ */

/* Em mobile, esconde sidebar fixa e mostra versão drawer */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .admin-sidebar {
        left: -280px;
        width: 280px;
        z-index: 1400;
        top: 0;
        -webkit-transition: left 0.3s ease;
        transition: left 0.3s ease;
    }

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

    .admin-content {
        margin-left: 0;
        padding: 1rem 0.75rem;
    }

    .admin-topbar {
        padding: 0 0.75rem;
    }

    .admin-topbar .topbar-brand span {
        font-size: 0.9rem;
    }

    .topbar-badge {
        display: none;
    }

    /* Botão hamburguer no topbar admin */
    .admin-topbar-hamburger {
        display: -webkit-flex;
        display: flex;
    }
}

@media (min-width: 769px) {
    .admin-topbar-hamburger {
        display: none;
    }

    /* Idioma no topbar admin — posição ajustada */
    .admin-language-switcher {
        position: static;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }

    .admin-language-switcher button {
        background: rgba(255,255,255,0.12);
        border-color: transparent;
        min-width: 38px;
        min-height: 38px;
    }
}

/* Hamburguer admin (mobile) */
.admin-topbar-hamburger {
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.1rem;
    -webkit-transition: all 0.15s;
    transition: all 0.15s;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
}

.admin-topbar-hamburger:active {
    background: rgba(255,255,255,0.25);
}

/* ============================================================
   BOTÃO VOLTAR — Android style
   ============================================================ */
.btn-voltar {
    background: var(--color-tertiary);
    color: var(--color-quaternary);
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    -webkit-box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    -webkit-transition: all 0.15s;
    transition: all 0.15s;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 1rem;
    min-height: 44px;
}

.btn-voltar:active {
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
}

/* ============================================================
   BOTÕES GERAIS
   ============================================================ */
.btn-mobile,
.btn-primary {
    width: 100%;
    padding: 0.9rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    -webkit-box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    -webkit-transition: all 0.15s;
    transition: all 0.15s;
    min-height: 48px;
    display: block;
    text-align: center;
}

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

.btn-mobile:active,
.btn-primary:active {
    -webkit-transform: scale(0.97);
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    -webkit-box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Botão Relatório */
.btn-relatorio {
    background: #dc2626;
    color: white;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    -webkit-transition: all 0.15s;
    transition: all 0.15s;
    min-height: 44px;
}

.btn-relatorio:active {
    background: #b91c1c;
    -webkit-transform: scale(0.96);
    transform: scale(0.96);
}

/* Botões de ação (tabelas) */
.btn-alterar,
.btn-excluir,
.btn-gravar,
.btn-novo {
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 4px;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 2px;
    min-height: 36px;
    -webkit-transition: all 0.15s;
    transition: all 0.15s;
}

.btn-alterar {
    background: var(--color-tertiary);
    color: var(--color-quaternary);
}

.btn-excluir {
    background: #dc2626;
    color: white;
}

.btn-gravar {
    background: #16a34a;
    color: white;
}

.btn-novo {
    background: var(--color-tertiary);
    color: var(--color-quaternary);
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
}

.btn-alterar:active,
.btn-excluir:active,
.btn-gravar:active,
.btn-novo:active {
    opacity: 0.8;
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
}

/* ============================================================
   FORMULÁRIOS — Mobile Friendly
   ============================================================ */
.form-input {
    width: 100%;
    padding: 0.8rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px !important;
    background: white;
    color: #111;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-transition: border-color 0.2s;
    transition: border-color 0.2s;
    min-height: 48px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-tertiary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
    -webkit-box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

select.form-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-container,
.config-form,
.config-container {
    background: rgba(255, 255, 255, 0.08);
    padding: 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.15);
}

/* === LOGO HOME === */
.logo-container {
    width: 160px;
    height: 160px;
    margin: 2.5rem auto 1.75rem;
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    -webkit-box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

/* === RODAPÉ === */
footer {
    padding: 1rem;
    text-align: center;
    color: white;
    margin-top: auto;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    position: relative;
    z-index: 1;
}

.footer-logo {
    width: 50px;
    height: 35px;
    object-fit: cover;
    border-radius: 4px;
}

/* === TABELAS — Mobile Scroll === */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    -webkit-box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    display: block;
    width: 100%;
}

table {
    min-width: 100%;
    font-size: 0.85rem;
    border-collapse: collapse;
    width: 100%;
}

th, td {
    padding: 0.6rem 0.5rem;
    text-align: left;
    white-space: nowrap;
}

th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
}

tbody tr {
    border-bottom: 1px solid #f0f0f0;
    -webkit-transition: background-color 0.15s;
    transition: background-color 0.15s;
}

tbody tr:active {
    background-color: rgba(0,0,0,0.04);
}

/* === GALERIA DE FOTOS === */
.foto-grid {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 0.75rem 1fr;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .foto-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.foto-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    -webkit-box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    -webkit-transition: -webkit-transform 0.2s;
    transition: transform 0.2s;
    aspect-ratio: 2/3;
    background: #f0f0f0;
}

.foto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.foto-item button {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: rgba(239, 68, 68, 0.92);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    -webkit-transition: all 0.15s;
    transition: all 0.15s;
}

.foto-item button:active {
    background: rgba(220, 38, 38, 1);
    -webkit-transform: scale(1.1);
    transform: scale(1.1);
}

/* === COLOR PICKER === */
.color-picker-container {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 0.75rem;
}

.color-preview {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

input[type="color"] {
    height: 48px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    padding: 2px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 6px;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

/* === TEXTAREA === */
textarea.form-input {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

.modal-content {
    max-width: 400px;
    width: 100%;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    -webkit-box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    -webkit-animation: modalFadeIn 0.25s ease;
    animation: modalFadeIn 0.25s ease;
    margin: auto;
}

@-webkit-keyframes modalFadeIn {
    from {
        opacity: 0;
        -webkit-transform: scale(0.88) translateY(20px);
        transform: scale(0.88) translateY(20px);
    }
    to {
        opacity: 1;
        -webkit-transform: scale(1) translateY(0);
        transform: scale(1) translateY(0);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* === HIDDEN === */
.hidden {
    display: none !important;
}

/* === ANIMAÇÕES === */
@-webkit-keyframes fadeIn {
    from { opacity: 0; -webkit-transform: translateY(8px); transform: translateY(8px); }
    to   { opacity: 1; -webkit-transform: translateY(0);   transform: translateY(0); }
}

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

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-tertiary);
    border-radius: 4px;
}

/* === FOCO ACESSÍVEL === */
*:focus-visible {
    outline: 3px solid var(--color-tertiary);
    outline-offset: 2px;
}

/* ============================================================
   RESPONSIVIDADE EXTRA — TELAS PEQUENAS ANDROID
   ============================================================ */

@media (max-width: 360px) {
    .home-logo-wrap {
        width: 120px;
        height: 120px;
        margin-top: 4.5rem;
    }

    .drawer-menu-item {
        font-size: 0.88rem;
        padding: 0.75rem 1rem;
    }
}

@media (min-width: 769px) {
    .home-logo-wrap {
        margin-top: 2rem;
    }
}

/* === FIREFOX COMPAT === */
@-moz-document url-prefix() {
    .form-input {
        padding: 0.75rem;
    }
    input[type="color"] {
        padding: 4px;
    }
}

/* === PRINT === */
@media print {
    .btn-mobile, .btn-voltar, button, footer, .language-switcher,
    .admin-sidebar, .admin-topbar, .hamburger-btn, .mobile-drawer,
    .drawer-overlay { display: none !important; }
    body { background: white !important; }
}

/* === LOADING === */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* === PREFERS REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    * {
        -webkit-animation-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        -webkit-transition-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* === TOAST ANDROID STYLE === */
.toast-notification {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    background: rgba(30,30,30,0.92);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    -webkit-box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    max-width: 90vw;
    text-align: center;
    -webkit-animation: toastIn 0.3s ease;
    animation: toastIn 0.3s ease;
}

@-webkit-keyframes toastIn {
    from { opacity: 0; -webkit-transform: translateX(-50%) translateY(20px); transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; -webkit-transform: translateX(-50%) translateY(0);   transform: translateX(-50%) translateY(0); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === FORM LABELS === */
label.block {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

/* === SPACE-Y === */
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* === GRID 2 COLUNAS === */
.grid.grid-cols-2 {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 1rem 1fr;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* === CHECKBOX E RADIO === */
input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-tertiary);
    -webkit-appearance: auto;
    appearance: auto;
}

input[type="file"].form-input {
    padding: 0.6rem;
    font-size: 0.9rem;
    min-height: 44px;
}

.border-2 {
    border-width: 2px;
    border-style: solid;
}

.rounded-lg {
    border-radius: 10px;
}

/* Edge Legacy Fix */
@supports (-ms-ime-align: auto) {
    .admin-sidebar { position: fixed; }
    .admin-content { margin-left: var(--sidebar-width); }
}

/* Admin content screens (para-screens que aparecem dentro do admin) */
.admin-inner-screen {
    padding: 0;
}

/* Overlay do drawer no admin mobile */
.admin-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    z-index: 1300;
    opacity: 0;
    pointer-events: none;
    -webkit-transition: opacity 0.3s ease;
    transition: opacity 0.3s ease;
}

.admin-drawer-overlay.open {
    opacity: 1;
    pointer-events: all;
}
