/* ─── Materializa 3D · identidade ───────────────────────────────
   Rosa #ED1872 · Bordô #A71236 · Azul #8FAFD6 · Rosa bebê #F7D6E6 · Off-white #F4F4EF
   Fonte da marca é Poppins; usamos a pilha do sistema para não depender de CDN.      */

:root {
    --rosa: #ED1872;
    --rosa-escuro: #C6135F;
    --bordo: #A71236;
    --azul: #8FAFD6;
    --azul-escuro: #5F7FA6;
    --rosa-bebe: #F7D6E6;
    --offwhite: #F4F4EF;
    --tinta: #1c1230;
    --tinta-suave: #5a5470;
    --borda: #e4e1ea;
    --verde: #15803d;
    --vermelho: #b91c1c;
    --ambar: #b45309;
    --sombra: 0 1px 2px rgba(28, 18, 48, .06), 0 4px 14px rgba(28, 18, 48, .05);
    --raio: 12px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: "Segoe UI Variable Display", "Segoe UI", Poppins, system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: var(--offwhite);
    color: var(--tinta);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .6rem; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
a { color: var(--rosa); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── layout ─────────────────────────────────────────────── */
.mz-app { display: flex; min-height: 100vh; }

.mz-lateral {
    width: 240px;
    flex: 0 0 240px;
    background: linear-gradient(170deg, #2a1040 0%, #1c1230 55%, #2b0d20 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.mz-marca { padding: 1.1rem 1rem .8rem; display: flex; align-items: center; gap: .6rem; }
.mz-marca img { height: 34px; }
.mz-marca span { font-weight: 700; font-size: 1.02rem; letter-spacing: -.02em; }
.mz-marca small { display: block; font-weight: 400; font-size: .68rem; opacity: .6; letter-spacing: .08em; text-transform: uppercase; }

.mz-nav { flex: 1; overflow-y: auto; padding: .3rem .5rem 1rem; }
.mz-nav-grupo { font-size: .66rem; text-transform: uppercase; letter-spacing: .11em; opacity: .45; margin: 1rem .7rem .35rem; }
.mz-nav a {
    display: flex; align-items: center; gap: .55rem;
    padding: .5rem .7rem; margin-bottom: 2px;
    border-radius: 9px; color: #e9e5f0; font-size: .89rem; text-decoration: none;
    transition: background .12s, color .12s;
}
.mz-nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.mz-nav a.active { background: var(--rosa); color: #fff; font-weight: 600; }
.mz-nav .ic { width: 18px; text-align: center; font-size: .95rem; opacity: .9; }

.mz-usuario { padding: .7rem .9rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .8rem; }
.mz-usuario b { display: block; font-size: .86rem; }
.mz-usuario span { opacity: .55; font-size: .72rem; }
.mz-usuario a { color: var(--rosa-bebe); font-size: .76rem; }

.mz-conteudo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mz-topo {
    background: #fff; border-bottom: 1px solid var(--borda);
    padding: .75rem 1.4rem; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 20;
}
.mz-topo .titulo { font-weight: 650; font-size: 1.02rem; }
.mz-corpo { padding: 1.2rem 1.4rem 3rem; }

/* ─── cartões e grades ───────────────────────────────────── */
.mz-cartao { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.mz-cartao > h2, .mz-cartao > h3 { margin-top: 0; }

.mz-grade { display: grid; gap: 1rem; }
.mz-grade.c2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.mz-grade.c3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mz-grade.c4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.mz-indicador { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: .85rem 1rem; box-shadow: var(--sombra); }
.mz-indicador .rotulo { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--tinta-suave); }
.mz-indicador .valor { font-size: 1.5rem; font-weight: 700; margin-top: .15rem; letter-spacing: -.02em; }
.mz-indicador .nota { font-size: .74rem; color: var(--tinta-suave); }
.mz-indicador.destaque { border-left: 4px solid var(--rosa); }
.mz-indicador.alerta { border-left: 4px solid var(--vermelho); }
.mz-indicador.ok { border-left: 4px solid var(--verde); }
.mz-indicador.info { border-left: 4px solid var(--azul); }

/* ─── tabelas ────────────────────────────────────────────── */
.mz-tabela-wrap { overflow-x: auto; }
table.mz { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.mz thead th {
    position: sticky; top: 0; background: #fbfaf8; text-align: left;
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tinta-suave);
    padding: .55rem .6rem; border-bottom: 1px solid var(--borda); white-space: nowrap;
}
table.mz tbody td { padding: .55rem .6rem; border-bottom: 1px solid #f0eef3; vertical-align: middle; }
table.mz tbody tr:hover { background: #fdf6fa; }
table.mz .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.mz .acoes { text-align: right; white-space: nowrap; }

/* ─── formulários ────────────────────────────────────────── */
.mz-campo { margin-bottom: .8rem; }
.mz-campo label { display: block; font-size: .76rem; font-weight: 600; color: var(--tinta-suave); margin-bottom: .22rem; }
.mz-campo .dica { font-size: .72rem; color: var(--tinta-suave); margin-top: .2rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=tel], select, textarea {
    width: 100%; padding: .48rem .6rem; font: inherit; font-size: .88rem;
    border: 1px solid var(--borda); border-radius: 9px; background: #fff; color: var(--tinta);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--rosa-bebe); border-color: var(--rosa); }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--rosa); }

.mz-btn {
    display: inline-flex; align-items: center; gap: .4rem; justify-content: center;
    padding: .48rem .95rem; border-radius: 9px; border: 1px solid var(--rosa);
    background: var(--rosa); color: #fff; font: inherit; font-size: .86rem; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: filter .12s;
}
.mz-btn:hover { filter: brightness(1.07); text-decoration: none; color: #fff; }
.mz-btn:disabled { opacity: .5; cursor: not-allowed; }
.mz-btn.sec { background: #fff; color: var(--tinta); border-color: var(--borda); }
.mz-btn.sec:hover { background: #faf8fb; color: var(--tinta); }
.mz-btn.perigo { background: var(--vermelho); border-color: var(--vermelho); }
.mz-btn.mini { padding: .28rem .6rem; font-size: .78rem; border-radius: 7px; }
.mz-btn.zap { background: #25D366; border-color: #25D366; }

.mz-acoes { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.mz-filtros { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: .9rem; }
.mz-filtros .mz-campo { margin-bottom: 0; min-width: 150px; }

/* ─── etiquetas ──────────────────────────────────────────── */
.mz-tag {
    display: inline-block; padding: .16rem .5rem; border-radius: 999px;
    font-size: .72rem; font-weight: 600; color: #fff; white-space: nowrap;
}
.mz-tag.claro { background: var(--rosa-bebe); color: var(--bordo); }
.mz-tag.cinza { background: #eceaf0; color: var(--tinta-suave); }

.mz-aviso { padding: .6rem .8rem; border-radius: 9px; font-size: .85rem; margin-bottom: .8rem; }
.mz-aviso.erro { background: #fdecec; color: var(--vermelho); border: 1px solid #f5c6c6; }
.mz-aviso.ok { background: #e8f6ed; color: var(--verde); border: 1px solid #c2e5cf; }
.mz-aviso.info { background: #eef3fa; color: #37506f; border: 1px solid #cfdcee; }

.mz-vazio { text-align: center; padding: 2.5rem 1rem; color: var(--tinta-suave); }
.mz-vazio h2 { color: var(--tinta); }

/* ─── barra de progresso ─────────────────────────────────── */
.mz-barra { height: 8px; background: #eceaf0; border-radius: 999px; overflow: hidden; }
.mz-barra > div { height: 100%; background: var(--rosa); border-radius: 999px; transition: width .3s; }
.mz-barra.verde > div { background: var(--verde); }
.mz-barra.ambar > div { background: var(--ambar); }
.mz-barra.vermelha > div { background: var(--vermelho); }

/* ─── login ──────────────────────────────────────────────── */
.mz-login {
    min-height: 100vh; display: grid; place-items: center;
    background: linear-gradient(150deg, #2a1040 0%, #1c1230 50%, #40122c 100%);
    padding: 1rem;
}
.mz-login .caixa { background: #fff; border-radius: 18px; padding: 2rem 1.9rem; width: 100%; max-width: 380px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.mz-login .caixa img { height: 46px; display: block; margin: 0 auto 1.1rem; }
.mz-login .caixa h1 { text-align: center; font-size: 1.15rem; margin-bottom: .2rem; }
.mz-login .caixa p.sub { text-align: center; color: var(--tinta-suave); font-size: .82rem; margin: 0 0 1.3rem; }
.mz-login .mz-btn { width: 100%; padding: .6rem; }
.mz-login .rodape { text-align: center; font-size: .72rem; color: var(--tinta-suave); margin-top: 1.1rem; }

/* ─── modal ──────────────────────────────────────────────── */
.mz-modal-fundo { position: fixed; inset: 0; background: rgba(28,18,48,.45); display: grid; place-items: center; z-index: 100; padding: 1rem; }
.mz-modal { background: #fff; border-radius: 16px; width: 100%; max-width: 640px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.mz-modal.largo { max-width: 900px; }
.mz-modal header { padding: .9rem 1.1rem; border-bottom: 1px solid var(--borda); display: flex; justify-content: space-between; align-items: center; }
.mz-modal header h2 { margin: 0; font-size: 1.02rem; }
.mz-modal .corpo { padding: 1.1rem; overflow-y: auto; }
.mz-modal footer { padding: .8rem 1.1rem; border-top: 1px solid var(--borda); display: flex; justify-content: flex-end; gap: .5rem; }
.mz-fechar { background: none; border: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--tinta-suave); }

@media (max-width: 900px) {
    .mz-app { flex-direction: column; }
    .mz-lateral { width: 100%; flex: none; height: auto; position: static; }
    .mz-nav { display: flex; flex-wrap: wrap; gap: .2rem; }
    .mz-nav-grupo { display: none; }
    .mz-corpo { padding: 1rem .8rem 2rem; }
}

h1:focus, h2:focus, [tabindex="-1"]:focus { outline: none; }

@media print {
    .mz-lateral, .mz-acoes, .mz-filtros, .mz-btn { display: none !important; }
    .mz-app { display: block; }
    .mz-cartao { break-inside: avoid; box-shadow: none; }
}

#blazor-error-ui { display: none; }
