* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Helvetica, Arial, sans-serif; background: #f4f6f8; color: #212529; }

/* Header / nav */
header { background: #00695c; color: #fff; padding: 0 20px; display: flex; align-items: center; gap: 8px; height: 56px; }
header .brand { font-weight: 700; font-size: 1.05rem; margin-right: 12px; white-space: nowrap; }
header form { margin: 0; }
.topnav { display: flex; gap: 4px; margin-left: 8px; flex-wrap: wrap; }
.topnav a { color: #ffffffcc; text-decoration: none; font-size: .9rem; padding: 8px 12px; border-radius: 6px; }
.topnav a:hover { color: #fff; background: #ffffff1a; }
.topnav a.active { color: #fff; background: #ffffff2e; font-weight: 600; }
.header-spacer { margin-left: auto; }

main { max-width: 1180px; margin: 24px auto; padding: 0 16px; }

/* Cards */
.card { background: #fff; border: 1px solid #e3e6ea; border-radius: 10px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.04); margin-bottom: 20px; }
.card h1 { font-size: 1.4rem; margin-top: 0; }
.card h2 { font-size: 1.05rem; margin: 0 0 14px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title h2 { margin: 0; }

/* Grid helpers */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* KPI tiles */
.kpi { background: #fff; border: 1px solid #e3e6ea; border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.kpi .label { font-size: .78rem; text-transform: uppercase; color: #6c757d; letter-spacing: .03em; }
.kpi .value { font-size: 1.7rem; font-weight: 700; margin-top: 4px; line-height: 1.1; }
.kpi .sub { font-size: .8rem; color: #6c757d; margin-top: 4px; }
.kpi.accent .value { color: #00695c; }
.kpi.good .value { color: #1b5e20; }
.kpi.warn .value { color: #b26a00; }
.kpi.bad .value { color: #b71c1c; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eee; vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; color: #6c757d; letter-spacing: .03em; }
tbody tr:hover { background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.b-green { background: #e8f5e9; color: #1b5e20; }
.b-blue { background: #e3f2fd; color: #0d47a1; }
.b-amber { background: #fff8e1; color: #b26a00; }
.b-red { background: #fdecea; color: #b71c1c; }
.b-gray { background: #eceff1; color: #546e7a; }
.b-purple { background: #f3e5f5; color: #6a1b9a; }

/* Buttons */
.btn { display: inline-block; border: none; border-radius: 6px; padding: 8px 14px; font-size: .9rem; cursor: pointer; text-decoration: none; background: #eceff1; color: #263238; }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: #00897b; color: #fff; }
.btn-primary:hover { background: #00796b; filter: none; }
.btn-light { background: #fff; color: #00695c; }
.btn-danger { background: #fdecea; color: #b71c1c; }
.btn-sm { padding: 6px 10px; font-size: .82rem; }
.btn-link { background: none; color: #00695c; padding: 0; text-decoration: none; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }

/* Forms */
input[type=text], input[type=password], input[type=number], input[type=search], select {
    padding: 8px 10px; border: 1px solid #ced4da; border-radius: 6px; font-size: .92rem; background: #fff;
}
label { display: block; font-size: .82rem; color: #495057; margin-bottom: 4px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; max-width: 720px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { color: #6c757d; font-size: .78rem; margin-top: 2px; }

/* Alerts */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.alert-ok { background: #e8f5e9; color: #1b5e20; }
.alert-err { background: #fdecea; color: #b71c1c; }

/* Misc */
.muted { color: #6c757d; font-size: .85rem; }
.mt { margin-top: 18px; }
.mono { font-family: 'Cascadia Code', Consolas, monospace; font-size: .82rem; }
a.row-link { color: #00695c; text-decoration: none; font-weight: 600; }
a.row-link:hover { text-decoration: underline; }
.crumb { font-size: .85rem; color: #6c757d; margin-bottom: 12px; }
.crumb a { color: #00695c; text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: .9rem; }
.dl dt { color: #6c757d; }
.dl dd { margin: 0; }
.bar { height: 8px; border-radius: 4px; background: #eceff1; overflow: hidden; }
.bar > span { display: block; height: 100%; background: #00897b; }
.bar > span.over { background: #b71c1c; }

/* Compat: classes usadas em telas legadas (Packs) */
.reset-form { display: flex; gap: 8px; align-items: center; }
.badge-on { color: #1b5e20; font-weight: 600; margin-right: 8px; }
.badge-off { color: #9e9e9e; font-weight: 600; margin-right: 8px; }
.m-0 { margin: 0; }
