* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--cr-ui);
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    color: var(--cr-text);
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-nav {
    background: var(--cr-gray, var(--cr-muted));
    color: var(--cr-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    gap: 1rem;
}

.nav-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-link {
    color: #000000;
    text-decoration: none;
    font-weight: 400;
    font-size: 0.85rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: #dcdcdc;
    transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover {
    color: #ffffff;
    background: #84bb43;
}

.nav-link.active {
    background: #84bb43;
    color: #ffffff;
}

.nav-link--primary {
    font-weight: 700;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-user span,
.nav-user .secondary-link {
    color: #ffffff;
    font-size: 0.85rem;
}

.brand-logo {
    height: 72px;
    margin-right: 0.5rem;
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.4));
}

.brand span {
    display: none;
}

.role-chip {
    background: rgba(255, 255, 255, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.secondary-link {
    color: #1f2937;
    font-size: 0.85rem;
    border-bottom: none;
    text-decoration: none;
    padding-bottom: 2px;
    border-radius: 0;
}

.secondary-link:hover {
    color: #0f172a;
}

.content-wrapper {
    flex: 1;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.panel {
    background: var(--cr-white);
    padding: 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 5px 15px var(--cr-shadow);
    margin-bottom: 1.5rem;
}

.panel h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.15rem;
    color: var(--cr-green);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.card {
    padding: 1rem;
    background: var(--cr-white);
    border-radius: 0.5rem;
    border: 1px solid var(--cr-border);
}

.card strong {
    display: block;
    font-size: 1.3rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
}

input,
select,
textarea {
    padding: 0.6rem 0.75rem;
    border-radius: 0.35rem;
    border: 1px solid var(--cr-border);
    background: var(--cr-white);
    font-size: 0.95rem;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus,
.sap-focus {
    background: var(--sap-yellow-focus);
    border-color: var(--sap-yellow-border);
    outline: none;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    background: var(--cr-green);
    color: var(--cr-white);
    border-radius: 0.35rem;
    border: 1px solid var(--cr-green);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    font-weight: 600;
    min-height: 38px;
    gap: 0.35rem;
}

.btn:hover {
    background: var(--cr-green);
    border-color: var(--cr-green);
    filter: brightness(0.92);
}

.form-card .btn.btn-primary.btn-new {
    margin-top: 25px;
}

.btn-new::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    background: url('../../uploads/img/iconnuevo.png') no-repeat center / contain;
}

.btn.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}

.inline-form button {
    margin: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
    background: var(--cr-white);
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
}

th,
td {
    border-bottom: 1px solid var(--cr-border);
    text-align: left;
    padding: 0.65rem;
}

th {
    background: var(--cr-ui);
}

.badge {
    display: inline-flex;
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-success {
    background: #e3f6ea;
    color: #187c45;
}

.badge-warning {
    background: #fff4e5;
    color: #b66400;
}

.badge-danger {
    background: #ffe4e4;
    color: #a22a2a;
}

.muted {
    color: #54627b;
    font-size: 0.9rem;
}

.installment-list {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.installment-list li {
    padding: 0.3rem 0;
    border-bottom: 1px dashed #c8d3e0;
}

.installment-list li:last-child {
    border-bottom: 0;
}

.flash {
    padding: 0.9rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.flash-success {
    background: var(--cr-white);
    color: var(--cr-green);
    border: 1px solid var(--cr-green);
}

.flash-error {
    background: var(--cr-white);
    color: var(--cr-red);
    border: 1px solid var(--cr-red);
}

.panel-subsection {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--cr-ui);
    border-radius: 0.5rem;
    border: 1px solid var(--cr-border);
}

.panel-subsection h3 {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
    color: #334155;
}

.site-footer {
    padding: 1rem 0;
    text-align: center;
    color: #7a7a7a;
}

@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-user {
        flex-direction: column;
        align-items: flex-start;
    }
}

