/* MohrMes - visual industrial (mesma identidade do relogio) */
:root {
    --grafite: #252c33;
    --grafite-2: #2f3841;
    --laranja: #ff9800;
    --laranja-escuro: #e07b00;
    --fundo: #f2f4f6;
    --cartao: #ffffff;
    --borda: #dde2e7;
    --texto: #1d2329;
    --texto-2: #66717d;
    --verde: #1e9e4a;
    --vermelho: #d93025;
    --amarelo: #f2b705;
    --azul: #2b6fd6;
    --cinza: #8a949e;
    --raio: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 15px;
    color: var(--texto);
    background: var(--fundo);
    display: flex;
    min-height: 100vh;
}

a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Menu lateral ---------- */
.menu {
    width: 220px;
    flex-shrink: 0;
    background: var(--grafite);
    color: #fff;
    padding: 18px 0;
    border-right: 4px solid var(--laranja);
}
.menu .marca {
    font-size: 22px;
    font-weight: 700;
    padding: 0 20px 18px;
    letter-spacing: .5px;
}
.menu .marca span { color: var(--laranja); }
.menu nav a {
    display: block;
    color: #d6dbe0;
    padding: 10px 20px;
    text-decoration: none;
    border-left: 4px solid transparent;
}
.menu nav a:hover { background: var(--grafite-2); color: #fff; }
.menu nav a.ativo { background: var(--grafite-2); color: #fff; border-left-color: var(--laranja); }
.menu .grupo {
    color: #8e99a4;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 18px 20px 6px;
}

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--cartao);
    border-bottom: 1px solid var(--borda);
    padding: 10px 24px;
    gap: 16px;
}
.topo .usuario { display: flex; align-items: center; gap: 12px; color: var(--texto-2); }
.topo form { margin: 0; }
.seletor { display: flex; align-items: center; gap: 8px; }
.seletor label { color: var(--texto-2); }

.conteudo { padding: 24px; max-width: 1400px; width: 100%; }

h1 { font-size: 24px; margin: 0 0 18px; }
h2 { font-size: 18px; margin: 28px 0 12px; }

.cabecalho {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.cabecalho h1 { margin: 0; }

/* ---------- Cartoes e tabelas ---------- */
.cartao {
    background: var(--cartao);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    padding: 18px;
}

table.lista {
    width: 100%;
    border-collapse: collapse;
    background: var(--cartao);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    overflow: hidden;
}
table.lista th, table.lista td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--borda);
    vertical-align: middle;
}
table.lista th { background: #f7f8fa; color: var(--texto-2); font-weight: 600; font-size: 13px; }
table.lista tr:last-child td { border-bottom: none; }
table.lista td.acoes { white-space: nowrap; text-align: right; }
table.lista td.acoes form { display: inline; }
.vazio { color: var(--texto-2); padding: 18px; text-align: center; }
.sub { color: var(--texto-2); font-size: 13px; }

/* ---------- Formularios ---------- */
.formulario {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px 18px;
    max-width: 900px;
}
.formulario .largo { grid-column: 1 / -1; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=datetime-local], select, textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #c8cfd6;
    border-radius: 7px;
    font: inherit;
    background: #fff;
}
textarea { min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--laranja); border-color: var(--laranja); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { width: auto; }
.dica { color: var(--texto-2); font-size: 12px; margin-top: 4px; font-weight: 400; }
.erro-campo { color: var(--vermelho); font-size: 12px; }
.barra-acoes { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.botao {
    display: inline-block;
    border: none;
    border-radius: 7px;
    padding: 9px 16px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    background: var(--grafite);
    color: #fff;
    text-decoration: none;
}
.botao:hover { background: var(--grafite-2); text-decoration: none; }
.botao.primario { background: var(--laranja); }
.botao.primario:hover { background: var(--laranja-escuro); }
.botao.secundario { background: #e4e8ec; color: var(--texto); }
.botao.secundario:hover { background: #d5dbe1; }
.botao.perigo { background: var(--vermelho); }
.botao.sucesso { background: var(--verde); }
.botao.fino { padding: 5px 10px; font-size: 13px; }

.aviso { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.aviso.ok { background: #e3f5e9; color: #145c2c; border: 1px solid #b6e2c4; }
.aviso.erro { background: #fde8e6; color: #8a1c13; border: 1px solid #f5c1bb; }
.aviso.info { background: #e8f0fc; color: #1a4a8f; border: 1px solid #c3d6f5; }

.filtros { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filtros a { padding: 6px 12px; border-radius: 20px; background: #e4e8ec; color: var(--texto); text-decoration: none; font-size: 13px; }
.filtros a.ativo { background: var(--grafite); color: #fff; }

/* ---------- Selos de status ---------- */
.selo {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}
.st-desconectada { background: #5f6b76; }
.st-desligada    { background: var(--cinza); }
.st-parada       { background: var(--laranja); }
.st-produzindo   { background: var(--verde); }
.st-falha        { background: var(--vermelho); }

.ch-aberto       { background: var(--vermelho); }
.ch-emandamento  { background: var(--laranja); }
.ch-finalizado   { background: var(--verde); }
.ch-cancelado    { background: var(--cinza); }

.op-aberta       { background: var(--azul); }
.op-emproducao   { background: var(--laranja); }
.op-finalizada   { background: var(--verde); }
.op-cancelada    { background: var(--cinza); }

.tp-supervisao   { background: var(--azul); }
.tp-eletrica     { background: #ef7d00; }
.tp-mecanica     { background: #b3261e; }

.online  { color: var(--verde); font-weight: 600; }
.offline { color: var(--cinza); }

/* ---------- Painel ---------- */
.resumo {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.resumo .item {
    background: var(--cartao);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    padding: 14px;
    border-top: 4px solid var(--cinza);
}
.resumo .numero { font-size: 28px; font-weight: 700; }
.resumo .rotulo { color: var(--texto-2); font-size: 13px; }
.resumo .item.verde    { border-top-color: var(--verde); }
.resumo .item.laranja  { border-top-color: var(--laranja); }
.resumo .item.vermelho { border-top-color: var(--vermelho); }
.resumo .item.azul     { border-top-color: var(--azul); }

.grade-maquinas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}
.maquina {
    background: var(--cartao);
    border: 1px solid var(--borda);
    border-radius: var(--raio);
    overflow: hidden;
    color: var(--texto);
    display: block;
}
.maquina:hover { text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.maquina .faixa { padding: 10px 14px; color: #fff; display: flex; justify-content: space-between; font-weight: 700; }
.maquina .corpo { padding: 12px 14px; }
.maquina .nome { font-size: 17px; font-weight: 700; }
.maquina .linha { color: var(--texto-2); font-size: 13px; margin-top: 4px; }
.maquina .op { margin-top: 10px; font-size: 13px; }
.barra { height: 6px; background: #e4e8ec; border-radius: 3px; margin-top: 5px; overflow: hidden; }
.barra div { height: 100%; background: var(--laranja); }

/* ---------- Login ---------- */
body.sem-menu { align-items: center; justify-content: center; background: var(--grafite); }
body.sem-menu .principal { flex: 0 1 420px; }
.login {
    background: var(--cartao);
    border-radius: 14px;
    padding: 32px;
    border-top: 6px solid var(--laranja);
}
.login .marca { font-size: 30px; font-weight: 800; margin-bottom: 4px; }
.login .marca span { color: var(--laranja); }
.login .campo { margin-bottom: 14px; }
.login .botao { width: 100%; padding: 12px; }

.colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) {
    body { flex-direction: column; }
    .menu { width: 100%; border-right: none; border-bottom: 4px solid var(--laranja); }
    .menu nav { display: flex; flex-wrap: wrap; }
    .menu .grupo { display: none; }
    .colunas { grid-template-columns: 1fr; }
    table.lista { display: block; overflow-x: auto; }
}

/* ---------- Manutencao ---------- */
.nt-corretiva { background: #c2410c; }
.nt-preventiva { background: #2b6fd6; }
.oc-prevista  { background: var(--cinza); }
.oc-osaberta  { background: var(--laranja); }
.oc-concluida { background: var(--verde); }
.oc-cancelada { background: #5f6b76; }
.oc-atrasada  { background: var(--vermelho); }

.barras { display: flex; height: 12px; background: #eef1f4; border-radius: 6px; overflow: hidden; }
.b-parada { background: var(--laranja); }
.b-falha  { background: var(--vermelho); }
.leg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin: 0 4px 0 10px; }
.resumo a.item.link { color: var(--texto); text-decoration: none; }
.resumo a.item.link:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }

.linha-tempo { list-style: none; padding: 0; margin: 0; }
.linha-tempo li { border-left: 3px solid var(--borda); padding: 6px 0 10px 14px; position: relative; }
.linha-tempo li::before { content: ""; position: absolute; left: -7px; top: 10px; width: 11px; height: 11px; border-radius: 50%; background: var(--laranja); }
.linha-tempo li.auto::before { background: var(--cinza); }
.linha-tempo .quando { color: var(--texto-2); font-size: 12px; }

.mes { margin-bottom: 18px; }
.mes h3 { margin: 0 0 8px; font-size: 15px; text-transform: capitalize; }
.dia-alerta { color: var(--vermelho); font-weight: 700; }
.dia-proximo { color: var(--laranja-escuro); font-weight: 700; }
.badge-alerta { background: var(--vermelho); color: #fff; border-radius: 12px; padding: 2px 9px; font-size: 12px; font-weight: 700; margin-left: 6px; }
.menu nav a .badge-alerta { float: right; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form select, .inline-form input { width: auto; }
.dias { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Producao (dashboards e graficos) ---------- */
svg.grafico { width: 100%; height: auto; display: block; }
.legenda { color: var(--texto-2); font-size: 12px; margin-top: 6px; }
.legenda .leg:first-child { margin-left: 0; }
.hbarras { display: grid; grid-template-columns: minmax(110px, 34%) 1fr auto; gap: 8px 10px; align-items: center; }
.hb-rotulo { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-trilho { height: 14px; background: #eef1f4; border-radius: 7px; overflow: hidden; }
.hb-trilho div { height: 100%; border-radius: 7px; }
.hb-valor { font-size: 13px; color: var(--texto-2); white-space: nowrap; text-align: right; }
.linha-status { position: relative; height: 26px; background: #eef1f4; border-radius: 6px; overflow: hidden; }
.linha-status div { position: absolute; top: 0; bottom: 0; }
.linha-status-eixo { position: relative; height: 16px; font-size: 11px; color: var(--texto-2); }
.linha-status-eixo span { position: absolute; transform: translateX(-50%); top: 2px; }
.dia-linha { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: start; margin-bottom: 6px; }
.dia-nome { font-size: 13px; font-weight: 600; padding-top: 4px; }
.dia-linha .legenda { display: none; }
.dia-linha:last-child .legenda { display: block; }

/* login: link de ajuda (FAQ do site) */
.ajuda-login { margin: 18px 0 0; text-align: center; font-size: 14px; color: #5d6873; }
.ajuda-login a { color: #b86e00; font-weight: 600; }
