:root, [data-theme="dark"] {
  /* Baligo Dark Theme - Default */
  --bg-color: #0f172a;
  --surface-color: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --secondary-color: #ec4899;
  --danger-color: #f43f5e;
  --danger-hover: #e11d48;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  
  --brand-gradient: linear-gradient(135deg, #6366f1, #ec4899);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --transition: all 0.2s ease;
}

[data-theme="colorful"] {
  --bg-color: #f1f5f9;
  --surface-color: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border-color: #e2e8f0;
  --primary-color: #6366f1;
  --secondary-color: #ec4899;
  --brand-gradient: linear-gradient(135deg, #6366f1, #ec4899);
}

[data-theme="light"] {
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --brand-gradient: linear-gradient(135deg, #2563eb, #1d4ed8);
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.page-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background-color: var(--surface-color);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: transform 0.3s ease-in-out;
}

.sidebar.mobile-hidden {
  transform: translateX(-100%);
}

@media (min-width: 1024px) {
  .sidebar.mobile-hidden {
    transform: translateX(0);
  }
}

.brand {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  background: var(--brand-gradient);
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.brand-text {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-primary);
}

.sidebar-nav { flex-grow: 1; padding: 1.5rem 0.75rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  margin-bottom: 0.25rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover {
  background-color: var(--bg-color);
  color: var(--text-primary);
}

.nav-link.active {
  background-color: var(--primary-color);
  color: white;
}

.text-danger { color: var(--danger-color); }
.text-danger:hover { background-color: #fef2f2; color: var(--danger-hover); }

.sidebar-bottom {
  padding: 1.5rem 0.75rem;
  border-top: 1px solid var(--border-color);
}

.main-content {
  flex-grow: 1;
  margin-left: 0;
  min-height: 100vh;
  padding: 1.5rem;
  max-width: 100%;
  transition: margin-left 0.3s ease-in-out;
  width: 100%;
}

@media (min-width: 1024px) {
  .main-content {
    margin-left: 260px;
    padding: 2.5rem;
    max-width: calc(100% - 260px);
  }
}

.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  margin: -1.5rem -1.5rem 1.5rem -1.5rem;
}

@media (min-width: 1024px) {
  .mobile-header {
    display: none;
  }
}

.hamburger-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

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

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}

h1 { font-size: 1.875rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.25rem; }
h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.75rem; }
h4 { font-size: 1.125rem; font-weight: 600; }
.subtext { color: var(--text-secondary); font-size: 0.95rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-large { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; display: flex; }

.btn-primary { background: var(--brand-gradient); color: white; border: none; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3); }

.btn-outline { background-color: var(--surface-color); border-color: var(--border-color); color: var(--text-primary); }
.btn-outline:hover { background-color: var(--bg-color); }

.btn-danger { background-color: var(--surface-color); border-color: var(--danger-color); color: var(--danger-color); }
.btn-danger:hover { background-color: var(--danger-color); color: white; }

.btn-text { background: none; border: none; color: var(--primary-color); font-weight: 500; cursor: pointer; transition: color 0.15s; font-size: 0.875rem; }
.btn-text:hover { color: var(--primary-hover); text-decoration: underline; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  transition: var(--transition);
  cursor: pointer;
}
.btn-icon:hover { color: var(--primary-color); border-color: var(--primary-color); }
.icon-delete:hover { color: var(--danger-color); border-color: var(--danger-color); }
.inline-form { display: inline-block; margin: 0; }

/* Cards */
.card {
  background-color: var(--surface-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.danger-card { border: 1px solid var(--danger-color); background-color: rgba(244, 63, 94, 0.05); }
.card-light { background-color: var(--bg-color); border-radius: var(--radius-md); padding: 1rem; border: 1px solid var(--border-color); }
.max-w-md { max-width: 32rem; }
.max-w-lg { max-width: 48rem; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
label { display: block; font-weight: 500; font-size: 0.875rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.required { color: var(--danger-color); }

.text-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--surface-color);
  color: var(--text-primary);
}

.text-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.text-input:disabled { background-color: var(--bg-color); cursor: not-allowed; }

.textarea-tall { min-height: 120px; resize: vertical; }

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper .text-input {
  padding-right: 2.5rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.password-toggle-btn:hover {
  color: var(--primary-color);
}

/* Form Grid */
.row { display: flex; flex-wrap: wrap; margin: 0 -0.75rem; }
.justify-content-center { justify-content: center; }
.col-md-10, .col-md-6, .col-md-4, .col-md-8, .col-md-5, .col-md-7 { padding: 0 0.75rem; width: 100%; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
@media (min-width: 768px) {
  .col-md-6 { width: 50%; }
  .col-md-4 { width: 33.333333%; }
  .col-md-8 { width: 66.666667%; }
  .col-md-5 { width: 41.666667%; }
  .col-md-7 { width: 58.333333%; }
  .col-md-10 { width: 83.333333%; }
}

.flex-between { display: flex; justify-content: space-between; align-items: center; }
.align-items-center { align-items: center; }
.text-right { text-align: right; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.w-100 { width: 100%; }
.divider { border: 0; height: 1px; background: var(--border-color); margin: 1.5rem 0; }

/* Custom Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 30px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
}

.checkbox-label input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.custom-checkbox { position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: 20px; width: 20px; background-color: var(--surface-color); border: 1px solid var(--border-color); border-radius: 4px; transition: var(--transition); }
.checkbox-label:hover input ~ .custom-checkbox { border-color: var(--primary-color); }
.checkbox-label input:checked ~ .custom-checkbox { background-color: var(--primary-color); border-color: var(--primary-color); }
.custom-checkbox:after { content: ""; position: absolute; display: none; left: 6px; top: 2px; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.checkbox-label input:checked ~ .custom-checkbox:after { display: block; }

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.skill-item { display: flex; flex-direction: column; gap: 0.75rem; }
.flex-grow { flex-grow: 1; }

.rating-stars { display: flex; align-items: center; }
.stars { display: flex; gap: 0.25rem; cursor: pointer; }
.star { width: 24px; height: 24px; color: #cbd5e1; transition: color 0.1s; }
.star.hover, .star.active { color: #fbbf24; fill: #fbbf24; }

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.modern-table { width: 100%; border-collapse: collapse; text-align: left; min-width: 800px; }
.modern-table th { font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border-color); padding: 1rem; font-size: 0.875rem; white-space: nowrap; }
.modern-table td { padding: 1rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; font-size: 0.95rem; }
.modern-table tbody tr { transition: var(--transition); }
.modern-table tbody tr:hover { background-color: var(--bg-color); }

.candidate-info { display: flex; align-items: center; gap: 0.75rem; }
.avatar { width: 36px; height: 36px; background-color: var(--primary-color); color: white; display: flex; justify-content: center; align-items: center; border-radius: 50%; font-weight: 600; font-size: 14px; text-transform: uppercase; }
.action-group { display: flex; gap: 0.5rem; justify-content: flex-end; }

/* Badges */
.status-badge { display: inline-flex; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.status-selected { background-color: #d1fae5; color: #047857; }
.status-not-recommended { background-color: #fee2e2; color: #b91c1c; }
.status-hold { background-color: #fef3c7; color: #b45309; }
.status-consider-with-training { background-color: #e0e7ff; color: #4338ca; }
.status-skip { background-color: #f1f5f9; color: #475569; border: 1px solid var(--border-color); }

/* Auth Layout */
.auth-wrapper { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem; background: radial-gradient(circle at top right, #e0e7ff, #fbcfe8, var(--bg-color) 70%); }
.auth-card { background: var(--surface-color); padding: 3rem; border-radius: var(--radius-lg); box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); width: 100%; max-width: 420px; border: 1px solid var(--border-color); /* Glass effect */ background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); }
.auth-header { text-align: center; margin-bottom: 2.5rem; }
.brand-icon-large { margin: 0 auto 1rem; width: 48px; height: 48px; background: var(--brand-gradient); color: white; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; box-shadow: 0 4px 6px -1px rgba(236, 72, 153, 0.3); }
.auth-footer { margin-top: 2rem; color: var(--text-secondary); font-size: 0.875rem; }

/* Modal Framework */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  animation: modalScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-close { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 0.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.modal-close:hover { background: var(--bg-color); color: var(--text-primary); }

.theme-select {
  width: 100%;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
  cursor: pointer;
}

/* Flash Msgs */
.flash-messages { margin-bottom: 2rem; }
.flash { padding: 1rem; border-radius: var(--radius-md); font-weight: 500; font-size: 0.95rem; margin-bottom: 0.5rem; display: flex; align-items: center; }
.flash-success { background-color: rgba(16, 185, 129, 0.1); color: var(--success-color); border-left: 4px solid var(--success-color); }
.flash-error { background-color: rgba(244, 63, 94, 0.1); color: var(--danger-color); border-left: 4px solid var(--danger-color); }

/* Empty state */
.empty-state { text-align: center; padding: 3rem; color: var(--text-secondary); }
.empty-icon { color: #cbd5e1; margin-bottom: 1rem; }

/* Overlay for Mobile Sidebar */
.sidebar-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 30;
  display: none;
}
.sidebar-overlay.active {
  display: block;
}
@media (min-width: 1024px) {
  .sidebar-overlay.active {
    display: none;
  }
}


/* Auth Screens */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-color);
  background-image: radial-gradient(circle at top left, rgba(99, 102, 241, 0.1), transparent),
                    radial-gradient(circle at bottom right, rgba(236, 72, 153, 0.1), transparent);
  padding: 1.5rem;
}

.auth-card {
  background: var(--surface-color);
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  text-align: center;
}

.auth-header { margin-bottom: 2rem; }
.auth-header h2 { margin-bottom: 0.5rem; color: var(--text-primary); }
.auth-header p { color: var(--text-secondary); }

.brand-icon-large {
  margin: 0 auto 1rem;
  width: 56px; height: 56px;
  background: var(--brand-gradient);
  color: white;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.auth-footer { margin-top: 2rem; color: var(--text-secondary); font-size: 0.875rem; }
