:root {
    --sipos-navy: #062a4a;
    --sipos-deep: #0a3d6b;
    --sipos-cyan: #40b3d8;
    --sipos-cyan-bright: #2ec4e8;
    --sipos-green: #83c933;
    --sipos-orange: #f18a2a;
    --sipos-mist: #e8f4fa;
    --sipos-foam: #f4fafc;
    --sipos-text: #12324a;
    --sipos-muted: #5a7a90;
    --sipos-card: rgba(255, 255, 255, 0.92);
    --sipos-radius: 18px;
    --sipos-shadow: 0 12px 40px rgba(6, 42, 74, 0.1);
    --font-display: 'Sora', system-ui, sans-serif;
    --font-body: 'Outfit', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.portal-page {
    margin: 0;
    font-family: var(--font-body);
    color: var(--sipos-text);
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(64, 179, 216, 0.22), transparent 55%),
        radial-gradient(900px 420px at 100% 0%, rgba(131, 201, 51, 0.14), transparent 50%),
        linear-gradient(180deg, var(--sipos-mist) 0%, var(--sipos-foam) 45%, #eef6fa 100%);
    min-height: 100vh;
}

.sipos-portal {
    max-width: 980px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: rgba(6, 42, 74, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(64, 179, 216, 0.25);
}

.portal-topbar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    color: inherit;
}

.portal-brand:hover,
.portal-brand:focus,
.portal-brand:focus-visible,
.portal-brand:hover .portal-brand-title,
.portal-brand:hover .portal-brand-sub {
    text-decoration: none !important;
}

.portal-brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
    box-shadow: 0 0 0 2px rgba(64, 179, 216, 0.55);
}

.portal-site-header .portal-brand img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.portal-brand-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: #eaf7ff;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.portal-brand-sub {
    font-size: 0.72rem;
    color: rgba(166, 216, 236, 0.9);
    font-weight: 400;
}

.portal-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.portal-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #d7eef8;
    padding: 8px 13px;
    border-radius: 999px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(64, 179, 216, 0.35);
    transition: background .2s, color .2s, border-color .2s;
}

.portal-nav a:hover,
.portal-nav a.is-active {
    background: rgba(64, 179, 216, 0.22);
    border-color: rgba(64, 179, 216, 0.7);
    color: #fff;
}

/* Hero */
.portal-hero {
    position: relative;
    overflow: hidden;
    margin: 16px 16px 0;
    padding: 42px 24px 34px;
    border-radius: 28px;
    text-align: center;
    color: #eaf7ff;
    background:
        linear-gradient(135deg, #062a4a 0%, #0a4a7a 42%, #1a8fb8 78%, #40b3d8 100%);
    box-shadow: var(--sipos-shadow);
    animation: portal-rise .7s ease both;
}

.portal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% 15%, rgba(131, 201, 51, 0.28), transparent 35%),
        radial-gradient(circle at 12% 90%, rgba(46, 196, 232, 0.25), transparent 40%);
    pointer-events: none;
}

.portal-hero-wave {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 56px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath fill='%23e8f4fa' d='M0,40 C240,80 480,0 720,30 C960,60 1200,10 1440,40 L1440,80 L0,80 Z'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
    opacity: 0.95;
    animation: portal-wave 8s ease-in-out infinite alternate;
}

.portal-hero-inner { position: relative; z-index: 1; }

.portal-eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #9fd8ef;
    font-weight: 600;
    margin-bottom: 10px;
}

.portal-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 4vw, 2.45rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 12px;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
}

.portal-hero p {
    max-width: 520px;
    margin: 0 auto 22px;
    font-size: 0.98rem;
    font-weight: 300;
    color: #c7e7f5;
    line-height: 1.55;
}

.portal-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--sipos-green), #6fb01f);
    color: #062a4a;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(131, 201, 51, 0.35);
    transition: transform .15s, box-shadow .15s;
}

.portal-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(131, 201, 51, 0.45);
    color: #062a4a;
    text-decoration: none;
}

.portal-stats {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.portal-stat strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.45rem;
    color: #fff;
}

.portal-stat span {
    font-size: 0.72rem;
    color: #9fd8ef;
    letter-spacing: 0.04em;
}

/* Sections */
.portal-section {
    padding: 28px 18px 8px;
    animation: portal-rise .7s ease both;
    animation-delay: .08s;
}

.portal-section-label {
    text-align: center;
    margin-bottom: 18px;
}

.portal-section-label .eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sipos-deep);
    font-weight: 700;
}

.portal-section-label h2 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    margin: 6px 0 4px;
    color: var(--sipos-navy);
}

.portal-section-label p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--sipos-muted);
    font-weight: 300;
}

/* Cards grid */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 14px;
}

.ben-card {
    background: var(--sipos-card);
    border: 1px solid rgba(64, 179, 216, 0.18);
    border-radius: var(--sipos-radius);
    padding: 20px 16px;
    box-shadow: 0 6px 20px rgba(6, 42, 74, 0.05);
    transition: transform .2s, border-color .2s, box-shadow .2s;
    animation: portal-rise .55s ease both;
}

.ben-card:nth-child(1) { animation-delay: .05s; }
.ben-card:nth-child(2) { animation-delay: .1s; }
.ben-card:nth-child(3) { animation-delay: .15s; }
.ben-card:nth-child(4) { animation-delay: .2s; }
.ben-card:nth-child(5) { animation-delay: .25s; }

.ben-card:hover {
    transform: translateY(-4px);
    border-color: rgba(64, 179, 216, 0.55);
    box-shadow: 0 14px 30px rgba(10, 61, 107, 0.12);
}

.ben-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: linear-gradient(145deg, rgba(64, 179, 216, 0.18), rgba(131, 201, 51, 0.16));
    color: var(--sipos-deep);
    font-size: 1.15rem;
}

.ben-card h3 {
    font-size: 0.98rem;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--sipos-navy);
}

.ben-card p {
    font-size: 0.8rem;
    color: var(--sipos-muted);
    line-height: 1.45;
    margin: 0;
    font-weight: 300;
}

.ben-tag {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(64, 179, 216, 0.14);
    color: var(--sipos-deep);
    font-weight: 600;
}

/* Featured */
.featured {
    margin: 10px 18px 8px;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(64, 179, 216, 0.18);
    box-shadow: var(--sipos-shadow);
    animation: portal-rise .7s ease both;
    animation-delay: .12s;
}

.featured-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(90deg, var(--sipos-navy), var(--sipos-deep) 60%, #1578a0);
    color: #eaf7ff;
    font-weight: 600;
    font-size: 0.95rem;
}

.featured-header i { color: var(--sipos-green); }

.featured-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px;
}

.feat-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(64, 179, 216, 0.16);
    background: linear-gradient(180deg, #f7fcfe, #fff);
    transition: border-color .15s, transform .15s;
}

.feat-item:hover {
    border-color: rgba(131, 201, 51, 0.55);
    transform: translateY(-2px);
}

.feat-item > i {
    color: var(--sipos-cyan);
    margin-top: 2px;
    font-size: 1rem;
}

.feat-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--sipos-navy);
}

.feat-desc {
    font-size: 0.75rem;
    color: var(--sipos-muted);
    margin-top: 2px;
    line-height: 1.4;
    font-weight: 300;
}

/* News */
.news-section {
    padding: 20px 18px 28px;
}

.news-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--sipos-muted);
    font-weight: 600;
    margin-bottom: 12px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(64, 179, 216, 0.16);
    transition: border-color .15s, transform .15s;
}

.news-item:hover {
    border-color: rgba(64, 179, 216, 0.5);
    transform: translateX(3px);
}

.news-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sipos-cyan), var(--sipos-green));
    flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(64, 179, 216, 0.15);
}

.news-item-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--sipos-navy);
}

.news-item-date {
    font-size: 0.72rem;
    color: var(--sipos-muted);
    margin-top: 2px;
}

.news-arrow {
    margin-left: auto;
    color: var(--sipos-cyan);
}

/* Contact + footer */
.contact-bar {
    margin-top: auto;
    padding: 18px 20px;
    background: linear-gradient(90deg, var(--sipos-navy), var(--sipos-deep));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.contact-bar p {
    margin: 0;
    font-size: 0.88rem;
    color: #a8cfe0;
    font-weight: 300;
}

.contact-bar strong { color: #eaf7ff; font-weight: 600; }

.contact-links { display: flex; gap: 8px; flex-wrap: wrap; }

.contact-link {
    font-size: 0.78rem;
    color: #9fd8ef;
    padding: 6px 11px;
    border: 1px solid rgba(64, 179, 216, 0.45);
    border-radius: 999px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .15s, color .15s;
}

.contact-link:hover {
    background: rgba(64, 179, 216, 0.2);
    color: #fff;
    text-decoration: none;
}

.portal-footer {
    background: #041929;
    padding: 12px 18px;
    text-align: center;
    font-size: 0.72rem;
    color: #3f6f8a;
}

.portal-footer-link { color: #6aa8c4; }

.portal-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--sipos-muted);
    font-size: 0.9rem;
}

.portal-topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.portal-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
}

.portal-menu-label {
    display: none;
}

.portal-logout-form { margin: 0; }

.portal-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(64, 179, 216, 0.35);
    color: #d7eef8;
    padding: 8px 13px;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: .82rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.portal-logout-btn:hover {
    background: rgba(64, 179, 216, 0.22);
    border-color: rgba(64, 179, 216, 0.7);
    color: #fff;
}

.portal-install-btn {
    background: linear-gradient(135deg, #83c933, #40b3d8);
    border: 1px solid transparent;
    color: #062a4a;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.portal-install-btn:hover { filter: brightness(1.05); }

.portal-pwa-status {
    display: none;
}


/* Cupo */
.portal-hero--compact {
    padding: 32px 22px 28px;
    text-align: left;
}

.portal-hero--compact h1 { margin-bottom: 8px; }
.portal-hero--compact p { margin: 0; max-width: none; }

.cupo-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
}

.cupo-card {
    background: var(--sipos-card);
    border: 1px solid rgba(64, 179, 216, 0.18);
    border-radius: var(--sipos-radius);
    padding: 16px 18px;
    box-shadow: 0 6px 20px rgba(6, 42, 74, 0.05);
}

.cupo-card--main {
    background: linear-gradient(145deg, #fff, #f3fafd);
}

.cupo-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sipos-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.cupo-value {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--sipos-navy);
    line-height: 1.1;
}

.cupo-card--main.is-ok .cupo-value { color: #2f7d14; }
.cupo-card--main.is-warn .cupo-value { color: #b86b00; }
.cupo-card--main.is-danger .cupo-value { color: #b42318; }

.cupo-bar {
    margin-top: 14px;
    height: 8px;
    border-radius: 999px;
    background: rgba(10, 61, 107, 0.1);
    overflow: hidden;
}

.cupo-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--sipos-green), var(--sipos-cyan));
    transition: width .35s ease;
}

.cupo-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--sipos-muted);
}

.cupo-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cupo-mini-grid strong {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--sipos-navy);
}

.cupo-orders { margin-top: 8px; }

.cupo-order-item { align-items: flex-start; }

.cupo-order-text { min-width: 0; flex: 1; }

.cupo-order-amount {
    font-weight: 700;
    color: var(--sipos-deep);
    font-size: 0.88rem;
    white-space: nowrap;
    margin-left: 8px;
}

@keyframes portal-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes portal-wave {
    from { transform: translateX(0); }
    to { transform: translateX(-18px); }
}

@media (max-width: 900px) {
    .portal-topbar-main {
        align-items: flex-start;
        flex-direction: column;
        padding: 10px 14px 12px;
    }
    .portal-topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .portal-nav {
        flex: 1 1 auto;
    }
    .portal-nav a,
    .portal-logout-btn,
    .portal-install-btn {
        min-height: 40px;
    }
    .featured-body { grid-template-columns: 1fr; }
    .portal-hero { margin: 12px 12px 0; padding: 34px 18px 30px; border-radius: 22px; }
    .portal-hero--compact { padding: 28px 18px 24px; }
    .portal-stats { gap: 18px; }
    .cupo-mini-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .portal-topbar-actions {
        display: grid;
        grid-template-columns: 1fr auto;
        width: 100%;
    }
    .portal-nav {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .portal-nav a {
        justify-content: center;
        font-size: 0.62rem;
        padding: 8px 2px;
    }
    .portal-install-btn {
        grid-column: 1 / -1;
        justify-content: center;
    }
    .portal-logout-btn span {
        display: none;
    }
}

/* Minimal visual layer — shared SIPOS identity */
body.portal-page {
    background: var(--sipos-bg);
}

.sipos-portal {
    max-width: 1040px;
    background: var(--sipos-bg);
}

.portal-topbar {
    background: rgba(7, 40, 68, 0.98);
    border-bottom: 0;
    backdrop-filter: blur(10px);
}

.portal-topbar-main {
    min-height: 68px;
    padding: 10px 20px;
}

.portal-brand img {
    width: 42px;
    height: 42px;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.portal-brand-title {
    font-family: var(--sipos-font);
    font-size: 1rem;
}

.portal-nav a,
.portal-logout-btn {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.18);
}

.portal-nav a:hover,
.portal-nav a.is-active,
.portal-logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.portal-hero {
    margin: 20px 18px 0;
    padding: 48px 28px 38px;
    border-radius: 18px;
    background: var(--sipos-navy);
    box-shadow: none;
    animation: none;
}

.portal-hero::before {
    display: none;
}

.portal-hero-wave {
    display: none;
}

.portal-hero h1 {
    font-family: var(--sipos-font);
    font-size: clamp(1.8rem, 4vw, 2.35rem);
    text-shadow: none;
}

.portal-hero p {
    color: #bdd3df;
}

.portal-cta {
    padding: 10px 18px;
    background: var(--sipos-green);
    box-shadow: none;
}

.portal-cta:hover {
    box-shadow: none;
}

.portal-stats {
    margin-top: 26px;
}

.portal-section {
    padding-top: 36px;
    animation: none;
}

.portal-section-label h2 {
    font-family: var(--sipos-font);
}

.benefits-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ben-card,
.featured,
.news-item,
.cupo-card {
    border: 1px solid var(--sipos-border);
    box-shadow: none;
    animation: none;
}

.ben-card {
    padding: 18px;
    border-radius: 12px;
}

.ben-card:hover {
    transform: none;
    border-color: #b8cdd8;
    box-shadow: none;
}

.ben-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #edf5f7;
}

.featured {
    border-radius: 14px;
}

.featured-header {
    background: var(--sipos-navy);
}

.feat-item {
    background: var(--sipos-surface-soft);
    border-color: var(--sipos-border);
}

.contact-bar {
    background: var(--sipos-navy);
}

.portal-footer {
    background: var(--sipos-navy-strong);
}

.portal-hero--compact {
    padding: 34px 26px;
}

.portal-hero--home {
    text-align: left;
    padding: 40px 28px 34px;
}

.portal-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.portal-cta--ghost {
    background: transparent;
    color: #eaf7ff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: none;
}

.portal-cta--ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: none;
}

.home-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.home-summary-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-summary-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 118px;
    padding: 18px;
    border: 1px solid var(--sipos-border);
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease;
}

a.home-summary-card:hover {
    border-color: #b8cdd8;
    text-decoration: none;
    color: inherit;
}

.home-summary-card--cupo {
    border-top: 3px solid var(--sipos-green);
}

.home-summary-label {
    color: var(--sipos-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-summary-value {
    color: var(--sipos-navy);
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.15;
}

.home-summary-meta {
    color: var(--sipos-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.featured-footer {
    padding: 0 16px 14px;
    text-align: right;
}

.featured-link {
    color: var(--sipos-blue);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
}

.featured-link:hover {
    color: var(--sipos-navy);
}

.portal-search {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.portal-search-field {
    position: relative;
    flex: 1 1 220px;
    min-width: 0;
}

.portal-search-field i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sipos-muted);
    font-size: 0.85rem;
}

.portal-search-field input,
.portal-search select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--sipos-border);
    border-radius: 10px;
    background: #fff;
    color: var(--sipos-navy);
    font-family: var(--sipos-font);
    font-size: 0.9rem;
}

.portal-search-field input {
    padding: 10px 12px 10px 36px;
}

.portal-search select {
    flex: 0 1 200px;
    padding: 8px 12px;
}

.portal-cta--sm {
    min-height: 42px;
    padding: 8px 16px;
    font-size: 0.86rem;
}

.portal-search-clear {
    color: var(--sipos-muted);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
}

.portal-search-clear:hover {
    color: var(--sipos-navy);
}

a.ben-card--link,
a.feat-item--link,
a.news-item--link {
    text-decoration: none;
    color: inherit;
}

a.ben-card--link:hover,
a.feat-item--link:hover,
a.news-item--link:hover {
    text-decoration: none;
    color: inherit;
}

.ben-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}

.ben-more {
    color: var(--sipos-blue);
    font-size: 0.78rem;
    font-weight: 600;
}

.ben-tag--soft {
    background: #edf5f7;
    color: var(--sipos-navy);
}

.beneficio-detail {
    padding-top: 24px;
}

.beneficio-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--sipos-muted);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
}

.beneficio-back:hover {
    color: var(--sipos-navy);
}

.beneficio-detail-card {
    padding: 28px 24px;
    border: 1px solid var(--sipos-border);
    border-radius: 14px;
    background: #fff;
}

.beneficio-detail-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: #edf5f7;
    color: var(--sipos-navy);
    font-size: 1.25rem;
}

.beneficio-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.beneficio-detail-card h1 {
    margin: 0 0 8px;
    color: var(--sipos-navy);
    font-family: var(--sipos-font);
    font-size: clamp(1.4rem, 3vw, 1.9rem);
}

.beneficio-detail-date {
    margin: 0 0 18px;
    color: var(--sipos-muted);
    font-size: 0.84rem;
}

.beneficio-detail-body {
    color: #3d5360;
    font-size: 0.98rem;
    line-height: 1.65;
}

.credencial-card {
    overflow: hidden;
    border: 1px solid var(--sipos-border);
    border-radius: 16px;
    background: #fff;
}

.credencial-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--sipos-navy);
    color: #fff;
}

.credencial-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: #fff;
    object-fit: contain;
}

.credencial-org {
    font-weight: 700;
    font-size: 0.95rem;
}

.credencial-org-sub {
    color: #bdd3df;
    font-size: 0.75rem;
}

.credencial-badge {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(180, 35, 24, 0.2);
    color: #ffd7d4;
}

.credencial-badge.is-ok {
    background: rgba(118, 184, 42, 0.22);
    color: #d9f5b8;
}

.credencial-body {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    padding: 22px 18px;
    align-items: center;
}

.credencial-photo {
    width: 108px;
    height: 128px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--sipos-border);
    background: #edf5f7;
}

.credencial-photo--empty {
    display: grid;
    place-items: center;
    color: #8aa0ad;
    font-size: 2rem;
}

.credencial-name {
    margin-bottom: 14px;
    color: var(--sipos-navy);
    font-size: 1.25rem;
    font-weight: 700;
}

.credencial-meta {
    margin: 0;
    display: grid;
    gap: 10px;
}

.credencial-meta div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 6px;
}

.credencial-meta dt {
    margin: 0;
    color: var(--sipos-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.credencial-meta dd {
    margin: 0;
    color: var(--sipos-navy);
    font-weight: 600;
    font-size: 0.9rem;
}

.credencial-qr-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.credencial-qr {
    width: 168px;
    height: 168px;
    padding: 8px;
    border: 1px solid var(--sipos-border);
    border-radius: 12px;
    background: #fff;
}

.credencial-qr-wrap span {
    color: var(--sipos-muted);
    font-size: 0.74rem;
}

.credencial-hint {
    margin-top: 14px;
    color: var(--sipos-muted);
    font-size: 0.82rem;
    word-break: break-all;
}

.credencial-hint a {
    color: var(--sipos-blue);
}

.portal-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #eaf7ff;
    text-decoration: none;
}

.portal-icon-btn:hover,
.portal-icon-btn.is-active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    text-decoration: none;
}

.portal-nav--public {
    display: flex;
    width: auto;
}

.portal-nav--public a {
    min-width: 112px;
    justify-content: center;
}

.portal-login-section {
    display: flex;
    justify-content: center;
    padding-top: 28px;
    padding-bottom: 40px;
}

.portal-login-card {
    width: 100%;
    max-width: 420px;
    padding: 28px 24px;
    border: 1px solid var(--sipos-border);
    border-radius: 16px;
    background: #fff;
}

.portal-login-brand {
    text-align: center;
    margin-bottom: 22px;
}

.portal-login-brand img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 12px;
}

.portal-login-brand h1 {
    margin: 0 0 6px;
    color: var(--sipos-navy);
    font-size: 1.35rem;
    font-weight: 700;
}

.portal-login-brand p {
    margin: 0;
    color: var(--sipos-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.portal-login-card .form-group {
    margin-bottom: 14px;
}

.portal-login-card label {
    color: var(--sipos-navy);
    font-size: 0.82rem;
    font-weight: 700;
}

.portal-login-card .form-control {
    min-height: 44px;
    border-radius: 10px;
    border-color: var(--sipos-border);
}

.portal-cta--block {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}

.portal-login-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    color: var(--sipos-muted);
    font-size: 0.86rem;
}

.portal-login-links a {
    color: var(--sipos-blue);
    font-weight: 600;
    text-decoration: none;
}

.portal-login-alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
}

.portal-login-alert--danger {
    background: #fdeceb;
    color: #8f1f18;
}

.portal-login-alert--success {
    background: #eef8e4;
    color: #2f7d14;
}

.portal-login-alert--info {
    background: #eaf4f9;
    color: #0b3558;
}

.portal-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--sipos-green);
    color: #072844;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.notif-list,
.familia-list {
    display: grid;
    gap: 10px;
}

.notif-item,
.familia-item {
    padding: 16px 18px;
    border: 1px solid var(--sipos-border);
    border-radius: 12px;
    background: #fff;
}

.notif-item-title,
.familia-item-name {
    color: var(--sipos-navy);
    font-weight: 700;
    font-size: 1rem;
}

.notif-item-date {
    margin-top: 4px;
    color: var(--sipos-muted);
    font-size: 0.78rem;
}

.notif-item-body {
    margin-top: 10px;
    color: #3d5360;
    font-size: 0.92rem;
    line-height: 1.55;
}

.familia-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
    color: var(--sipos-muted);
    font-size: 0.82rem;
}

@media (max-width: 900px) {
    .portal-topbar-main {
        padding: 10px 14px 12px;
    }
    .portal-hero {
        margin: 12px 12px 0;
        padding: 36px 20px 30px;
    }
    .benefits-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-summary-grid,
    .home-summary-grid--4 {
        grid-template-columns: 1fr 1fr;
    }
    .credencial-body {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
    .credencial-meta div {
        grid-template-columns: 1fr;
    }
    .portal-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .portal-nav a {
        justify-content: center;
        padding: 8px 4px;
        font-size: 0.68rem;
    }
    .portal-nav--public {
        display: flex;
        width: auto;
        grid-template-columns: none;
    }
    .portal-nav--public a {
        min-width: 112px;
        font-size: 0.74rem;
    }
}

@media (max-width: 560px) {
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    .portal-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .portal-stat strong {
        font-size: 1.2rem;
    }
    .portal-stat span {
        font-size: 0.65rem;
    }
    .cupo-order-item {
        flex-wrap: wrap;
    }
    .cupo-order-amount {
        width: 100%;
        margin: 6px 0 0 21px;
    }
    .portal-nav a i {
        display: none;
    }
}

/* Menú compacto del portal en celulares y tablets */
@media (max-width: 900px) {
    .portal-topbar-main {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        padding: 9px 12px;
    }

    .portal-brand {
        min-width: 0;
        flex: 1 1 auto;
    }

    .portal-brand-sub {
        max-width: 210px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .portal-menu-toggle {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .portal-menu-toggle.is-open {
        background: rgba(64, 179, 216, 0.22);
        border-color: rgba(64, 179, 216, 0.7);
    }

    .portal-topbar-actions {
        display: none !important;
        width: 100%;
        margin-top: 8px;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
    }

    .portal-topbar-actions.is-open {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .portal-nav,
    .portal-nav--public {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 7px;
    }

    .portal-nav a,
    .portal-nav--public a,
    .portal-icon-btn,
    .portal-logout-btn,
    .portal-install-btn {
        width: 100%;
        min-width: 0;
        min-height: 42px;
        justify-content: flex-start;
        padding: 9px 13px;
        border-radius: 10px;
        font-size: 0.82rem;
    }

    .portal-nav a i {
        display: inline-block;
        width: 18px;
        text-align: center;
    }

    .portal-menu-label,
    .portal-logout-btn span,
    .portal-install-btn span {
        display: inline;
    }

    .portal-logout-form {
        width: 100%;
    }

    .portal-badge {
        position: static;
        margin-left: auto;
    }
}

/* Categorías como acceso al catálogo */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.cat-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 20px 18px;
    border: 1px solid var(--sipos-border);
    border-radius: 12px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}

.cat-card:hover {
    border-color: #b8cdd8;
    transform: translateY(-2px);
    color: inherit;
    text-decoration: none;
}

.cat-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 6px;
    border-radius: 12px;
    background: #edf5f7;
    color: var(--sipos-navy);
    font-size: 1.15rem;
}

.cat-card h3 {
    margin: 0;
    color: var(--sipos-navy);
    font-size: 1rem;
    font-weight: 600;
}

.cat-count {
    color: var(--sipos-muted);
    font-size: 0.8rem;
}

.cat-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--sipos-blue);
    font-size: 0.78rem;
    font-weight: 600;
}

.cat-card--all .cat-icon {
    background: var(--sipos-navy);
    color: #fff;
}

@media (max-width: 720px) {
    .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
    .category-grid { grid-template-columns: 1fr; }
}
