/* Portal de familias — mismo sistema visual que el CRM VNM (versión minimalista de la maqueta) */
:root {
  --primary: #95c1e6; --primary-light: #eaf3fb; --primary-dark: #6ea6d6; --primary-ink: #16324a;
  --accent: #21a0a0; --cyan: #aed3ee; --lavender: #8da2de;
  --bg: #f0f4f8; --surface: #ffffff; --border: #dde3ed;
  --text: #1a202c; --text-secondary: #5a6577; --text-muted: #8e99a8;
  --success: #0d9f6e; --success-bg: #ecfdf5; --warning: #d97706; --warning-bg: #fffbeb;
  --danger: #d14b4b; --danger-bg: #fef2f2;
  --soft: color-mix(in srgb, var(--primary) 14%, var(--surface));
  --ink-soft: color-mix(in srgb, var(--primary-dark) 80%, var(--text));
  --logo-filter: none;
  --radius: 12px;
  --font: 'DM Sans', -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary-light: #16273a; --primary-dark: #aed3ee;
    --bg: #0b0f1a; --surface: #1a2029; --border: #1e2a3f;
    --text: #e4e8f0; --text-secondary: #8e99b0; --text-muted: #6b7a90;
    --success: #34d399; --success-bg: #0a2e1e; --warning: #fbbf24; --warning-bg: #2a1e08;
    --danger: #f87171; --danger-bg: #2e1212;
    --logo-filter: brightness(1.25); color-scheme: dark;
  }
}
* { box-sizing: border-box }
html, body { margin: 0 }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14.5px; line-height: 1.6; -webkit-font-smoothing: antialiased }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.3px; text-wrap: balance }
p { margin: 0 }
a { color: inherit }
button { font: inherit; color: inherit }
:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 2px; border-radius: 8px }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }

/* Barra superior */
.top { position: sticky; top: 0; z-index: 20; padding-top: 12px; background: linear-gradient(var(--bg) 70%, transparent) }
.bar { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 16px }
.bar-row { display: flex; align-items: center; gap: 14px; padding: 10px 16px }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none }
.brand img { width: 34px; height: 34px; object-fit: contain; filter: var(--logo-filter); flex-shrink: 0 }
.brand-name { font-weight: 700; font-size: 13px; letter-spacing: 1.8px; white-space: nowrap }
.brand-sub { font-size: 9.5px; letter-spacing: 3px; color: var(--text-muted); white-space: nowrap; text-transform: uppercase }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px }
.user { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px }
.lang { display: flex; width: max-content; justify-self: start; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; font-size: 12px; font-weight: 600 }
.lang a { padding: 4px 11px; text-decoration: none; color: var(--text-muted) }
.lang a[aria-current="true"] { background: var(--soft); color: var(--text) }
@media (max-width: 720px) { .user, .brand-sub { display: none } }
@media (max-width: 560px) {
  .bar-row { flex-wrap: wrap; padding: 10px 12px; gap: 10px }
  .bar-right { margin-left: 0; width: 100%; justify-content: space-between }
}
@media (max-width: 520px) { .brand-name { font-size: 11px; letter-spacing: 1px; white-space: normal; line-height: 1.25 } }

.tabs { display: flex; gap: 4px; padding: 7px 10px; border-top: 1px solid var(--border); overflow-x: auto; scrollbar-width: none }
.tab { padding: 6px 14px; border-radius: 999px; font-weight: 500; font-size: 13.5px; color: var(--text-secondary); text-decoration: none; white-space: nowrap }
.tab:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); color: var(--text) }
.tab[aria-current="page"] { background: var(--soft); color: var(--text); font-weight: 600 }

main { padding-block: 26px 48px }
.head { margin-bottom: 20px }
.head h1 { font-size: clamp(22px, 3.2vw, 28px) }
.head p { color: var(--text-secondary); max-width: 62ch; margin-top: 2px }
.kicker { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted) }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; min-width: 0 }
.card h3 { font-size: 14.5px; font-weight: 600; margin-bottom: 16px }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap }
.card-hd h3 { margin: 0 }
.c12 { grid-column: span 12 } .c7 { grid-column: span 7 } .c5 { grid-column: span 5 }
.stack { display: grid; gap: 16px; align-content: start }
@media (max-width: 900px) { .c7, .c5 { grid-column: span 12 } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 500; border: 1px solid var(--border); cursor: pointer; white-space: nowrap; background: var(--surface); color: var(--text); text-decoration: none }
.btn:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)) }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); font-weight: 600 }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 85%, var(--primary-ink)) }
.btn-sm { padding: 5px 12px; font-size: 12.5px }
.btn-link { background: none; border: 0; padding: 0; color: var(--ink-soft); font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none }
.btn-link:hover { text-decoration: underline }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; padding: 3px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--border); color: var(--text-secondary) }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary-dark) }
.badge.ok::before { background: var(--success) }

/* Etapas */
.journey { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) }
.journey li { position: relative; text-align: center; padding-top: 34px; font-size: 13px; color: var(--text-muted); font-weight: 500 }
.journey li::before { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--border) }
.journey li:first-child::before { display: none }
.journey .pin { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); display: grid; place-items: center; z-index: 1 }
.journey li.done { color: var(--text-secondary) }
.journey li.done::before, .journey li.now::before { background: var(--primary) }
.journey li.done .pin { background: var(--primary); border-color: var(--primary) }
.journey li.done .pin::after { content: ""; width: 8px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px,-1px) }
.journey li.now { color: var(--text); font-weight: 600 }
.journey li.now .pin { border-color: var(--primary-dark); box-shadow: 0 0 0 4px var(--soft) }
.journey li.now .pin::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--primary-dark) }
.journey small { display: block; font-weight: 400; color: var(--text-muted); font-size: 11.5px }
@media (max-width: 640px) {
  .journey { grid-template-columns: 1fr }
  .journey li { text-align: left; padding: 0 0 18px 40px; min-height: 40px }
  .journey li::before { top: -22px; left: 11px; width: 2px; height: 30px }
  .journey .pin { left: 0; transform: none }
}

/* Proyectos */
.procs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px }
.proc { display: grid; gap: 1px; padding: 10px 18px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; min-width: 0 }
.proc b { font-size: 13.5px; font-weight: 600 }
.proc span { font-size: 12px; color: var(--text-muted) }
.proc[aria-current="true"] { background: var(--soft); border-color: transparent }
.dotp { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--primary-dark) }
.dotp.prep { background: var(--text-muted) } .dotp.done { background: var(--success) }

/* Filas */
.rows { display: grid }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border) }
.row:last-child { border-bottom: 0; padding-bottom: 0 }
.row:first-child { padding-top: 0 }
.row-tx { flex: 1; min-width: 0 }
.row-tx b { display: block; font-weight: 500; font-size: 13.5px; overflow-wrap: anywhere }
.row-tx span { font-size: 12.5px; color: var(--text-muted) }
.ext { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 9.5px; font-weight: 800; flex-shrink: 0; letter-spacing: .3px; background: var(--bg); color: var(--text-secondary) }
.vacio { color: var(--text-muted); font-size: 13.5px }

.note { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px }
.note b { font-size: 13.5px }
.note p { color: var(--text-secondary); font-size: 13.5px; margin-top: 4px; white-space: pre-line }
.note small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 6px }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--soft); color: var(--ink-soft); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0 }

.hito { display: flex; align-items: center; gap: 16px; flex-wrap: wrap }
.hito + .hito { margin-top: 14px }
.hito h2 { font-size: 17px }
.hito p { color: var(--text-secondary); font-size: 13.5px }

/* Carpetas */
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px }
.folder { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); display: flex; gap: 12px; align-items: center; text-decoration: none }
.folder:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)) }
.folder[aria-current="true"] { background: var(--soft); border-color: transparent }
.folder svg { color: var(--text-secondary); flex-shrink: 0 }
.folder b { display: block; font-size: 13.5px; font-weight: 600 }
.folder span { font-size: 12px; color: var(--text-muted) }

/* Acceso */
.acc { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) }
.acc-form { display: grid; place-items: center; padding-block: 48px }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 16px }
.login-card h1 { font-size: 26px }
.login-card p { color: var(--text-secondary); font-size: 13.5px }
.acc-mini { display: flex; align-items: center; gap: 10px; margin-bottom: 14px }
.acc-mini img { width: 30px; height: 30px; filter: var(--logo-filter) }
.campo { display: grid; gap: 6px; font-size: 12.5px; color: var(--text-secondary) }
.campo input { font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; width: 100% }
.campo input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--soft) }
.campo input.code { font-size: 26px; font-weight: 700; letter-spacing: 12px; text-align: center; font-variant-numeric: tabular-nums }
.secure { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px }
.err { color: var(--danger); font-size: 13px; font-weight: 500 }
.ok-msg { color: var(--success); font-size: 13px; font-weight: 500 }
.acc-marca { position: relative; overflow: hidden; margin: 16px; border-radius: 28px;
  background: radial-gradient(120% 90% at 85% 15%, color-mix(in srgb, var(--primary) 30%, var(--surface)) 0%, color-mix(in srgb, var(--primary) 10%, var(--surface)) 55%, var(--surface) 100%);
  border: 1px solid var(--border); display: flex; flex-direction: column; justify-content: flex-end; padding: 40px }
.acc-marca img { position: absolute; left: 40px; top: 50%; transform: translateY(-50%); height: 52%; width: auto; max-width: 70%; opacity: .9; filter: var(--logo-filter) }
.acc-marca .tx { position: relative; max-width: 30ch }
.acc-marca .tx b { display: block; font-size: 12px; letter-spacing: 3px; font-weight: 700 }
.acc-marca .tx span { display: block; margin-top: 8px; font-size: 22px; font-weight: 600; letter-spacing: -.3px; line-height: 1.3 }
@media (max-width: 860px) { .acc { grid-template-columns: 1fr } .acc-marca { display: none } }

footer { color: var(--text-muted); font-size: 12px; padding-block: 0 32px; text-align: center }
