/* /css/style.css */

/* * ========================================
 * 1. VARIÁVEIS E RESET
 * ========================================
 */
:root {
    /* Cores da Marca */
    --cor-principal: #004a91;
    /* Azul escuro */
    --cor-acao: #ff6600;
    /* Laranja */

    /* Fundos */
    --cor-fundo-app: #0A192F;
    /* Azul quase preto */
    --cor-fundo-container: #172A45;
    /* Azul card */

    /* Textos */
    --cor-texto-principal: #FFFFFF;
    --cor-texto-secundario: #E0E0E0;
    --cor-texto-link: #ff6600;

    /* Status */
    --cor-sucesso: #27C93F;
    --cor-alerta: #FFBD2E;
    --cor-erro: #FF5F56;

    /* Bordas e Tipografia */
    --cor-borda: rgba(0, 74, 145, 0.5);
    --fonte-principal: 'Poppins', 'Segoe UI', Roboto, sans-serif;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

body {
    background-color: var(--cor-fundo-app);
    color: var(--cor-texto-secundario);
    font-family: var(--fonte-principal);
    font-weight: 300;
    line-height: 1.6;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--cor-texto-principal);
    font-weight: 500;
}

a {
    color: var(--cor-texto-link);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #ff8533;
}

/* * ========================================
 * 2. LAYOUT PRINCIPAL (Sidebar & Main)
 * ========================================
 */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar unificada (Visual + Scrollbar hide) */
.sidebar {
    width: 250px;
    background-color: var(--cor-fundo-container);
    border-right: 1px solid var(--cor-borda);
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    top: 0;
    left: 0;
    z-index: 1000;

    /* Esconder scrollbar */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE */
}

.sidebar::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.sidebar-logo {
    width: 80%;
    margin: 0 auto 40px;
    display: block;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 10px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--cor-texto-secundario);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: rgba(0, 74, 145, 0.2);
    color: var(--cor-acao);
}

.sidebar-nav a i {
    margin-right: 10px;
}

.sidebar-logout {
    margin-top: auto;
    border-top: 1px solid var(--cor-borda);
    padding-top: 20px;
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    margin-left: 250px;
    /* Compensa a sidebar fixa */
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.main-header h1 {
    margin: 0;
    font-size: 2rem;
}

.welcome-section {
    margin-top: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

/* * ========================================
 * 3. COMPONENTES DE UI (Básicos)
 * ========================================
 */

/* --- Notificações --- */
.notificacao {
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: 500;
    text-align: left;
    border: 1px solid;
    background-color: rgba(255, 255, 255, 0.05);
}

.notificacao.sucesso {
    border-color: var(--cor-sucesso);
    color: var(--cor-sucesso);
}

.notificacao.erro {
    border-color: var(--cor-erro);
    color: var(--cor-erro);
}

.notificacao.alerta {
    border-color: var(--cor-alerta);
    color: var(--cor-alerta);
}

/* --- Botões --- */
.btn-primary {
    background-color: var(--cor-acao);
    color: #fff;
    padding: 12px 24px;
    border-radius: 5px;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    display: inline-block;
}

.btn-primary:hover {
    background-color: #e55c00;
}

.btn-action {
    background-color: var(--cor-acao);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

.btn-action:hover {
    background-color: #e55c00;
    color: #fff;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--cor-texto-secundario);
    color: var(--cor-texto-secundario);
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-secondary:hover {
    border-color: var(--cor-acao);
    color: var(--cor-acao);
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.85rem;
}

/* Ícones clicáveis (Pequenos vs Padrao) */
.btn-icon-small {
    background: none;
    border: none;
    color: var(--cor-texto-secundario);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-small:hover {
    background-color: rgba(255, 102, 0, 0.1);
    color: var(--cor-acao);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* --- Badges de Status --- */
.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.aberto {
    background: rgba(255, 189, 46, 0.2);
    color: var(--cor-alerta);
}

.status-badge.em-andamento {
    background: rgba(85, 193, 227, 0.2);
    color: #55C1E3;
}

.status-badge.concluído,
.status-badge.concluido {
    background: rgba(39, 201, 63, 0.2);
    color: var(--cor-sucesso);
}

.status-badge.cancelado {
    background: rgba(255, 95, 86, 0.2);
    color: var(--cor-erro);
}

/* * ========================================
 * 4. FORMULÁRIOS E TABELAS
 * ========================================
 */
.form-card,
.card-table {
    background-color: var(--cor-fundo-container);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-card {
    padding: 30px;
}

.card-table {
    overflow-x: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--cor-texto-secundario);
    font-weight: 400;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: #fff;
    font-family: var(--fonte-principal);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--cor-acao);
    background-color: rgba(255, 255, 255, 0.08);
}

select.form-control option {
    background-color: var(--cor-fundo-container);
    color: var(--cor-texto-secundario);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
    color: var(--cor-acao);
    font-weight: 500;
}

.data-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* * ========================================
 * 5. DASHBOARD
 * ========================================
 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.dash-card {
    background-color: var(--cor-fundo-container);
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.dash-card:hover {
    transform: translateY(-5px);
}

.dash-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.dash-icon i {
    font-size: 30px;
}

/* Variações de cores dos ícones */
.icon-blue {
    background: rgba(85, 193, 227, 0.1);
    color: #55C1E3;
}

.icon-orange {
    background: rgba(255, 102, 0, 0.1);
    color: var(--cor-acao);
}

.icon-green {
    background: rgba(39, 201, 63, 0.1);
    color: var(--cor-sucesso);
}

.icon-purple {
    background: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
}

.dash-info h3 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: var(--cor-texto-secundario);
    font-weight: 400;
}

.dash-value {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--cor-texto-principal);
}

/* * ========================================
 * 6. MODAIS E HISTÓRICO
 * ========================================
 */

/* Modal Padrão */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--cor-fundo-container);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--cor-borda);
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

.close-modal {
    color: var(--cor-texto-secundario);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--cor-acao);
    text-decoration: none;
}

/* Modal Customizado (Dialogs) */
.custom-modal-overlay {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.custom-modal-box {
    background-color: var(--cor-fundo-container);
    border: 1px solid var(--cor-borda);
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: scaleUp 0.2s ease-out;
}

.custom-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.custom-modal-message {
    font-size: 1.1rem;
    color: #ccc;
    margin-bottom: 30px;
    line-height: 1.6;
    padding: 0 10px;
}

.custom-modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Botões do Modal */
.btn-modal {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: transform 0.1s, opacity 0.2s;
}

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

.btn-modal-confirm {
    background-color: #8ab4f8;
    color: #000;
}

.btn-modal-confirm:hover {
    background-color: #aecbfa;
}

.btn-modal-cancel {
    background-color: transparent;
    border: 1px solid #5f6368;
    color: #e8eaed;
}

.btn-modal-cancel:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Histórico */
.history-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--cor-acao);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 0 5px 5px 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--cor-texto-secundario);
}

.history-status {
    font-weight: bold;
    color: var(--cor-texto-principal);
}

.history-obs {
    font-size: 0.95rem;
    color: #ddd;
}

/* * ========================================
 * 7. ANIMAÇÕES
 * ========================================
 */
@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}