/* ADT Enterprise Command Center — discharge workbench + shared patient header */

.adt-cc {
  padding-bottom: 5rem;
}

.adt-cc__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1rem;
  align-items: start;
}

.adt-cc__main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.adt-cc__sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: sticky;
  top: 0.75rem;
}

.adt-cc__section-head h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Patient header dashboard */
.adt-patient-header {
  background: var(--eu-surface, #fff);
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.adt-patient-header__top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.adt-patient-header__name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.adt-patient-header__meta {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--eu-text-muted, #64748b);
}

.adt-patient-header__alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.adt-patient-header__badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.adt-patient-header__badge--danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.adt-patient-header__badge--warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.adt-patient-header__badge--info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.adt-patient-header__badge--success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }

.adt-patient-header__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
  margin: 0;
}

.adt-patient-header__cell dt {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--eu-text-muted, #64748b);
}

.adt-patient-header__cell dd {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}

/* Workflow progress */
.adt-cc-workflow {
  background: var(--eu-surface, #fff);
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.adt-cc-workflow__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.adt-cc-workflow__head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.adt-cc-workflow__pct {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--eu-accent, #2563eb);
}

.adt-cc-workflow__bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.adt-cc-workflow__bar-fill {
  display: block;
  height: 100%;
  width: var(--adt-progress, 0%);
  background: linear-gradient(90deg, #2563eb, #16a34a);
  border-radius: 999px;
}

.adt-cc-workflow__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.adt-cc-workflow__step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #64748b;
}

.adt-cc-workflow__step.is-complete { color: #166534; font-weight: 600; }
.adt-cc-workflow__step.is-current { color: #1d4ed8; font-weight: 700; }

.adt-cc-workflow__arrow { display: none; }

/* Stage cards */
.adt-cc__stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
}

.adt-cc-stage {
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  background: #fff;
}

.adt-cc-stage--success { border-left: 3px solid #16a34a; background: #f8fff9; }
.adt-cc-stage--warning { border-left: 3px solid #f59e0b; background: #fffbeb; }
.adt-cc-stage--neutral { border-left: 3px solid #94a3b8; }

.adt-cc-stage__head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.adt-cc-stage__title {
  margin: 0;
  font-size: 0.88rem;
}

.adt-cc-stage__status {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.adt-cc-stage__status--success { background: #dcfce7; color: #166534; }
.adt-cc-stage__status--warning { background: #fef3c7; color: #92400e; }
.adt-cc-stage__status--neutral { background: #f1f5f9; color: #475569; }

.adt-cc-stage__meta {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.75rem;
}

.adt-cc-stage__meta dt {
  font-size: 0.62rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}

.adt-cc-stage__meta dd { margin: 0; font-weight: 600; }

.adt-cc-stage__notes {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: #475569;
}

.adt-cc-stage__form {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

/* Checklist */
.adt-cc-checklist {
  background: #fff;
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.adt-cc-checklist__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.adt-cc-checklist__head h3 { margin: 0; font-size: 0.95rem; }
.adt-cc-checklist__stats { font-size: 0.75rem; color: #64748b; font-weight: 600; }

.adt-cc-checklist__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.adt-cc-checklist__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: #f8fafc;
}

.adt-cc-checklist__item.is-done {
  background: #f0fdf4;
  color: #166534;
}

.adt-cc-checklist__icon {
  font-size: 1rem;
  line-height: 1;
  width: 1.1rem;
  text-align: center;
}

.adt-cc-checklist__label { flex: 1; }
.adt-cc-checklist__time { font-size: 0.7rem; color: #64748b; }
.adt-cc-checklist__form { margin: 0; }

/* Sidebar */
.adt-cc-sidebar__panel {
  background: #fff;
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.adt-cc-sidebar__title {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
}

.adt-cc-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.adt-cc-timeline__when {
  font-size: 0.68rem;
  color: #64748b;
}

.adt-cc-timeline__label {
  font-size: 0.78rem;
  font-weight: 600;
}

.adt-cc-quicklinks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.adt-cc-quicklinks__link {
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: #f1f5f9;
  text-decoration: none;
  color: #1e293b;
  font-weight: 600;
}

.adt-cc-quicklinks__link:hover {
  background: #e2e8f0;
}

.adt-cc-dept-grid {
  display: grid;
  gap: 0.35rem;
}

.adt-cc-dept {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.adt-cc-dept--success { background: #dcfce7; color: #166534; }
.adt-cc-dept--warning { background: #fef3c7; color: #92400e; }
.adt-cc-dept--neutral { background: #f1f5f9; color: #475569; }

/* Danger zone */
.adt-cc-danger {
  border: 1px dashed #fecaca;
  border-radius: 8px;
  background: #fffafa;
}

.adt-cc-danger__summary {
  cursor: pointer;
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #991b1b;
}

.adt-cc-danger__body {
  padding: 0 0.75rem 0.75rem;
}

.adt-cc-danger__form { margin-top: 0.5rem; }
.adt-cc-danger__unlock { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid #fecaca; }

/* Sticky action bar */
.adt-cc-actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--eu-border, #e2e8f0);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(6px);
}

.adt-cc-actionbar__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.adt-cc-actionbar__hint {
  flex: 1;
  font-size: 0.8rem;
  color: #475569;
}

.adt-cc-actionbar__primary {
  margin-left: auto;
}

.adt-cc-actionbar__form { margin: 0; display: inline; }

.adt-dc-finance {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--eu-border, #e2e8f0);
  background: var(--eu-surface, #fff);
}

.adt-dc-finance--blocked {
  border-color: var(--chk-warning, #f59e0b);
  background: color-mix(in srgb, var(--chk-warning, #f59e0b) 8%, white);
}

.adt-dc-finance--clear {
  border-color: var(--chk-success, #16a34a);
  background: color-mix(in srgb, var(--chk-success, #16a34a) 6%, white);
}

.adt-dc-finance__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.adt-dc-finance__title {
  margin: 0;
  font-size: 0.95rem;
}

.adt-dc-finance__status {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  background: var(--eu-surface-2, #f1f5f9);
}

.adt-dc-finance--blocked .adt-dc-finance__status {
  background: #fef3c7;
  color: #92400e;
}

.adt-dc-finance--clear .adt-dc-finance__status {
  background: #dcfce7;
  color: #166534;
}

.adt-dc-finance__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.adt-dc-finance__label {
  display: block;
  font-size: 0.7rem;
  color: var(--eu-text-muted, #64748b);
}

.adt-dc-finance__warn {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: #92400e;
}

.adt-dc-finance__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.adt-dc-finance-override {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

.adt-dc-finance-override .eu-input {
  min-width: 14rem;
}

@media (max-width: 900px) {
  .adt-dc-finance__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Clinical summary */
.adt-cc-clinical {
  background: #fff;
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.adt-cc-clinical__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1rem;
  margin: 0;
}

.adt-cc-clinical__row dt {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--eu-text-muted, #64748b);
}

.adt-cc-clinical__row dd {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

@media (max-width: 1100px) {
  .adt-cc__layout {
    grid-template-columns: 1fr;
  }

  .adt-cc__sidebar {
    position: static;
  }

  .adt-patient-header__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .adt-patient-header__grid {
    grid-template-columns: 1fr;
  }

  .adt-cc-actionbar__inner {
    flex-wrap: wrap;
  }
}
