﻿/* Variáveis globais inspiradas no Microsoft Power Platform */
:root {
    --primary-color: #742774;
    --primary-dark: #5e215e;
    --primary-light: #b280b2;
    --text-color: #ffffff;
    --background-light: #f3f4f6;
}

/* Tipografia */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    background-color: white;
    font-family: Arial, sans-serif;
}

/* Container */
.container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    padding: 20px;
    margin: 20px; /* Adicionado espaço para evitar que os elementos fiquem colados */
}

/* Layout principal */
.layout-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    padding: 20px;
    max-width: 100%;
    height: 100vh; /* Make the container take full screen height */
}

/* Coluna esquerda (Formulário) */
.col-left {
    flex: 1;
    min-width: 300px;
    max-width: 25%;
    background: white;
    padding: 20px;
    border-radius: 10px 0 0 10px; /* Bordas arredondadas apenas nas extremidades externas */
}

/* Coluna direita (Filtros + Tabela) */
.col-right {
    flex: 1;
    min-width: 300px;
    max-width: 75%;
    background: white;
    padding: 20px;
    border-radius: 0 10px 10px 0; /* Bordas arredondadas apenas nas extremidades externas */
    border-left: 0px solid rgba(0, 0, 0, 0.1); /* Linha APENAS entre as colunas */
    min-height: 100vh; /* Ensures it stretches full height */
}

/* Responsividade */
@media (max-width: 992px) {
    .layout-container {
        flex-direction: column;
        height: auto; /* Remove fixed height to allow flexibility */
    }

    .col-left, .col-right {
        max-width: 100%;
        border-left: none; /* Remove a linha entre colunas quando empilhado */
        border-radius: 0px; /* Garante que ambas tenham bordas arredondadas */
        min-height: auto; /* Adjust height for smaller screens */
    }

    .col-right {
        border-top: 0px solid rgba(0, 0, 0, 0.1); /* Linha entre seções no modo mobile */
    }
}

.btn-danger, .btn-secondary {
    margin-top: 10px;
}
/* Botões */
.btn-primary, .btn-edit, .btn-delete, .bt {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    margin-right: 10px;
    margin-top: 10px;
}

    .btn-primary:hover,
    .btn-edit:hover,
    .btn-delete:hover {
        background-color: var(--primary-dark);
    }

/* Tabelas */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    border: 0.5px solid #dcdcdc;
}

    .table th, .table td {
        padding: 12px 15px;
        text-align: left;
        vertical-align: middle;
        border-bottom: 1px solid #dcdcdc;
    }

    .table th {
        background-color: #f3f4f6;
        color: #333333;
        font-weight: bold;
        border: none;
    }

.table-striped tbody tr {
    background-color: #ffffff;
}

    .table-striped tbody tr:nth-of-type(odd) {
        background-color: #f9f9f9;
    }

    .table-striped tbody tr:hover {
        background-color: #e3e3e3;
    }

/* Modais */
.modal-content {
    background-color: var(--text-color);
    border-radius: 10px;
}

.modal-header {
    background-color: var(--primary-dark);
    color: var(--text-color);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.modal-footer {
    border-top: none;
}

/* Navbar */
.navbar {
    background-color: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    height: 40px;
    filter: brightness(0) invert(1);
}

.navbar-nav .nav-link {
    color: var(--text-color);
    transition: color 0.3s ease;
}

    .navbar-nav .nav-link:hover {
        color: var(--primary-light);
    }

/* Links de botão */
.btn-link {
    color: var(--text-color);
    transition: color 0.3s ease;
}

    .btn-link:hover {
        color: var(--primary-light);
    }

/* Títulos */
h1, h4 {
    color: var(--primary-dark);
}

/* Formulários */
.form-control, select {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px;
}

/* Rodapé */
footer {
    padding: 10px;
    background-color: var(--primary-dark);
    color: var(--text-color);
    text-align: center;
    font-size: 0.875rem;
}

/* Ajuste dos alertas para que fiquem sobrepostos */
.alert-dismissible {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    width: auto;
    max-width: 90%;
    min-width: 300px;
    text-align: center;
    opacity: 1;
    transition: opacity 0.5s ease-in-out, top 0.5s ease-in-out;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}

.alert.fade {
    opacity: 0;
    top: 0px;
    transition: opacity 0.5s ease-in-out, top 0.5s ease-in-out;
}

#remainingHoursDisplay {
    font-size: 14px;
    text-align: right;
    right: 20px;
}

#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center; /* Centers horizontally */
    align-items: center; /* Centers vertically */
    z-index: 1000; /* Ensures it's above other elements */
}

/* ─────────────────────────────────────────────
   Payments Page Styles
───────────────────────────────────────────── */
.payments-page html,
.payments-page body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

.payments-page .payments-flex {
    display: flex;
    width: 100vw;
    height: 100vh;
    padding: 10px; /* margem interna de 10px */
    box-sizing: border-box;
    gap: 10px;
}

.payments-page .left-panel,
.payments-page .right-panel {
    background: #fff;
    padding: 24px;
    box-sizing: border-box;
    overflow: auto;
    border: none; /* sem bordas */
    border-radius: 0; /* sem cantos arredondados */
    box-shadow: none; /* sem sombra */
}

/* esquerda ocupa 35%, direita o restante */
.payments-page .left-panel {
    flex: 0 0 35%;
    min-width: 0;
}

.payments-page .right-panel {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

/* tabela responsiva e col-resize */
.payments-page .table th,
.payments-page .table td {
    vertical-align: middle !important;
    text-align: center;
    position: relative;
    user-select: none;
}

.payments-page .resizer {
    display: inline-block;
    position: absolute;
    right: 0;
    top: 0;
    width: 7px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
}

.payments-page .table th:last-child .resizer,
.payments-page .table td:last-child .resizer {
    display: none;
}

/* badges de status */
.payments-page .entry-status {
    font-weight: 500;
    padding: 3px 18px;
    border-radius: 16px;
    font-size: .98em;
    color: #fff;
    background: #6c63ff;
    text-transform: capitalize;
}

    .payments-page .entry-status.paid {
        background: green;
    }

    .payments-page .entry-status.pending {
        background: #b280b2;
    }

    .payments-page .entry-status.open {
        background: #7dabdd;
    }

    .payments-page .entry-status.invoiced {
        background: #bfbf77;
    }
    .payments-page .entry-status.rejected {
        background: #e81212;
    }

/* botão de anexo */
.payments-page .attach-btn {
    border: none;
    background: #ede7f6;
    color: #5439bd;
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 1em;
    cursor: pointer;
    transition: .15s;
}

    .payments-page .attach-btn:hover {
        background: #6c63ff;
        color: #fff;
    }

.payments-page .right-panel table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed;
}

.payments-page .right-panel th,
.payments-page .right-panel td {
    /* permite quebra de texto no conteúdo, para não explodir as células */
    white-space: normal !important;
    word-wrap: break-word;
}

@media (max-width: 900px) {
    .payments-page .payments-flex {
        flex-direction: column;
        width: 100vw;
        height: auto;
    }

    .payments-page .left-panel,
    .payments-page .right-panel {
        width: 100%;
        height: auto;
    }
}

.toast-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.table td:last-child {
    white-space: nowrap;
}

/* Largura padrão */
.col-smaller {
    width: 100px;
    max-width: 120px;
    white-space: nowrap;
}

/* Opcional: diminuir em telas muito pequenas */
@media (max-width: 576px) {
    .col-smaller {
        width: 60px;
        max-width: 80px;
    }
}

