:root {
  --navy: #0d378c;
  --sky: #6ba5f2;
  --olive: #babf24;
  --gold: #f2e205;
  --mist: #f2f2f0;
  --ink: #111111;
  --white: #ffffff;
  --line: #dfe1dc;
  --muted: #656963;
  font-family: "Inter Tight", Arial, sans-serif;
  color: var(--ink);
  background: var(--mist);
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.shell { min-height: 100vh; background: var(--mist); }
.header { height: 74px; padding: 0 5.5vw; display: flex; align-items: center; justify-content: space-between; background: var(--white); border-bottom: 1px solid var(--line); }
.brand img { display: block; width: 158px; height: auto; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.account-name { color: var(--muted); font-size: .9rem; }
.help-link, .user-button { border: 0; background: transparent; color: var(--ink); font-weight: 600; padding: 10px; }
.user-button { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: white; padding: 0; }
.user-button svg { width: 19px; height: 19px; }
.page { max-width: 1180px; padding: 42px 5.5vw 72px; margin: auto; }
.eyebrow { color: var(--navy); font-size: .9rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; margin: 0 0 10px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.25rem, 6vw, 4.2rem); line-height: .96; letter-spacing: -.055em; margin-bottom: 18px; font-weight: 600; }
h2 { font-size: clamp(1.65rem, 4vw, 2.45rem); letter-spacing: -.04em; line-height: 1; margin-bottom: 12px; }
h3 { font-size: 1.22rem; margin-bottom: 6px; }
.lead { max-width: 600px; color: #444; font-size: clamp(1.1rem, 2vw, 1.32rem); line-height: 1.35; }
.button { display: inline-flex; align-items: center; width: fit-content; gap: 12px; border: 0; border-radius: 999px; padding: 11px 14px 11px 20px; font-weight: 700; background: var(--ink); color: white; }
.button .circle, .arrow-circle { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: var(--white); color: var(--ink); font-size: 1.15rem; }
.button .circle svg { width: 16px; height: 16px; display: block; }
.button.primary { background: var(--navy); }
.button.secondary { background: var(--white); color: var(--ink); border: 1px solid var(--line); }
.button.small { padding: 8px 11px 8px 15px; font-size: .9rem; }
.button.small .circle { width: 24px; height: 24px; }

.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); background: var(--white); }
.login-panel { display: flex; flex-direction: column; padding: 42px clamp(28px, 7vw, 104px); }
.login .brand { margin-bottom: auto; }
.login-content { max-width: 430px; padding: 78px 0; }
.login-content h1 { font-size: clamp(2.5rem, 5vw, 4.2rem); }
.form { display: grid; gap: 16px; margin-top: 34px; }
.field { display: grid; gap: 7px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; max-width: 100%; padding: 14px 15px; border: 1px solid #bfc3bc; border-radius: 10px; background: white; color: var(--ink); outline-color: var(--navy); }
.field textarea { min-height: 112px; resize: vertical; }
/* WebKit iOS calcula mal los controles de fecha al combinar ancho completo y padding. */
@supports (-webkit-touch-callout: none) {
  .field input[type="date"] { height: 48px; padding: 0; text-indent: 15px; }
}
.form-row { display: flex; justify-content: space-between; align-items: center; font-size: .94rem; }
.form-message { margin: -3px 0 0; color: #a32929; font-weight: 600; }
.turnstile-widget { min-height: 65px; margin: 4px 0; }
.link-value { overflow-wrap: anywhere; }
.text-link { color: var(--navy); font-weight: 700; background: none; border: 0; padding: 0; }
.login-aside { background: var(--mist); padding: clamp(28px, 5vw, 70px); display: grid; gap: 18px; align-content: center; }
.announcement { padding: clamp(26px, 4vw, 44px); border-radius: 22px; background: var(--white); }
.announcement.coming { background: var(--white); }
.announcement p { color: #333; font-size: 1.1rem; line-height: 1.35; }
.tag { display: inline-block; margin-bottom: 16px; padding: 6px 11px; border-radius: 99px; background: var(--navy); color: var(--white); font-size: .82rem; font-weight: 700; }

.hero { display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: 28px; padding: clamp(28px, 5vw, 58px); border: 1px solid var(--line); border-radius: 28px; background: var(--white); color: var(--ink); overflow: hidden; }
.hero .eyebrow { color: var(--navy); }
.hero .lead { color: #444; }
.hero-mark { display: grid; place-items: center; min-height: 210px; border-radius: 20px; background: linear-gradient(135deg, var(--sky), #2d67c4); font-size: clamp(7rem, 16vw, 12rem); color: var(--gold); font-weight: 600; }
.hero-image { display: block; width: min(100%, 300px); aspect-ratio: 4 / 5; justify-self: center; overflow: hidden; border-radius: 20px; background: var(--mist); }
.hero-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.section { margin-top: 58px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; padding: 26px; min-height: 220px; border: 1px solid var(--line); border-radius: 20px; background: white; }
.card p { color: var(--muted); line-height: 1.4; }
.card .button { align-self: flex-start; margin-top: auto; }
.card-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: auto; border-radius: 15px; background: var(--mist); color: var(--navy); }
.card-icon svg { width: 25px; height: 25px; }
.meta { color: var(--muted); font-size: .92rem; }
.status { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #e9f3dc; color: #355800; font-size: .82rem; font-weight: 700; }
.status.progress { background: #fff2c9; color: #735c00; }
.card-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 18px; }
.item-grid span { display: grid; gap: 3px; color: var(--muted); font-size: .83rem; }
.item-grid strong { color: var(--ink); font-size: .96rem; }
.empty { padding: 32px; border: 1px dashed #b9beb6; border-radius: 20px; color: var(--muted); text-align: center; }
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.subnav button { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: white; font-weight: 600; }
.subnav button.active { color: white; background: var(--navy); border-color: var(--navy); }
.notice { margin-top: 28px; padding: 18px 20px; border-radius: 14px; background: #eff5ff; color: #183d7e; line-height: 1.4; }
.payment-detail-list { display: grid; gap: 12px; margin-top: 18px; }
.payment-detail-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "code status" "summary action"; gap: 6px 18px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.payment-code { color: var(--navy); font-size: .84rem; font-weight: 800; }
.payment-detail-card .payment-code { grid-area: code; }
.payment-detail-card .status { grid-area: status; justify-self: end; }
.payment-summary { grid-area: summary; margin: 0; color: var(--navy); }
.payment-summary strong { font-weight: 700; }
.payment-summary small { color: var(--muted); font-size: .86em; }
.payment-detail-card .button { grid-area: action; justify-self: end; }
.association { margin: 8px 0 0; color: var(--navy); font-size: .9rem; font-weight: 600; }
.association.unmatched { color: var(--muted); font-weight: 500; }
.survey-wrap { max-width: 720px; margin: 0 auto; }
.survey-card { padding: clamp(24px, 5vw, 52px); border-radius: 24px; background: white; border: 1px solid var(--line); }
fieldset.survey-question { min-inline-size: 0; margin: 0; padding: 25px 0; border: 0; }
.survey-question { margin: 0; padding: 25px 0; border: 0; }
.survey-question legend { margin-bottom: 16px; font-weight: 700; font-size: 1.22rem; }
.choice-list { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; font-weight: 500; }
.choice input { accent-color: var(--navy); width: 18px; height: 18px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale label { display: grid; gap: 7px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 10px; text-align: center; font-size: .82rem; }
.scale b { font-size: 1.25rem; color: var(--navy); }
.footer { padding: 19px 5.5vw; border-top: 1px solid var(--line); background: var(--white); color: var(--muted); font-size: .9rem; text-align: center; }
.activity-indicator { position: fixed; z-index: 30; left: 20px; bottom: 20px; display: inline-flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 999px; background: var(--navy); color: var(--white); box-shadow: 0 10px 24px rgba(13,55,140,.25); font-size: .9rem; }
.activity-indicator span { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.45); border-top-color: var(--white); border-radius: 50%; animation: activity-spin .7s linear infinite; }
@keyframes activity-spin { to { transform: rotate(360deg); } }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 13px; color: var(--navy); font-size: .9rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.breadcrumbs a { text-decoration: underline; text-underline-offset: 3px; }
.breadcrumbs span[aria-current="page"] { color: var(--ink); }
.breadcrumb-separator { color: var(--muted) !important; text-decoration: none !important; }
.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; overflow-x: hidden; background: rgba(0,0,0,.48); }
.modal { width: min(550px, 100%); min-width: 0; max-height: calc(100dvh - 40px); padding: 24px; overflow-x: hidden; overflow-y: auto; border-radius: 20px; background: white; box-shadow: 0 20px 60px rgba(0,0,0,.25); overscroll-behavior: contain; }
.modal .form, .modal .field, .modal .form-columns, .modal input, .modal select, .modal textarea { min-width: 0; max-width: 100%; }
.modal input[type="date"] { inline-size: 100%; min-inline-size: 0; box-sizing: border-box; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.modal-lead { color: var(--muted); line-height: 1.4; }
.client-form { gap: 12px; margin-top: 20px; }
.form-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.access-choice { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--mist); cursor: pointer; }
.access-choice input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy); }
.access-choice span { display: grid; gap: 4px; }
.access-choice small { color: var(--muted); line-height: 1.3; }
.credential { display: grid; gap: 7px; margin-top: 20px; padding: 16px; border-radius: 12px; background: var(--mist); }
.credential span { color: var(--muted); font-size: .86rem; }
.credential strong { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.2rem; letter-spacing: .03em; }
.credential-note { margin: 12px 0 0; color: var(--muted); font-size: .92rem; }
.form .button { justify-self: start; }
.admin-page { max-width: 1180px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 9px; margin: 30px 0; }
.admin-module-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.filter-select { display: grid; gap: 6px; color: var(--navy); font-size: .74rem; font-weight: 700; letter-spacing: .04em; line-height: 1; text-transform: uppercase; }
.filter-select select { appearance: none; width: 178px; min-height: 46px; max-width: 100%; padding: 11px 42px 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d378c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center / 18px; color: var(--ink); cursor: pointer; font-family: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2; transition: border-color .18s ease, box-shadow .18s ease; }
.filter-select select:hover { border-color: var(--sky); }
.filter-select select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(13, 55, 140, .12); }
.settings-card { padding: clamp(24px, 4vw, 38px); border: 1px solid var(--line); border-radius: 20px; background: var(--white); }
.settings-card > p { max-width: 680px; color: var(--muted); line-height: 1.4; }
.settings-accordions { display: grid; gap: 14px; }
.settings-card summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.settings-card summary::-webkit-details-marker { display: none; }
.settings-card summary::after { content: '+'; color: var(--navy); font-size: 1.55rem; font-weight: 500; }
.settings-card[open] summary::after { content: '−'; }
.settings-card summary span { display: grid; gap: 5px; }
.settings-card summary small { color: var(--muted); font-weight: 400; }
.accordion-content { margin-top: 24px; }
.portal-settings-form { margin-top: 24px; }
.service-form { display: flex; align-items: end; gap: 12px; margin: 0 0 18px; }
.service-form .field { flex: 1; }
.service-list { display: grid; gap: 10px; }
.service-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.service-item > div { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.readonly-field { min-height: 48px; display: flex; align-items: center; padding: 14px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--mist); color: var(--muted); font-weight: 500; line-height: 1.25; }
.image-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.portal-image-preview, .image-empty { width: 100%; min-height: 180px; margin-top: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--mist); object-fit: cover; }
.image-empty { display: grid; place-items: center; padding: 20px; color: var(--muted); text-align: center; }
.recovery-signout { margin-top: 18px; justify-self: start; }
.admin-nav a { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-weight: 600; }
.admin-nav a.active { border-color: var(--navy); background: var(--navy); color: var(--white); }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-card { display: flex; min-height: 265px; flex-direction: column; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--white); }
.admin-card-top { display: flex; align-items: start; justify-content: space-between; margin-bottom: auto; }
.admin-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 15px; background: var(--mist); color: var(--navy); }
.admin-icon svg { width: 27px; height: 27px; }
.admin-count { color: var(--navy); font-size: 2.8rem; line-height: 1; letter-spacing: -.06em; }
.admin-card h2 { margin: 22px 0 8px; font-size: 1.7rem; }
.admin-card p { color: var(--muted); line-height: 1.4; }
.admin-card .button { align-self: flex-start; margin-top: auto; }
.admin-list { display: grid; gap: 12px; }
.admin-list-card { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.admin-list-card h2 { margin-bottom: 6px; font-size: 1.25rem; }
.admin-list-card p { margin: 0; color: var(--muted); }
.client-list-card { align-items: center; }
.client-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 22px; color: var(--muted); font-size: .92rem; }
.pagination .button:disabled { cursor: not-allowed; opacity: .45; }
.credential .circle svg { width: 16px; height: 16px; display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric-card { display: grid; gap: 7px; padding: 22px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); }
.metric-card span { color: var(--muted); font-size: .9rem; }
.metric-card strong { color: var(--navy); font-size: 2rem; letter-spacing: -.05em; }

@media (max-width: 760px) {
  .header { padding: 0 22px; height: 65px; }
  .brand img { width: 132px; }
  .help-link { display: none; }
  .account-name { display: none; }
  .page { padding: 28px 20px 55px; }
  .login { grid-template-columns: 1fr; }
  .login-panel { padding: 28px 25px 0; }
  .login-content { padding: 48px 0 30px; }
  .login-aside { padding: 22px; }
  .announcement { padding: 25px; }
  .hero { grid-template-columns: 1fr; padding: 28px; border-radius: 20px; }
  .hero-mark { min-height: 120px; }
  .hero-image { width: min(100%, 230px); }
  .card-grid { grid-template-columns: 1fr; }
  .admin-grid, .metric-grid { grid-template-columns: 1fr; }
  .image-settings-grid { grid-template-columns: 1fr; }
  .service-form { align-items: stretch; flex-direction: column; }
  .service-form .button { align-self: flex-start; }
  .service-item { align-items: flex-start; flex-direction: column; }
  .admin-list-card { flex-direction: column; }
  .client-list-card { align-items: stretch; }
  .pagination { flex-wrap: wrap; }
  .item-grid { grid-template-columns: 1fr 1fr; }
  .section { margin-top: 40px; }
  .section-heading { align-items: start; flex-direction: column; }
  .scale { grid-template-columns: repeat(5, minmax(0,1fr)); gap: 5px; }
  .scale label { padding: 9px 3px; font-size: .7rem; }
  .form-columns { grid-template-columns: 1fr; }
  .modal-backdrop { align-items: center; padding: 14px; overflow-y: auto; }
  .modal { width: calc(100vw - 28px); max-width: calc(100vw - 28px); max-height: calc(100dvh - 28px); padding: 22px; }
  .modal input[type="date"] { width: 100%; max-width: 100%; }
  .modal [data-payment-date] { width: 100%; max-width: 100%; overflow: hidden; }
  .modal [data-payment-date] input[type="date"] { max-inline-size: calc(100% - 1px); }
  .modal .field input[type="date"] { display: inline-block; vertical-align: middle; }
  .portal-image-preview { display: block; width: min(100%, 250px); height: 220px; min-height: 0; margin-inline: auto; object-fit: cover; object-position: center; }
  .activity-indicator { left: 14px; bottom: 14px; }
  .payment-detail-card { grid-template-areas: "code status" "summary summary" "action action"; gap: 8px; }
  .payment-detail-card .button { justify-self: start; margin-top: 4px; }
}

