/* ==========================================================================
   LEGALIA - Design System & Stylesheet
   ========================================================================== */

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

:root {
  /* Color Palette matching reference design */
  --bg-main: #f4f7f9;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  
  --primary-teal: #0d6e6e;
  --primary-teal-hover: #0a5656;
  --primary-teal-light: #e6f4f4;
  
  --navy-dark: #0a192f;
  --navy-hover: #172a46;
  --navy-muted: #1e293b;
  
  --text-title: #0f172a;
  --text-body: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --accent-amber: #f59e0b;
  --accent-amber-light: #fffbe6;
  --accent-green: #10b981;
  --accent-blue: #2563eb;
  
  --border-light: #e2e8f0;
  --border-focus: #0d6e6e;
  
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.1);
  --shadow-hover: 0 15px 30px rgba(13, 110, 110, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Layout & Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  transition: var(--transition);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
  filter: brightness(1.10);
}

.brand-logo-img:hover {
  transform: scale(1.03);
}

.footer-logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.sidebar-logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0,0,0,0.3)); /* Makes white/bright for dark sidebar if needed, or clean contrast */
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  position: relative;
}

.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-body);
  transition: var(--transition);
  position: relative;
  padding: 8px 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-teal);
}

.nav-beam {
  position: absolute;
  bottom: 1px;
  left: 0;
  width: var(--beam-width, 0px);
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #00cad5 22%, #ffffff 50%, #007c8a 78%, transparent);
  box-shadow: 0 0 8px #00cad599, 0 0 16px #00cad566;
  transform: translateX(var(--beam-left, 0px));
  transition: transform .55s cubic-bezier(.2,.9,.2,1), width .55s cubic-bezier(.2,.9,.2,1);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .nav-beam { transition: none; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary {
  background-color: transparent;
  color: var(--navy-dark);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  background-color: #f1f5f9;
  border-color: var(--text-light);
}

.btn-primary-dark {
  background-color: var(--navy-dark);
  color: #ffffff;
  border-radius: var(--radius-sm);
}

.btn-primary-dark:hover {
  background-color: var(--navy-hover);
  box-shadow: 0 4px 12px rgba(10, 25, 47, 0.25);
  transform: translateY(-1px);
}

.btn-teal {
  background-color: var(--primary-teal);
  color: #ffffff;
  padding: 12px 26px;
  font-size: 0.95rem;
}

.btn-teal:hover {
  background-color: var(--primary-teal-hover);
  box-shadow: 0 4px 16px rgba(13, 110, 110, 0.3);
  transform: translateY(-1px);
}

.btn-icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  color: var(--text-body);
  border: 1px solid var(--border-light);
  background: transparent;
}

.btn-icon-only:hover {
  background-color: var(--bg-main);
  color: var(--primary-teal);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--navy-dark);
  cursor: pointer;
}

/* Hero Section */
.hero-section {
  padding: 80px 0 70px;
}

.hero-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 840px;
  margin: 0 auto;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-title);
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.hero-content h1 .teal-highlight {
  color: var(--primary-teal);
  display: block;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-body);
  margin-bottom: 36px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* Two Cards Grid (Acceso Clientes + Indicadores) */
.dual-cards-section {
  padding-bottom: 70px;
}

.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-with-accent {
  border-left: 4px solid var(--primary-teal);
}

.card-with-accent-amber {
  border-left: 4px solid var(--accent-amber);
}

.card-header-flex {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.card-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--primary-teal-light);
  color: var(--primary-teal);
}

.card-icon-badge.amber {
  background-color: var(--accent-amber-light);
  color: var(--accent-amber);
}

.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-title);
}

.card-description {
  font-size: 0.92rem;
  color: var(--text-body);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-title);
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--text-title);
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(13, 110, 110, 0.15);
}

.form-input::placeholder {
  color: var(--text-light);
}

.btn-full {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  font-size: 0.95rem;
}

.form-footer-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--primary-teal);
  transition: var(--transition);
}

.form-footer-link:hover {
  text-decoration: underline;
}

/* Indicadores Económicos List */
.indicators-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.indicator-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background-color: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid #f1f5f9;
  transition: var(--transition);
}

.indicator-item:hover {
  background-color: #ffffff;
  border-color: var(--border-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.indicator-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-body);
}

.indicator-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.indicator-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-title);
  letter-spacing: -0.2px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background-color: #dcfce7;
  color: #15803d;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #16a34a;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

.calc-btn-trigger {
  width: 100%;
  padding: 10px;
  font-size: 0.85rem;
  color: var(--primary-teal);
  background: var(--primary-teal-light);
  border: 1px dashed var(--primary-teal);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.calc-btn-trigger:hover {
  background: #d1eded;
}

/* Proceso Didáctico Section */
.proceso-section {
  padding: 70px 0;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 50px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-title);
  margin-bottom: 14px;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-body);
  line-height: 1.6;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  position: relative;
}

.step-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.step-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-teal-light);
}

.step-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--navy-dark);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 8px 16px rgba(10, 25, 47, 0.15);
  transition: var(--transition);
}

.step-card:nth-child(2) .step-icon-circle {
  background-color: var(--primary-teal);
  box-shadow: 0 8px 16px rgba(13, 110, 110, 0.2);
}

.step-card:hover .step-icon-circle {
  transform: scale(1.1);
}

.step-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 12px;
}

.step-description {
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 20px;
}

.step-more-link {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-teal);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.step-card:hover .step-more-link svg {
  transform: translateX(4px);
}

.step-more-link svg {
  transition: var(--transition);
}

/* La Empresa & Nuestra Propuesta Section */
.about-section {
  padding-bottom: 80px;
}

.about-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 16px;
}

.about-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-body);
}

/* Metrics Banner Bar */
.metrics-banner {
  background: linear-gradient(135deg, var(--navy-dark) 0%, #0f2744 100%);
  color: #ffffff;
  padding: 40px 0;
  margin-bottom: 70px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.metric-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: #2dd4bf;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Footer */
.site-footer {
  background-color: var(--bg-main);
  border-top: 1px solid var(--border-light);
  padding: 40px 0 30px;
}

/* Datos de contacto centrados en el footer */
.footer-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-style: normal;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.footer-contact strong {
  color: var(--text-title);
  font-size: 1rem;
}

.footer-contact a {
  color: var(--primary-teal);
  text-decoration: none;
}

.footer-contact a:hover {
  text-decoration: underline;
}

.footer-links {
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-left {
    align-items: center;
  }

  .footer-links {
    justify-content: center;
  }
}

.footer-address {
  color: var(--text-muted) !important;
  text-decoration: underline !important;
  text-decoration-color: var(--primary-teal) !important;
  text-underline-offset: 3px;
}

.footer-address:hover {
  color: var(--primary-teal) !important;
}

.footer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: 0.5px;
}

.footer-copyright {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.footer-link {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--primary-teal);
  transition: var(--transition);
  cursor: pointer;
}

.footer-link:hover {
  text-decoration: underline;
  color: var(--primary-teal-hover);
}

/* Modals System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px) scale(0.95);
  transition: var(--transition);
  position: relative;
}

.modal-overlay.active .modal-container {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 24px 30px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-title);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background-color: #f1f5f9;
  color: var(--text-title);
}

.modal-body {
  padding: 30px;
}

/* Client Portal Demo Dashboard inside Modal */
.portal-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.portal-user-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--primary-teal-light);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(13, 110, 110, 0.2);
}

.portal-user-info h4 {
  color: var(--primary-teal);
  font-size: 1rem;
  font-weight: 700;
}

.portal-user-info p {
  font-size: 0.85rem;
  color: var(--navy-dark);
}

.case-status-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  background-color: #f8fafc;
}

.case-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.case-id {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-title);
}

.status-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.status-badge.in-progress {
  background-color: #fef3c7;
  color: #b45309;
}

.status-badge.success {
  background-color: #d1fae5;
  color: #047857;
}

.status-badge.judicial {
  background-color: #e0e7ff;
  color: #4338ca;
}

.case-details-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
  font-size: 0.85rem;
}

.case-detail-item strong {
  display: block;
  color: var(--text-title);
  font-size: 0.8rem;
}

.case-detail-item span {
  color: var(--text-body);
}

.progress-bar-container {
  height: 8px;
  background-color: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-teal), var(--accent-green));
  border-radius: var(--radius-full);
}

/* Demo Login Presets Bar */
.demo-logins-bar {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-light);
  flex-wrap: wrap;
}

.btn-demo {
  font-size: 0.75rem;
  padding: 6px 10px;
  background-color: #f1f5f9;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--navy-dark);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-demo:hover {
  background-color: var(--primary-teal-light);
  color: var(--primary-teal);
  border-color: var(--primary-teal);
}

.btn-demo.admin-demo {
  background-color: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.btn-demo.admin-demo:hover {
  background-color: #fee2e2;
}

/* Role Badges */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.role-badge.admin {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.role-badge.client {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 24px;
}

.admin-tab-btn {
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: -2px;
}

.admin-tab-btn:hover {
  color: var(--primary-teal);
}

.admin-tab-btn.active {
  color: var(--primary-teal);
  border-bottom-color: var(--primary-teal);
  font-weight: 700;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

/* Admin Management Tables */
.admin-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.admin-table th {
  background-color: #f8fafc;
  color: var(--text-title);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-body);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background-color: #f8fafc;
}

/* Checkbox & Permission Controls */
.permission-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.permission-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-title);
  cursor: pointer;
}

.permission-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-teal);
  cursor: pointer;
}

/* Case Selection List in Admin */
.case-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.case-selector-card {
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.case-selector-card:hover {
  border-color: var(--primary-teal);
  box-shadow: 0 4px 12px rgba(13, 110, 110, 0.08);
}

.case-selector-card.selected {
  border-color: var(--primary-teal);
  background-color: var(--primary-teal-light);
}

/* ==========================================================================
   FULL SCREEN CORPORATE APPLICATION SHELL
   ========================================================================== */

#public-view {
  min-height: 100vh;
}

#app-view {
  display: none;
  min-height: 100vh;
  background-color: #f1f5f9;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  overflow: hidden;
}

#app-view.active {
  display: flex;
}

/* Sidebar Styles */
.app-sidebar {
  width: 280px;
  background: linear-gradient(180deg, #0a192f 0%, #06101e 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.sidebar-user-card {
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.user-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card-rut {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  cursor: pointer;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-link.active {
  background: var(--primary-teal);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(13, 110, 110, 0.4);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-logout {
  width: 100%;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

/* App Main Body Layout */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-topbar {
  height: 70px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.app-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  width: 340px;
  border: 1px solid var(--border-light);
}

.app-search-box input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 0.875rem;
  color: var(--text-title);
  outline: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-indicator-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.825rem;
  background: #f8fafc;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  font-weight: 600;
}

.app-content-body {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* Stat Cards Summary Grid */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-title {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: -0.5px;
}

.stat-subtext {
  font-size: 0.775rem;
  color: var(--primary-teal);
  font-weight: 600;
  margin-top: 4px;
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-teal-light);
  color: var(--primary-teal);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Full App Panel Cards & Tables */
.app-panel-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.panel-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-title);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-content h1 {
    font-size: 2.2rem;
  }
  
  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  
  .two-col-grid {
    grid-template-columns: 1fr;
  }
  
  .steps-grid {
    grid-template-columns: 1fr;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-sidebar {
    width: 220px;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
  }
  
  .nav-menu.active {
    display: flex;
  }

  .nav-beam { display: none; }
  .nav-link.active { text-decoration: underline; text-decoration-color: var(--primary-teal); text-underline-offset: 7px; }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .header-actions .btn-secondary {
    display: none;
  }
  
  .footer-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .footer-links {
    flex-wrap: wrap;
  }

  #app-view.active {
    flex-direction: column;
  }

  .app-sidebar {
    width: 100%;
    height: auto;
  }

  .stat-cards-grid {
    grid-template-columns: 1fr;
  }
}

.contact-card {
  max-width: 650px;
  margin: 32px auto 0;
  padding: 30px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--primary-teal);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  color: var(--text-body);
}

.contact-card h2 {
  margin: 0 0 4px;
  color: var(--text-title);
  font-size: 1.3rem;
}

.contact-card strong {
  color: var(--text-title);
}

.contact-card a {
  color: var(--primary-teal);
  text-decoration: none;
  line-height: 1.6;
}

.contact-card a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .contact-card {
    padding: 26px 18px;
  }
}