:root {
  --bg-main: #0B0F19;
  --bg-card: rgba(21, 29, 46, 0.75);
  --bg-card-hover: rgba(29, 40, 64, 0.9);
  --bg-input: rgba(15, 23, 42, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.4);

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --color-primary: #6366F1;
  --color-primary-glow: rgba(99, 102, 241, 0.25);
  --color-emerald: #10B981;
  --color-emerald-glow: rgba(16, 185, 129, 0.2);
  --color-amber: #F59E0B;
  --color-amber-glow: rgba(245, 158, 11, 0.2);
  --color-rose: #EF4444;
  --color-rose-glow: rgba(239, 68, 68, 0.2);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 16px 80px 16px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-box {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #4F46E5, #06B6D4);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.35);
}

.logo-icon {
  width: 24px;
  height: 24px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.badge-admin {
  background: rgba(99, 102, 241, 0.2);
  color: #A5B4FC;
  border: 1px solid rgba(99, 102, 241, 0.35);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--color-emerald);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--color-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.header-actions {
  display: flex;
  gap: 8px;
}

.btn-icon-glass {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 9px 13px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition-fast);
}

.btn-icon-glass:hover, .btn-icon-glass:active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-icon-glass svg {
  width: 17px;
  height: 17px;
}

.spin-anim {
  animation: spin 0.8s linear infinite;
}

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

/* Stats KPI Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-card);
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.stat-card.active-card {
  border-color: var(--color-primary);
  box-shadow: 0 0 20px var(--color-primary-glow);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-icon-wrapper {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-wrapper svg {
  width: 15px;
  height: 15px;
}

.stat-icon-wrapper.total { background: rgba(99, 102, 241, 0.15); color: #818CF8; }
.stat-icon-wrapper.pending { background: var(--color-amber-glow); color: var(--color-amber); }
.stat-icon-wrapper.approved { background: var(--color-emerald-glow); color: var(--color-emerald); }
.stat-icon-wrapper.rejected { background: var(--color-rose-glow); color: var(--color-rose); }

.stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #FFFFFF;
}

.stat-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Search and Filters */
.controls-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 13px 40px 13px 44px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 15px var(--color-primary-glow);
}

.btn-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px var(--color-primary-glow);
}

/* Applications List */
.applications-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  padding: 3px 9px;
  border-radius: 12px;
}

.applications-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Application Card */
.app-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition-fast);
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.app-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

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

.candidate-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.candidate-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #374151, #1F2937);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #E2E8F0;
  flex-shrink: 0;
}

.candidate-name {
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.candidate-vacancy {
  font-size: 0.8rem;
  color: #A5B4FC;
  font-weight: 500;
}

/* Status Badges */
.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-badge.pending {
  background: var(--color-amber-glow);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-badge.approved {
  background: var(--color-emerald-glow);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-badge.rejected {
  background: var(--color-rose-glow);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.status-badge.incomplete {
  background: rgba(249, 115, 22, 0.2);
  color: #FB923C;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.app-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 8px 10px;
  background: rgba(10, 15, 25, 0.4);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-dim);
}

.app-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.app-card-actions {
  display: flex;
  gap: 8px;
}

.btn-card-action {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-card-action:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-card-action.approve-small {
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.3);
}

.btn-card-action.approve-small:hover {
  background: var(--color-emerald-glow);
}

.btn-card-action.reject-small {
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-card-action.reject-small:hover {
  background: var(--color-rose-glow);
}

/* Empty & Loading States */
.empty-state, .loading-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

.empty-icon-box {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  background: var(--bg-glass);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

.empty-icon-box svg {
  width: 30px;
  height: 30px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
}

/* Slide-Over Modal / Bottom Sheet */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  background: #111827;
  border: 1px solid var(--border-color);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-drag-handle {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin: 10px auto 4px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4F46E5, #06B6D4);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.modal-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.modal-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-app-id {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
}

.modal-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.btn-close {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

/* Quick Actions in Modal */
.modal-quick-actions {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.action-chip {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.action-chip svg {
  width: 15px;
  height: 15px;
}

.action-chip.call {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.3);
}

.action-chip.tg {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border-color: rgba(59, 130, 246, 0.3);
}

.action-chip.cv {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border-color: rgba(245, 158, 11, 0.3);
}

.action-chip:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

/* Modal Body Q&A */
.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.subsection-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.qa-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qa-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.qa-question {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.qa-answer {
  font-size: 0.92rem;
  color: #FFFFFF;
  font-weight: 600;
  word-break: break-word;
}

/* Modal Footer Actions */
.modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: #111827;
}

.btn-action {
  flex: 1;
  padding: 13px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-action svg {
  width: 18px;
  height: 18px;
}

.btn-action.approve {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-action.approve:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-action.reject {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-action.reject:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--border-color);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 2000;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, 15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.hidden {
  display: none !important;
}

/* Responsive Media Queries */
@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .btn-text-desktop {
    display: none;
  }
}
