/* ============================================
   MANANTIALES · FORMACIÓN Y DISCIPULADO
   Design System — DM Serif Display + DM Sans
   ============================================ */

:root {
  --teal: #007A8A;
  --teal-2: #00A8BC;
  --teal-3: #CCF0F4;
  --teal-4: #E8F8FA;
  --sand: #C4B99A;
  --sand-2: #EDE7D6;
  --sand-3: #F7F3EB;
  --dark: #1A1A18;
  --dark-2: #2D2D2A;
  --dark-3: #3F3F3A;
  --muted: #7A7570;
  --muted-2: #A09B94;
  --ok: #1A8F5A;
  --ok-bg: #E6F7EF;
  --warn: #92650A;
  --warn-bg: #FEF3DC;
  --error: #C0392B;
  --error-bg: #FDECEA;
  --info: #0A6E8A;
  --info-bg: #E0F4F8;
  --pink: #A0005C;
  --pink-bg: #FCE8F2;
  --white: #FFFFFF;
  --bg: #F4F0E8;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-sm: 0 2px 8px rgba(26,26,24,.06);
  --shadow-md: 0 8px 24px rgba(26,26,24,.08);
  --shadow-lg: 0 20px 48px rgba(26,26,24,.12);
  --shadow-xl: 0 32px 64px rgba(26,26,24,.16);
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--dark);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.05; margin: 0; }
h2 { font-size: 1.8rem; line-height: 1.2; margin: 0 0 8px; }
h3 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 6px; }
p { margin: 0; color: var(--muted); line-height: 1.65; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ========= PORTAL ========= */
.portal-body {
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}
.portal-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.portal-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}
.orb-1 { width: 600px; height: 600px; background: radial-gradient(circle, #007A8A 0%, transparent 70%); top: -200px; left: -200px; }
.orb-2 { width: 500px; height: 500px; background: radial-gradient(circle, #C4B99A 0%, transparent 70%); bottom: -150px; right: -150px; }
.orb-3 { width: 400px; height: 400px; background: radial-gradient(circle, #00A8BC 0%, transparent 70%); top: 50%; left: 60%; }

.portal-wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Portal Header */
.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
}
.portal-brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 0 8px 20px rgba(0,122,138,.25);
  flex-shrink: 0;
}
.brand-name { display: block; font-family: var(--font-display); font-size: 1.1rem; color: var(--dark); }
.brand-sub { display: block; font-size: .82rem; color: var(--muted); }
.portal-badge {
  background: var(--teal-4);
  color: var(--teal);
  border: 1px solid rgba(0,122,138,.2);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
}

/* Hero */
.portal-hero {
  padding: 60px 0 48px;
}
.hero-title {
  color: var(--dark);
  margin-bottom: 20px;
}
.hero-title em {
  font-style: italic;
  color: var(--teal);
}
.hero-desc {
  font-size: 1.1rem;
  max-width: 600px;
  margin-bottom: 28px;
}
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hpill {
  background: white;
  border: 1px solid rgba(26,26,24,.1);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--dark-2);
  box-shadow: var(--shadow-sm);
}
.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 48px;
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(26,26,24,.06);
  width: fit-content;
  flex-wrap: wrap;
}
.hstat { text-align: center; padding: 0 28px; }
.hstat strong { display: block; font-family: var(--font-display); font-size: 1.4rem; color: var(--teal); }
.hstat span { font-size: .88rem; color: var(--muted); }
.hstat-div { width: 1px; height: 40px; background: rgba(26,26,24,.1); }

/* Sections */
.portal-section { padding: 48px 0; }
.section-title { font-size: 2rem; margin-bottom: 8px; color: var(--dark); }
.section-sub { color: var(--muted); font-size: 1rem; margin-bottom: 36px; max-width: 640px; }

/* Flow steps */
.flow-steps {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
}
.flow-step {
  flex: 1; min-width: 200px;
  background: white;
  border: 1px solid rgba(26,26,24,.07);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.flow-step:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); transition: .2s; }
.flow-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--teal-3);
  line-height: 1;
  margin-bottom: 12px;
}
.flow-step h3 { color: var(--dark); font-size: 1rem; font-family: var(--font-body); font-weight: 700; }
.flow-arrow {
  display: flex; align-items: center; padding: 0 12px;
  color: var(--sand); font-size: 1.6rem;
}

/* Role groups */
.role-group { margin-bottom: 36px; }
.role-group-label {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 14px;
  padding-left: 2px;
}
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.user-card {
  background: white;
  border: 1px solid rgba(26,26,24,.08);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: all .2s;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.user-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--teal-2);
}
.user-card-top { display: flex; align-items: center; gap: 12px; }
.uc-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-3), var(--teal-4));
  border: 2px solid var(--teal-3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem; color: var(--teal);
  flex-shrink: 0;
}
.uc-info strong { display: block; font-size: .95rem; color: var(--dark); }
.user-card p { font-size: .85rem; color: var(--muted); line-height: 1.5; }
.user-card-actions { display: flex; gap: 8px; margin-top: auto; }
.btn-card {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(26,26,24,.1);
  background: var(--sand-3);
  color: var(--dark);
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: .15s;
}
.btn-card.primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(0,122,138,.2);
}
.btn-card:hover { filter: brightness(1.05); }

/* Reg cards */
.reg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.reg-card {
  background: white;
  border: 1px solid rgba(26,26,24,.08);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.reg-icon { font-size: 2rem; margin-bottom: 12px; }
.reg-card h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; color: var(--dark); }
.reg-card p { font-size: .9rem; margin: 8px 0 16px; }
.reg-card code {
  background: var(--teal-4);
  color: var(--teal);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .9em;
}

/* Buttons */
.btn-demo {
  background: var(--teal-4);
  color: var(--teal);
  border: 1px solid rgba(0,122,138,.2);
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: .15s;
}
.btn-demo:hover { background: var(--teal-3); }
.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  color: white;
  border: none;
  padding: 13px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: .15s;
  box-shadow: 0 6px 16px rgba(0,122,138,.25);
  width: 100%;
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-secondary {
  background: white;
  color: var(--muted);
  border: 1px solid rgba(26,26,24,.1);
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: .15s;
  width: 100%;
  margin-top: 10px;
}
.btn-approve {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid rgba(26,143,90,.2);
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.btn-reject {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(192,57,43,.2);
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,26,24,.55);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: white;
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-xl);
}
.modal-close {
  position: absolute; top: 16px; right: 20px;
  background: var(--sand-3); border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: .9rem;
  color: var(--muted);
}
.modal-box h2 { margin-bottom: 4px; }
.modal-sub { color: var(--muted); margin-bottom: 24px; font-size: .93rem; }
.reg-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-weight: 600; font-size: .88rem; color: var(--dark-2); }
.form-group input, .form-group select, .form-group textarea {
  border: 1.5px solid rgba(26,26,24,.12);
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--sand-3);
  color: var(--dark);
  transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--teal-2);
  background: white;
}
.form-hint { font-size: .82rem; color: var(--muted); }
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-opt { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--dark-2); cursor: pointer; }
.step-header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.step-icon { font-size: 2rem; }
.step-success { text-align: left; }
.step-success.center { text-align: center; }
.success-icon {
  width: 64px; height: 64px;
  background: var(--ok-bg);
  color: var(--ok);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700;
  margin: 0 auto 16px;
}
.leader-preview {
  background: var(--sand-3);
  border: 1px solid rgba(26,26,24,.08);
  border-radius: 14px;
  padding: 16px;
  margin: 12px 0;
}
.info-box {
  background: var(--info-bg);
  color: var(--info);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: .9rem;
  margin-top: 16px;
}

/* Code demo */
.code-demo { margin: 20px 0; }
.code-card {
  background: var(--dark);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  margin-bottom: 20px;
}
.code-label { color: rgba(255,255,255,.6); font-size: .82rem; margin-bottom: 12px; }
.code-display {
  font-family: 'Courier New', monospace;
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  letter-spacing: .08em;
  margin-bottom: 16px;
}
.code-display span { color: var(--teal-2); }
.code-features { display: flex; flex-direction: column; gap: 12px; }
.code-feat { display: flex; gap: 12px; align-items: flex-start; }
.feat-icon { font-size: 1.2rem; }
.code-feat strong { display: block; font-size: .9rem; }
.code-feat p { font-size: .85rem; }
.code-format-explain { margin-top: 20px; }
.code-format-explain h4 { font-family: var(--font-body); font-weight: 700; margin-bottom: 12px; }
.format-parts { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.format-part { text-align: center; padding: 8px 12px; background: var(--sand-3); border-radius: 10px; }
.fp-val { display: block; font-family: monospace; font-size: 1.1rem; font-weight: 700; color: var(--dark); }
.fp-label { display: block; font-size: .75rem; color: var(--muted); margin-top: 2px; }
.format-sep { font-size: 1.4rem; color: var(--muted); font-weight: 700; }

/* Validation flow */
.val-flow { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.val-step { display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: var(--sand-3); border-radius: 12px; }
.val-step strong { font-size: .9rem; display: block; }
.val-step p { font-size: .85rem; }
.val-num {
  width: 32px; height: 32px;
  background: var(--teal);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}
.val-preview { margin-top: 20px; }
.val-preview h4 { font-family: var(--font-body); font-weight: 700; margin-bottom: 12px; }
.val-card { background: var(--sand-3); border-radius: 14px; padding: 18px; }
.val-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.avatar-sm {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--teal-3);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
}
.val-card-header strong { font-size: .95rem; }
.tag-pending { background: var(--warn-bg); color: var(--warn); padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; margin-left: auto; }
.val-details { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.val-details span { background: white; padding: 5px 10px; border-radius: 8px; font-size: .82rem; color: var(--dark-2); }
.val-actions { display: flex; gap: 10px; }

/* Portal footer */
.portal-footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid rgba(26,26,24,.08);
  margin-top: 20px;
}
.portal-footer p { font-family: var(--font-display); font-size: 1rem; color: var(--muted); }
.footer-sub { font-family: var(--font-body); font-size: .82rem; margin-top: 6px; }

/* Tags/badges */
.tag {
  display: inline-flex; align-items: center;
  padding: 5px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700;
  border: 1px solid transparent;
}
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-error { background: var(--error-bg); color: var(--error); }
.tag-info { background: var(--info-bg); color: var(--info); }
.tag-pink { background: var(--pink-bg); color: var(--pink); }
.tag-ep { background: var(--pink-bg); color: var(--pink); padding: 3px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.role-tag { padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }

/* ============ APP SHELL ============ */
.app-body { background: #F0EBE0; min-height: 100vh; }
.mobile-bar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: white;
  border-bottom: 1px solid rgba(26,26,24,.08);
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.mb-brand { display: flex; align-items: center; gap: 10px; }
.brand-mark-sm {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: .95rem;
}
.mb-brand span { font-weight: 700; font-size: .95rem; }
.mb-exit { background: var(--sand-3); border: 1px solid rgba(26,26,24,.1); padding: 7px 14px; border-radius: 10px; font-weight: 600; font-size: .85rem; color: var(--muted); cursor: pointer; }

.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid rgba(26,26,24,.08);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 18px 16px;
  border-bottom: 1px solid rgba(26,26,24,.06);
}
.sidebar-church { font-family: var(--font-display); font-size: 1.05rem; color: var(--dark); }
.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(26,26,24,.06);
  background: var(--sand-3);
}
.sidebar-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem;
  flex-shrink: 0;
}
.sidebar-user-info strong { display: block; font-size: .9rem; }
.sidebar-user-info span { font-size: .8rem; color: var(--muted); }
.sidebar-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: .15s;
  font-size: .9rem;
  color: var(--muted);
  border: none; background: transparent;
  text-align: left;
  width: 100%;
}
.nav-item .nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }
.nav-item:hover { background: var(--sand-3); color: var(--dark); }
.nav-item.active { background: var(--teal-4); color: var(--teal); font-weight: 700; }
.nav-badge { margin-left: auto; background: var(--pink-bg); color: var(--pink); padding: 2px 7px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.sidebar-footer { padding: 14px 18px; border-top: 1px solid rgba(26,26,24,.06); }
.sidebar-exit { background: none; border: 1px solid rgba(26,26,24,.1); width: 100%; padding: 9px; border-radius: 10px; color: var(--muted); font-size: .85rem; cursor: pointer; }

.app-main { flex: 1; min-width: 0; padding: 28px; }

/* Loading */
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 50vh; gap: 14px; color: var(--muted); }
.loading-spinner { width: 36px; height: 36px; border: 3px solid var(--sand-2); border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ SCREENS ============ */
.screen-header { margin-bottom: 24px; }
.screen-header h1 { font-size: 1.8rem; }
.screen-header p { font-size: .95rem; margin-top: 4px; }

/* Cards */
.cards-grid { display: grid; gap: 14px; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: white;
  border: 1px solid rgba(26,26,24,.07);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-accent {
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  color: white;
}
.card-accent h3, .card-accent p { color: rgba(255,255,255,.9); }
.kpi-card { display: flex; flex-direction: column; gap: 4px; }
.kpi-value { font-family: var(--font-display); font-size: 2.2rem; color: var(--dark); line-height: 1; }
.kpi-label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.kpi-sub { font-size: .8rem; color: var(--muted-2); margin-top: 2px; }

/* Section within screen */
.screen-section { margin-bottom: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-head h2 { font-size: 1.1rem; font-family: var(--font-body); font-weight: 700; color: var(--dark); margin: 0; }
.section-head-link { font-size: .85rem; color: var(--teal); font-weight: 600; cursor: pointer; background: none; border: none; }

/* List */
.item-list { display: flex; flex-direction: column; gap: 2px; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  transition: .15s;
  background: white;
  border: 1px solid rgba(26,26,24,.06);
  cursor: default;
}
.list-item:hover { background: var(--sand-3); }
.li-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--teal-4);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  flex-shrink: 0;
}
.li-info { flex: 1; min-width: 0; }
.li-info strong { display: block; font-size: .9rem; }
.li-info span { font-size: .8rem; color: var(--muted); }
.li-right { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }

/* Progress bar */
.progress-bar { height: 8px; background: var(--sand-2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--teal-2)); transition: width .4s; }
.progress-fill.fill-warn { background: linear-gradient(90deg, #D4860A, #F0A020); }
.progress-fill.fill-error { background: linear-gradient(90deg, var(--error), #E05050); }

/* Video player */
.video-player {
  background: linear-gradient(160deg, #1A1A18, #2D2D2A);
  border-radius: var(--radius-lg);
  padding: 24px;
  color: white;
}
.video-player-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.vp-title { font-size: 1.05rem; font-weight: 700; }
.vp-meta { font-size: .82rem; color: rgba(255,255,255,.6); margin-top: 2px; }
.video-screen {
  background: #111;
  border-radius: 14px;
  height: 240px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,.06);
}
.video-screen-bg {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(0,168,188,.15), transparent 60%);
}
.play-btn {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative; z-index: 1;
  transition: .2s;
  font-size: 1.5rem;
  padding: 0;
  color: white;
  backdrop-filter: blur(4px);
}
.play-btn:hover { background: rgba(255,255,255,.2); transform: scale(1.05); }
.video-progress { margin-bottom: 10px; }
.vp-bar { height: 6px; background: rgba(255,255,255,.15); border-radius: 999px; overflow: hidden; cursor: pointer; }
.vp-fill { height: 100%; background: linear-gradient(90deg, var(--teal-2), #5DE0EA); transition: width .3s; }
.vp-info { display: flex; justify-content: space-between; font-size: .8rem; color: rgba(255,255,255,.6); margin-top: 6px; }
.vp-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.vp-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.85);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
}
.vp-btn:hover { background: rgba(255,255,255,.15); }
.vp-btn.vp-warn { border-color: rgba(240,160,32,.4); background: rgba(240,160,32,.1); color: #F0C060; }
.vp-alerts { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.vp-alert { padding: 8px 12px; border-radius: 10px; font-size: .82rem; display: flex; align-items: center; gap: 8px; }
.vp-alert.jump { background: rgba(240,160,32,.15); color: #D4A020; border: 1px solid rgba(240,160,32,.2); }
.vp-alert.hidden { background: rgba(160,0,92,.1); color: #C0508A; border: 1px solid rgba(160,0,92,.15); }

/* Questions */
.questions-section { margin-top: 20px; }
.question-block { margin-bottom: 16px; }
.question-block label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 8px; color: var(--dark); }
.question-block textarea, .question-block input {
  width: 100%;
  border: 1.5px solid rgba(26,26,24,.12);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--sand-3);
  color: var(--dark);
  resize: vertical;
}
.question-block textarea { min-height: 80px; }
.question-block textarea:focus, .question-block input:focus { outline: none; border-color: var(--teal-2); background: white; }
.question-block textarea:disabled, .question-block input:disabled { opacity: .5; cursor: not-allowed; }
.question-locked {
  background: var(--warn-bg);
  border: 1px solid rgba(146,101,10,.15);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--warn);
  font-size: .88rem;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}

/* Review thread */
.review-thread { display: flex; flex-direction: column; gap: 10px; }
.rt-entry {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--sand-3);
  border-left: 3px solid var(--sand);
}
.rt-entry.envio { border-left-color: var(--info); background: var(--info-bg); }
.rt-entry.aprobado { border-left-color: var(--ok); background: var(--ok-bg); }
.rt-entry.observado { border-left-color: var(--warn); background: var(--warn-bg); }
.rt-actor { font-weight: 700; font-size: .85rem; margin-bottom: 3px; }
.rt-text { font-size: .88rem; color: var(--dark-2); }

/* Review actions */
.review-action-box {
  background: white;
  border: 1px solid rgba(26,26,24,.08);
  border-radius: var(--radius-md);
  padding: 20px;
}
.review-action-box h3 { font-family: var(--font-body); font-weight: 700; font-size: 1rem; margin-bottom: 12px; }
.review-actions-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.btn-approve-action {
  background: var(--ok-bg); color: var(--ok);
  border: 1px solid rgba(26,143,90,.2);
  padding: 10px 18px; border-radius: 10px;
  font-weight: 700; font-size: .9rem; cursor: pointer;
}
.btn-observe-action {
  background: var(--warn-bg); color: var(--warn);
  border: 1px solid rgba(146,101,10,.2);
  padding: 10px 18px; border-radius: 10px;
  font-weight: 700; font-size: .9rem; cursor: pointer;
}
.btn-send-review {
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  color: white; border: none;
  padding: 12px 22px; border-radius: 12px;
  font-weight: 700; font-size: .95rem; cursor: pointer;
}

/* Team person cards */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.person-card {
  background: white;
  border: 1px solid rgba(26,26,24,.07);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.person-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pc-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--teal-4);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}
.pc-info strong { display: block; font-size: .92rem; }
.pc-info .role-chip { font-size: .78rem; color: var(--muted); }
.pc-stats { display: flex; flex-direction: column; gap: 8px; }
.pc-stat-row { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; }
.pc-stat-row span:first-child { color: var(--muted); }
.btn-review-person {
  margin-top: 12px;
  width: 100%;
  padding: 9px;
  border-radius: 10px;
  background: var(--teal-4);
  color: var(--teal);
  border: 1px solid rgba(0,122,138,.15);
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
}

/* Cascade view */
.cascade-chain {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.chain-node {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  border: 1px solid rgba(26,26,24,.07);
  border-radius: 12px;
}
.chain-node.top { background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: white; }
.chain-node.top .li-info strong, .chain-node.top .li-info span { color: rgba(255,255,255,.9); }
.chain-connector { width: 2px; height: 16px; background: var(--sand); margin-left: 29px; }

/* Stats */
.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.stat-item { flex: 1; min-width: 120px; background: white; border-radius: 14px; padding: 16px; border: 1px solid rgba(26,26,24,.06); }

/* Modules timeline */
.modules-list { display: flex; flex-direction: column; gap: 10px; }
.module-item {
  background: white;
  border: 1px solid rgba(26,26,24,.07);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  cursor: pointer;
  transition: .15s;
}
.module-item:hover { box-shadow: var(--shadow-md); }
.mi-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--teal-4);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.mi-info { flex: 1; min-width: 180px; }
.mi-info strong { display: block; font-size: .95rem; color: var(--dark); }
.mi-info span { font-size: .82rem; color: var(--muted); }
.mi-progress { flex: 0 0 140px; }
.mi-right { flex-shrink: 0; }

/* Admin users table */
.users-table { background: white; border-radius: var(--radius-md); border: 1px solid rgba(26,26,24,.07); overflow: hidden; }
.table-header { display: grid; grid-template-columns: 1fr 1fr 1fr 100px; padding: 10px 16px; background: var(--sand-3); font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.table-row { display: grid; grid-template-columns: 1fr 1fr 1fr 100px; padding: 12px 16px; border-top: 1px solid rgba(26,26,24,.05); align-items: center; font-size: .88rem; }
.table-row:hover { background: var(--sand-3); }

/* Alerts */
.alerts-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: white;
  border-radius: 12px;
  border-left: 4px solid var(--sand);
  border-top: 1px solid rgba(26,26,24,.06);
  border-right: 1px solid rgba(26,26,24,.06);
  border-bottom: 1px solid rgba(26,26,24,.06);
}
.alert-item.alert-warn { border-left-color: #D4860A; background: #FFFBF2; }
.alert-item.alert-error { border-left-color: var(--error); background: var(--error-bg); }
.alert-item.alert-info { border-left-color: var(--teal); background: var(--teal-4); }
.alert-icon { font-size: 1.3rem; }
.alert-info-text { flex: 1; }
.alert-info-text strong { display: block; font-size: .9rem; }
.alert-info-text span { font-size: .82rem; color: var(--muted); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--dark);
  color: white;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  z-index: 9999;
  transition: transform .3s, opacity .3s;
  opacity: 0;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Mobile bottom nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-top: 1px solid rgba(26,26,24,.08);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(26,26,24,.08);
  gap: 4px;
}
.mbn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  border-radius: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  transition: .15s;
}
.mbn-item.active { color: var(--teal); background: var(--teal-4); }
.mbn-icon { font-size: 1.2rem; line-height: 1; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 10px; }
.empty-state p { font-size: .9rem; }

/* Responsive */
@media (max-width: 900px) {
  .app-sidebar { display: none; }
  .mobile-bar { display: flex; }
  .mobile-bottom-nav { display: flex; }
  .app-main { padding: 76px 16px 90px; }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .cards-3 { grid-template-columns: repeat(2, 1fr); }
  .cards-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .table-header, .table-row { grid-template-columns: 1fr 1fr 80px; }
  .table-header > *:nth-child(3), .table-row > *:nth-child(3) { display: none; }
}
@media (max-width: 600px) {
  .portal-wrap { padding: 0 16px 60px; }
  .hero-stats { flex-direction: column; padding: 16px 20px; }
  .hstat-div { width: 100%; height: 1px; }
  .hstat { padding: 12px 0; }
  .flow-steps { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); justify-content: center; }
  .cards-4, .cards-3 { grid-template-columns: repeat(2, 1fr); }
  .modal-box { padding: 24px 20px; }
}
