/*
=========================================
TEMA CORPORATIVO - FÁBRICA DE VEÍCULOS
=========================================
Cores base: 
- Vermelho Corporativo: #db001b
- Preto Corporativo: #1a171b
- Variações complementares para um visual profissional
*/

/* ==== VARIÁVEIS DE CORES ==== */
:root {
    --primary-red: #db001b;
    --primary-black: #1a171b;
    --dark-red: #b50017;
    --light-red: #ff1a35;
    --gray-dark: #2a2a2a;
    --gray-medium: #4a4a4a;
    --gray-light: #f5f5f5;
    --white: #ffffff;
    --silver: #c0c0c0;
    --steel-blue: #3d4a5c;
    --warning-orange: #ff6b35;
    --success-green: #28a745;
    --info-blue: #17a2b8;
}

/* ==== RESET E CONFIGURAÇÕES GLOBAIS ==== */
body {
    background: linear-gradient(135deg, var(--gray-light) 0%, #e8e8e8 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--primary-black);
    line-height: 1.6;
}

/* ==== LAYOUT PRINCIPAL ==== */
.main_container {
    background: var(--white);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
    border-radius: 0;
}

/* ==== SIDEBAR LATERAL ==== */
.left_col {
    background: linear-gradient(180deg, var(--primary-black) 0%, var(--gray-dark) 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    width: 230px !important;
    max-width: 230px;
    overflow: hidden;
}

.nav_title {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    border-bottom: 3px solid var(--primary-black);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.site_title {
    color: var(--white) !important;
    font-weight: 700;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.site_title:hover {
    color: var(--silver) !important;
    text-decoration: none;
}

/* ==== MENU LATERAL ==== */
.nav.side-menu > li > a {
    color: var(--silver);
    padding: 15px 20px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.nav.side-menu > li > a:hover {
    background: linear-gradient(90deg, rgba(219, 0, 27, 0.2) 0%, rgba(219, 0, 27, 0.05) 100%);
    border-left: 4px solid var(--primary-red);
    color: var(--white);
}

.nav.side-menu > li.active,
.nav.side-menu > li.current-page {
    background: linear-gradient(90deg, var(--primary-red) 0%, var(--dark-red) 100%);
    border-left: 4px solid var(--light-red);
    box-shadow: inset -5px 0 15px rgba(0, 0, 0, 0.2);
    max-width: 230px;
    overflow: hidden;
}

.nav.side-menu > li.active > a,
.nav.side-menu > li.current-page > a {
    color: var(--white);
    font-weight: 600;
}

.nav.child_menu {
    background: rgba(26, 23, 27, 0.8);
    width: 100%;
    max-width: 230px;
    box-sizing: border-box;
}

.nav.child_menu li a {
    color: #bbb;
    padding: 12px 20px 12px 40px;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.nav.child_menu li a:hover,
.nav.child_menu li.active a {
    color: var(--white);
    background: rgba(219, 0, 27, 0.2);
    border-left: 2px solid var(--primary-red);
}

/* ==== CORREÇÕES PARA MENU LATERAL ==== */
.main_menu_side,
#sidebar-menu {
    width: 100%;
    max-width: 230px;
    overflow: hidden;
}

.nav.side-menu {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.nav.side-menu li {
    width: 100%;
    max-width: 230px;
    overflow: hidden;
    position: relative;
}

/* Garantir que elementos ativos não estourem */
.nav.side-menu > li.active > a,
.nav.side-menu > li.current-page > a {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==== PERFIL DO USUÁRIO ==== */
.profile_info {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin: 15px 10px;
    padding: 15px;
}

.profile_info h2 {
    color: var(--white);
    font-weight: 600;
    margin-bottom: 5px;
}

.profile_info span {
    color: var(--silver);
    font-size: 12px;
}

.img-circle.profile_img {
    border: 3px solid var(--primary-red);
    box-shadow: 0 0 15px rgba(219, 0, 27, 0.5);
}

/* ==== MENU SUPERIOR ==== */
.top_nav {
    background: linear-gradient(90deg, var(--white) 0%, #f8f9fa 100%);
    border-bottom: 3px solid var(--primary-red);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-right li a {
    color: var(--primary-black) !important;
    padding: 15px 20px;
    transition: all 0.3s ease;
}

.navbar-right li a:hover {
    background: var(--primary-red);
    color: var(--white) !important;
}

/* ==== ÁREA DE CONTEÚDO ==== */
.right_col {
    background: var(--white);
    min-height: calc(100vh - 70px);
}

/* ==== CARDS E PAINÉIS ==== */
.x_panel {
    background: var(--white);
    border: none;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.x_panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.x_title {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    color: var(--white);
    padding: 15px 20px;
    margin: -10px -17px 15px -17px;
    border-radius: 10px 10px 0 0;
}

.x_title h2 {
    color: var(--white);
    font-weight: 600;
    font-size: 18px;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* ==== BOTÕES ==== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    border: none;
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(219, 0, 27, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--dark-red) 0%, var(--primary-red) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(219, 0, 27, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-green) 0%, #1e7e34 100%);
    border: none;
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 600;
}

.btn-info {
    background: linear-gradient(135deg, var(--info-blue) 0%, #117a8b 100%);
    border: none;
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 600;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-orange) 0%, #e55a2b 100%);
    border: none;
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 600;
}

/* ==== ESTATÍSTICAS E CONTADORES ==== */
.tile_count .tile_stats_count {
    background: linear-gradient(135deg, var(--white) 0%, #f8f9fa 100%);
    border: none;
    border-radius: 15px;
    padding: 20px;
    margin: 10px 5px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tile_count .tile_stats_count:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.tile_count .tile_stats_count:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-red) 0%, var(--warning-orange) 100%);
}

.tile_count .tile_stats_count .count {
    color: var(--primary-red);
    font-weight: 700;
    font-size: 36px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==== FORMULÁRIOS ==== */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 0.2rem rgba(219, 0, 27, 0.25);
    outline: none;
}

/* ==== TABELAS ==== */
.table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-black) 0%, var(--gray-dark) 100%);
    color: var(--white);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 15px;
    border: none;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: rgba(219, 0, 27, 0.05);
    transform: scale(1.01);
}

/* ==== NAVEGAÇÃO DE ABAS ==== */
.nav-tabs {
    border-bottom: 3px solid var(--primary-red);
}

.nav-tabs li.active a,
.nav-tabs li.active a:hover,
.nav-tabs li.active a:focus {
    background: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: 10px 10px 0 0;
}

.nav-tabs li a {
    border: none;
    color: var(--gray-dark);
    font-weight: 600;
    padding: 15px 20px;
    transition: all 0.3s ease;
}

.nav-tabs li a:hover {
    background: rgba(219, 0, 27, 0.1);
    color: var(--primary-red);
}

/* ==== NOTIFICAÇÕES ==== */
.alert-success {
    background: linear-gradient(135deg, var(--success-green) 0%, #1e7e34 100%);
    border: none;
    border-radius: 10px;
    color: var(--white);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.alert-danger {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    border: none;
    border-radius: 10px;
    color: var(--white);
    box-shadow: 0 4px 15px rgba(219, 0, 27, 0.3);
}

.alert-info {
    background: linear-gradient(135deg, var(--info-blue) 0%, #117a8b 100%);
    border: none;
    border-radius: 10px;
    color: var(--white);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

/* ==== ELEMENTOS INDUSTRIAIS ==== */
.industrial-accent {
    position: relative;
}

.industrial-accent:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        var(--primary-red) 0px,
        var(--primary-red) 10px,
        var(--primary-black) 10px,
        var(--primary-black) 20px
    );
}

/* ==== BADGES E ETIQUETAS ==== */
.badge {
    border-radius: 15px;
    padding: 8px 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary-red);
    color: var(--white);
}

.badge-success {
    background: var(--success-green);
    color: var(--white);
}

/* ==== DROPDOWN MENUS ==== */
.dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 10px 0;
}

.dropdown-menu li a {
    padding: 12px 20px;
    color: var(--gray-dark);
    transition: all 0.3s ease;
}

.dropdown-menu li a:hover {
    background: var(--primary-red);
    color: var(--white);
}

/* ==== RESPONSIVIDADE ==== */
@media (max-width: 768px) {
    .left_col {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .left_col.active {
        transform: translateX(0);
    }
    
    .site_title {
        font-size: 18px;
    }
    
    .x_title h2 {
        font-size: 16px;
    }
}

/* ==== ANIMAÇÕES ==== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease;
}

/* ==== ELEMENTOS ESPECÍFICOS DE FÁBRICA ==== */
.factory-header {
    background: linear-gradient(135deg, var(--steel-blue) 0%, var(--gray-dark) 100%);
    color: var(--white);
    padding: 20px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.production-card {
    background: var(--white);
    border-left: 5px solid var(--primary-red);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.production-card:before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
    background: var(--primary-red);
    border-radius: 0 0 0 50px;
    opacity: 0.1;
}

/* ==== FOOTER CORPORATIVO ==== */
.footer_fixed footer {
    background: linear-gradient(135deg, var(--primary-black) 0%, var(--gray-dark) 100%);
    color: var(--silver);
    border-top: 3px solid var(--primary-red);
}

/* ==== SCROLL CUSTOMIZADO ==== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-red);
}