:root {
  --opms-brand: #008168;
  --opms-brand-dark: #006652;
  --opms-brand-light: #e6f5f1;
  --opms-ink: #14302b;
  --opms-muted: #5a7a72;
  --opms-sidebar: 268px;
  --opms-sidebar-collapsed: 76px;
  --opms-topbar: 58px;
  --opms-line: #d0e4de;
  --opms-surface: #ffffff;
  --opms-green: #008168;
  --opms-green-dark: #006652;
  --opms-mint: #e6f5f1;
  --opms-font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

html, body { height: 100%; }

.opms-body {
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(0, 129, 104, 0.10), transparent 55%),
    linear-gradient(180deg, #f2f8f6 0%, #eef3f1 45%, #f7faf9 100%);
  color: var(--opms-ink);
  font-family: var(--opms-font);
  font-size: 0.98rem;
  margin: 0;
}

.opms-topbar {
  position: sticky;
  top: 0;
  z-index: 1120;
  min-height: var(--opms-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 1rem;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--opms-line);
  box-shadow: 0 1px 0 rgba(0, 129, 104, 0.04);
}

.opms-top-brand {
  font-weight: 800;
  color: var(--opms-brand-dark);
  text-decoration: none;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
}
.opms-top-brand:hover { color: var(--opms-brand); }

.opms-menu-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--opms-line);
  border-radius: 0.65rem;
  background: #fff;
  color: var(--opms-brand-dark);
  font-size: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  z-index: 1110;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.opms-menu-toggle:hover { background: var(--opms-mint); border-color: #a8d5ca; }
.opms-menu-toggle:focus-visible { outline: 2px solid #008168; outline-offset: 2px; }

.opms-user-chip {
  font-size: 0.85rem;
  color: #3f675e;
  background: var(--opms-brand-light);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  white-space: nowrap;
  font-weight: 600;
}

.opms-sidebar {
  position: fixed !important;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--opms-sidebar);
  background: linear-gradient(180deg, #006652 0%, #008168 70%, #00967a 100%) !important;
  color: #fff !important;
  z-index: 1100;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.opms-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  min-height: var(--opms-topbar);
}

.opms-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 0.55rem;
  background: rgba(255,255,255,0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.opms-logo-text { font-weight: 700; letter-spacing: 0.06em; }

.opms-side-nav {
  padding: 0.75rem 0.55rem 1.5rem;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.15rem;
}

.opms-side-link {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255,255,255,0.92) !important;
  text-decoration: none !important;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}
.opms-side-link i { font-size: 1.15rem; width: 1.25rem; text-align: center; flex-shrink: 0; }
.opms-side-link:hover { background: rgba(255,255,255,0.14); color: #fff !important; }
.opms-side-sep { height: 1px; background: rgba(255,255,255,0.14); margin: 0.55rem 0.4rem; }
.opms-side-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.55);
  padding: 0.65rem 0.75rem 0.25rem;
  font-weight: 700;
}

body.sidebar-collapsed .opms-sidebar { width: var(--opms-sidebar-collapsed); }
body.sidebar-collapsed .opms-logo-text,
body.sidebar-collapsed .opms-side-link span { display: none; }
body.sidebar-collapsed .opms-side-link { justify-content: center; padding: 0.7rem; }

.opms-main {
  padding: 1.1rem 1.15rem 2rem;
  min-height: calc(100vh - var(--opms-topbar));
}

@media (min-width: 992px) {
  body.has-sidebar .opms-main { margin-left: var(--opms-sidebar); }
  body.has-sidebar.sidebar-collapsed .opms-main { margin-left: var(--opms-sidebar-collapsed); }
  .opms-sidebar-backdrop { display: none !important; }
}

.opms-sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
  .opms-sidebar { transform: translateX(-105%); box-shadow: 8px 0 28px rgba(0,0,0,0.18); }
  body.sidebar-open .opms-sidebar { transform: translateX(0) !important; width: min(86vw, var(--opms-sidebar)) !important; }
  body.sidebar-open .opms-sidebar-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(8, 28, 24, 0.45);
    z-index: 1090;
  }
  body.sidebar-collapsed .opms-sidebar { width: min(86vw, var(--opms-sidebar)); }
  body.sidebar-collapsed .opms-logo-text,
  body.sidebar-collapsed .opms-side-link span { display: inline; }
  body.sidebar-collapsed .opms-side-link { justify-content: flex-start; padding: 0.65rem 0.75rem; }
}

.opms-card {
  background: var(--opms-surface);
  border: 1px solid var(--opms-line);
  border-radius: 0.9rem;
  padding: 1.15rem 1.2rem;
  box-shadow: 0 10px 28px rgba(0, 129, 104, 0.06);
}

.form-label { font-weight: 600; color: #2d4f47; font-size: 0.9rem; }
.form-control, .form-select {
  border-color: #c5ddd6;
  border-radius: 0.65rem;
}
.form-control:focus, .form-select:focus {
  border-color: #008168;
  box-shadow: 0 0 0 0.2rem rgba(0, 129, 104, 0.18);
}
.alert-success {
  background: #e6f5f1;
  border-color: #b7dfd3;
  color: #006652;
}
.alert-danger {
  border-radius: 0.65rem;
}
/* Hide empty validation summary (prevents pink bar with no message) */
.validation-summary-valid {
  display: none !important;
}

/* --- Auth / Login --- */
body.is-auth-page {
  background: #e8f1ef;
}
body.is-auth-page .opms-topbar { display: none !important; }
body.is-auth-page .opms-main {
  padding: 0 !important;
  min-height: 100vh;
  margin: 0 !important;
}
body.is-auth-page .opms-bottom-nav { display: none !important; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.auth-shell--split {
  max-width: 1080px;
  margin: clamp(1rem, 4vw, 2.5rem) auto;
  min-height: calc(100vh - clamp(2rem, 8vw, 5rem));
  border-radius: 1.5rem;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.8) inset,
    0 28px 70px rgba(0, 55, 45, 0.14);
}

.auth-brand-pane {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: clamp(2rem, 5vw, 3.5rem);
  display: flex;
  align-items: center;
  background:
    linear-gradient(160deg, rgba(0, 40, 34, 0.45) 0%, transparent 55%),
    linear-gradient(185deg, #00382f 0%, #005544 38%, #008168 100%);
}
.auth-brand-pane--photo {
  padding: 0;
  align-items: flex-end;
  justify-content: flex-start;
  min-height: 100%;
}
.auth-brand-photo {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(125deg, rgba(0, 70, 58, 0.35), transparent 50%),
    radial-gradient(ellipse 70% 60% at 70% 30%, rgba(255,255,255,0.18), transparent 55%),
    linear-gradient(160deg, #0a4f44 0%, #127a68 42%, #1a9a7f 100%);
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  animation: auth-photo-ken 18s ease-in-out infinite alternate;
}
.auth-brand-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 22% 28%, rgba(255,255,255,0.22) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 62%, rgba(255,255,255,0.16) 0 1.5px, transparent 3px),
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
  opacity: 0.55;
}
.auth-brand-photo::after {
  content: "";
  position: absolute;
  width: 14rem;
  height: 14rem;
  right: 8%;
  top: 18%;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  box-shadow: 0 0 0 28px rgba(255,255,255,0.05);
}
.auth-brand-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 35, 30, 0.25) 0%, rgba(0, 35, 30, 0.15) 40%, rgba(0, 28, 24, 0.72) 100%);
}
.auth-brand-welcome {
  position: relative;
  z-index: 2;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  max-width: 22rem;
}
.auth-welcome-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.82;
}
.auth-welcome-title {
  margin: 0 0 0.4rem;
  font-size: clamp(2.1rem, 4.5vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.auth-welcome-sub {
  margin: 0;
  font-size: 1.05rem;
  opacity: 0.9;
  line-height: 1.45;
}
.auth-brand-pane::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 75% 70% at 30% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}
.auth-brand-pane--photo::before { display: none; }
.auth-brand-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}
.auth-brand-glow--a {
  width: 28rem; height: 28rem;
  right: -8rem; bottom: -10rem;
  background: radial-gradient(circle, rgba(120, 230, 200, 0.22), transparent 68%);
  animation: auth-drift 14s ease-in-out infinite alternate;
}
.auth-brand-glow--b {
  width: 16rem; height: 16rem;
  left: -4rem; top: 12%;
  background: radial-gradient(circle, rgba(255,255,255,0.14), transparent 70%);
  animation: auth-drift 11s ease-in-out infinite alternate-reverse;
}
.auth-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 28rem;
}
.auth-logo { margin-bottom: 1.35rem; }
.auth-logo-mark,
.auth-logo-mark--sm {
  width: 3.4rem; height: 3.4rem;
  border-radius: 0.9rem;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  box-shadow: 0 10px 28px rgba(0, 30, 24, 0.22);
  animation: auth-mark-float 5.5s ease-in-out infinite;
}
.auth-logo-mark--sm {
  width: 2.5rem; height: 2.5rem;
  font-size: 1.05rem;
  animation: none;
  box-shadow: none;
}
.auth-logo-mark--solid {
  background: linear-gradient(145deg, #008168, #00a07f);
  border: none;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 129, 104, 0.28);
}
.auth-card-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}
.auth-card-brand-name {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--opms-ink);
  line-height: 1;
}
.auth-card-brand-sub {
  font-size: 0.78rem;
  color: var(--opms-muted);
  margin-top: 0.15rem;
}
.auth-role-block { margin-bottom: 1.15rem; }
.auth-role-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5a7a72;
  margin-bottom: 0.55rem;
}
.auth-role-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 9.5rem;
  overflow-y: auto;
  padding-bottom: 0.15rem;
}
.auth-role-hint {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.01em;
}
.auth-role-chip {
  --role: #008168;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: color-mix(in srgb, var(--role) 88%, #000);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--role) 35%, transparent);
}
.auth-role-chip i { font-size: 0.95rem; }
.auth-role-chip:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.auth-role-chip.is-active {
  outline: 2px solid #fff;
  box-shadow:
    0 0 0 2px var(--role),
    0 8px 18px color-mix(in srgb, var(--role) 40%, transparent);
  transform: translateY(-1px);
}
.auth-form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.15rem 0 1rem;
  font-size: 0.88rem;
}
.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #3f675e;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
}
.auth-remember input { width: 1.05rem; height: 1.05rem; accent-color: #008168; }
.auth-meta-hint { color: #7a9790; font-size: 0.82rem; }
.auth-brand-name {
  margin: 0 0 0.35rem;
  font-size: clamp(2.75rem, 6vw, 4.25rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 0.95;
  text-transform: uppercase;
}
.auth-tagline {
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.78;
}
.auth-lead {
  margin: 0;
  max-width: 24rem;
  font-size: 1.08rem;
  line-height: 1.55;
  opacity: 0.92;
  font-weight: 400;
}

.auth-form-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem) 1.25rem;
  background: #fff;
}
.auth-shell--split .auth-form-pane {
  background:
    radial-gradient(ellipse 55% 40% at 90% 0%, rgba(0, 129, 104, 0.06), transparent 55%),
    #fff;
}
.auth-card {
  width: 100%;
  max-width: 26rem;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--opms-line);
  border-radius: 1.25rem;
  padding: 1.85rem 1.65rem 1.55rem;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 22px 50px rgba(0, 70, 56, 0.09);
  backdrop-filter: blur(8px);
}
.auth-card--wide {
  max-width: 28rem;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0.35rem 0.25rem 0.5rem;
}
.auth-card--inset { max-width: none; box-shadow: 0 14px 40px rgba(0, 80, 64, 0.07); }
.auth-card-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.15rem 1.35rem;
  background: linear-gradient(135deg, #006652, #008168 60%, #00a07f);
}
.auth-form-title {
  margin: 0 0 0.25rem;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--opms-ink);
  letter-spacing: -0.01em;
}
.auth-form-sub {
  margin: 0 0 1.35rem;
  color: var(--opms-muted);
  font-size: 0.95rem;
}
.auth-alert {
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}
.auth-field { margin-bottom: 1.05rem; }
.auth-field .form-label {
  font-weight: 700;
  font-size: 0.86rem;
  color: #2f564e;
  margin-bottom: 0.35rem;
}
.auth-input .input-group-text {
  background: #f0f8f5;
  border-color: #c5ddd6;
  color: #008168;
  border-radius: 0.75rem 0 0 0.75rem;
  padding-left: 0.9rem;
  padding-right: 0.75rem;
}
.auth-input .form-control {
  border-color: #c5ddd6;
  background: #fff;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.auth-input .form-control::placeholder { color: #9bb5ae; }
.auth-input .form-control:focus {
  border-color: #008168;
  box-shadow: none;
  z-index: 3;
}
.auth-input:focus-within .input-group-text,
.auth-input:focus-within .form-control,
.auth-input:focus-within .auth-pwd-toggle {
  border-color: #008168;
}
.auth-input:focus-within {
  box-shadow: 0 0 0 0.2rem rgba(0, 129, 104, 0.14);
  border-radius: 0.75rem;
}
.auth-pwd-toggle {
  border-color: #c5ddd6;
  border-radius: 0 0.75rem 0.75rem 0;
  color: #5a7a72;
  background: #f8fcfa;
  min-width: 3rem;
}
.auth-pwd-toggle:hover {
  background: #e6f5f1;
  color: #008168;
  border-color: #c5ddd6;
}
.auth-submit {
  margin-top: 0.35rem;
  border-radius: 0.85rem;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 10px 24px rgba(0, 129, 104, 0.22);
}
.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 129, 104, 0.28);
}
.auth-submit:disabled,
.auth-submit.is-loading {
  opacity: 0.88;
  cursor: wait;
}
.auth-portal-link {
  margin: 1.35rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--opms-muted);
}
.auth-link {
  color: #008168 !important;
  font-weight: 700;
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }
.auth-foot {
  margin: 1.1rem 0 0;
  font-size: 0.8rem;
  color: #7a9790;
  text-align: center;
}

.auth-anim {
  opacity: 0;
  transform: translateY(12px);
  animation: auth-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.auth-anim--1 { animation-delay: 0.05s; }
.auth-anim--2 { animation-delay: 0.14s; }
.auth-anim--3 { animation-delay: 0.22s; }
.auth-anim--4 { animation-delay: 0.3s; }
.auth-anim--5 { animation-delay: 0.18s; }

@keyframes auth-rise {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes auth-mark-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes auth-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-18px, -12px) scale(1.06); }
}
@keyframes auth-photo-ken {
  from { transform: scale(1.02) translate(0, 0); }
  to { transform: scale(1.08) translate(-1.5%, -1%); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-anim,
  .auth-logo-mark,
  .auth-brand-glow,
  .auth-brand-photo,
  .auth-submit {
    animation: none !important;
    transition: none !important;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 991.98px) {
  .auth-shell,
  .auth-shell--split {
    grid-template-columns: 1fr;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    max-width: none;
    box-shadow: none;
  }
  .auth-brand-pane {
    padding: 1.75rem 1.35rem 1.4rem;
    min-height: auto;
    align-items: flex-end;
  }
  .auth-brand-pane--photo {
    min-height: 38vh;
    padding: 0;
  }
  .auth-welcome-title { font-size: 2rem; }
  .auth-brand-name {
    font-size: clamp(2.2rem, 11vw, 3rem);
    margin-bottom: 0.15rem;
  }
  .auth-tagline { margin-bottom: 0.55rem; font-size: 0.8rem; }
  .auth-lead {
    font-size: 0.95rem;
    max-width: none;
    opacity: 0.88;
  }
  .auth-logo { margin-bottom: 0.85rem; }
  .auth-logo-mark { width: 2.75rem; height: 2.75rem; font-size: 1.2rem; }
  .auth-form-pane { padding: 1.15rem 1rem 2rem; justify-content: flex-start; }
  .auth-card { padding: 1.4rem 1.15rem 1.25rem; border-radius: 1.05rem; }
  .auth-card--wide { padding: 0.2rem 0; }
  .auth-form-title { font-size: 1.35rem; }
  .auth-role-chip { padding: 0.42rem 0.7rem; font-size: 0.76rem; }
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .auth-role-chip {
    background: #008168;
    box-shadow: 0 4px 12px rgba(0, 129, 104, 0.28);
  }
  .auth-role-chip[data-role="doctor"] { background: #1d5fd1; }
  .auth-role-chip[data-role="nurse"] { background: #0e7490; }
  .auth-role-chip[data-role="pharmacy"] { background: #15803d; }
  .auth-role-chip[data-role="lab"] { background: #1d4ed8; }
  .auth-role-chip[data-role="reception"] { background: #0f766e; }
  .auth-role-chip[data-role="admin"] { background: #334155; }
  .auth-role-chip[data-role="cashier"] { background: #b45309; }
  .auth-role-chip[data-role="accounts"] { background: #6d28d9; }
  .auth-role-chip[data-role="hr"] { background: #be185d; }
  .auth-role-chip[data-role="care"] { background: #047857; }
  .auth-role-chip[data-role="procedure"] { background: #c2410c; }
  .auth-role-chip[data-role="emergency"] { background: #b91c1c; }
  .auth-role-chip[data-role="patient"] { background: #0369a1; }
}

.opms-login-wrap {
  min-height: calc(100vh - var(--opms-topbar));
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top right, rgba(0, 129, 104, 0.14), transparent 42%),
    linear-gradient(180deg, #f3faf7, #e7efec);
}

.opms-login-panel { width: 100%; max-width: 440px; }

.btn-touch { min-height: 48px; font-size: 1.05rem; font-weight: 700; }
.form-control-lg, .form-select-lg { min-height: 48px; }
.table-touch td, .table-touch th { vertical-align: middle; padding: 0.85rem 0.75rem; }

.btn-success, .btn-success:focus {
  background-color: #008168 !important;
  border-color: #008168 !important;
}
.btn-success:hover { background-color: #006652 !important; border-color: #006652 !important; }
.btn-outline-success {
  color: #008168 !important;
  border-color: #008168 !important;
}
.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success.active,
.btn-outline-success:active,
.pharmacy-subnav .btn-outline-success.active,
.pharmacy-subnav a.btn.active {
  background-color: #008168 !important;
  border-color: #008168 !important;
  color: #fff !important;
}
.pharmacy-subnav .btn-outline-success.active i,
.pharmacy-subnav a.btn.active i {
  color: #fff !important;
}
.text-success { color: #008168 !important; }
.bg-success { background-color: #008168 !important; }
.progress-bar.bg-success { background-color: #008168 !important; }

.app-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
@media (min-width: 576px) { .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 992px) { .app-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .app-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.app-tile {
  display: flex !important;
  flex-direction: column;
  gap: 0.45rem;
  text-decoration: none !important;
  color: var(--opms-ink) !important;
  background: #fff;
  border: 1px solid var(--opms-line);
  border-radius: 1rem;
  padding: 1rem 0.9rem;
  min-height: 6.5rem;
  box-shadow: 0 6px 18px rgba(0, 129, 104, 0.05);
}
.app-tile:hover {
  border-color: #008168;
  color: #006652 !important;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 129, 104, 0.1);
}
.app-tile-icon {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #e6f5f1, #d4efe7);
  color: #008168;
  font-size: 1.25rem;
}
.app-tile-title { font-weight: 700; font-size: 0.95rem; }
.app-tile-sub { font-size: 0.78rem; color: #62857c; }

.kpi-hero {
  background: linear-gradient(135deg, #006652, #008168 55%, #00a07f);
  color: #fff;
  border-radius: 1rem;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}
.kpi-stat {
  background: #fff;
  border: 1px solid var(--opms-line);
  border-radius: 0.9rem;
  padding: 0.95rem;
  text-align: center;
  height: 100%;
}
.kpi-stat .label { color: #62857c; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-stat .value { font-size: 1.55rem; font-weight: 800; color: #006652; line-height: 1.2; }

.p360-tabs .nav-link {
  border: 0;
  color: #3f675e;
  font-weight: 600;
  border-radius: 999px !important;
  padding: 0.45rem 0.9rem;
}
.p360-tabs .nav-link.active { background: #008168; color: #fff; }
.p360-chip {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  background: #e6f5f1;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.82rem;
  margin: 0.15rem;
}
.vital-pill {
  border: 1px solid var(--opms-line);
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: #fbfefd;
}
.vital-pill .k { font-size: 0.72rem; color: #62857c; text-transform: uppercase; }
.vital-pill .v { font-weight: 700; color: #006652; }

.timeline { position: relative; padding-left: 1.1rem; }
.timeline-item { position: relative; padding: 0 0 1rem 0.85rem; border-left: 2px solid #d0e4de; }
.timeline-dot {
  position: absolute; left: -0.4rem; top: 0.25rem; width: 0.7rem; height: 0.7rem;
  border-radius: 50%; background: #008168;
}

.opms-side-link.active {
  background: rgba(255,255,255,0.2);
  box-shadow: inset 3px 0 0 #fff;
}
.opms-side-link.active.exact { background: rgba(255,255,255,0.28); }

.btn-mic-name {
  min-width: 52px;
  color: #008168 !important;
  border-color: #008168 !important;
}
.btn-mic-name.listening {
  background: #dc3545 !important;
  border-color: #dc3545 !important;
  color: #fff !important;
  animation: micPulse 1s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
}

.doctor-now-card {
  border: 2px solid #008168;
  background: linear-gradient(135deg, #e6f5f1, #fff 55%);
}
.doctor-queue-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--opms-line);
  padding: 0.85rem 0;
}
.doctor-queue-row.is-current {
  background: #e6f5f1;
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: 0.65rem;
}

@media (max-width: 575.98px) {
  .opms-main { padding: 0.75rem 0.7rem 1.5rem; }
  .opms-card { padding: 0.9rem 0.85rem; border-radius: 0.75rem; }
  .opms-user-chip { display: none; }
  .opms-top-brand { font-size: 0.95rem; }
  .doctor-queue-row { flex-direction: column; align-items: stretch; }
  .doctor-queue-row .btn { width: 100%; }
  .display-5 { font-size: 2rem; }
  .table-touch td, .table-touch th { padding: 0.65rem 0.5rem; font-size: 0.9rem; }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .opms-main { padding: 0.95rem 1rem 1.75rem; }
}

/* Patient flow strip */
.opms-flow-nav {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.35rem 0.15rem 0.85rem;
  margin-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.opms-flow-nav::-webkit-scrollbar { display: none; }
.opms-flow-step {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--opms-line);
  color: #3f675e !important;
  text-decoration: none !important;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.opms-flow-step.active {
  background: #008168;
  border-color: #008168;
  color: #fff !important;
}
.opms-flow-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.opms-flow-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border-radius: 0.65rem;
  background: #fff;
  border: 1px solid var(--opms-line);
  color: #006652 !important;
  text-decoration: none !important;
  font-size: 0.85rem;
  font-weight: 600;
}
.opms-flow-links a:hover { border-color: #008168; background: #e6f5f1; }

.live-dept-head {
  background: #e6f5f1;
  margin: 0 -0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.65rem;
}
.live-patient-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--opms-line);
  padding: 0.75rem 0;
}
.live-patient-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

/* Mobile app-like bottom nav */
.opms-bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1030;
  background: rgba(255,255,255,0.97);
  border-top: 1px solid var(--opms-line);
  padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
  justify-content: space-around;
  box-shadow: 0 -8px 24px rgba(0, 129, 104, 0.08);
}
.opms-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.2rem;
  color: #62857c !important;
  text-decoration: none !important;
  font-size: 0.68rem;
  font-weight: 700;
}
.opms-bottom-nav a i { font-size: 1.25rem; }
.opms-bottom-nav a.active { color: #008168 !important; }

body.has-sidebar .opms-bottom-nav { display: flex; }
body.has-sidebar .opms-main { padding-bottom: 4.75rem; }

@media (max-width: 991.98px) {
  .live-patient-row { flex-direction: column; align-items: stretch; }
  .live-patient-actions { justify-content: stretch; }
  .live-patient-actions .btn, .live-patient-actions form { flex: 1 1 auto; }
  .opms-flow-step span { font-size: 0.75rem; }
  .clinical-list-row { flex-direction: column; align-items: stretch; }
  .consult-tabs .nav-link { font-size: 0.82rem; padding: 0.45rem 0.7rem; }
}

/* Today / OPD stage / clinical lists */
.today-bar { margin-bottom: 0.25rem; }
.today-bar-date {
  color: #5a7a72;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.opd-stage {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.85rem;
  margin-bottom: 0.25rem;
  scrollbar-width: none;
}
.opd-stage::-webkit-scrollbar { display: none; }
.opd-stage-item {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 3.6rem;
  padding: 0.4rem 0.45rem;
  border-radius: 0.75rem;
  text-decoration: none !important;
  color: #62857c !important;
  font-size: 0.68rem;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--opms-line);
}
.opd-stage-item i { font-size: 1.05rem; }
.opd-stage-item.done { background: #e6f5f1; color: #006652 !important; border-color: #b7dfd3; }
.opd-stage-item.current {
  background: #008168;
  color: #fff !important;
  border-color: #008168;
  box-shadow: 0 6px 16px rgba(0, 129, 104, 0.25);
}
.opd-stage-sep {
  flex: 0 0 12px;
  height: 2px;
  background: #d0e4de;
  border-radius: 2px;
}
.opd-stage-sep.done, .opd-stage-sep.current { background: #008168; }

.clinical-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--opms-line);
  background: #fff;
}
.clinical-list-row.is-current { background: #e6f5f1; }
.clinical-list-row:last-child { border-bottom: 0; }

.next-flow-panel {
  background: #f3faf7;
  border: 1px solid var(--opms-line);
  border-radius: 0.85rem;
  padding: 0.75rem 0.85rem;
}
.consult-tabs {
  scrollbar-width: none;
  padding-bottom: 0.15rem;
}
.consult-tabs::-webkit-scrollbar { display: none; }
.consult-tabs .nav-link {
  white-space: nowrap;
  border-radius: 999px !important;
  color: #3f675e;
  font-weight: 700;
  background: #f3faf7;
}
.consult-tabs .nav-link.active {
  background: #008168 !important;
  color: #fff !important;
}
.consult-tabs .nav-link i { margin-right: 0.25rem; }
.sticky-actions {
  position: sticky;
  bottom: 0.5rem;
  background: rgba(255,255,255,0.95);
  padding: 0.65rem 0;
  z-index: 5;
}
@media (max-width: 991.98px) {
  .sticky-actions { bottom: 4.5rem; }
}
.btn-mic.listening {
  background: #dc3545 !important;
  color: #fff !important;
  border-color: #dc3545 !important;
}

/* Admin OPD dashboard */
.dash-welcome {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #e6f5f1 0%, #fff 55%, #f0f7f5 100%);
  border: 1px solid var(--opms-line);
}
.dash-kpi {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.05rem;
  border-radius: 1rem;
  min-height: 6.5rem;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(0, 97, 82, 0.12);
}
.dash-kpi i { font-size: 1.75rem; opacity: 0.85; }
.dash-kpi-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.9; }
.dash-kpi-value { font-size: 2rem; font-weight: 800; line-height: 1.15; }
.dash-kpi-sub { font-size: 0.78rem; opacity: 0.9; margin-top: 0.2rem; }
.dash-kpi--teal { background: linear-gradient(135deg, #008168, #00a388); }
.dash-kpi--green { background: linear-gradient(135deg, #1f8a4c, #2db86a); }
.dash-kpi--mint { background: linear-gradient(135deg, #0d6e8a, #1494b8); }
.dash-kpi--slate { background: linear-gradient(135deg, #3d5a5a, #5a7a7a); }
.dash-list-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--opms-line);
}
.dash-list-row:last-child { border-bottom: 0; }
.dash-alert {
  border-radius: 0.65rem;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.45rem;
  border: 1px solid var(--opms-line);
  background: #f7fbfa;
}
.dash-alert.alert-crit { border-color: #f1aeb5; background: #fff5f5; }
.dash-alert.alert-warn { border-color: #ffd666; background: #fffbeb; }
.dash-alert.alert-info { border-color: #9fd3c7; background: #f0faf7; }
.dash-mix-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8efed;
}
.dash-mix-bar .new { background: #008168; }
.dash-mix-bar .fu { background: #f0a202; }
.dash-mix .dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.25rem;
  vertical-align: middle;
}
.dash-mix .dot.new { background: #008168; }
.dash-mix .dot.fu { background: #f0a202; }
.pharm-row-gap { background: #fff8f8; border-left: 3px solid #dc3545; padding-left: 0.65rem; }

/* Care hub · emergency triage · workflow polish */
.care-hub-tile {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.care-hub-tile:hover {
  border-color: #008168;
  box-shadow: 0 4px 16px rgba(0, 129, 104, 0.12);
}
.care-hub .kpi-stat { min-height: 100%; }
.em-triage-card {
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--opms-line);
  background: #fff;
}
.em-triage-card .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #5a7a7a;
}
.em-triage-card .value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; }
.em-triage-card--red { border-left: 4px solid #dc3545; }
.em-triage-card--red .value { color: #dc3545; }
.em-triage-card--yellow { border-left: 4px solid #ffc107; }
.em-triage-card--yellow .value { color: #b8860b; }
.em-triage-card--green { border-left: 4px solid #008168; }
.em-triage-card--green .value { color: #008168; }
.em-triage-card-row { background: #f7fbfa; }
.doctor-workflow .opms-flow-links { margin-top: 0.5rem; }
.doctor-workflow .p360-chip { margin-bottom: 0.25rem; }
.doctor-desk-hero {
  background: linear-gradient(135deg, #1d5fd1 0%, #1747a6 45%, #0f2f6b 100%);
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
  color: #fff;
  box-shadow: 0 12px 28px rgba(122, 82, 36, 0.22);
}
.doctor-desk-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.2rem;
}
.doctor-desk-sub { font-size: 0.9rem; opacity: 0.88; }
.doctor-next-card { border-left: 4px solid #1d5fd1; }
.doctor-list-head { background: #eef4ff; color: #0f2f6b; }
.doctor-subnav { border-color: #c7d7fb; }
.doctor-subnav-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1d5fd1;
  margin-right: 0.35rem;
}
.kpi-stat--link { transition: transform .15s ease, box-shadow .15s ease; cursor: pointer; color: inherit; }
.kpi-stat--link:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(29,95,209,.18); border-color: #1d5fd1; }
.doc-filter-bar {
  display: flex; flex-wrap: nowrap; gap: 0.4rem; overflow-x: auto;
  -webkit-overflow-scrolling: touch; padding-bottom: 0.15rem;
}
.doc-filter-chip {
  border: 1px solid #c7d7fb; background: #fff; color: #0f2f6b;
  border-radius: 999px; padding: 0.45rem 0.85rem; font-size: 0.82rem; font-weight: 700;
  white-space: nowrap; flex: 0 0 auto;
}
.doc-filter-chip .badge { background: #eef4ff; color: #1747a6; margin-left: 0.25rem; }
.doc-filter-chip.is-active { background: #1d5fd1; border-color: #1d5fd1; color: #fff; }
.doc-filter-chip.is-active .badge { background: rgba(255,255,255,.22); color: #fff; }
.doc-patient-card {
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start;
  justify-content: space-between; padding: 0.85rem 1rem;
  border-bottom: 1px solid #efe6da; background: #fff;
}
.doc-patient-card.is-current { background: #f3f7ff; box-shadow: inset 3px 0 0 #1d5fd1; }
.doc-patient-card--compact { padding: 0.65rem 0.9rem; }
.doc-patient-token { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-bottom: 0.15rem; }
.doc-patient-name { font-size: 1.05rem; font-weight: 650; color: #1f2a27; }
.doc-patient-meta { font-size: 0.82rem; color: #6b7c76; margin-bottom: 0.35rem; }
.doc-patient-status-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.doc-patient-cta { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.doc-status {
  display: inline-block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; border-radius: 999px; padding: 0.2rem 0.55rem;
}
.doc-status--wait { background: #fef3c7; color: #92400e; }
.doc-status--called { background: #dbeafe; color: #1e40af; }
.doc-status--room { background: #1d5fd1; color: #fff; }
.doc-status--done { background: #d1fae5; color: #065f46; }
.doc-status--skip { background: #e5e7eb; color: #4b5563; }
.doc-status--cancel { background: #fee2e2; color: #991b1b; }
.consult-step-strip {
  display: flex; gap: 0.35rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 0.35rem; background: #fff; border: 1px solid #c7d7fb; border-radius: 999px;
}
.consult-step {
  border: 0; background: transparent; color: #1747a6; border-radius: 999px;
  padding: 0.45rem 0.75rem; font-size: 0.8rem; font-weight: 700; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 0.35rem; text-decoration: none;
}
.consult-step-n {
  width: 1.35rem; height: 1.35rem; border-radius: 50%; background: #eef4ff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem;
}
.consult-step.is-active { background: #1d5fd1; color: #fff; }
.consult-step.is-active .consult-step-n { background: rgba(255,255,255,.22); color: #fff; }
.auth-steps {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;
}
.auth-step {
  border: 1px solid #d0e4de; background: #fff; color: #5a7a72;
  border-radius: 999px; padding: 0.35rem 0.75rem; font-size: 0.78rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.auth-step span {
  width: 1.25rem; height: 1.25rem; border-radius: 50%; background: #e6f5f1;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem;
}
.auth-step.is-active { background: #008168; border-color: #008168; color: #fff; }
.auth-step.is-active span { background: rgba(255,255,255,.22); color: #fff; }
.auth-step-sep {
  width: 1.25rem; height: 2px; background: #d0e4de; border-radius: 2px;
}
.opd-stage--doctor .opd-stage-item.current {
  background: #1d5fd1;
  border-color: #1d5fd1;
  box-shadow: 0 6px 16px rgba(154, 107, 47, 0.28);
}
.opd-stage--doctor .opd-stage-item.done {
  background: #eef4ff;
  color: #1747a6 !important;
  border-color: #c7d7fb;
}
.opd-stage--doctor .opd-stage-sep.done,
.opd-stage--doctor .opd-stage-sep.current { background: #1d5fd1; }
.opd-stage--pharmacy .opd-stage-item.current {
  background: #0b7a68;
  border-color: #0b7a68;
  box-shadow: 0 6px 16px rgba(11, 122, 104, 0.28);
}
.opd-stage--pharmacy .opd-stage-item.done {
  background: #e8f6f2;
  color: #0b7a68 !important;
  border-color: #b7dfd3;
}
.opd-stage--pharmacy .opd-stage-sep.done,
.opd-stage--pharmacy .opd-stage-sep.current { background: #0b7a68; }
.pharmacy-desk-hero {
  background: linear-gradient(135deg, #0b7a68 0%, #086b5c 48%, #055a4d 100%);
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
  color: #fff;
  box-shadow: 0 12px 28px rgba(11, 122, 104, 0.22);
}
.pharmacy-desk-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.2rem;
}
.pharmacy-desk-sub { font-size: 0.9rem; opacity: 0.88; }
.doctor-consult-banner { border-top: 3px solid #1d5fd1; }
.doctor-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1rem;
  background: #eef4ff;
  color: #1d5fd1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}
.doctor-profile .kpi-stat { min-height: 100%; }

/* Billing - consolidated / dept bills */
.bill-hero { background: linear-gradient(135deg, #f3faf7 0%, #fff 55%); }
.bill-pay-card {
  border-color: #9dd4c5;
  box-shadow: 0 10px 28px rgba(0, 129, 104, 0.08);
}
.bill-invoice-table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a7a72;
  white-space: nowrap;
}
.bill-invoice-table tbody td { vertical-align: middle; }
.billing-subnav .btn.active,
.billing-subnav a.btn.btn-success {
  color: #fff !important;
}
.billing-subnav .btn-outline-success.active {
  background-color: #008168 !important;
  border-color: #008168 !important;
  color: #fff !important;
}
.bill-dept-block {
  border: 1px solid #d0e4de;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  background: #fafcfb;
}
.bill-card-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e4efeb;
}
.bill-card-row:last-child { border-bottom: none; }
.bill-list-card { transition: border-color 0.15s ease; }
.bill-list-card:hover { border-color: #008168; }

.pos-stock-list { max-height: 28rem; overflow: auto; }
.pos-hotkeys-bar { background: #f3faf7; }
.pos-layout .sticky-lg-top { z-index: 2; }
@media (max-width: 991.98px) {
  .pos-stock-panel { position: static !important; }
}

/* Desktop POS billing - select / add / next */
.pos-desk {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(18rem, 0.95fr);
  gap: 0.85rem;
  align-items: start;
}
@media (max-width: 991.98px) {
  .pos-desk { grid-template-columns: 1fr; }
}
.pos-desk-cart,
.pos-desk-catalog {
  background: #fff;
  border: 1px solid var(--opms-line);
  border-radius: 0.85rem;
  overflow: hidden;
}
.pos-desk-catalog { position: sticky; top: 4.5rem; }
@media (max-width: 991.98px) {
  .pos-desk-catalog { position: static; }
}
.pos-desk-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #f3faf7 0%, #fff 70%);
  border-bottom: 1px solid #e4efeb;
}
.pos-desk-body { padding: 0.85rem 1rem 1rem; }
.pos-search-wrap { position: relative; }
.pos-search-wrap .form-control {
  padding-left: 2.35rem;
  font-size: 1.05rem;
  min-height: 2.85rem;
}
.pos-search-wrap .pos-search-ico {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #008168;
  pointer-events: none;
}
.pos-pick-list {
  max-height: min(62vh, 30rem);
  overflow: auto;
  border: 1px solid #e4efeb;
  border-radius: 0.65rem;
  background: #fafcfb;
}
.pos-pick-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #e8f0ed;
  background: transparent;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}
.pos-pick-item:last-child { border-bottom: 0; }
.pos-pick-item:hover,
.pos-pick-item.is-active {
  background: #e6f5f1;
}
.pos-pick-item.is-active {
  box-shadow: inset 3px 0 0 #008168;
}
.pos-pick-item.pos-picked {
  animation: posPickPulse 0.45s ease;
  background: #c8ebe0;
}
@keyframes posPickPulse {
  0% { transform: scale(1); }
  40% { transform: scale(0.985); background: #9dd4c5; }
  100% { transform: scale(1); }
}
.pos-cart-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.pos-cart-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a7a72;
  font-weight: 700;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #d0e4de;
  background: #f7fbfa;
  position: sticky;
  top: 0;
  z-index: 1;
}
.pos-cart-table tbody td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid #eef5f2;
  vertical-align: middle;
}
.pos-cart-row.pos-cart-enter {
  animation: posCartIn 0.35s ease;
}
.pos-cart-row.pos-flash-add {
  background: #e6f5f1;
}
@keyframes posCartIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: none; }
}
.pos-cart-empty {
  border: 1px dashed #b8d4cb;
  border-radius: 0.75rem;
  padding: 1.5rem 1rem;
  text-align: center;
  color: #5a7a72;
  background: #f7fbfa;
}
.pos-total-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 2px solid #d0e4de;
}
.pos-total-bar .pos-total-amt {
  font-size: 1.85rem;
  font-weight: 800;
  color: #008168;
  line-height: 1;
}
.pos-toast-host {
  position: fixed;
  right: 1rem;
  bottom: 5.5rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  pointer-events: none;
}
.pos-toast {
  background: #14302b;
  color: #fff;
  padding: 0.55rem 0.9rem;
  border-radius: 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 24px rgba(20, 48, 43, 0.25);
}
.pos-toast.show {
  opacity: 1;
  transform: none;
}
.pos-hint-keys {
  font-size: 0.75rem;
  color: #5a7a72;
}
.pos-hint-keys kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
  background: #eef5f2;
  border: 1px solid #d0e4de;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Pharmacy desktop billing (SOP reference UI) */
.pharm-bill {
  --ph-line: #d5e4df;
  --ph-teal: #0b7a68;
  --ph-teal-soft: #e8f6f2;
  background: linear-gradient(180deg, #f0f7f5 0%, #f7faf9 40%, #fff 100%);
  border: 1px solid var(--ph-line);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 1rem;
}
.pharm-bill-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: linear-gradient(90deg, #0b5f52 0%, #0b7a68 55%, #14967f 100%);
  color: #fff;
}
.pharm-bill-brand { display: flex; align-items: center; gap: 0.65rem; }
.pharm-bill-logo {
  width: 2.4rem; height: 2.4rem; border-radius: 0.55rem;
  background: rgba(255,255,255,0.15); display: grid; place-items: center; font-size: 1.25rem;
}
.pharm-bill-title { font-weight: 800; letter-spacing: 0.02em; line-height: 1.1; }
.pharm-bill-sub { font-size: 0.72rem; opacity: 0.85; }
.pharm-bill-meta {
  display: flex; flex-wrap: wrap; gap: 0.65rem 1rem; font-size: 0.78rem; opacity: 0.95;
}
.pharm-bill-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pharm-bill-actions .btn { border-color: rgba(255,255,255,0.45); color: #fff; }
.pharm-bill-actions .btn-success { background: #22c55e; border-color: #22c55e; color: #053; }
.pharm-bill-actions .btn-warning { border: 0; }
.pharm-bill-body {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(16.5rem, 1fr);
  gap: 0.75rem;
  padding: 0.75rem;
  align-items: start;
}
@media (max-width: 1099.98px) {
  .pharm-bill-body { grid-template-columns: 1fr; }
}
.pharm-bill-main { display: flex; flex-direction: column; gap: 0.65rem; min-width: 0; }
.pharm-panel {
  background: #fff; border: 1px solid var(--ph-line); border-radius: 0.65rem; overflow: hidden;
}
.pharm-panel-h {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.75rem; background: var(--ph-teal-soft); border-bottom: 1px solid var(--ph-line);
  font-size: 0.82rem; font-weight: 700; color: #0b5f52;
}
.pharm-panel-h kbd, .pharm-side-h kbd, .pharm-keys kbd, .btn kbd {
  background: #fff; color: #0b5f52; border: 1px solid #b8d4cb; border-radius: 0.25rem; box-shadow: none;
  padding: 0.05rem 0.3rem; font-size: 0.68rem; font-weight: 700;
}
.pharm-panel-b { padding: 0.65rem 0.75rem; }
.pharm-patient-card {
  background: #f7fbfa; border: 1px solid #dceae5; border-radius: 0.5rem; padding: 0.65rem 0.75rem;
}
/* Shared patient search (Pharmacy + Lab billing) */
.opms-pat-search { position: relative; z-index: 30; }
.opms-pat-hits {
  position: absolute; left: 0; right: 0; top: calc(100% + 0.2rem);
  background: #fff; border: 1px solid #c5ddd5; border-radius: 0.55rem;
  box-shadow: 0 10px 28px rgba(11, 95, 82, 0.14);
  max-height: min(16rem, 50vh); overflow: auto; z-index: 50;
}
.lab-bill .opms-pat-hits { border-color: #c5d4e4; box-shadow: 0 10px 28px rgba(30, 58, 138, 0.14); }
.opms-pat-hit {
  display: flex; flex-direction: column; gap: 0.15rem; width: 100%;
  text-align: left; border: 0; border-bottom: 1px solid #e8f0ed;
  background: #fff; padding: 0.65rem 0.85rem; cursor: pointer;
}
.opms-pat-hit:last-child { border-bottom: 0; }
.opms-pat-hit:hover, .opms-pat-hit:focus {
  background: #e8f6f2; outline: none;
}
.lab-bill .opms-pat-hit:hover, .lab-bill .opms-pat-hit:focus { background: #e8f0fe; }
.opms-pat-hit.empty { color: #6b7c76; cursor: default; font-size: 0.85rem; }
.opms-pat-hit-main {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.65rem;
}
.opms-pat-hit-name { font-weight: 700; font-size: 0.95rem; color: #0b5f52; }
.lab-bill .opms-pat-hit-name { color: #1e3a8a; }
.opms-pat-hit-code { font-size: 0.75rem; color: #6b7c76; font-family: ui-monospace, monospace; }
.opms-pat-hit-phone {
  font-size: 0.82rem; font-weight: 600; color: #0b7a68;
  display: flex; align-items: center; gap: 0.3rem;
}
.lab-bill .opms-pat-hit-phone { color: #1d4ed8; }
.opms-pat-phone {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.9rem; font-weight: 700; color: #0b7a68; margin-top: 0.15rem;
}
.lab-bill .opms-pat-phone { color: #1d4ed8; }
.opms-pat-phone-link { color: inherit; text-decoration: none; }
.opms-pat-phone-link:hover { text-decoration: underline; }
#secPatient.pharm-panel, .lab-top-grid > .lab-panel:first-child {
  overflow: visible;
}
@media (max-width: 575.98px) {
  .opms-pat-hits { max-height: 40vh; }
  .opms-pat-hit { padding: 0.75rem 0.85rem; }
  .opms-pat-hit-name { font-size: 1rem; }
}

.pharm-dd { z-index: 40; max-height: 14rem; overflow: auto; }
.pharm-type-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.pharm-chip {
  border: 1px solid #c5ddd5; background: #fff; color: #0b5f52;
  border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.75rem; font-weight: 600;
}
.pharm-chip.active, .pharm-chip:hover { background: var(--ph-teal); color: #fff; border-color: var(--ph-teal); }
.pharm-stock-wrap { max-height: 12.5rem; overflow: auto; border: 1px solid var(--ph-line); border-radius: 0.45rem; }
.pharm-stock-table thead th, .pharm-cart-table thead th {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.03em; color: #5a7a72;
  background: #f7fbfa; position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
.pharm-stock-row { cursor: pointer; }
.pharm-stock-row:hover, .pharm-stock-row:focus { background: #e8f6f2; outline: none; }
.stock-ok { color: #0b7a68; font-weight: 700; }
.stock-low { color: #d97706; font-weight: 700; }
.stock-out { color: #dc2626; font-weight: 700; }
.pharm-cart-table .form-control-sm { min-height: 1.85rem; padding: 0.15rem 0.35rem; }
.pharm-cart-foot { background: #f7fbfa; border-top: 1px solid var(--ph-line); }
.btn-xs { padding: 0.15rem 0.45rem; font-size: 0.72rem; line-height: 1.3; border-radius: 0.35rem; }
.pharm-bill-side { position: sticky; top: 4.25rem; }
@media (max-width: 1099.98px) { .pharm-bill-side { position: static; } }
.pharm-side-card {
  background: #fff; border: 1px solid var(--ph-line); border-radius: 0.65rem; padding: 0.75rem; box-shadow: 0 8px 24px rgba(11,95,82,0.06);
}
.pharm-side-h { font-size: 0.82rem; font-weight: 700; color: #0b5f52; margin-bottom: 0.55rem; }
.pharm-sum { margin: 0; }
.pharm-sum > div {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  padding: 0.28rem 0; border-bottom: 1px dashed #e4efeb; font-size: 0.82rem;
}
.pharm-sum dt { margin: 0; color: #5a7a72; font-weight: 500; }
.pharm-sum dd { margin: 0; font-weight: 700; }
.pharm-net, .pharm-final {
  margin-top: 0.55rem; border-radius: 0.5rem; padding: 0.55rem 0.7rem;
  display: flex; justify-content: space-between; align-items: center;
}
.pharm-net { background: #e0f2fe; color: #075985; }
.pharm-final { background: #dcfce7; color: #166534; }
.pharm-net-val, .pharm-final-val { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.pharm-net-label, .pharm-final-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.pharm-pay-tabs {
  display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.75rem 0 0.5rem;
}
.pharm-pay-tabs button {
  flex: 1 1 auto; border: 1px solid #c5ddd5; background: #fff; border-radius: 0.4rem;
  padding: 0.35rem 0.4rem; font-size: 0.75rem; font-weight: 700; color: #0b5f52;
}
.pharm-pay-tabs button.active { background: var(--ph-teal); color: #fff; border-color: var(--ph-teal); }
.pharm-cash-box { background: #f7fbfa; border-radius: 0.5rem; padding: 0.55rem; }
.pharm-side-btns { display: flex; gap: 0.4rem; margin-top: 0.75rem; }
.pharm-side-btns .btn-lg { font-weight: 700; }
.pharm-bill-foot {
  border-top: 1px solid var(--ph-line); background: #f3faf7;
  padding: 0.45rem 0.75rem; display: flex; flex-direction: column; gap: 0.35rem;
}
.pharm-legend { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.72rem; }
.pharm-legend .leg::before {
  content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%;
  margin-right: 0.3rem; vertical-align: middle;
}
.pharm-legend .leg.ok::before { background: #0b7a68; }
.pharm-legend .leg.low::before { background: #d97706; }
.pharm-legend .leg.out::before { background: #dc2626; }
.pharm-legend .leg.near::before { background: #2563eb; }
.pharm-keys {
  display: flex; flex-wrap: wrap; gap: 0.45rem 0.85rem; align-items: center;
  font-size: 0.72rem; color: #5a7a72;
}
.pharm-keys a { color: inherit; text-decoration: none; }
.bg-success-subtle { background: #dcfce7; }

/* Lab desktop billing (SOP reference UI) - blue variant of pharmacy desk */
.lab-bill {
  --lab-line: #d0dde8;
  --lab-blue: #1d4ed8;
  --lab-blue-soft: #e8f0fe;
  background: linear-gradient(180deg, #eef4fb 0%, #f7fafc 40%, #fff 100%);
  border: 1px solid var(--lab-line);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 1rem;
}
.lab-bill-top {
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  background: linear-gradient(90deg, #1e3a8a 0%, #1d4ed8 55%, #3b82f6 100%);
  color: #fff;
}
.lab-bill-brand { display: flex; align-items: center; gap: 0.65rem; }
.lab-bill-logo {
  width: 2.4rem; height: 2.4rem; border-radius: 0.55rem;
  background: rgba(255,255,255,0.15); display: grid; place-items: center; font-size: 1.25rem;
}
.lab-bill-title { font-weight: 800; letter-spacing: 0.02em; line-height: 1.1; }
.lab-bill-sub { font-size: 0.72rem; opacity: 0.85; }
.lab-bill-meta { display: flex; flex-wrap: wrap; gap: 0.65rem 1rem; font-size: 0.78rem; }
.lab-bill-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.lab-bill-actions .btn { border-color: rgba(255,255,255,0.45); color: #fff; }
.lab-bill-actions .btn-success { background: #22c55e; border-color: #22c55e; color: #053; }
.lab-bill-body {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(16.5rem, 1fr);
  gap: 0.75rem; padding: 0.75rem; align-items: start;
}
@media (max-width: 1099.98px) { .lab-bill-body { grid-template-columns: 1fr; } }
.lab-bill-main { display: flex; flex-direction: column; gap: 0.65rem; min-width: 0; }
.lab-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(14rem, 0.85fr);
  gap: 0.65rem;
}
@media (max-width: 1199.98px) {
  .lab-top-grid { grid-template-columns: 1fr 1fr; }
  .lab-history-panel { grid-column: 1 / -1; }
}
@media (max-width: 767.98px) {
  .lab-top-grid { grid-template-columns: 1fr; }
}
.lab-pat-avatar {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: #dbeafe; color: #1d4ed8; display: grid; place-items: center; font-size: 1.25rem;
}
.lab-pat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 0.75rem;
}
.lab-pat-grid > div { display: flex; flex-direction: column; gap: 0.05rem; }
.lab-pat-grid strong { font-weight: 700; color: #1e3a8a; }
.lab-pay-tabs {
  display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.15rem 0 0.35rem;
}
.lab-pay-tabs button {
  flex: 1 1 auto; border: 1px solid #c5d4e4; background: #fff; border-radius: 0.4rem;
  padding: 0.35rem 0.4rem; font-size: 0.75rem; font-weight: 700; color: #1e3a8a;
}
.lab-pay-tabs button.active { background: var(--lab-blue); color: #fff; border-color: var(--lab-blue); }
.lab-cash-box { background: #f5f8fc; border-radius: 0.5rem; padding: 0.55rem; }
.lab-pkg-reco { border-top: 1px dashed var(--lab-line); background: #f8fbff; }
.lab-pkg-reco-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.lab-pkg-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
  border: 1px solid #c5d4e4; background: #fff; border-radius: 0.5rem;
  padding: 0.4rem 0.65rem; min-width: 8.5rem; text-align: left;
}
.lab-pkg-card:hover { border-color: var(--lab-blue); background: #eef4fb; }
.lab-pkg-name { font-size: 0.78rem; font-weight: 700; color: #1e3a8a; }
.lab-pkg-price { font-size: 0.85rem; font-weight: 800; }
.lab-pkg-add { font-size: 0.68rem; color: var(--lab-blue); font-weight: 700; }
.lab-bill-foot {
  border-top: 1px solid var(--lab-line); background: #eef4fb;
  padding: 0.45rem 0.75rem; display: flex; flex-wrap: wrap; gap: 0.45rem 0.85rem; align-items: center;
  font-size: 0.72rem; color: #5a6f86;
}
.lab-pay-opt {
  flex: 1 1 auto; border: 1px solid #c5d4e4; background: #fff; border-radius: 0.4rem;
  padding: 0.45rem 0.55rem; font-size: 0.8rem; font-weight: 700; color: #1e3a8a;
  text-align: center; cursor: pointer; margin: 0;
}
.lab-pay-opt input { display: none; }
.lab-pay-opt.active { background: var(--lab-blue, #1d4ed8); color: #fff; border-color: var(--lab-blue, #1d4ed8); }
.lab-pay-desk .lab-pay-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* Pharmacy top meta row (reference) */
.pharm-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.65rem;
}
@media (max-width: 1099.98px) {
  .pharm-top-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767.98px) {
  .pharm-top-grid { grid-template-columns: 1fr; }
}
.pharm-pat-avatar {
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: #d1fae5; color: #0b7a68; display: grid; place-items: center; font-size: 1.2rem;
}
.pharm-pat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem 0.65rem; margin-top: 0.45rem;
}
.pharm-bill-actions .btn-outline-light {
  border-color: rgba(255,255,255,0.55); color: #fff; background: transparent;
}
.pharm-bill-actions .btn-outline-light:hover { background: rgba(255,255,255,0.12); color: #fff; }
.pharm-pat-grid .grid-span-2 { grid-column: 1 / -1; }
.lab-panel {
  background: #fff; border: 1px solid var(--lab-line); border-radius: 0.65rem; overflow: hidden;
}
.lab-panel-h {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.75rem; background: var(--lab-blue-soft); border-bottom: 1px solid var(--lab-line);
  font-size: 0.82rem; font-weight: 700; color: #1e3a8a;
}
.lab-panel-h kbd, .lab-side-h kbd, .lab-keys kbd {
  background: #fff; border: 1px solid #b8c9dc; border-radius: 0.25rem;
  padding: 0.05rem 0.3rem; font-size: 0.68rem; font-weight: 700;
}
.lab-panel-b { padding: 0.65rem 0.75rem; }
.lab-patient-card {
  background: #f5f8fc; border: 1px solid #d5e0ec; border-radius: 0.5rem; padding: 0.65rem 0.75rem;
}
.lab-mode-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.5rem; }
.lab-mode-tabs button {
  border: 1px solid #c5d4e4; background: #fff; color: #1e3a8a;
  border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.75rem; font-weight: 600;
}
.lab-mode-tabs button.active, .lab-mode-tabs button:hover { background: var(--lab-blue); color: #fff; border-color: var(--lab-blue); }
.lab-type-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.lab-chip {
  border: 1px solid #c5d4e4; background: #fff; color: #1e3a8a;
  border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.75rem; font-weight: 600;
}
.lab-chip.active, .lab-chip:hover { background: var(--lab-blue); color: #fff; border-color: var(--lab-blue); }
.lab-test-wrap { max-height: 14rem; overflow: auto; border: 1px solid var(--lab-line); border-radius: 0.45rem; }
.lab-test-table thead th, .lab-cart-table thead th {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.03em; color: #5a6f86;
  background: #f5f8fc; position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
.lab-test-row { cursor: pointer; }
.lab-test-row:hover { background: #e8f0fe; }
.lab-bill-side { position: sticky; top: 4.25rem; }
@media (max-width: 1099.98px) { .lab-bill-side { position: static; } }
.lab-side-card {
  background: #fff; border: 1px solid var(--lab-line); border-radius: 0.65rem; padding: 0.75rem;
  box-shadow: 0 8px 24px rgba(30,58,138,0.06);
}
.lab-side-h { font-size: 0.82rem; font-weight: 700; color: #1e3a8a; margin-bottom: 0.55rem; }
.lab-sum { margin: 0; }
.lab-sum > div {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  padding: 0.28rem 0; border-bottom: 1px dashed #e4ebf2; font-size: 0.82rem;
}
.lab-sum dt { margin: 0; color: #5a6f86; font-weight: 500; }
.lab-sum dd { margin: 0; font-weight: 700; }
.lab-net {
  margin-top: 0.55rem; border-radius: 0.5rem; padding: 0.55rem 0.7rem;
  display: flex; justify-content: space-between; align-items: center;
  background: #dbeafe; color: #1e3a8a;
}
.lab-net-val { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.lab-side-btns { display: flex; gap: 0.4rem; margin-top: 0.75rem; }
.lab-entry-banner {
  background: linear-gradient(135deg, #006652, #008168 55%, #00a07f);
  color: #fff; border-radius: 0.85rem; padding: 0.95rem 1.1rem; margin-bottom: 0.85rem;
}
.lab-entry-banner .badge { font-size: 0.75rem; }
.lab-result-grid .lab-result-row {
  border: 1px solid #d0dde8; border-radius: 0.5rem; padding: 0.75rem; margin-bottom: 0.65rem; background: #fff;
}
.lab-result-grid .lab-result-row.is-abn { border-color: #f59e0b; background: #fffbeb; }
.lab-result-grid .lab-result-row.is-crit { border-color: #dc2626; background: #fef2f2; }
.lab-entry-table { font-size: 0.92rem; }
.lab-entry-table .lab-result-input { min-width: 4.5rem; }
@media (max-width: 767.98px) {
  .lab-entry-banner .fs-3 { font-size: 1.35rem !important; }
  .lab-subnav .btn { font-size: 0.78rem; padding: 0.35rem 0.55rem; }
}

@media (max-width: 575.98px) {
  .bill-list-card .fs-4 { font-size: 1.35rem !important; }
  .clinical-list-row { flex-direction: column; align-items: stretch; }
  .clinical-list-row > div:last-child { display: flex; gap: 0.35rem; }
  .clinical-list-row .btn { flex: 1; }
}

@media (max-width: 991.98px) {
  .doctor-workflow .doctor-row-actions { width: 100%; }
  .doctor-workflow .doctor-row-actions .btn { flex: 1 1 auto; }
  .doc-patient-card { flex-direction: column; }
  .doc-patient-cta { width: 100%; }
  .doc-patient-cta .btn { flex: 1 1 auto; }
  .doctor-hero-actions { width: 100%; }
  .consult-step-strip { border-radius: 0.85rem; }
  .consult-tabs { margin-left: -0.25rem; margin-right: -0.25rem; }
  .opms-bottom-nav a span { font-size: 0.65rem; }
  .opms-bottom-nav a { padding: 0.35rem 0.15rem; min-width: 0; flex: 1; }
}
@media (max-width: 767.98px) {
  .auth-steps { justify-content: center; }
  .auth-role-row { max-height: none; }
  .doctor-desk-hero .display-5 { font-size: 2.2rem; }
  .consult-shell { padding-bottom: 5.5rem; }
  .sticky-actions {
    position: sticky; bottom: 4.25rem; z-index: 20;
    background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
    border: 1px solid #c7d7fb; border-radius: 0.85rem; padding: 0.55rem;
    box-shadow: 0 -6px 20px rgba(92,61,26,.12);
  }
}

/* Doctor full-screen module mode */
body.is-module-fs .opms-sidebar,
body.is-module-fs .opms-sidebar-backdrop { display: none !important; }
body.is-module-fs .opms-main {
  margin-left: 0 !important;
  max-width: 100%;
  padding: 0.75rem 0.85rem 5.25rem;
}
body.is-module-fs .opms-topbar--module {
  background: linear-gradient(135deg, #1d5fd1, #0f2f6b);
  color: #fff;
  border: 0;
}
body.is-module-fs .opms-topbar--module .opms-module-title {
  font-weight: 800; letter-spacing: 0.02em;
}
body.is-module-fs .opms-topbar--module .btn-outline-secondary {
  border-color: rgba(255,255,255,.45); color: #fff;
}
body.is-module-fs .opms-topbar--module .opms-user-chip {
  color: #1a1a1a !important;
  background: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
body.is-module-fs .opms-topbar--module .opms-user-chip i {
  color: #0f2f6b;
}
body.is-module-fs.module-fs--lab .opms-topbar--module .opms-user-chip i {
  color: #1e40af;
}
body.is-module-fs .opms-bottom-nav { display: flex; }
body.is-module-fs .opms-bottom-nav--module a.active {
  color: #1d5fd1;
}
body.is-module-fs.module-fs--doctor .opms-bottom-nav--module {
  border-top-color: #c7d7fb;
}
body.is-module-fs.module-fs--doctor .opms-bottom-nav a.active { color: #1d5fd1 !important; }
body.is-module-fs.module-fs--lab .opms-topbar--module {
  background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
}
body.is-module-fs.module-fs--lab .opms-bottom-nav--lab a.active { color: #1d4ed8; }

.lab-desk-hero {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 45%, #1e3a8a 100%);
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
  color: #fff;
  box-shadow: 0 12px 28px rgba(29, 78, 216, 0.22);
}
.lab-desk-kicker {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; opacity: 0.85; margin-bottom: 0.2rem;
}
.lab-desk-sub { font-size: 0.9rem; opacity: 0.88; }
.lab-order-card {
  display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between;
  padding: 0.9rem 1rem; border-bottom: 1px solid #dbe3f0; background: #fff;
}
.lab-order-card.is-critical { background: #fef2f2; box-shadow: inset 3px 0 0 #dc2626; }
.lab-order-card--compact { padding: 0.65rem 0.9rem; }
.lab-order-card--compact .lab-order-main { font-size: 0.92rem; }
.lab-order-main { min-width: 0; flex: 1 1 12rem; }
.lab-order-cta { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.lab-status {
  display: inline-block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; border-radius: 999px; padding: 0.2rem 0.55rem;
}
.lab-status--collect { background: #dbeafe; color: #1e40af; }
.lab-status--sample { background: #e0e7ff; color: #3730a3; }
.lab-status--result { background: #fef3c7; color: #92400e; }
.lab-status--verify { background: #ffedd5; color: #9a3412; }
.lab-status--report { background: #d1fae5; color: #065f46; }
.opd-stage--lab .opd-stage-item.current {
  background: #1d4ed8; border-color: #1d4ed8;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.28);
}
.opd-stage--lab .opd-stage-item.done {
  background: #eff6ff; color: #1d4ed8 !important; border-color: #bfdbfe;
}
.opd-stage--lab .opd-stage-sep.done,
.opd-stage--lab .opd-stage-sep.current { background: #1d4ed8; }
@media (max-width: 991.98px) {
  .lab-hero-actions { width: 100%; }
  .lab-order-card { flex-direction: column; }
  .lab-order-cta { width: 100%; }
  .lab-order-cta .btn { flex: 1; }
}
/* Doctor module — blue theme (matches the consultation workspace) */
body.module-fs--doctor {
  --opms-brand: #1d5fd1; --opms-brand-dark: #0f2f6b; --opms-brand-light: #eef4ff;
  --opms-green: #1d5fd1; --opms-green-dark: #0f2f6b; --opms-mint: #eef4ff;
  --opms-line: #d6e0f0; --opms-ink: #14233d; --opms-muted: #5a6b85;
  background: #f3f6fb;
}
body.module-fs--doctor .opms-topbar--module { background: linear-gradient(135deg, #1d5fd1, #0f2f6b); }
body.module-fs--doctor .btn-success {
  --bs-btn-bg: #1d5fd1; --bs-btn-border-color: #1d5fd1; --bs-btn-hover-bg: #1747a6; --bs-btn-hover-border-color: #1747a6;
  --bs-btn-active-bg: #0f2f6b; --bs-btn-active-border-color: #0f2f6b; --bs-btn-disabled-bg: #1d5fd1; --bs-btn-disabled-border-color: #1d5fd1;
  --bs-btn-focus-shadow-rgb: 29, 95, 209;
}
body.module-fs--doctor .btn-outline-success {
  --bs-btn-color: #1d5fd1; --bs-btn-border-color: #9db8ee; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #1d5fd1; --bs-btn-hover-border-color: #1d5fd1;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #1747a6; --bs-btn-active-border-color: #1747a6; --bs-btn-disabled-color: #1d5fd1;
  --bs-btn-focus-shadow-rgb: 29, 95, 209;
}
body.module-fs--doctor .text-success { color: #1d5fd1 !important; }
body.module-fs--doctor .nav-pills { --bs-nav-pills-link-active-bg: #1d5fd1; }
body.module-fs--doctor .form-check-input:checked { background-color: #1d5fd1; border-color: #1d5fd1; }
body.module-fs--doctor .opms-card { border-color: #d6e0f0; box-shadow: 0 1px 2px rgba(15, 47, 107, .05); }
body.module-fs--doctor .btn-success,
body.module-fs--doctor .btn-success:focus,
body.module-fs--doctor .btn-outline-success:hover,
body.module-fs--doctor .btn-outline-success:focus,
body.module-fs--doctor .btn-outline-success.active,
body.module-fs--doctor .btn-outline-success:active,
body.module-fs--doctor .pharmacy-subnav a.btn.active { background-color: #1d5fd1 !important; border-color: #1d5fd1 !important; color: #fff !important; }
body.module-fs--doctor .btn-success:hover { background-color: #1747a6 !important; border-color: #1747a6 !important; }
body.module-fs--doctor .btn-outline-success { color: #1d5fd1 !important; border-color: #9db8ee !important; }
body.module-fs--doctor .btn-outline-success:hover i,
body.module-fs--doctor .btn-outline-success.active i { color: #fff !important; }
body.module-fs--doctor .bg-success { background-color: #1d5fd1 !important; }
body.module-fs--doctor .opms-flow-step { color: #2c4a7a !important; }
body.module-fs--doctor .opms-flow-step.active { background: #1d5fd1; border-color: #1d5fd1; color: #fff !important; }

/* Doctor profile — shared by Doctor master and the doctor's own profile */
.dp-hero { position: relative; border-radius: 1.1rem; overflow: hidden; background: #fff; border: 1px solid #d6e0f0; box-shadow: 0 6px 20px rgba(15, 47, 107, .08); }
.dp-cover { height: 7.5rem; background: linear-gradient(120deg, #0f2f6b 0%, #1d5fd1 60%, #4f8cf0 100%); }
.dp-hero-body { display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: flex-end; padding: 0 1.4rem 1.2rem; margin-top: -3.4rem; }
.dp-photo { width: 7.5rem; height: 7.5rem; border-radius: 50%; border: 4px solid #fff; background: #eef4ff; color: #1d5fd1; display: grid; place-items: center;
  font-size: 2.4rem; font-weight: 800; overflow: hidden; box-shadow: 0 6px 16px rgba(15, 47, 107, .18); flex: 0 0 auto; }
.dp-photo img { width: 100%; height: 100%; object-fit: cover; }
.dp-photo-sm { width: 3.6rem; height: 3.6rem; font-size: 1.2rem; border-width: 2px; margin: 0; }
.dp-id { flex: 1 1 16rem; min-width: 0; padding-bottom: .2rem; padding-top: 3.6rem; }
.dp-name { font-size: 1.55rem; font-weight: 800; color: #0f2f6b; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.dp-spec { color: #1d5fd1; font-weight: 700; }
.dp-qual { color: #5a6b85; font-size: .92rem; }
.dp-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.dp-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 700; padding: .22rem .6rem; border-radius: 999px; background: #eef4ff; color: #1d4ed8; border: 1px solid #c7d7fb; }
.dp-badge--exp { background: #fff7e6; color: #9a5b00; border-color: #fde2a7; }
.dp-badge--ok { background: #e7f8ee; color: #166534; border-color: #bbe7cb; }
.dp-badge--off { background: #fdecec; color: #991b1b; border-color: #f7c6c6; }
.dp-actions { display: flex; flex-wrap: wrap; gap: .4rem; padding-bottom: .2rem; }
.dp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: .9rem; margin-top: .9rem; }
.dp-section { background: #fff; border: 1px solid #d6e0f0; border-radius: .9rem; padding: .9rem 1rem; }
.dp-section h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #5a6b85; font-weight: 800; margin: 0 0 .6rem; display: flex; align-items: center; gap: .4rem; }
.dp-section h3 i { color: #1d5fd1; font-size: 1rem; }
.dp-row { display: flex; gap: .6rem; padding: .38rem 0; border-bottom: 1px dashed #e3e9f4; font-size: .92rem; }
.dp-row:last-child { border-bottom: 0; }
.dp-row > span:first-child { color: #5a6b85; min-width: 8.5rem; flex: 0 0 auto; }
.dp-row > b, .dp-row > a, .dp-row > div { font-weight: 600; color: #14233d; word-break: break-word; }
.dp-links { display: flex; flex-wrap: wrap; gap: .45rem; }
.dp-link { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: .6rem; border: 1px solid #d6e0f0; text-decoration: none; font-weight: 600; font-size: .88rem; color: #14233d; background: #f8fafd; }
.dp-link:hover { border-color: #1d5fd1; color: #1d5fd1; }
.dp-link .bi-linkedin { color: #0a66c2; } .dp-link .bi-youtube { color: #ff0000; } .dp-link .bi-whatsapp { color: #25d366; } .dp-link .bi-globe2 { color: #1d5fd1; }
.dp-bio { font-size: .93rem; color: #33415c; white-space: pre-line; }
.dp-empty { color: #9aa7bb; font-style: italic; font-weight: 400 !important; }

.dm-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.dm-toolbar .form-control, .dm-toolbar .form-select { max-width: 22rem; }
.dm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: .9rem; }
.dm-card { background: #fff; border: 1px solid #d6e0f0; border-radius: 1rem; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 2px 8px rgba(15, 47, 107, .05); transition: transform .15s, box-shadow .15s; }
.dm-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 47, 107, .12); }
.dm-card-top { display: flex; gap: .8rem; align-items: center; padding: .9rem 1rem .6rem; background: linear-gradient(180deg, #eef4ff, #fff); }
.dm-card-name { font-weight: 800; color: #0f2f6b; font-size: 1.05rem; line-height: 1.2; }
.dm-card-body { padding: .2rem 1rem .8rem; font-size: .86rem; flex: 1; }
.dm-card-body .dp-row { padding: .25rem 0; font-size: .85rem; }
.dm-card-body .dp-row > span:first-child { min-width: 6.2rem; }
.dm-card-foot { display: flex; gap: .4rem; align-items: center; padding: .6rem 1rem; border-top: 1px solid #eef2f8; background: #fbfcfe; }
.dm-card-foot .dm-social { margin-left: auto; display: flex; gap: .5rem; font-size: 1.1rem; }
.dm-card-foot .dm-social a { text-decoration: none; }
.dp-form .dp-section { margin-bottom: .9rem; }
.dp-form .form-label { font-weight: 600; font-size: .86rem; color: #33415c; margin-bottom: .25rem; }
.dp-photo-edit { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
@media (max-width: 575.98px) {
  .dp-hero-body { justify-content: center; text-align: center; }
  .dp-name, .dp-badges, .dp-actions { justify-content: center; }
  .dp-row { flex-direction: column; gap: .1rem; }
}

/* Pharmacy billing polish (market-standard POS) */
.pharm-hbtn {
  display: inline-flex; align-items: center; gap: .35rem; padding: .32rem .7rem; border-radius: .5rem;
  border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.1); color: #fff !important;
  font-size: .8rem; font-weight: 700; text-decoration: none !important; cursor: pointer; white-space: nowrap;
}
.pharm-hbtn:hover { background: rgba(255,255,255,.22); }
.pharm-hbtn--warn { background: #fbbf24; border-color: #fbbf24; color: #422006 !important; }
.pharm-hbtn--warn:hover { background: #f59e0b; }
.pharm-hbtn--new { background: #fff; border-color: #fff; color: #0b5f52 !important; }
.pharm-hbtn--new:hover { background: #e8f6f2; }
.pharm-hbtn-count { background: rgba(0,0,0,.18); border-radius: 999px; padding: 0 .45rem; font-size: .72rem; }
.pharm-bill-meta i { opacity: .8; margin-right: .15rem; }
.pharm-seg { display: inline-flex; border: 1px solid #b8d4cb; border-radius: .45rem; overflow: hidden; }
.pharm-seg button { border: 0; background: #fff; color: #0b5f52; font-size: .72rem; font-weight: 700; padding: .18rem .6rem; }
.pharm-seg button.active { background: var(--ph-teal, #0b7a68); color: #fff; }
.sched-badge { display: inline-block; font-size: .62rem; font-weight: 800; letter-spacing: .03em; padding: .05rem .35rem; border-radius: .3rem; vertical-align: middle; }
.sched-h { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.sched-h1 { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.sched-x { background: #7f1d1d; color: #fff; border: 1px solid #7f1d1d; }
.sched-otc { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.pharm-sched-alert { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; border-radius: .45rem; padding: .45rem .6rem; font-size: .78rem; }
.pharm-quick-cash { display: flex; flex-wrap: wrap; gap: .3rem; }
.pharm-quick-cash button { flex: 1 1 auto; border: 1px solid #c5ddd5; background: #fff; border-radius: .4rem; font-size: .78rem; font-weight: 700; color: #0b5f52; padding: .25rem .3rem; }
.pharm-quick-cash button:hover { background: #e8f6f2; }
.pharm-pay-tabs button i { margin-right: .15rem; }
.pharm-pay-tabs button { font-size: .72rem; }
.pharm-held-card { border: 1px solid #e3ece9; border-radius: .6rem; padding: .6rem .7rem; margin-bottom: .5rem; background: #fff; }
.pharm-held-card:hover { border-color: #9fd3c5; box-shadow: 0 4px 14px rgba(11,95,82,.08); }
.pharm-keys .pharm-legend { margin-right: auto; }
.pharm-final { margin-top: .65rem; }
.pharm-final-val { font-size: 1.7rem; }

/* Pharmacy report pages */
.ph-page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .75rem; margin-bottom: .9rem; }
.ph-page-head h1 { font-size: 1.35rem; font-weight: 800; color: #0b5f52; margin: 0; }
.ph-page-head .ph-sub { color: #5a7a72; font-size: .82rem; }
.ph-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; background: #fff; border: 1px solid #d5e4df; border-radius: .65rem; padding: .6rem .75rem; margin-bottom: .9rem; }
.ph-filter .form-label { font-size: .72rem; font-weight: 700; color: #5a7a72; margin-bottom: .1rem; }
.ph-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .6rem; margin-bottom: .9rem; }
.ph-kpi { background: #fff; border: 1px solid #d5e4df; border-radius: .65rem; padding: .6rem .8rem; text-decoration: none !important; color: inherit; display: block; }
.ph-kpi .l { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #5a7a72; }
.ph-kpi .v { font-size: 1.35rem; font-weight: 800; color: #0b5f52; line-height: 1.2; }
.ph-kpi .s { font-size: .75rem; color: #6b7c76; }
.ph-kpi--danger .v { color: #b91c1c; } .ph-kpi--warn .v { color: #b45309; } .ph-kpi--info .v { color: #1d4ed8; }
.ph-kpi.active { border-color: #0b7a68; box-shadow: 0 0 0 2px rgba(11,122,104,.15); }
.ph-table { background: #fff; border: 1px solid #d5e4df; border-radius: .65rem; overflow: hidden; }
.ph-table table { margin: 0; }
.ph-table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; color: #5a7a72; background: #f3faf7; white-space: nowrap; }
.ph-table tfoot td { font-weight: 800; background: #f7fbfa; }
.ph-exp-EXPIRED { background: #fef2f2; } .ph-exp-30 { background: #fff7ed; }
.ph-empty { text-align: center; color: #6b7c76; padding: 2.5rem 1rem; }
@media print {
  .ph-filter, .pharmacy-subnav, .d-print-none { display: none !important; }
  .ph-table { border: 0; }
}
/* Pharmacy counter: final discount + keyboard flow */
.pharm-disc { border: 1px dashed #b8d4cb; border-radius: .55rem; padding: .5rem .6rem; margin-top: .55rem; background: #f7fbfa; }
.pharm-disc-h { font-size: .78rem; font-weight: 700; color: #0b5f52; }
.pharm-disc .pharm-seg button { padding: .08rem .55rem; }
.pharm-disc-chips { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .4rem; }
.pharm-disc-chips button { border: 1px solid #c5ddd5; background: #fff; border-radius: 999px; font-size: .7rem; font-weight: 700; color: #0b5f52; padding: .08rem .5rem; }
.pharm-disc-chips button:hover { background: #e8f6f2; }
.pharm-disc-policy { font-size: .7rem; color: #5a7a72; margin-top: .35rem; }
.pharm-disc-policy.is-over { color: #b91c1c; font-weight: 600; }
.pharm-disc-policy.is-warn { color: #b45309; }
.pharm-askqty { margin-left: .6rem; font-size: .68rem; font-weight: 600; color: #5a7a72; cursor: pointer; white-space: nowrap; }
.pharm-askqty input { vertical-align: -2px; }
.pharm-stock-row.kb-active > td { background: #d9f2ea !important; }
.pharm-stock-row.kb-active > td:first-child { box-shadow: inset 3px 0 0 #0b7a68; }
.pharm-cart-table input:focus { border-color: #0b7a68; box-shadow: 0 0 0 .18rem rgba(11,122,104,.25); background: #fffbea; }
.pharm-keys kbd { margin: 0 .05rem; }

/* Stock view */
.sv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: .75rem; align-items: start; }
@media (max-width: 1199.98px) { .sv-layout { grid-template-columns: 1fr; } }
.sv-list .table-responsive { max-height: calc(100vh - 20rem); min-height: 18rem; overflow: auto; }
.sv-list thead th { position: sticky; top: 0; z-index: 1; }
.sv-row { cursor: pointer; }
.sv-row:focus { outline: none; }
.sv-row.sv-active > td { background: #d9f2ea !important; }
.sv-row.sv-active > td:first-child { box-shadow: inset 3px 0 0 #0b7a68; }
.sv-sort { cursor: pointer; user-select: none; }
.sv-sort.asc::after { content: " \25B2"; font-size: .6rem; }
.sv-sort.desc::after { content: " \25BC"; font-size: .6rem; }
.sv-badge-low { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.sv-foot { border-top: 1px solid #e3ece9; background: #f7fbfa; }
.sv-detail { position: sticky; top: 4.5rem; background: #fff; border: 1px solid #d5e4df; border-radius: .65rem; overflow: hidden; }
.sv-detail-h { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; padding: .65rem .8rem; background: #f3faf7; border-bottom: 1px solid #e3ece9; }
.sv-detail table thead th { font-size: .66rem; text-transform: uppercase; color: #5a7a72; }
.sv-b-exp > td { background: #fef2f2; }
.sv-b-near > td { background: #fff7ed; }
.sv-actions { display: flex; flex-wrap: wrap; gap: .35rem; padding: .65rem .8rem; border-top: 1px solid #e3ece9; }