/* ==========================================================================
   Device holdings and inventory — existing SmartCare tokens only.

   Two screens, one stylesheet, dv- prefix throughout.
   ========================================================================== */

.dv-toggle { display: inline-flex; align-items: center; gap: 7px;
             font-size: 13px; color: var(--muted); white-space: nowrap;
             cursor: pointer; }
.dv-toggle input { width: auto; margin: 0; cursor: pointer; }

.dv-h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
         color: var(--muted); margin: 18px 0 8px; font-weight: 650; }

.dv-none { color: var(--muted); padding: 16px 0; font-size: 13.5px; }

/* ---- holdings list ------------------------------------------------------ */
.dv-list { list-style: none; margin: 0; padding: 0; }

.dv-item { display: flex; align-items: flex-start; gap: 12px;
           padding: 13px 0; border-bottom: 1px solid var(--line); }
.dv-item:last-child { border-bottom: none; }
.dv-item-main { flex: 1; min-width: 0; }
.dv-item-title { font-weight: 650; display: flex; align-items: center;
                 gap: 8px; flex-wrap: wrap; }
.dv-item-title .t-sub { font-weight: 400; }
.dv-meta { margin-top: 3px; line-height: 1.5; }
.dv-note { margin-top: 3px; font-style: italic; }

.dv-list-past .dv-item { padding: 9px 0; }
.dv-list-past .dv-item-title { font-weight: 550; color: var(--ink-soft); }

/* A device that cannot be billed, or cannot be matched to a reading, is a
   fact that has to compete with the rest of the row for attention. Weight and
   colour, not colour alone. */
.dv-flag { color: var(--warn); font-weight: 600; }

/* ---- warnings ----------------------------------------------------------- */
/* Loud enough to read before the list, quiet enough not to look like an
   error: a duplicate assignment is usually a housekeeping miss, not a crisis. */
.dv-warn { background: var(--warn-soft); color: var(--warn);
           border-radius: var(--radius-sm); padding: 10px 13px;
           margin: 0 0 14px; font-size: 13px; line-height: 1.55; }

/* ---- status filter chips ------------------------------------------------ */
.dv-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.dv-chip { font: inherit; font-size: 13px; font-weight: 600;
           padding: 5px 12px; border-radius: 999px; cursor: pointer;
           background: var(--surface); color: var(--muted);
           border: 1px solid var(--line); }
.dv-chip:hover { border-color: var(--accent); color: var(--ink-soft); }
.dv-chip.on { background: var(--accent); border-color: var(--accent);
              color: #fff; }

/* ---- inventory table ---------------------------------------------------- */
/* Fixed layout, because auto-layout spent the width on the IMEI column and
   wrapped "Blood pressure cuff" over three lines. The columns here are sized
   for what they hold: a 15-digit IMEI, a status with a reason and a note under
   it, and a device name that should never wrap. */
.dv-table { font-size: 13.5px; table-layout: fixed; width: 100%; }
.dv-table thead th { padding: 8px 12px; white-space: nowrap; }
.dv-table tbody td { padding: 10px 12px; vertical-align: top; }

.dv-c-serial { width: 14%; }
.dv-c-dev    { width: 17%; }
.dv-c-imei   { width: 13%; }
.dv-c-status { width: 21%; }
.dv-c-seen   { width: 8%; }
.dv-c-act    { width: 11%; }

/* Serials are compared character by character and some carry a suffix, so
   they break anywhere rather than pushing the table wide. */
.dv-serial { overflow-wrap: anywhere; }
.dv-seen { white-space: nowrap; }
.dv-act { text-align: right; }
.dv-act .btn { white-space: nowrap; }

/* An IMEI is compared digit by digit against a label on a box, so it gets a
   monospaced run rather than proportional text. */
.dv-mono { font-family: ui-monospace, "Cascadia Mono", "Consolas", monospace;
           font-size: 12.5px; letter-spacing: -.01em; }

/* ---- dialogs ------------------------------------------------------------ */
.dv-subject { background: var(--surface); border-radius: var(--radius-sm);
              padding: 10px 13px; font-size: 13.5px; line-height: 1.5; }

/* What the button is about to do, in words, above the button. Device state
   changes are not reversible from the UI, so the consequence is shown before
   the act rather than reported after it. */
.dv-consequence { font-size: 13px; line-height: 1.55; color: var(--ink-soft);
                  background: var(--accent-soft); border-radius: var(--radius-sm);
                  padding: 9px 12px; margin: 12px 0; }
.dv-consequence-warn { background: var(--warn-soft); color: var(--warn);
                       border-left: 3px solid var(--warn); }

#dv-sgo:disabled, #dv-go:disabled { opacity: .5; cursor: not-allowed; }

/* On a phone the IMEI and the last-seen column are the two a device
   technician is least likely to be reading from a phone, so they go first. */
@media (max-width: 760px) {
  .dv-item { flex-wrap: wrap; }
  .dv-table { table-layout: auto; }
  .dv-table thead th:nth-child(3),
  .dv-table tbody td:nth-child(3),
  .dv-table thead th:nth-child(5),
  .dv-table tbody td:nth-child(5) { display: none; }
}

/* Patient column (first) on the inventory: who holds the device now. */
.dv-c-patient { width: 16%; }
.dv-patient { font-weight: 600; color: inherit; text-decoration: none; }
.dv-patient:hover { text-decoration: underline; }
