/* ─── PORTAL HEADER ─────────────────────────────────── */
.portal-header {
  background: var(--fg);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.portal-header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.portal-wordmark {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}
.portal-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(200,147,58,0.15);
  padding: 3px 10px;
  border-radius: 100px;
}
.portal-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.portal-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.2s;
}
.portal-nav a:hover,
.portal-nav a.active { color: var(--white); }
.portal-logout {
  color: rgba(255,255,255,0.4) !important;
}

/* ─── PORTAL MAIN ───────────────────────────────────── */
.portal-main {
  min-height: calc(100vh - 130px);
  padding: 48px 32px;
  max-width: 1160px;
  margin: 0 auto;
}

/* ─── PORTAL FOOTER ─────────────────────────────────── */
.portal-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 24px 32px;
  text-align: center;
}
.portal-footer p {
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.portal-footer a {
  color: var(--accent);
}

/* ─── AUTH PAGE ──────────────────────────────────────── */
.portal-auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--bg-alt);
}
.portal-auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}
.auth-wordmark {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}
.auth-portal-tag {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(200,147,58,0.12);
  padding: 4px 12px;
  border-radius: 100px;
}
.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 4px 24px rgba(26,39,68,0.08);
}
.auth-card-header {
  margin-bottom: 28px;
}
.auth-card-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
}
.auth-card-header p {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.6;
}
.auth-error {
  background: #fdf2f2;
  border: 1px solid #f5c0c0;
  border-radius: 4px;
  padding: 12px 16px;
  color: #c0392b;
  font-size: 0.875rem;
  margin-bottom: 20px;
}
.auth-success {
  background: #f2fdf2;
  border: 1px solid #c0f5c0;
  border-radius: 4px;
  padding: 12px 16px;
  color: #2c7a2c;
  font-size: 0.875rem;
  margin-bottom: 20px;
}
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
}
.auth-field input {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--fg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,147,58,0.15);
}
.auth-submit {
  background: var(--fg);
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}
.auth-submit:hover { background: #2a3a5e; }
.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.auth-footer a { color: var(--accent); }

/* ─── ONBOARDING PAGE ───────────────────────────────── */
.onboarding-header {
  margin-bottom: 40px;
}
.onboarding-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
}
.onboarding-header p {
  font-size: 1rem;
  color: var(--fg-muted);
}
.onboarding-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px;
  max-width: 600px;
}
.onboarding-form { display: flex; flex-direction: column; gap: 24px; }
.onboarding-row { display: flex; flex-direction: column; gap: 6px; }
.onboarding-row label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
}
.onboarding-row input,
.onboarding-row select {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--fg);
  width: 100%;
}
.onboarding-row input:focus,
.onboarding-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,147,58,0.15);
}
.onboarding-error {
  background: #fdf2f2;
  border: 1px solid #f5c0c0;
  border-radius: 4px;
  padding: 12px 16px;
  color: #c0392b;
  font-size: 0.875rem;
}
.onboarding-submit {
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  align-self: flex-start;
}
.onboarding-submit:hover { background: var(--accent-dark); }

/* ─── DASHBOARD ─────────────────────────────────────── */
.dashboard-welcome {
  margin-bottom: 36px;
}
.dashboard-welcome h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
}
.dashboard-welcome p {
  font-size: 0.95rem;
  color: var(--fg-muted);
}
.dashboard-welcome .target-role {
  font-weight: 600;
  color: var(--fg);
}

/* Stats row */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}
.stat-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 8px;
}
.stat-card-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
}

/* Section */
.dashboard-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 24px;
  overflow: hidden;
}
.dashboard-section-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dashboard-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
}
.dashboard-section-body { padding: 0; }

/* Call card */
.call-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
}
.call-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-alt);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.call-details { flex: 1; }
.call-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.call-time {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
}
.call-meta {
  font-size: 0.875rem;
  color: var(--fg-muted);
  margin-top: 2px;
}
.call-cta {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  flex-shrink: 0;
}
.call-cta:hover { background: var(--accent-dark); }
.no-call {
  padding: 32px 24px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* Application table */
.app-table {
  width: 100%;
  border-collapse: collapse;
}
.app-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.app-table td {
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.app-table tr:last-child td { border-bottom: none; }
.app-table tr:hover td { background: var(--bg); }
.app-company { font-weight: 600; }
.app-role { color: var(--fg-muted); font-size: 0.85rem; }
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-applied { background: #e8f0fe; color: #1a56db; }
.status-phone_screen { background: #fef3c7; color: #92400e; }
.status-interview { background: #d1fae5; color: #065f46; }
.status-offer { background: #d1fae5; color: var(--accent); font-weight: 700; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-withdrawn { background: var(--bg-alt); color: var(--fg-muted); }
.status-select {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--fg);
  cursor: pointer;
}
.app-date { color: var(--fg-muted); font-size: 0.8rem; white-space: nowrap; }
.add-app-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--fg);
  color: var(--white);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.add-app-btn:hover { background: #2a3a5e; }

/* Add application modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,39,68,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal {
  background: var(--white);
  border-radius: 8px;
  padding: 32px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 24px;
}
.modal-form { display: flex; flex-direction: column; gap: 18px; }
.modal-row { display: flex; flex-direction: column; gap: 5px; }
.modal-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
}
.modal-row input,
.modal-row select {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--fg);
  width: 100%;
}
.modal-row input:focus,
.modal-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,147,58,0.15);
}
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}
.modal-cancel {
  background: var(--bg-alt);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 9px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
.modal-cancel:hover { background: var(--border); }
.modal-submit {
  background: var(--fg);
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 9px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
.modal-submit:hover { background: #2a3a5e; }

/* Interviews section */
.interview-list { }
.interview-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.interview-item:last-child { border-bottom: none; }
.interview-type-badge {
  display: inline-block;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.interview-details { flex: 1; }
.interview-company { font-weight: 600; color: var(--fg); }
.interview-role { font-size: 0.85rem; color: var(--fg-muted); }
.interview-time { font-size: 0.85rem; color: var(--fg-muted); font-style: italic; }

/* Responsive */
@media (max-width: 768px) {
  .portal-header-inner { padding: 14px 20px; }
  .portal-main { padding: 32px 20px; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
  .app-table { display: block; overflow-x: auto; }
  .onboarding-card { padding: 28px 20px; }
  .auth-card { padding: 28px 20px; }
  .call-card { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
  .portal-nav a:not(.portal-logout) { display: none; }
}