.card {
    background: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 22px 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--card);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--muted);
}

.field input,
.note-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 1rem;
    background: #fff;
    outline: none;
}

.btn,
.secondary-button,
.pay-button,
.delete-button {
    display: block;
    width: 100%;
    border: none;
    border-radius: var(--radius-pill);
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: background-color 180ms ease, color 180ms ease, opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.btn {
    padding: 16px 20px;
    background: var(--accent);
    color: #111;
    font-size: 1.1rem;
}

.secondary-button,
.pay-button {
    font-size: 1.1rem;
    padding: 16px 20px;
}

.secondary-button {
    background: var(--surface-muted);
    color: #111;
}

.pay-button {
    background: var(--accent);
    color: #111;
}

.delete-button {
    margin-top: 12px;
    padding: 16px 20px;
    background: var(--danger-soft);
    color: #9f2f2a;
    font-size: 1rem;
}

.actions {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.95rem;
    font-weight: bold;
    white-space: nowrap;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-debe {
    color: var(--danger);
}

.status-debe .dot {
    background: var(--danger);
}

.status-aldia {
    color: var(--success);
}

.status-aldia .dot {
    background: var(--success);
}

.status-inactivo {
    color: #6f7480;
}

.status-inactivo .dot {
    background: #9aa0ab;
}

.empty-history {
    padding: 18px;
    color: var(--muted);
    font-size: 0.95rem;
}

.load-more-link {
    min-height: 46px;
    margin: 14px 0 0;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5ff;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 700;
}

button,
input[type="submit"],
.load-more-link,
.bottom-item {
    transition: background-color 180ms ease, color 180ms ease, opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

button:where(:not(:disabled)):active,
.load-more-link:active,
.bottom-item:active {
    transform: translateY(1px) scale(0.99);
}

button:disabled,
button[aria-disabled="true"],
input[type="submit"]:disabled,
form.is-submitting button {
    opacity: 0.68;
    cursor: progress;
    pointer-events: none;
    box-shadow: none;
}

form.is-submitting {
    cursor: progress;
}

.fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--accent);
    color: #111;
    font-size: 2rem;
    line-height: 1;
    box-shadow: var(--shadow-strong);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-submit {
    margin-top: 8px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    max-width: var(--app-width);
    height: 72px;
    transform: translateX(-50%);
    border-top: 1px solid #e7e9ee;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -8px 22px rgba(35, 50, 78, 0.08);
}

.bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #7d828d;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
}

.bottom-item.active {
    color: var(--primary);
    font-weight: 700;
}

.bottom-icon {
    font-size: 1.15rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(16, 22, 34, 0.52);
}

.modal-overlay[hidden] {
    display: none;
}

.modal-card {
    width: 100%;
    max-width: 360px;
    border-radius: 22px;
    padding: 24px 20px 18px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(16, 22, 34, 0.22);
    text-align: center;
}

.modal-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.danger-modal-icon {
    background: var(--danger-soft);
    color: var(--danger);
}

.modal-card h2 {
    margin: 0;
    color: #111318;
    font-size: 1.18rem;
    line-height: 1.25;
    font-weight: 700;
}

.modal-card p {
    margin: 10px 0 20px;
    color: #6f7480;
    font-size: 0.95rem;
    line-height: 1.35;
    font-weight: 400;
}

.modal-actions {
    display: grid;
    gap: 10px;
}

.modal-danger-button,
.modal-secondary-button {
    min-height: 50px;
    border: 0;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease, opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.modal-danger-button {
    background: var(--danger);
    color: #ffffff;
}

.modal-secondary-button {
    background: #f2f4f7;
    color: #343943;
}

@media (min-width: 768px) {
    .fab {
        right: calc(50% - (var(--app-width) / 2) + 18px);
    }
}
