/* ============================================================
   NursingRidge Clinical Tools v2.0.0 — Shared Stylesheet
   Used by all 18 tool modules
   ============================================================ */
:root {
  --nr-primary:    #153A5B;
  --nr-primary-dk: #0d2640;
  --nr-teal:       #2D9C9C;
  --nr-teal-dk:    #237a7a;
  --nr-teal-lt:    #e6f7f7;
  --nr-card-bg:    #D9EEF2;
  --nr-page-bg:    #F8FAFC;
  --nr-border:     #c8dde8;
  --nr-border-soft:#e2e8f0;
  --nr-muted:      #4B6B82;
  --nr-body:       #1F2937;
  --nr-white:      #ffffff;
}

/* ── Page wrap ── */
.nr-page { background: var(--nr-page-bg); min-height: 100vh; font-family: var(--font-sans, system-ui, sans-serif); color: var(--nr-body); font-size: 14px; }

/* ── Hero ── */
.nr-hero { background: linear-gradient(135deg, #0d2640 0%, #153A5B 55%, #1a4a72 100%); padding: 1.6rem 1.75rem 1.3rem; color: #fff; }
.nr-hero-title    { font-size: 1.6rem; font-weight: 900; margin: 0 0 .3rem; color: #fff; letter-spacing: -.01em; }
.nr-hero-subtitle { font-size: .84rem; color: rgba(255,255,255,.8); margin: 0; line-height: 1.5; }
.nr-hero-badge    { display: inline-block; font-size: .7rem; font-weight: 700; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: rgba(255,255,255,.9); padding: .2rem .65rem; border-radius: 20px; margin-bottom: .6rem; }

/* ── Body ── */
.nr-body { padding: 1.25rem 1.5rem; }

/* ── Search row ── */
.nr-search-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .85rem; }
.nr-search-row input[type=text],
.nr-search-row input[type=search],
.nr-input { flex: 1; min-width: 180px; padding: .6rem .9rem; border: 1.5px solid var(--nr-border); border-radius: 8px; font-size: .9rem; color: var(--nr-body); background: var(--nr-white); transition: border-color .18s; }
.nr-input:focus { border-color: var(--nr-teal); outline: none; box-shadow: 0 0 0 3px rgba(45,156,156,.15); }
.nr-select { padding: .55rem .75rem; border: 1.5px solid var(--nr-border); border-radius: 8px; font-size: .88rem; background: var(--nr-white); color: var(--nr-body); cursor: pointer; }
.nr-select:focus { border-color: var(--nr-teal); outline: none; }
.nr-btn { padding: .6rem 1.3rem; background: var(--nr-primary); color: #fff; border: none; border-radius: 8px; font-size: .9rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .15s; }
.nr-btn:hover { background: var(--nr-primary-dk); }
.nr-btn-teal { background: var(--nr-teal); }
.nr-btn-teal:hover { background: var(--nr-teal-dk); }

/* ── Card ── */
.nr-card { background: var(--nr-white); border: 1px solid var(--nr-border); border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: .7rem; }
.nr-card:last-child { margin-bottom: 0; }
.nr-card-title { font-size: .92rem; font-weight: 700; color: var(--nr-primary); margin: 0 0 .4rem; }
.nr-card-meta  { display: flex; gap: .6rem; flex-wrap: wrap; font-size: .78rem; color: var(--nr-muted); margin-bottom: .4rem; align-items: center; }
.nr-card-body  { font-size: .83rem; color: var(--nr-body); line-height: 1.6; }

/* ── Badges ── */
.nr-badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: .18rem .55rem; border-radius: 8px; white-space: nowrap; }
.nr-badge-blue   { background: #dbeafe; color: #1e40af; }
.nr-badge-green  { background: #dcfce7; color: #15803d; }
.nr-badge-red    { background: #fef2f2; color: #991b1b; }
.nr-badge-yellow { background: #fef3c7; color: #92400e; }
.nr-badge-purple { background: #ede9fe; color: #5b21b6; }
.nr-badge-teal   { background: var(--nr-teal-lt); color: var(--nr-teal-dk); }
.nr-badge-dark   { background: #1a202c; color: #fff; }
.nr-badge-grey   { background: #f1f5f9; color: #64748b; }

/* ── Section heading ── */
.nr-section-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; padding-bottom: .5rem; border-bottom: 2px solid var(--nr-card-bg); }
.nr-section-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.nr-section-title { font-size: .92rem; font-weight: 700; color: var(--nr-primary); flex: 1; }

/* ── Link ── */
.nr-link { color: var(--nr-teal); text-decoration: none; border-bottom: 1px dotted var(--nr-teal); font-size: .82rem; transition: color .12s; }
.nr-link:hover { color: var(--nr-primary); }

/* ── Empty state ── */
.nr-empty { text-align: center; padding: 2.5rem 1.5rem; background: var(--nr-white); border: 1.5px dashed var(--nr-border); border-radius: 10px; color: var(--nr-muted); font-size: .88rem; margin: .5rem 0; }

/* ── Hint text ── */
.nr-hint { font-size: .78rem; color: var(--nr-muted); margin: .25rem 0 .6rem; line-height: 1.5; }

/* ── Result count ── */
.nr-count { font-size: .82rem; color: var(--nr-muted); margin-bottom: .65rem; }

/* ── Info box ── */
.nr-info  { background: var(--nr-card-bg); border: .5px solid var(--nr-border); border-radius: 8px; padding: .75rem 1rem; font-size: .83rem; color: var(--nr-primary); line-height: 1.6; margin-bottom: 1rem; }
.nr-warn  { background: #fef3c7; border: .5px solid #fde68a; border-radius: 8px; padding: .75rem 1rem; font-size: .83rem; color: #78350f; line-height: 1.6; margin-bottom: 1rem; }

/* ── Quick pill tags ── */
.nr-pills { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0; }
.nr-pill  { font-size: .78rem; padding: .28rem .8rem; border-radius: 20px; border: .5px solid var(--nr-border); background: var(--nr-white); color: var(--nr-primary); text-decoration: none; transition: all .12s; cursor: pointer; }
.nr-pill:hover { background: var(--nr-card-bg); border-color: var(--nr-teal); }
.nr-pill.active { background: var(--nr-primary); color: #fff; border-color: var(--nr-primary); }

/* ── Table ── */
.nr-table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.nr-table { width: 100%; border-collapse: collapse; background: var(--nr-white); border: .5px solid var(--nr-border); border-radius: 8px; overflow: hidden; }
.nr-table th { background: var(--nr-primary); color: #fff; padding: .55rem .8rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
.nr-table td { padding: .55rem .8rem; font-size: .83rem; border-bottom: .5px solid var(--nr-border-soft); vertical-align: top; }
.nr-table tr:last-child td { border: none; }
.nr-table tr:hover td { background: #fafcfd; }

/* ── Range badges ── */
.nr-range-normal  { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; padding: .2rem .55rem; border-radius: 6px; font-size: .78rem; font-weight: 600; border-left: 3px solid #15803d; }
.nr-range-crit-lo { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; padding: .2rem .55rem; border-radius: 6px; font-size: .78rem; font-weight: 600; border-left: 3px solid #1e40af; }
.nr-range-crit-hi { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; padding: .2rem .55rem; border-radius: 6px; font-size: .78rem; font-weight: 600; border-left: 3px solid #991b1b; }

/* ── Collapsible details/summary ── */
.nr-details { border: 1px solid var(--nr-border); border-radius: 8px; overflow: hidden; margin-bottom: .45rem; }
.nr-details summary { display: flex; align-items: center; justify-content: space-between; padding: .7rem 1rem; cursor: pointer; font-size: .85rem; font-weight: 600; list-style: none; user-select: none; transition: background .12s; }
.nr-details summary::-webkit-details-marker { display: none; }
.nr-details summary:hover { filter: brightness(.97); }
.nr-details-arrow { transition: transform .2s ease; display: inline-block; font-size: 1rem; font-style: normal; }
.nr-details[open] .nr-details-arrow { transform: rotate(90deg); }
.nr-details-body { padding: .85rem 1rem; background: var(--nr-white); border-top: 1px solid var(--nr-border-soft); font-size: .83rem; line-height: 1.75; }

/* ── FDA text formatting ── */
.nr-fda { font-size: .83rem; line-height: 1.75; color: var(--nr-body); }
.nr-fda-h { font-size: .88rem; font-weight: 700; color: var(--nr-primary); margin: .9rem 0 .3rem; display: flex; align-items: baseline; gap: .4rem; }
.nr-fda-h:first-child { margin-top: 0; }
.nr-fda-num { font-size: .7rem; font-weight: 800; font-family: monospace; background: var(--nr-primary); color: #fff; padding: .1rem .4rem; border-radius: 4px; }
.nr-fda p  { margin: 0 0 .6rem; }
.nr-fda ul { margin: .3rem 0 .7rem 1.2rem; padding: 0; }
.nr-fda li { margin-bottom: .25rem; }

/* ── Cross-links bar ── */
.nr-crosslinks { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .65rem 1.5rem; background: var(--nr-card-bg); border-top: 1px solid var(--nr-border); }
.nr-crosslinks-label { font-size: .75rem; font-weight: 600; color: var(--nr-muted); }
.nr-crosslink { font-size: .75rem; padding: .22rem .65rem; border-radius: 6px; background: var(--nr-white); border: .5px solid var(--nr-border); color: var(--nr-primary); text-decoration: none; transition: background .12s; }
.nr-crosslink:hover { background: var(--nr-teal-lt); border-color: var(--nr-teal); }

/* ── Footer ── */
.nr-footer { padding: .75rem 1.5rem; background: var(--nr-primary); font-size: .74rem; color: rgba(255,255,255,.72); line-height: 1.6; }
.nr-footer a { color: var(--nr-card-bg); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .nr-hero { padding: 1.1rem; }
  .nr-hero-title { font-size: 1.3rem; }
  .nr-body { padding: .85rem; }
}

/* ── NIOSH specific ── */
.nr-niosh-info { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; font-size: .85rem; line-height: 1.6; }
.nr-niosh-info-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@media(min-width:640px){ .nr-niosh-info-grid { grid-template-columns: 1fr 1fr; } }
.nr-niosh-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@media(min-width:640px){ .nr-niosh-grid { grid-template-columns: 1fr 1fr; } }
@media(min-width:1024px){ .nr-niosh-grid { grid-template-columns: 1fr 1fr 1fr; } }
.nr-niosh-card { background: #fff; border: 1px solid var(--nr-border); border-radius: 10px; padding: .9rem 1rem; }
.nr-niosh-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; margin-bottom: .4rem; }
.nr-niosh-drug-name { font-size: .95rem; font-weight: 700; color: var(--nr-primary); }
.nr-niosh-table-badge { font-size: .7rem; font-weight: 800; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.nr-niosh-ahfs { font-size: .78rem; color: var(--nr-muted); margin-bottom: .4rem; }
.nr-niosh-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .5rem; }
.nr-niosh-repro-badge { background: #fef3c7; color: #92400e; font-size: .7rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; }
.nr-niosh-mshi-badge  { background: #fef2f2; color: #991b1b; font-size: .7rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; }
.nr-niosh-ppe { font-size: .82rem; line-height: 1.5; color: var(--nr-body); margin-bottom: .6rem; padding: .5rem .65rem; background: #f8fafc; border-radius: 6px; border-left: 3px solid var(--nr-teal); }
.nr-niosh-actions { display: flex; gap: .75rem; }
.nr-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.nr-pill { font-size: .8rem; font-weight: 600; padding: .3rem .75rem; border-radius: 999px; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3); color: #fff; text-decoration: none; }
.nr-pill.active { background: #fff; color: var(--nr-primary); }
.nr-crosslinks { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; padding: .75rem; background: #f8fafc; border: 1px solid var(--nr-border); border-radius: 8px; }
.nr-crosslinks-label { font-size: .78rem; font-weight: 700; color: var(--nr-muted); text-transform: uppercase; }
.nr-crosslink { font-size: .82rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; background: var(--nr-white); border: 1px solid var(--nr-border); color: var(--nr-primary); text-decoration: none; }
.nr-crosslink:hover { background: #e2e8f0; }
.nr-footer { font-size: .75rem; color: var(--nr-muted); background: #f8fafc; border: 1px solid var(--nr-border); border-radius: 6px; padding: .65rem .85rem; line-height: 1.5; }
