/**
 * assets/css/issues.css
 * Issues & Case Intelligence module. New rules only — reuses .ic-card,
 * .ic-field, .ic-grid2, .console-empty, .btn/.btn-primary/.btn-ghost, and the
 * brand hex values already used throughout steward-console.css rather than
 * introducing a parallel design system.
 */

.iss-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(27,42,51,0.15);
  background: rgba(27,42,51,0.05);
  color: #5C7A6B;
  white-space: nowrap;
}
.iss-badge-visible { background: rgba(31,61,59,0.10); color: #1F3D3B; border-color: rgba(31,61,59,0.3); }
.iss-badge-internal { background: rgba(154,163,168,0.15); color: #6b6b6b; border-color: rgba(154,163,168,0.35); }

.iss-mini-stat { font-family: 'JetBrains Mono', monospace; }
.iss-mini-stat-good { color: #1F3D3B; font-weight: 600; }

.iss-list { display: flex; flex-direction: column; gap: 14px; }

.iss-case-card { cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; }
.iss-case-card:hover { box-shadow: 0 14px 34px -18px rgba(27,42,51,0.35); transform: translateY(-1px); }

.iss-header-card { margin-bottom: 20px; }

.iss-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid rgba(27,42,51,0.08);
  margin-bottom: 20px;
  overflow-x: auto;
}
.iss-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 10px 16px;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: #5C7A6B;
  cursor: pointer;
  white-space: nowrap;
}
.iss-tab.active { color: #1F3D3B; border-bottom-color: #C9622D; }
.iss-tab:hover:not(.active) { color: #1F3D3B; }

.iss-evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.iss-evidence-card { padding: 18px 20px; margin-bottom: 0; }

.iss-finding-row {
  padding: 12px 0;
  border-top: 1px solid rgba(27,42,51,0.08);
}
.iss-finding-row:first-child { border-top: none; padding-top: 0; }

.iss-filter-chip {
  background: none;
  border: 1px solid rgba(27,42,51,0.15);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  color: #5C7A6B;
  cursor: pointer;
  text-transform: capitalize;
}
.iss-filter-chip.active { background: #1F3D3B; color: #F7F3EC; border-color: #1F3D3B; }

.iss-timeline { display: flex; flex-direction: column; }
.iss-timeline-row {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid rgba(27,42,51,0.08);
}
.iss-timeline-row:first-child { border-top: none; padding-top: 0; }
.iss-timeline-dot {
  flex: 0 0 auto;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #C9622D;
  margin-top: 5px;
}
.iss-timeline-dot.iss-dot-ai { background: #C8A24A; }
.iss-timeline-body { flex: 1; min-width: 0; }

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


/* Customer/property name-and-address picker used in the "Open Issue" modal
   (and anywhere else a case needs linking to an existing property record). */
.iss-picker-results {
  display: none;
  position: absolute;
  z-index: 20;
  left: 0; right: 0;
  top: 100%;
  margin-top: 4px;
  background: #fff;
  border: 1px solid rgba(27,42,51,0.15);
  border-radius: 10px;
  box-shadow: 0 14px 34px -14px rgba(27,42,51,0.35);
  max-height: 240px;
  overflow-y: auto;
}
.iss-picker-row {
  padding: 9px 14px;
  cursor: pointer;
  border-top: 1px solid rgba(27,42,51,0.06);
}
.iss-picker-row:first-child { border-top: none; }
.iss-picker-row:hover { background: rgba(201,98,45,0.08); }
.iss-picker-name { font-weight: 600; color: #1F3D3B; font-size: 0.9rem; }
.iss-picker-addr { color: #5C7A6B; font-size: 0.8rem; }
.iss-picker-empty { padding: 10px 14px; color: #9aa3a8; font-size: 0.85rem; }

.iss-locked-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: rgba(31,61,59,0.06);
  border: 1px solid rgba(31,61,59,0.2);
  border-radius: 8px;
  font-size: 0.88rem;
  color: #1F3D3B;
}

/* ==========================================================================
   PHASE B additions
   ========================================================================== */

/* Danger-styled buttons — delete case / delete evidence. Same .btn-ghost
   sizing as everywhere else in this module, just red instead of neutral. */
.iss-btn-danger { color: #A6473C !important; border-color: rgba(166,71,60,0.4) !important; }
.iss-btn-danger:hover { background: rgba(166,71,60,0.08) !important; }
.iss-btn-danger-solid { background: #A6473C !important; border-color: #A6473C !important; color: #fff !important; }
.iss-btn-danger-solid:hover { background: #8f3b31 !important; }

/* --- Tasks tab --- */
.iss-task-list { display: flex; flex-direction: column; }
.iss-task-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(27,42,51,0.08);
}
.iss-task-row:first-child { border-top: none; padding-top: 0; }
.iss-task-row.iss-task-done { opacity: 0.6; }
.iss-task-row.iss-task-done strong { text-decoration: line-through; }
.iss-task-check {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid rgba(27,42,51,0.3);
  background: #fff;
  cursor: pointer;
  color: #1F3D3B;
  font-size: 0.8rem;
  line-height: 1;
  margin-top: 2px;
}
.iss-task-check.checked { background: #1F3D3B; border-color: #1F3D3B; color: #F7F3EC; }
.iss-task-body { flex: 1; min-width: 0; }
.iss-task-overdue { color: #A6473C; font-weight: 600; }

/* --- Reports tab --- */
.iss-report-list { display: flex; flex-direction: column; }
.iss-report-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid rgba(27,42,51,0.08);
}
.iss-report-row:first-child { border-top: none; padding-top: 0; }

.iss-report-type-picker { display: flex; flex-direction: column; gap: 8px; }
.iss-report-type-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(27,42,51,0.12);
  border-radius: 10px;
  cursor: pointer;
}
.iss-report-type-option input { margin-top: 4px; }
.iss-report-type-option:has(input:checked) { border-color: #C9622D; background: rgba(201,98,45,0.06); }

/* Full-page print overlay — same "hide chrome, print just this" strategy as
   workforce.css's pay-stub pattern (@media print on .wf-nav/.tab-bar/etc),
   ported for the Steward Console's own nav/tab classnames. */
.iss-report-print-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: #F7F3EC;
  overflow-y: auto;
  padding: 24px;
}
.iss-report-print-actions {
  max-width: 720px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.iss-report-back-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 8px 0;
  color: #1F3D3B;
  font: 600 0.9rem 'Source Sans 3', sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.iss-report-back-link:hover { color: #C9622D; }
.iss-report-back-link:focus-visible { outline: 2px solid #C9622D; outline-offset: 3px; border-radius: 2px; }
.iss-report-print-page {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  padding: 40px 48px;
  box-shadow: 0 20px 50px -24px rgba(27,42,51,0.35);
  color: #1B2A33;
  font-family: 'Source Sans 3', sans-serif;
}
.iss-report-letterhead { text-align: center; border-bottom: 2px solid #1F3D3B; padding-bottom: 14px; margin-bottom: 20px; }
.iss-report-letterhead h1 { font-family: Georgia, 'Times New Roman', serif; letter-spacing: 0.04em; margin: 0; color: #1F3D3B; }
.iss-report-letterhead-sub { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; letter-spacing: 0.05em; color: #5C7A6B; margin-top: 4px; text-transform: uppercase; }
.iss-report-print-page h3 { margin: 22px 0 8px; color: #1F3D3B; border-bottom: 1px solid rgba(27,42,51,0.12); padding-bottom: 4px; }
.iss-report-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.iss-report-table td, .iss-report-table th { padding: 6px 4px; border-bottom: 1px solid rgba(27,42,51,0.08); text-align: left; }
.iss-report-finding { padding: 6px 0; font-size: 0.92rem; border-top: 1px solid rgba(27,42,51,0.06); }
.iss-report-finding:first-of-type { border-top: none; }
.iss-report-tl-row { padding: 5px 0; font-size: 0.88rem; }
.iss-report-tl-date { font-family: 'JetBrains Mono', monospace; font-size: 0.74rem; color: #9aa3a8; margin-right: 8px; }
.iss-report-footer { margin-top: 28px; padding-top: 12px; border-top: 1px solid rgba(27,42,51,0.12); font-size: 0.74rem; color: #9aa3a8; text-align: center; }

@media print {
  body * { visibility: hidden; }
  .iss-report-print-overlay, .iss-report-print-overlay * { visibility: visible; }
  .iss-report-print-overlay { position: static; background: #fff; padding: 0; }
  .iss-report-print-actions { display: none !important; }
  .iss-report-print-page { box-shadow: none; max-width: none; padding: 0; }
}

@media (max-width: 640px) {
  .iss-report-print-page { padding: 24px 20px; }
}
