﻿:root {
  --tce-bg-dark: #002B49;      /* Header background & topo principal */
  --tce-bg-header: #002B49;    /* Fundo da barra superior de navegação */
  --tce-bg-subnav: #001F3B;    /* Fundo escuro para sub-menus / barra de data */
  --tce-sidebar-bg: #0b1f33;   /* Fundo da barra lateral */
  --tce-sidebar-hover: #122d4a;/* Hover do menu lateral */
  --tce-sidebar-active: #1a3c5d;/* Item ativo */
  --tce-accent-blue: #005691;  /* Cor primária de botões e links */
  --tce-accent-light: #e8f1f5; /* Fundo claro para hover */
  --tce-content-bg: #f4f6f8;   /* Fundo principal da área de trabalho */
  --tce-text-dark: #2c3e50;    /* Texto principal */
  --tce-text-muted: #596978;   /* Rótulos e textos auxiliares */
  --tce-border-color: #d1d8e0; /* Bordas de cards e formulários */
  --font-sans: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--tce-content-bg);
    color: var(--tce-text-dark);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* Topo Institucional */
.topo-tce {
    width: 100%;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.faixa-tce {
    background-color: var(--tce-bg-dark);
    min-height: 70px;
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-portal {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    text-decoration: none;
    color: #ffffff;
}

.logo-portal:hover {
    opacity: 0.95;
}

.logo-portal i {
    font-size: 36px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    padding: 10px;
    border-radius: 8px;
}

.titulo-sistema {
    display: flex;
    flex-direction: column;
}

.titulo-principal {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.subtitulo-principal {
    font-size: 13px;
    font-weight: 400;
    color: #d0e1ec;
    margin-top: 2px;
}

.logo-tce-container {
    display: flex;
    align-items: center;
}

.logo-tce {
    height: 58px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.logo-tce:hover {
    transform: scale(1.03);
}

.borda-faixa-tce {
    background-color: var(--tce-bg-subnav);
    color: #ffffff;
    font-size: 13px;
    padding: 8px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.usuario-topo .nome-usuario {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: #e0ecf5;
}

.data-topo {
    font-size: 12px;
    color: #b0c8db;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: capitalize;
}

/* Container e Layout Principal */
#wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
}

.conteudo {
    width: 100%;
}

/* Cards e Widgets */
.tce-widget {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--tce-border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 25px 30px;
    margin-bottom: 25px;
}

.tce-widget-icon-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.tce-widget-icon-section i {
    font-size: 72px;
    color: var(--tce-accent-blue);
}

.tce-widget-text-section h2 {
    color: var(--tce-bg-dark);
    font-size: 20px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--tce-accent-light);
    padding-bottom: 10px;
}

.tce-widget-text-section p {
    color: var(--tce-text-dark);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
}

/* Formulário de Cálculo */
.widget-form {
    width: 100%;
}

.form-horizontal .form-group {
    margin-bottom: 18px;
}

.control-label {
    color: var(--tce-text-dark);
    font-weight: 600;
    font-size: 14px;
    padding-top: 7px;
}

.form-control {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--tce-border-color);
    border-radius: 5px;
    padding: 9px 12px;
    font-size: 14px;
    color: var(--tce-text-dark);
    background-color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--tce-accent-blue);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 86, 145, 0.18);
}

/* Botões Institucionais */
.btn-primary {
    background-color: var(--tce-bg-dark) !important;
    border-color: var(--tce-bg-dark) !important;
    color: #ffffff !important;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 43, 73, 0.2);
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--tce-bg-subnav) !important;
    border-color: var(--tce-bg-subnav) !important;
    box-shadow: 0 3px 6px rgba(0, 31, 59, 0.3);
}

.btn-default,
.btn-limpar {
    background-color: #ffffff;
    border: 1px solid var(--tce-border-color);
    color: var(--tce-text-dark);
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-default:hover,
.btn-limpar:hover {
    background-color: var(--tce-accent-light);
    border-color: var(--tce-accent-blue);
    color: var(--tce-accent-blue);
}

/* Visualização PDF */
#montaPdfTce {
    width: 100%;
    margin-top: 15px;
}

#pdfEmbed {
    width: 100%;
    height: 900px;
    border: 1px solid var(--tce-border-color);
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Loading Overlay */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.load-state-off {
    display: none !important;
}

.back-load {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 43, 73, 0.65);
}

.loader {
    position: relative;
    z-index: 10000;
    display: flex;
    gap: 8px;
}

.loader .circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loader .circle:nth-child(1) { animation-delay: -0.32s; }
.loader .circle:nth-child(2) { animation-delay: -0.16s; }
.loader .circle:nth-child(3) { animation-delay: 0; }
.loader .circle:nth-child(4) { animation-delay: 0.16s; }
.loader .circle:nth-child(5) { animation-delay: 0.32s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

.loading-text {
    position: relative;
    z-index: 10000;
    color: #ffffff;
    margin-top: 15px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Alertas e Validações */
#divAlert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    z-index: 9998;
}

.has-error .form-control {
    border-color: #d9534f;
}

.help-block {
    color: #d9534f;
    font-size: 12px;
    margin-top: 4px;
}

/* Responsividade */
@media (max-width: 768px) {
    .faixa-tce {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 15px;
    }

    .borda-faixa-tce {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        padding: 8px 15px;
    }

    .tce-widget {
        padding: 15px;
    }

    .btn-primary,
    .btn-limpar {
        width: 100%;
        margin-bottom: 10px;
    }
}
