:root {
    --bg: #F6FBF8;
    --panel: #FFFFFF;
    --border: rgba(16, 24, 40, .10);
    --text: #0F172A;
    --muted: #5B6B7A;
    --primary: #16A34A;
    --ok: #16A34A;
    --warn: #F59E0B;
    --bad: #EF4444;
    --shadow: 0 10px 28px rgba(2, 6, 23, .08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    color: var(--text);
    background: radial-gradient(900px 540px at 12% 12%, rgba(34, 197, 94, .12), transparent 55%), var(--bg);
    min-height: 100vh;
}

.page {
    max-width: 1600px;
    margin: 24px auto;
    padding: 0 18px;
}

/* Header e Layout */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border: 1px solid var(--border);
    background: #FFF;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    margin-top: 16px;
}

.card {
    border: 1px solid var(--border);
    background: #FFF;
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 16px;
}

/* Botões e Inputs */
.btn {
    padding: 8px 16px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: #FFF;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.btn.primary {
    background: rgba(34, 197, 94, .1);
    border-color: var(--primary);
    color: #0B3B1B;
}

.btn.danger {
    background: rgba(239, 68, 68, .08);
    border-color: var(--bad);
    color: #7F1D1D;
}

.field {
    margin-bottom: 12px;
}

.field label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}

.field select,
.field input {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    outline: none;
}

/* KPIs */
.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.kpi {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.kpi .value {
    font-size: 24px;
    font-weight: 900;
    color: #0B3B1B;
}

/* Tabela SEAPE (6 colunas) */
.table-wrap {
    overflow-x: hidden;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

th {
    text-align: left;
    padding: 12px 10px;
    font-size: 11px;
    text-transform: uppercase;
    background: rgba(34, 197, 94, .05);
    color: var(--muted);
    border-bottom: 2px solid var(--border);
}

/* Larguras SEAPE */
th:nth-child(1) {
    width: 20%;
}

/* Tema */
th:nth-child(2) {
    width: 15%;
}

/* Status */
th:nth-child(3) {
    width: 20%;
}

/* Protocolo */
th:nth-child(4) {
    width: 10%;
}

/* Entrada */
th:nth-child(5) {
    width: 10%;
}

/* Saída */
th:nth-child(6) {
    width: 25%;
}

/* Observações */

td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    font-size: 13px;
    vertical-align: middle;
}

.obs-wrapper {
    font-size: 11px;
    line-height: 1.3;
    color: #666;
    white-space: normal;
    word-wrap: break-word;
    max-height: 50px;
    overflow-y: auto;
}

/* Status */
.badge-status {
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}

.badge-status.concluido {
    background: rgba(34, 197, 94, .15);
    color: #0B3B1B;
    border-color: rgba(34, 197, 94, 0.3);
}

.badge-status.andamento {
    background: rgba(245, 158, 11, .12);
    color: #7A4A00;
    border-color: rgba(245, 158, 11, 0.3);
}

/* Gráfico Sidebar */
.chart-box--sidebar canvas {
    max-height: 180px;
    margin: 10px 0;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.dot.ok {
    background: var(--ok);
}

.dot.warn {
    background: var(--warn);
}

.dot.bad {
    background: var(--bad);
}