/* Cores e fontes herdadas das telas /trucks do PESA; disposicao no modelo do NiceAdmin:
   cabecalho fixo no topo, menu lateral, conteudo a direita, rodape. */
body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    color: #333;
}

/* Cabecalho */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 997;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background-color: #fff;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.header-marca { display: flex; align-items: center; justify-content: space-between; }

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    line-height: 1;
}

.logo img { height: 48px; width: auto; }
.small-logo { width: 100px; }

.toggle-sidebar-btn {
    background: none;
    border: none;
    padding: 0 0 0 10px;
    font-size: 32px;
    line-height: 1;
    color: #333;
    cursor: pointer;
}

/* Menu do usuario, a direita do cabecalho */
.perfil { position: relative; font-size: 14px; }

.perfil summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    font-weight: bold;
}

.perfil summary::-webkit-details-marker { display: none; }
.perfil summary .bi-person-circle { font-size: 28px; }
.perfil summary .bi-chevron-down { font-size: 12px; }

.perfil-menu {
    position: absolute;
    top: 44px;
    right: 0;
    min-width: 200px;
    padding: 8px 0;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
}

.perfil-menu form { margin: 0; }

.perfil-menu a,
.perfil-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 15px;
    border: none;
    background: none;
    color: #333;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

.perfil-menu a:hover,
.perfil-menu button:hover { background-color: #f5f5f5; }
.perfil-menu i { font-size: 18px; }

/* Menu lateral */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 300px;
    z-index: 996;
    padding: 20px;
    overflow-y: auto;
    background-color: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    transition: all 0.3s;
}

.sidebar-nav { margin: 0; padding: 0; list-style: none; }
.sidebar-nav .nav-item { margin-bottom: 5px; }

.sidebar-nav .nav-heading {
    margin: 15px 0 5px 15px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: #666;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    color: #666;
    text-decoration: none;
}

.sidebar-nav .nav-link i { font-size: 16px; margin-right: 10px; }

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.ativo { color: #333; background-color: #f5f5f5; }

/* Item com submenus (Relatorio): o titulo abre e fecha, os links ficam recuados */
.nav-grupo summary { list-style: none; cursor: pointer; }
.nav-grupo summary::-webkit-details-marker { display: none; }
.nav-grupo .seta { margin: 0 0 0 auto; font-size: 12px; transition: transform 0.2s; }
.nav-grupo[open] .seta { transform: rotate(180deg); }
.nav-sub { margin: 5px 0 0 0; padding: 0; list-style: none; }
.nav-sub .nav-link { padding: 8px 15px 8px 30px; font-size: 14px; font-weight: normal; }
.nav-sub .nav-link.ativo { font-weight: bold; }

/* Conteudo e rodape: ao lado do menu em tela larga; em tela estreita o menu fica escondido */
#main {
    margin-top: 60px;
    padding: 20px 30px;
    transition: all 0.3s;
}

.footer {
    padding: 20px 0;
    background-color: #fff;
    border-top: 1px solid #ddd;
    text-align: center;
    transition: all 0.3s;
}

@media (min-width: 1200px) {
    .header .logo { width: 280px; }
    #main, #footer { margin-left: 300px; }
    .toggle-sidebar #main, .toggle-sidebar #footer { margin-left: 0; }
    .toggle-sidebar .sidebar { left: -300px; }
}

@media (max-width: 1199px) {
    #main { padding: 20px; }
    .sidebar { left: -300px; }
    .toggle-sidebar .sidebar { left: 0; }
}

/* Titulo da pagina e trilha */
.pagetitle { margin-bottom: 20px; }
.pagetitle h1 { font-size: 24px; margin: 0 0 6px 0; }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    color: #666;
}

.breadcrumb li + li::before { content: "/"; padding: 0 8px; color: #999; }
.breadcrumb a { color: #666; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .atual { color: #333; font-weight: bold; }

/* Tela de login: sem cabecalho nem menu, tudo centralizado */
.login {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
}

.login .login-logo { width: 160px; }
.login .box { width: 100%; }
/* O PNG da C2H tem fundo branco: multiply faz o branco sumir no cinza da pagina */
.login .small-logo { mix-blend-mode: multiply; }
.login h1 { font-size: 22px; margin: 0 0 20px 0; }

h2 { font-size: 18px; margin: 0 0 15px 0; text-align: left; }
.dica { margin: -8px 0 15px 0; font-size: 14px; color: #666; text-align: left; }

.box {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 0 0 20px 0;
    box-sizing: border-box;
}

.box-estreito { max-width: 420px; }

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.filter-group label {
    font-weight: bold;
    margin-bottom: 5px;
}

.filter-group input,
.filter-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
    box-sizing: border-box;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #333;
}

.form-coluna .filter-group { width: 100%; margin-bottom: 15px; }
.form-coluna .filter-group input,
.form-coluna .filter-group select { width: 100%; }
.form-coluna .linha-check { flex-direction: row; align-items: center; gap: 8px; }
.form-coluna .linha-check input { width: auto; min-width: 0; }
.form-coluna .linha-check label { margin: 0; }

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-search { background-color: #333; color: #fff; }
.btn-search:hover { background-color: #555; }
.btn-excel { background-color: #1d6f42; color: #fff; }
.btn-excel:hover { background-color: #185c37; }
.btn-clear { background-color: #dc3545; color: #fff; }
.btn-clear:hover { background-color: #c82333; }
.btn-link { background: none; color: #333; padding: 0; }
.btn-link:hover { text-decoration: underline; }

table.lista {
    width: 100%;
    margin: 0 0 20px 0;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

table.lista th, table.lista td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: center;
}

table.lista th { background-color: #333; color: #fff; }
table.lista tr:nth-child(even) { background-color: #f2f2f2; }
table.lista tr:hover { background-color: #e9e9e9; }

.acao {
    display: inline-block;
    text-decoration: none;
    font-size: 20px;
    line-height: 1;
}

.total { color: #666; font-size: 14px; margin-bottom: 10px; }

.selo {
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
}

.selo-camera { background-color: #28a745; }
.selo-ocr { background-color: #007bff; }
.selo-nenhuma { background-color: #dc3545; }
.selo-inativo { background-color: #999; }
.sem-placa { color: #dc3545; font-weight: bold; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.pagination a, .pagination span {
    color: #333;
    padding: 8px 16px;
    text-decoration: none;
    border: 1px solid #ddd;
    background-color: #fff;
}

.pagination a.active { background-color: #333; color: #fff; border-color: #333; }
.pagination a:hover:not(.active) { background-color: #ddd; }
.pagination span { border-color: transparent; background: none; }

.empty-message { padding: 40px; color: #666; font-size: 18px; text-align: center; }

.aviso, .erro {
    margin: 0 0 20px 0;
    padding: 12px;
    border-radius: 4px;
    box-sizing: border-box;
}

.aviso { background-color: #d4edda; color: #155724; }
.erro { background-color: #f8d7da; color: #721c24; }

/* Detalhe da pesagem */
.campos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px 24px;
    text-align: left;
}

.campo .rotulo { font-size: 12px; color: #666; text-transform: uppercase; }
.campo .valor { font-size: 15px; font-weight: bold; overflow-wrap: anywhere; }
.campo .vazio { color: #bbb; font-weight: normal; }

.fotos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.fotos figure { margin: 0; }
.fotos figcaption { font-weight: bold; margin-bottom: 8px; }
.fotos .sem-foto { padding: 60px 0; text-align: center; border: 1px dashed #bbb; border-radius: 8px; color: #999; }

.img-container { position: relative; display: block; cursor: pointer; }
.img-container img { width: 100%; height: auto; border-radius: 8px; display: block; }
.img-container:hover .zoom-icon { opacity: 1; }

.zoom-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s;
}

pre.json {
    text-align: left;
    background-color: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 13px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content { margin: 2% auto 0 auto; display: block; max-width: 90%; max-height: 90%; }

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

@media (max-width: 900px) {
    table.lista { display: block; overflow-x: auto; }
}

/* Placa desenhada no titulo do detalhe: Mercosul (faixa azul) e padrao antigo (cinza) */
.pagetitle .titulo-placa { margin-bottom: 12px; }
.placa-br {
    display: inline-flex;
    flex-direction: column;
    width: 300px;
    max-width: 90%;
    text-align: center;
    border: 4px solid #111;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
    color: #111;
}
.placa-faixa {
    height: 26px;
    line-height: 26px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 3px;
}
.placa-texto {
    font-size: 52px;
    font-weight: bold;
    line-height: 1.25;
    letter-spacing: 4px;
    white-space: nowrap;
}
.placa-mercosul { background-color: #fff; }
.placa-mercosul .placa-faixa { background-color: #003399; color: #fff; }
.placa-antiga { background-color: #c4c7c9; }
.placa-antiga .placa-faixa { height: 14px; }

/* Dashboard */
.dash-atualizado { margin-top: 12px; }
.dash-cartoes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin: 0 0 20px 0;
}
.dash-cartao {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    text-align: left;
}
.dash-cartao .rotulo { font-size: 12px; color: #666; text-transform: uppercase; margin-bottom: 6px; }
.dash-cartao .numero { font-size: 30px; font-weight: bold; line-height: 1.1; }
.dash-cartao .numero2 { font-size: 20px; font-weight: bold; margin-top: 10px; }
.dash-cartao .unidade { font-size: 12px; color: #666; }
table.dash-tabela { width: 100%; margin: 0 0 10px 0; box-shadow: none; }
table.dash-tabela th, table.dash-tabela td { padding: 8px 12px; }
.dash-grafico { width: 100%; overflow: hidden; }
.dash-grafico svg { display: block; }
.dash-grafico .barra { fill: #2f6fb3; }
.dash-grafico .grade { stroke: #e6e6e6; stroke-width: 1; }
.dash-grafico .eixo { stroke: #999; stroke-width: 1; }
.dash-grafico .escala { fill: #666; font-size: 11px; }
.dash-grafico .alvo { fill: transparent; }
.dash-grafico .alvo:hover { fill: rgba(0, 0, 0, 0.06); }
.dash-dica { min-height: 20px; font-size: 14px; font-weight: bold; margin-top: 6px; }
.dash-detalhe { text-align: left; margin-top: 10px; }
.dash-detalhe summary { cursor: pointer; margin-bottom: 10px; }
