* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f4f1ec; color: #2b2620; }
.hidden { display: none !important; }
.muted { color: #8a8175; font-size: .85rem; }
.erro { color: #b3261e; font-size: .85rem; margin-top: .5rem; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 340px; display: flex; flex-direction: column; gap: .8rem; }
.card { background: #fff; border-radius: 14px; padding: 1.4rem; box-shadow: 0 2px 12px rgba(0,0,0,.08); }

#app { display: flex; min-height: 100vh; }
aside { width: 220px; background: #23201c; color: #efe9df; padding: 1.2rem .8rem; display: flex; flex-direction: column; }
aside h1 { font-size: 1.15rem; margin-bottom: 1.2rem; padding: 0 .5rem; }
aside h1 span { color: #d9a441; }
nav { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
nav button { background: none; border: 0; color: #cfc6b8; text-align: left; padding: .65rem .8rem; border-radius: 8px; cursor: pointer; font-size: .95rem; }
nav button:hover { background: #33302a; }
nav button.active { background: #d9a441; color: #23201c; font-weight: 600; }
.side-foot { border-top: 1px solid #3a352e; padding-top: .8rem; display: flex; flex-direction: column; gap: .4rem; font-size: .85rem; }
.side-foot button { background: none; border: 0; color: #cfc6b8; cursor: pointer; text-align: left; padding: .3rem .5rem; border-radius: 6px; }
.side-foot button:hover { background: #33302a; }

main { flex: 1; padding: 1.6rem 2rem; overflow-x: auto; }
h2 { margin-bottom: .2rem; }
h3 { margin: 1.4rem 0 .6rem; font-size: 1rem; color: #6b6154; text-transform: uppercase; letter-spacing: .04em; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px,1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.kpi { background: #fff; border-radius: 12px; padding: 1rem 1.2rem; box-shadow: 0 1px 6px rgba(0,0,0,.06); }
.kpi .lbl { font-size: .78rem; color: #8a8175; text-transform: uppercase; letter-spacing: .05em; }
.kpi .val { font-size: 1.5rem; font-weight: 700; margin-top: .2rem; }
.kpi .sub { font-size: .78rem; color: #8a8175; margin-top: .15rem; }
.kpi.ok .val { color: #2e7d32; } .kpi.bad .val { color: #b3261e; }

.tabela-wrap { background: #fff; border-radius: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.06); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: .55rem .8rem; text-align: left; border-bottom: 1px solid #efe9df; white-space: nowrap; }
th { background: #faf7f2; color: #6b6154; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: #fbf8f3; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; background: #eee7db; }
.tag.ok { background: #d8ecd9; color: #2e7d32; }
.tag.bad { background: #f6dcd8; color: #b3261e; }

input, select, textarea { width: 100%; padding: .5rem .7rem; border: 1px solid #ddd2c2; border-radius: 8px; font-size: .9rem; background: #fff; }
input:focus, select:focus { outline: 2px solid #d9a44155; border-color: #d9a441; }
button.btn { background: #d9a441; border: 0; color: #23201c; padding: .55rem 1rem; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: .9rem; }
button.btn:hover { filter: brightness(1.07); }
button.btn.sec { background: #efe9df; }
button.btn.danger { background: #b3261e; color: #fff; }
button.btn.sm { padding: .3rem .6rem; font-size: .8rem; }

.barra { display: flex; gap: .6rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.barra input, .barra select { width: auto; min-width: 140px; }

#modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 10; }
#modalBox { width: 480px; max-width: 92vw; max-height: 88vh; overflow-y: auto; }
#modalBox h3 { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.form-grid .full { grid-column: 1 / -1; }
.modal-btns { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }

.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .duas { grid-template-columns: 1fr; } aside { width: 64px; } aside h1, nav button, .side-foot span { font-size: 0; } }
.ok { color: #2e7d32; } .ruim { color: #b3261e; }
.estoque-baixo { color: #b3261e; font-weight: 700; }
