/* Reset básico */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}

/* Estilo geral */
body {
    font-family: Arial, sans-serif;
}

/* Sidebar (Menu Lateral) */
#sidebar {
    height: 100vh;
    background-color: #343a40;
    color: white;
    transition: width 0.3s ease-in-out;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    overflow: hidden;
    width: 250px;
}

#sidebar.collapsed {
    width: 80px;
}

#sidebar .sidebar-header {
    padding: 15px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Menu */
#sidebar ul.menu {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#sidebar ul.menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#sidebar ul.menu li a:hover {
    background-color: #495057;
}

/* Ícones do Menu */
#sidebar ul.menu li a i {
    margin-right: 10px;
    font-size: 1.2rem;
    transition: margin 0.3s ease-in-out;
}

#sidebar.collapsed ul.menu li a span {
    opacity: 0;
    display: none;
}

#sidebar.collapsed ul.menu li a i {
    margin-right: 0;
}

/* Conteúdo Principal */
#content {
    margin-left: 250px;
    width: calc(100% - 250px);
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out;
    padding: 20px;
    background-color: #f8f9fa;
}

#sidebar.collapsed + #content {
    margin-left: 80px;
    width: calc(100% - 80px);
}

/* Cabeçalho */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: margin-left 0.3s ease-in-out;
}

/* Ajusta cabeçalho quando sidebar está recolhida */
#sidebar.collapsed ~ .header {
    margin-left: 80px;
}

/* Responsividade */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #content {
        margin-left: 0 !important;
    }

    #overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1039;
    }

    #overlay.active {
        display: block;
    }
}

/* 🔥 Ajuste da Tabela */
.table-responsive table {
    table-layout: auto; /* 🔥 Agora a tabela se ajusta automaticamente ao conteúdo */
    width: 100%;
    border-collapse: collapse; /* 🔥 Remove espaçamentos entre células */
}

/* 🔹 Ajusta o comportamento do conteúdo dentro das células */
th, td {
    white-space: normal !important; /* 🔥 Permite quebras de linha */
    overflow-wrap: break-word; /* 🔥 Garante que textos longos quebrem corretamente */
    word-wrap: break-word;
    text-align: center;
    padding: 8px;
    vertical-align: middle;
}

/* 🔹 Ajusta os inputs dentro das células */
.table-responsive input {
    width: 100%;
    max-width: 100%;
    padding: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

/* 🔹 Ajuste para valores numéricos ficarem alinhados corretamente */
td:nth-child(5), /* Quantidade */
td:nth-child(6), /* Custo */
td:nth-child(7), /* Custo Total */
td:nth-child(8), /* Venda */
td:nth-child(9) { /* Venda Total */
    text-align: right;
    font-weight: bold;
}

/* 🔥 Responsividade da tabela */
@media (max-width: 768px) {
    th, td {
        font-size: 14px;
        padding: 5px;
    }

    .table-responsive input {
        max-width: 80px;
    }
}

/* Estilo para campos bloqueados */
.field-locked {
    background-color: #f8f9fa;
    color: #6c757d;
    pointer-events: none;
    border: 1px solid #dee2e6;
}

/* Estilo para campos liberados */
.field-editable {
    background-color: #ffffff;
    color: #212529;
    border: 1px solid #ced4da;
}

/* Botão de salvar ativado */
.btn-success {
    background-color: #28a745;
    color: #fff;
    border: none;
}

.btn-success:hover {
    background-color: #218838;
}

/* Botão de editar */
.btn-warning {
    background-color: #ffc107;
    color: #212529;
    border: none;
}

.btn-warning:hover {
    background-color: #e0a800;
}

/* Tabela com status */
.table-danger {
    background-color: #f8d7da !important;
}

.table-warning {
    background-color: #fff3cd !important;
}

/* Estilizando formulários */
form div {
    margin-bottom: 15px;
}

form label {
    display: block;
    font-weight: bold;
}

form input, form textarea, form button {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
}

/* 🔥 Estilo para avaliação com estrelas */
.avaliacao {
    margin-bottom: 20px;
}

.estrelas {
    display: flex;
    align-items: center;
    font-size: 24px;
}

.estrela {
    cursor: pointer;
    color: #ccc;
}

.estrela.selected,
.estrela:hover,
.estrela:hover ~ .estrela {
    color: gold;
}

.nota {
    margin-left: 10px;
    font-size: 16px;
    font-weight: bold;
}


/* =========================
   PADRÃO LISTAS DE SIMULAÇÃO
   ========================= */
.sim-page-hero .card,
.sim-filter-card .card,
.sim-status-card .card,
.sim-table-card .card,
.sim-kpi-card.card { border-radius: 1rem; }
.sim-page-hero .card-body { border-radius: 1rem; }
.sim-page-hero .hero-title { font-weight: 700; letter-spacing: -.02em; }
.sim-helper-text { color: #6c757d; font-size: .92rem; }
.sim-kpi-card .card-body { padding: 1rem; }
.sim-kpi-card .sim-kpi-value { font-size: 1.45rem; font-weight: 700; }
.sim-kpi-card .sim-kpi-label { color: #6c757d; font-size: .9rem; }
.sim-status-tabs { display:flex; flex-wrap:wrap; gap:.5rem; }
.btn-status-tab { border: 1px solid rgba(13,110,253,.18); background: #f8fbff; color: #0d6efd; border-radius: 999px; padding: .5rem .85rem; font-weight: 600; }
.btn-status-tab:hover { background: #eef5ff; color: #0a58ca; }
.btn-status-tab.active { background: #0d6efd; color: #fff; border-color: #0d6efd; }
.btn-status-tab .badge { font-size: .75rem; }
.sim-table-card .table thead th { white-space: nowrap; }
.sim-table-card .table tbody tr:hover { background-color: rgba(0, 123, 255, 0.04); }
.sim-counter { color: #6c757d; font-size: .92rem; }
.sim-action-stack { display:flex; flex-direction:column; gap:.35rem; min-width: 126px; }
.sim-action-stack .btn { width: 100%; justify-content: center; }
.sim-empty-state { display:none; text-align:center; padding: 3rem 1rem; }
.sim-empty-state i { font-size: 2.75rem; color: #adb5bd; margin-bottom: .75rem; }
.sim-status-chip { display:inline-flex; align-items:center; gap:.35rem; padding:.4rem .7rem; border-radius:999px; font-size:.82rem; font-weight:600; }
.sim-status-chip.status-habilitacao, .sim-status-chip.status-habilitação { background:#fff3cd; color:#856404; }
.sim-status-chip.status-adjudica { background:#d1e7dd; color:#0f5132; }
.sim-status-chip.status-perdida { background:#f8d7da; color:#842029; }
.sim-status-chip.status-anulada { background:#e2e3e5; color:#41464b; }
.sim-status-chip.status-prazo-vencido { background:#212529; color:#fff; }
.sim-status-chip.status-sem-status { background:#eef1f4; color:#495057; }
@media (max-width: 991.98px) { .sim-action-stack { min-width: 100px; } }
