/* ==========================================================================
   Monthly RPM review — existing SmartCare tokens only, no new palette.

   The grid is the point of this page, so it gets the density: tabular
   numerals, tight rows, and a day header that breaks the month into the unit
   the device-day count is actually made of.
   ========================================================================== */

.vd-ctl { display: inline-flex; align-items: center; gap: 8px; font-size: 13px;
          color: var(--muted); white-space: nowrap; margin-right: 10px; }
.vd-ctl select { width: auto; min-width: 150px; font: inherit; }

.vd-back { font-size: 13px; margin: 0 0 12px; }
.vd-back a { color: var(--muted); text-decoration: none; }
.vd-back a:hover { color: var(--accent); text-decoration: underline; }

/* ---- summary strip ------------------------------------------------------ */
.vd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 12px; margin-bottom: 14px; }
.vd-stat { background: var(--surface); border: 1px solid var(--line);
           border-radius: var(--radius-sm); padding: 13px 15px; }
.vd-stat-n { font-size: 26px; font-weight: 700; line-height: 1.1;
             font-variant-numeric: tabular-nums; }
.vd-stat-l { font-size: 12.5px; color: var(--muted); text-transform: uppercase;
             letter-spacing: .04em; }
.vd-stat-x { font-size: 12.5px; margin-top: 3px; }

/* ---- per-metric cards --------------------------------------------------- */
.vd-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
              gap: 12px; margin-bottom: 16px; }
.vd-metric { background: var(--card); border: 1px solid var(--line);
             border-radius: var(--radius-sm); padding: 12px 14px; }
.vd-metric-head { display: flex; justify-content: space-between;
                  align-items: baseline; gap: 8px; margin-bottom: 4px; }
.vd-metric-name { font-weight: 650; font-size: 13.5px; }
.vd-metric-row { display: flex; align-items: center; justify-content: space-between;
                 gap: 10px; margin-bottom: 4px; }
.vd-metric-now { font-size: 24px; font-weight: 700;
                 font-variant-numeric: tabular-nums; line-height: 1; }
.vd-metric-unit { font-size: 12px; font-weight: 500; color: var(--muted); }

/* A sparkline carries direction, not magnitude -- the number beside it does
   that. No axes, because at this size they would be decoration. */
.vd-spark { color: var(--accent); flex: 0 0 auto; }
.vd-spark-oor { color: var(--brand-red); }

/* ---- the grid ----------------------------------------------------------- */
.vd-table { font-size: 13.5px; }
.vd-table thead th { padding: 8px 12px; white-space: nowrap; }
.vd-table tbody td { padding: 7px 12px; }
.vd-unit { font-weight: 500; text-transform: none; letter-spacing: 0;
           font-size: 11px; color: var(--muted); }

.vd-time { font-variant-numeric: tabular-nums; white-space: nowrap;
           color: var(--ink-soft); }
.vd-v { font-variant-numeric: tabular-nums; font-weight: 600;
        text-align: right; white-space: nowrap; }
.vd-empty { color: var(--line); font-weight: 400; text-align: center; }
.vd-dev { white-space: nowrap; }

/* Out of range gets weight and a rule as well as colour, so it does not
   depend on colour vision. */
.vd-v-oor { color: var(--stop); font-weight: 750; }
.vd-table tr.vd-r-oor td:first-child { box-shadow: inset 3px 0 0 var(--stop); }
.vd-manual { font-size: 11px; color: var(--muted); font-weight: 400; }

/* Day header. The day is the unit the billable count is made of, so it is
   worth a row of its own rather than a repeated column. */
.vd-table tr.vd-day td { background: var(--surface); padding: 9px 12px;
                         border-top: 1px solid var(--line); }
.vd-day-name { font-weight: 700; margin-right: 10px; }
.vd-pill { display: inline-block; font-size: 11.5px; font-weight: 650;
           padding: 1px 8px; border-radius: 999px; margin-left: 10px; }
.vd-pill-go { background: var(--go-soft); color: var(--go); }
.vd-pill-mute { background: var(--card); color: var(--muted);
                border: 1px solid var(--line); }

.vd-none { color: var(--muted); text-align: center; padding: 28px; }
.vd-foot { font-size: 12.5px; color: var(--muted); line-height: 1.6;
           margin-top: 14px; }

.vd-ok { color: var(--go); font-weight: 600; }
.vd-warn { color: var(--warn); font-weight: 600; }
.vd-bad { color: var(--brand-red); font-weight: 600; }

/* ---- finish dialog ------------------------------------------------------ */
.vd-finish-facts { background: var(--surface); border-radius: var(--radius-sm);
                   padding: 10px 13px; margin-bottom: 12px; font-size: 13.5px; }
.vd-draft-actions { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.vd-draft-actions .btn { width: auto; }

.vd-notice { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft);
             background: var(--accent-soft); border-radius: var(--radius-sm);
             padding: 9px 12px; margin: 0 0 12px; }
/* Warned, not alarming: PHI leaving for a third party is a fact the person
   should see every time, not a scolding. */
.vd-notice-warn { background: var(--warn-soft); color: var(--warn);
                  border-left: 3px solid var(--warn); }

/* The acknowledgement is the one control on this page that must not be
   skimmed past, so it is the one thing with a border. */
.vd-ack { border: 1px solid var(--line); border-left: 3px solid var(--accent);
          border-radius: var(--radius-sm); padding: 10px 12px;
          background: var(--surface); }

#vd-sign:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 900px) {
  .vd-table thead th:last-child,
  .vd-table tbody td.vd-dev { display: none; }
}

/* ==========================================================================
   Timer stop dialog — the AI draft additions.

   These are tw- classes, which belong to timer.css, but they live here on
   purpose: this stylesheet is global and loads after timer.css, so the
   dialog is styled wherever it opens, and timer.css stays unpatched. The
   patch that adds the markup is patch_timer_ai_draft.py.
   ========================================================================== */

.tw-draft-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.tw-draft-actions .btn { width: auto; }

.tw-notice { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft);
             background: var(--accent-soft); border-radius: var(--radius-sm);
             padding: 9px 12px; margin: 0 0 12px; }
/* Warned, not scolding: PHI going to a third party is a fact the person
   should see every time they do it. */
.tw-notice-warn { background: var(--warn-soft); color: var(--warn);
                  border-left: 3px solid var(--warn); }

/* The one control in this dialog that must not be skimmed past, so the one
   thing with a border. Shown only once a draft has been inserted. */
.tw-ack { display: flex; gap: 10px; align-items: flex-start;
          border: 1px solid var(--line); border-left: 3px solid var(--accent);
          border-radius: var(--radius-sm); padding: 10px 12px;
          background: var(--surface); margin: 12px 0 4px;
          font-size: 13.5px; line-height: 1.45; cursor: pointer; }
.tw-ack input { width: auto; margin-top: 2px; flex: 0 0 auto; }

#tw-save:disabled { opacity: .5; cursor: not-allowed; }

/* The stop dialog is now tall enough to scroll, which exposed that
   .modal-head scrolls away with the body and collides with the content
   underneath it. Pinning it keeps the patient's name and the close button
   visible while a nurse reads four sections of a note -- the two things you
   most want on screen when deciding whether to sign something. */
.modal-head { position: sticky; top: 0; z-index: 2;
              background: var(--card); border-bottom: 1px solid var(--line-soft); }
