/* instaquickmed — the doctor console, and the pharmacy/lab shop chrome.
   Loaded after app.css, so it inherits the same palette variables. */

/* --- Small status tags ---------------------------------------------------
   .chip in app.css is an interactive filter pill. These are labels: they say
   what state something is in and are never clickable, so they get their own
   class rather than a variant. */

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--divider); background: var(--surface-2); color: var(--muted);
}
.tag .ic { flex: 0 0 auto; }
.tag.ok   { color: #1a7f37; background: rgba(26, 127, 55, .1);  border-color: rgba(26, 127, 55, .25); }
.tag.warn { color: #9a6700; background: rgba(191, 135, 0, .12); border-color: rgba(191, 135, 0, .28); }
.tag.off  { color: var(--muted); }
[data-theme="dark"] .tag.ok   { color: #4ac26b; }
[data-theme="dark"] .tag.warn { color: #e3b341; }

.tag.stat { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 12px; border-radius: 12px; }
.tag.stat b     { font-size: 13px; font-weight: 600; color: var(--fg); }
.tag.stat small { font-size: 11.5px; }
.tag.stat i     { font-style: normal; font-size: 11.5px; color: var(--blue); font-weight: 700; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* The coloured pill shared by lab bookings and pharmacy orders. */
.spill {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--divider); color: var(--muted);
}
.spill.good { color: #1a7f37; background: rgba(26, 127, 55, .1);  border-color: rgba(26, 127, 55, .25); }
.spill.info { color: #0969da; background: rgba(9, 105, 218, .1);  border-color: rgba(9, 105, 218, .25); }
.spill.warn { color: #9a6700; background: rgba(191, 135, 0, .12); border-color: rgba(191, 135, 0, .28); }
.spill.bad  { color: var(--like); background: rgba(237, 73, 86, .1); border-color: rgba(237, 73, 86, .28); }
[data-theme="dark"] .spill.good { color: #4ac26b; }
[data-theme="dark"] .spill.info { color: #58a6ff; }
[data-theme="dark"] .spill.warn { color: #e3b341; }

/* --- Doctor console chrome ----------------------------------------------- */

.doctor-head b .ic { color: var(--blue); }

/* A tab for a feature the doctor was never assigned: visible, so they can see
   it exists, but plainly out of reach. */
.admin-tabs span.off {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 600;
  border: 1px dashed var(--divider); color: var(--muted); cursor: not-allowed;
}

.hospital-card {
  display: flex; gap: 18px; align-items: stretch;
  background: var(--surface); border: 1px solid var(--divider);
  border-radius: 14px; padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.hospital-photo {
  flex: 0 0 132px; height: 132px; border-radius: 12px; overflow: hidden;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
}
.hospital-photo img { width: 100%; height: 100%; object-fit: cover; }
.hospital-photo .ph  { color: var(--muted); }

.hospital-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hospital-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hospital-title h1 { font-size: 22px; margin: 0; }
.hospital-meta { margin: 0; font-size: 13px; }
.hospital-foot {
  margin-top: auto; padding-top: 10px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.hospital-foot .fee { font-weight: 600; }

/* --- The assigned-features grid ------------------------------------------ */

.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px;
}
.feature-tile {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 14px; border-radius: 12px; border: 1px solid var(--divider);
  background: var(--surface);
}
.feature-tile b     { font-size: 14.5px; }
.feature-tile small { color: var(--muted); font-size: 12.5px; line-height: 1.35; flex: 1; }
.feature-tile .feature-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface-2); color: var(--muted);
}
.feature-tile.on { cursor: pointer; }
.feature-tile.on:hover { border-color: var(--blue); }
.feature-tile.on .feature-icon { background: rgba(0, 149, 246, .12); color: var(--blue); }
.feature-tile.off { border-style: dashed; background: var(--surface-2); }
.feature-tile.off b, .feature-tile.off small { opacity: .7; }

/* --- Lists inside the console -------------------------------------------- */

.patient-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--divider); background: var(--surface);
}
a.patient-row:hover { border-color: var(--muted); }
.patient-name { flex: 1; min-width: 0; }
.patient-name b { display: block; font-size: 14px; font-weight: 600; }
.patient-name small { display: block; font-size: 12px; color: var(--muted); }
.patient-meta { font-size: 12px; white-space: nowrap; }

.patient-head { display: flex; gap: 16px; align-items: center; }

/* One card in the doctor's prescription / order / lab lists. Deliberately not
   .rx-row - that class is the prescription composer's input grid. */
.dr-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dr-main { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 4px; }
.dr-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.day-nav { display: flex; gap: 6px; }

/* --- Filters -------------------------------------------------------------- */

.filter-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filter-bar input[type="search"] {
  flex: 1; min-width: 200px; padding: 9px 12px; font: inherit;
  border-radius: 10px; border: 1px solid var(--divider);
  background: var(--surface-2); color: var(--fg);
}

.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-tabs a {
  padding: 5px 12px; border-radius: 20px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--divider); color: var(--muted);
}
.filter-tabs a.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* --- The shop: medicines and lab tests -----------------------------------
   Used by the patient pharmacy/lab pages as well as the doctor's own views. */

.shop-list { display: flex; flex-direction: column; gap: 12px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

.shop-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px; border-radius: 12px;
  border: 1px solid var(--divider); background: var(--surface);
}
.shop-card h3 { font-size: 15px; margin: 0 0 2px; }
.shop-body { flex: 1; min-width: 0; }
.shop-body p { margin: 0 0 8px; font-size: 13px; }
.shop-photo { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.shop-icon {
  width: 72px; height: 72px; border-radius: 10px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; color: var(--muted);
}
.shop-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.shop-tags .fact {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--muted);
  border: 1px solid var(--divider); border-radius: 20px; padding: 2px 9px;
}
.shop-tags .fact.off { color: #1a7f37; border-color: rgba(26, 127, 55, .3); }
.shop-body .prep { margin-top: 8px; font-size: 12px; display: flex; align-items: center; gap: 5px; }

.shop-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.shop-price b { font-size: 16px; }
.shop-price s { color: var(--muted); font-size: 12.5px; margin-left: 6px; }

.step { display: inline-flex; align-items: center; gap: 8px; }

/* The progress rail on an order or a lab booking (care_views.php: tracker). */
.track { display: flex; list-style: none; margin: 12px 0; padding: 0; gap: 4px; }
.track li { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }
.track li i {
  display: block; height: 4px; border-radius: 3px;
  background: var(--divider); margin-bottom: 5px;
}
.track li.on i   { background: var(--blue); }
.track li.on     { color: var(--fg); }
.track li.now    { font-weight: 700; }

@media (max-width: 760px) {
  .hospital-card  { flex-direction: column; }
  .hospital-photo { flex: 0 0 auto; width: 100%; height: 150px; }
  .shop-card      { flex-wrap: wrap; }
  .shop-side      { align-items: flex-start; width: 100%; flex-direction: row; justify-content: space-between; }
  .patient-row    { flex-wrap: wrap; }
  .patient-meta   { white-space: normal; }
}

/* --- The shop list, and one shop's shelf ---------------------------------
   The pharmacy is a list of shops before it is a list of medicines, so the
   store card is the primary object here and gets the bigger picture. */

.store-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.store-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--divider); border-radius: 14px; background: var(--surface);
}
.store-card:hover { border-color: var(--blue); }
.store-card.shut { opacity: .72; }

.store-photo { position: relative; height: 132px; background: var(--surface-2); }
.store-photo .shop-photo,
.store-photo .shop-icon { width: 100%; height: 100%; border-radius: 0; }
.store-photo .shop-photo { object-fit: cover; }
.store-shut {
  position: absolute; inset: auto 0 0 0; padding: 5px 10px;
  background: rgba(0, 0, 0, .62); color: #fff; font-size: 12px; font-weight: 600;
}

.store-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.store-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.store-title h3 { margin: 0; font-size: 15.5px; }
.store-body p { margin: 0; font-size: 12.5px; }

.store-head {
  display: flex; gap: 16px; align-items: center; margin: 12px 0 14px;
  padding: 14px; border: 1px solid var(--divider); border-radius: 14px;
  background: var(--surface);
}
.store-head-photo { flex: 0 0 96px; height: 96px; border-radius: 12px; overflow: hidden; }
.store-head-photo .shop-photo,
.store-head-photo .shop-icon { width: 100%; height: 100%; border-radius: 0; }
.store-head-body { flex: 1; min-width: 0; }
.store-head-body h1 { font-size: 20px; margin: 0 0 2px; }
.store-head-body p  { margin: 0 0 8px; font-size: 13px; }

.shop-tags .fact.closed { color: var(--like); border-color: rgba(237, 73, 86, .3); }

/* The "your basket is from another shop" prompt, and its slimmer cousins. */
.switch-banner {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  justify-content: space-between; margin: 12px 0;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(191, 135, 0, .35); background: rgba(191, 135, 0, .09);
}
.switch-banner p { margin: 4px 0 0; font-size: 12.5px; }
.switch-banner.slim {
  border-color: var(--divider); background: var(--surface-2);
}
.switch-banner form { margin: 0; }

/* A line the shop has taken down still shows in its own console, greyed. */
.shop-card.retired { opacity: .6; border-style: dashed; }

/* Editing price and stock without leaving the shelf. */
.shelf-edit {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px;
}
.shelf-edit label { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.shelf-edit input[type="number"] {
  width: 82px; padding: 5px 8px; font: inherit; font-size: 13px;
  border-radius: 8px; border: 1px solid var(--divider);
  background: var(--surface-2); color: var(--fg);
}
.mini-select {
  padding: 4px 8px; font-size: 12.5px; border-radius: 8px;
  border: 1px solid var(--divider); background: var(--surface-2); color: var(--fg);
}
