:root {
    --bg: #ffd400;
    --panel: #fff8cc;
    --text: #171407;
    --muted: #6e6251;
    --line: #e2d4a8;
    --brand: #f5c400;
    --brand-dark: #111111;
    --danger: #c62828;
    --warn: #b77900;
    --ok: #1f7a3f;
    --black: #111111;
    --yellow: #ffd400;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

.app {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--black);
    color: var(--yellow);
    padding: 18px 14px;
    border-right: 4px solid var(--yellow);
}

.brand {
    color: var(--yellow);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 22px;
}

.nav a {
    display: block;
    padding: 11px 12px;
    margin: 5px 0;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #f7efc3;
    text-decoration: none;
}

.nav a.active,
.nav a:hover {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--black);
}

.main {
    background: var(--bg);
    padding: 24px;
}

.topbar {
    background: var(--black);
    border-radius: 8px;
    color: var(--yellow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 14px 16px;
}

h1 {
    font-size: 26px;
    margin: 0;
}

h2 {
    font-size: 18px;
    margin: 0 0 14px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 14px;
}

.panel {
    background: var(--panel);
    border: 2px solid var(--black);
    border-top: 5px solid var(--black);
    border-radius: 8px;
    padding: 16px;
}

.metric {
    color: var(--muted);
    font-size: 13px;
}

.metric strong {
    display: block;
    color: var(--text);
    font-size: 26px;
    margin-top: 8px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: var(--black);
    padding: 9px 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.btn.secondary {
    background: var(--black);
    color: var(--yellow);
}

.btn.danger {
    background: var(--danger);
}

.btn.light {
    background: #fff5bf;
    color: var(--text);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--black);
    color: var(--yellow);
    font-size: 12px;
    text-transform: uppercase;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px 10px;
    font: inherit;
    background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(245, 196, 0, 0.22);
    outline: none;
}

textarea {
    min-height: 84px;
    resize: vertical;
}

.notice {
    margin-bottom: 14px;
    padding: 11px 13px;
    border-radius: 6px;
    background: #fff7cc;
    color: var(--black);
    border: 1px solid var(--brand);
}

.empty {
    color: var(--muted);
    padding: 18px;
}

.status {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    background: #eef4ff;
    color: #1849a9;
}

.status.ok {
    background: #ecfdf3;
    color: var(--ok);
}

.status.warn {
    background: #fffaeb;
    color: var(--warn);
}

.status-form {
    margin: 0;
}

.status-form select {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    font-weight: 700;
    min-width: 150px;
    padding: 6px 8px;
}

.status-padrao select {
    background: #5f6b7a;
}

.status-ativo select,
.status-aprovado select,
.status-finalizada select,
.status-pago select,
.status-recebida select {
    background: #1f7a3f;
}

.status-inativo select,
.status-cancelado select {
    background: #c62828;
}

.status-aguardando select,
.status-aberta select {
    background: #b77900;
}

.status-andamento select {
    background: #1d5fa7;
}

.status-atrasado select {
    background: #8f1d1d;
}

.money {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.switch {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    flex-direction: row;
    gap: 8px;
}

.switch input {
    width: auto;
}

.items-table input {
    min-width: 90px;
}

.items-table input.desc {
    min-width: 240px;
}

@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .topbar,
    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }
}
