/* Candidate Intake Portal - Dashboard & Print Stylesheet */

/* Stats KPI Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(18, 24, 40, 0.65);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  background: rgba(26, 35, 58, 0.78);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

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

.stat-icon.blue { background: rgba(10, 132, 255, 0.2); color: #64D2FF; }
.stat-icon.green { background: rgba(48, 209, 88, 0.2); color: #30D158; }
.stat-icon.amber { background: rgba(255, 159, 10, 0.2); color: #FF9F0A; }
.stat-icon.red { background: rgba(255, 69, 58, 0.2); color: #FF453A; }
.stat-icon.purple { background: rgba(191, 90, 242, 0.2); color: #BF5AF2; }

.stat-info .stat-val {
  font-family: var(--font-primary);
  font-size: 1.6rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.1;
}

.stat-info .stat-lbl {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Control & Filter Bar */
.control-bar {
  background: rgba(18, 24, 40, 0.65);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.search-box-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-box-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding-left: 42px !important;
  border-radius: var(--radius-full) !important;
}

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-select {
  padding: 9px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

/* Candidates Table */
.table-card {
  background: rgba(18, 24, 40, 0.65);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 1.5px rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: rgba(14, 21, 36, 0.9);
  padding: 14px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
}

.data-table td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  color: #E2E8F0;
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.candidate-name-cell {
  display: flex;
  flex-direction: column;
}

.candidate-name-cell strong {
  color: #FFFFFF;
  font-size: 0.95rem;
}

.candidate-name-cell span {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.category-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(14, 165, 233, 0.15);
  color: #38BDF8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.app-id-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.12);
  color: #818CF8;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.25);
  display: inline-block;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.badge-status.PENDING {
  background: rgba(148, 163, 184, 0.12);
  color: #CBD5E1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.badge-status.PENDING::before { background: #94A3B8; }

.badge-status.SELECTED {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.badge-status.SELECTED::before { background: #10B981; }

.badge-status.REJECTED {
  background: rgba(244, 63, 94, 0.15);
  color: #FB7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}
.badge-status.REJECTED::before { background: #F43F5E; }

.badge-status.HOLD {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.badge-status.HOLD::before { background: #F59E0B; }

.badge-status.HOLD_BY_CANDIDATE {
  background: rgba(139, 92, 246, 0.15);
  color: #A78BFA;
  border: 1px solid rgba(139, 92, 246, 0.35);
}
.badge-status.HOLD_BY_CANDIDATE::before { background: #8B5CF6; }

/* Table Action Buttons */
.action-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #CBD5E1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-icon.review {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: #818CF8;
}
.btn-icon.review:hover {
  background: #4F46E5;
  color: #FFFFFF;
}

.btn-icon.delete {
  color: #FB7185;
}
.btn-icon.delete:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: #F43F5E;
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  color: var(--text-subtle);
}

.empty-state h4 {
  font-size: 1.1rem;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Office Use Review Modal */
.modal-review-content {
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: left;
  overflow: hidden;
}

.modal-review-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(14, 21, 36, 0.9);
}

.modal-review-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
}

.office-box-highlight {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(220, 38, 38, 0.03) 100%);
  border: 2px dashed rgba(239, 68, 68, 0.5);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-top: 24px;
}

.office-box-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.office-box-title h4 {
  color: #F87171;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Mobile Responsive Styling for Dashboard */
@media (max-width: 768px) {
  .control-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    gap: 12px;
  }

  .search-box-wrap {
    min-width: 100%;
  }

  .filter-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .filter-select {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
    gap: 10px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
  }

  .stat-info .stat-val {
    font-size: 1.3rem;
  }

  .stat-info .stat-lbl {
    font-size: 0.72rem;
  }

  .candidate-modal-card {
    padding: 18px 14px;
    max-height: 94vh;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Physical Form Print View (replica matching original physical sheets!) */
@media print {
  body {
    background: #FFFFFF !important;
    color: #111827 !important;
    font-family: Arial, sans-serif !important;
  }

  .portal-header,
  .control-bar,
  .stats-grid,
  .btn-nav,
  .btn-submit-main,
  .modal-overlay,
  .no-print {
    display: none !important;
  }

  .printable-sheet {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10mm !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    box-shadow: none !important;
    border: none !important;
  }

  .print-page {
    page-break-after: always;
    min-height: 270mm;
  }

  .print-header {
    border-bottom: 2px solid #1E3A8A;
    padding-bottom: 8px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .print-header h1 {
    font-size: 20pt;
    font-weight: bold;
    color: #1E3A8A;
    margin: 0;
  }

  .print-section-title {
    background: #1E3A8A !important;
    color: #FFFFFF !important;
    padding: 4px 8px;
    font-size: 10pt;
    font-weight: bold;
    text-transform: uppercase;
    margin: 12px 0 8px 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
    margin-bottom: 8px;
  }

  .print-table td, .print-table th {
    padding: 4px 6px;
    border: 1px solid #D1D5DB;
  }

  .print-office-box {
    border: 2px dashed #DC2626 !important;
    padding: 10px;
    margin-top: 15px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
