:root{
  --app-bg:#ffffff;
  --surface:#ffffff;
  --sidebar-bg:#f8fafc;
  --line:#e5e7eb;
  --text:#0f172a;
  --muted:#64748b;
  --hover:#eef2ff;
  --active:#e0e7ff;
  --primary:#1d4ed8;
  --shadow2:0 6px 18px rgba(2,6,23,.05);
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;overflow:hidden}
body{
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  background:var(--app-bg);
  color:var(--text);
}

/* App Shell */
.app-shell{
  height:100vh;
  display:flex;
  background:var(--app-bg);
  overflow:hidden;
}

/* Sidebar */
.sidebar{
  width:300px;
  background:var(--sidebar-bg);
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  height:100vh;
  flex-shrink:0;
}

.sidebar-header{
  padding:20px 16px 16px 16px;
  border-bottom:1px solid var(--line);
}

.brand{
  font-size:16px;
  font-weight:800;
  color:var(--text);
}

.brand-logo{
  height: 40px;
  width: auto;
  object-fit: contain;
}

.mobile-brand-logo{
  height: 32px;
  width: auto;
  object-fit: contain;
}

.brand-sub{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
}

/* Search tabs */
.search-tabs{
  display:flex;
  margin:16px 16px 0 16px;
  background:var(--line);
  border-radius:8px;
  padding:4px;
  gap:4px;
}

.search-tab{
  flex:1;
  padding:8px 12px;
  border:none;
  background:transparent;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  border-radius:6px;
  transition:all .15s ease;
  font-family:inherit;
}

.search-tab:hover{
  color:var(--text);
}

.search-tab.active{
  color:var(--text);
  background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.1);
}

/* Search sections */
.search-section{
  flex:1;
  display:flex;
  flex-direction:column;
  padding:16px;
  min-height:0;
}

.search-section.hidden{
  display:none;
}

.job-textarea{
  flex:1;
  min-height:0;
  resize:none;
  margin-bottom:12px;
}

.search-input{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:8px;
  font-size:13px;
  background:#fff;
  color:var(--text);
  font-family:inherit;
}

.search-input:focus{
  outline:none;
  border-color:#d1d5db;
}

.search-input::placeholder{
  color:var(--muted);
}

#directSection .search-input{
  margin-bottom:12px;
}

.btn{
  width:100%;
  padding:10px 14px;
  border:1px solid var(--line);
  border-radius:8px;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  background:#fff;
  color:var(--text);
  transition:all .15s ease;
  font-family:inherit;
}

.btn:hover{
  background:var(--hover);
}

.btn.primary{
  background:rgba(29,78,216,.10);
  border-color:rgba(29,78,216,.25);
  color:var(--primary);
}

.btn.primary:hover{
  background:rgba(29,78,216,.15);
}

.btn:disabled{
  opacity:0.5;
  cursor:not-allowed;
}

/* Status bar */
.status-bar{
  display:none;
}

/* Pagination - ahora inline en header */
.pagination{
  display:none;
}

.pagination-btn{
  width:32px;
  height:32px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  cursor:pointer;
  font-size:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all .15s;
}

.pagination-btn:hover:not(:disabled){
  border-color:var(--primary);
  color:var(--primary);
}

.pagination-btn:disabled{
  opacity:0.4;
  cursor:not-allowed;
}

.pagination-info{
  font-size:13px;
  color:var(--muted);
  min-width:50px;
  text-align:center;
}

/* Panel header actions */
.panel-header-right{
  display:flex;
  align-items:center;
  gap:12px;
}

.pagination-inline{
  display:flex;
  align-items:center;
  gap:6px;
}

.pagination-inline .pagination-btn{
  width:28px;
  height:28px;
  border:1px solid var(--line);
  border-radius:4px;
  background:#fff;
  cursor:pointer;
  font-size:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all .15s;
}

.pagination-inline .pagination-btn:hover:not(:disabled){
  border-color:var(--primary);
  color:var(--primary);
}

.pagination-inline .pagination-btn:disabled{
  opacity:0.4;
  cursor:not-allowed;
}

.pagination-inline .pagination-info{
  font-size:12px;
  color:var(--muted);
}

.btn-export{
  padding:4px;
  border:1px solid var(--line);
  border-radius:4px;
  background:#fff;
  cursor:pointer;
  transition:all .15s;
  display:flex;
  align-items:center;
  justify-content:center;
}

.btn-export:hover{
  border-color:#217346;
  background:#f0fdf4;
}

.btn-export img{
  width:20px;
  height:20px;
}

.status-dot{
  width:8px !important;
  height:8px !important;
  min-width:8px !important;
  min-height:8px !important;
  max-width:8px !important;
  max-height:8px !important;
  border-radius:50% !important;
  background:#22c55e;
  flex-shrink:0;
}

.status-dot.loading{
  background:#3b82f6;
}

.status-dot.error{
  background:#ef4444;
}

@keyframes pulse{
  0%,100%{opacity:1}
  50%{opacity:0.4}
}

/* Main */
.main{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  height:100vh;
  overflow:hidden;
}

/* Content grid - SCROLL INDEPENDIENTE */
.content{
  flex:1;
  display:grid;
  grid-template-columns:1fr 1fr;
  height:100%;
  overflow:hidden;
}

/* Panels - SCROLL INDEPENDIENTE */
.panel{
  display:flex;
  flex-direction:column;
  border-right:1px solid var(--line);
  height:100%;
  overflow:hidden;
}

.panel:last-child{
  border-right:none;
}

.panel-header{
  padding:0 18px;
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
  background:var(--surface);
  height:52px;
  flex-shrink:0;
}

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

.panel-count{
  font-size:12px;
  color:var(--muted);
}

/* Panel content con scroll propio */
.panel-content{
  flex:1;
  overflow-y:auto;
  overflow-x:hidden;
  padding:14px;
}

/* Scrollbar estilizado */
.panel-content::-webkit-scrollbar{
  width:6px;
}

.panel-content::-webkit-scrollbar-track{
  background:#f1f5f9;
  border-radius:3px;
}

.panel-content::-webkit-scrollbar-thumb{
  background:#cbd5e1;
  border-radius:3px;
}

.panel-content::-webkit-scrollbar-thumb:hover{
  background:#94a3b8;
}

/* Empty state */
.empty-state,
.detail-empty{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  height:100%;
  text-align:center;
  padding:40px 20px;
}

.empty-title{
  font-size:14px;
  font-weight:600;
  color:var(--text);
  margin-bottom:6px;
}

.empty-sub{
  font-size:13px;
  color:var(--muted);
}

/* Cards */
.card{
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  padding:14px 16px;
  margin-bottom:10px;
  cursor:pointer;
  transition:all .15s ease;
}

.card:hover{
  border-color:#d1d5db;
  box-shadow:0 2px 8px rgba(0,0,0,.04);
}

.card.active{
  border-color:var(--primary);
  background:rgba(29,78,216,.02);
}

.card.visited{
  opacity:0.7;
}

.card.visited:hover{
  opacity:1;
}

.card-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.card-info{
  flex:1;
  min-width:0;
}

.card-name{
  font-size:14px;
  font-weight:700;
  color:var(--text);
  margin-bottom:2px;
  display:flex;
  align-items:center;
  gap:8px;
}

.visited-badge{
  font-size:10px;
  font-weight:600;
  color:#16a34a;
  background:rgba(34,197,94,.1);
  padding:2px 6px;
  border-radius:4px;
}

.card-title{
  font-size:13px;
  color:var(--text);
  font-weight:500;
}

.card-score{
  font-size:12px;
  font-weight:700;
  color:var(--primary);
  background:rgba(29,78,216,.08);
  border:1px solid rgba(29,78,216,.15);
  padding:4px 10px;
  border-radius:6px;
  white-space:nowrap;
  flex-shrink:0;
}

.card-reason{
  font-size:12px;
  color:var(--muted);
  font-style:italic;
  margin-top:8px;
  line-height:1.4;
}

.card-meta{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:8px;
  font-size:12px;
  color:var(--muted);
}

.card-company{
  color:var(--text);
  font-weight:500;
}

.card-company::after{
  content:'·';
  margin-left:8px;
}

.card-location{
  color:var(--muted);
}

/* Detail panel */
.detail-header{
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  padding:16px;
  margin-bottom:14px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}

.detail-info{
  flex:1;
  min-width:0;
}

.detail-name{
  font-size:18px;
  font-weight:800;
  color:var(--text);
  margin-bottom:4px;
}

.detail-title{
  font-size:14px;
  color:var(--text);
  font-weight:500;
}

.detail-company{
  font-size:14px;
  color:var(--muted);
  margin-top:2px;
}

.detail-meta{
  display:flex;
  align-items:center;
  gap:12px;
  margin-top:12px;
  flex-wrap:wrap;
}

.detail-location{
  font-size:12px;
  color:var(--muted);
}

.detail-snippet{
  background:#f8fafc;
  border:1px solid var(--line);
  border-radius:8px;
  padding:14px;
  font-size:13px;
  color:var(--muted);
  line-height:1.6;
  margin-bottom:14px;
}

/* Actions in header */
.detail-actions{
  display:flex;
  gap:8px;
  flex-shrink:0;
}

.btn-linkedin{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  background:var(--primary);
  color:#fff;
  border:none;
  border-radius:8px;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  text-decoration:none;
  transition:opacity .15s ease;
  white-space:nowrap;
}

.btn-linkedin:hover{
  opacity:0.9;
}

.btn-copy{
  display:flex;
  align-items:center;
  justify-content:center;
  width:38px;
  height:38px;
  background:#fff;
  color:var(--muted);
  border:1px solid var(--line);
  border-radius:8px;
  cursor:pointer;
  transition:all .15s ease;
}

.btn-copy:hover{
  background:var(--hover);
  border-color:#d1d5db;
  color:var(--text);
}

.btn-copy.copied{
  background:rgba(34,197,94,.1);
  border-color:rgba(34,197,94,.3);
  color:#16a34a;
}

/* Analysis sections */
.section{
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  padding:14px;
  margin-bottom:12px;
}

.section-title{
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.5px;
  color:var(--muted);
  margin-bottom:10px;
}

.section-content{
  font-size:13px;
  color:var(--text);
  line-height:1.6;
}

.section-content ul{
  margin:0;
  padding-left:18px;
}

.section-content li{
  margin-bottom:4px;
}

.section.highlight{
  background:rgba(29,78,216,.04);
  border-color:rgba(29,78,216,.15);
}

.section.highlight .section-title{
  color:var(--primary);
}

.section.warning{
  background:#fffbeb;
  border-color:#fde68a;
}

.section.warning .section-title{
  color:#b45309;
}

/* Interest badge */
.interest-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:6px;
  font-size:13px;
  font-weight:600;
  margin-bottom:14px;
}

/* LinkedIn Profile Styles */
.profile-header{
  display:flex;
  gap:16px;
  padding:16px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  margin-bottom:14px;
  align-items:flex-start;
}

.profile-photo{
  width:80px;
  height:80px;
  border-radius:50%;
  object-fit:cover;
  flex-shrink:0;
}

.profile-photo-placeholder{
  width:80px;
  height:80px;
  border-radius:50%;
  background:var(--line);
  flex-shrink:0;
}

.profile-info{
  flex:1;
  min-width:0;
}

.profile-name{
  font-size:18px;
  font-weight:800;
  color:var(--text);
  margin-bottom:4px;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.badge{
  font-size:10px;
  font-weight:600;
  padding:3px 8px;
  border-radius:4px;
}

.badge.premium{
  background:linear-gradient(135deg, #d4af37, #f4d03f);
  color:#333;
}

.badge.topvoice{
  background:linear-gradient(135deg, #0077b5, #00a0dc);
  color:#fff;
}

.profile-headline{
  font-size:13px;
  color:var(--text);
  margin-bottom:4px;
  line-height:1.4;
}

.profile-location{
  font-size:12px;
  color:var(--muted);
  margin-bottom:8px;
}

.profile-stats{
  display:flex;
  gap:12px;
  font-size:12px;
  color:var(--muted);
}

.profile-stats span{
  background:var(--sidebar-bg);
  padding:4px 8px;
  border-radius:4px;
}

/* Experience */
.experience-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.experience-item{
  display:flex;
  gap:12px;
}

.company-logo{
  width:40px;
  height:40px;
  border-radius:6px;
  object-fit:cover;
  flex-shrink:0;
}

.company-logo-placeholder{
  width:40px;
  height:40px;
  border-radius:6px;
  background:var(--line);
  flex-shrink:0;
}

.experience-info{
  flex:1;
  min-width:0;
}

.experience-title{
  font-size:13px;
  font-weight:600;
  color:var(--text);
}

.experience-company{
  font-size:12px;
  color:var(--text);
}

.experience-dates{
  font-size:11px;
  color:var(--muted);
  margin-top:2px;
}

.experience-desc{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
  line-height:1.4;
}

/* Education */
.education-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.education-item{
  display:flex;
  gap:12px;
}

.school-logo{
  width:40px;
  height:40px;
  border-radius:6px;
  object-fit:cover;
  flex-shrink:0;
}

.school-logo-placeholder{
  width:40px;
  height:40px;
  border-radius:6px;
  background:var(--line);
  flex-shrink:0;
}

.education-info{
  flex:1;
}

.education-school{
  font-size:13px;
  font-weight:600;
  color:var(--text);
}

.education-degree{
  font-size:12px;
  color:var(--text);
}

.education-years{
  font-size:11px;
  color:var(--muted);
}

/* Skills */
.skills-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.skill-tag{
  font-size:12px;
  background:var(--sidebar-bg);
  color:var(--text);
  padding:6px 12px;
  border-radius:20px;
  border:1px solid var(--line);
}

/* Trayectoria */
.trayectoria-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.trayectoria-item{
  padding-left:12px;
  border-left:2px solid var(--primary);
}

.trayectoria-cargo{
  font-size:13px;
  font-weight:600;
  color:var(--text);
}

.trayectoria-empresa{
  font-size:12px;
  color:var(--muted);
}

.trayectoria-desc{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
  line-height:1.4;
}

/* Educación */
.educacion-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.educacion-item{
  padding-left:12px;
  border-left:2px solid var(--line);
}

.educacion-titulo{
  font-size:13px;
  font-weight:600;
  color:var(--text);
}

.educacion-institucion{
  font-size:12px;
  color:var(--muted);
}

.interest-badge.high{
  background:rgba(34,197,94,.1);
  color:#16a34a;
}

.interest-badge.medium{
  background:rgba(234,179,8,.1);
  color:#b45309;
}

.interest-badge.low{
  background:rgba(239,68,68,.1);
  color:#dc2626;
}

.interest-reason{
  font-weight:400;
  font-size:12px;
  opacity:0.8;
}

/* News items */
.news-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.news-item{
  display:block;
  padding:12px;
  background:#f8fafc;
  border:1px solid var(--line);
  border-radius:8px;
  text-decoration:none;
  color:inherit;
  transition:all .15s ease;
}

.news-item:hover{
  background:#f1f5f9;
  border-color:#d1d5db;
}

.news-source{
  font-size:10px;
  font-weight:700;
  color:var(--primary);
  text-transform:uppercase;
  letter-spacing:0.5px;
  margin-bottom:4px;
}

.news-title{
  font-size:13px;
  color:var(--text);
  font-weight:500;
  line-height:1.4;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.news-date{
  font-size:11px;
  color:var(--muted);
  margin-top:4px;
}

/* Stats */
.stats-row{
  display:flex;
  gap:16px;
  padding:14px 0;
  border-top:1px solid var(--line);
  margin-top:16px;
}

.stat{
  text-align:center;
  flex:1;
}

.stat-value{
  font-size:18px;
  font-weight:800;
  color:var(--text);
}

.stat-label{
  font-size:10px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0.5px;
  margin-top:2px;
}

/* Loading */
.loading{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:40px;
  color:var(--muted);
  font-size:13px;
}

.spinner{
  width:18px;
  height:18px;
  border:2px solid var(--line);
  border-top-color:var(--primary);
  border-radius:50%;
  animation:spin .7s linear infinite;
}

@keyframes spin{
  to{transform:rotate(360deg)}
}

/* ==================== MOBILE STYLES ==================== */

/* Mobile Header - hidden on desktop */
.mobile-header{
  display:none;
}

/* Mobile Tabs - hidden on desktop */
.mobile-tabs{
  display:none;
}

/* Mobile Back Button - hidden on desktop */
.mobile-back-btn{
  display:none;
}

/* Search Modal */
.search-modal{
  display:none;
  position:fixed;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background:rgba(0,0,0,.5);
  z-index:1000;
}

.search-modal.open{
  display:flex;
  align-items:flex-end;
}

.search-modal-content{
  background:#fff;
  width:100%;
  max-height:80vh;
  border-radius:16px 16px 0 0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.search-modal-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 20px;
  border-bottom:1px solid var(--line);
  font-weight:700;
  font-size:16px;
}

.search-modal-close{
  width:32px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:none;
  background:var(--line);
  border-radius:50%;
  cursor:pointer;
  font-size:16px;
  color:var(--muted);
}

.search-modal .search-tabs{
  margin:12px;
}

.search-modal .search-section{
  padding:12px;
  flex:1;
  overflow:auto;
}

.search-modal .job-textarea{
  min-height:120px;
}

/* FAB */
.fab{
  display:none;
  position:fixed;
  bottom:20px;
  right:20px;
  width:56px;
  height:56px;
  border-radius:50%;
  border:none;
  background:var(--primary);
  color:#fff;
  box-shadow:0 4px 12px rgba(29,78,216,.4);
  cursor:pointer;
  z-index:99;
  align-items:center;
  justify-content:center;
}

/* ==================== TABLET ==================== */
@media(max-width:1024px){
  .content{
    grid-template-columns:1fr;
  }
  .panel{
    border-right:none;
    border-bottom:1px solid var(--line);
    max-height:50vh;
  }
}

/* ==================== MOBILE ==================== */
@media(max-width:768px){
  html,body{
    overflow:auto;
  }
  
  /* Hide desktop sidebar */
  .sidebar{
    display:none;
  }
  
  /* Show mobile elements */
  .mobile-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:12px 16px;
    background:#fff;
    border-bottom:1px solid var(--line);
  }
  
  .mobile-brand{
    font-size:18px;
    font-weight:800;
    color:var(--text);
  }
  
  .mobile-search-btn{
    width:40px;
    height:40px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:none;
    background:var(--primary);
    color:#fff;
    border-radius:10px;
    cursor:pointer;
  }
  
  .mobile-tabs{
    display:flex;
    padding:8px;
    gap:8px;
    background:var(--sidebar-bg);
    border-bottom:1px solid var(--line);
  }
  
  .mobile-tab{
    flex:1;
    padding:10px;
    border:none;
    background:transparent;
    color:var(--muted);
    font-size:13px;
    font-weight:600;
    border-radius:8px;
    cursor:pointer;
    font-family:inherit;
    text-align:center;
  }
  
  .mobile-tab.active{
    background:#fff;
    color:var(--text);
    box-shadow:0 1px 3px rgba(0,0,0,.1);
  }
  
  .mobile-tab-count{
    font-size:11px;
    background:var(--primary);
    color:#fff;
    padding:2px 6px;
    border-radius:10px;
    margin-left:4px;
  }
  
  .mobile-tab-count:empty{
    display:none;
  }
  
  .mobile-back-btn{
    display:block;
    padding:6px 10px;
    border:1px solid var(--line);
    background:#fff;
    color:var(--text);
    font-size:12px;
    border-radius:6px;
    cursor:pointer;
    font-family:inherit;
  }
  
  .fab{
    display:flex;
  }
  
  /* Layout */
  .app-shell{
    flex-direction:column;
    height:auto;
    min-height:100vh;
  }
  
  .main{
    flex:1;
    display:flex;
    flex-direction:column;
    min-height:0;
    height:auto;
  }
  
  .content{
    flex:1;
    display:block;
    overflow:visible;
    height:auto;
  }
  
  /* Panels */
  .panel{
    height:auto;
    max-height:none;
    border:none;
    display:none;
    flex-direction:column;
    overflow:visible;
  }
  
  .panel-content{
    overflow:visible;
  }
  
  #resultsPanel{
    display:flex;
  }
  
  #detailPanelWrapper{
    display:none;
  }
}
