/* ==========================================================================
   Admin Back-Office Portal Stylesheet (Good IT System International Co., Ltd.)
   ========================================================================== */

.admin-body {
  background-color: #f1f5f9;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--navy-900);
}

.admin-container {
  width: 100%;
  max-width: 1360px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ==========================================================================
   1. Login Screen
   ========================================================================== */
.login-wrapper {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}

.login-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-xl);
  padding: 2.75rem 2.5rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-symbol {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #0284c7 0%, #1e40af 100%);
  border-radius: var(--radius-md);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 16px rgba(2, 132, 199, 0.3);
}

.login-logo-symbol svg {
  width: 28px;
  height: 28px;
}

.login-title {
  font-size: 1.5rem;
  color: var(--navy-900);
  margin-bottom: 0.25rem;
}

.login-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.login-badge {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.login-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy-800);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
}

.login-input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.75rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--navy-900);
  transition: var(--transition);
}

.login-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.btn-toggle-pwd {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
}

.btn-toggle-pwd:hover {
  color: var(--navy-800);
}

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

.login-error-msg {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  text-align: center;
}

.btn-login-submit {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.login-footer {
  text-align: center;
  margin-top: 1rem;
}

.back-link {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--primary);
}

/* ==========================================================================
   2. Admin Topbar
   ========================================================================== */
.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-brand-icon svg {
  width: 20px;
  height: 20px;
}

.admin-brand-title {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
  color: var(--navy-900);
}

.admin-brand-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-user-pill {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
}

/* ==========================================================================
   3. Main Dashboard Layout & Metrics
   ========================================================================== */
.admin-main {
  padding: 2.25rem 0 4rem;
}

.dashboard-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-title {
  font-size: 1.85rem;
  color: var(--navy-900);
}

.dashboard-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.heading-actions {
  display: flex;
  gap: 0.75rem;
}

/* Metrics Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon svg {
  width: 26px;
  height: 26px;
}

.bg-blue { background: #e0f2fe; color: #0284c7; }
.bg-amber { background: #fef3c7; color: #d97706; }
.bg-cyan { background: #cffafe; color: #0891b2; }
.bg-emerald { background: #d1fae5; color: #059669; }

.text-amber { color: #d97706; }
.text-cyan { color: #0891b2; }
.text-emerald { color: #059669; }

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.metric-val {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--navy-900);
}

/* ==========================================================================
   4. Toolbar & Data Table
   ========================================================================== */
.admin-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
}

.toolbar-card {
  padding: 1rem 1.5rem;
}

.toolbar-flex {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.search-input-group {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94a3b8;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-800);
}

.filter-select {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background-color: #ffffff;
}

/* Table Card */
.table-card {
  overflow: hidden;
}

.table-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #ffffff;
}

.table-card-title {
  font-size: 1.15rem;
  color: var(--navy-900);
}

.table-card-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.admin-data-table th {
  background: var(--bg-card-subtle);
  color: var(--navy-800);
  font-weight: 600;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.admin-data-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--navy-900);
  vertical-align: middle;
}

.admin-data-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Thumbnail Photo in Table */
.applicant-thumb-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: #e2e8f0;
  border: 1.5px solid #cbd5e1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.applicant-thumb-wrapper:hover {
  transform: scale(1.08);
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.applicant-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-empty-placeholder {
  color: #94a3b8;
}

.thumb-empty-placeholder svg {
  width: 22px;
  height: 22px;
}

/* Status Pill Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-pending { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.status-interview { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.status-accepted { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.status-rejected { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* Document Attached Pills */
.doc-attached-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  color: var(--navy-800);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.775rem;
  cursor: pointer;
}

.doc-attached-tag:hover {
  background: #e2e8f0;
  color: var(--primary);
}

.doc-attached-tag.none {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: default;
}

.admin-empty-box {
  padding: 4rem 1.5rem;
  text-align: center;
}

.empty-icon {
  width: 54px;
  height: 54px;
  color: #94a3b8;
  margin: 0 auto 1rem;
}

.empty-title {
  font-size: 1.15rem;
  color: var(--navy-800);
  margin-bottom: 0.25rem;
}

.empty-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ==========================================================================
   5. Applicant Full Profile Modal
   ========================================================================== */
.modal-full-profile {
  max-width: 980px;
  width: 95%;
  padding: 2rem;
}

.profile-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1.75rem;
}

.applicant-id-badge {
  background: var(--navy-900);
  color: #ffffff;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.775rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  display: inline-block;
  margin-bottom: 0.35rem;
}

.profile-modal-title {
  font-size: 1.6rem;
  color: var(--navy-900);
}

.profile-modal-date {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.profile-modal-grid {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 2rem;
}

/* Sidebar Col */
.profile-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profile-big-photo-box {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-lg);
  background: #e2e8f0;
  border: 2px solid var(--border-light);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.profile-big-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #94a3b8;
  font-size: 0.85rem;
}

.photo-empty-state svg {
  width: 48px;
  height: 48px;
}

.status-manage-box {
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.status-box-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 0.4rem;
}

.status-select-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  background-color: #ffffff;
}

.contact-mini-box {
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mini-box-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy-900);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.4rem;
  margin-bottom: 0.25rem;
}

.contact-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.825rem;
  gap: 0.5rem;
}

.contact-row .c-title {
  color: var(--text-muted);
  flex-shrink: 0;
}

.hr-notes-box {
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: var(--radius-md);
  padding: 1rem;
}

.hr-notes-box .mini-box-title {
  border-bottom-color: #fef08a;
  color: #854d0e;
}

.hr-notes-input {
  width: 100%;
  border: 1px solid #fde047;
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: #ffffff;
}

/* Profile Content Col */
.profile-content-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-key-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.key-stat-box {
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.k-label {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.k-value {
  font-size: 1.1rem;
  color: var(--navy-900);
}

.profile-section-block {
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.profile-section-heading {
  font-size: 1.05rem;
  color: var(--navy-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.profile-section-heading svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.profile-info-content {
  font-size: 0.925rem;
  color: var(--text-sub);
  line-height: 1.6;
}

.skills-badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.resume-card-box {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.resume-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.resume-item-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.resume-item-info svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.resume-item-name {
  font-weight: 600;
  color: var(--navy-900);
  font-size: 0.95rem;
}

.resume-item-size {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.resume-item-actions {
  display: flex;
  gap: 0.5rem;
}

/* Modal Footer */
.profile-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  margin-top: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left-buttons {
  display: flex;
  gap: 0.75rem;
}

/* ==========================================================================
   6. Photo Zoom & Document Preview Modals
   ========================================================================== */
.zoom-photo-card {
  position: relative;
  background: #0f172a;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 700px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.zoomed-photo {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.zoom-photo-caption {
  color: #ffffff;
  font-size: 0.95rem;
  margin-top: 0.75rem;
}

.btn-close-zoom {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: none;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-zoom:hover {
  background: #ef4444;
}

/* Doc Preview */
.modal-doc-preview {
  max-width: 860px;
  width: 95%;
}

.doc-preview-body {
  min-height: 480px;
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.doc-preview-frame {
  width: 100%;
  height: 520px;
  border: none;
}

.doc-preview-img {
  max-width: 100%;
  max-height: 520px;
  object-fit: contain;
}

/* Responsive */
@media (max-width: 960px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-modal-grid {
    grid-template-columns: 1fr;
  }

  .profile-big-photo-box {
    height: 240px;
  }
}

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

  .topbar-flex {
    flex-direction: column;
    height: auto;
    padding: 1rem 0;
    gap: 0.75rem;
  }

  .profile-key-stats {
    grid-template-columns: 1fr;
  }
}
