/* ======================================================================
   V68.UI.1C — Patient profile approved visual system
   Scoped to the Patient 360 page so the rest of the staff shell stays
   untouched. Inspired by the approved soft-clinical dashboard direction.
====================================================================== */

.drt-patient-profile-v68c {
  width: min(100%, 1180px);
  margin-inline: auto;
}

.drt-patient-profile-loading {
  display: flex;
  min-height: 22rem;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  color: #6b7f96;
  font-size: .84rem;
  font-weight: 750;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  border: 1px solid #dfe9f4;
  border-radius: 22px;
}

.drt-patient-profile-loading__pulse {
  width: .65rem;
  height: .65rem;
  border-radius: 999px;
  background: #1b75eb;
  box-shadow: 0 0 0 7px rgba(27, 117, 235, .11);
  animation: drt-patient-pulse 1.2s ease-in-out infinite alternate;
}

@keyframes drt-patient-pulse {
  to { opacity: .38; transform: scale(.82); }
}

.drt-patient-profile-shell {
  color: #14294a;
}

.drt-patient-profile-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 10.8rem;
  padding: 1.45rem 1.55rem;
  overflow: visible;
  background: #fff;
  border: 1px solid #dce8f5;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(30, 74, 122, .055);
}

.drt-patient-profile-hero::after {
  content: "";
  position: absolute;
  inset-inline-start: 1.55rem;
  inset-inline-end: 1.55rem;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #dfe9f5 15%, #dfe9f5 85%, transparent);
}

.drt-patient-profile-hero__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 1rem;
}

.drt-patient-profile-avatar {
  width: 5.1rem !important;
  height: 5.1rem !important;
  flex: 0 0 5.1rem;
  border-radius: 50% !important;
  border: 4px solid #f3f8fd !important;
  box-shadow: 0 0 0 1px #d5e3f2, 0 9px 22px rgba(31, 82, 134, .09);
}

.drt-patient-profile-hero__copy {
  min-width: 0;
}

.drt-patient-profile-hero__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
}

.drt-patient-profile-hero__title-row h1 {
  margin: 0;
  color: #10264a;
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  line-height: 1.25;
  font-weight: 950;
  letter-spacing: -.02em;
}

.drt-patient-profile-status,
.drt-patient-profile-type {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  white-space: nowrap;
  border-radius: 999px;
  font-size: .69rem;
  font-weight: 850;
}

.drt-patient-profile-status {
  padding: .3rem .58rem;
}

.drt-patient-profile-status.is-complete {
  color: #137a4d;
  background: #e6f8ef;
  border: 1px solid #c4edd8;
}

.drt-patient-profile-type {
  padding: .2rem .48rem;
  color: #24649b;
  background: #eef6ff;
  border: 1px solid #d7e9fb;
}

.drt-patient-profile-hero__meta,
.drt-patient-profile-hero__demographics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .85rem;
}

.drt-patient-profile-hero__meta {
  margin-top: .6rem;
  color: #5f7693;
  font-size: .78rem;
}

.drt-patient-profile-hero__meta strong {
  color: #294f79;
  font-weight: 900;
}

.drt-patient-profile-hero__demographics {
  margin-top: .5rem;
  color: #667b94;
  font-size: .76rem;
}

.drt-patient-profile-hero__demographics span + span::before {
  content: "·";
  margin-inline-end: .8rem;
  color: #a9b8c8;
}

.drt-patient-profile-hero__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
}

.drt-patient-profile-action {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  gap: .48rem;
  padding: .64rem .9rem;
  border-radius: 11px;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 850;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.drt-patient-profile-action:hover {
  transform: translateY(-1px);
}

.drt-patient-profile-action.is-primary {
  color: #fff;
  background: #1477ee;
  border: 1px solid #1477ee;
  box-shadow: 0 7px 16px rgba(20, 119, 238, .17);
}

.drt-patient-profile-action.is-primary:hover {
  color: #fff;
  background: #0d68d6;
  border-color: #0d68d6;
}

.drt-patient-profile-action.is-secondary {
  color: #244e78;
  background: #fff;
  border: 1px solid #cfe0f1;
}

.drt-patient-profile-action.is-secondary:hover {
  background: #f7fbff;
  border-color: #a9c7e6;
}

.drt-patient-profile-more {
  position: relative;
}

.drt-patient-profile-more > summary {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  color: #56728e;
  background: #fff;
  border: 1px solid #d4e2f0;
  border-radius: 11px;
  cursor: pointer;
  list-style: none;
  font-weight: 900;
  letter-spacing: .12em;
}

.drt-patient-profile-more > summary::-webkit-details-marker { display: none; }

.drt-patient-profile-more__menu {
  position: absolute;
  z-index: 35;
  inset-inline-end: 0;
  top: calc(100% + .45rem);
  min-width: 13rem;
  padding: .38rem;
  background: #fff;
  border: 1px solid #d9e5f1;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(20, 56, 91, .14);
}

.drt-patient-profile-more__menu a {
  display: block;
  padding: .58rem .68rem;
  color: #2e5579;
  border-radius: 8px;
  font-size: .76rem;
  font-weight: 750;
  text-decoration: none;
}

.drt-patient-profile-more__menu a:hover { background: #f0f7ff; }

.drt-patient-biometric-notice {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  margin-top: -.45rem;
  padding: .58rem .85rem;
  color: #8a5a0a;
  background: #fff9ea;
  border: 1px solid #f3dda2;
  border-radius: 12px;
  font-size: .7rem;
  line-height: 1.65;
}

.drt-patient-biometric-notice strong { white-space: nowrap; }
.drt-patient-biometric-notice__copy { color: #9a6c20; }

.drt-patient-profile-tabs {
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.drt-patient-profile-tabs > .drt-patient-tablist {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-top: -.35rem;
  padding: .25rem .65rem 0;
  overflow-x: auto;
  background: #fff;
  border: 1px solid #dfe9f4;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(29, 71, 113, .035);
  scrollbar-width: none;
}

.drt-patient-profile-tabs > .drt-patient-tablist::-webkit-scrollbar { display: none; }

.drt-patient-profile-tabs > .drt-patient-tablist button {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  min-height: 3rem;
  padding: .55rem .82rem;
  color: #526d8c;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 10px 10px 0 0;
  font-size: .75rem;
  font-weight: 800;
  cursor: pointer;
}

.drt-patient-profile-tabs > .drt-patient-tablist button:hover {
  color: #146cc9;
  background: #f5faff;
}

.drt-patient-profile-tabs > .drt-patient-tablist button[aria-selected="true"],
.drt-patient-profile-tabs > .drt-patient-tablist button.is-active {
  color: #126bd1;
  background: #f0f7ff;
  border-bottom-color: #1477ee;
}

.drt-patient-tab-count {
  display: inline-grid;
  min-width: 1.18rem;
  height: 1.18rem;
  place-items: center;
  padding-inline: .28rem;
  color: #3a648d;
  background: #e4eef8;
  border-radius: 999px;
  font-size: .62rem;
}

.drt-patient-profile-tabs > .drt-patient-tabpanels {
  padding-top: 1rem;
}

.drt-patient-profile-tabs .drt-patient-tabpanel {
  padding: 0 !important;
  background: transparent !important;
}

.drt-patient-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.drt-patient-dashboard-card {
  min-width: 0;
  padding: 1rem 1.05rem;
  background: #fff;
  border: 1px solid #dfe9f4;
  border-radius: 18px;
  box-shadow: 0 7px 22px rgba(26, 67, 110, .045);
}

.drt-patient-dashboard-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: .78rem;
  border-bottom: 1px solid #e8eff6;
}

.drt-patient-dashboard-card__title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .62rem;
}

.drt-patient-dashboard-card__icon {
  display: inline-grid;
  width: 2.15rem;
  height: 2.15rem;
  flex: 0 0 2.15rem;
  place-items: center;
  border-radius: 10px;
}

.drt-patient-dashboard-card__icon.is-blue { color: #176fdb; background: #edf6ff; }
.drt-patient-dashboard-card__icon.is-rose { color: #e84b5a; background: #fff0f2; }
.drt-patient-dashboard-card__icon.is-indigo { color: #4969d8; background: #f0f3ff; }
.drt-patient-dashboard-card__icon.is-cyan { color: #0586bc; background: #ecfaff; }

.drt-patient-dashboard-card__title h2 {
  margin: 0;
  color: #173052;
  font-size: .96rem;
  font-weight: 900;
  line-height: 1.35;
}

.drt-patient-dashboard-card__title p {
  margin: .14rem 0 0;
  color: #8395aa;
  font-size: .65rem;
  font-weight: 650;
}

.drt-patient-card-edit {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  padding: .38rem .65rem;
  color: #176fcd;
  background: #fff;
  border: 1px solid #d0e0f0;
  border-radius: 9px;
  text-decoration: none;
  font-size: .68rem;
  font-weight: 820;
}

.drt-patient-card-edit:hover { background: #f2f8ff; border-color: #a7caec; }

.drt-patient-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .02rem 1.2rem;
  margin-top: .8rem;
}

.drt-patient-kv {
  display: grid;
  grid-template-columns: minmax(6.2rem, .78fr) minmax(0, 1.22fr);
  gap: .45rem;
  align-items: baseline;
  min-height: 2.12rem;
  padding: .4rem 0;
  border-bottom: 1px dashed #edf2f7;
}

.drt-patient-kv span {
  color: #73879f;
  font-size: .69rem;
  font-weight: 680;
}

.drt-patient-kv strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #183453;
  font-size: .76rem;
  font-weight: 850;
}

.drt-patient-card-note {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: .38rem;
  align-items: start;
  margin-top: .75rem;
  padding: .64rem .7rem;
  color: #56728d;
  background: #f7fbff;
  border: 1px solid #e1edf8;
  border-radius: 10px;
  font-size: .7rem;
}

.drt-patient-card-note strong { color: #365a7c; }
.drt-patient-card-note p { margin: 0; }

.drt-patient-identity-docs {
  margin-top: .75rem;
  padding-top: .72rem;
  border-top: 1px solid #e9f0f6;
}

.drt-patient-identity-docs__label {
  color: #6c8199;
  font-size: .66rem;
  font-weight: 800;
}

.drt-patient-identity-docs__items {
  display: flex;
  flex-wrap: wrap;
  gap: .38rem;
  margin-top: .4rem;
}

.drt-patient-identity-docs__items span {
  padding: .34rem .52rem;
  color: #4f6c88;
  background: #f5f9fd;
  border: 1px solid #e0eaf4;
  border-radius: 8px;
  font-size: .64rem;
}

.drt-patient-identity-docs__empty {
  margin-top: .34rem;
  color: #91a0af;
  font-size: .68rem;
}

.drt-patient-medical-alert {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-top: .8rem;
  padding: .72rem .78rem;
  color: #b42338;
  background: #fff1f3;
  border: 1px solid #ffcbd2;
  border-radius: 11px;
}

.drt-patient-medical-alert__icon {
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 1.7rem;
  place-items: center;
  color: #fff;
  background: #e5485b;
  border-radius: 999px;
  font-weight: 950;
}

.drt-patient-medical-alert strong { display: block; font-size: .78rem; font-weight: 900; }
.drt-patient-medical-alert p { margin: .12rem 0 0; color: #cc5968; font-size: .65rem; }

.drt-patient-medical-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .78rem;
}

.drt-patient-medical-chips span {
  display: inline-flex;
  align-items: center;
  padding: .34rem .58rem;
  color: #466781;
  background: #eff5fa;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 760;
}

.drt-patient-medical-chips span.is-danger { color: #c12f43; background: #ffecef; }
.drt-patient-medical-chips span.is-warning { color: #9a691a; background: #fff4d9; }
.drt-patient-medical-chips span.is-ok { color: #28785a; background: #eaf8f1; }

.drt-patient-medical-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
  margin-top: .8rem;
}

.drt-patient-medical-summary > div {
  padding: .62rem .68rem;
  background: #fafcff;
  border: 1px solid #e8eff6;
  border-radius: 10px;
}

.drt-patient-medical-summary span,
.drt-patient-insurance-summary span {
  display: block;
  color: #7e91a5;
  font-size: .63rem;
  font-weight: 700;
}

.drt-patient-medical-summary strong,
.drt-patient-insurance-summary strong {
  display: block;
  margin-top: .18rem;
  color: #203e5e;
  font-size: .74rem;
  font-weight: 850;
}

.drt-patient-medical-summary strong.is-danger { color: #bd3144; }
.drt-patient-medical-summary small { display: block; margin-top: .16rem; color: #7b8ea1; font-size: .62rem; }

.drt-patient-medical-note {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  margin-top: .72rem;
  padding: .62rem .7rem;
  color: #55728e;
  background: #f1f7fd;
  border: 1px solid #dce9f5;
  border-radius: 10px;
}

.drt-patient-medical-note strong { display: block; color: #3d5f7d; font-size: .65rem; }
.drt-patient-medical-note p { margin: .12rem 0 0; font-size: .67rem; line-height: 1.7; }

.drt-patient-insurance-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem 1rem;
  margin-top: .8rem;
  padding: .72rem;
  background: #f9fbfe;
  border: 1px solid #e4edf6;
  border-radius: 11px;
}

.drt-patient-doc-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-top: .85rem;
}

.drt-patient-doc-preview-head strong { color: #294867; font-size: .72rem; }
.drt-patient-doc-preview-head a { color: #1672d5; font-size: .65rem; font-weight: 800; text-decoration: none; }

.drt-patient-doc-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  margin-top: .5rem;
}

.drt-patient-doc-preview-item {
  min-width: 0;
  padding: .35rem;
  background: #fbfdff;
  border: 1px solid #e3ecf5;
  border-radius: 10px;
}

.drt-patient-doc-preview-item .drt-file-preview-tile {
  width: 100%;
  height: 5.2rem;
  border-radius: 7px;
}

.drt-patient-doc-preview-item strong {
  display: block;
  overflow: hidden;
  margin-top: .35rem;
  color: #315371;
  font-size: .62rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drt-patient-doc-preview-item small { color: #8999aa; font-size: .58rem; }

.drt-patient-doc-preview-empty {
  display: flex;
  min-height: 6.5rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  margin-top: .55rem;
  color: #8a9bae;
  background: #fafcff;
  border: 1px dashed #d7e4f0;
  border-radius: 11px;
  font-size: .68rem;
}

.drt-patient-imaging-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .3rem;
}

.drt-patient-imaging-pills span {
  padding: .2rem .4rem;
  color: #2f6f9e;
  background: #eaf5fd;
  border-radius: 999px;
  font-size: .6rem;
  font-weight: 850;
}

.drt-patient-recent-activity {
  position: relative;
  margin: .7rem 0 0;
  padding: 0;
  list-style: none;
}

.drt-patient-recent-activity::before {
  content: "";
  position: absolute;
  inset-inline-start: .78rem;
  top: .7rem;
  bottom: .7rem;
  width: 1px;
  background: #dfe9f4;
}

.drt-patient-recent-activity li {
  position: relative;
  display: grid;
  grid-template-columns: 1.65rem 2rem minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: center;
  min-height: 3.5rem;
  padding: .45rem 0;
  border-bottom: 1px solid #edf2f7;
}

.drt-patient-recent-activity li:last-child { border-bottom: 0; }

.drt-patient-recent-activity__dot {
  position: relative;
  z-index: 2;
  width: .48rem;
  height: .48rem;
  margin-inline: auto;
  background: #1b78e7;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 2px #dbeafd;
}

.drt-patient-recent-activity__icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: #176fd4;
  background: #edf6ff;
  border-radius: 999px;
}

.drt-patient-recent-activity li.is-lab .drt-patient-recent-activity__icon { color: #7c55c5; background: #f3efff; }
.drt-patient-recent-activity li.is-payment .drt-patient-recent-activity__icon,
.drt-patient-recent-activity li.is-invoice .drt-patient-recent-activity__icon { color: #b27612; background: #fff5dc; }
.drt-patient-recent-activity li.is-treatment .drt-patient-recent-activity__icon,
.drt-patient-recent-activity li.is-amendment .drt-patient-recent-activity__icon { color: #16825e; background: #e9f8f1; }

.drt-patient-recent-activity__body { min-width: 0; }
.drt-patient-recent-activity__title { color: #294967; font-size: .7rem; font-weight: 770; }
.drt-patient-recent-activity__title strong { margin-inline-start: .28rem; color: #153754; font-weight: 900; }
.drt-patient-recent-activity__body p { overflow: hidden; margin: .12rem 0 0; color: #8495a6; font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.drt-patient-recent-activity time { direction: ltr; color: #768ba1; font-size: .61rem; white-space: nowrap; }

@media (max-width: 1199px) {
  .drt-patient-profile-hero { align-items: flex-start; }
  .drt-patient-profile-hero__actions { max-width: 20rem; }
  .drt-patient-doc-preview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .drt-patient-overview-grid { grid-template-columns: 1fr; }
  .drt-patient-profile-hero { flex-direction: column; }
  .drt-patient-profile-hero__actions { width: 100%; max-width: none; justify-content: flex-start; }
}

@media (max-width: 639px) {
  .drt-patient-profile-v68c { width: 100%; }
  .drt-patient-profile-hero { padding: 1rem; border-radius: 16px; }
  .drt-patient-profile-hero__identity { align-items: flex-start; }
  .drt-patient-profile-avatar { width: 4rem !important; height: 4rem !important; flex-basis: 4rem; }
  .drt-patient-profile-action { flex: 1 1 auto; }
  .drt-patient-profile-tabs > .drt-patient-tablist { border-radius: 13px; }
  .drt-patient-profile-tabs > .drt-patient-tablist button { min-height: 2.7rem; padding-inline: .62rem; }
  .drt-patient-dashboard-card { padding: .85rem; border-radius: 15px; }
  .drt-patient-kv-grid,
  .drt-patient-medical-summary,
  .drt-patient-insurance-summary { grid-template-columns: 1fr; }
  .drt-patient-doc-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drt-patient-recent-activity li { grid-template-columns: 1.3rem 1.8rem minmax(0, 1fr); }
  .drt-patient-recent-activity time { grid-column: 3; }
  .drt-patient-biometric-notice { flex-direction: column; }
  .drt-patient-biometric-notice strong { white-space: normal; }
}

/* UI.1C.1 — full patient timeline alignment.
   The legacy V60 timeline used implicit RTL grid placement, which can make the
   date, title and detail columns collide inside the newer Patient Profile shell.
   Keep this override scoped to the approved profile UI. */
.drt-patient-profile-v68c .drt-p360-timeline-item {
  grid-template-columns: 8rem minmax(0, 1fr) 1.2rem;
  grid-template-areas: "time body dot";
  column-gap: 1rem;
  min-height: 0;
  padding: .85rem 0;
  direction: ltr;
  align-items: start;
}

.drt-patient-profile-v68c .drt-p360-timeline-item::after {
  inset-inline-start: auto;
  right: .49rem;
  top: 1.55rem;
  bottom: -.9rem;
}

.drt-patient-profile-v68c .drt-p360-timeline-dot {
  grid-area: dot;
  margin: .28rem auto 0;
}

.drt-patient-profile-v68c .drt-p360-timeline-time {
  grid-area: time;
  padding-top: .05rem;
  direction: ltr;
  text-align: left;
  line-height: 1.45;
}

.drt-patient-profile-v68c .drt-p360-timeline-body {
  grid-area: body;
  min-width: 0;
  margin: 0;
  padding: 0 0 .85rem;
  direction: rtl;
  text-align: right;
}

.drt-patient-profile-v68c .drt-p360-timeline-title {
  gap: .45rem;
  line-height: 1.55;
}

.drt-patient-profile-v68c .drt-p360-timeline-title strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.drt-patient-profile-v68c .drt-p360-timeline-detail {
  margin-top: .22rem;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .drt-patient-profile-v68c .drt-p360-timeline-item {
    grid-template-columns: minmax(0, 1fr) 1.1rem;
    grid-template-areas:
      "body dot"
      "time dot";
    column-gap: .7rem;
    row-gap: .22rem;
    padding: .75rem 0;
  }

  .drt-patient-profile-v68c .drt-p360-timeline-item::after {
    right: .43rem;
    top: 1.45rem;
  }

  .drt-patient-profile-v68c .drt-p360-timeline-time {
    text-align: right;
  }
}
