/* ============================================================================
   DEKON Job Hub — styles.css
   ----------------------------------------------------------------------------
   Visual system mirrors the rest of the DEKON toolkit (statement generators,
   capability sheets). The point is consistency, not novelty.

   Tokens:
     navy        #1B3A5C   primary brand
     navy-dark   #122848   header/footer fills
     orange      #E87722   accent/CTA
     grays       #f5f7fa → #2d3748   body chrome

   Type:
     Montserrat       — display, section labels, tabs
     Source Sans 3    — body, form fields, prose
   ============================================================================ */

:root {
  --navy: #1B3A5C;
  --navy-dark: #122848;
  --navy-deep: #0e2035;
  --orange: #E87722;
  --orange-soft: #f29550;
  --orange-tint: rgba(232, 119, 34, 0.08);

  --white: #fff;
  --cream: #faf8f4;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --g50:  #fafbfc;
  --g100: #eef1f5;
  --g200: #dde2ea;
  --g300: #c5cdd8;
  --g400: #9aa3b0;
  --g500: #6b7280;
  --g600: #4a5260;
  --g700: #2d3748;
  --g800: #1a202c;

  --ok:    #2f9e44;
  --warn:  #d97706;
  --amber: #f59e0b;
  --err:   #c0392b;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 50, 0.06);
  --shadow-md: 0 4px 14px rgba(20, 30, 50, 0.08);
  --shadow-lg: 0 18px 40px rgba(20, 30, 50, 0.18);

  --content-max: 1080px;
}

/* ---------------------------------------------------------------------------
   Reset / base
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Source Sans 3', system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--g700);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

/* ---------------------------------------------------------------------------
   Sticky app header (DEKON pattern: navy fill, orange accent bar, brand block)
   ------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.header-accent {
  height: 4px;
  background: var(--orange);
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: var(--white);
}

.brand-divider {
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.25);
}

.brand-tag {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.tool-label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
}

.tool-sub {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.user-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
}

.user-role {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange-soft);
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn-primary,
.btn-ghost,
.btn-icon {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(232, 119, 34, 0.3);
}
.btn-primary:hover { background: var(--orange-soft); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-lg { font-size: 1rem; padding: 13px 26px; }

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  padding: 7px 14px;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.app-main .btn-ghost {
  color: var(--g600);
  border-color: var(--g300);
  background: var(--white);
}
.app-main .btn-ghost:hover { background: var(--g100); border-color: var(--g400); }

.btn-icon {
  background: transparent;
  color: var(--g500);
  font-size: 1.6rem;
  line-height: 1;
  padding: 4px 10px;
}
.btn-icon:hover { color: var(--g700); }

/* ---------------------------------------------------------------------------
   Login gate
   ------------------------------------------------------------------------- */
.login-gate {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(232,119,34,0.08), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(27,58,92,0.06), transparent 50%),
    var(--bg);
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 50px 40px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--orange);
}

.login-mark {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: 0.1em;
  color: var(--navy);
  margin-bottom: 8px;
}

.login-card h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 12px;
}

.login-sub {
  color: var(--g500);
  margin-bottom: 28px;
  font-size: 0.95rem;
}

.login-help {
  margin-top: 24px;
  color: var(--g500);
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------------------
   Main layout
   ------------------------------------------------------------------------- */
.app-main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* Tab strip */
.tab-strip {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--g200);
  margin-bottom: 28px;
}

.tab {
  background: transparent;
  border: 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--g500);
  cursor: pointer;
  padding: 14px 22px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  transition: color 0.15s ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.tab .tab-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--g400);
  letter-spacing: 0.08em;
}

.tab:hover { color: var(--navy); }
.tab.is-active {
  color: var(--navy);
  border-bottom-color: var(--orange);
}
.tab.is-active .tab-num { color: var(--orange); }

.tab-count {
  background: var(--g200);
  color: var(--g700);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.tab.is-active .tab-count { background: var(--orange); color: var(--white); }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Panel header */
.panel-header { margin-bottom: 22px; }
.panel-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 6px;
}
.panel-sub {
  color: var(--g500);
  margin: 0;
  font-size: 0.95rem;
  max-width: 720px;
}

/* ---------------------------------------------------------------------------
   Form panels (DEKON pattern)
   ------------------------------------------------------------------------- */
.panel-section {
  background: var(--panel);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 22px 24px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.panel-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 28px;
  background: var(--orange);
  border-radius: var(--radius) 0 0 0;
}

.section-label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 16px;
  padding-left: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-help {
  color: var(--g500);
  font-size: 0.85rem;
  margin: -10px 0 18px;
  padding-left: 10px;
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field.span-2 { grid-column: span 2; }
.field.span-3 { grid-column: 1 / -1; }

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--g600);
  letter-spacing: 0.01em;
}

.field .req { color: var(--orange); margin-left: 2px; }

.field input[type=text],
.field input[type=email],
.field input[type=tel],
.field input[type=number],
.field input[type=date],
.field input[type=search],
.field select,
.field textarea {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  color: var(--g700);
  background: var(--white);
  border: 1px solid var(--g300);
  border-radius: var(--radius);
  padding: 9px 12px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-tint);
}

.field input:invalid:not(:placeholder-shown),
.field input.invalid {
  border-color: var(--err);
}

.field .help {
  color: var(--g500);
  font-size: 0.78rem;
  font-style: italic;
}

/* Checkbox stack */
.field .check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--g700);
  margin: 4px 0;
  cursor: pointer;
}
.field .check input { accent-color: var(--orange); width: 16px; height: 16px; }

/* Form actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--g200);
}

.form-msg {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  border-left: 4px solid;
}
.form-msg.ok    { background: #e8f6ee; border-color: var(--ok); color: #1f6c33; }
.form-msg.err   { background: #fcebe7; border-color: var(--err); color: #8a2818; }
.form-msg.info  { background: #e7f0fa; border-color: var(--navy); color: var(--navy); }

/* ---------------------------------------------------------------------------
   Job list (My Submissions / All Jobs)
   ------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-bar input[type=search] {
  flex: 1;
  min-width: 240px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  padding: 10px 14px;
  border: 1px solid var(--g300);
  border-radius: var(--radius);
  background: var(--white);
}
.filter-bar input[type=search]:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-tint);
}

.status-filter { display: flex; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--g300);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--g600);
  cursor: pointer;
}
.chip input { accent-color: var(--orange); }
.chip:has(input:checked) { background: var(--orange-tint); border-color: var(--orange); color: var(--navy); }

.job-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-row {
  background: var(--panel);
  border: 1px solid var(--g200);
  border-left: 4px solid var(--g300);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 100px 1fr auto 130px;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.job-row:hover {
  border-color: var(--g400);
  border-left-color: var(--orange);
  box-shadow: var(--shadow-md);
}
.job-row:active { transform: translateY(1px); }

.job-row[data-status="Requested"]    { border-left-color: var(--orange); }
.job-row[data-status="Under Review"] { border-left-color: var(--amber); }
.job-row[data-status="Active"]       { border-left-color: var(--ok); }
.job-row[data-status="Closed"]       { border-left-color: var(--g500); }
.job-row[data-status="Archived"]     { border-left-color: var(--g300); opacity: 0.7; }

.job-num {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
  letter-spacing: 0.04em;
}
.job-num.pending { color: var(--g400); font-weight: 500; font-style: italic; font-size: 0.85rem; }

.job-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.job-project {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--g700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-client {
  font-size: 0.82rem;
  color: var(--g500);
}

.job-value {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.95rem;
}
.job-value.empty { color: var(--g400); font-weight: 400; }

/* Status badge — Requested=orange, Under Review=amber, Active=green, Closed=gray, Archived=light gray */
.badge {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-block;
  text-align: center;
  white-space: nowrap;
}
.badge-requested    { background: var(--orange-tint); color: var(--orange); }
.badge-under-review { background: #fef3c7; color: #92400e; }
.badge-active       { background: #d1fae5; color: #065f46; }
.badge-closed       { background: var(--g100); color: var(--g600); }
.badge-archived     { background: var(--g100); color: var(--g500); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--g500);
  background: var(--panel);
  border: 1px dashed var(--g300);
  border-radius: var(--radius);
}
.empty-state p { margin-bottom: 14px; }

/* ---------------------------------------------------------------------------
   Modal (job detail view)
   ------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 32, 53, 0.55);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--orange);
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--g200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-body .loading { text-align: center; color: var(--g500); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 22px;
  margin-bottom: 18px;
}

.detail-block {
  font-size: 0.9rem;
}

.detail-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g500);
  margin-bottom: 2px;
}

.detail-value {
  color: var(--g700);
  font-weight: 500;
}
.detail-value.empty { color: var(--g400); font-style: italic; font-weight: 400; }

.detail-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--g200);
}

.detail-section h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}
.audit-list li {
  padding: 6px 0;
  color: var(--g600);
  border-bottom: 1px dotted var(--g200);
}
.audit-list li:last-child { border-bottom: 0; }
.audit-list time { color: var(--g500); font-size: 0.78rem; margin-right: 8px; }
.audit-list strong { color: var(--g700); font-weight: 600; }

/* ---------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.app-footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--g500);
  font-size: 0.82rem;
  border-top: 1px solid var(--g200);
  background: var(--white);
  margin-top: 40px;
}
.app-footer p { margin: 0; }

/* ---------------------------------------------------------------------------
   Responsive — collapse to phone-friendly layout for field use
   ------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .header-inner { padding: 12px 16px; gap: 12px; }
  .brand-tag .tool-sub { display: none; }
  .user-info { display: none; }
  .app-main { padding: 18px 14px 50px; }

  .tab-strip { overflow-x: auto; flex-wrap: nowrap; }
  .tab { padding: 12px 14px 14px; white-space: nowrap; }
  .tab .tab-num { display: none; }

  .panel-section { padding: 18px 16px 20px; }

  .form-grid { grid-template-columns: 1fr; }
  .field.span-2, .field.span-3 { grid-column: span 1; }

  .job-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .job-row .job-num { font-size: 0.85rem; }
  .job-row .badge { justify-self: start; }

  .form-actions { flex-direction: column-reverse; align-items: stretch; }
  .form-actions button { width: 100%; justify-content: center; }

  .detail-grid { grid-template-columns: 1fr; }

  .modal { padding: 0; align-items: flex-end; }
  .modal-card { max-height: 95vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}

/* Print stylesheet for job detail (per SKILL.md: clean one-page print) */
@media print {
  .app-header, .tab-strip, .form-actions, .filter-bar, .app-footer,
  .modal-backdrop, .btn-primary, .btn-ghost, .btn-icon { display: none !important; }
  .modal { position: static; padding: 0; }
  .modal-card { box-shadow: none; max-height: none; border-top-color: var(--orange); }
  body { background: var(--white); }
}


/* Admin shortcut link in navy header */
.admin-link{color:#E87722;text-decoration:none;font-weight:600;font-size:13px;letter-spacing:0.02em;}
.admin-link:hover{color:#fff;text-decoration:underline;}
