/* flowchart */
.fc-page { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; }
.fc-scroll { padding-bottom: 24px; }
.fc-wrap { max-width: 1320px; margin: 0 auto; padding: 28px 32px 40px; }
.fc-empty-state .empty-state { padding-top: 120px; }
.fc-empty .fc-table-wrap { max-width: 1320px; margin: 0 auto 40px; padding: 0 32px; }
.fc-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.fc-head-title { font-size: 24px; color: var(--navy); }
.fc-head-count { color: var(--text-2); font-size: 14px; }

/* timeline table */
.fc-table-wrap { overflow-x: auto; }
.fc-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
.fc-table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-2); background: var(--bg-soft); padding: 12px 14px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.fc-table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15px; }
.fc-c-time { width: 118px; white-space: nowrap; }
.fc-c-name { width: 24%; }
.fc-c-by { width: 16%; }
.fc-c-res { width: 18%; }
.fc-c-act { width: 52px; text-align: right; }
.fc-tx { cursor: pointer; transition: background .1s; }
.fc-tx:hover td { background: #f3f9fd; }
.fc-time { font-size: 18px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.fc-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fc-pta { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .5px; color: #fff; background: #8e44ad; border-radius: 3px; padding: 1px 6px; }
.fc-name { font-size: 17px; font-weight: 600; color: var(--text); }
.fc-cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; }
.fc-det { font-size: 16px; color: var(--text); }
.fc-notes { font-size: 13px; color: var(--text-2); margin-top: 4px; font-style: italic; white-space: pre-wrap; }
.fc-none { color: #b5bfc7; }
.fc-result { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fc-badge { font-size: 12px; font-weight: 700; border-radius: 3px; padding: 2px 8px; color: #fff; }
.fc-ok { background: var(--green-dark); }
.fc-fail { background: var(--red); }
.fc-sub { font-size: 13px; color: var(--text-2); }
.fc-resp { font-size: 13px; font-weight: 600; }
.fc-resp-improved { color: var(--green-dark); }
.fc-resp-unchanged { color: var(--text-2); }
.fc-resp-worse { color: var(--red); }
.fc-comp { flex-basis: 100%; font-size: 12px; color: #b03a2e; }
.fc-del { border: 0; background: none; color: var(--red); cursor: pointer; padding: 4px; border-radius: 3px; display: inline-flex; }
.fc-del .ico { width: 22px; height: 22px; }
.fc-del .ico svg { stroke-width: 2.4; }
.fc-del:hover { background: #fdecea; }
.fc-vitals td { background: #f2f4f6; color: #7b8994; }
.fc-vitals .fc-time { color: #7b8994; font-weight: 600; }
.fc-vitals-text { font-size: 15px; font-variant-numeric: tabular-nums; word-spacing: 2px; vertical-align: middle !important; }
.fc-vitals-label { font-weight: 700; color: #6a7884; }

/* bottom bar of category buttons */
.fc-bar { flex: none; display: flex; gap: 0; background: #fff; border-top: 1px solid var(--line); padding: 0; position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -2px 10px rgba(20, 30, 45, .06); }
.fc-bar-btn { flex: 1; min-width: 0; height: 64px; border: 0; border-right: 1px solid rgba(255, 255, 255, .45); background: var(--green); color: #fff; font-size: 18px; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.fc-bar-btn:last-child { border-right: 0; }
/* Keep the help button above the category bar so it does not cover "Other". */
body:has(.fc-bar) .help-fab { bottom: calc(var(--rp-foot, 0px) + 76px); }
.fc-bar-btn:hover { background: var(--green-2); }
.fc-bar-btn:active { background: var(--green-dark); }

/* tile picker modal */
.fc-tile-modal { height: calc(100vh - 40px); max-width: 1400px !important; }
.fc-tile-modal .modal-header { padding: 14px 28px; }
.fc-tile-modal .modal-title { flex: 1 1 0; font-size: 22px; font-weight: 600; letter-spacing: 1px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-tile-modal .modal-actions { flex: 1 1 0; justify-content: flex-end; }
.fc-search-wrap { position: relative; width: min(440px, 40vw); display: flex; align-items: center; }
.fc-search-wrap .ico { position: absolute; left: 14px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.fc-search { width: 100%; border: 1px solid var(--line-2); border-radius: 24px; padding: 10px 16px 10px 42px; font: inherit; font-size: 17px; color: var(--text); background: #fff; }
.fc-search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(11, 152, 222, .2); }
.fc-tile-body { padding: 0 !important; flex: 1; background: #fff; }
.fc-grid .tile-grid { padding: 32px 48px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }

/* detail form modal */
.fc-form-modal .modal-title { display: none; }
.fc-form-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fc-form-name { font-size: 24px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-form-cat { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.fc-form-modal .modal-body { padding: 28px 40px 10px; }
.fc-form .f-row { gap: 32px; align-items: flex-start; }
.fc-form .f-row > .f-pill { flex: 0 0 auto; margin-top: 24px; }
.fc-form .f-heading { margin-top: 4px; color: var(--navy); }


@media (max-width: 900px) {
  .fc-wrap { padding: 16px; }
  .fc-bar-btn { font-size: 14px; height: 56px; }
  .fc-tile-modal .modal-title { font-size: 16px; }
  .fc-grid .tile-grid { padding: 16px; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}


@media (max-width: 700px) {
  .fc-table-wrap { overflow: visible; }
  .fc-table, .fc-table tbody { display: block; }
  .fc-table thead { display: none; }
  .fc-table tr { display: grid; grid-template-columns: 92px 1fr 40px; border-bottom: 1px solid var(--line); }
  .fc-table td { border: 0; padding: 6px 10px; width: auto; }
  .fc-table tr > td:first-child { padding-top: 12px; }
  .fc-table .fc-c-time { grid-row: 1 / span 4; }
  .fc-table .fc-c-name { grid-column: 2; padding-top: 12px; }
  .fc-table .fc-c-act { grid-column: 3; grid-row: 1; padding: 8px 4px 0 0; }
  .fc-table .fc-c-det, .fc-table .fc-c-by, .fc-table .fc-c-res { grid-column: 2 / span 2; }
  .fc-table .fc-c-res { padding-bottom: 12px; }
  .fc-table .fc-vitals-text { grid-column: 2 / span 2; padding: 12px 10px; }
  .fc-time { font-size: 16px; }
}

/* scope of practice (Admin → Scope of Practice) */
.fc-tile-modal .tile { flex-direction: column; justify-content: space-between; gap: 8px; }
.fc-scope-note { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #ffb3aa; }
.fc-scope-note .ico { width: 13px; height: 13px; }
.fc-scope-note.fc-scope-warn { color: #ffd166; }
.tile.fc-tile-blocked { background: #5a6570; color: #b9c2ca; cursor: not-allowed; opacity: .7; background-image: repeating-linear-gradient(135deg, transparent 0 10px, rgba(255, 255, 255, .05) 10px 20px); }
.tile.fc-tile-blocked:hover { background-color: #5a6570; }
.tile.fc-tile-warn { box-shadow: inset 5px 0 0 #f0a500; }
.fc-scope-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 16px 48px 0; font-size: 13px; color: var(--text-2); }
.fc-scope-legend .ico { width: 15px; height: 15px; }
.fc-scope-key { font-weight: 700; padding: 1px 7px; border-radius: 3px; }
.fc-scope-key.blocked { background: #5a6570; color: #e2e7eb; }
.fc-scope-key.warn { background: #f0a500; color: #2b1d00; }
@media (max-width: 700px) { .fc-scope-legend { margin: 12px 16px 0; } }
