/* Painel de expedicao de e-mail.
 *
 * Uma folha so, com uma borda forte: elevacao por borda, nao por card. A
 * divisao interna e por tom de superficie. A unica coisa saturada e a marca de
 * substituicao — o valor preenchido aparece no lugar do placeholder, para a
 * conferencia ser de um relance.
 */
:root {
    color-scheme: dark;

    --base:     #1b2026;
    --panel:    #222931;
    --panel-2:  #2a323b;
    --edge:     #38424e;
    --edge-lit: #4a5766;

    --fg:   #eef2f6;
    --fg-2: #a7b3c0;
    --fg-3: #76838f;

    /* Latao: o valor que o operador preencheu. */
    --posto:    #c9a35b;
    --posto-bg: #332a18;
    /* Rosa: o que falta, e o que deu errado. */
    --falta:    #e08a84;
    --falta-bg: #38211f;
    /* Salva: aceito. */
    --aceito:   #8fcfae;

    --tipo: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --cod: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--base);
    color: var(--fg);
    font-family: var(--tipo);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

/* ====================================================== a folha (o painel) */
#folha {
    max-width: 1120px;
    margin: 18px auto;
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: 10px;
    overflow: hidden;
}

.barra {
    display: flex; align-items: center; gap: 24px;
    min-height: 44px; padding: 4px 18px;
    border-bottom: 1px solid var(--edge);
    background: var(--panel-2);
    flex-wrap: wrap;
}
#abas { display: flex; gap: 20px; align-items: stretch; align-self: stretch; }
#abas button {
    font: inherit; font-size: 14px; color: var(--fg-3); font-weight: 500;
    background: none; border: 0; cursor: pointer;
    padding: 10px 0; position: relative;
}
#abas button:hover { color: var(--fg-2); }
#abas button[aria-current="page"] { color: var(--fg); font-weight: 600; }
#abas button[aria-current="page"]::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
    height: 2px; background: var(--fg);
}
.direita { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.cota { font-size: 13px; color: var(--fg-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cota b { color: var(--fg-2); font-weight: 600; }

/* Duas aguas: preencher a esquerda, conferir a direita. */
.aguas { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
.esq { padding: 22px 24px 26px; min-width: 0; }
.dir { padding: 22px 24px 26px; min-width: 0; background: var(--base); border-left: 1px solid var(--edge); }
@media (max-width: 860px) {
    .aguas { grid-template-columns: 1fr; }
    .dir { border-left: 0; border-top: 1px solid var(--edge); }
}

/* =============================================================== primitivos */
h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 5px; }
.sobre { color: var(--fg-2); font-size: 13.5px; margin: 0 0 22px; max-width: 54ch; }

.campo { display: block; margin-bottom: 15px; min-width: 0; }
.campo .nome { display: flex; gap: 9px; align-items: baseline; font-size: 13px; font-weight: 500; margin-bottom: 5px; flex-wrap: wrap; }
.campo .nome .cru { font-family: var(--cod); font-size: 11.5px; color: var(--fg-3); font-weight: 400; }

input, select, textarea {
    font: inherit; font-size: 14px; width: 100%; min-width: 0;
    color: var(--fg); background: var(--base);
    border: 1px solid var(--edge-lit); border-radius: 7px;
    padding: 8px 11px;
}
.dir input, .dir select, .dir textarea { background: var(--panel); }
select { cursor: pointer; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
    outline: 2px solid var(--posto); outline-offset: 1px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--posto); }
input::placeholder, textarea::placeholder { color: var(--fg-3); }
textarea { font-family: var(--cod); font-size: 12.5px; line-height: 1.6; resize: vertical; }
.nota { font-size: 12.5px; color: var(--fg-3); margin: 6px 0 0; }

button.bt {
    font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
    border-radius: 7px; padding: 8px 16px;
    background: transparent; color: var(--fg-2); border: 1px solid var(--edge-lit);
}
button.bt:hover { color: var(--fg); border-color: var(--fg-3); }
button.bt.claro { background: var(--fg); color: #171c21; border-color: var(--fg); }
button.bt.claro:hover { background: #fff; border-color: #fff; }
button.bt:disabled { opacity: 0.38; cursor: not-allowed; }
button.bt:disabled:hover { color: var(--fg-2); border-color: var(--edge-lit); }
.fila { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.divisa { border: 0; border-top: 1px solid var(--edge); margin: 20px 0; }

/* ======================================== a marca de substituicao (assinatura) */
.posto {
    background: var(--posto-bg); color: var(--posto);
    border-bottom: 1px solid var(--posto);
    padding: 0 2px; border-radius: 2px;
}
.falta {
    background: var(--falta-bg); color: var(--falta);
    border-bottom: 1px dashed var(--falta);
    padding: 0 2px; border-radius: 2px; font-family: var(--cod); font-size: 0.88em;
}

/* o cabecalho do documento */
.cab { margin-bottom: 15px; }
.cab > div { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 5px 14px; font-size: 13.5px; }
.cab dt { color: var(--fg-3); font-size: 12.5px; padding-top: 2px; }
.cab dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.cab dd.end { color: var(--fg-2); }
.cab dd.ass { font-weight: 600; }

iframe.vista {
    width: 100%; height: 300px; display: block;
    border: 1px solid var(--edge); border-radius: 7px; background: #fff;
}

.marca-liga { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; margin-bottom: 9px; flex-wrap: wrap; }
.marca-liga label { font-size: 12.5px; color: var(--fg-3); display: flex; gap: 7px; align-items: center; cursor: pointer; }
.marca-liga input { width: auto; accent-color: var(--posto); }

.oco { color: var(--fg-3); font-size: 13.5px; max-width: 42ch; padding: 34px 0 0; }

.recado { font-size: 13.5px; padding: 11px 14px; border-radius: 7px; border: 1px solid; margin-bottom: 16px; }
.recado.bom  { border-color: #3f6b55; background: #1b2b24; color: var(--aceito); }
.recado.ruim { border-color: #6b3b38; background: var(--falta-bg); color: var(--falta); }

/* ================================================================ as listas */
.reg { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.reg th {
    text-align: left; font-size: 12.5px; font-weight: 500; color: var(--fg-3);
    padding: 0 14px 8px 0; border-bottom: 1px solid var(--edge); white-space: nowrap;
}
.reg td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--edge); vertical-align: baseline; }
.reg tbody tr { cursor: pointer; }
.reg tbody tr:hover td { background: var(--panel-2); }
.reg tbody tr[aria-selected="true"] td { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--posto); }
.reg .quando { color: var(--fg-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.reg .para { overflow-wrap: anywhere; }
.reg .para small { display: block; color: var(--fg-3); font-size: 12.5px; }
.sit { white-space: nowrap; font-weight: 500; font-size: 13px; }
.sit.ok { color: var(--aceito); }
.sit.er { color: var(--falta); }
/* Em transito: nem bom nem ruim, e nao pode parecer bom. Tres tons, nao sete —
   o que importa e "a empresa recebeu" / "nao vai receber" / "ainda nao se
   sabe". */
.sit.esp { color: var(--fg-2); }

/* O que a situacao quer dizer, por extenso. "aceito" nao e intuitivo, e a
   diferenca entre aceito e entregue e justamente o que se quer que fique
   claro. */
.cab dd .diz { display: block; color: var(--fg-3); font-size: 12px; margin-top: 2px; }

/* O motivo que veio do servidor do destino, na letra de codigo porque e texto
   de maquina — nao se finge que foi escrito para o dono ler. */
.motivo {
    display: block;
    margin-top: 4px;
    padding: 3px 8px;
    border-left: 2px solid var(--edge-lit);
    background: var(--panel-2);
    font-family: var(--cod);
    font-size: 11.5px;
    color: var(--fg-2);
    overflow-wrap: anywhere;
}

/* A linha do tempo dos eventos: uma regua a esquerda. Nao sao cards — sao o
   mesmo fato em instantes diferentes, e card sugeriria coisas separadas. */
.linha {
    list-style: none;
    margin: 0 0 15px;
    padding: 0 0 0 14px;
    border-left: 1px solid var(--edge);
}
.linha li { position: relative; padding: 3px 0; font-size: 13px; }
.linha li::before {
    content: '';
    position: absolute; left: -18px; top: 10px;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--edge-lit);
}
.linha .qnd {
    margin-right: 8px;
    color: var(--fg-3);
    font-family: var(--cod);
    font-size: 11.5px;
}
.rola { overflow-x: auto; }

.item { display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap; padding: 14px 0; border-bottom: 1px solid var(--edge); }
.item:last-of-type { border-bottom: 0; }
.item-c { flex: 1 1 210px; min-width: 0; }
.item-c b { font-weight: 600; font-size: 14px; }
.item-c div { font-size: 13px; color: var(--fg-3); overflow-wrap: anywhere; margin-top: 2px; }
.item-u { font-size: 12.5px; color: var(--fg-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kk { font-family: var(--cod); font-size: 11.5px; color: var(--posto); }
.kks { display: flex; gap: 11px; flex-wrap: wrap; }

/* ============================================================ tela da senha */
.entrada { max-width: 300px; margin: 0 auto; padding: 56px 0 64px; }
.entrada h1 { font-size: 18px; }
.entrada .sobre { margin-bottom: 20px; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
