* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  color: #2d3748;
  height: 100vh;
  overflow: hidden;
}

/* ======= LOGIN ======= */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}

#login-screen::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  pointer-events: none;
}

#login-screen::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
  bottom: -150px;
  left: -100px;
  pointer-events: none;
}

#login-box {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 44px 40px 36px;
  width: 420px;
  text-align: center;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 1;
  animation: loginBoxIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginBoxIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  margin-bottom: 20px;
}

.login-logo-icon {
  display: inline-block;
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

#login-box h1 {
  font-size: 1.7rem;
  color: #fff;
  margin-bottom: 6px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-subtitle {
  color: #a5b4fc !important;
  font-size: 0.9rem !important;
  margin-bottom: 6px !important;
  font-weight: 500 !important;
}

.developer-credit {
  color: rgba(148, 163, 184, 0.5) !important;
  font-size: 0.7rem !important;
  font-weight: 400;
  margin-bottom: 20px !important;
}

.login-features {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.login-features span {
  font-size: 0.72rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.login-form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#login-box input {
  display: block;
  width: 100%;
  padding: 13px 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  direction: rtl;
  outline: none;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

#login-box input::placeholder {
  color: #64748b;
}

#login-box input:focus {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

#login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

#login-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

#login-error {
  margin-top: 15px;
  color: #f87171;
  font-size: 0.9rem;
  font-weight: 600;
}

#app {
  display: flex;
  height: 100vh;
}

.hidden {
  display: none !important;
}

/* ======= SIDEBAR ======= */
#sidebar {
  width: 280px;
  min-width: 280px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  color: #1e293b;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  overflow-y: auto;
  border-left: 1px solid #e2e8f0;
}

#sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 15px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 15px;
}

#sidebar h1 {
  font-size: 1.3rem;
}

#logout-btn {
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #64748b;
  transition: all 0.2s;
}

#logout-btn:hover {
  background: #e74c3c;
  border-color: #e74c3c;
  color: #fff;
}

#add-job-form {
  display: flex;
  gap: 8px;
  padding: 0 15px;
  margin-bottom: 15px;
}

#job-title-input {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

#job-title-input::placeholder {
  color: #94a3b8;
}

#job-title-input:focus {
  background: #333366;
}

#add-job-btn {
  padding: 8px 14px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

#add-job-btn:hover {
  background: #3a56d4;
}

#jobs-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
}

.job-item {
  padding: 12px 20px;
  cursor: pointer;
  border-right: 3px solid transparent;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.job-item:hover {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
}

.job-item.active {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  border-right-color: #6366f1;
}

.job-item .job-name {
  font-size: 0.95rem;
}

.job-item .candidate-count {
  background: #6366f1;
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  min-width: 24px;
  text-align: center;
}

/* ======= MAIN CONTENT ======= */
#main-content {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  background: linear-gradient(180deg, #eef2f7 0%, #e2e8f0 100%);
}

#welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #888;
}

.welcome-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: welcomeBounce 3s ease-in-out infinite;
  line-height: 1;
}

@keyframes welcomeBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

#welcome-screen h2 {
  font-size: 1.6rem;
  color: #1e293b;
  margin-bottom: 6px;
  font-weight: 800;
}

.welcome-subtitle {
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 35px;
}

.welcome-features {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.welcome-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 16px;
  padding: 22px 28px;
  min-width: 160px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: all 0.3s;
}

.welcome-feature:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

.wf-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.wf-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
}

.wf-desc {
  font-size: 0.78rem;
  color: #94a3b8;
}

/* Job Header */
#job-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e2e8f0;
}

#job-title-display {
  font-size: 1.6rem;
  color: #1e293b;
}

#job-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

#upload-label {
  padding: 10px 18px;
  background: #6366f1;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}

#upload-label:hover {
  background: #4f46e5;
}

#upload-label input {
  display: none;
}

#delete-job-btn {
  padding: 10px 14px;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  color: #94a3b8;
  transition: all 0.2s;
}

#delete-job-btn:hover {
  background: #fee;
  border-color: #e74c3c;
}

#upload-status {
  padding: 12px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  animation: fadeIn 0.3s;
}

#upload-status.success {
  background: #ecfdf5;
  color: #059669;
}

#upload-status.error {
  background: #fef2f2;
  color: #dc2626;
}

#upload-status.loading {
  background: #fffbeb;
  color: #d97706;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Candidates Grid */
#candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.candidate-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.candidate-card:hover {
  background: #ffffff;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15), 0 2px 6px rgba(0, 0, 0, 0.06);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-3px);
}

.candidate-card .card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 12px;
}

.candidate-card .card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: #555;
}

.candidate-card .card-info span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
}

.candidate-card .card-file {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.8rem;
  color: #888;
}

.candidate-card .has-notes {
  display: inline-block;
  margin-top: 8px;
  background: #fffbeb;
  color: #d97706;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
}

#no-candidates {
  text-align: center;
  color: #94a3b8;
  padding: 60px 0;
  font-size: 1rem;
}

/* ======= MODAL ======= */
#candidate-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

#modal-content {
  position: relative;
  background: #fff;
  border-radius: 20px;
  width: 94%;
  max-width: 1050px;
  max-height: 88vh;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(99, 102, 241, 0.08);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

#modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(241, 245, 249, 0.9);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: all 0.2s;
  z-index: 10;
}

#modal-close:hover {
  background: #fee2e2;
  color: #dc2626;
}

#modal-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 88vh;
  max-height: 88vh;
}

/* Top bar - name */
#modal-top-bar {
  padding: 24px 30px 16px;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

/* Two column layout */
#modal-columns {
  display: flex;
  flex: 1;
  min-height: 0;
}

#modal-col-right {
  width: 45%;
  min-width: 340px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e2e8f0;
  background: #fff;
}

#modal-col-right #modal-info {
  padding: 20px 24px 0;
  flex-shrink: 0;
}

#modal-col-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f8fafc;
}

/* Details */
#modal-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}

.detail-label {
  font-weight: 600;
  color: #64748b;
  min-width: 90px;
  font-size: 0.85rem;
}

.detail-value {
  color: #1e293b;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

/* Resume section */
#modal-resume-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
}

#resume-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid #e2e8f0;
}

#modal-resume-section h3 {
  font-size: 1rem;
  color: #475569;
  margin: 0;
  font-weight: 700;
}

#modal-resume-preview {
  flex: 1;
  overflow-y: auto;
  background: #f8fafc;
  padding: 20px 24px;
  font-size: 0.84rem;
  line-height: 1.7;
  white-space: pre-wrap;
  direction: rtl;
  color: #334155;
  margin: 0;
  border: none;
  border-radius: 0;
}

#modal-resume-preview::-webkit-scrollbar {
  width: 6px;
}

#modal-resume-preview::-webkit-scrollbar-track {
  background: transparent;
}

#modal-resume-preview::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

#modal-resume-preview::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

#modal-resume-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #eef2ff;
  color: #4f46e5;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
  border: 1px solid transparent;
}

#modal-resume-download:hover {
  background: #e0e7ff;
  border-color: #c7d2fe;
}

/* Notes */
#modal-notes-section {
  padding: 16px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  border-top: none;
}

#modal-notes-section h3 {
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: #475569;
  font-weight: 700;
}

#modal-notes {
  width: 100%;
  flex: 1;
  min-height: 90px;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  resize: none;
  outline: none;
  direction: rtl;
  line-height: 1.6;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f8fafc;
}

#modal-notes:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: #fff;
}

#save-notes-btn {
  padding: 9px 20px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

#save-notes-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

#notes-saved-msg {
  margin-right: 10px;
  color: #059669;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Bottom actions bar */
#modal-bottom-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

/* Card bottom row */
.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.delete-candidate-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #94a3b8;
  transition: all 0.2s;
  opacity: 0;
}

.candidate-card:hover .delete-candidate-btn {
  opacity: 1;
}

.delete-candidate-btn:hover {
  background: #fee;
  border-color: #e74c3c;
}

/* Modal delete button */
#delete-candidate-btn {
  padding: 10px 22px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
  margin-right: auto;
}

#delete-candidate-btn:hover {
  background: #c0392b;
}

.notes-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

/* Editable fields */
.editable-field {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1a1a2e;
  outline: none;
  direction: rtl;
  flex: 1;
  transition: border-color 0.2s, background 0.2s;
  background: #f8f9fa;
}

.editable-field:focus {
  border-color: #6366f1;
  background: #fff;
}

.editable-name {
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid transparent;
  background: transparent;
  padding: 6px 10px;
  width: 100%;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.editable-name:hover {
  border-color: #c7d2fe;
  background: rgba(255, 255, 255, 0.7);
}

.editable-name:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#save-details-btn {
  margin-top: 12px;
  padding: 8px 18px;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

#save-details-btn:hover {
  background: #218838;
}

#details-saved-msg {
  margin-right: 10px;
  color: #28a745;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Job title wrapper */
#job-title-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

#rename-job-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  opacity: 0.5;
}

#rename-job-btn:hover {
  opacity: 1;
  border-color: #6366f1;
}

/* Move candidate */
.move-candidate {
  display: flex;
  align-items: center;
  gap: 8px;
}

#move-to-job {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  direction: rtl;
  outline: none;
  cursor: pointer;
}

#move-to-job:focus {
  border-color: #6366f1;
}

#move-candidate-btn {
  padding: 8px 16px;
  background: #ff9800;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

#move-candidate-btn:hover {
  background: #e68900;
}

/* ======= DRAG & DROP ======= */
.candidate-card[draggable="true"] {
  cursor: grab;
}

.candidate-card.dragging {
  opacity: 0.4;
  transform: scale(0.95);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.job-item.drag-over {
  background: rgba(99, 102, 241, 0.2) !important;
  border: 2px dashed #6366f1;
  transform: scale(1.03);
  transition: all 0.2s;
}

/* ======= MOBILE ======= */
@media (max-width: 768px) {
  body { overflow: auto; }

  #app {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  #sidebar {
    width: 100%;
    min-width: 100%;
    max-height: none;
    padding: 15px 0;
  }

  #sidebar-header {
    padding: 0 15px 10px;
  }

  #sidebar h1 { font-size: 1.1rem; }

  #add-job-form {
    padding: 0 10px;
    margin-bottom: 10px;
  }

  #jobs-list {
    display: flex;
    overflow-x: auto;
    padding: 0 10px;
    gap: 6px;
  }

  .job-item {
    padding: 8px 14px;
    white-space: nowrap;
    border-right: none;
    border-bottom: 3px solid transparent;
    border-radius: 8px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    font-size: 0.85rem;
  }

  .job-item.active {
    border-bottom-color: #4361ee;
    border-right-color: transparent;
  }

  #main-content {
    padding: 15px;
    overflow-y: visible;
  }

  #job-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  #job-title-display { font-size: 1.2rem; }

  #job-actions {
    width: 100%;
    justify-content: flex-start;
  }

  #upload-label {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  #candidates-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .candidate-card {
    padding: 15px;
  }

  .delete-candidate-btn {
    opacity: 1;
  }

  /* Modal mobile */
  #modal-content {
    width: 98%;
    max-height: 95vh;
    border-radius: 14px;
  }

  #modal-body { height: 95vh; max-height: 95vh; }

  #modal-columns {
    flex-direction: column;
  }

  #modal-col-right {
    width: 100%;
    min-width: auto;
    border-left: none;
    border-bottom: 1px solid #e2e8f0;
  }

  #modal-col-left {
    max-height: 40vh;
  }

  #modal-top-bar {
    padding: 18px 16px 12px;
  }

  #modal-col-right #modal-info {
    padding: 14px 16px 0;
  }

  #modal-notes-section {
    padding: 12px 16px;
  }

  #modal-bottom-actions {
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  #resume-header {
    padding: 12px 16px;
  }

  #modal-resume-preview {
    padding: 14px 16px;
  }

  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .detail-label { min-width: auto; }

  .editable-field { width: 100%; }

  .notes-actions {
    flex-wrap: wrap;
  }

  .move-candidate {
    width: 100%;
  }

  #move-to-job { flex: 1; }

  #login-box {
    width: 92%;
    padding: 30px 22px 26px;
  }

  .login-features {
    gap: 8px;
  }

  .login-features span {
    font-size: 0.68rem;
    padding: 4px 10px;
  }

  .welcome-features {
    gap: 12px;
  }

  .welcome-feature {
    padding: 16px 20px;
    min-width: 130px;
  }
}

/* Add manual candidate button */
#add-manual-btn {
  padding: 10px 18px;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.2s;
}

#add-manual-btn:hover {
  background: #218838;
}

/* ======= ARCHIVE ======= */
#archive-section {
  border-top: 2px solid #e2e8f0;
  margin-top: auto;
  padding: 10px 0;
}

#archive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  color: #1e293b;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: #f8fafc;
  border-radius: 8px;
  margin: 0 10px;
}

#archive-header:hover {
  background: #eef2ff;
  color: #4f46e5;
}

#toggle-archive-btn {
  background: none;
  border: none;
  color: #1e293b;
  cursor: pointer;
  font-size: 0.8rem;
  transition: transform 0.3s;
}

#toggle-archive-btn.open {
  transform: rotate(180deg);
}

#archive-list {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
}

.archive-item {
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #334155;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.archive-item:hover {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
}

.archive-item .archive-name {
  flex: 1;
  text-decoration: line-through;
  opacity: 0.85;
  color: #475569;
}

.archive-actions {
  display: flex;
  gap: 6px;
}

.archive-restore-btn, .archive-delete-btn {
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
}

.archive-restore-btn {
  color: #4caf50;
  border-color: #4caf50;
}

.archive-restore-btn:hover {
  background: #4caf50;
  color: #fff;
}

.archive-delete-btn {
  color: #e74c3c;
  border-color: #e74c3c;
}

.archive-delete-btn:hover {
  background: #e74c3c;
  color: #fff;
}

/* WhatsApp buttons */
.wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 50%;
  background: #25d366;
  margin-right: 4px;
  transition: transform 0.2s, box-shadow 0.2s;
  vertical-align: middle;
}

.wa-btn:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.4);
}

.wa-btn-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  text-decoration: none;
  border-radius: 50%;
  background: #25d366;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.wa-btn-modal:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(37, 211, 102, 0.4);
}

.job-owner {
  display: inline-block;
  font-size: 0.7rem;
  background: rgba(99,102,241,0.15);
  color: #6366f1;
  padding: 1px 6px;
  border-radius: 8px;
  margin-right: 4px;
  font-weight: 600;
}

/* ======= ADMIN PANEL ======= */
#admin-nav-btn {
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #64748b;
  transition: all 0.2s;
  margin-left: 6px;
}

#admin-nav-btn:hover {
  background: #eef2ff;
  border-color: #6366f1;
  color: #6366f1;
}

#admin-header {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e2e8f0;
}

#admin-header h2 {
  font-size: 1.5rem;
  color: #1e293b;
}

#admin-add-user {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  padding: 16px;
  background: rgba(255,255,255,0.85);
  border-radius: 12px;
  border: 1px solid rgba(99,102,241,0.15);
}

#admin-add-user input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  direction: rtl;
  outline: none;
}

#admin-add-user input:focus {
  border-color: #6366f1;
}

#admin-add-user-btn {
  padding: 10px 20px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.2s;
  white-space: nowrap;
}

#admin-add-user-btn:hover {
  background: #4f46e5;
}

#admin-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.admin-user-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid rgba(99,102,241,0.15);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

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

.admin-user-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
}

.admin-user-role {
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 12px;
  background: #eef2ff;
  color: #6366f1;
  font-weight: 600;
}

.admin-user-stats {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 12px;
}

.admin-user-jobs {
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
  margin-bottom: 12px;
}

.admin-job-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.85rem;
  color: #475569;
}

.admin-job-row.archived {
  text-decoration: line-through;
  opacity: 0.5;
}

.admin-job-count {
  color: #94a3b8;
  font-size: 0.8rem;
}

.admin-user-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.admin-show-pw-btn, .admin-change-pw-btn, .admin-delete-user-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid;
}

.admin-show-pw-btn {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #86efac;
}

.admin-show-pw-btn:hover {
  background: #dcfce7;
}

.admin-change-pw-btn {
  background: #eff6ff;
  color: #3b82f6;
  border-color: #bfdbfe;
}

.admin-change-pw-btn:hover {
  background: #dbeafe;
}

.admin-delete-user-btn {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

.admin-delete-user-btn:hover {
  background: #fee2e2;
}

/* --- Requirements Panel --- */
#requirements-panel {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  transition: box-shadow 0.3s;
}

#requirements-panel:hover {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15), 0 2px 6px rgba(0, 0, 0, 0.06);
}

#req-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  cursor: pointer;
  color: #4338ca;
  user-select: none;
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.8), rgba(224, 231, 255, 0.6));
  transition: background 0.2s;
}

#req-header:hover {
  background: linear-gradient(135deg, rgba(224, 231, 255, 0.9), rgba(199, 210, 254, 0.7));
}

#req-header h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

#req-toggle {
  transition: transform 0.3s;
  font-size: 0.9rem;
  color: #6366f1;
}

#req-toggle.open {
  transform: rotate(180deg);
}

#req-body {
  padding: 14px 18px 16px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.5), rgba(255, 255, 255, 0.8));
  max-height: 65vh;
  overflow-y: auto;
}

.req-category {
  margin-bottom: 12px;
}

.req-category:last-child {
  margin-bottom: 8px;
}

.req-category-title {
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
  letter-spacing: 0.02em;
}

.req-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.req-checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #475569;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.req-checkbox-label:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

.req-checkbox-label input[type=checkbox] {
  accent-color: #6366f1;
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.req-checkbox-label.checked {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border-color: #a5b4fc;
  color: #3730a3;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.15);
}

#save-requirements-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  padding: 8px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  margin-top: 10px;
  font-family: inherit;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

#save-requirements-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

#req-saved-msg {
  color: #059669;
  font-size: 0.85rem;
  margin-right: 12px;
  font-weight: 600;
}

/* Match Score on Candidate Card */
.match-badge {
  display: block;
  text-align: center;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.match-high { background: #16a34a; }
.match-medium { background: #f59e0b; }
.match-low { background: #dc2626; }


/* Match tooltip box */
.match-badge {
  cursor: pointer;
}

.match-badge[data-tip] {
  position: relative;
}

.match-badge[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  top: 100%;
  left: 0;
  background: #1f2937;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 400;
  width: 220px;
  z-index: 100;
  margin-top: 6px;
  line-height: 1.5;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  white-space: normal;
}

/* Hint under requirements */
.req-hint {
  text-align: center;
  color: #4338ca;
  font-size: 0.85rem;
  font-weight: 600;
  margin: -4px 0 20px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  letter-spacing: -0.01em;
}
.req-hint-secondary {
  margin-top: -12px !important;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7) !important;
  border-color: #86efac !important;
  color: #166534 !important;
}