/* =========================================================
   IDENTIDADE VISUAL RM (mesma do index_atesto.php)
========================================================= */
:root {
    --primary: #429B65;
    --primary-dark: #244A38;
    --primary-light: #577D69;
    --accent: #9EB291;
    --accent-light: #D2DBBA;
    --dark: #1F2B25;
    --text: #26352D;
    --text-light: #69766E;
    --white: #FFFFFF;
    --lighter: #F8FAF6;
    --light: #F1F4EE;
    --border: #DDE4DA;

    /* Situações */
    --ok-bg: #E3F1E8;      --ok-tx: #1F6B40;
    --pend-bg: #FFF2D6;    --pend-tx: #8A5A00;
    --alerta-bg: #FCE5E1;  --alerta-tx: #9B2C1F;
    --neutro-bg: #ECEFEA;  --neutro-tx: #5B665F;
    --cancel-bg: #EEE7EE;  --cancel-tx: #6B4A6B;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; }
body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--lighter);
    color: var(--text);
    font-size: 14px;
}
a { color: var(--primary); }
:focus-visible { outline: 3px solid rgba(66, 155, 101, .45); outline-offset: 2px; }

/* =========================================================
   LOGIN (modelo index_atesto.php)
========================================================= */
.login-page { width: 100%; min-height: 100vh; display: flex; background: var(--lighter); }
.login-banner { width: 70%; min-height: 100vh; overflow: hidden; position: relative; background: var(--primary-dark); }
.login-banner img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
.login-area { width: 30%; min-width: 420px; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-box {
    width: 100%; max-width: 440px; padding: 42px 40px;
    background: var(--white); border: 1px solid var(--border); border-radius: 18px;
    box-shadow: 0 12px 35px rgba(36, 74, 56, 0.08);
}
.login-logo { margin: 0 auto 24px; display: flex; align-items: center; justify-content: center; }
.login-logo img { width: 60%; }
.login-box h1 { margin-bottom: 8px; text-align: center; font-size: 26px; font-weight: 600; color: var(--primary-dark); }
.login-subtitle { margin-bottom: 26px; text-align: center; font-size: 16px; color: var(--text-light); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 600; }
.form-group input {
    width: 100%; height: 52px; padding: 0 14px;
    border: 1px solid var(--border); border-radius: 7px; background: var(--light);
    color: var(--text); font-size: 16px; outline: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.form-group input:focus { background: var(--white); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(66,155,101,.12); }
.login-button {
    width: 100%; height: 54px; margin-top: 8px; border: none; border-radius: 8px;
    background: var(--primary); color: var(--white); font-size: 18px; font-weight: 600; cursor: pointer;
    transition: background .2s, box-shadow .2s;
}
.login-button:hover { background: var(--primary-dark); box-shadow: 0 5px 14px rgba(36,74,56,.18); }
.btn-voltar {
    width: 100%; height: 50px; margin-top: 10px; border: none; border-radius: 8px;
    background: transparent; color: var(--text-light); font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn-voltar:hover { background: var(--light); color: var(--primary-dark); }
.forgot-password { margin-top: 22px; text-align: center; font-size: 14px; color: var(--text-light); }
.forgot-password a { font-weight: 600; text-decoration: none; }
.forgot-password a:hover { color: var(--primary-dark); text-decoration: underline; }

@media (max-width: 1100px) {
    .login-banner { width: 55%; }
    .login-area { width: 45%; }
}

/* =========================================================
   BLOQUEIO (celular / janela pequena)
========================================================= */
.tela-bloqueio, .tela-pequena {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: var(--lighter);
}
.tela-pequena { position: fixed; inset: 0; z-index: 100; }
.tela-pequena[hidden] { display: none; }
.bloqueio-box {
    max-width: 440px; padding: 32px; text-align: center;
    background: var(--white); border: 1px solid var(--border); border-radius: 16px;
}
.bloqueio-box h1 { font-size: 22px; color: var(--primary-dark); margin-bottom: 10px; }
.bloqueio-box p { color: var(--text-light); line-height: 1.5; }

/* =========================================================
   ESTRUTURA INTERNA
========================================================= */
body.interno { min-width: 1024px; }
.topo {
    height: 64px; padding: 0 28px;
    display: flex; align-items: center; gap: 32px;
    background: var(--primary-dark); color: var(--white);
}
.topo-marca { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; }
.topo-marca img { height: 38px; border-radius: 6px; background: var(--white); padding: 3px; }
.topo-nav { display: flex; gap: 4px; flex: 1; }
.topo-nav a {
    color: var(--accent-light); text-decoration: none; padding: 8px 14px; border-radius: 6px; font-weight: 600;
}
.topo-nav a:hover { background: rgba(255,255,255,.08); color: var(--white); }
.topo-nav a.ativo { background: var(--primary); color: var(--white); }
.topo-usuario { display: flex; align-items: center; gap: 14px; }
.topo-usuario small { color: var(--accent); }
.btn-sair { color: var(--white); border: 1px solid var(--primary-light); padding: 6px 12px; border-radius: 6px; text-decoration: none; }
.btn-sair:hover { background: var(--primary-light); }

.conteudo { padding: 26px 28px 40px; max-width: 1800px; margin: 0 auto; }

.pagina-cabecalho { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.pagina-cabecalho h1 { font-size: 24px; color: var(--primary-dark); }
.pagina-sub { margin-top: 4px; color: var(--text-light); }
.acoes { display: flex; gap: 10px; }

/* Botões */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 40px; padding: 0 18px; border-radius: 7px; border: 1px solid transparent;
    font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
    font-family: inherit;
}
.btn-primario { background: var(--primary); color: var(--white); }
.btn-primario:hover { background: var(--primary-dark); }
.btn-secundario { background: var(--white); color: var(--primary-dark); border-color: var(--border); }
.btn-secundario:hover { border-color: var(--primary); }
.btn-link { background: transparent; color: var(--text-light); }
.btn-link:hover { color: var(--primary-dark); background: var(--light); }

/* Alertas */
.alerta { padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; line-height: 1.4; }
.alerta-ok   { background: var(--ok-bg); color: var(--ok-tx); }
.alerta-erro { background: var(--alerta-bg); color: var(--alerta-tx); }
.login-box .alerta { font-size: 14px; }

/* Campos */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-weight: 600; font-size: 13px; color: var(--text); }
.campo small { color: var(--text-light); font-size: 12px; }
.campo input, .campo select, .campo textarea {
    height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--white); color: var(--text); font-size: 14px; font-family: inherit;
}
.campo textarea { height: auto; padding: 10px; resize: vertical; line-height: 1.4; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(66,155,101,.12);
}
.campo input[type=file] { padding: 7px 10px; }

/* Filtros */
.filtros {
    display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
    padding: 16px 18px; margin-bottom: 14px;
    background: var(--white); border: 1px solid var(--border); border-radius: 10px;
}
.filtros .campo { min-width: 200px; }
.filtros .campo-largo { flex: 1; min-width: 260px; }
.campo-check { display: flex; align-items: center; gap: 8px; height: 40px; color: var(--text-light); cursor: pointer; }
.campo-check input { accent-color: var(--primary); width: 16px; height: 16px; }
.filtros-botoes { display: flex; gap: 6px; }

/* Resumo por situação */
.resumo { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.resumo-item { padding: 6px 12px; border-radius: 20px; text-decoration: none; font-size: 13px; }
.resumo-item strong { font-size: 14px; margin-right: 2px; }

/* Selos de situação */
.selo { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.selo-ok        { background: var(--ok-bg);     color: var(--ok-tx); }
.selo-pendente  { background: var(--pend-bg);   color: var(--pend-tx); }
.selo-alerta    { background: var(--alerta-bg); color: var(--alerta-tx); }
.selo-neutro    { background: var(--neutro-bg); color: var(--neutro-tx); }
.selo-cancelado { background: var(--cancel-bg); color: var(--cancel-tx); }

/* Tabela */
.tabela-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--border); border-radius: 10px; }
.tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabela th {
    position: sticky; top: 0; text-align: left; padding: 10px 10px;
    background: var(--light); color: var(--primary-dark); font-size: 12px; font-weight: 700;
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tabela td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.35; }
.tabela tbody tr:hover td { background: var(--lighter); }
.tabela tbody tr:last-child td { border-bottom: none; }
.tabela .data { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabela .num { font-variant-numeric: tabular-nums; }
.tabela .nome { font-weight: 600; min-width: 200px; }
.tabela .obs { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-light); }
.tabela .pequeno { font-size: 12px; min-width: 170px; }
.suave { color: var(--text-light); }
.sem-cadastro { color: var(--alerta-tx); font-weight: 400; }
.linha-inativa td { color: var(--text-light); }
.linha-inativa .nome { font-weight: 400; }
.linha-alerta td { background: #FFFBF2; }
.texto-alerta { color: var(--alerta-tx); }
.btn-editar {
    display: inline-block; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border);
    color: var(--primary-dark); text-decoration: none; font-weight: 600; font-size: 12px;
}
.btn-editar:hover { border-color: var(--primary); background: var(--ok-bg); }

/* Vazio */
.vazio { text-align: center; padding: 56px 20px; background: var(--white); border: 1px dashed var(--border); border-radius: 10px; }
.vazio h2 { font-size: 18px; color: var(--primary-dark); margin-bottom: 6px; }
.vazio p { color: var(--text-light); margin-bottom: 16px; }

/* Cartões e formulários */
.cartao { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 14px; line-height: 1.5; }
.grade { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.campo-2 { grid-column: span 2; }
.campo-4 { grid-column: span 4; }
.form-botoes { display: flex; gap: 8px; margin-top: 18px; }
.form-importar { max-width: 900px; }
.regras { margin: 18px 0 0 18px; color: var(--text-light); line-height: 1.6; }

.edicao { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.ficha { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; }
.ficha dt { font-size: 12px; color: var(--text-light); margin-top: 12px; }
.ficha dt:first-child { margin-top: 0; }
.ficha dd { font-weight: 600; margin-top: 2px; line-height: 1.35; }
.form-edicao { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }
