/* Aplicación privada /app */
body { background: var(--bg); }
.boot { min-height: 100svh; display: grid; place-items: center; }
.boot-radar { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--blue-100); position: relative; background: conic-gradient(from 0deg, transparent 0 300deg, rgba(8, 111, 201, .5) 360deg); animation: spin 1.2s linear infinite; }

/* ---------- autenticación ---------- */
.auth-page { min-height: 100svh; display: grid; grid-template-columns: 1fr 1.05fr; }
.auth-side { position: relative; overflow: hidden; isolation: isolate; background: radial-gradient(800px 500px at 80% 20%, #0f4a86, transparent 60%), linear-gradient(160deg, var(--navy-950), var(--navy)); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { color: #fff; font-size: clamp(30px, 3.6vw, 46px); font-weight: 800; max-width: 480px; }
.auth-side p { color: #a9c3dd; font-size: 17px; max-width: 440px; margin-top: 16px; }
.auth-side .logo-chip { display: inline-flex; background: #fff; border-radius: 14px; padding: 8px 14px; align-self: flex-start; }
.auth-side .logo { height: 42px; }
.auth-orbit { position: absolute; right: -180px; bottom: -180px; width: 560px; height: 560px; border-radius: 50%; border: 1px solid rgba(111, 182, 245, .18); z-index: -1; }
.auth-orbit::before, .auth-orbit::after { content: ''; position: absolute; inset: 70px; border-radius: 50%; border: 1px solid rgba(111, 182, 245, .14); }
.auth-orbit::after { inset: 0; border: 0; background: conic-gradient(from 0deg, transparent 0 300deg, rgba(26, 134, 232, .35) 360deg); animation: spin 6s linear infinite; }
.auth-orb { width: 74px; height: 74px; animation: float 5s ease-in-out infinite; filter: drop-shadow(0 12px 30px rgba(26, 134, 232, .5)); }
@keyframes float { 50% { transform: translateY(-10px) rotate(6deg); } }
.auth-main { display: grid; place-items: center; padding: 40px 20px; }
.auth-box { width: min(440px, 100%); animation: rise .6s var(--ease); }
.auth-box h2 { font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.auth-box > p { color: var(--muted); margin-bottom: 26px; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 18px; font-size: 14px; font-weight: 700; }
.auth-links a { text-decoration: none; }
.state-icon { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; font-size: 36px; margin-bottom: 18px; background: var(--blue-100); animation: pop .5s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- estructura ---------- */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100svh; }
.sidebar { position: sticky; top: 0; height: 100svh; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 16px; }
.sidebar .brand-link { display: block; padding: 4px 8px 22px; }
.sidebar .logo { height: 50px; }
.side-nav { display: grid; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; position: relative; transition: background .2s, color .2s; }
.side-nav a:hover { background: var(--bg); }
.side-nav a[aria-current='page'] { background: var(--blue-100); color: var(--blue); }
.side-nav a[aria-current='page']::before { content: ''; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--blue); }
.side-nav svg { width: 20px; height: 20px; flex-shrink: 0; }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--bg); }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--blue), var(--navy)); }
.user-chip strong { display: block; font-size: 14px; color: var(--navy); line-height: 1.3; }
.user-chip small { color: var(--muted); font-size: 12.5px; word-break: break-all; }
.linkish { border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 10px; cursor: pointer; text-align: left; display: flex; gap: 10px; align-items: center; }
.linkish:hover { background: var(--red-100); color: var(--red-600); }

.main { min-width: 0; padding: 34px clamp(18px, 4vw, 48px) 80px; }
.page { max-width: 1160px; margin-inline: auto; animation: rise .5s var(--ease); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 6px; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--blue); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.kicker::before { content: ''; width: 18px; height: 2px; background: var(--red); }
.wave { display: inline-block; animation: wave 2.4s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes wave { 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40%, 100% { transform: none; } }

.mobile-top { display: none; }
.tabbar { display: none; }

/* ---------- tarjetas ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); }
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 40px 0 18px; gap: 12px; }
.section-title h2 { font-size: 24px; font-weight: 800; }
.section-title a { font-weight: 700; text-decoration: none; font-size: 14.5px; }

.event-hero { position: relative; overflow: hidden; isolation: isolate; border-radius: 24px; padding: 30px; color: #fff; background: radial-gradient(600px 300px at 90% 0%, rgba(26, 134, 232, .55), transparent), linear-gradient(140deg, var(--navy-950), var(--navy) 60%, #0b3d72); box-shadow: var(--shadow); }
.event-hero::after { content: ''; position: absolute; right: -120px; top: -120px; width: 380px; height: 380px; border-radius: 50%; z-index: -1; border: 1px solid rgba(111, 182, 245, .2); background: conic-gradient(from 0deg, transparent 0 300deg, rgba(26, 134, 232, .3) 360deg); animation: spin 7s linear infinite; }
.event-hero h2 { color: #fff; font-size: clamp(24px, 2.8vw, 32px); font-weight: 800; margin: 14px 0 8px; }
.event-hero .meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: #b9d0e7; font-size: 15px; margin-bottom: 22px; }
.event-hero .meta span { display: inline-flex; align-items: center; gap: 7px; }
.event-hero .badge { background: rgba(255, 255, 255, .12); color: #fff; }
.event-hero .badge-ok { background: rgba(19, 138, 91, .25); color: #6ff0b4; }
.event-hero .badge-warn { background: rgba(240, 160, 32, .2); color: #ffd28a; }
.event-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.event-note { margin-top: 16px; font-size: 14px; color: #a9c3dd; display: flex; gap: 8px; align-items: flex-start; }
.mini-cd { display: flex; gap: 8px; margin: 4px 0 22px; }
.mini-cd div { padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); text-align: center; min-width: 62px; }
.mini-cd strong { display: block; font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.mini-cd span { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #9ebbd8; }

.stat-card { padding: 24px; display: grid; gap: 16px; align-content: start; }
.stat-card h3 { font-size: 18px; }
.ring-wrap { display: flex; align-items: center; gap: 18px; }
.ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: conic-gradient(var(--blue) calc(var(--p) * 1%), var(--blue-100) 0); transition: --p 1.2s var(--ease); }
@property --p { syntax: '<number>'; initial-value: 0; inherits: false; }
.ring::before { content: attr(data-label); width: 72px; height: 72px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: 19px; color: var(--navy); }
.ring-wrap p { color: var(--muted); font-size: 14.5px; }

.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.course-card { overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.course-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.course-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--blue-100); }
.course-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.course-card:hover .course-img img { transform: scale(1.07); }
.course-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 26, 51, .35), transparent 45%); }
.course-img .badge { position: absolute; top: 12px; right: 12px; z-index: 1; background: #fff; box-shadow: var(--shadow-sm); }
.course-img .route-tag { position: absolute; z-index: 1; top: 14px; left: 14px; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.course-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-body h3 { font-size: 19px; }
.course-body p { color: var(--muted); font-size: 14.5px; }
.course-foot { margin-top: auto; padding-top: 12px; display: grid; gap: 8px; }
.progress { height: 8px; border-radius: 8px; background: var(--blue-100); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--blue), var(--blue-500)); transition: width 1.2s var(--ease); }
.progress-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- aula ---------- */
.classroom { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #041a33; box-shadow: var(--shadow); }
.player video { width: 100%; height: 100%; background: #000; }
.player-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 12px; color: #c6dbef; padding: 24px; background: radial-gradient(400px 200px at 50% 30%, rgba(26, 134, 232, .35), transparent), #041a33; }
.player-empty strong { color: #fff; font-size: 20px; }
.player-empty .big { font-size: 44px; }
.lesson-info { padding: 24px; margin-top: 20px; }
.lesson-info h2 { font-size: 24px; margin-bottom: 10px; }
.lesson-info p { color: var(--muted); }
.lesson-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.lesson-list { padding: 10px; position: sticky; top: 20px; }
.lesson-list h3 { font-size: 16px; padding: 12px 12px 4px; }
.lesson-list .progress-row { padding: 0 12px 10px; }
.lesson-list ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lesson-list a { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 650; font-size: 14.5px; transition: background .2s; }
.lesson-list a:hover { background: var(--bg); }
.lesson-list a[aria-current='true'] { background: var(--blue-100); color: var(--blue); }
.lesson-num { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--bg); border: 1.5px solid var(--line); color: var(--muted); }
.lesson-list a.done .lesson-num { background: var(--ok); border-color: var(--ok); color: #fff; }
.lesson-list small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.access-banner { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 16px; margin-bottom: 20px; }
.access-banner.ok { background: var(--ok-100); color: #0d6c47; }
.access-banner.warn { background: var(--warn-100); color: #8a5208; }
.access-banner.lock { background: var(--red-100); color: #a01d2a; }

/* ---------- vacío / error ---------- */
.empty { text-align: center; padding: 56px 24px; }
.empty .big { font-size: 46px; margin-bottom: 10px; }
.empty h2 { font-size: 22px; margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 460px; margin: 0 auto 18px; }
.skeleton { border-radius: 20px; background: linear-gradient(90deg, #e9eff6 25%, #f5f8fc 50%, #e9eff6 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- panel del equipo ---------- */
.admin-grid { display: grid; gap: 22px; }
.admin-card { padding: 24px; }
.admin-card h2 { font-size: 20px; margin-bottom: 4px; }
.admin-card > p { color: var(--muted); font-size: 14.5px; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { padding: 18px 20px; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 700; }
.stat strong { display: block; font-size: 30px; color: var(--navy); font-weight: 800; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; font-size: 14px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--blue); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 150%); background: var(--navy); color: #fff; padding: 13px 20px; border-radius: 14px; font-weight: 700; box-shadow: var(--shadow-lg); transition: transform .45s var(--ease); max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); }
.toast.error { background: var(--red-600); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .classroom, .grid-2 { grid-template-columns: 1fr; }
  .lesson-list { position: static; }
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { padding: 26px 20px 30px; gap: 22px; }
  .auth-side .auth-orb, .auth-side .auth-side-foot { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; padding: 10px 16px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .mobile-top .logo { height: 32px; }
  .main { padding: 22px 16px 110px; }
  .tabbar { display: grid; grid-template-columns: repeat(var(--tabs, 3), 1fr); position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 40; padding: 6px; border-radius: 20px; background: rgba(255, 255, 255, .95); backdrop-filter: blur(14px); box-shadow: 0 10px 40px rgba(4, 26, 51, .18); border: 1px solid var(--line); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 8px 4px; border-radius: 14px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 750; }
  .tabbar a[aria-current='page'] { color: var(--blue); background: var(--blue-100); }
  .tabbar svg { width: 22px; height: 22px; }
  .course-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .event-hero { padding: 24px 20px; border-radius: 20px; }
  .event-actions .btn { flex: 1 1 100%; }
}

/* ---------- novedades ---------- */
.feed { display: grid; gap: 20px; max-width: 720px; }
.feed-layout { display: grid; grid-template-columns: minmax(0, 720px) 1fr; gap: 28px; align-items: start; }
.feed-side { position: sticky; top: 20px; display: grid; gap: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; border: 1.5px solid var(--line); background: #fff; color: var(--ink); padding: 8px 15px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer; transition: all .25s var(--ease); }
.chip:hover { border-color: var(--blue-300); }
.chip[aria-pressed='true'] { background: var(--navy); border-color: var(--navy); color: #fff; }
.post { overflow: hidden; animation: rise .5s var(--ease) both; }
.post-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; }
.post-head .avatar { background: linear-gradient(135deg, var(--red), var(--blue)); }
.post-head strong { display: block; color: var(--navy); font-size: 15px; }
.post-head small { color: var(--muted); font-size: 13px; }
.post-head .badges { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.post-body { padding: 14px 20px 0; }
.post-body h2 { font-size: 21px; margin-bottom: 6px; }
.post-body p { color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.post-media { margin-top: 14px; background: #041a33; }
.post-media img { width: 100%; max-height: 560px; object-fit: cover; cursor: zoom-in; }
.post-media video { width: 100%; max-height: 560px; background: #000; }
.embed { position: relative; aspect-ratio: 16 / 9; width: 100%; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.post-link { margin: 14px 20px 0; }
.post-actions { display: flex; gap: 4px; padding: 10px 12px; margin-top: 14px; border-top: 1px solid var(--line); }
.act { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; color: var(--muted); font-weight: 750; font-size: 14.5px; padding: 10px 14px; border-radius: 12px; cursor: pointer; transition: background .2s, color .2s; }
.act:hover { background: var(--bg); color: var(--navy); }
.act svg { width: 20px; height: 20px; }
.act.liked { color: var(--red); }
.act.liked svg { fill: var(--red); animation: heart .45s var(--ease); }
@keyframes heart { 30% { transform: scale(1.35); } 60% { transform: scale(.9); } }
.comments { padding: 4px 20px 18px; display: grid; gap: 12px; background: #fbfcfe; border-top: 1px solid var(--line); }
.comment { display: flex; gap: 10px; animation: rise .35s var(--ease); }
.comment .avatar { width: 34px; height: 34px; font-size: 13px; }
.comment-bubble { background: #fff; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 9px 13px; flex: 1; min-width: 0; }
.comment-bubble strong { font-size: 13.5px; color: var(--navy); }
.comment-bubble p { font-size: 14.5px; white-space: pre-line; overflow-wrap: anywhere; }
.comment-bubble small { color: var(--muted); font-size: 12px; }
.comment.is-hidden { opacity: .5; }
.comment-form { display: flex; gap: 10px; align-items: flex-end; padding-top: 14px; }
.comment-form textarea { min-height: 46px; height: 46px; resize: none; }
.lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(4, 26, 51, .92); display: grid; place-items: center; padding: 20px; cursor: zoom-out; animation: pop .25s var(--ease); }
.lightbox img { max-height: 92svh; border-radius: 12px; }
.event-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- panel con pestañas ---------- */
.tabs { display: flex; gap: 6px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 8px; z-index: 5; box-shadow: var(--shadow-sm); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex-shrink: 0; border: 0; background: none; padding: 10px 16px; border-radius: 11px; font-weight: 800; color: var(--muted); cursor: pointer; transition: all .25s var(--ease); display: inline-flex; gap: 8px; align-items: center; }
.tabs button:hover { color: var(--navy); background: var(--bg); }
.tabs button[aria-selected='true'] { background: var(--navy); color: #fff; box-shadow: 0 6px 16px rgba(9, 41, 77, .25); }
.tab-panel { animation: rise .4s var(--ease); }
.uploader { border: 2px dashed #c9d8e8; border-radius: 16px; padding: 18px; text-align: center; background: var(--bg); transition: border-color .2s, background .2s; position: relative; }
.uploader.drag { border-color: var(--blue); background: var(--blue-100); }
.uploader input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.uploader .up-icon { font-size: 28px; }
.uploader strong { display: block; color: var(--navy); }
.uploader small { color: var(--muted); }
.up-bar { height: 8px; border-radius: 8px; background: #dfe9f4; overflow: hidden; margin-top: 12px; }
.up-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--red)); transition: width .2s; }
.up-preview { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: left; }
.up-preview img, .up-preview video { width: 96px; height: 64px; object-fit: cover; border-radius: 10px; background: #041a33; }
.up-preview div { flex: 1; min-width: 0; }
.up-preview strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: inline-flex; padding: 4px; background: var(--bg); border-radius: 12px; gap: 4px; margin-bottom: 12px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font-weight: 750; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed='true'] { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }
.link-rows { display: grid; gap: 8px; margin-bottom: 10px; }
.link-row { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; }
.icon-btn { border: 0; background: var(--red-100); color: var(--red-600); width: 46px; border-radius: 12px; font-size: 18px; cursor: pointer; }
.post-admin { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.post-admin .thumb { width: 72px; height: 54px; border-radius: 10px; background: var(--blue-100) center / cover; display: grid; place-items: center; font-size: 22px; }
.post-admin strong { color: var(--navy); }
.post-admin p { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-admin.retired { opacity: .55; }
@media (max-width: 1080px) { .feed-layout { grid-template-columns: 1fr; } .feed-side { display: none; } }
@media (max-width: 860px) {
  .link-row { grid-template-columns: 1fr auto; }
  .link-row input:first-child { grid-column: 1 / -1; }
  .post-admin { grid-template-columns: 56px 1fr; }
  .post-admin .row-actions { grid-column: 1 / -1; }
  .post-head { padding: 16px 16px 0; } .post-body { padding: 12px 16px 0; } .post-link { margin: 12px 16px 0; } .comments { padding: 4px 16px 16px; }
}

/* ---------- usuarios, leads y equipo ---------- */
.users-table tbody tr { cursor: pointer; transition: background .2s; }
.users-table tbody tr:hover, .users-table tbody tr:focus-visible { background: var(--bg); outline: none; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .avatar { width: 36px; height: 36px; font-size: 13px; }
.who strong { display: block; color: var(--navy); font-size: 14px; }
.who small { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.sources { display: grid; gap: 10px; margin-bottom: 18px; }
.source-row { display: grid; grid-template-columns: 110px 1fr 34px; gap: 10px; align-items: center; font-size: 14px; }
.source-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-row .bar { height: 10px; border-radius: 10px; background: var(--blue-100); overflow: hidden; }
.source-row .bar span { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--blue), var(--red)); }
.source-row b { text-align: right; color: var(--navy); }
.utm-help { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--bg); font-size: 13.5px; }
.utm-help code { overflow-wrap: anywhere; font-size: 12.5px; color: var(--blue); }
.drawer-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(4, 26, 51, .45); backdrop-filter: blur(3px); animation: fade .25s var(--ease); }
.drawer-overlay.closing { opacity: 0; transition: opacity .25s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(480px, 100%); background: #fff; padding: 28px 26px 40px; overflow-y: auto; box-shadow: var(--shadow-lg); animation: slide-in .35s var(--ease); }
@keyframes slide-in { from { transform: translateX(100%); } }
.drawer-close { position: absolute; right: 16px; top: 14px; width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--bg); font-size: 24px; cursor: pointer; color: var(--muted); }
.drawer-close:hover { background: var(--red-100); color: var(--red-600); }
.drawer-head { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; padding-right: 40px; }
.drawer-head h2 { font-size: 22px; }
.drawer-head a { font-size: 14px; overflow-wrap: anywhere; }
.drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.drawer-grid div { padding: 12px; border-radius: 12px; background: var(--bg); }
.drawer-grid span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.drawer-grid strong { color: var(--navy); font-size: 14.5px; overflow-wrap: anywhere; }
.drawer h3 { font-size: 16px; margin: 22px 0 10px; }
.drawer-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; display: grid; gap: 4px; }
.drawer-item strong { color: var(--navy); font-size: 14.5px; }
.drawer-item span { color: var(--muted); font-size: 13px; }
.drawer-item .progress > span { width: 0; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.role-check { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .2s, background .2s; }
.role-check:has(input:checked) { border-color: var(--blue); background: var(--blue-100); }
.role-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); flex-shrink: 0; }
.role-check b { display: block; color: var(--navy); font-size: 14px; }
.role-check small { display: block; color: var(--muted); font-size: 12.5px; }
.role-grid.compact .role-check { padding: 8px 10px; }
.role-grid.compact .role-check small { display: none; }
.member { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 1080px) { .member { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .role-grid { grid-template-columns: 1fr; } .drawer { padding: 22px 18px 40px; } .users-table th:nth-child(2), .users-table td:nth-child(2), .users-table th:nth-child(6), .users-table td:nth-child(6) { display: none; } }

/* =========================================================
   Diseño vivo: fondo animado, cristal, luz que sigue al cursor
   ========================================================= */
body { background: #f2f6fb; }
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; will-change: transform; animation: blob 26s ease-in-out infinite alternate; }
.ambient span:nth-child(1) { width: 560px; height: 560px; background: #b9dcff; top: -180px; right: -120px; }
.ambient span:nth-child(2) { width: 460px; height: 460px; background: #ffd3d8; bottom: -200px; left: 18%; animation-duration: 32s; animation-delay: -8s; opacity: .45; }
.ambient span:nth-child(3) { width: 380px; height: 380px; background: #cfe6ff; top: 35%; left: -140px; animation-duration: 38s; animation-delay: -16s; }
.ambient::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(9, 41, 77, .07) 1px, transparent 1px); background-size: 26px 26px; mask-image: linear-gradient(180deg, #000, transparent 70%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%); }
@keyframes blob { 33% { transform: translate(-70px, 60px) scale(1.12); } 66% { transform: translate(50px, -40px) scale(.92); } 100% { transform: translate(-30px, 90px) scale(1.06); } }
#root, .shell, .auth-page { position: relative; z-index: 1; }

/* Barra lateral de cristal */
.sidebar { background: rgba(255, 255, 255, .72); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-right: 1px solid rgba(223, 231, 240, .8); }
.side-nav a { transition: background .25s, color .25s, transform .25s var(--ease); }
.side-nav a:hover { transform: translateX(3px); }
.side-nav a[aria-current='page'] { background: linear-gradient(110deg, var(--navy), var(--blue)); color: #fff; box-shadow: 0 10px 24px rgba(8, 111, 201, .28); }
.side-nav a[aria-current='page']::before { display: none; }
.user-chip { background: linear-gradient(135deg, rgba(230, 242, 253, .9), rgba(255, 255, 255, .9)); border: 1px solid var(--line); }
.mobile-top { background: rgba(255, 255, 255, .78); }
.tabbar a { transition: background .3s var(--ease), color .3s; }
.tabbar a[aria-current='page'] { background: linear-gradient(110deg, var(--navy), var(--blue)); color: #fff; }

/* Encabezados con acento animado */
.page-head h1 { position: relative; }
.page-head h1::after { content: ''; display: block; width: 56px; height: 4px; margin-top: 10px; border-radius: 4px; background: linear-gradient(90deg, var(--red), var(--blue), var(--red)); background-size: 200% 100%; animation: accent 4s linear infinite; }
@keyframes accent { to { background-position: 200% 0; } }

/* Tarjetas: luz que sigue al cursor y borde degradado al pasar */
.card { position: relative; background: rgba(255, 255, 255, .92); border-color: rgba(223, 231, 240, .9); box-shadow: 0 1px 2px rgba(9, 41, 77, .04), 0 8px 24px rgba(9, 41, 77, .05); transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s; }
.card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(8, 111, 201, .08), transparent 45%); }
.card:hover::before { opacity: 1; }
.card:hover { box-shadow: 0 2px 4px rgba(9, 41, 77, .05), 0 18px 40px rgba(9, 41, 77, .09); border-color: rgba(111, 182, 245, .55); }
.course-card:hover, .stat:hover { transform: translateY(-4px); }

/* Entrada escalonada del contenido */
.page > *, .tab-panel > *, .feed > .post, .course-grid > *, .stats > * { animation: rise .6s var(--ease) both; }
.page > :nth-child(2), .stats > :nth-child(2), .course-grid > :nth-child(2), .feed > .post:nth-child(2) { animation-delay: .06s; }
.page > :nth-child(3), .stats > :nth-child(3), .course-grid > :nth-child(3), .feed > .post:nth-child(3) { animation-delay: .12s; }
.page > :nth-child(4), .stats > :nth-child(4), .course-grid > :nth-child(4) { animation-delay: .18s; }
.page > :nth-child(n+5) { animation-delay: .24s; }

/* Estadísticas con icono y número animado */
.stat { overflow: hidden; }
.stat::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(8, 111, 201, .12), transparent 70%); }
.stat strong { font-variant-numeric: tabular-nums; background: linear-gradient(120deg, var(--navy), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Iconos grandes de estados vacíos y pantallas de acceso */
.empty .big { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 26px; display: grid; place-items: center; font-size: 38px; color: var(--blue); background: linear-gradient(140deg, var(--blue-100), #fff); box-shadow: 0 12px 30px rgba(8, 111, 201, .15); animation: float 5s ease-in-out infinite; }
.state-icon { color: var(--blue); font-size: 34px; box-shadow: 0 14px 34px rgba(8, 111, 201, .18); }
.player-empty .big { font-size: 48px; color: var(--blue-300); margin: 0 auto; }
.post-actions .i, .act .i { font-size: 20px; }
.event-hero .meta .i { color: var(--blue-300); }
.tabs button .i { font-size: 17px; }
.field > label .i { color: var(--blue); margin-right: 2px; }
.lesson-list .lesson-num .i { font-size: 15px; }
.wave .i { color: #f0a020; }

/* Botones: brillo continuo suave en el principal */
.btn-red { background-image: linear-gradient(110deg, var(--red) 0%, #f0566a 50%, var(--red) 100%); background-size: 200% 100%; animation: btn-glow 5s ease-in-out infinite; }
@keyframes btn-glow { 50% { background-position: 100% 0; } }

/* Esqueletos más elegantes */
.skeleton { background: linear-gradient(100deg, #e8eff7 20%, #f7fafd 40%, #e8eff7 60%); background-size: 200% 100%; }

@media (prefers-reduced-motion: reduce) { .ambient span { animation: none; } }
.card.lesson-list { position: sticky; }
@media (max-width: 1080px) { .card.lesson-list { position: relative; } }

/* =================== Yayly =================== */
.yayly { position: fixed; right: 22px; bottom: 22px; z-index: 70; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.y-orb { position: relative; width: 72px; height: 72px; border: 0; padding: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #dfeefe 60%, #b9d9fb); cursor: pointer; box-shadow: 0 14px 36px rgba(8, 111, 201, .35), inset 0 -4px 10px rgba(8, 111, 201, .18); animation: y-breathe 4s ease-in-out infinite; transition: transform .3s var(--ease); }
.y-orb:hover { transform: scale(1.08) rotate(-4deg); }
.y-orb img { width: 100%; height: 100%; border-radius: 50%; position: relative; z-index: 1; animation: y-spin 18s linear infinite; }
.y-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(8, 111, 201, .35); animation: y-ring 2.8s var(--ease) infinite; }
.y-ring.r2 { border-color: rgba(230, 57, 70, .3); animation-delay: 1.4s; }
.y-label { position: absolute; z-index: 2; left: 50%; bottom: -10px; transform: translateX(-50%); background: #fff; color: var(--navy); font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; box-shadow: var(--shadow-sm); white-space: nowrap; }
.yayly.open .y-orb { animation: none; }
.yayly.open .y-ring { display: none; }
@keyframes y-breathe { 50% { box-shadow: 0 18px 46px rgba(8, 111, 201, .5), 0 0 0 10px rgba(8, 111, 201, .06), inset 0 -4px 10px rgba(8, 111, 201, .18); } }
@keyframes y-spin { to { transform: rotate(360deg); } }
@keyframes y-ring { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }

.y-panel { width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100svh - 140px)); display: flex; flex-direction: column; background: rgba(255, 255, 255, .94); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); border: 1px solid rgba(223, 231, 240, .9); border-radius: 26px; box-shadow: 0 30px 80px rgba(4, 26, 51, .28); overflow: hidden; transform-origin: bottom right; transform: scale(.85) translateY(20px); opacity: 0; pointer-events: none; transition: transform .4s var(--ease), opacity .3s; }
.yayly.open .y-panel { transform: none; opacity: 1; pointer-events: auto; }
.y-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; color: #fff; background: radial-gradient(300px 120px at 90% 0%, rgba(26, 134, 232, .7), transparent), linear-gradient(130deg, var(--navy-950), var(--navy) 60%, #0b4a86); }
.y-head > div:nth-child(2) { flex: 1; min-width: 0; }
.y-head strong { display: block; font-size: 17px; }
.y-head small { display: flex; align-items: center; gap: 6px; color: #a9c3dd; font-size: 12.5px; }
.y-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ee08f; box-shadow: 0 0 0 3px rgba(62, 224, 143, .25); }
.y-orb-mini { width: 42px; height: 42px; border-radius: 50%; background: #fff; padding: 2px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .15); }
.y-orb-mini img { width: 100%; height: 100%; border-radius: 50%; }
.y-icon { width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.y-icon:hover { background: rgba(255, 255, 255, .2); }
.y-context { padding: 8px 16px; font-size: 13px; font-weight: 700; color: var(--blue); background: var(--blue-100); display: flex; gap: 6px; align-items: center; }
.y-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.y-msg { display: flex; gap: 8px; align-items: flex-end; animation: rise .35s var(--ease); max-width: 100%; }
.y-user { justify-content: flex-end; }
.y-avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.y-bubble { padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.55; max-width: 85%; overflow-wrap: anywhere; }
.y-assistant .y-bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; color: var(--ink); }
.y-user .y-bubble { background: linear-gradient(130deg, var(--blue), #0b5fb0); color: #fff; border-bottom-right-radius: 6px; white-space: pre-line; }
.y-bubble p { margin: 0 0 6px; } .y-bubble p:last-child { margin: 0; }
.y-bubble ul { margin: 4px 0 6px; padding-left: 18px; } .y-bubble li { margin-bottom: 3px; }
.y-bubble strong { color: var(--navy); }
.y-error { color: var(--red-600); }
.y-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.y-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-300); animation: y-dots 1.2s infinite; }
.y-typing i:nth-child(2) { animation-delay: .15s; } .y-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes y-dots { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.y-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.y-chip { border: 1.5px solid #cfe2f5; background: #fff; color: var(--blue); font-weight: 700; font-size: 13px; padding: 7px 12px; border-radius: 999px; cursor: pointer; text-align: left; transition: all .2s; }
.y-chip:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.y-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
.y-form textarea { flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 16px; padding: 11px 14px; font: inherit; font-size: 15px; max-height: 120px; color: var(--ink); }
.y-form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(8, 111, 201, .12); }
.y-send { width: 46px; height: 46px; flex-shrink: 0; border: 0; border-radius: 50%; color: #fff; cursor: pointer; background: linear-gradient(130deg, var(--red), #f0566a); box-shadow: 0 8px 20px rgba(230, 57, 70, .35); transition: transform .2s; display: grid; place-items: center; }
.y-send:hover { transform: scale(1.06); } .y-send:disabled { opacity: .5; transform: none; }
.y-soon { padding: 14px 16px; margin: 0; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); background: var(--bg); }
.y-note { margin: 0; padding: 6px 12px 10px; font-size: 11.5px; color: var(--muted); text-align: center; background: #fff; }
.yayly-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; margin-top: 22px; border-radius: 20px; color: #fff; background: radial-gradient(400px 160px at 90% 0%, rgba(26, 134, 232, .55), transparent), linear-gradient(120deg, var(--navy-950), var(--navy)); }
.yayly-cta img { width: 54px; height: 54px; border-radius: 50%; animation: y-spin 18s linear infinite; }
.yayly-cta > div { display: flex; align-items: center; gap: 14px; }
.yayly-cta strong { display: block; font-size: 17px; } .yayly-cta p { color: #a9c3dd; font-size: 14px; }
@media (max-width: 860px) {
  .yayly { right: 14px; bottom: 96px; }
  .y-orb { width: 60px; height: 60px; }
  .y-panel { height: min(560px, calc(100svh - 190px)); }
  .yayly-cta { flex-direction: column; align-items: stretch; }
}
.code { background: var(--navy-950); color: #cfe6ff; padding: 14px 16px; border-radius: 12px; font-size: 13px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

/* =================== Pagos, suscripción y consultas =================== */
.plan-card { padding: 28px; position: relative; overflow: hidden; }
.plan-card::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(230, 57, 70, .12), transparent 70%); }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 14px; }
.plan-price strong { font-size: 52px; font-weight: 800; letter-spacing: -.04em; background: linear-gradient(120deg, var(--navy), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.plan-price span { color: var(--muted); font-weight: 700; }
.plan-status { display: grid; gap: 8px; justify-items: start; padding: 14px; border-radius: 14px; background: var(--bg); margin-bottom: 16px; }
.plan-status p { color: var(--ink); font-size: 14.5px; }
.plan-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.plan-list li { display: flex; gap: 10px; align-items: center; font-weight: 650; color: var(--navy); }
.plan-list .i { color: var(--blue); width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--blue-100); box-sizing: border-box; -webkit-mask: none; mask: none; background-image: none; position: relative; }
.plan-list .i::before { content: ''; position: absolute; inset: 8px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.paywall { text-align: center; padding: 40px 28px; max-width: 620px; margin: 0 auto; }
.paywall h2 { font-size: 26px; margin-bottom: 10px; }
.paywall > p { color: var(--muted); margin-bottom: 18px; }
.paywall .plan-list { max-width: 380px; margin: 0 auto 24px; text-align: left; }
.paywall-badge { width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 24px; display: grid; place-items: center; font-size: 34px; color: #fff; background: linear-gradient(140deg, var(--red), #f0566a); box-shadow: 0 14px 34px rgba(230, 57, 70, .35); animation: float 5s ease-in-out infinite; }
.quota { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.quota-card { display: flex; gap: 14px; align-items: center; padding: 18px 20px; }
.quota-card > .i { font-size: 26px; color: var(--blue); }
.quota-card strong { display: block; font-size: 20px; color: var(--navy); }
.quota-card span { color: var(--muted); font-size: 13.5px; }
.consult { padding: 18px 20px; margin-bottom: 12px; }
.consult header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.consult header small { color: var(--muted); }
.consult-q { white-space: pre-line; overflow-wrap: anywhere; color: var(--ink); }
.consult-a { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--blue-100); display: grid; gap: 6px; justify-items: start; }
.consult-a strong { color: var(--blue); display: flex; gap: 6px; align-items: center; }
.consult-a p { white-space: pre-line; color: var(--ink); }
.consult-admin { padding: 18px 0; border-bottom: 1px solid var(--line); }
.consult-admin header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.success-card .big { color: var(--ok) !important; background: linear-gradient(140deg, var(--ok-100), #fff) !important; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 99; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: confetti linear forwards; }
@keyframes confetti { to { transform: translateY(110vh) rotate(720deg); opacity: .8; } }
@media (max-width: 860px) { .quota { grid-template-columns: 1fr; } .plan-price strong { font-size: 44px; } }

/* =================== Saldo de IA =================== */
.credit-card { margin-bottom: 22px; position: relative; overflow: hidden; }
.credit-card::after { content: ''; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(19, 138, 91, .14), transparent 70%); pointer-events: none; }
.credit-low::after { background: radial-gradient(circle, rgba(240, 160, 32, .2), transparent 70%); }
.credit-empty::after { background: radial-gradient(circle, rgba(230, 57, 70, .2), transparent 70%); }
.credit-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; position: relative; z-index: 1; }
.credit-amount { display: flex; align-items: baseline; gap: 10px; }
.credit-amount strong { font-size: 46px; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--ok); }
.credit-low .credit-amount strong { color: var(--warn); }
.credit-empty .credit-amount strong { color: var(--red-600); }
.credit-amount span { color: var(--muted); font-weight: 700; }
.credit-bar { height: 12px; border-radius: 12px; background: var(--bg); overflow: hidden; margin-bottom: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.credit-bar span { display: block; height: 100%; border-radius: 12px; background: linear-gradient(90deg, #1fb57a, var(--ok)); transition: width 1.2s var(--ease); }
.credit-low .credit-bar span { background: linear-gradient(90deg, #f0a020, #e07b10); }
.credit-empty .credit-bar span { background: var(--red); }
.credit-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.credit-stats div { padding: 12px 14px; border-radius: 12px; background: var(--bg); }
.credit-stats span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.credit-stats strong { font-size: 19px; color: var(--navy); }
.credit-form { padding: 16px; border-radius: 14px; border: 1.5px dashed #c9d8e8; margin-bottom: 14px; }
.credit-form p { margin-bottom: 10px; font-size: 14.5px; }
.credit-inputs { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; }
.credit-history { margin-bottom: 12px; }
.credit-history summary { cursor: pointer; font-weight: 750; color: var(--blue); margin-bottom: 8px; }
.credit-banner { align-items: center; }
.credit-banner span { flex: 1; }
@media (max-width: 860px) { .credit-inputs, .credit-stats { grid-template-columns: 1fr; } .credit-amount strong { font-size: 38px; } }
@media (max-width: 860px) {
  .tabbar { grid-template-columns: repeat(var(--tabs, 3), minmax(0, 1fr)); gap: 2px; }
  .tabbar a { padding: 8px 2px; min-width: 0; }
  .tabbar a span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
}
