/* ============================================================
   RENEW SOLAR – Mobile Sales App
   Design System & Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
/* Dashboard Background Watermark */
#screen-dashboard::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  max-width: 90vw;
  max-height: 80vh;
  background-image: url('../assets/images/renew copia logo.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.08 !important; /* Increased from 0.035 */
  pointer-events: none;
  z-index: -1 !important;
  filter: grayscale(1);
  mix-blend-mode: multiply; /* Changed from luminosity for better contrast in light mode */
}

body.dark-theme #screen-dashboard::after {
  opacity: 0.12 !important; /* Increased from 0.07 */
  filter: grayscale(1) brightness(0.4); /* Increased brightness from 0.1 */
  mix-blend-mode: screen; /* Changed for better glow effect in dark mode */
}



:root {
  --primary: #00dfbf;
  --primary-dark: #00bfa3;
  --primary-light: #ccfbf1;
  --primary-glow: rgba(13, 148, 136, 0.18);

  --accent: #05d564;
  --accent-dark: #04b353;

  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;

  --text-primary: #0b1120;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --purple: #8b5cf6;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --shadow-fab: 0 6px 24px rgba(13,148,136,.45);

  --transition: all .22s cubic-bezier(.4,0,.2,1);
  --transition-slow: all .35s cubic-bezier(.4,0,.2,1);

  --header-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

/* ── Dark Theme ────────────────────────────────────────────── */
body.dark-theme {
  --bg: #000000;
  --surface: #121212;
  --surface-alt: #1e1e1e;
  --border: #2a2a2a;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.6);
}

body.dark-theme .nav-item:not(.active) { color: var(--text-secondary); }
body.dark-theme .menu-card, body.dark-theme .menu-list { background: #181818; }
body.dark-theme .stat-chip { background: #181818 !important; }
body.dark-theme .card, body.dark-theme .info-card { background: #121212; border-color: #2a2a2a; }

/* ── Hidden Utilities ───────────────────────────────────── */
.desktop-only { display: none !important; }
.nuclear-hidden { display: none !important; }

/* ── Theme Icons ────────────────────────────────────────── */
.nav-btn-theme { cursor: pointer; background: none; border: none; color: var(--text-secondary); }
.sun-icon { display: block; }
.moon-icon { display: none; }
body.dark-theme .sun-icon { display: none; }
body.dark-theme .moon-icon { display: block; }

/* ── Common Utilities ───────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.hidden { display: none !important; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.pt-6 { padding-top: 24px; }
.pt-8 { padding-top: 32px; }
.pb-24 { padding-bottom: 96px; }
.mt-2 { margin-top: 8px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-8 { margin-bottom: 32px; }
.text-white { color: #ffffff; }
.text-2xl { font-size: 1.5rem; }
.font-bold { font-weight: 700; }
.animate-fadeIn { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Screen System (SPA Router) ────────────────────────────── */
.screen { display: none; min-height: 100dvh; flex-direction: column; animation: fadeSlideIn .28s cubic-bezier(.4,0,.2,1) both; }
.screen.active { display: flex; }

/* ── iframe-based full-screen sections ── */
.iframe-screen.active {
  position: fixed !important;
  inset: 0 !important;
  z-index: 200 !important;
  background: var(--bg) !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: unset !important;
  height: 100dvh !important;
  overflow: hidden !important;
}
.iframe-screen-frame {
  flex: 1;
  border: none;
  width: 100%;
  /* height:0 + flex:1 forces the iframe to grow to fill remaining flex space */
  height: 0;
  min-height: 0;
  display: block;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(60px); }
}
.slide-in-right { animation: slideInRight .3s cubic-bezier(.4,0,.2,1) both; }
.slide-in-left  { animation: slideInLeft  .3s cubic-bezier(.4,0,.2,1) both; }

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.animate-sheetUp {
  animation: sheetUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.animate-slide-up {
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── App Container (max-width phone) ─────────────────────────── */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
  overflow-x: hidden; /* Prevent horizontal scroll within app */
}

/* ═══════════════════════════════════════════════════════════
   SCREEN 1 – LOGIN
   ═══════════════════════════════════════════════════════════ */
#screen-login {
  background: radial-gradient(circle at top left, #f0fdfa 0%, #f8fafc 40%, #ecfdf5 100%);
  justify-content: center;
  align-items: center;
  padding: 40px 24px;
  gap: 0;
  overflow: hidden;
}

.login-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 44px;
}
.login-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 20px;
  filter: drop-shadow(0 8px 24px rgba(0, 223, 191, 0.2));
  transition: transform 0.3s ease;
}
.login-logo:hover { transform: scale(1.05); }

.login-brand {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  margin-bottom: 2px;
}
.login-tagline {
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 4px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 32px;
  padding: 40px 32px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 1;
}
.login-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, rgba(0, 223, 191, 0.2), rgba(5, 213, 100, 0.1));
  border-radius: inherit;
  z-index: -1;
  opacity: 0.5;
}
.login-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.login-card p {
  font-size: .875rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* ── Form Fields ─────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.field-group label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.input-wrap { position: relative; }
.input-wrap svg.input-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
  transition: all 0.2s ease;
}
.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  width: 100%;
  padding: 16px 16px 16px 48px;
  border: 2px solid var(--border);
  border-radius: 16px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--surface-alt);
  transition: all 0.2s ease;
  outline: none;
  appearance: none;
  position: relative;
  z-index: 1;
}
.input-wrap input:focus,
.input-wrap select:focus,
.input-wrap textarea:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  transform: translateY(-1px);
}

/* Sincronizar el icono con el movimiento del input al hacer focus */
.input-wrap input:focus + svg.input-icon,
.input-wrap select:focus + svg.input-icon,
.input-wrap textarea:focus + svg.input-icon {
  transform: translateY(calc(-50% - 1px));
  color: var(--primary);
}

/* Fix for date inputs to ensure they are interactive on mobile */
input[type="date"] {
  -webkit-appearance: listbox !important;
  appearance: auto !important;
  min-height: 50px;
}
.input-wrap input::placeholder { color: var(--text-muted); }

.input-wrap .toggle-pw {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  transition: var(--transition);
}
.input-wrap .toggle-pw:hover { color: var(--primary); }

/* no-icon variant */
.input-wrap.no-icon input,
.input-wrap.no-icon select,
.input-wrap.no-icon textarea {
  padding-left: 14px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 16px 24px;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  letter-spacing: -.1px;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #000;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(0, 223, 191, 0.2);
  border-radius: 18px;
  height: 58px;
}
.btn-primary:hover { 
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(0, 223, 191, 0.3); 
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  width: auto; padding: 8px 0;
}

.btn-danger {
  background: #fee2e2;
  color: var(--danger);
}

.btn-sm {
  padding: 10px 18px;
  font-size: .875rem;
  border-radius: var(--radius-sm);
  width: auto;
}

/* Loading spinner in button */
.btn.loading { pointer-events: none; opacity: .75; }
.btn.loading::after {
  content: '';
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Login submit margin */
#btn-login { margin-top: 8px; }

/* Forgot password */
.forgot-link {
  text-align: center;
  margin-top: 16px;
  font-size: .85rem;
  color: var(--text-muted);
}
.forgot-link a { color: var(--primary); text-decoration: none; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════
   SCREEN 2 – DASHBOARD
   ═══════════════════════════════════════════════════════════ */
#screen-dashboard {
  background: var(--bg);
  padding-bottom: calc(var(--safe-bottom) + 72px);
  width: 100%;
  overflow-x: hidden;
}

/* Dashboard Header */
.dash-header {
  background: var(--surface);
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.dash-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dash-greeting h1 {
  font-size: 1.25rem; font-weight: 800;
  color: var(--text-primary); line-height: 1.2;
}
.dash-greeting span.greeting-time {
  font-size: .8rem; color: var(--text-muted); font-weight: 400;
}
.avatar-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 1.1rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  flex-shrink: 0;
}
.avatar-btn:hover { transform: scale(1.05); }

/* Stats Row */
.dash-stats {
  display: flex;
  gap: 8px;
  width: 100%;
}
.stat-chip {
  flex: 1;
  min-width: 0; /* Allow shrinking */
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.stat-chip .stat-num {
  font-size: 1.3rem; font-weight: 800;
  color: var(--primary);
}
.stat-chip .stat-label {
  font-size: .72rem; color: var(--text-muted); font-weight: 500; margin-top: 1px;
}

/* Section header */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 10px;
}
.section-header h2 {
  font-size: 1rem; font-weight: 700; color: var(--text-primary);
}
.section-header span {
  font-size: .8rem; color: var(--text-muted);
}

/* Deal Cards */
.deals-list {
  display: flex; flex-direction: column;
  gap: 12px;
  padding: 0 16px;
}

.deal-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.deal-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--card-accent, var(--primary));
}
.deal-card:active { transform: scale(.98); box-shadow: var(--shadow); }
.deal-card:hover  { border-color: var(--primary); box-shadow: var(--shadow); }

/* ── Locked Project Styles ────────────────────────────────── */
.deal-locked {
  border-style: dashed;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-alt) 100%);
  position: relative;
}
.deal-locked::before {
  background: var(--text-muted) !important;
  opacity: 0.4;
}
.deal-locked .deal-client-name {
  color: var(--text-secondary);
}
.deal-locked .badge {
  opacity: 0.6;
  filter: grayscale(0.5);
}
.deal-locked .deal-arrow {
  opacity: 0.4;
}

.locked-upload {
  background: var(--surface-alt) !important;
  border-color: var(--border) !important;
  opacity: 0.6;
}


.deal-card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px;
}
.deal-client-name {
  font-size: 1.05rem; font-weight: 700;
  color: var(--text-primary); line-height: 1.3;
  flex: 1; margin-right: 10px;
}
.deal-card-bottom {
  display: flex; align-items: center; justify-content: space-between;
}
.deal-date {
  font-size: .78rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
}
.deal-arrow {
  color: var(--text-muted);
}

/* Stage Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: .72rem; font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-blue    { background: #dbeafe; color: #1d4ed8; }
.badge-purple  { background: #ede9fe; color: #6d28d9; }
.badge-teal    { background: #ccfbf1; color: #0f766e; }
.badge-green   { background: #d1fae5; color: #065f46; }
.badge-orange  { background: #ffedd5; color: #c2410c; }
.badge-gray    { background: #f1f5f9; color: #475569; }
.badge-red     { background: #fee2e2; color: #b91c1c; }
.badge-yellow  { background: #fef9c3; color: #854d0e; }

/* Progress Bar in Cards */
.deal-progress-wrap {
  margin: 14px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.deal-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.deal-progress-percentage {
  color: var(--card-accent, var(--primary));
  font-weight: 800;
}
.deal-progress-bg {
  height: 6px;
  background: var(--surface-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}
.deal-progress-bar {
  height: 100%;
  background: var(--card-accent, var(--primary));
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Empty state */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  text-align: center;
}
.empty-state svg { color: var(--text-muted); opacity: .5; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); }
.empty-state p { font-size: .875rem; color: var(--text-muted); }

/* FAB */

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border) 50%, var(--surface-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-card {
  height: 90px; border-radius: var(--radius); margin: 0 16px 12px;
}

/* ═══════════════════════════════════════════════════════════
   SCREEN 3 – NEW CLIENT FORM
   ═══════════════════════════════════════════════════════════ */
#screen-new-client, #screen-detail, #screen-academy { 
  padding-bottom: calc(var(--safe-bottom) + 80px); 
}

.screen-header {
  background: var(--surface);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  box-shadow: var(--shadow-sm);
}
.back-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  cursor: pointer; color: var(--text-primary);
  transition: var(--transition);
  flex-shrink: 0;
}
.back-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.back-btn:active { transform: scale(.93); }

.screen-header h2 {
  font-size: 1.1rem; font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.form-body {
  padding: 24px 20px;
  display: flex; flex-direction: column; gap: 0;
}

.form-section-title {
  font-size: .72rem; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 24px 0 14px;
}
.form-section-title:first-child { margin-top: 0; }

/* Select no-icon */
.input-wrap.select-wrap::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-muted);
  pointer-events: none;
}
.input-wrap.select-wrap select { padding-left: 44px; padding-right: 36px; }
.input-wrap.select-wrap.no-icon select { padding-left: 14px; }

/* Upload buttons */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface-alt);
  position: relative;
}
.upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-area input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.upload-area .upload-icon { color: var(--primary); margin-bottom: 8px; }
.upload-area p { font-size: .875rem; font-weight: 600; color: var(--text-secondary); }
.upload-area span { font-size: .78rem; color: var(--text-muted); }
.upload-area.has-file { border-color: var(--accent); border-style: solid; background: #d1fae5; }
.upload-area.has-file p { color: var(--accent-dark); }

.upload-group {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 6px;
}

.form-footer {
  padding: 16px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: sticky; bottom: 0;
  z-index: 40;
}

/* ═══════════════════════════════════════════════════════════
   SCREEN 4 – PROJECT DETAIL
   ═══════════════════════════════════════════════════════════ */

/* Progress Bar */
.progress-section {
  background: var(--surface);
  margin: 16px;
  border-radius: var(--radius);
  padding: 20px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.progress-section h3 {
  font-size: .78rem; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .8px;
  margin-bottom: 18px;
}

.progress-steps {
  display: flex; align-items: flex-start; gap: 0;
}
.progress-step {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  position: relative;
}
.progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px; left: 50%; right: -50%;
  height: 3px;
  background: var(--border);
  z-index: 0;
  transition: var(--transition-slow);
}
.progress-step.done:not(:last-child)::after { background: var(--primary); }

.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  color: var(--text-muted);
  position: relative; z-index: 1;
  transition: var(--transition-slow);
}
.progress-step.done .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.progress-step.active .step-circle {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.step-label {
  font-size: .7rem; font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px; text-align: center;
  line-height: 1.3;
}
.progress-step.active .step-label { color: var(--primary); font-weight: 700; }
.progress-step.done .step-label { color: var(--text-secondary); }

/* Info Card */
.info-card {
  background: var(--surface);
  margin: 0 16px 12px;
  border-radius: var(--radius);
  padding: 18px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.info-card h3 {
  font-size: .72rem; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .8px;
  margin-bottom: 14px;
}
.info-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-row svg { color: var(--text-muted); flex-shrink: 0; }
.info-row-label { font-size: .72rem; color: var(--text-muted); font-weight: 500; }
.info-row-value { font-size: .9rem; color: var(--text-primary); font-weight: 600; margin-top: 1px; }

/* Action Section */
.action-section {
  margin: 0 16px 16px;
  border-radius: var(--radius);
  overflow: hidden;
}

.action-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.action-card h3 {
  font-size: .9rem; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.action-card p {
  font-size: .85rem; color: var(--text-secondary);
  margin-bottom: 18px; line-height: 1.5;
}
.action-btns { display: flex; flex-direction: column; gap: 10px; }

/* Read-only info box */
.info-box {
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex; gap: 12px;
  align-items: flex-start;
}
.info-box svg { color: #0284c7; flex-shrink: 0; margin-top: 1px; }
.info-box-content h4 { font-size: .9rem; font-weight: 700; color: #075985; margin-bottom: 4px; }
.info-box-content p { font-size: .82rem; color: #0369a1; line-height: 1.5; }

/* Success box */
.success-box {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex; gap: 12px;
  align-items: flex-start;
}
.success-box svg { color: var(--accent); flex-shrink: 0; }
.success-box h4 { font-size: .9rem; font-weight: 700; color: #14532d; margin-bottom: 4px; }
.success-box p  { font-size: .82rem; color: #166534; line-height: 1.5; }

/* ── Toast ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
  width: calc(100% - 40px);
  max-width: 430px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--text-primary);
  color: #fff;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: .875rem; font-weight: 600;
  pointer-events: auto;
  animation: toastIn .3s ease both;
}
.toast.removing { animation: toastOut .3s ease both; }
.toast.success { background: var(--accent-dark); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--info); }

@keyframes toastIn  { from { opacity: 0; transform: translateY(-12px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-8px) scale(.95); } }

/* ── Modal / Overlay ──────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.7);
  z-index: 100;
  display: flex; align-items: flex-end;
  animation: overlayIn .22s ease both;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
  width: 100%; max-height: 90dvh;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 20px 24px 32px;
  overflow-y: auto;
  animation: sheetUp .3s cubic-bezier(.4,0,.2,1) both;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes sheetDown { from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes overlayOut { from { opacity: 1; } to { opacity: 0; } }
.modal-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 20px;
}
.modal-title {
  font-size: 1.1rem; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.modal-subtitle {
  font-size: .85rem; color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ── Branding / Sidebar Header ───────────────────────────── */
.sidebar-header { display: none; }

/* ── Bottom Nav ────────────────────────────────────────────── */
#bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 72px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 1000 !important;
  align-items: center;
  justify-content: space-evenly;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}

/* HIDE NAV GLOBALLY */
body.no-nav #bottom-nav {
  display: none !important;
}

.nav-group-top, .nav-group-bottom { display: contents !important; }

.screen {
    min-height: 100dvh;
    padding-bottom: 90px !important; /* Spacing for the bottom nav bar */
    overflow-x: hidden;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  transition: var(--transition);
  flex: 1;
  min-width: 0;
  padding: 0 2px;
}
.nav-item span {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

/* Mobile-only centering for bottom nav */
@media (max-width: 767px) {
  .nav-item {
    justify-content: center;
  }
  .nav-item span:not([id*="badge"]) {
    display: block;
    width: 100%;
    text-align: center;
  }
}
.nav-item.active {
  color: var(--primary);
}
.nav-item-plus {
  position: relative;
  top: -12px;
  height: 100%;
  justify-content: flex-end;
  padding-bottom: 6px;
}
.plus-circle {
  width: 50px;
  height: 50px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 14px rgba(0,223,191,0.3);
  border: 3px solid var(--bg);
  transition: var(--transition);
}
.nav-item-plus.active .plus-circle {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0,223,191,0.4);
}

/* ── Menu Section Styles ─────────────────────────────── */
.menu-section-label {
  font-size: 0.75rem; 
  font-weight: 800; 
  color: var(--text-muted); 
  text-transform: uppercase; 
  letter-spacing: 1px; 
  margin-bottom: 16px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.menu-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}
.menu-card:active { transform: scale(0.96); opacity: 0.8; }

.menu-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.menu-card-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* ── Academy Hero Cards ─────────────────────────────── */
.academy-hero-card {
  width: 100%;
  height: 140px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background-size: cover !important;
  background-position: center !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border);
}

.academy-hero-card:active {
  transform: scale(0.98);
}

.academy-hero-card .card-overlay {
  position: absolute;
  inset: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 70%);
}

.academy-hero-card h3 {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: -0.5px;
}

.academy-hero-card p {
  color: rgba(255,255,255,0.7);
  font-size: 0.75rem;
  font-weight: 500;
  margin: 4px 0 0;
}

.menu-list {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.menu-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: 0.2s;
}
.menu-list-item:last-child { border-bottom: none; }
.menu-list-item:active { background: rgba(0, 223, 191, 0.05); }

.menu-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.menu-item-icon {
  color: var(--text-secondary);
}
.menu-list-item span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.menu-list-item .chevron {
  color: var(--text-muted);
  opacity: 0.6;
}

.btn-logout-wide {
  margin-top: 40px;
  width: 100%;
  height: 54px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1.5px solid rgba(239, 68, 68, 0.2);
  border-radius: 16px;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn-logout-wide:active {
  background: var(--danger);
  color: #fff;
  transform: scale(0.98);
}

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  height: 1px; background: var(--border);
  margin: 16px 0;
}

/* ── Hub Screen ───────────────────────────────────────────── */
#screen-hub {
  background: var(--surface);
  padding: 60px 24px;
  justify-content: center;
}
.hub-header { text-align: center; margin-bottom: 40px; }
.hub-header h2 { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.hub-header p { font-size: .95rem; color: var(--text-secondary); }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.hub-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  padding: 16px;
}
.hub-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.hub-card:active { transform: scale(.95); }
.hub-icon { margin-bottom: 12px; }
.hub-title { font-weight: 700; font-size: 1.05rem; }

/* ── Utility ──────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.px-20 { padding-left: 20px; padding-right: 20px; }
.gap-8 { gap: 8px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Dashboard Tabs (Mobile) ─────────────────────────── */
.dash-tabs-wrapper {
  padding: 0 20px;
  margin: 16px 0 24px;
}
.dash-tabs-container {
  display: flex;
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 4px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
}
.dash-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: 0.3s;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
}
.dash-tab.active {
  background: var(--surface) !important;
  color: var(--primary) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Responsive Desktop Layouts ──────────────────────────── */
@media (min-width: 768px) {
  body { 
    background: var(--bg);
    margin: 0; 
    overflow-x: hidden;
    overflow-y: auto; 
  }
  
  #app {
    max-width: 100%;
    margin: 0;
    padding-left: 260px; /* Sidebar width */
    min-height: 100dvh;
    background: transparent;
    transition: padding 0.3s ease;
  }
  
  /* HIDE SIDEBAR SPACE ON LOGIN/HUB/FORMS - Only if strictly necessary */
  body.no-nav:not(.on-dashboard) #app,
  body.no-nav.sidebar-collapsed:not(.on-dashboard) #app {
    padding-left: 0 !important;
    background: #fff !important; /* Asegurar que no se vea el fondo negro del body */
  }

  body.no-nav #bottom-nav {
    display: none !important;
  }
  
  body.on-dashboard #app {
    padding-left: 260px !important;
  }
  body.on-dashboard.sidebar-collapsed #app {
    padding-left: 80px !important;
  }
  
  /* SIDEBAR NAVIGATION */
  #bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100dvh;
    flex-direction: column;
    justify-content: space-between; /* Space between top and bottom groups */
    padding: 32px 16px;
    background: var(--surface);
    border-top: none;
    border-right: 1px solid var(--border);
    z-index: 1000;
    box-shadow: 4px 0 16px rgba(0,0,0,0.03);
    transform: none;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease !important;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .nav-group-top, .nav-group-bottom {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 4px !important;
  }

  .desktop-only { display: flex !important; }

  .sidebar-header {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin-bottom: 40px !important;
    padding: 0 4px !important;
    width: 100% !important;
    position: relative !important;
  }
  .sidebar-logo {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
    transition: 0.3s ease;
  }
  .sidebar-logo img {
    height: 30px !important;
    width: 30px !important;
    object-fit: contain !important;
    margin-left: 2px !important;
  }
  .sidebar-brand-text {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    line-height: 0.9 !important;
    transition: opacity 0.3s ease !important;
  }
  .brand-equipo {
    font-weight: 900 !important;
    font-size: 1.15rem !important;
    color: var(--primary) !important;
    letter-spacing: -0.5px !important;
  }
  .brand-renew {
    font-weight: 900 !important;
    font-size: 1.05rem !important;
    color: var(--text-primary) !important;
    letter-spacing: 0.5px !important;
    opacity: 0.9 !important;
  }

  .sidebar-toggle {
    position: absolute !important;
    right: -10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: var(--text-muted) !important;
    transition: 0.3s !important;
    z-index: 10 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
  }
  .sidebar-toggle:hover {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    transform: translateY(-50%) scale(1.1) !important;
  }

  /* COLLAPSED STATE */
  body.sidebar-collapsed #app {
    padding-left: 80px !important;
  }
  body.sidebar-collapsed #bottom-nav {
    width: 80px !important;
    padding: 32px 8px !important;
  }
  body.sidebar-collapsed .sidebar-brand-text,
  body.sidebar-collapsed .nav-item span {
    display: none !important;
  }
  body.sidebar-collapsed .sidebar-header {
    justify-content: center !important;
    margin-bottom: 32px !important;
  }
  body.sidebar-collapsed .sidebar-toggle {
    right: -12px !important;
    transform: translateY(-50%) rotate(180deg) !important;
  }
  body.sidebar-collapsed .sidebar-toggle:hover {
      transform: translateY(-50%) rotate(180deg) scale(1.1) !important;
  }
  body.sidebar-collapsed .nav-item {
    justify-content: center !important;
    padding: 14px 0 !important;
    border-radius: 12px !important;
    width: 100% !important;
  }
  body.sidebar-collapsed .nav-item svg {
    margin: 0 !important;
  }

  .nav-item {
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 12px 18px !important;
    margin-bottom: 4px !important;
    border-radius: 12px !important;
    width: 100% !important;
    height: auto !important;
    transition: 0.2s !important;
  }
  .nav-item:hover {
    background: var(--surface-alt);
    color: var(--primary) !important;
  }
  .nav-item.active {
    background: rgba(0, 223, 191, 0.08);
    color: var(--primary) !important;
  }
  .nav-item span {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
  }
  .nav-item svg {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0 !important;
  }

  /* Reset Center Button for Sidebar */
  .nav-item-plus {
    position: static !important;
    top: auto !important;
    padding: 12px 18px !important;
    height: auto !important;
    justify-content: flex-start !important;
  }
  .plus-circle {
    width: 22px !important;
    height: 22px !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: inherit !important;
    margin: 0 !important;
  }
  .nav-item-plus .plus-circle svg {
    width: 22px !important;
    height: 22px !important;
  }
  .nav-item-plus .plus-circle { border-radius: 0 !important; }

  /* Desktop Header Adjustment */
  .dash-header { 
    padding: 24px 64px 12px !important; 
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    position: relative !important;
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
  }
  
  /* Dashboard Tabs Desktop */
  .dash-tabs-wrapper {
    max-width: 1200px !important;
    margin: 0 auto 32px !important;
    padding: 0 64px !important;
    display: flex !important;
    justify-content: center !important;
  }

  .dash-tabs-container {
    max-width: 800px !important;
    margin: 0 auto !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 24px !important;
    border-radius: 0 !important;
    border-bottom: 2px solid var(--border) !important;
    justify-content: center !important;
  }
  .dash-tab {
    flex: none !important;
    padding: 18px 50px !important;
    font-size: 1.2rem !important;
    border-radius: 0 !important;
    position: relative !important;
    background: transparent !important;
    font-weight: 900 !important;
  }


  .dash-tab:hover {
    color: var(--primary) !important;
  }
  .dash-tab.active {
    background: transparent !important;
    color: var(--primary) !important;
    box-shadow: none !important;
  }
  .dash-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
  }

  /* Specific fix for Clients Screen Tabs */
  #screen-clients .clients-tabs-fix {
    margin-top: 32px !important;
    margin-bottom: 32px !important;
    display: flex !important;
    justify-content: center !important;
  }
  #screen-clients .clients-tabs-fix .dash-tabs-container {
    max-width: 1000px !important;
    gap: 40px !important;
    margin: 0 auto !important;
    justify-content: center !important;
  }
  #screen-clients .clients-tabs-fix .dash-tab {
    padding: 22px 70px !important;
    font-size: 1.4rem !important;
    font-weight: 900 !important;
  }



  .dash-tab-content {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
  }
  
  .dash-header-top { 
    margin-bottom: 16px !important; 
  }
  .dash-greeting h1 { font-size: 2.2rem !important; }
  
  .dash-stats {
    display: flex !important;
    gap: 24px !important;
    width: 100% !important;
  }
  .stat-chip {
    flex: 1 !important;
    max-width: 320px !important;
    padding: 24px !important;
    border-radius: 20px !important;
    align-items: flex-start !important;
    text-align: left !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow-sm) !important;
  }
  .stat-chip .stat-num { font-size: 2rem !important; }

  .section-header { 
    padding: 20px 64px !important; 
    max-width: 1200px !important;
    margin: 0 auto !important;
  }
  
  .deals-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)) !important;
    gap: 32px !important;
    padding: 0 64px 60px !important;
    max-width: 1240px !important;
    margin: 0 auto !important;
    width: 100% !important;
  }
  
  /* MENU SCREEN ON DESKTOP */
  .menu-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px !important;
  }
  .menu-body {
    max-width: 1000px !important;
    margin: 0 auto !important;
    padding-top: 40px !important;
  }
  .menu-card {
    padding: 32px 24px !important;
  }

  /* FORMS & DETAIL PAGES */
  .form-body {
    padding: 40px 64px !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
  }
  .form-footer {
    position: fixed !important;
    bottom: 32px !important;
    right: 64px !important;
    width: auto !important;
    background: transparent !important;
    border: none !important;
    z-index: 100;
  }
  .form-footer .btn-primary { width: 300px !important; box-shadow: var(--shadow-lg) !important; }
  .form-footer .btn-primary { width: 300px !important; box-shadow: var(--shadow-lg) !important; }

  /* DETAIL PAGE COLUMN SPLIT */
  #screen-detail > div:nth-child(3) {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 32px !important;
    padding: 40px 64px 100px !important;
    align-items: start !important;
    max-width: 1500px !important;
    margin: 0 auto !important;
  }
}
 
/* ── Sala Virtual (Base/Mobile) ─────────────────────── */
.academy-main-container {
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}
.academy-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  width: 100% !important;
  max-width: 380px !important; /* Aumentado de 330px */
  margin: 0 auto !important;
}
.academy-hero-card {
  width: 100% !important;
  cursor: pointer;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

@media (min-width: 768px) {
  /* ACADEMY DESKTOP OPTIMIZATION */
  .academy-main-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Main module cards: single column of horizontal rectangles */
  .academy-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    max-width: 860px !important;
    margin: 40px auto 100px !important;
    padding: 0 64px !important;
    width: 100% !important;
  }

  /* Each module card is a wide horizontal rectangle */
  .academy-hero-card {
    height: 180px !important; /* Aumentado de 130px para evitar estiramiento */
    width: 100% !important;
    transition: var(--transition) !important;
  }
  
  .academy-hero-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: var(--shadow-lg) !important;
  }

  /* Resources list on desktop: multi-column grid */
  #contenedor-recursos-finales.academy-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    max-width: 1200px !important;
    gap: 20px !important;
  }
  /* Resource cards don't use fixed height */
  #contenedor-recursos-finales .academy-hero-card {
    height: 200px !important;
  }
  
  #academia-menu-principal header {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 32px 64px !important;
    margin-bottom: 0 !important;
    width: 100% !important;
  }
  
  #academia-subvista header {
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
  }

  /* ── New Client Form Desktop Layout ── */
  #screen-new-client .form-body {
    max-width: 1100px !important;
    margin: 0 auto !important;
    padding: 20px 64px 100px !important;
  }
  #screen-new-client .form-card {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
    align-items: start !important;
    padding: 32px !important;
  }
  #screen-new-client .form-card-header,
  #screen-new-client #mode-search,
  #screen-new-client #selected-client-preview,
  #screen-new-client #search-results {
    grid-column: span 2 !important;
  }
  #screen-new-client .upload-area {
    min-height: 140px !important;
    margin-bottom: 0 !important;
  }
  #screen-new-client #btn-submit {
    max-width: 400px !important;
    margin: 32px auto !important;
  }

  /* ── Menu Screen Desktop Layout ── */
  .menu-body {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 20px 64px 100px !important;
  }
  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 32px !important;
    margin-bottom: 48px !important;
  }
  .menu-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
    background: transparent !important;
    border: none !important;
  }
  .menu-list-item {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 20px !important;
    padding: 32px 40px !important;
    margin-bottom: 0 !important;
    transition: all 0.2s ease !important;
    box-shadow: var(--shadow-sm) !important;
  }
  .menu-list-item:hover {
    transform: translateY(-5px) !important;
    box-shadow: var(--shadow-lg) !important;
    border-color: var(--primary) !important;
  }
  .menu-item-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 12px !important;
    margin-right: 16px !important;
  }
  .menu-item-icon svg {
    width: 24px !important;
    height: 24px !important;
  }
  .menu-item-left span {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.3px !important;
  }
  .menu-list-item .chevron {
    width: 22px !important;
    height: 22px !important;
    color: var(--primary) !important;
  }
  .btn-logout-wide {
    max-width: 500px !important;
    margin: 60px auto 0 !important;
    height: 60px !important;
    font-size: 1.1rem !important;
  }


  /* ── Technical Inventory Desktop Adjustment ── */
  #screen-inventory-tech .menu-body {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 40px 64px !important;
  }
  #inv-step-1-grid, #inv-step-2-grid {
      display: grid !important;
      grid-template-columns: repeat(2, 1fr) !important;
      gap: 24px !important;
  }
  #inv-step-2-grid {
      grid-template-columns: repeat(3, 1fr) !important;
  }
  #inv-step-3 .inventory-form-container {
      display: grid !important;
      grid-template-columns: 1fr 1.5fr !important;
      gap: 40px !important;
      align-items: start !important;
  }
  #inv-step-3 .field-group {
      margin-bottom: 32px !important;
  }
  #inv-step-3 .mobile-submit-box {
      grid-column: span 2 !important;
      margin-top: 24px !important;
  }
}

@media (min-width: 1400px) {
  /* Keep module cards as single column but wider max-width */
  #academia-menu-principal .academy-grid {
    max-width: 1000px !important;
  }
}

@media (min-width: 1800px) {
  #academia-menu-principal .academy-grid {
    max-width: 1100px !important;
  }
}

/* ── Technician & Call Center Overrides ────────────────────────── */
body.is-tecnico .nav-item-plus,
body.is-callcenter .nav-item-plus {
  display: none !important;
}

body.is-tecnico .clients-tabs-fix,
body.is-callcenter .clients-tabs-fix {
  display: none !important;
}

body.is-tecnico #nav-btn-nuevo-cliente,
body.is-callcenter #nav-btn-nuevo-cliente {
  display: none !important;
}
