:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --text: #1a2332;
    --text-muted: #6b7785;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --hero-from: #1e293b;
    --hero-to: #0f172a;
    --radius: 1rem;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body.app-body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.public-topbar {
    background: var(--hero-to);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.public-topbar-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0.65rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.public-topbar-title {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
}

.public-admin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.public-admin-link:hover,
.public-admin-link:focus {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.public-main,
.admin-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
}

.admin-main {
    max-width: 1100px;
}

/* Hero / saldo principal */
.hero-card {
    background: linear-gradient(145deg, var(--hero-from), var(--hero-to));
    color: #fff;
    border-radius: calc(var(--radius) + 0.25rem);
    padding: 1.75rem 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    text-align: center;
}

.hero-label {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
}

.hero-amount {
    margin: 0;
    font-size: clamp(2.5rem, 10vw, 3.75rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.hero-progress .progress {
    height: 0.55rem;
    background: rgba(255, 255, 255, 0.2);
}

.hero-progress .progress-bar {
    background: #34d399;
}

.hero-progress-text {
    display: block;
    margin-top: 0.5rem;
    opacity: 0.85;
}

/* Resumen */
.summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 576px) {
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.summary-item {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow);
}

.summary-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.summary-value {
    font-size: 1.15rem;
}

/* Secciones */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.empty-state {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    box-shadow: var(--shadow);
}

/* Tarjetas de pago */
.payment-cards {
    display: grid;
    gap: 0.85rem;
}

.payment-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow);
}

.payment-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.payment-card-amount {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.payment-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.meta-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.payment-note {
    margin: 0.85rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.currency-badge {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.currency-ars {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
}

.currency-usd {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.payments-table {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.public-footer {
    border-top: 1px solid #e5e7eb;
}

/* Admin */
.admin-topbar {
    background: var(--hero-to);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.admin-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.admin-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.debt-dl {
    margin: 0;
}

.debt-dl > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.55rem 0;
    border-bottom: 1px solid #eef2f7;
}

.debt-dl > div:last-child {
    border-bottom: 0;
}

.debt-dl dt {
    color: var(--text-muted);
    font-weight: 500;
}

.debt-dl dd {
    margin: 0;
    font-weight: 600;
}

.rate-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.rate-item {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 0.85rem;
    text-align: center;
}

.rate-item span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.rate-item strong {
    font-size: 1rem;
}

.rate-item-highlight {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.rate-item-highlight strong {
    color: var(--primary-dark);
}

.admin-payment-card .payment-card-meta {
    margin-bottom: 0;
}

/* Login */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(160deg, #eef2ff, #f8fafc 45%, #f4f6f9);
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--surface);
    border-radius: calc(var(--radius) + 0.25rem);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow);
}

.login-title {
    margin: 0 0 0.35rem;
    font-size: 1.6rem;
    font-weight: 800;
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Formularios */
.form-control-lg,
.btn-lg {
    min-height: 3rem;
}

.currency-toggle .btn {
    flex: 1;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

@media (min-width: 768px) {
    .public-main {
        padding-top: 1.5rem;
    }

    .hero-card {
        padding: 2.25rem 2rem;
    }
}
