/* ── SuperMarketTPV — Portal de Fidelización ── */

:root {
    --primary:     #1d4ed8;
    --primary-dk:  #1e40af;
    --accent:      #16a34a;
    --gold:        #b45309;
    --silver:      #64748b;
    --bronze:      #92400e;
    --danger:      #dc2626;
    --bg:          #f0f4ff;
    --card-bg:     #ffffff;
    --text:        #111827;
    --muted:       #6b7280;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

.navbar {
    background: var(--primary);
    color: white;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.navbar .brand { font-size: 1.2rem; font-weight: 700; }
.navbar a { color: rgba(255,255,255,.8); text-decoration: none; font-size: .9rem; }
.navbar a:hover { color: white; }
.nav-links { display: flex; gap: 1rem; }
.nav-links a { padding: .3rem .75rem; border-radius: 6px; transition: background .2s; }
.nav-links a:hover { background: rgba(255,255,255,.15); color: white; }
.nav-links a.nav-active { background: rgba(255,255,255,.25); color: white; font-weight: 600; }
.logout-link { margin-left: auto; }
@media(max-width:560px) { .nav-links { display: none; } }

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

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 6px rgba(0,0,0,.08);
}

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi { background: var(--card-bg); border-radius: 12px; padding: 1.25rem 1.5rem; box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.kpi-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .25rem; }
.kpi-val { font-size: 2rem; font-weight: 800; }
.kpi-sub { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.kpi-points .kpi-val { color: var(--primary); }
.kpi-tier-Oro .kpi-val    { color: var(--gold); }
.kpi-tier-Plata .kpi-val  { color: var(--silver); }
.kpi-tier-Bronce .kpi-val { color: var(--bronze); }
.kpi-tier-Base .kpi-val   { color: var(--muted); }

.progress-bar-wrap { background: #e2e8f0; border-radius: 99px; height: 12px; margin: .5rem 0 .25rem; }
.progress-bar-fill { background: var(--accent); border-radius: 99px; height: 12px; transition: width .4s ease; }

.mov-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.mov-table th { text-align: left; padding: .5rem .75rem; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid #e2e8f0; }
.mov-table td { padding: .6rem .75rem; border-bottom: 1px solid #f1f5f9; }
.mov-table tr:last-child td { border-bottom: none; }
.pts-pos { color: var(--accent); font-weight: 700; }
.pts-neg { color: var(--danger); font-weight: 700; }
.badge-type { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .72rem; font-weight: 600; }
.badge-Accrual          { background: #dcfce7; color: #15803d; }
.badge-BonusHighTicket  { background: #fef9c3; color: #92400e; }
.badge-Redemption       { background: #fee2e2; color: #b91c1c; }
.badge-ManualAdjustment { background: #e0e7ff; color: #4338ca; }
.badge-Expiry           { background: #f1f5f9; color: #64748b; }

.login-box { max-width: 420px; margin: 4rem auto; background: var(--card-bg); border-radius: 16px; padding: 2.5rem; box-shadow: 0 4px 24px rgba(0,0,0,.1); }
.login-box h2 { margin: 0 0 .25rem; font-size: 1.5rem; }
.login-box p  { color: var(--muted); font-size: .9rem; margin: 0 0 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; }
.form-group input { width: 100%; padding: .65rem .9rem; border: 1px solid #d1d5db; border-radius: 8px; font-size: 1rem; outline: none; transition: border-color .2s; }
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,78,216,.15); }
.btn-primary { width: 100%; padding: .75rem; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .2s; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.alert-error { background: #fee2e2; color: #991b1b; border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9rem; }
.alert-info  { background: #dbeafe; color: #1e40af; border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9rem; }

.client-card { background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%); color: white; border-radius: 16px; padding: 1.5rem 2rem; margin-bottom: 1.5rem; }
.client-card .name { font-size: 1.4rem; font-weight: 700; margin: 0 0 .2rem; }
.client-card .sub  { font-size: .85rem; opacity: .75; margin: 0 0 1rem; }
.client-card .barcode-label { font-family: monospace; font-size: 1rem; background: rgba(255,255,255,.15); padding: .3rem .8rem; border-radius: 6px; display: inline-block; letter-spacing: .1em; }

#blazor-error-ui { display: none; }

/* ── Sección de Ofertas ─────────────────────────────────────────────── */
.section-header { margin-bottom: 1.5rem; }
.section-header h2 { margin: 0 0 .25rem; font-size: 1.4rem; }
.section-sub { color: var(--muted); font-size: .9rem; margin: 0; }
.portal-home-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.btn-portal-primary, .btn-portal-secondary, .btn-portal-ghost {
  display: inline-flex; align-items: center; padding: .6rem 1.1rem; border-radius: 8px;
  font-weight: 600; font-size: .95rem; text-decoration: none;
}
.btn-portal-primary { background: var(--primary); color: #fff; }
.btn-portal-secondary { background: #e8f0ff; color: #1e40af; }
.btn-portal-ghost { border: 1px solid var(--line, #dde5eb); color: var(--text); }
.offer-count { color: var(--muted); font-size: .85rem; margin-bottom: 1rem; }
.loading-msg { text-align: center; margin-top: 3rem; color: var(--muted); }
.empty-state { text-align: center; background: var(--card-bg); border-radius: 12px; padding: 3rem 1.5rem; color: var(--text); box-shadow: 0 1px 6px rgba(0,0,0,.06); }

.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.offer-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 6px rgba(0,0,0,.08);
    position: relative;
    overflow: hidden;
    border-top: 4px solid var(--primary);
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.offer-category { font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.offer-name { margin: 0; font-size: 1rem; font-weight: 700; color: var(--text); }
.offer-desc { margin: 0; font-size: .82rem; color: var(--muted); }
.offer-prices { display: flex; align-items: baseline; gap: .75rem; margin-top: .4rem; }
.price-normal { font-size: .9rem; color: var(--muted); text-decoration: line-through; }
.price-offer  { font-size: 1.5rem; font-weight: 800; color: #dc2626; }
.offer-badge {
    position: absolute; top: .75rem; right: .75rem;
    background: #dc2626; color: white;
    font-size: .75rem; font-weight: 700;
    padding: .25rem .55rem; border-radius: 99px;
}
.offer-until { margin: 0; font-size: .78rem; color: var(--muted); margin-top: .25rem; }

.reward-card { border-top-color: var(--accent); }
.reward-cost { font-size: 1.6rem; font-weight: 800; color: var(--accent); margin-top: .35rem; }
