/* ============================================================
 * Patient Lookup — search + full patient record modal.
 * ============================================================ */

.pl-searchbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e6ee); border-radius: 10px;
}
.pl-search-input {
  flex: 1; min-width: 220px; padding: 9px 12px;
  border: 1px solid var(--border, #d5d9e0); border-radius: 8px; font: inherit;
}
.pl-searchbar select, .pl-searchbar input[type="month"] {
  padding: 8px 10px; border: 1px solid var(--border, #d5d9e0);
  border-radius: 8px; font: inherit; background: #fff;
}
.pl-empty { padding: 26px; text-align: center; color: var(--muted, #9ca3af); }

/* --- Results table ---------------------------------------------------- */
.pl-results { background: var(--surface, #fff); border: 1px solid var(--border, #e2e6ee);
  border-radius: 10px; overflow-x: auto; }
.pl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pl-table th, .pl-table td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border-soft, #eef0f3);
  white-space: nowrap;
}
.pl-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .3px;
  color: var(--muted, #6b7280); font-weight: 700; }
.pl-table tbody tr:hover { background: #f8fafc; }

.pl-pill { display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px; }
.pl-pill-good { background: #dcfce7; color: #166534; }
.pl-pill-warn { background: #fef3c7; color: #92400e; }
.pl-pill-neutral { background: #eef2ff; color: #3730a3; }
.pl-pill-none { background: #f1f5f9; color: #94a3b8; }

/* --- Record modal ----------------------------------------------------- */
.pl-record-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(15,23,42,.55);
  display: flex; padding: 24px; justify-content: center;
}
.pl-record-backdrop.hidden { display: none; }
.pl-record-frame {
  background: var(--bg, #f7f8fb); border-radius: 12px; width: 100%; max-width: 1100px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.pl-record-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--border, #e2e6ee);
}
.pl-record-header h2 { margin: 0; font-size: 18px; }
.pl-record-header .meta { font-size: 12px; color: var(--muted, #6b7280); }
.pl-record-body { padding: 16px 18px; overflow-y: auto; }

.pl-block { background: #fff; border: 1px solid var(--border, #e2e6ee);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.pl-section-title {
  margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  color: #334155; border-bottom: 2px solid #e2e8f0; padding-bottom: 6px;
}

/* --- Workflow --------------------------------------------------------- */
.pl-wf { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .pl-wf { grid-template-columns: 1fr; } }
.pl-wf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.pl-field-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .3px;
  color: var(--muted, #9ca3af); font-weight: 700; }
.pl-field-val { font-size: 13px; color: #1e293b; font-weight: 500; word-break: break-word; }
.pl-none { font-size: 13px; color: var(--muted, #9ca3af); font-style: italic; }

/* --- Workflow step strip --------------------------------------------- */
.pl-steps { display: flex; align-items: center; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.pl-step { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  color: var(--muted, #9ca3af); }
.pl-step-dot { width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; }
.pl-step.done { color: #166534; }
.pl-step.done .pl-step-dot { background: #16a34a; }
.pl-step-line { width: 28px; height: 2px; background: #e2e8f0; }

/* --- Timeline --------------------------------------------------------- */
.pl-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pl-timeline li { display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid var(--border-soft, #f1f3f6); font-size: 12.5px; }
.pl-tl-text { color: #334155; }
.pl-tl-meta { color: var(--muted, #9ca3af); font-size: 11px; white-space: nowrap; }

.pl-readonly-record { background: #fff; border: 1px solid var(--border, #e2e6ee);
  border-radius: 10px; padding: 8px 12px; }

/* --- Document tabs ---------------------------------------------------- */
.pl-doctabs { }
.pl-tabbar { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border, #e2e6ee); margin-bottom: 10px; }
.pl-tab {
  padding: 7px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted, #6b7280);
  border: 1px solid transparent; border-bottom: none; border-radius: 8px 8px 0 0;
  background: transparent; cursor: pointer; margin-bottom: -1px;
}
.pl-tab:hover { color: #334155; background: #f8fafc; }
.pl-tab.active {
  color: #3730a3; background: #eef2ff;
  border-color: var(--border, #e2e6ee); border-bottom: 1px solid #eef2ff;
}
.pl-tab-count {
  display: inline-block; min-width: 18px; text-align: center; font-size: 10px;
  font-weight: 700; padding: 0 5px; border-radius: 999px; background: #e0e7ff; color: #4338ca;
}
.pl-tabpanel { display: none; flex-direction: column; gap: 8px; }
.pl-tabpanel.active { display: flex; }
.pl-doc {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border: 1px solid var(--border-soft, #eef0f3); border-radius: 8px;
  background: #fafbfc;
}
.pl-doc-main { min-width: 0; flex: 1; }
.pl-doc-name { font-size: 13px; font-weight: 600; color: #1e293b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-doc-meta { font-size: 11px; color: var(--muted, #9ca3af); margin-top: 2px; }
.pl-doc-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* --- Inline document viewer ------------------------------------------ */
.pl-doclists { }
.pl-doc { cursor: pointer; }
.pl-doc:hover { border-color: #93a4c8; background: #f5f8ff; }
.pl-doc.active { border-color: #6366f1; background: #eef2ff; box-shadow: 0 0 0 1px #6366f1 inset; }
.pl-viewer {
  margin-top: 12px; border: 1px solid var(--border, #e2e6ee);
  border-radius: 10px; overflow: hidden; background: #fff;
}
.pl-viewer-empty { padding: 28px; text-align: center; color: var(--muted, #9ca3af); font-size: 13px; }
.pl-viewer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; background: #f8fafc; border-bottom: 1px solid var(--border, #e2e6ee);
}
.pl-viewer-name { font-size: 13px; font-weight: 600; color: #1e293b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-viewer-actions { display: flex; gap: 6px; flex-shrink: 0; }
.pl-viewer-frame { width: 100%; height: 520px; border: 0; display: block; background: #f1f5f9; }
.pl-viewer-fallback { padding: 28px; text-align: center; color: var(--muted, #6b7280); font-size: 13px; }
.pl-doc-intro { font-size: 12.5px; color: #475569; margin-bottom: 10px; }
.pl-doc-intro-empty { color: var(--muted, #9ca3af); font-style: italic; }
