/* Shared mobile-first styles */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(160deg, #eff6ff 0%, #f8fafc 50%, #fff 100%);
  color: var(--gray-900);
  min-height: 100vh;
  line-height: 1.5;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.header {
  text-align: center;
  margin-bottom: 28px;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.header p {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-500);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.875rem;
  z-index: 1000;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  max-width: 90%;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.result-list {
  margin-top: 16px;
}

.result-item {
  background: var(--gray-50);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  border-left: 4px solid var(--primary);
}

.result-item .row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  margin-bottom: 4px;
}

.result-item .label {
  color: var(--gray-500);
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-hired { background: #dcfce7; color: #166534; }
.status-rejected { background: #f3f4f6; color: #4b5563; }
.status-blacklist { background: #fee2e2; color: #991b1b; }

/* Admin styles */
.admin-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

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

.admin-header h1 {
  font-size: 1.25rem;
}

.admin-header a {
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.875rem;
}

.admin-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 0;
}

.admin-nav-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}

.admin-nav-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
}

.admin-form-card {
  padding: 20px;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--gray-900);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.btn-inline {
  width: auto;
  min-width: 140px;
  margin-top: 4px;
}

.btn-secondary {
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-secondary:hover {
  background: var(--gray-50);
}

.export-btn {
  margin-top: 0;
  min-width: auto;
  flex-shrink: 0;
}

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

  .btn-inline:not(.export-btn) {
    width: 100%;
  }

  .filters {
    align-items: stretch;
  }

  .export-btn {
    width: 100%;
    text-align: center;
  }
}

.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 999px;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--gray-700);
}

.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

th, td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}

th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
}

.actions {
  display: flex;
  gap: 4px;
}

.action-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 500;
}

.action-hired { background: #dcfce7; color: #166534; }
.action-rejected { background: #f3f4f6; color: #4b5563; }
.action-blacklist { background: #fee2e2; color: #991b1b; }
.action-delete { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.pagination button {
  padding: 8px 14px;
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.login-card {
  max-width: 360px;
  margin: 80px auto;
  padding: 28px 24px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-card h1 {
  text-align: center;
  font-size: 1.25rem;
  margin-bottom: 24px;
}

.error-msg {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.empty {
  text-align: center;
  padding: 40px;
  color: var(--gray-500);
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  .hide-mobile {
    display: none;
  }
}
