/* ================================================================
   SIAUDI - style.css | Tema SED / SIGEPE
   Cores exatas do sistema SED: azul escuro #071d41, azul #005c99, laranja #e3701c
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rawline:wght@300;400;500;600;700&display=swap');

/* ---- VARIAVEIS ---- */
:root {
    --azul-escuro:   #071d41;
    --azul:          #005c99;
    --azul-hover:    #004d80;
    --azul-claro:    #e8f4fd;
    --laranja:       #e3701c;
    --laranja-hover: #c45a0e;
    --verde:         #168821;
    --verde-claro:   #e8f5e9;
    --vermelho:      #c62828;
    --vermelho-claro:#ffebee;
    --amarelo:       #e65100;
    --amarelo-claro: #fff3e0;

    --bg:            #f0f2f5;
    --bg-branco:     #ffffff;
    --bg-cinza:      #f8f9fa;
    --bg-cinza2:     #e9ecef;

    --texto:         #333333;
    --texto2:        #555555;
    --texto3:        #777777;
    --borda:         #dee2e6;
    --borda2:        #c8d0dc;

    --fonte: 'Rawline', 'Segoe UI', Arial, sans-serif;
    --fonte-mono: 'Courier New', monospace;

    --sombra-sm: 0 1px 3px rgba(0,0,0,0.1);
    --sombra:    0 2px 6px rgba(0,0,0,0.12);
    --sombra-lg: 0 4px 16px rgba(0,0,0,0.15);
    --raio:      4px;
    --trans:     0.18s ease;

    --sidebar-w: 240px;
    --topbar-h:  60px;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    background: var(--bg);
    color: var(--texto);
    font-family: var(--fonte);
    font-size: 0.9rem;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--azul); text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--azul-escuro); text-decoration: underline; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-cinza2); }
::-webkit-scrollbar-thumb { background: var(--borda2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--azul); }

/* ---- TOPBAR ---- */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--azul);
    display: flex;
    align-items: stretch;
    z-index: 300;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.topbar-toggle {
    width: 60px;
    min-width: 60px;
    background: var(--laranja);
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--trans);
    font-family: var(--fonte);
    line-height: 1;
}
.topbar-toggle:hover { background: var(--laranja-hover); }

.topbar-brand {
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.3px;
    text-decoration: none;
    border-left: 1px solid rgba(255,255,255,0.15);
    flex-grow: 1;
    gap: 0.6rem;
}
.topbar-brand:hover { color: white; text-decoration: none; }

.topbar-brand-sub {
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255,255,255,0.75);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0 1rem;
    flex-shrink: 0;
}

.topbar-clock {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
}

.user-name {
    font-size: 0.85rem;
    color: white;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-avatar {
    width: 35px;
    height: 35px;
    background: #81c784;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
    flex-shrink: 0;
    cursor: default;
}

.badge-perfil {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.12rem 0.5rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.badge-admin   { background: var(--vermelho); color: white; }
.badge-auditor { background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.4); }
.badge-viz     { background: var(--laranja); color: white; }

.btn-header {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.28rem 0.75rem;
    border-radius: var(--raio);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: background var(--trans);
    white-space: nowrap;
    font-family: var(--fonte);
}
.btn-header:hover { background: rgba(255,255,255,0.28); color: white; text-decoration: none; }
.btn-header-red { background: var(--vermelho); border-color: var(--vermelho); }
.btn-header-red:hover { background: #a31e1e; border-color: #a31e1e; }

/* ---- BREADCRUMB ---- */
.breadcrumb {
    position: fixed;
    top: var(--topbar-h);
    left: 0; right: 0;
    height: 30px;
    background: white;
    border-bottom: 1px solid var(--borda);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    font-size: 0.72rem;
    color: var(--texto3);
    z-index: 200;
    letter-spacing: 0.3px;
}
.breadcrumb strong { color: var(--azul); text-transform: uppercase; font-weight: 600; }

/* ---- SIDEBAR ---- */
.sidebar {
    position: fixed;
    top: calc(var(--topbar-h) + 30px);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--azul-escuro);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--trans);
    will-change: transform;
}

.sidebar.fechado {
    transform: translateX(calc(-1 * var(--sidebar-w)));
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}
.sidebar-overlay.ativo { display: block; }

.sidebar-grupo {
    font-size: 0.62rem;
    font-weight: 700;
    color: rgba(255,255,255,0.38);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 0.75rem 1rem 0.22rem;
    user-select: none;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    color: rgba(255,255,255,0.75);
    font-size: 0.87rem;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background var(--trans), color var(--trans), border-color var(--trans);
}
.sidebar a:hover {
    color: white;
    background: rgba(255,255,255,0.09);
    text-decoration: none;
    border-left-color: rgba(255,255,255,0.3);
}
.sidebar a.ativo {
    color: white;
    background: var(--azul);
    border-left-color: var(--laranja);
    font-weight: 600;
}

.sidebar-icone {
    width: 16px;
    min-width: 16px;
    text-align: center;
    font-size: 0.78rem;
    opacity: 0.5;
    font-style: normal;
}
.sidebar a:hover .sidebar-icone,
.sidebar a.ativo .sidebar-icone { opacity: 1; }

.sidebar-rodape {
    margin-top: auto;
    padding: 0.75rem 1rem;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.28);
    border-top: 1px solid rgba(255,255,255,0.06);
    line-height: 1.8;
}

/* ---- CORPO DA PAGINA ---- */
.corpo-pagina {
    padding-top: calc(var(--topbar-h) + 30px);
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--trans);
}

.corpo-pagina.sidebar-fechado { margin-left: 0; }

.main { flex: 1; padding: 1.5rem; overflow-x: auto; }

/* ---- TITULO DA PAGINA ---- */
.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--azul-escuro);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 3px solid var(--azul);
    padding-bottom: 0.6rem;
    margin-bottom: 1.35rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.page-title .subtitle {
    font-size: 0.72rem;
    color: var(--texto3);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-left: auto;
}

.glow { /* sem efeito */ }

/* ---- BOX / CARD ---- */
.box {
    background: var(--bg-branco);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    margin-bottom: 1.25rem;
    box-shadow: var(--sombra-sm);
}

.box-header {
    background: var(--bg-cinza);
    border-bottom: 1px solid var(--borda);
    border-radius: var(--raio) var(--raio) 0 0;
    padding: 0.55rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--azul-escuro);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.box > *:not(.box-header) { padding: 1rem; }
.box > .table-wrap,
.box > table { padding: 0; }

/* ---- STAT CARDS ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.stat-card {
    background: var(--bg-branco);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    border-top: 4px solid var(--azul);
    padding: 0.9rem 1rem;
    box-shadow: var(--sombra-sm);
    transition: box-shadow var(--trans), transform var(--trans);
}
.stat-card:hover { box-shadow: var(--sombra); transform: translateY(-2px); }
.stat-card.warn { border-top-color: var(--amarelo); }
.stat-card.err  { border-top-color: var(--vermelho); }
.stat-card.info { border-top-color: #2670e8; }
.stat-card.ok   { border-top-color: var(--verde); }

.stat-label { font-size: 0.65rem; color: var(--texto3); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; margin-bottom: 0.15rem; }
.stat-value { font-size: 1.9rem; font-weight: 700; color: var(--azul); line-height: 1.1; }
.stat-card.warn .stat-value { color: var(--amarelo); }
.stat-card.err  .stat-value { color: var(--vermelho); }
.stat-card.info .stat-value { color: #2670e8; }
.stat-card.ok   .stat-value { color: var(--verde); }
.stat-sub { font-size: 0.7rem; color: var(--texto3); margin-top: 0.12rem; }

/* ---- TABELAS ---- */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
    font-family: var(--fonte);
}

table th {
    background: var(--azul-escuro);
    color: white;
    font-size: 0.71rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0.55rem 0.9rem;
    text-align: left;
    white-space: nowrap;
    border: none;
}

table td {
    padding: 0.5rem 0.9rem;
    border-bottom: 1px solid var(--borda);
    color: var(--texto);
    vertical-align: middle;
    background: white;
    font-size: 0.87rem;
}

table tr:nth-child(even) td { background: var(--bg-cinza); }
table tr:hover td { background: var(--azul-claro) !important; }

.dim { color: var(--texto3); font-size: 0.8rem; }

/* ---- FORMULARIOS ---- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 1rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.28rem; }
.form-group.full { grid-column: 1 / -1; }

label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--texto2);
    letter-spacing: 0.2px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="month"],
input[type="number"],
input[type="file"],
select,
textarea {
    background: white;
    border: 1px solid var(--borda2);
    border-radius: var(--raio);
    color: var(--texto);
    font-family: var(--fonte);
    font-size: 0.9rem;
    padding: 0.46rem 0.72rem;
    outline: none;
    transition: border-color var(--trans), box-shadow var(--trans);
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 2px rgba(0,92,153,0.18);
}

input[type="file"] { cursor: pointer; color: var(--texto2); }
select option { background: white; color: var(--texto); }
textarea { resize: vertical; min-height: 78px; }
.form-hint { font-size: 0.72rem; color: var(--texto3); }

/* ---- BOTOES ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.46rem 1rem;
    font-family: var(--fonte);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--raio);
    text-decoration: none;
    transition: background var(--trans), border-color var(--trans), color var(--trans);
    background: transparent;
    white-space: nowrap;
    line-height: 1.35;
    vertical-align: middle;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-green, .btn-primary, .btn-blue {
    background: var(--azul); border-color: var(--azul); color: white;
}
.btn-green:hover, .btn-primary:hover, .btn-blue:hover {
    background: var(--azul-hover); border-color: var(--azul-hover); color: white;
}

.btn-cyan {
    background: #005c99; border-color: #005c99; color: white;
}
.btn-cyan:hover { background: #004d80; border-color: #004d80; color: white; }

.btn-amber {
    background: var(--laranja); border-color: var(--laranja); color: white;
}
.btn-amber:hover { background: var(--laranja-hover); border-color: var(--laranja-hover); color: white; }

.btn-red {
    background: var(--vermelho); border-color: var(--vermelho); color: white;
}
.btn-red:hover { background: #a31e1e; border-color: #a31e1e; color: white; }

.btn-gray {
    background: white; border-color: var(--borda2); color: var(--texto2);
}
.btn-gray:hover { background: var(--bg-cinza2); color: var(--texto); }

.btn-outline {
    background: transparent; border-color: var(--azul); color: var(--azul);
}
.btn-outline:hover { background: var(--azul); color: white; }

.btn-sm  { padding: 0.28rem 0.65rem; font-size: 0.78rem; }
.btn-lg  { padding: 0.6rem 1.5rem; font-size: 0.95rem; }

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ---- BADGES ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    font-size: 0.71rem;
    font-weight: 700;
    padding: 0.14rem 0.52rem;
    border-radius: 20px;
    border: 1px solid transparent;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-ok   { background: var(--verde-claro);   border-color: #a5d6a7;   color: var(--verde); }
.badge-warn { background: var(--amarelo-claro); border-color: #ffcc80;   color: var(--amarelo); }
.badge-err  { background: var(--vermelho-claro);border-color: #ef9a9a;   color: var(--vermelho); }
.badge-info { background: var(--azul-claro);    border-color: #90caf9;   color: var(--azul); }
.badge-pend { background: var(--bg-cinza2);     border-color: var(--borda); color: var(--texto3); }

/* ---- ALERTAS ---- */
.alert {
    padding: 0.72rem 1rem;
    border-radius: var(--raio);
    border: 1px solid;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    line-height: 1.55;
}

.alert-ok   { background: var(--verde-claro);   border-color: #a5d6a7;   color: #1b5e20; }
.alert-err  { background: var(--vermelho-claro); border-color: #ef9a9a;   color: #7f0000; }
.alert-warn { background: var(--amarelo-claro); border-color: #ffcc80;   color: #7a3500; }
.alert-info { background: var(--azul-claro);    border-color: #90caf9;   color: #0a2d6b; }

/* ---- ALERTA DUPLICATA ---- */
.dup-alert {
    background: var(--vermelho-claro);
    border: 1px solid #ef9a9a;
    border-left: 4px solid var(--vermelho);
    border-radius: var(--raio);
    padding: 0.85rem 1rem;
    margin: 0.75rem 0;
    color: #7f0000;
    font-size: 0.88rem;
    line-height: 1.6;
}
.dup-alert strong { display: block; margin-bottom: 0.3rem; color: var(--vermelho); }

/* ---- RNU TAG ---- */
.rnu-tag {
    font-family: var(--fonte-mono);
    font-size: 0.75rem;
    color: #5c3600;
    background: #fff8e1;
    border: 1px solid #ffcc80;
    border-radius: 3px;
    padding: 0.1rem 0.45rem;
    white-space: nowrap;
    display: inline-block;
}

/* ---- PAGINACAO ---- */
.pager {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--borda);
}

.pager a, .pager span {
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--borda2);
    border-radius: var(--raio);
    color: var(--azul);
    text-decoration: none;
    background: white;
    font-size: 0.82rem;
    transition: background var(--trans), border-color var(--trans);
}
.pager a:hover   { background: var(--azul-claro); border-color: var(--azul); text-decoration: none; }
.pager .current  { background: var(--azul); border-color: var(--azul); color: white; }
.pager .dim      { color: var(--texto3); background: var(--bg-cinza); }

/* ---- BARRA DE FILTRO ---- */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    border-left: 4px solid var(--azul);
    box-shadow: var(--sombra-sm);
}
.filter-bar .form-group { min-width: 130px; }

/* ---- UPLOAD ZONE ---- */
.upload-zone {
    border: 2px dashed var(--borda2);
    border-radius: var(--raio);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--trans), background var(--trans);
    position: relative;
    background: var(--bg-cinza);
}
.upload-zone:hover, .upload-zone.drag {
    border-color: var(--azul);
    background: var(--azul-claro);
}
.upload-zone input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; font-size: 0;
}
.upload-zone .ico { font-size: 2.2rem; color: var(--azul); display: block; margin-bottom: 0.5rem; line-height: 1; }
.upload-zone p { color: var(--texto3); font-size: 0.88rem; }

/* ---- PROGRESS BAR ---- */
.prog-bar-wrap { background: var(--bg-cinza2); height: 5px; border-radius: 3px; overflow: hidden; }
.prog-bar { height: 100%; background: var(--azul); transition: width 0.3s; border-radius: 3px; }

/* ---- TRIAGEM LOTE ---- */
.lote-wrap { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.lote-topbar {
    height: var(--topbar-h);
    background: var(--azul);
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.lote-btn-voltar {
    width: 60px;
    background: var(--laranja);
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background var(--trans);
    text-decoration: none;
    font-family: var(--fonte);
}
.lote-btn-voltar:hover { background: var(--laranja-hover); color: white; text-decoration: none; }

.lote-titulo {
    display: flex; align-items: center;
    padding: 0 1.25rem;
    color: white; font-weight: 700; font-size: 1.1rem;
    text-decoration: none; border-left: 1px solid rgba(255,255,255,0.15);
    flex-grow: 1;
}
.lote-titulo:hover { color: white; text-decoration: none; }

.lote-acoes {
    display: flex; align-items: center; gap: 0.5rem; padding: 0 1rem; flex-shrink: 0;
}

/* Barra de progresso fina abaixo do topbar */
.lote-progresso { height: 4px; background: var(--bg-cinza2); flex-shrink: 0; }
.lote-progresso .barra { height: 100%; background: var(--azul); transition: width 0.3s; }

.lote-corpo {
    display: grid;
    grid-template-columns: 280px 1fr;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.lote-lista {
    border-right: 1px solid var(--borda);
    overflow-y: auto;
    background: white;
    display: flex;
    flex-direction: column;
}

.lote-lista-cabecalho {
    padding: 0.5rem 0.75rem;
    background: var(--bg-cinza);
    border-bottom: 1px solid var(--borda);
    font-size: 0.71rem;
    font-weight: 700;
    color: var(--azul-escuro);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky; top: 0; z-index: 5;
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0;
}

.lote-item {
    padding: 0.48rem 0.75rem;
    border-bottom: 1px solid var(--borda);
    cursor: pointer;
    transition: background var(--trans);
    display: flex; align-items: center; gap: 0.45rem;
}
.lote-item:hover   { background: var(--azul-claro); }
.lote-item.ativo   { background: #e3f2fd; border-left: 3px solid var(--azul); }
.lote-item.salvo   { border-left: 3px solid var(--verde); }

.lote-item .idx     { color: var(--texto3); font-size: 0.71rem; min-width: 22px; flex-shrink: 0; }
.lote-item .arq-nome {
    font-size: 0.8rem; color: var(--texto); flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.lote-direita {
    display: grid;
    grid-template-rows: 1fr auto;
    overflow: hidden;
    min-height: 0;
}

.viewer-area {
    background: #1a1a2e;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
    border-bottom: 2px solid var(--borda);
}

.viewer-area img   { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.viewer-area iframe { width: 100%; height: 100%; border: none; }
.viewer-area video { max-width: 100%; max-height: 100%; }

.viewer-placeholder { color: rgba(255,255,255,0.4); text-align: center; }
.viewer-placeholder .ph-icone { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; opacity: 0.4; }

.viewer-label {
    position: absolute; top: 0.5rem; left: 0.5rem;
    background: rgba(0,0,0,0.6); color: rgba(255,255,255,0.85);
    font-size: 0.65rem; padding: 0.18rem 0.55rem; border-radius: 2px;
    max-width: calc(100% - 1rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.lote-formulario {
    overflow-y: auto;
    background: var(--bg-cinza);
    border-top: 1px solid var(--borda);
    padding: 0.85rem 1rem;
    flex-shrink: 0;
}

.lote-form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.lote-nav {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.65rem;
    flex-wrap: wrap; gap: 0.5rem;
}
.lote-nav-titulo { font-size: 0.88rem; font-weight: 700; color: var(--azul-escuro); }

.nav-btn {
    background: var(--azul-escuro); border: none; border-radius: var(--raio);
    color: white; font-size: 0.9rem; padding: 0.22rem 0.7rem;
    cursor: pointer; transition: background var(--trans);
    font-family: var(--fonte);
}
.nav-btn:hover { background: var(--azul); }

.arq-contador { font-size: 0.78rem; color: var(--texto2); min-width: 55px; text-align: center; }

.lote-acoes-form {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}

/* Barra de rodape estilo PF keys SED */
.barra-pf {
    background: var(--azul-escuro);
    display: flex; gap: 1.5rem; align-items: center;
    padding: 0.22rem 1rem;
    font-family: var(--fonte-mono); font-size: 0.68rem;
    flex-shrink: 0; white-space: nowrap; overflow-x: auto;
}
.pf-chave  { color: white; font-weight: 700; }
.pf-igual  { color: rgba(255,255,255,0.3); }
.pf-desc   { color: rgba(255,255,255,0.6); }
.barra-pf-info { margin-left: auto; color: rgba(255,255,255,0.35); font-size: 0.65rem; }

/* ---- LOGIN ---- */
.login-wrap {
    min-height: 100vh; display: flex; flex-direction: column; background: var(--bg);
}
.govbr-barra {
    background: var(--azul-escuro); height: 36px; display: flex; align-items: center;
    padding: 0 2rem; gap: 1rem; font-size: 0.72rem; color: rgba(255,255,255,0.85);
}
.govbr-barra a { color: white; font-weight: 600; text-decoration: none; }
.login-centro { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.login-caixa { width: 460px; background: white; border-radius: var(--raio); box-shadow: var(--sombra-lg); overflow: hidden; }
.login-cabecalho { background: var(--azul); padding: 1.5rem 2rem; display: flex; align-items: center; gap: 1rem; }
.login-logo-icone {
    width: 46px; height: 46px; background: var(--laranja); border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 1.3rem; color: white; flex-shrink: 0;
}
.login-logo-texto strong { display: block; font-size: 1.25rem; font-weight: 700; color: white; letter-spacing: 1px; }
.login-logo-texto small  { font-size: 0.68rem; color: rgba(255,255,255,0.7); }
.login-corpo { padding: 2rem; }
.login-subtitulo { font-size: 1rem; font-weight: 600; color: var(--azul-escuro); margin-bottom: 1.5rem; }
.login-divisor { display: flex; align-items: center; gap: 0.75rem; color: var(--texto3); font-size: 0.85rem; margin: 1.25rem 0; }
.login-divisor::before, .login-divisor::after { content: ''; flex: 1; border-top: 1px solid var(--borda); }

/* ---- MODAL ---- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 500; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: var(--raio); box-shadow: var(--sombra-lg); padding: 1.75rem; min-width: 440px; max-width: 92vw; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-titulo { font-size: 1.05rem; font-weight: 700; color: var(--azul-escuro); margin-bottom: 1.25rem; padding-bottom: 0.7rem; border-bottom: 2px solid var(--azul); text-transform: uppercase; }
.modal-fechar { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: var(--texto3); font-size: 1.1rem; cursor: pointer; padding: 0.25rem; border-radius: 50%; transition: background var(--trans); }
.modal-fechar:hover { background: var(--vermelho-claro); color: var(--vermelho); }

/* ---- FOOTER ---- */
footer {
    background: var(--azul-escuro);
    color: rgba(255,255,255,0.45);
    text-align: center;
    font-size: 0.71rem;
    padding: 0.75rem;
}

/* ---- UTILITARIOS ---- */
.text-green,
.text-primary { color: var(--azul); }
.text-cyan    { color: var(--azul); }
.text-amber   { color: var(--amarelo); }
.text-red     { color: var(--vermelho); }
.text-ok      { color: var(--verde); }
.text-gray    { color: var(--texto3); }

.text-right   { text-align: right; }
.text-center  { text-align: center; }

.mt1 { margin-top: 0.5rem; }
.mt2 { margin-top: 1rem; }
.mt3 { margin-top: 1.5rem; }
.mb1 { margin-bottom: 0.5rem; }
.mb2 { margin-bottom: 1rem; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-gap { gap: 0.5rem; }
.w100 { width: 100%; }

hr.sep { border: none; border-top: 1px solid var(--borda); margin: 1.25rem 0; }
.mono  { font-family: var(--fonte-mono); }
.small { font-size: 0.8rem; }
.preformatted { white-space: pre-wrap; word-break: break-all; font-size: 0.78rem; color: var(--texto3); }

/* ---- RESPONSIVO ---- */
@media (max-width: 900px) {
    .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
    .sidebar.aberto { transform: translateX(0); }
    .corpo-pagina { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid  { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; }
    .main { padding: 1rem; }
    .lote-corpo { grid-template-columns: 1fr; }
    .lote-lista { max-height: 180px; }
    .lote-form-grid { grid-template-columns: repeat(2, 1fr); }
    .user-name, .topbar-clock, .topbar-brand-sub { display: none; }
}