:root {
    --navy: #122F3E;
    --navy-light: #1E4356;
    --gold: #C9A24B;
    --cream: #FAF6EE;
    --gray: #555555;
    --danger: #B5473B;
    --ok: #3B7A4A;
    --bronce: #8C5A34;
    --plata: #9CA3AC;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    background: var(--cream);
    color: var(--navy);
    font-family: 'Jost', Arial, sans-serif;
    font-size: 16px;
}

h1, h2, h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: var(--navy);
    margin: 0 0 .4rem;
}

a { color: var(--navy-light); text-decoration: none; }

.topbar {
    background: var(--navy);
    color: #fff;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar .brand {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.4rem;
    letter-spacing: .5px;
}
.topbar .brand span { color: var(--gold); }
.topbar a.logout { color: rgba(255,255,255,.75); font-size: .82rem; }

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 1rem 1rem 3rem;
}
.container.container-wide { max-width: 720px; }

.card {
    background: #fff;
    border-radius: 16px;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 14px rgba(18,47,62,.08);
}

.hero-card {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: #fff;
    border-radius: 18px;
    padding: 1.4rem 1.3rem;
    margin-bottom: 1rem;
}
.hero-card h2 { color: #fff; margin-bottom: .1rem; }
.hero-card .puntos-num {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 3rem;
    font-weight: 600;
    color: var(--gold);
    line-height: 1;
    margin: .3rem 0 0;
}
.hero-card .puntos-label { font-size: .8rem; color: rgba(255,255,255,.7); }

.nivel-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .7rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    color: #fff;
}
.nivel-pill.bronce { background: var(--bronce); }
.nivel-pill.plata { background: var(--plata); }
.nivel-pill.oro { background: var(--gold); color: var(--navy); }
.nivel-pill.inicial { background: var(--plata); }
.nivel-pill.preferente { background: var(--navy-light); }
.nivel-pill.elite { background: var(--gold); color: var(--navy); }

.progress-track {
    background: rgba(255,255,255,.18);
    border-radius: 10px;
    height: 8px;
    margin-top: .8rem;
    overflow: hidden;
}
.progress-fill { background: var(--gold); height: 100%; border-radius: 10px; }
.progress-note { font-size: .74rem; color: rgba(255,255,255,.75); margin-top: .4rem; }

.btn {
    display: inline-block;
    background: var(--gold);
    color: var(--navy);
    font-weight: 600;
    font-family: 'Jost', Arial, sans-serif;
    padding: .7rem 1rem;
    border: none;
    border-radius: 10px;
    text-align: center;
    width: 100%;
    margin-top: .9rem;
}

.section-title {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray);
    margin: 1.4rem 0 .5rem;
    font-weight: 600;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: .7rem 0;
    border-bottom: 1px solid #f0ead9;
    gap: .6rem;
}
.item-row:last-child { border-bottom: none; }
.item-row .meta { font-size: .76rem; color: #888; margin-top: .15rem; }

.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 600;
    background: var(--navy-light);
    color: #fff;
    white-space: nowrap;
}
.badge.ok { background: var(--ok); }
.badge.warn { background: var(--danger); }

.puntos-pos { color: var(--ok); font-weight: 600; }
.puntos-neg { color: var(--danger); font-weight: 600; }

.empty { color: #999; font-size: .85rem; padding: .5rem 0; }

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
}
.login-card {
    background: #fff;
    border-radius: 18px;
    padding: 2rem 1.6rem;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 8px 30px rgba(18,47,62,.15);
    text-align: center;
}
.login-card h1 { font-size: 1.7rem; }
.login-card p.tagline { color: var(--gray); font-size: .85rem; margin-bottom: 1.3rem; font-style: italic; }
.login-card input {
    width: 100%;
    padding: .8rem .9rem;
    border: 1px solid #d8cfb6;
    border-radius: 10px;
    font-family: 'Jost', Arial, sans-serif;
    font-size: 1rem;
    margin-bottom: .8rem;
}
.login-card label { display: block; text-align: left; font-size: .8rem; color: var(--gray); margin-bottom: .3rem; }
.error-msg { color: var(--danger); font-size: .85rem; margin-bottom: .8rem; }

.install-hint {
    background: #fff;
    border: 1px dashed var(--gold);
    border-radius: 12px;
    padding: .8rem 1rem;
    font-size: .78rem;
    color: var(--gray);
    margin-top: 1rem;
}

/* --- Portal corporativo --- */
.hero-eyebrow {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: .2rem;
}

.resumen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .6rem;
    margin: 1rem 0 .3rem;
}
.resumen-stat {
    background: rgba(255,255,255,.08);
    border-radius: 12px;
    padding: .7rem .5rem;
    text-align: center;
}
.resumen-num {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.1;
}
.resumen-num.gold { color: var(--gold); }
.resumen-label {
    font-size: .66rem;
    color: rgba(255,255,255,.7);
    margin-top: .2rem;
    line-height: 1.2;
}

.chart-row {
    display: flex;
    align-items: flex-end;
    gap: .5rem;
    height: 140px;
    padding-top: .5rem;
}
.chart-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}
.chart-bar {
    width: 100%;
    max-width: 26px;
    background: linear-gradient(180deg, var(--gold) 0%, var(--navy-light) 130%);
    border-radius: 5px 5px 0 0;
    min-height: 3px;
}
.chart-label {
    font-size: .64rem;
    color: var(--gray);
    margin-top: .35rem;
}

.table-search {
    width: 100%;
    padding: .6rem .8rem;
    border: 1px solid #d8cfb6;
    border-radius: 10px;
    font-family: 'Jost', Arial, sans-serif;
    font-size: .9rem;
    margin-bottom: .8rem;
}
.table-scroll { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
    white-space: nowrap;
}
.data-table th {
    text-align: left;
    padding: .5rem .6rem;
    background: var(--navy);
    color: #fff;
    font-weight: 600;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.data-table th:first-child { border-radius: 8px 0 0 8px; }
.data-table th:last-child { border-radius: 0 8px 8px 0; }
.data-table td {
    padding: .55rem .6rem;
    border-bottom: 1px solid #f0ead9;
}
.data-table tr:hover td { background: #fbf8ef; }

.contact-card { text-align: center; }
.contact-card .btn { max-width: 320px; margin-left: auto; margin-right: auto; }
