@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root { 
    --primary-color: #389599; 
    --primary-hover: #2c7a7d; 
    --bg-body: #F4F7F6; 
    --sidebar-bg: #113233; 
    --sidebar-hover: #1f5052; 
    --accent-color: #FF9F43; /* Added for the glass plate border */
}
/* =======================================================================
   BASE DE TIPOGRAFIA CORPORATIVA (REDUÇÃO GLOBAL DE ESCALA)
   ======================================================================= */
html {
    font-size: 14px !important; /* Reduz a escala base de todo o Bootstrap de 16px para 14px */
}

body { 
    background-color: var(--bg-body); 
    font-family: 'Inter', sans-serif; 
    overflow-x: hidden; 
    margin: 0;
    font-size: 0.9rem; /* Texto padrão mais refinado */
    color: #334155; 
}

/* Redução proporcional dos Títulos (h1 a h6) para não ficarem "gritando" na tela */
h1, .h1 { font-size: 1.6rem !important; }
h2, .h2 { font-size: 1.4rem !important; }
h3, .h3 { font-size: 1.15rem !important; }
h4, .h4 { font-size: 1.05rem !important; }
h5, .h5 { font-size: 0.95rem !important; }
h6, .h6 { font-size: 0.85rem !important; }

/* Força inputs, selects e tabelas a terem um tamanho mais compacto e elegante */
.form-control, .form-select { 
    font-size: 0.85rem !important; 
}
.table {
    font-size: 0.85rem !important;
}
.form-label { 
    font-size: 0.75rem !important; 
}

@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.animate-up { animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; }
.delay-1 { animation-delay: 0.2s; } .delay-2 { animation-delay: 0.4s; } .delay-3 { animation-delay: 0.6s; }

#login-screen { display: flex; height: 100vh; overflow: hidden; background-color: #ffffff; }
.login-left { width: 100%; max-width: 480px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; z-index: 10; background: #fff; position: relative; overflow-y: auto; }
.login-form-container { width: 100%; max-width: 340px; margin: auto; text-align: center; }

.form-control, .form-select { background-color: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px; height: 55px; transition: 0.3s;}
.form-control:focus, .form-select:focus { box-shadow: 0 0 0 4px rgba(56, 149, 153, 0.15); border-color: var(--primary-color); }

/* Custom Login/Call Buttons */
.btn-custom { background-color: var(--primary-color); color: white; border-radius: 12px; font-weight: 700; height: 55px; transition: 0.3s; font-size: 1.1rem; border: none; width: 100%; display: flex; align-items: center; justify-content: center;}
.btn-custom:hover { background-color: var(--primary-hover); color: white; transform: translateY(-3px); box-shadow: 0 10px 20px rgba(56, 149, 153, 0.25); }

.login-right { flex: 1; position: relative; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(135deg, #123032 0%, #1a4548 50%, #0d2224 100%); overflow: hidden; padding: 4rem; perspective: 1000px; align-items: center;}

/* Background image overlay */
.engineering-reveal { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-image: linear-gradient(rgba(18, 48, 50, 0.2), rgba(18, 48, 50, 0.2)), url('../fundo.png'); background-size: cover; background-position: center; -webkit-mask-image: radial-gradient(circle 350px at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(0,0,0,1) 0%, transparent 80%); mask-image: radial-gradient(circle 350px at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(0,0,0,1) 0%, transparent 80%); z-index: 2; pointer-events: none; transition: opacity 0.4s; opacity: 0; }
.login-right:hover .engineering-reveal { opacity: 1; }

.right-content-wrapper { z-index: 5; display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 800px; gap: 40px; }
.glass-plates-container { display: flex; gap: 20px; width: 100%; justify-content: center; }
.glass-plate { flex: 1; background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.15); box-shadow: 0 15px 35px rgba(0,0,0,0.2); border-radius: 16px; padding: 1.5rem; text-align: center; border-bottom: 4px solid var(--accent-color); transition: transform 0.3s; color: white;}
.glass-plate:hover { transform: translateY(-10px); }
.plate-icon { font-size: 2rem; color: #FF9F43; margin-bottom: 10px; display: block; }
.plate-title { font-weight: bold; text-transform: uppercase; margin-bottom: 10px; letter-spacing: 2px; font-size: 0.9rem; }
.plate-text { margin-bottom: 0; font-size: 0.9rem; line-height: 1.5; opacity: 0.9;}

.cta-container { text-align: center; color: white; background: rgba(0,0,0,0.2); padding: 3rem; border-radius: 24px; border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(10px); width: 100%;}
.btn-call { background: #FF9F43; color: white; border: none; padding: 15px 40px; border-radius: 50px; font-size: 1.2rem; font-weight: 800; transition: 0.3s; box-shadow: 0 10px 25px rgba(255, 159, 67, 0.4); text-transform: uppercase; letter-spacing: 1px; width: 100%; max-width: 400px;}
.btn-call:hover { background: #f28c2c; transform: scale(1.05); color: white; }

.modal { z-index: 1055 !important; }
.modal-backdrop { z-index: 1050 !important; }

#app-container { display: none; }
.app-screen { display: none; padding-bottom: 50px; }

/* =========================================================================
   ESTILIZAÇÃO GLOBAL DE BOTÕES - PADRÃO ERP PREMIUM (NOVO)
   ========================================================================= */

/* Esta regra afeta todos os botões padrão do sistema (dentro do App, Modais, Tabelas) */
#app-container .btn:not(.btn-toggle-menu):not(.btn-logout-premium):not(.btn-close), 
.modal-content .btn:not(.btn-close) {
    font-size: 0.8rem !important;        /* Letra reduzida e mais elegante */
    font-weight: 600 !important;         /* Texto firme para leitura */
    padding: 0.4rem 0.9rem !important;   /* Deixa o botão mais fino e compacto */
    border-radius: 6px !important;       /* Curvatura moderna */
    letter-spacing: 0.3px !important;    /* Leve espaçamento Premium nas letras */
    transition: all 0.2s ease-in-out !important; /* Prepara para a animação suave */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;                 /* Espaço perfeito entre o Ícone e o Texto */
    white-space: nowrap !important;
}

/* Efeito de Elevação (Hover) */
#app-container .btn:not(:disabled):not(.disabled):not(.btn-toggle-menu):not(.btn-logout-premium):not(.btn-close):hover,
.modal-content .btn:not(:disabled):not(.disabled):not(.btn-close):hover {
    transform: translateY(-1.5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12) !important;
    filter: brightness(1.05);
}

/* Efeito de Clique (Active) */
#app-container .btn:not(:disabled):not(.disabled):not(.btn-toggle-menu):not(.btn-logout-premium):not(.btn-close):active,
.modal-content .btn:not(:disabled):not(.disabled):not(.btn-close):active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

/* Diminui os ícones de dentro dos botões */
#app-container .btn i, .modal-content .btn i {
    font-size: 0.85rem !important;
}

/* Regra específica para botões muito pequenos (Tabelas) */
#app-container .btn-sm, .modal-content .btn-sm {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.6rem !important;
    border-radius: 5px !important;
}
#app-container .btn-sm i, .modal-content .btn-sm i {
    font-size: 0.75rem !important;
}

/* Retira a borda preta estranha ao focar no botão */
#app-container .btn:focus, #app-container .btn:focus-visible,
.modal-content .btn:focus, .modal-content .btn:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(56, 149, 153, 0.25) !important;
}

/* =========================================================================
   ESTILOS GERAIS DE CARDS E LISTAS
   ========================================================================= */

.menu-card { cursor: grab; border: none; border-radius: 20px; background: #ffffff; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 10px 25px rgba(0,0,0,0.04); position: relative; overflow: hidden; z-index: 1; padding: 2rem 1rem !important; height: 100%; }
.menu-card:active { cursor: grabbing; }
.menu-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--primary-color); transition: all 0.3s ease; }
.menu-card.maa-card::before { background: #f59e0b; }
.menu-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(56, 149, 153, 0.15); }
.menu-card.maa-card:hover { box-shadow: 0 20px 40px rgba(245, 158, 11, 0.15); }
.menu-card .icon-wrapper { width: 75px; height: 75px; border-radius: 22px; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem auto; background: rgba(56, 149, 153, 0.08); color: var(--primary-color); transition: all 0.4s ease; }
.menu-card.maa-card .icon-wrapper { background: rgba(245, 158, 11, 0.08); color: #f59e0b; }
.menu-card:hover .icon-wrapper { background: var(--primary-color); color: #ffffff; transform: rotate(10deg) scale(1.1); box-shadow: 0 10px 20px rgba(56, 149, 153, 0.3); }
.menu-card.maa-card:hover .icon-wrapper { background: #f59e0b; color: #ffffff; transform: rotate(10deg) scale(1.1); box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3); }

.sortable-ghost { opacity: 0.4; }
.sortable-drag { cursor: grabbing !important; }

.fin-tab-card { cursor: pointer; transition: 0.2s; border: 1px solid #E2E8F0; border-radius: 12px; background: white; color: #64748b;}
.fin-tab-card:hover { border-color: var(--primary-color); color: var(--primary-color); }
.fin-tab-card.active { background: var(--primary-color); color: white; border-color: var(--primary-color); box-shadow: 0 8px 15px rgba(56, 149, 153, 0.2); }

/* =========================================================================
   NOVO DESIGN PREMIUM - MENU LATERAL (ENGRENAR)
   ========================================================================= */
.sidebar-modern { 
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #153c3e 100%); 
    color: #f8fafc; 
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}
.sidebar-modern .offcanvas-header { 
    border-bottom: 1px solid rgba(255,255,255,0.08); 
    background-color: rgba(0,0,0,0.15); 
    padding: 1.5rem 1rem;
}
.sidebar-modern .list-group-item { 
    background: transparent; 
    color: #e2e8f0; 
    border: none; 
    margin-bottom: 6px; 
    border-radius: 10px; 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    padding: 12px 16px;
}
.sidebar-modern .list-group-item:hover, 
.sidebar-modern .list-group-item:focus { 
    background-color: var(--sidebar-hover); 
    color: #ffffff; 
    transform: translateX(6px); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.sidebar-modern .list-group-item i { 
    color: #7dc4c7 !important; 
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    transition: 0.3s;
}
.sidebar-modern .list-group-item:hover i { 
    color: #ffffff !important; 
    text-shadow: 0 0 8px rgba(255,255,255,0.4);
}
.sidebar-modern .sub-menu-link { 
    padding-left: 3.2rem !important; 
    font-size: 0.85rem; 
    font-weight: 500;
    color: #cbd5e1;
    margin-bottom: 2px;
}
.sidebar-modern .sub-menu-link:hover { 
    border-left: 3px solid var(--primary-color); 
    background-color: rgba(56, 149, 153, 0.15); 
    color: #fff;
    transform: translateX(0);
}
/* ========================================================================= */

.caixa-ativo-click { cursor: pointer; transition: 0.2s; }
.caixa-ativo-click:hover { background-color: #e6f4ea !important; border-color: #28a745 !important; }

/* Refined Toolbar avoiding overriding new button styles too much */
.system-toolbar { display: inline-flex; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 4px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); gap: 4px; flex-wrap: wrap; }

.btn-toolbar-primary { background-color: #f0f9ff; color: #0284c7; }
.btn-toolbar-primary:hover { background-color: #0284c7; color: #ffffff; }
.btn-toolbar-success { background-color: #f0fdf4; color: #16a34a; }
.btn-toolbar-success:hover { background-color: #16a34a; color: #ffffff; }
.btn-toolbar-warning { background-color: #fffbeb; color: #d97706; }
.btn-toolbar-warning:hover { background-color: #d97706; color: #ffffff; }
.btn-toolbar-info { background-color: #f5f3ff; color: #7c3aed; }
.btn-toolbar-info:hover { background-color: #7c3aed; color: #ffffff; }
.btn-toolbar-danger { background-color: #fef2f2; color: #dc2626; }
.btn-toolbar-danger:hover { background-color: #dc2626; color: #ffffff; }

@media print {
    body * { visibility: hidden; }
    #screen-orcamento-externo, #screen-orcamento-externo * { visibility: visible; }
    #screen-orcamento-externo { position: absolute; left: 0; top: 0; width: 100%; margin: 0; padding: 0; background: #fff;}
    .no-print { display: none !important; }
    .card { border: none !important; box-shadow: none !important; }
    .modal { position: absolute; left: 0; top: 0; margin: 0; padding: 0; visibility: visible !important; }
    .modal * { visibility: visible !important; }
    .modal-content { border: none !important; box-shadow: none !important; }
}

/* =========================================================================
   NOVO DESIGN PREMIUM - BARRA SUPERIOR (HEADER-APP) E COMPONENTES
   ========================================================================= */
#header-app {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    z-index: 1000;
}

#header-app .navbar-brand span {
    letter-spacing: -0.5px;
}

/* Estilo Premium para o Filtro Global de Empresas */
.top-filter-container select {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-weight: 700;
    border-radius: 50px;
    padding: 10px 35px 10px 42px; /* Espaço para o ícone */
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    height: 42px;
}

.top-filter-container select:hover {
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 4px 10px rgba(56, 149, 153, 0.1);
}

.top-filter-container select:focus {
    box-shadow: 0 0 0 4px rgba(56, 149, 153, 0.15);
    border-color: var(--primary-color);
    outline: none;
}

/* Botão Sair Premium */
.btn-logout-premium {
    background: #fff0f2;
    color: #e11d48;
    border: 1px solid #ffe4e6;
    border-radius: 50px;
    font-weight: 700;
    padding: 8px 22px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    /* Resetting the global button styles specifically for this one to keep its unique shape */
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-logout-premium:hover {
    background: #e11d48;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(225, 29, 72, 0.25);
    border-color: #e11d48;
}

/* Botão Toggle Menu (Mobile/Desktop) */
.btn-toggle-menu {
    background-color: rgba(56, 149, 153, 0.08);
    color: var(--primary-color);
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-toggle-menu:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: rotate(90deg) scale(1.05);
    box-shadow: 0 4px 12px rgba(56, 149, 153, 0.3);
}

/* Sino de Notificação */
.bell-container {
    width: 40px; 
    height: 40px; 
    background: #ffffff; 
    border-radius: 50%; 
    cursor: pointer; 
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}
.bell-container:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}