:root {
    --bg: #f3f5f8;
    --card: #ffffff;
    --card-2: #f1f3f6;
    --border: #e3e6ec;
    --text: #1a1d23;
    --text-dim: #6b7280;
    --primary: #16a34a;
    --primary-dim: #15803d;
    --danger: #dc2626;
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px 100px;
}

/* ---------- Login ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 340px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(20, 23, 30, 0.06);
}

.login-card h1 {
    font-size: 20px;
    margin: 0 0 4px;
}

.login-card p {
    color: var(--text-dim);
    font-size: 14px;
    margin: 0 0 24px;
}

.pin-input {
    width: 100%;
    font-size: 32px;
    letter-spacing: 16px;
    text-align: center;
    padding: 14px 0;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card-2);
    color: var(--text);
    margin-bottom: 16px;
}

.pin-input:focus {
    outline: none;
    border-color: var(--primary);
}

.error-msg {
    color: var(--danger);
    font-size: 13px;
    margin: -8px 0 16px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: var(--primary);
    color: #06280f;
}

.btn:active {
    background: var(--primary-dim);
}

.btn-secondary {
    background: var(--card-2);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 8px 12px;
    font-size: 13px;
    width: auto;
}

/* ---------- Header / Summary ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.topbar h1 {
    font-size: 18px;
    margin: 0;
}

.icon-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 20px;
    padding: 4px 8px;
}

.summary-card {
    background: linear-gradient(160deg, var(--card), var(--card-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: 0 4px 16px rgba(20, 23, 30, 0.06);
    margin-bottom: 20px;
}

.summary-label {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 16px;
}

.summary-value.quitado {
    color: var(--primary);
}

.progress-bar {
    height: 8px;
    background: var(--card-2);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-dim);
}

.summary-row strong {
    color: var(--text);
    font-weight: 600;
}

/* ---------- Form ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: 0 2px 10px rgba(20, 23, 30, 0.05);
    margin-bottom: 20px;
}

.card h2 {
    font-size: 15px;
    margin: 0 0 14px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---------- Previsão ---------- */
.forecast-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.forecast-row:last-of-type {
    border-bottom: none;
}

.forecast-row span {
    color: var(--text-dim);
}

.forecast-row strong {
    font-weight: 600;
}

.forecast-empty {
    color: var(--text-dim);
    font-size: 14px;
    margin: 0;
}

.forecast-note {
    color: var(--text-dim);
    font-size: 12px;
    margin: 10px 0 0;
}

/* ---------- Gráfico ---------- */
.chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 150px;
}

.chart-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.chart-bar-track {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.chart-bar {
    width: 70%;
    max-width: 26px;
    min-height: 4px;
    background: var(--primary);
    border-radius: 5px 5px 0 0;
    transition: height 0.3s ease;
}

.chart-label {
    font-size: 9px;
    color: var(--text-dim);
    margin-top: 6px;
    white-space: nowrap;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.field input,
.field textarea {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-2);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.row-2 {
    display: flex;
    gap: 12px;
}

.row-2 .field {
    flex: 1;
}

/* ---------- List ---------- */
.list-title {
    font-size: 13px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 24px 0 10px;
}

.aporte-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 6px rgba(20, 23, 30, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.aporte-info {
    min-width: 0;
}

.aporte-valor {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
}

.aporte-data {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

.aporte-obs {
    font-size: 14px;
    margin-top: 4px;
    color: var(--text);
    overflow-wrap: anywhere;
}

.del-form button {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
}

.empty-state {
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
    padding: 30px 10px;
}

.footer-actions {
    margin-top: 24px;
    text-align: center;
}

.footer-actions a {
    color: var(--text-dim);
    font-size: 13px;
    text-decoration: none;
}
