/* ============================================
   CURRÍCULUM AI - Global Styles
   Design System: SaaS Premium, Clean, Modern
   ============================================ */

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

/* ── CSS Variables ── */
:root {
  /* Colors */
  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a8a;

  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;

  --orange-50:  #fff7ed;
  --orange-100: #ffedd5;
  --orange-400: #fb923c;
  --orange-500: #f97316;

  --red-50:  #fef2f2;
  --red-100: #fee2e2;
  --red-400: #f87171;
  --red-500: #ef4444;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --white: #ffffff;

  /* Semantic */
  --primary:        var(--blue-600);
  --primary-hover:  var(--blue-700);
  --primary-light:  var(--blue-50);
  --success:        var(--green-500);
  --warning:        var(--orange-500);
  --danger:         var(--red-500);
  --text-primary:   var(--slate-900);
  --text-secondary: var(--slate-500);
  --text-muted:     var(--slate-400);
  --bg-page:        var(--slate-50);
  --bg-card:        var(--white);
  --border-color:   var(--slate-200);

  /* Spacing */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.10);
  --shadow-xl:  0 20px 60px rgba(0,0,0,.12);

  /* Transitions */
  --transition: all .2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, textarea, select { font-family: inherit; outline: none; }
ul { list-style: none; }

/* ── Hidden utility ── */
.hidden { display: none !important; }

/* ── App Shell ── */
#app { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 256px;
  background: var(--white);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s ease;
}
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px;
}
.sidebar-logo .logo-text { font-weight: 700; font-size: 15px; color: var(--slate-900); line-height: 1.2; }
.sidebar-logo .logo-text span { font-size: 10px; color: var(--blue-600); font-weight: 500; display: block; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-section-label {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 0;
  color: var(--slate-600);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  margin: 1px 8px;
  border-radius: var(--radius-md);
}
.nav-item:hover { background: var(--slate-50); color: var(--slate-900); }
.nav-item.active {
  background: var(--blue-50);
  color: var(--blue-600);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--blue-600);
  border-radius: 0 3px 3px 0;
  left: -8px;
}
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--blue-600);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
}
.user-mini {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.user-mini:hover { background: var(--slate-50); }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info .user-name { font-size: 13px; font-weight: 600; color: var(--slate-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .user-role { font-size: 11px; color: var(--text-muted); }

/* ── Main Content ── */
.main-content {
  flex: 1;
  margin-left: 256px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top Bar ── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 18px; font-weight: 700; color: var(--slate-900); }
.topbar-subtitle { font-size: 13px; color: var(--text-muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--slate-50);
  border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
  color: var(--slate-500);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.topbar-btn:hover { background: var(--slate-100); color: var(--slate-700); }

/* ── Page Content ── */
.page-content { flex: 1; padding: 32px; }
.page { display: none; }
.page.active { display: block; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-xl { padding: 16px 32px; font-size: 16px; border-radius: var(--radius-lg); }

.btn-primary {
  background: var(--blue-600);
  color: white;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.btn-primary:hover { background: var(--blue-700); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  background: var(--white);
  color: var(--slate-700);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--slate-50); border-color: var(--slate-300); }

.btn-ghost {
  background: transparent;
  color: var(--blue-600);
  padding: 8px 12px;
}
.btn-ghost:hover { background: var(--blue-50); }

.btn-success { background: var(--green-500); color: white; }
.btn-success:hover { background: var(--green-600); }
.btn-danger { background: var(--red-500); color: white; }
.btn-icon { padding: 8px; border-radius: var(--radius-md); }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-sm { padding: 16px; border-radius: var(--radius-lg); }
.card-lg { padding: 32px; border-radius: var(--radius-2xl); }

/* ── Progress Bar ── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--slate-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-400));
  border-radius: var(--radius-full);
  transition: width .5s ease;
}

/* ── Score Circle (SVG gauge) ── */
.score-circle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.score-circle svg { transform: rotate(-90deg); }
.score-circle-value {
  font-size: 48px;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1;
}
.score-circle-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}
.badge-blue   { background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-200); }
.badge-green  { background: var(--green-50); color: var(--green-600); border: 1px solid var(--green-100); }
.badge-orange { background: var(--orange-50); color: var(--orange-500); border: 1px solid var(--orange-100); }
.badge-red    { background: var(--red-50); color: var(--red-500); border: 1px solid var(--red-100); }
.badge-gray   { background: var(--slate-100); color: var(--slate-600); border: 1px solid var(--slate-200); }

/* ── Chip / Tag ── */
.chip {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: var(--white);
}
.chip-found  { background: var(--green-50); border-color: var(--green-200); color: var(--green-700); }
.chip-missing { background: var(--red-50); border-color: var(--red-200); color: var(--red-600); }

/* ── Form Elements ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--slate-700); }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--white);
  transition: var(--transition);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-hint { font-size: 12px; color: var(--text-muted); }

/* ── Dropzone ── */
.dropzone {
  border: 2px dashed var(--slate-300);
  border-radius: var(--radius-xl);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--blue-500);
  background: var(--blue-50);
}
.dropzone-icon { font-size: 40px; margin-bottom: 12px; }
.dropzone-title { font-size: 16px; font-weight: 600; color: var(--slate-800); margin-bottom: 6px; }
.dropzone-sub { font-size: 13px; color: var(--text-muted); }

/* ── Step Indicator ── */
.wizard-progress {
  padding: 16px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
}
.wizard-step-count { font-size: 13px; font-weight: 600; color: var(--blue-600); white-space: nowrap; }
.wizard-bar { flex: 1; height: 6px; background: var(--slate-100); border-radius: var(--radius-full); overflow: hidden; }
.wizard-bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue-600), var(--blue-400)); border-radius: var(--radius-full); transition: width .5s ease; }

/* ── Loading Spinner ── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2.5px solid var(--blue-100);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-lg { width: 48px; height: 48px; border-width: 4px; }

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

/* ── Accordion ── */
.accordion-item { border: 1.5px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; }
.accordion-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  background: var(--white);
  transition: var(--transition);
}
.accordion-header:hover { background: var(--slate-50); }
.accordion-icon { font-size: 18px; }
.accordion-title { flex: 1; font-size: 14px; font-weight: 600; color: var(--slate-800); }
.accordion-arrow { color: var(--text-muted); transition: transform .2s ease; font-size: 12px; }
.accordion-item.open .accordion-arrow { transform: rotate(180deg); }
.accordion-body { padding: 0 20px 20px; border-top: 1px solid var(--border-color); background: var(--white); display: none; }
.accordion-item.open .accordion-body { display: block; padding-top: 16px; }

/* ── Stat Card ── */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-info .stat-value { font-size: 28px; font-weight: 800; color: var(--slate-900); line-height: 1; }
.stat-info .stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stat-info .stat-change { font-size: 12px; font-weight: 600; margin-top: 4px; }
.stat-change.positive { color: var(--green-600); }
.stat-change.negative { color: var(--red-500); }

/* ── Action Card ── */
.action-card {
  background: var(--white);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.action-card:hover {
  border-color: var(--blue-400);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.action-card .action-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.action-card .action-title { font-size: 15px; font-weight: 700; color: var(--slate-800); }
.action-card .action-desc { font-size: 12px; color: var(--text-muted); }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border-color);
  background: var(--slate-50);
}
.data-table th:first-child { border-radius: var(--radius-md) 0 0 0; }
.data-table th:last-child  { border-radius: 0 var(--radius-md) 0 0; }
.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--slate-700);
  border-bottom: 1px solid var(--border-color);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--slate-50); }

/* ── Alert / Info Box ── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-blue   { background: var(--blue-50);   border-color: var(--blue-200);   color: var(--blue-700); }
.alert-green  { background: var(--green-50);  border-color: var(--green-100);  color: var(--green-700); }
.alert-orange { background: var(--orange-50); border-color: var(--orange-100); color: var(--orange-500); }
.alert-red    { background: var(--red-50);    border-color: var(--red-100);    color: var(--red-600); }

/* ── Section Header ── */
.section-header { margin-bottom: 24px; }
.section-title { font-size: 20px; font-weight: 700; color: var(--slate-900); }
.section-sub { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* ── Grid Helpers ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border-color); margin: 24px 0; }

/* ── Toast notification ── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--slate-900);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-lg);
  animation: slideIn .3s ease;
  max-width: 320px;
}
.toast.success { background: var(--green-600); }
.toast.error   { background: var(--red-500); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Mobile hamburger ── */
.hamburger {
  display: none;
  flex-direction: column; gap: 4px;
  padding: 8px;
  cursor: pointer;
}
.hamburger span { display: block; width: 20px; height: 2px; background: var(--slate-600); border-radius: 2px; }

/* ── Overlay ── */
.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}
.overlay.active { display: block; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .page-content { padding: 20px 16px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
}
