/* === DASHBOARD SHARED === */
.dashboard-page { min-height: 100vh; }

.dashboard-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 245, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.dashboard-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.dashboard-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  font-family: 'Bitter', serif;
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
}
.dashboard-logo svg { display: block; }

.dashboard-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
}
.dashboard-tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s;
}
.dashboard-tab:hover { background: var(--bg-alt); color: var(--fg); }
.dashboard-tab.active { background: var(--forest); color: white; }

.dashboard-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.user-email {
  font-size: 13px;
  color: var(--fg-muted);
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logout-btn {
  font-size: 13px;
  color: var(--fg-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.15s;
}
.logout-btn:hover { background: var(--bg-alt); color: var(--fg); }

/* === MAIN DASHBOARD (/dashboard) === */
.dashboard-hero {
  background: var(--forest);
  color: white;
  padding: 56px 0 48px;
}
.dashboard-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}
.dashboard-hero h1 {
  font-family: 'Bitter', serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}
.dashboard-hero p {
  font-size: 15px;
  color: rgba(255,255,255,0.7);
}
.dashboard-hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.track-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--forest);
  font-weight: 700;
  font-size: 14px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.track-new-btn:hover { background: #d4b554; transform: translateY(-1px); }

/* Stats Row */
.stats-row {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.stat-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 10px;
}
.stat-card-value {
  font-family: 'Bitter', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--forest);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card-sub {
  font-size: 12px;
  color: var(--fg-muted);
}
.stat-card.alt .stat-card-value { color: var(--accent-dark); }
.stat-card.alt .stat-card-value { color: #0e7490; }

/* Dashboard Body */
.dashboard-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px 80px;
}
.dashboard-section-title {
  font-family: 'Bitter', serif;
  font-size: 20px;
  color: var(--forest);
  margin-bottom: 16px;
  padding-top: 40px;
}
.recent-apps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recent-app-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--fg);
  transition: all 0.15s;
}
.recent-app-row:hover {
  border-color: var(--forest);
  box-shadow: 0 4px 16px rgba(26,26,26,0.07);
}
.recent-app-info { min-width: 0; }
.recent-app-title { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.recent-app-company { font-size: 13px; color: var(--fg-muted); }
.status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.status-Applied { background: #dbeafe; color: #1d4ed8; }
.status-Interview { background: #fef3c7; color: #92400e; }
.status-Offer { background: #d1fae5; color: #065f46; }
.status-Hired { background: #d1fae5; color: #065f46; font-weight: 700; }
.status-Rejected { background: #fee2e2; color: #991b1b; }

.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--forest);
  text-decoration: none;
  margin-top: 16px;
  transition: gap 0.15s;
}
.view-all-link:hover { gap: 10px; }

/* Auth prompt (when logged out) */
.auth-prompt {
  max-width: 560px;
  margin: 80px auto;
  text-align: center;
  padding: 0 40px;
}
.auth-prompt h2 {
  font-family: 'Bitter', serif;
  font-size: 32px;
  color: var(--forest);
  margin-bottom: 16px;
}
.auth-prompt p {
  font-size: 16px;
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 32px;
}
.auth-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-primary {
  padding: 12px 28px;
  background: var(--forest);
  color: white;
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--forest-light); }
.btn-outline {
  padding: 12px 28px;
  background: transparent;
  color: var(--forest);
  font-weight: 600;
  font-size: 15px;
  border: 2px solid var(--forest);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-outline:hover { background: var(--forest); color: white; }

/* === APPLICATIONS PAGE (/dashboard/applications) === */
.applications-hero {
  background: var(--forest);
  color: white;
  padding: 48px 0 40px;
}
.applications-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.applications-hero h1 {
  font-family: 'Bitter', serif;
  font-size: clamp(24px, 3.5vw, 38px);
  font-weight: 700;
  color: white;
}
.applications-controls {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-tabs {
  display: flex;
  gap: 4px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  flex-wrap: wrap;
}
.filter-tab {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.filter-tab:hover { background: var(--bg-alt); color: var(--fg); }
.filter-tab.active { background: var(--forest); color: white; }
.filter-tab .count {
  display: inline-block;
  background: rgba(255,255,255,0.25);
  padding: 0 6px;
  border-radius: 10px;
  font-size: 11px;
  margin-left: 5px;
}
.filter-tab.active .count { background: rgba(255,255,255,0.3); }

.search-bar {
  flex: 1;
  max-width: 280px;
  min-width: 160px;
  padding: 8px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s;
}
.search-bar:focus { border-color: var(--forest); }
.search-bar::placeholder { color: rgba(26,26,26,0.35); }

.sort-select {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--fg);
  cursor: pointer;
  outline: none;
}

.applications-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

/* Applications Table */
.app-table-header {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1fr 1.5fr 120px;
  gap: 12px;
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.app-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1fr 1.5fr 120px;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.app-row:hover { border-color: var(--forest); box-shadow: 0 4px 16px rgba(26,26,26,0.07); }
.app-row.expanded {
  border-color: var(--forest);
  background: #f8fdfb;
}
.app-row-title { font-weight: 600; font-size: 15px; color: var(--fg); }
.app-row-company { font-size: 13px; color: var(--fg-muted); }
.app-row-salary { font-size: 14px; color: var(--forest); font-weight: 600; }
.app-row-date { font-size: 13px; color: var(--fg-muted); }
.app-row-notes {
  font-size: 13px;
  color: var(--fg-muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 150px;
}
.app-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.action-btn {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--fg);
  transition: all 0.15s;
}
.action-btn:hover { background: var(--forest); color: white; border-color: var(--forest); }
.action-btn.danger:hover { background: #991b1b; border-color: #991b1b; }
.action-btn.archive:hover { background: #7c3aed; border-color: #7c3aed; }

/* Expanded Row */
.app-expanded {
  display: none;
  background: white;
  border: 1px solid var(--forest);
  border-top: none;
  border-radius: 0 0 10px 10px;
  margin-top: -8px;
  margin-bottom: 8px;
  padding: 20px 24px;
}
.app-row.expanded + .app-expanded { display: block; }

.expanded-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 16px;
}
.expanded-field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg-muted);
  display: block;
  margin-bottom: 6px;
}
.expanded-field span {
  font-size: 15px;
  color: var(--fg);
}
.expanded-field input,
.expanded-field select,
.expanded-field textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--fg);
  font-family: 'DM Sans', system-ui, sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.expanded-field input:focus,
.expanded-field select:focus,
.expanded-field textarea:focus { border-color: var(--forest); }
.expanded-field textarea { resize: vertical; min-height: 80px; }

.expanded-notes {
  margin-bottom: 16px;
}
.expanded-notes-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 6px;
}
.notes-content {
  font-size: 14px;
  color: var(--fg);
  line-height: 1.65;
  white-space: pre-wrap;
  background: var(--bg-alt);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.no-notes { font-size: 13px; color: var(--fg-muted); font-style: italic; }

.add-note-form {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.add-note-form textarea {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--fg);
  font-family: 'DM Sans', system-ui, sans-serif;
  resize: vertical;
  min-height: 60px;
  outline: none;
}
.add-note-form textarea:focus { border-color: var(--forest); }
.add-note-btn {
  padding: 9px 16px;
  background: var(--forest);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.add-note-btn:hover { background: var(--forest-light); }

.expanded-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
.save-btn {
  padding: 9px 20px;
  background: var(--forest);
  color: white;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.save-btn:hover { background: var(--forest-light); }
.cancel-btn {
  padding: 9px 20px;
  background: white;
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.cancel-btn:hover { background: var(--bg-alt); }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 40px;
}
.empty-state-icon { font-size: 48px; margin-bottom: 20px; }
.empty-state h2 {
  font-family: 'Bitter', serif;
  font-size: 24px;
  color: var(--forest);
  margin-bottom: 12px;
}
.empty-state p { font-size: 15px; color: var(--fg-muted); margin-bottom: 28px; }

/* Inline Add Form (used both on translator and dashboard) */
.inline-add-form {
  background: white;
  border: 2px solid var(--forest);
  border-radius: 16px;
  padding: 28px 32px;
  margin: 32px 0;
  display: none;
}
.inline-add-form.visible { display: block; }
.inline-add-form h3 {
  font-family: 'Bitter', serif;
  font-size: 20px;
  color: var(--forest);
  margin-bottom: 20px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.form-label span { color: #dc2626; }
.form-input,
.form-textarea {
  padding: 11px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--fg);
  font-family: 'DM Sans', system-ui, sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus,
.form-textarea:focus { border-color: var(--forest); }
.form-textarea { resize: vertical; min-height: 72px; }
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}
.submit-btn {
  padding: 11px 24px;
  background: var(--forest);
  color: white;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.submit-btn:hover { background: var(--forest-light); }
.form-cancel {
  padding: 11px 20px;
  background: white;
  color: var(--fg-muted);
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.form-cancel:hover { background: var(--bg-alt); }
.form-error { color: #991b1b; font-size: 13px; margin-top: -8px; margin-bottom: 8px; display: none; }
.form-error.visible { display: block; }

/* Confirm Dialog */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.confirm-overlay.visible { display: flex; }
.confirm-box {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
}
.confirm-box h3 {
  font-family: 'Bitter', serif;
  font-size: 20px;
  color: var(--forest);
  margin-bottom: 12px;
}
.confirm-box p { font-size: 15px; color: var(--fg-muted); margin-bottom: 24px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-yes {
  padding: 10px 24px;
  background: #991b1b;
  color: white;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.confirm-no {
  padding: 10px 24px;
  background: white;
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard-nav-inner { padding: 12px 20px; }
  .dashboard-tabs { display: none; }
  .stats-row { grid-template-columns: repeat(2, 1fr); padding: 24px 20px; gap: 12px; }
  .dashboard-hero-inner { flex-direction: column; }
  .dashboard-hero-right { align-items: flex-start; }
  .dashboard-body { padding: 0 20px 60px; }
  .applications-hero-inner { flex-direction: column; align-items: flex-start; }
  .applications-controls { padding: 16px 20px; }
  .app-table-header { display: none; }
  .app-row { grid-template-columns: 1fr auto; gap: 8px; }
  .app-row-company, .app-row-date, .app-row-salary, .app-row-notes { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .expanded-grid { grid-template-columns: 1fr; }
  .dashboard-user .user-email { display: none; }
}