:root {
    /* CORES INVERTIDAS: Fundo branco e caixas verdes (#ebfff0) */
    --pdf-bg: #ffffff;
    --pdf-box-bg: #ebfff0;
    --pdf-text: #000;
    --pdf-border: #000;
    --ui-bg: #111;
    --ui-gold: #d4af37;
    --ui-login-blue: #0056b3;
}

/* Quando o Tema Azul estiver ativo */
.theme-blue {
    --pdf-bg: #ffffff;
    --pdf-box-bg: #e6f2ff;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--ui-login-blue);
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
    justify-content: center;
    align-items: center;
}

/* TELA DE LOGIN E PAINEL */
#login-screen {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    width: 350px;
    text-align: center;
}

.login-logo {
    max-width: 180px;
    max-height: 70px;
    object-fit: contain;
    margin-bottom: 10px;
}

#login-screen h2 {
    margin-top: 0;
    font-size: 1.2rem;
    margin-bottom: 30px;
    font-weight: bold;
    color: #333;
}

.login-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    text-transform: uppercase;
}

.login-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    background: #f8f9fa;
    color: #333;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: var(--ui-login-blue);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

#login-error {
    color: #ff4d4d;
    font-size: 0.85rem;
    margin-top: 15px;
    display: none;
}

#app-sistema {
    display: none;
    width: 100vw;
    height: 100vh;
}

.sidebar {
    width: 380px;
    background: var(--ui-bg);
    color: #fff;
    padding: 25px 20px;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.sidebar h2 {
    margin-top: 0;
    font-size: 1.3rem;
    color: var(--ui-gold);
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.sidebar h3 {
    font-size: 1rem;
    color: #aaa;
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #ddd;
}

.form-group input[type="text"],
.form-group input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #444;
    background: #222;
    color: #fff;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: monospace;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    background: #222;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #444;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    accent-color: var(--ui-gold);
    cursor: pointer;
}

.btn-export {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--ui-gold);
    color: #000;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 30px;
}

.split-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.split-input .fixed-text {
    font-size: 0.9rem;
    font-weight: bold;
    color: #888;
    white-space: nowrap;
}

/* VISUALIZAÇÃO E PDF */
.preview-container {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #ccc;
}

.a4-page {
    width: 210mm;
    min-height: 296mm;
    background: var(--pdf-bg);
    color: var(--pdf-text);
    padding: 18mm 20mm;
    box-sizing: border-box;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* CABEÇALHO ESPAÇOSO E LOGO AUMENTADA */
.header {
    border-bottom: 2px solid var(--pdf-border);
    margin-bottom: 25px;
    position: relative;
    min-height: 130px;
}

.header img {
    position: absolute;
    top: -15px;
    left: 0;
    max-height: 90px;
    max-width: 250px;
    object-fit: contain;
}

.legal-info {
    position: absolute;
    top: -5px;
    right: 0;
    text-align: right;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.4;
}

.legal-info a {
    color: #0056b3;
    text-decoration: none;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 5px;
    width: max-content;
}

.header-center h1 {
    font-size: 1.5rem;
    margin: 0;
    text-transform: uppercase;
    font-weight: 900;
}

.header-right {
    position: absolute;
    bottom: 5px;
    right: 0;
}

.header-right p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: bold;
}

.subheader-text {
    text-align: center;
    font-size: 0.85rem;
    font-weight: bold;
    margin-top: -5px;
    margin-bottom: 20px;
}

/* CAIXA CLIENTE */
.client-info {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 12px;
    margin-bottom: 25px;
    font-size: 0.85rem;
    background: var(--pdf-box-bg);
    padding: 18px 20px;
    border: 1px solid var(--pdf-border);
    border-radius: 5px;
}

.client-info-item {
    display: flex;
    flex-direction: column;
}

.client-info-item span.label {
    font-weight: bold;
    margin-bottom: 3px;
    color: #333;
}

.client-info-item span.value {
    font-weight: normal;
    font-size: 0.95rem;
}

/* GRIDS E CAIXAS PRINCIPAIS */
.grid-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.info-box {
    border: 1px solid var(--pdf-border);
    padding: 12px 10px;
    text-align: center;
    background: var(--pdf-box-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-box.highlight {
    background: var(--pdf-box-bg);
    border-width: 1px;
}

.info-box span {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 4px;
    font-weight: bold;
}

.info-box .info-value {
    font-size: 1.2rem;
    font-weight: normal;
}

.info-box .bold-value {
    font-weight: bold;
}

.box-destaque-liquido span {
    font-size: 0.95rem;
}

.box-destaque-liquido .info-value {
    font-size: 1.5rem;
}

/* SALDO DEVEDOR */
.saldo-devedor {
    text-align: center;
    border: 1px solid var(--pdf-border);
    padding: 25px 25px;
    background: var(--pdf-box-bg);
}

.saldo-devedor h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.saldo-devedor p {
    font-size: 0.9rem;
    margin-bottom: 18px;
    line-height: 1.45;
}

.opcoes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.opcao-box {
    border-top: 1px solid var(--pdf-border);
    padding-top: 12px;
}

.opcao-box span {
    font-size: 0.75rem;
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
}

.opcao-box .opcao-valor {
    font-size: 1rem;
    display: block;
    margin-bottom: 2px;
    font-weight: normal;
}

.antecipacao-nota {
    font-size: 0.75rem;
    display: block;
    font-weight: bold;
    margin-top: 3px;
    color: #000;
    text-transform: lowercase;
}

/* TAXAS COMPACTAS E NEGRITO */
.taxas-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 20px;
    border: 1px solid var(--pdf-border);
    background: var(--pdf-box-bg);
    font-size: 0.85rem;
}

.taxas-box>div {
    padding: 4px 8px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.taxas-box .taxa-label {
    font-weight: 800 !important;
    color: #000;
}

.taxas-box .taxa-valor {
    font-weight: normal;
}

.taxas-box>div:first-child {
    border-right: 1px solid var(--pdf-border);
}

/* RODAPÉ */
.footer {
    margin-top: auto;
    border-top: 2px solid var(--pdf-border);
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.footer-social {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.social-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-item img {
    width: 15px;
    height: 15px;
    object-fit: contain;
}

.social-item span {
    font-size: 1rem;
    font-weight: bold;
    line-height: 1;
    color: var(--pdf-text);
}

.social-item .site-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

/* AGRUPAMENTO NÚMERO DO CONSULTOR + WHATSAPP ALINHADOS */
.footer-consultor {
    text-align: right;
}

.footer-consultor span.title {
    display: block;
    font-size: 0.8rem;
    color: #444;
    margin-bottom: 2px;
    text-transform: uppercase;
    font-weight: bold;
}

.footer-consultor strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.consultor-phone-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.consultor-phone-group img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.footer-consultor span.phone {
    display: block;
    font-size: 0.95rem;
    font-weight: bold;
}