.login-form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
}
.login-form {
    max-width: 100vw;
    width: 420px;
    padding: 48px;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}
.login-form img {
    max-width: 80%;
    margin-bottom: 1.5rem;
}
.login-form .form-control {
    background-color: #f8f9fa;
    padding: 12px 15px;
}
.app-header.header-text-light .app-header__logo .logo-src,
.app-sidebar.sidebar-text-light .app-header__logo .logo-src,
.app-header.header-text-dark .app-header__logo .logo-src,
.app-header__logo .logo-src {
    height: 46px !important;
    width: 150px !important;
    background-position: left center !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
}
@media (max-width: 991.98px) {
    .popover, .dropdown-menu {
        top: 64px!important;
        width: 100%!important;
        left: 50%!important;
        transform: translateX(-50%)!important;
    }
    .app-header.header-text-light .header-mobile-open {
        width: fit-content;
        left: 50%;
        transform: translateX(-50%);
        overflow: visible;
    }
}

.table th, td {
    padding: 16px 8px;
}
.table th {
    border-top: none;
}
.table td {
    color: var(--secondary);
}
.tox.tox-tinymce {
    border-radius: .25rem;
}
.selectize-dropdown-content > .create {
    padding: 4px 12px;
    font-size: 0.9em;
    opacity: 0.8;
}
.variations-table th {
    padding-top: 0;
}
.variations-table input[type=checkbox].form-control {
    height: 16px;
    max-width: 16px;
}
.toast-bottom-center {
    pointer-events: none;
}
.toast {
    pointer-events: all;
}
.fakeinput-readonly {
    font-size: 1.2rem;
    margin-top: -10px;
}
.fakeinputgroup-readonly {
    margin-top: -10px;
}
.fakeinputgroup-readonly ~ .fakeinputgroup-readonly {
    margin-top: 0px;
}
.custom-color {
    border:1px dashed black;
    appearance: none;
    outline: none;
    background: transparent;
    width: 100%;
    height: 40px;
    padding:0;
}
.custom-color::-webkit-color-swatch{
    border:1px dashed white;
    width: 100%;
    height:100%;
}

.propagandas{
    max-height: 100px;
}

.perfil{
    max-width: 300px;
}

.tooltip {
    pointer-events: none;
}
/* ========================================================
   MELHORIAS DE UI / UX APLICADAS
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif !important;
    background-color: #f4f6f9;
}

/* Cards mais suaves e modernos */
.main-card.card, .card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}
.card:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
}
.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background-color: #ffffff;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    font-weight: 600;
}

/* Botões Modernizados */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
}
.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    box-shadow: 0 4px 10px rgba(0,123,255,0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,123,255,0.4);
}

/* Tabela Elegante */
.table th {
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #edf2f9;
    background-color: #f8f9fa;
}
.table td {
    vertical-align: middle;
    color: #495057;
    border-bottom: 1px solid #edf2f9;
}

/* Inputs globais aprimorados */
.form-control {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Header e Sidebar com sombras leves */
.app-sidebar {
    box-shadow: 2px 0 15px rgba(0,0,0,0.03);
    border-right: 1px solid rgba(0,0,0,0.02);
}
.app-header {
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
    border-bottom: 1px solid rgba(0,0,0,0.02);
}

/* ========================================================
   DARK MODE (NIGHT THEME) - ATIVA AUTOMATICAMENTE
   ======================================================== */

@media (prefers-color-scheme: dark) {
    /* Fundo da Aplicação */
    body, .app-main {
        background-color: #0f172a !important;
        color: #e2e8f0 !important;
    }
    .app-container {
        background-color: #0f172a !important;
    }

    /* Header e Sidebar */
    .app-header, .app-sidebar {
        background-color: #1e293b !important;
        border-color: #334155 !important;
    }
    .app-header .app-header__logo .logo-src {
        filter: brightness(0) invert(1); /* Torna a logo branca */
    }
    .app-sidebar__heading {
        color: #94a3b8 !important;
    }
    .metismenu-icon, .metismenu-link {
        color: #cbd5e1 !important;
    }
    .metismenu-link:hover {
        background-color: #334155 !important;
        color: #ffffff !important;
    }

    /* Cards e Containers */
    .main-card.card, .card {
        background-color: #1e293b !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }
    .card-header {
        background-color: #1e293b !important;
        border-bottom: 1px solid #334155 !important;
        color: #f8fafc !important;
    }
    .card-title {
        color: #f8fafc !important;
    }

    /* Tabelas */
    .table {
        color: #e2e8f0 !important;
    }
    .table th {
        background-color: #0f172a !important;
        color: #94a3b8 !important;
        border-bottom: 2px solid #334155 !important;
    }
    .table td {
        border-bottom: 1px solid #334155 !important;
        color: #cbd5e1 !important;
    }
    .table-hover tbody tr:hover {
        background-color: rgba(255, 255, 255, 0.05) !important;
    }

    /* Formulários e Inputs */
    .form-control {
        background-color: #0f172a !important;
        border: 1px solid #334155 !important;
        color: #f8fafc !important;
    }
    .form-control:focus {
        background-color: #1e293b !important;
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
    }
    label {
        color: #cbd5e1 !important;
    }

    /* Tela de Login Dark Glassmorphism */
    .login-form-container {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    }
    .login-form {
        background-color: rgba(30, 41, 59, 0.75) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
    }
    .login-form img {
        filter: brightness(0) invert(1);
    }
    
    /* Textos secundários (ex: subtítulos na page-title) */
    .page-title-subheading {
        color: #94a3b8 !important;
    }
    .app-page-title .page-title-heading {
        color: #f8fafc !important;
    }

    /* Paginação e Dropdowns */
    .pagination .page-link {
        background-color: #1e293b;
        border-color: #334155;
        color: #cbd5e1;
    }
    .pagination .page-item.active .page-link {
        background-color: #3b82f6;
        border-color: #3b82f6;
    }
    .dropdown-menu {
        background-color: #1e293b !important;
        border: 1px solid #334155 !important;
    }
    .dropdown-item {
        color: #e2e8f0 !important;
    }
    .dropdown-item:hover {
        background-color: #334155 !important;
    }
}

@media (prefers-color-scheme: dark) {
    .app-main__outer, .app-main__inner {
        background-color: #0f172a !important;
    }
    
    /* Popovers, tooltips, modais */
    .modal-content {
        background-color: #1e293b !important;
        border-color: #334155 !important;
        color: #f8fafc !important;
    }
    .modal-header {
        border-bottom-color: #334155 !important;
    }
    .modal-footer {
        border-top-color: #334155 !important;
    }
    .close {
        color: #f8fafc !important;
        text-shadow: none !important;
    }
}

/* Correção: Botões de Ações sempre alinhados à direita (ignorando tds de tabela vazia com colspan) */
.table th:last-child:not([colspan]),
.table td:last-child:not([colspan]) {
    text-align: right !important;
    white-space: nowrap;
    width: 1%; /* Faz a coluna encolher para caber apenas o conteúdo */
}

.table td:last-child:not([colspan]) .btn-group,
.table td:last-child:not([colspan]) .btn {
    float: right;
    justify-content: flex-end;
}

/* ========================================================
   ESTILO DA SIDEBAR - NOVO LAYOUT (INSPIRADO NA REFERÊNCIA)
   ======================================================== */

/* Cabeçalhos (Categorias) */
.sidebar-modern-layout .app-sidebar__heading {
    text-transform: uppercase;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 1.5rem;
    margin-bottom: 0.2rem;
    padding-left: 1.2rem !important;
}

/* Links do menu */
.sidebar-modern-layout .vertical-nav-menu li a {
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0 1rem 0 2.5rem !important;
    height: 2.2rem;
    line-height: 2.2rem;
    border-radius: 8px;
    margin: 0.2rem 0.8rem;
    transition: all 0.2s ease;
}

/* Ícones dos links */
.sidebar-modern-layout .vertical-nav-menu li a i.metismenu-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 0;
    opacity: 0.7;
}

/* Hover nos links */
.sidebar-modern-layout .vertical-nav-menu li a:hover {
    background-color: rgba(59, 130, 246, 0.05) !important;
    text-decoration: none;
}
.sidebar-modern-layout .vertical-nav-menu li a:hover i.metismenu-icon {
    opacity: 1;
}

/* Estado Ativo (Active) */
.sidebar-modern-layout .vertical-nav-menu li a.mm-active {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: #3b82f6 !important;
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.sidebar-modern-layout .vertical-nav-menu li a.mm-active i.metismenu-icon {
    color: #3b82f6 !important;
    opacity: 1;
}

/* Base Ativa */
.sidebar-base-ativa {
    padding: 0 0.5rem 1rem 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.sidebar-user-profile {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-color: rgba(0, 0, 0, 0.05) !important;
}
