/*
 * CIS Labor Marketplace — css/app.css
 *
 * Additive stylesheet for the authenticated "app" pages (Worker Profile,
 * Contractor Profile, Post a Job, Find Jobs, Job detail, My Applications)
 * built in this Phase 1 continuation. Deliberately NOT merged into the
 * existing css/style.css — that file is large, already deployed, and
 * carries no risk of being touched by this work. This file only adds new
 * component classes (prefixed .app- or a few dashboard-specific names)
 * using the SAME design tokens already defined in style.css's :root
 * (--navy-900, --orange-500, --sp-*, --radius-*, --shadow-*, --font-*) —
 * loaded after style.css on every page that needs it, so it inherits
 * those custom properties rather than redefining them.
 *
 * Reuses existing real classes wherever they already exist (.btn,
 * .btn-primary, .auth-card, .auth-field, .auth-input-wrap, .field-error,
 * .has-error, .job-card, .badge, .container, .hero--compact) rather than
 * duplicating them here — this file is only what's missing.
 */

.app-page-header {
  background: var(--navy-900);
  padding: 90px 0 var(--sp-4);
  color: var(--white);
}

.app-page-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 32px);
  margin: 0 0 6px;
}

.app-page-header p {
  color: var(--gray-300);
  font-size: 14px;
  margin: 0;
}

.app-section {
  background: var(--cream-100);
  padding: var(--sp-4) 0 var(--sp-6);
}

/* ---- Profile view / edit card ---- */
.app-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}

.app-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--navy-900);
  margin: 0 0 var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

@media (max-width: 720px) {
  .app-grid-2 { grid-template-columns: 1fr; }
}

.app-field { margin-bottom: var(--sp-2); }

.app-field label {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--navy-900);
  margin-bottom: 6px;
}

.app-field input,
.app-field select,
.app-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--navy-900);
  background: var(--white);
}

.app-field textarea { resize: vertical; min-height: 90px; }

.app-field input:focus,
.app-field select:focus,
.app-field textarea:focus {
  outline: 2px solid var(--orange-500);
  outline-offset: 1px;
}

.app-field .app-help { font-size: 12px; color: var(--gray-600); margin-top: 4px; }

.app-checkbox-list { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.app-checkbox-list label {
  display: flex; align-items: center; gap: 8px;
  font-weight: 400; font-size: 14px; color: var(--gray-700);
  margin-bottom: 0;
}

.app-view-row {
  display: flex; justify-content: space-between; gap: var(--sp-3);
  padding: 10px 0; border-bottom: 1px solid var(--cream-200);
  font-size: 14px;
}
.app-view-row:last-child { border-bottom: none; }
.app-view-row dt { color: var(--gray-600); font-weight: 600; }
.app-view-row dd { margin: 0; color: var(--navy-900); text-align: right; }

.app-empty-state {
  text-align: center; padding: var(--sp-5) var(--sp-3); color: var(--gray-600);
}

.app-loading { text-align: center; padding: var(--sp-4); color: var(--gray-600); }

.app-toast {
  position: fixed; top: 20px; right: 20px; z-index: 200;
  background: var(--navy-900); color: var(--white);
  padding: 12px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  font-size: 14px; font-weight: 600;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.app-toast--error { background: #b3261e; }
.app-toast[hidden] { display: none; }

/* ---- Dashboard tables (applicants, my jobs, my applications) ---- */
.app-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.app-table th {
  text-align: left; font-family: var(--font-display); font-weight: 700;
  color: var(--navy-900); padding: 10px 12px; border-bottom: 2px solid var(--cream-200);
  font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.03em;
}
.app-table td { padding: 12px; border-bottom: 1px solid var(--cream-200); vertical-align: top; color: var(--gray-700); }
.app-table tr:last-child td { border-bottom: none; }
.app-table-wrap { overflow-x: auto; }

.app-status-pill {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.app-status-draft { background: var(--cream-200); color: var(--gray-700); }
.app-status-open { background: #e3f6e9; color: #1f8a4c; }
.app-status-closed { background: #fdeaea; color: #b3261e; }
.app-status-submitted { background: var(--cream-200); color: var(--gray-700); }
.app-status-reviewed { background: var(--orange-100); color: var(--orange-600); }
.app-status-accepted { background: #e3f6e9; color: #1f8a4c; }
.app-status-rejected { background: #fdeaea; color: #b3261e; }
.app-status-withdrawn { background: var(--cream-200); color: var(--gray-600); }

/* ---- Job filters (Find Jobs) ---- */
.app-filters {
  display: flex; flex-wrap: wrap; gap: 12px; background: var(--white);
  padding: var(--sp-3); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-3);
}
.app-filters .app-field { margin-bottom: 0; flex: 1; min-width: 160px; }

.app-job-list { display: flex; flex-direction: column; gap: var(--sp-2); }

.app-inline-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: var(--sp-3); }

.app-auth-gate {
  max-width: 480px; margin: 0 auto; text-align: center;
  background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  padding: var(--sp-5) var(--sp-4);
}


/* ---- Worker portfolio (photo upload) ---- */
.app-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.app-portfolio-item {
  background: var(--cream-100);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-portfolio-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

.app-portfolio-item-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--navy-900);
}

.app-portfolio-item-desc {
  font-size: 12px;
  color: var(--gray-600);
}

.app-portfolio-upload {
  border-top: 1px solid var(--cream-200);
  padding-top: var(--sp-3);
}

@media (max-width: 480px) {
  .app-portfolio-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .app-portfolio-item img { height: 100px; }
}
