/* =========================================================
   Portal del paciente — Sistema Dental M
   ========================================================= */
:root {
    --portal-bg: #F3F7F9;
    --portal-line: #E1EBF0;
    --portal-ink: #18323D;
    --portal-muted: #758892;
}

body.portal-page,
body.portal-login-page {
    margin: 0;
    min-height: 100vh;
    background: var(--portal-bg);
    color: var(--portal-ink);
    font-family: var(--font);
}

.portal-page [hidden],
.portal-login-page [hidden] { display: none !important; }
.portal-btn-label { display: inline-block; }
.portal-page .btn--block,
.portal-login-page .btn--block { width: 100%; }

/* ---------- Barra superior ---------- */
.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 72px;
    padding: 12px clamp(18px, 4vw, 44px);
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--portal-line);
    backdrop-filter: blur(10px);
}

.portal-brand { display: flex; align-items: center; gap: 12px; color: var(--portal-ink); text-decoration: none; }
.portal-brand:hover { text-decoration: none; }
.portal-brand img { width: 154px; height: auto; max-height: 42px; object-fit: contain; }
.portal-brand span { display: grid; gap: 1px; }
.portal-brand strong { font-size: 13px; font-weight: 800; letter-spacing: -.01em; }
.portal-brand small { font-size: 10.5px; color: var(--portal-muted); }

.portal-topbar-actions { display: flex; align-items: center; gap: 16px; }
.portal-contact { color: var(--portal-muted); font-size: 11.5px; font-weight: 700; text-decoration: none; }
.portal-contact:hover { color: var(--brand); text-decoration: none; }
.portal-user { display: flex; align-items: center; gap: 9px; padding-left: 16px; border-left: 1px solid var(--portal-line); }
.portal-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: #fff; font-size: 13px; font-weight: 800; }
.portal-user-text { display: grid; gap: 1px; }
.portal-user-text strong { font-size: 11.5px; font-weight: 800; }
.portal-user-text small { font-size: 9.5px; color: var(--portal-muted); }
.portal-logout-form { margin: 0; }
.portal-logout { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px; border: 1px solid var(--portal-line); border-radius: 9px; background: #fff; color: #617681; font: inherit; font-size: 10.5px; font-weight: 700; cursor: pointer; }
.portal-logout:hover { background: #F3F8FA; color: var(--brand-700); }
.portal-logout svg { width: 15px; height: 15px; }

/* ---------- Contenido ---------- */
.portal-main { width: min(1180px, 100%); margin: 0 auto; padding: 28px 22px 36px; }
.portal-welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.portal-eyebrow { display: block; margin-bottom: 5px; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--brand); }
.portal-welcome h1 { margin: 0; font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -.04em; color: #122B36; }
.portal-welcome p { margin: 5px 0 0; font-size: 12.5px; color: var(--portal-muted); }
.portal-welcome-meta { min-width: 160px; padding: 10px 14px; border: 1px solid var(--portal-line); border-radius: 11px; background: #fff; text-align: right; }
.portal-welcome-meta span { display: block; font-size: 8.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--portal-muted); }
.portal-welcome-meta strong { display: block; margin-top: 1px; font-size: 13px; color: var(--brand-700); }
.portal-welcome-meta small { display: block; font-size: 9.5px; color: var(--portal-muted); }

.portal-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 20px; padding: 5px; border: 1px solid var(--portal-line); border-radius: 13px; background: #fff; overflow-x: auto; scrollbar-width: none; }
.portal-tabs::-webkit-scrollbar { display: none; }
.portal-tab { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: #637B86; font: inherit; font-size: 11px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.portal-tab svg { width: 16px; height: 16px; }
.portal-tab:hover { background: #F2F8FA; color: var(--brand-700); }
.portal-tab.is-active { background: var(--brand-050); color: var(--brand-700); box-shadow: inset 0 0 0 1px var(--brand-100); }

.portal-content { display: grid; gap: 16px; animation: portalFade .25s ease both; }
@keyframes portalFade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.portal-grid--hero { grid-template-columns: 1.3fr .7fr; }
.portal-card { min-width: 0; padding: 18px; border: 1px solid var(--portal-line); border-radius: 15px; background: #fff; box-shadow: 0 12px 30px -26px rgba(9, 49, 66, .35); }
.portal-card-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 8.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--portal-muted); }
.portal-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.portal-card-head h3 { margin: 0; font-size: 13.5px; font-weight: 800; color: #1B343F; }
.portal-card-head p { margin: 2px 0 0; font-size: 10.5px; color: var(--portal-muted); }
.portal-count { display: inline-grid; place-items: center; min-width: 26px; height: 25px; padding: 0 7px; border-radius: 8px; background: var(--brand-050); color: var(--brand-700); font-size: 10px; font-weight: 800; }
.portal-link { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--brand); font: inherit; font-size: 10.5px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.portal-link:hover { color: var(--brand-700); }
.portal-link svg { width: 13px; height: 13px; }

/* Próxima cita */
.portal-next { position: relative; overflow: hidden; background: linear-gradient(145deg, #F7FCFE, #fff); }
.portal-next::after { content: ""; position: absolute; width: 150px; height: 150px; right: -50px; top: -60px; border-radius: 50%; background: radial-gradient(circle, var(--brand-100), transparent 68%); pointer-events: none; }
.portal-next-date { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 5px; }
.portal-next-date strong { font-size: 27px; font-weight: 800; letter-spacing: -.05em; color: var(--brand-700); }
.portal-next-date span { font-size: 12px; font-weight: 800; color: var(--brand); }
.portal-next h3 { margin: 0; font-size: 16px; font-weight: 800; color: #17333F; }
.portal-next p { margin: 3px 0 0; font-size: 11.5px; color: var(--portal-muted); }
.portal-next-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 10px; color: var(--portal-muted); }
.portal-next-empty { padding: 22px 0 10px; text-align: center; color: var(--portal-muted); }
.portal-next-empty > span { display: inline-grid; place-items: center; width: 53px; height: 53px; margin-bottom: 8px; border-radius: 16px; background: var(--brand-050); color: var(--brand); }
.portal-next-empty strong { display: block; font-size: 13px; color: #2A4652; }
.portal-next-empty p { margin: 3px 0 0; font-size: 10.5px; }

.portal-balance-card { background: linear-gradient(150deg, var(--brand-800), var(--brand-700)); color: #fff; border-color: transparent; }
.portal-balance-card .portal-card-kicker { color: rgba(255, 255, 255, .7); }
.portal-big-number { display: block; margin-top: 17px; font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.05em; }
.portal-balance-card > p { margin: 4px 0 0; font-size: 10.5px; color: rgba(255, 255, 255, .7); }
.portal-mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .18); }
.portal-mini-stats span { display: block; font-size: 8.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.portal-mini-stats strong { display: block; margin-top: 2px; font-size: 12px; }

/* KPIs */
.portal-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.portal-kpi { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px 13px; border: 1px solid var(--portal-line); border-radius: 12px; background: #fff; }
.portal-kpi-icon { display: grid; place-items: center; flex: 0 0 31px; width: 31px; height: 31px; border-radius: 9px; background: var(--brand-050); color: var(--brand); }
.portal-kpi div { min-width: 0; }
.portal-kpi span:not(.portal-kpi-icon) { display: block; font-size: 8.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--portal-muted); }
.portal-kpi strong { display: block; margin-top: 1px; font-size: 17px; font-weight: 800; letter-spacing: -.03em; color: #1B343F; }

/* Listas */
.portal-list { display: grid; gap: 1px; border: 1px solid #EDF3F6; border-radius: 11px; overflow: hidden; }
.portal-list-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 11px; background: #fff; }
.portal-list-row + .portal-list-row { border-top: 1px solid #EDF3F6; }
.portal-list-icon { display: grid; place-items: center; flex: 0 0 31px; width: 31px; height: 31px; border-radius: 9px; background: var(--brand-050); color: var(--brand); }
.portal-list-icon--green { background: #E9F8F1; color: #0D8A68; }
.portal-list-main { flex: 1; min-width: 0; }
.portal-list-main strong { display: block; font-size: 11.5px; font-weight: 700; color: #263F4A; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-list-main small { display: block; margin-top: 1px; font-size: 9.5px; color: var(--portal-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-list-amount { font-size: 12px; font-weight: 800; color: #0E9F7A; white-space: nowrap; }
.portal-payment-actions { display: flex; align-items: center; gap: 9px; }
.portal-payment-actions strong { font-size: 12px; font-weight: 800; color: #0E9F7A; white-space: nowrap; }
.portal-payment-actions a { display: inline-grid; place-items: center; width: 29px; height: 29px; border: 1px solid var(--portal-line); border-radius: 8px; color: var(--brand-700); text-decoration: none; }
.portal-payment-actions a:hover { background: var(--brand-050); text-decoration: none; }
.portal-payment-actions svg { width: 15px; height: 15px; }

.portal-plan-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 13px; }
.portal-plan-summary > div { padding: 10px 11px; border: 1px solid var(--portal-line); border-radius: 9px; background: #FBFDFE; }
.portal-plan-summary span { display: block; font-size: 8.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--portal-muted); }
.portal-plan-summary strong { display: block; margin-top: 2px; font-size: 14px; color: #263F4A; }
.portal-wide-link { display: flex; align-items: center; justify-content: space-between; gap: 7px; width: 100%; padding: 10px 11px; border: 1px solid var(--brand-100); border-radius: 9px; background: var(--brand-050); color: var(--brand-700); font: inherit; font-size: 10.5px; font-weight: 800; cursor: pointer; }
.portal-wide-link:hover { background: var(--brand-100); }
.portal-wide-link svg { width: 14px; height: 14px; }

/* Sección de citas */
.portal-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.portal-section-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.04em; color: #142E39; }
.portal-section-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--portal-muted); }
.portal-appointments { display: grid; gap: 1px; border: 1px solid #EDF3F6; border-radius: 11px; overflow: hidden; }
.portal-appointment { display: flex; align-items: center; gap: 13px; padding: 12px 13px; background: #fff; }
.portal-appointment + .portal-appointment { border-top: 1px solid #EDF3F6; }
.portal-appointment-date { flex: 0 0 63px; padding: 8px 6px; border-radius: 9px; background: var(--brand-050); text-align: center; }
.portal-appointment-date strong { display: block; font-size: 11.5px; color: var(--brand-700); }
.portal-appointment-date span { display: block; margin-top: 1px; font-size: 10px; font-weight: 800; color: var(--brand); }
.portal-appointment-main { flex: 1; min-width: 0; }
.portal-appointment-main strong { display: block; font-size: 12px; font-weight: 800; color: #263F4A; }
.portal-appointment-main span { display: block; margin-top: 2px; font-size: 10px; color: var(--portal-muted); }
.portal-appointment-main small { display: block; margin-top: 2px; font-size: 9.5px; color: #8A9AA3; }
.portal-appointment-actions { flex: 0 0 auto; }

/* Plan */
.portal-plan-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.portal-plan-totals > div, .portal-payment-total { padding: 14px 15px; border: 1px solid var(--portal-line); border-radius: 12px; background: #fff; }
.portal-plan-totals span, .portal-payment-total span { display: block; font-size: 8.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--portal-muted); }
.portal-plan-totals strong { display: block; margin-top: 3px; font-size: 18px; color: #1B343F; letter-spacing: -.03em; }
.portal-payment-total { background: linear-gradient(135deg, var(--brand-700), var(--brand-800)); border-color: transparent; color: #fff; }
.portal-payment-total span { color: rgba(255, 255, 255, .7); }
.portal-payment-total strong { display: block; margin-top: 3px; font-size: 26px; letter-spacing: -.04em; }
.portal-payment-total small { display: block; margin-top: 2px; font-size: 10px; color: rgba(255, 255, 255, .65); }

.portal-budget-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.portal-budget-card { display: block; width: 100%; padding: 15px; border: 1px solid var(--portal-line); border-radius: 13px; background: #fff; text-align: left; font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.portal-budget-card:hover { border-color: var(--brand-200); box-shadow: 0 12px 28px -24px rgba(9, 49, 66, .45); transform: translateY(-1px); }
.portal-budget-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.portal-budget-head > span:first-child { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; color: var(--brand-700); }
.portal-budget-card > strong { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.04em; color: #1C343F; }
.portal-budget-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; font-size: 9.5px; color: var(--portal-muted); }
.portal-budget-progress { height: 6px; margin-top: 12px; border-radius: 99px; background: #EDF3F6; overflow: hidden; }
.portal-budget-progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-accent)); }
.portal-budget-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; font-size: 9.5px; color: var(--portal-muted); }
.portal-budget-foot strong { color: #526B76; }

/* Perfil */
.portal-profile-hero { display: flex; align-items: center; gap: 13px; padding: 16px 18px; border: 1px solid var(--portal-line); border-radius: 14px; background: #fff; }
.portal-profile-avatar { display: grid; place-items: center; flex: 0 0 52px; width: 52px; height: 52px; border-radius: 15px; background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: #fff; font-size: 21px; font-weight: 800; }
.portal-profile-hero h3 { margin: 0; font-size: 17px; font-weight: 800; color: #1B343F; }
.portal-profile-hero p { margin: 2px 0 0; font-size: 10.5px; color: var(--portal-muted); }
.portal-data-list { display: grid; gap: 1px; margin: 0; border: 1px solid #EDF3F6; border-radius: 10px; overflow: hidden; }
.portal-data-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; background: #fff; }
.portal-data-list > div + div { border-top: 1px solid #EDF3F6; }
.portal-data-list dt { margin: 0; font-size: 10px; color: var(--portal-muted); }
.portal-data-list dd { margin: 0; max-width: 62%; text-align: right; font-size: 10.5px; font-weight: 700; color: #2A4551; word-break: break-word; }
.portal-contact-card { display: grid; gap: 5px; margin-top: 12px; padding: 12px; border: 1px solid var(--portal-line); border-radius: 10px; background: #FBFDFE; }
.portal-contact-card strong { font-size: 11.5px; color: #243F4A; }
.portal-contact-card span { font-size: 10px; color: var(--portal-muted); }
.portal-contact-card a { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--brand-700); text-decoration: none; }
.portal-contact-card svg { width: 13px; height: 13px; }
.portal-note { margin: 0; font-size: 10px; color: var(--portal-muted); }

/* Estados */
.portal-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.portal-badge--green { background: #E7F8F1; color: #0B8464; }
.portal-badge--blue { background: var(--brand-050); color: var(--brand-700); }
.portal-badge--amber { background: #FEF4E5; color: #A86408; }
.portal-badge--red { background: #FDECEF; color: #B22B3B; }
.portal-badge--violet { background: #F2EDFE; color: #6435C4; }
.portal-badge--gray { background: #EEF3F5; color: #617681; }

/* Estado vacío / carga */
.portal-empty { display: grid; place-items: center; gap: 5px; min-height: 120px; padding: 20px; border: 1px dashed var(--portal-line); border-radius: 11px; text-align: center; color: var(--portal-muted); }
.portal-empty > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--brand-050); color: var(--brand); }
.portal-empty strong { font-size: 11.5px; color: #536C77; }
.portal-empty p { margin: 0; font-size: 10px; }
.portal-skeleton { display: grid; gap: 10px; }
.portal-skeleton span { display: block; height: 92px; border-radius: 14px; background: linear-gradient(90deg, #EDF3F5 25%, #F8FBFC 50%, #EDF3F5 75%); background-size: 200% 100%; animation: portalShimmer 1.3s linear infinite; }
.portal-skeleton span:nth-child(2) { height: 150px; }
.portal-skeleton span:nth-child(3) { height: 70px; }
@keyframes portalShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Modal */
body.portal-modal-open { overflow: hidden; }
.portal-modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(7, 37, 51, .55); backdrop-filter: blur(4px); }
.portal-modal { width: min(720px, 100%); max-height: min(86vh, 760px); display: flex; flex-direction: column; border-radius: 16px; background: #fff; box-shadow: 0 30px 80px -30px rgba(3, 26, 37, .55); overflow: hidden; animation: portalModalIn .22s ease both; }
@keyframes portalModalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.portal-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--portal-line); }
.portal-modal-head h3 { margin: 0; font-size: 14px; font-weight: 800; color: #1B343F; }
.portal-modal-close { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--portal-line); border-radius: 8px; background: #fff; color: #647A85; cursor: pointer; }
.portal-modal-close:hover { background: #F3F8FA; }
.portal-modal-body { padding: 18px; overflow-y: auto; }
.portal-modal-loading { display: grid; place-items: center; min-height: 150px; }
.portal-spinner { width: 28px; height: 28px; border: 3px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: portalSpin .7s linear infinite; }
@keyframes portalSpin { to { transform: rotate(360deg); } }
.portal-budget-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.portal-budget-detail-head span { font-size: 9.5px; font-weight: 800; color: var(--brand-700); }
.portal-budget-detail-head h3 { margin: 2px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -.04em; color: #1B343F; }
.portal-budget-detail-head p { margin: 2px 0 0; font-size: 10.5px; color: var(--portal-muted); }
.portal-budget-detail-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 16px; padding: 10px; border-radius: 10px; background: var(--brand-050); }
.portal-budget-detail-totals span { display: block; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--portal-muted); }
.portal-budget-detail-totals strong { display: block; margin-top: 2px; font-size: 12px; color: #294752; }
.portal-modal-subtitle { margin: 16px 0 7px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--portal-muted); }
.portal-table-wrap { overflow-x: auto; border: 1px solid #EDF3F6; border-radius: 10px; }
.portal-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.portal-table th { padding: 7px 9px; background: #F8FBFC; color: var(--portal-muted); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
.portal-table td { padding: 8px 9px; border-top: 1px solid #EDF3F6; color: #405B67; }
.portal-table .num { text-align: right; }

/* Pie */
.portal-foot { display: flex; justify-content: space-between; gap: 14px; margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--portal-line); font-size: 9.5px; color: #8A9CA5; }

/* Toast */
.portal-toast { position: fixed; left: 50%; bottom: 22px; z-index: 150; transform: translate(-50%, 120%); padding: 10px 16px; border-radius: 10px; background: #173845; color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 12px 30px -14px rgba(3, 28, 40, .6); opacity: 0; transition: transform .25s ease, opacity .25s ease; }
.portal-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Login ---------- */
.portal-login-page { background: #F3F7F9; }
.portal-login-shell { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr); min-height: 100vh; }
.portal-login-brand { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; overflow: hidden; padding: clamp(28px, 4.5vw, 62px); color: #fff; background: radial-gradient(1000px 620px at 82% -8%, rgba(var(--brand-accent-rgb), .42), transparent 60%), radial-gradient(760px 520px at -8% 100%, rgba(var(--brand-800-rgb), .72), transparent 62%), linear-gradient(152deg, var(--brand-800) 0%, var(--brand-700) 42%, var(--brand) 78%, var(--brand-accent) 100%); }
.portal-login-brand::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px); background-size: 76px 76px; mask-image: radial-gradient(80% 70% at 55% 40%, #000 30%, transparent 100%); pointer-events: none; }
.portal-login-brand-top, .portal-login-copy, .portal-login-footer { position: relative; z-index: 1; }
.portal-login-logo { width: clamp(210px, 22vw, 292px); height: auto; filter: drop-shadow(0 16px 30px rgba(0, 22, 34, .3)); }
.portal-login-copy { max-width: 520px; }
.portal-login-copy .portal-eyebrow { color: #B9EAF7; }
.portal-login-copy h1 { margin: 10px 0 15px; font-size: clamp(36px, 4.2vw, 60px); line-height: 1.04; font-weight: 800; letter-spacing: -.04em; }
.portal-login-copy h1 em { font-family: var(--serif); font-style: italic; font-weight: 500; color: #A9E7FA; }
.portal-login-copy p { margin: 0; max-width: 440px; font-size: 14.5px; line-height: 1.75; color: rgba(231, 247, 252, .78); }
.portal-login-features { display: grid; gap: 8px; margin-top: 28px; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(210, 241, 250, .68); }
.portal-login-footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: rgba(210, 238, 247, .55); font-weight: 600; }
.portal-login-panel { display: flex; align-items: center; justify-content: center; padding: clamp(24px, 4vw, 54px); background: radial-gradient(800px 420px at 100% 0%, #EAF6FB 0%, transparent 55%), #F3F7F9; }
.portal-login-card { width: min(100%, 420px); }
.portal-login-mobile-brand { display: none; margin-bottom: 26px; }
.portal-login-mobile-brand img { width: 230px; height: auto; }
.portal-login-kicker { display: block; margin-bottom: 8px; font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: var(--brand); }
.portal-login-card h2 { margin: 0 0 7px; font-size: clamp(26px, 3vw, 32px); font-weight: 800; letter-spacing: -.04em; color: #10242D; }
.portal-login-subtitle { margin: 0 0 22px; font-size: 13px; line-height: 1.6; color: #617681; }
.portal-login-form { display: grid; gap: 14px; }
.portal-field { display: grid; gap: 6px; }
.portal-field > span { font-size: 11.5px; font-weight: 700; color: #3B4D57; }
.portal-field input { width: 100%; height: 48px; padding: 0 13px; border: 1.5px solid var(--portal-line); border-radius: 11px; background: #fff; color: #17333F; font: inherit; font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.portal-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-050); }
.portal-field input.is-invalid { border-color: #D95463; box-shadow: 0 0 0 4px rgba(198, 47, 62, .08); }
.portal-field small { font-size: 9.5px; color: #8A9CA5; line-height: 1.5; }
.portal-btn-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: portalSpin .7s linear infinite; }
.portal-login-submit.is-loading .portal-btn-spinner { display: inline-block; }
.portal-login-submit.is-loading .portal-btn-label { opacity: .8; }
.portal-login-submit { margin-top: 3px; }
.portal-login-submit.btn { height: 49px; }
.portal-alert { margin-bottom: 14px; padding: 11px 13px; border: 1px solid #F5D6DA; border-radius: 10px; background: #FDF2F3; color: #9F2230; font-size: 12px; line-height: 1.5; }
.portal-alert--info { border-color: #D3EBF5; background: #EFF8FC; color: #075E80; }
.portal-login-links { margin-top: 18px; text-align: center; }
.portal-login-links a { font-size: 10.5px; font-weight: 700; color: var(--brand-700); text-decoration: none; }
.portal-login-links a:hover { text-decoration: underline; }
.portal-login-legal { margin: 20px 0 0; padding-top: 15px; border-top: 1px solid var(--portal-line); font-size: 9.5px; line-height: 1.6; color: #8A9CA5; }

/* ---------- Responsivo ---------- */
@media (max-width: 980px) {
    .portal-grid--hero { grid-template-columns: 1fr; }
    .portal-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-login-shell { grid-template-columns: 1fr; }
    .portal-login-brand { display: none; }
    .portal-login-mobile-brand { display: block; }
    .portal-login-panel { min-height: 100vh; padding: 36px 22px; background: radial-gradient(600px 320px at 50% -10%, #DDF1FA 0%, transparent 65%), #F3F7F9; }
}

@media (max-width: 720px) {
    .portal-topbar { align-items: flex-start; flex-wrap: wrap; gap: 10px; padding: 11px 16px; }
    .portal-brand img { width: 124px; }
    .portal-brand strong { font-size: 12px; }
    .portal-brand small { font-size: 9.5px; }
    .portal-topbar-actions { width: 100%; justify-content: space-between; gap: 8px; }
    .portal-contact { display: none; }
    .portal-user { padding-left: 0; border-left: 0; }
    .portal-logout span { display: none; }
    .portal-main { padding: 20px 14px 28px; }
    .portal-welcome { align-items: flex-start; flex-direction: column; gap: 12px; }
    .portal-welcome-meta { width: 100%; text-align: left; }
    .portal-tabs { margin-bottom: 14px; }
    .portal-grid, .portal-budget-grid { grid-template-columns: 1fr; }
    .portal-plan-totals { grid-template-columns: 1fr 1fr; }
    .portal-plan-totals > div:last-child { grid-column: span 2; }
    .portal-section-head { align-items: flex-start; flex-direction: column; }
    .portal-appointment { align-items: flex-start; gap: 9px; }
    .portal-appointment-date { flex-basis: 56px; }
    .portal-appointment-actions { align-self: flex-start; }
    .portal-foot { flex-direction: column; gap: 4px; }
    .portal-budget-detail-totals { grid-template-columns: 1fr; }
    .portal-data-list dd { max-width: 58%; }
    .portal-login-panel { padding: 26px 18px; }
    .portal-login-mobile-brand img { width: 205px; }
    .portal-login-card h2 { font-size: 26px; }
}

@media (max-width: 460px) {
    .portal-kpis { grid-template-columns: 1fr; }
    .portal-user-text strong { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .portal-plan-totals { grid-template-columns: 1fr; }
    .portal-plan-totals > div:last-child { grid-column: auto; }
    .portal-login-legal { font-size: 9px; }
    .portal-list-main small { white-space: normal; }
}
