/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a1f2e;
  --bg-hover: #232838;
  --text-primary: #f0f4f8;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --border: #1e293b;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-sm: 8px;
}
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== LOGIN ===== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0e1a 0%, #111827 50%, #0f172a 100%);
}
.login-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}
.logo-section {
  text-align: center;
  margin-bottom: 32px;
}
.logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
  color: white;
}
.logo-section h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

.login-form .input-group {
  position: relative;
  margin-bottom: 16px;
}
.login-form .input-group i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}
.login-form input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  transition: all 0.2s;
}
.login-form input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(59,130,246,0.3);
}
.login-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}
.login-info .hint { color: var(--text-muted); margin-top: 4px; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: var(--accent-red); }
.login-footer { text-align: center; margin-top: 24px; color: var(--text-muted); font-size: 12px; }
.login-footer .powered { margin-top: 4px; color: var(--text-secondary); }

/* ===== LAYOUT ===== */
.app-container { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}
.sidebar-brand {
  padding: 24px 20px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand i {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: white;
}
.sidebar-brand span { font-weight: 700; font-size: 16px; letter-spacing: -0.3px; }
.sidebar-nav { flex: 1; padding: 16px 12px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 4px;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.sidebar-nav a.active {
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(6,182,212,0.1));
  color: var(--accent-blue);
}
.sidebar-nav a i { width: 20px; text-align: center; }
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 14px;
}
.user-info i { font-size: 20px; color: var(--accent-cyan); }
.badge-admin {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.logout {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.logout:hover { background: rgba(239,68,68,0.1); color: var(--accent-red); }

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 24px 32px;
  min-height: 100vh;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.topbar h2 { font-size: 22px; font-weight: 700; }
.topbar h2 i { color: var(--accent-cyan); margin-right: 8px; }

/* ===== BUTTONS ===== */
.btn-primary {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(59,130,246,0.3); }
.btn-success {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--accent-green), #059669);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-secondary {
  padding: 10px 20px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
}
.btn-outline {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-sm {
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-apply {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: white;
}
.btn-text {
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex; align-items: center; gap: 16px;
  transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.stat-card.blue .stat-icon { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.stat-card.green .stat-icon { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.stat-card.orange .stat-icon { background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.stat-card.red .stat-icon { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.stat-info h3 { font-size: 28px; font-weight: 800; }
.stat-info p { color: var(--text-secondary); font-size: 14px; }

/* ===== SECTIONS ===== */
.section { margin-bottom: 28px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h3 { font-size: 18px; font-weight: 600; }
.section-header h3 i { color: var(--accent-cyan); margin-right: 8px; }

/* ===== TABLE ===== */
.jobs-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.jobs-table { width: 100%; border-collapse: collapse; }
.jobs-table th {
  background: var(--bg-secondary);
  padding: 14px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.jobs-table td { padding: 14px 16px; border-top: 1px solid var(--border); font-size: 14px; }
.jobs-table tr:hover td { background: var(--bg-hover); }
.match-bar {
  width: 100px;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.match-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
  border-radius: 3px;
  transition: width 0.5s ease;
}
.match-bar span {
  position: absolute;
  right: 0;
  top: -18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-green);
}

/* ===== BADGES ===== */
.badge-source, .badge-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-source.linkedin { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.badge-source.indeed { background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.badge-source.glassdoor { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.badge-status.novo { background: rgba(139,92,246,0.15); color: var(--accent-purple); }
.badge-status.aplicado { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.badge-status.pendente { background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.badge-status.erro { background: rgba(239,68,68,0.15); color: var(--accent-red); }

/* ===== UPLOAD ===== */
.upload-section { max-width: 800px; }
.upload-card {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.upload-card:hover { border-color: var(--accent-blue); background: rgba(59,130,246,0.05); }
.upload-card.dragover { border-color: var(--accent-cyan); background: rgba(6,182,212,0.05); }
.upload-icon { font-size: 48px; color: var(--accent-blue); margin-bottom: 16px; }
.upload-card h3 { font-size: 20px; margin-bottom: 8px; }
.upload-link { color: var(--accent-blue); font-weight: 600; }
.upload-hint { color: var(--text-muted); font-size: 13px; margin-top: 8px; }
.upload-progress {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  text-align: center;
}
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 4px;
  animation: progress 2s ease-in-out infinite;
}
@keyframes progress {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}
.cv-results { margin-top: 24px; }
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.result-card.full { grid-column: 1 / -1; }
.result-card h3 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.result-card h3 i { color: var(--accent-cyan); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list span {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.cv-preview {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
}

/* ===== JOBS GRID ===== */
.jobs-toolbar {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px;
}
.search-box {
  flex: 1;
  position: relative;
}
.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-box input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
}
.filter-group { display: flex; gap: 8px; }
.filter-group select {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
}
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}
.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
}
.job-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent-blue); }
.job-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}
.job-title-section h4 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.job-title-section .company { color: var(--text-secondary); font-size: 13px; }
.match-ring {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: conic-gradient(var(--accent-green) calc(var(--match) * 1%), var(--bg-secondary) 0);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.match-ring::before {
  content: '';
  width: 38px; height: 38px;
  background: var(--bg-card);
  border-radius: 50%;
  position: absolute;
}
.match-ring span {
  position: relative;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-green);
}
.job-meta {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.job-meta span { font-size: 13px; color: var(--text-secondary); }
.job-desc { color: var(--text-muted); font-size: 13px; line-height: 1.6; margin-bottom: 16px; }
.job-actions {
  display: flex; align-items: center; gap: 8px;
}
.job-select {
  width: 20px; height: 20px;
  accent-color: var(--accent-blue);
  margin-left: auto;
}

/* ===== SETTINGS ===== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 900px;
}
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.settings-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.settings-card h3 i { color: var(--accent-cyan); }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent-blue);
}
.form-group .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-group.checkbox label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
}
.form-group.checkbox input { width: auto; }
.checkbox-group { display: flex; flex-direction: column; gap: 10px; }
.checkbox-group label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal.active { display: flex; }
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-content h3 { margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.modal-content h3 i { color: var(--accent-cyan); }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 12px;
  margin-top: 24px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  padding: 14px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--accent-green); }
.toast.error { border-color: var(--accent-red); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; }
.empty-state p { font-size: 14px; }
.empty-state.full { grid-column: 1 / -1; }

/* ===== UTILS ===== */
.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr; }
  .jobs-grid { grid-template-columns: 1fr; }
  .jobs-toolbar { flex-direction: column; }
}
