:root {
  --primary: #0b6b5f;
  --primary-dark: #075248;
  --primary-soft: #e8f5f2;
  --secondary: #1769aa;
  --secondary-soft: #eaf3fb;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --warning: #9a6700;
  --warning-soft: #fff8e1;
  --success: #176c3a;
  --success-soft: #eaf7ef;
  --ink: #1d2939;
  --muted: #667085;
  --line: #dbe3e8;
  --surface: #ffffff;
  --canvas: #f4f7f8;
  --sidebar: #0d3740;
  --sidebar-muted: #a7c4c7;
  --shadow: 0 8px 24px rgba(16, 49, 54, 0.07);
  --shadow-raised: 0 14px 34px rgba(16, 49, 54, 0.11);
  --brand-shadow: rgba(11, 107, 95, 0.25);
  --radius: 14px;
  --radius-sm: 9px;
  --transition: 160ms ease;
  --demo-banner-height: 34px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: var(--primary-dark);
  background: #ccebe5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(23, 105, 170, 0.28);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.mobile-only {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 22px var(--brand-shadow);
}

.brand-mark-img,
.brand-mark-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-mark-img {
  object-fit: cover;
}

.brand-mark-icon {
  display: block;
  width: 72%;
  height: 72%;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(23, 105, 170, 0.14), transparent 28%),
    radial-gradient(circle at 85% 75%, rgba(11, 107, 95, 0.16), transparent 32%),
    linear-gradient(145deg, #edf7f5 0%, #f8fbfc 42%, #eef4f9 100%);
}

.login-card {
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 70px rgba(11, 52, 62, 0.16);
}

.brand-login {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.login-copy {
  margin: 28px 0 22px;
}

.login-copy h1 {
  margin: 0 0 8px;
  font-size: 1.65rem;
  letter-spacing: -0.035em;
}

.login-copy p,
.section-heading p,
.panel-header p,
.topbar p {
  margin: 0;
  color: var(--muted);
}

.login-footnote {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.form-stack,
.form-grid {
  display: grid;
  gap: 16px;
}

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

.form-grid.compact {
  gap: 13px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

label,
.full-label {
  display: grid;
  gap: 7px;
}

label > span,
.full-label > span {
  color: #344054;
  font-size: 0.84rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfd8de;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input,
select {
  padding: 0 12px;
}

textarea {
  min-height: 78px;
  padding: 10px 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 107, 95, 0.12);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f2f4f7;
  color: #667085;
}

.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0 15px;
  font-weight: 750;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 6px 16px rgba(11, 107, 95, 0.18);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-secondary {
  color: var(--secondary);
  border-color: #b9d2e7;
  background: var(--secondary-soft);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--secondary);
  background: #dfedf8;
}

.btn-danger {
  color: var(--danger);
  border-color: #efb5ae;
  background: var(--danger-soft);
}

.btn-ghost {
  color: #475467;
  border-color: var(--line);
  background: #fff;
}

.btn-sm {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 0.78rem;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #344054;
  font-size: 1.25rem;
}

.icon-btn.mobile-only {
  display: none;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 22px 16px 18px;
  color: #fff;
  background: linear-gradient(180deg, #103f48 0%, #0b3038 100%);
  box-shadow: 7px 0 28px rgba(13, 55, 64, 0.1);
}

.sidebar-brand {
  padding: 2px 8px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.sidebar-brand strong {
  color: #fff;
  font-size: 1.05rem;
}

.sidebar-brand span {
  color: var(--sidebar-muted);
  font-size: 0.74rem;
}

.main-nav {
  display: block;
  margin-top: 22px;
  padding-right: 4px;
  overflow-y: auto;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group + .nav-group {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-group-label {
  padding: 0 12px 5px;
  color: #96b7bb;
  font-size: 0.65rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.nav-item {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  color: #d5e8e9;
  background: transparent;
  text-align: left;
  font-weight: 650;
  transition: background var(--transition), color var(--transition);
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 #5dd6c3;
}

.nav-icon {
  display: inline-grid;
  width: 24px;
  place-items: center;
  font-size: 1.05rem;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .btn-ghost {
  color: #e7f2f3;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.status-badge,
.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.73rem;
  font-weight: 800;
  white-space: nowrap;
}

.sidebar-footer .status-badge {
  width: 100%;
}

.sidebar-backdrop {
  display: none;
}

.badge.success,
.status-badge.success {
  color: var(--success);
  background: var(--success-soft);
}

.badge.warning,
.status-badge.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.badge.danger,
.status-badge.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.badge.neutral,
.status-badge.neutral {
  color: #475467;
  background: #eef2f4;
}

.main-content {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 18px rgba(16, 49, 54, 0.035);
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.topbar p {
  font-size: 0.82rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  justify-content: flex-end;
}

.user-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-weight: 900;
}

.user-chip strong,
.user-chip span {
  display: block;
  text-align: right;
}

.user-chip strong {
  font-size: 0.86rem;
}

.user-chip span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: capitalize;
}

.content-area {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 26px 28px 42px;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2,
.panel-header h3 {
  margin: 0 0 5px;
  letter-spacing: -0.025em;
}

.section-heading h2 {
  font-size: 1.42rem;
  line-height: 1.2;
}

.section-heading p,
.panel-header p {
  font-size: 0.85rem;
  line-height: 1.5;
}

.panel {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  padding: 18px 20px 0;
}

.inline-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel > form,
.panel > .full-label,
.panel > .form-actions,
.panel > .search-field,
.panel > .selected-card,
.panel > .search-results {
  margin: 18px 20px 20px;
}

.toolbar-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  overflow: visible;
}

.inline-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
}

.inline-filter span {
  font-size: 0.85rem;
  color: var(--muted, #5b6b73);
}

.inline-filter select {
  min-width: 180px;
}

.search-field {
  display: flex;
  gap: 8px;
}

.search-field.grow {
  flex: 1;
}

.search-field input {
  flex: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  min-height: 124px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.metric-card::after {
  position: absolute;
  right: -18px;
  bottom: -28px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--primary-soft);
  content: "";
}

.metric-card.warning::after {
  background: var(--warning-soft);
}

.metric-card.danger::after {
  background: var(--danger-soft);
}

.metric-card.info::after {
  background: var(--secondary-soft);
}

.metric-label {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 13px;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

.metric-note {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.75rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf1f3;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #475467;
  background: #f8fafb;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

tbody tr:hover {
  background: #fbfdfd;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.actions-col {
  width: 1%;
  text-align: right;
}

.action-group {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.table-primary {
  font-weight: 750;
}

.table-secondary {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

.empty-cell,
.empty-state {
  padding: 32px 18px !important;
  color: var(--muted);
  text-align: center;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-actions.end {
  justify-content: flex-end;
}

.dispense-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.search-results {
  display: grid;
  gap: 8px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfdfd;
}

.search-result-item strong,
.search-result-item span {
  display: block;
}

.search-result-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

.selected-card {
  padding: 14px;
  border: 1px solid #a5d6ce;
  border-radius: 10px;
  background: var(--primary-soft);
}

.selected-card h4 {
  margin: 0 0 6px;
}

.selected-card p {
  margin: 3px 0;
  color: #3f5e5a;
  font-size: 0.8rem;
}

.recent-history {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #bcded8;
}

.recent-history h5 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recent-history ul {
  margin: 0;
  padding-left: 18px;
  color: #3f5e5a;
  font-size: 0.77rem;
}

.report-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 16px;
  overflow: visible;
}

.report-controls label {
  min-width: 180px;
}

.report-controls .report-date-field {
  min-width: 150px;
}

.report-output {
  min-height: 220px;
}

.report-heading {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.report-heading h3,
.report-heading p {
  margin: 0;
}

.report-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.narrow-panel {
  max-width: 680px;
}

.inline-alert {
  margin-top: 16px;
  border: 1px solid;
  border-radius: 9px;
  padding: 11px 12px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.inline-alert.warning {
  color: #6d4c00;
  border-color: #ecd38b;
  background: var(--warning-soft);
}

.inline-alert.danger {
  color: #7a271a;
  border-color: #f0b4aa;
  background: var(--danger-soft);
}

.inline-alert.success {
  color: #14532d;
  border-color: #a8dbba;
  background: var(--success-soft);
}

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: grid;
  width: min(360px, calc(100vw - 32px));
  gap: 10px;
}

.toast {
  border: 1px solid var(--line);
  border-left: 4px solid var(--secondary);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 45, 55, 0.16);
  animation: toast-in 180ms ease-out;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  font-size: 0.84rem;
}

.toast span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.4;
}

@keyframes toast-in {
  from {
    transform: translateY(-8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 35, 40, 0.52);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(760px, 100%);
  max-height: min(88vh, 900px);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(5, 27, 32, 0.32);
  overflow: hidden;
}

.modal.wide {
  width: min(1000px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2,
.modal-header p {
  margin: 0;
}

.modal-header h2 {
  font-size: 1.15rem;
}

.modal-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.modal-body {
  max-height: calc(88vh - 80px);
  overflow-y: auto;
  padding: 20px;
}

.receipt {
  color: #111;
  background: #fff;
}

.receipt-header {
  padding-bottom: 16px;
  border-bottom: 2px solid #111;
  text-align: center;
}

.receipt-header h2,
.receipt-header p {
  margin: 0;
}

.receipt-header p {
  margin-top: 4px;
  font-size: 0.82rem;
}

.receipt-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
  margin: 16px 0;
  font-size: 0.85rem;
}

.receipt table {
  font-size: 0.78rem;
}

.receipt-signature {
  margin-top: 48px;
  border-top: 1px solid #111;
  padding-top: 7px;
  text-align: center;
  font-size: 0.8rem;
}

.receipt-print-area {
  display: none;
}

.loading-row td {
  padding: 26px !important;
  color: var(--muted);
  text-align: center;
}

code {
  border-radius: 5px;
  padding: 1px 4px;
  background: #eef2f4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}



.brand-logo-slot,
.institution-logo-slot,
.preview-logo-slot {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
}

.brand-logo-slot {
  width: 48px;
  height: 48px;
}

.brand-logo-slot.compact {
  width: 44px;
  height: 44px;
}

.brand-logo,
.institution-logo,
.preview-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-detail {
  font-size: 0.74rem !important;
}

.version-label {
  display: block;
  color: var(--sidebar-muted);
  font-size: 0.72rem;
  text-align: center;
}

.topbar-copy {
  min-width: 0;
}

.topbar-institution {
  display: block;
  max-width: 720px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.institution-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--surface), var(--primary-soft));
  box-shadow: 0 7px 22px rgba(16, 49, 54, 0.06);
}

.institution-logo-slot {
  width: 62px;
  height: 62px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.institution-mark,
.preview-mark {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
}

.institution-mark .brand-mark-img,
.institution-mark .brand-mark-svg,
.preview-mark .brand-mark-img,
.preview-mark .brand-mark-svg {
  width: 100%;
  height: 100%;
}

.institution-mark .brand-mark-img,
.preview-mark .brand-mark-img {
  object-fit: cover;
}

.institution-mark .brand-mark-icon,
.preview-mark .brand-mark-icon {
  width: 58%;
  height: 58%;
}

.institution-copy {
  min-width: 0;
  flex: 1;
}

.institution-copy span {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.institution-copy h3 {
  margin: 4px 0 5px;
  font-size: 1.2rem;
}

.institution-copy p {
  margin: 0;
  color: var(--muted);
}

.institution-code {
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--primary);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 18px;
}

.settings-group + .settings-group {
  margin-top: 8px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.settings-group-title {
  margin-bottom: 16px;
}

.settings-group-title h3 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.settings-group-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.color-field {
  min-height: 46px;
  padding: 5px;
  cursor: pointer;
}

.settings-preview-panel {
  position: sticky;
  top: 92px;
}

.preview-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.identity-preview {
  --preview-primary: #0b6b5f;
  --preview-secondary: #1769aa;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 310px;
  justify-content: center;
  border-radius: 16px;
  padding: 26px 20px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.18), transparent 32%),
    linear-gradient(150deg, var(--preview-secondary), var(--preview-primary));
  text-align: center;
}

.preview-logo-slot {
  width: 82px;
  height: 82px;
  margin-bottom: 18px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255,255,255,.95);
}

.identity-preview p,
.identity-preview h3,
.identity-preview strong,
.identity-preview span,
.identity-preview small {
  display: block;
  margin: 0;
}

.identity-preview p {
  margin-bottom: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.identity-preview h3 {
  margin-bottom: 14px;
  font-size: 1.45rem;
}

.identity-preview strong {
  font-size: .88rem;
}

.identity-preview span {
  margin-top: 5px;
  font-size: .82rem;
}

.identity-preview small {
  margin-top: 7px;
  opacity: .85;
}

.preview-note {
  margin-top: 15px;
  border-radius: 10px;
  padding: 13px;
  background: var(--primary-soft);
}

.preview-note strong {
  color: var(--primary);
  font-size: .82rem;
}

.preview-note p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
}

.receipt-logo {
  display: block;
  width: 72px;
  max-height: 72px;
  margin: 0 auto 10px;
  object-fit: contain;
}

.receipt-government {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.receipt-header h3 {
  margin: 14px 0 0;
  font-size: 1rem;
  text-transform: uppercase;
}

.receipt-technical,
.receipt-footer-text {
  color: #475467;
  font-size: .78rem;
  text-align: center;
}

.receipt-footer-text {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #d0d5dd;
}

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .report-controls {
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  .icon-btn.mobile-only {
    display: grid;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-102%);
    width: min(280px, 86vw);
    transition: transform 220ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(7, 32, 38, 0.48);
    backdrop-filter: blur(2px);
  }

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

  .topbar {
    padding: 12px 18px;
  }

  .topbar > div:nth-child(2) {
    flex: 1;
  }

  .content-area {
    padding: 20px 18px 36px;
  }

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

  .dispense-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .login-view {
    padding: 14px;
  }

  .login-card {
    padding: 24px 20px;
  }

  .topbar {
    min-height: 68px;
  }

  .topbar h1 {
    font-size: 1.05rem;
  }

  .topbar p {
    display: none;
  }

  .user-chip {
    min-width: 0;
  }

  .user-chip > div:last-child {
    display: none;
  }

  .content-area {
    padding: 16px 12px 32px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading .btn {
    width: 100%;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 108px;
  }

  .toolbar-panel,
  .search-field,
  .report-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-panel .btn,
  .search-field .btn,
  .report-controls .btn,
  .report-controls label {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: span 1;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal,
  .modal.wide {
    width: 100%;
    max-height: 94vh;
    border-radius: 16px 16px 0 0;
  }

  .modal-body {
    max-height: calc(94vh - 76px);
  }

  .receipt-meta {
    grid-template-columns: 1fr;
  }
}

@media print {
  body * {
    visibility: hidden !important;
  }

  body.print-receipt #receiptPrintArea,
  body.print-receipt #receiptPrintArea * {
    visibility: visible !important;
  }

  body.print-report #reportOutput,
  body.print-report #reportOutput * {
    visibility: visible !important;
  }

  body.print-receipt #receiptPrintArea,
  body.print-report #reportOutput {
    position: absolute;
    inset: 0;
    display: block !important;
    width: 100%;
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  body.print-receipt #receiptPrintArea {
    padding: 18mm 14mm;
  }

  body.print-report #reportOutput {
    padding: 10mm;
  }

  table {
    break-inside: auto;
  }

  tr {
    break-inside: avoid;
  }

  .action-group,
  .btn {
    display: none !important;
  }
}


@media (max-width: 1050px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-preview-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .institution-banner {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 16px;
  }

  .institution-logo-slot {
    width: 54px;
    height: 54px;
  }

  .institution-code {
    margin-left: 72px;
  }

  .topbar-institution {
    max-width: 55vw;
  }
}

/* =========================================================
   FarmaFácil 1.2 — multiunidade e transferências
   ========================================================= */

.unit-switcher {
  display: grid;
  min-width: 230px;
  gap: 4px;
  margin-left: auto;
}

.unit-switcher span,
.compact-filter span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.unit-switcher select {
  min-height: 38px;
  padding: 7px 34px 7px 11px;
  border-color: var(--line-strong);
  background-color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.subpanel {
  margin: 18px 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafb;
}

.subpanel h4 {
  margin: 0 0 12px;
  font-size: 0.98rem;
}

.subpanel form {
  margin: 0;
}

.compact-filter {
  display: grid;
  min-width: 170px;
  gap: 4px;
}

.compact-filter select {
  min-height: 38px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.detail-grid > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafb;
}

.detail-grid span,
.detail-grid strong {
  display: block;
}

.detail-grid span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-grid strong {
  font-size: 0.9rem;
}

#section-transferencias .panel > .form-grid {
  margin: 18px 20px 20px;
}

#section-transferencias .table-wrap,
#section-unidades .table-wrap {
  max-height: 520px;
}

#transferDraftBody .btn,
#transfersBody .btn {
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .topbar {
    flex-wrap: wrap;
  }

  .unit-switcher {
    order: 3;
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 680px) {
  .unit-switcher {
    order: initial;
    width: calc(100% - 52px);
  }

  .unit-switcher span {
    display: none;
  }

  .user-chip {
    min-width: 42px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .inline-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-header-tools {
    width: 100%;
  }

  .panel-header-tools .btn {
    width: 100%;
  }

  .compact-filter {
    width: 100%;
  }
}

/* =========================================================
   FarmaFácil 1.4 — Portal do Paciente
   ========================================================= */

.operation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.operation-grid > .panel {
  margin: 0;
}

.inventory-count-table {
  max-height: 58vh;
}

.inventory-count-table table {
  min-width: 1120px;
}

.inventory-count-input,
.inventory-reason-input {
  width: 100%;
  min-width: 110px;
  min-height: 36px;
  padding: 7px 9px;
}

.inventory-reason-input {
  min-width: 230px;
}

.inventory-difference {
  font-weight: 800;
  white-space: nowrap;
}

#prescriptionDraftBody .table-primary,
#prescriptionsBody .table-primary,
#adjustmentsBody .table-primary {
  max-width: 290px;
}

#section-receitas .table-wrap,
#section-inventario .table-wrap {
  max-height: 560px;
}

#stockAdjustmentForm,
#prescriptionForm {
  margin: 0;
}

#adjustmentPatientField.hidden,
#reportMedicineField.hidden,
#reportLotField.hidden {
  display: none !important;
}

.inline-alert.neutral {
  border-color: var(--line-strong);
  background: #f8fafb;
  color: var(--text);
}

.modal.wide {
  width: min(1180px, 100%);
}

@media (max-width: 1180px) {
  .operation-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .operation-grid {
    gap: 12px;
  }

  #section-inventario .section-heading,
  #section-receitas .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  #section-inventario .section-heading .btn,
  #section-receitas .section-heading .btn {
    width: 100%;
  }
}


/* Versão 1.4 — gestão interna do Portal do Paciente */
.heading-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.compact-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.portal-settings-group { border-top: 3px solid var(--secondary); }
.activation-code-box { display:grid; gap:8px; place-items:center; padding:24px; border:2px dashed var(--primary); border-radius:14px; background:var(--primary-soft); text-align:center; }
.activation-code-box span { color:var(--muted); font-weight:700; }
.activation-code-box strong { font-size:2.4rem; letter-spacing:.18em; color:var(--primary-dark); }
.activation-code-box small { color:var(--muted); }
.print-code { margin:22px auto; padding:14px; border:2px solid #111; font-size:28px; font-weight:800; letter-spacing:8px; text-align:center; }
.inline-alert.success { color:var(--success); border-color:#a8d5b8; background:var(--success-soft); }
@media (max-width: 1100px) { .compact-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .compact-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .heading-actions { width:100%; } .heading-actions .btn { flex:1; } }


/* Atalho público apresentado separadamente do login dos servidores */
.patient-access-link {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafb;
  text-align: center;
}
.patient-access-link span { color: var(--text-muted); font-size: .76rem; }
.patient-access-link a { color: var(--primary); font-size: .86rem; font-weight: 800; text-decoration: none; }
.patient-access-link a:hover { text-decoration: underline; }


/* Base demonstrativa integrada à versão 1.4 */
.demo-banner {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 3000;
  height: var(--demo-banner-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  background: #7a3e00;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-align: center;
  box-shadow: 0 3px 12px rgba(0,0,0,.24);
}
body.demo-mode .login-view,
body.demo-mode .app-shell { padding-top: var(--demo-banner-height); }
body.demo-mode .sidebar {
  top: var(--demo-banner-height);
  height: calc(100vh - var(--demo-banner-height));
}
body.demo-mode .topbar { top: var(--demo-banner-height); }
.demo-settings-group {
  border: 2px dashed #d08a22;
  background: #fffaf0;
}
.demo-base-status {
  display: grid;
  gap: 4px;
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
}
.demo-base-status.active { border-color: #c77a13; background: #fff4dd; }
.demo-base-status.inactive { border-color: #9aa8a4; }
.demo-base-status strong { font-size: .95rem; }
.demo-base-status span, .demo-base-status small { color: var(--text-muted); }
.demo-base-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.demo-result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 20px; }
.demo-result-grid span { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted); }
.demo-result-grid strong { font-size: 1.2rem; color: var(--primary); }
.btn-danger { background: #a52b2b; color: #fff; border-color: #a52b2b; }
.btn-danger:hover { background: #842020; }
@media (max-width: 720px) {
  body.demo-mode { --demo-banner-height: 44px; }
  .demo-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-base-actions .btn { width: 100%; }
  .demo-banner {
    padding: 5px 12px;
    font-size: .68rem;
    line-height: 1.25;
  }

  .table-wrap {
    overflow: visible;
  }

  table.responsive-table,
  .responsive-table tbody,
  .responsive-table tr {
    display: block;
    width: 100%;
  }

  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .responsive-table tbody {
    display: grid;
    gap: 12px;
  }

  .responsive-table tbody tr {
    overflow: hidden;
    border: 1px solid var(--border-color, #dfe7e4);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(16, 63, 72, 0.06);
  }

  .responsive-table tbody tr:hover {
    background: #fff;
  }

  .responsive-table tbody td {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px 12px;
    border-bottom: 1px solid #edf1f3;
    text-align: left;
    overflow-wrap: anywhere;
  }

  .responsive-table tbody td::before {
    content: attr(data-label);
    color: #667085;
    font-size: 0.68rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.035em;
  }

  .responsive-table tbody td:last-child {
    border-bottom: 0;
  }

  .responsive-table tbody td[colspan] {
    display: block;
    padding: 18px 14px;
    text-align: center;
  }

  .responsive-table tbody td[colspan]::before {
    display: none;
  }

  .responsive-table .actions-col {
    width: auto;
  }

  .responsive-table .action-group {
    justify-content: flex-start;
    flex-wrap: wrap;
    white-space: normal;
  }

  .responsive-table .action-group .btn {
    flex: 1;
    min-width: 100px;
  }

  .responsive-table.inventory-count-table input {
    width: 100%;
  }
}


/* v1.4.2 — paginação e carregamento progressivo */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px 2px;
  border-top: 1px solid var(--border-color, #dfe7e4);
}
.pagination-bar:empty { display: none; }
.pager-summary { color: var(--text-muted, #5f6f69); font-size: .9rem; }
.pager-actions { display: flex; gap: 8px; }
@media (max-width: 640px) {
  .pagination-bar { align-items: stretch; flex-direction: column; }
  .pager-actions { width: 100%; }
  .pager-actions .btn { flex: 1; }
}

/* Etapa 3 — hierarquia do dashboard e acabamento visual */
.section-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.dashboard-heading {
  align-items: end;
}

.dashboard-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.dashboard-updated {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.dashboard-updated::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5aa899;
  box-shadow: 0 0 0 4px rgba(90, 168, 153, 0.12);
  content: "";
}

.dashboard-overview {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-metric-section {
  min-width: 0;
}

.dashboard-metric-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 11px;
  padding: 0 2px;
}

.dashboard-metric-heading span {
  display: block;
  margin-bottom: 3px;
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.dashboard-metric-heading h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.dashboard-metric-heading p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
  text-align: right;
}

.dashboard-grid-primary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-grid-attention {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-grid-context {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-metric-section:last-child .dashboard-grid {
  margin-bottom: 0;
}

.metric-card {
  transition: border-color var(--transition), box-shadow var(--transition);
}

.metric-card-action {
  display: block;
  width: 100%;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.metric-card-action:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-raised);
  transform: translateY(-1px);
}

.metric-card-action:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, white);
  outline-offset: 2px;
}

.metric-card-action.warning:hover {
  border-color: #c9a227;
}

.metric-card-action.danger:hover {
  border-color: #c4574a;
}

.panel-header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.metric-card.warning {
  border-color: #ebd79c;
}

.metric-card.danger {
  border-color: #efc1bb;
}

.metric-card-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
}

.metric-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 0.9rem;
  font-weight: 900;
}

.metric-card.info .metric-icon {
  color: var(--secondary);
  background: var(--secondary-soft);
}

.metric-card.warning .metric-icon {
  color: var(--warning);
  background: var(--warning-soft);
}

.metric-card.danger .metric-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.metric-card.featured {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #0c7063 0%, #075248 100%);
  box-shadow: var(--shadow-raised);
}

.metric-card.featured::after {
  right: -8px;
  bottom: -38px;
  width: 126px;
  height: 126px;
  background: rgba(255, 255, 255, 0.08);
}

.metric-card.featured .metric-icon {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.metric-card.featured .metric-label,
.metric-card.featured .metric-note {
  color: rgba(255, 255, 255, 0.8);
}

.dashboard-grid-context .metric-card {
  min-height: 112px;
}

.dashboard-grid-context .metric-value {
  font-size: 1.72rem;
}

.dashboard-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #edf1f3;
}

.dashboard-alert-header .status-badge {
  flex: 0 0 auto;
}

.dashboard-loading {
  display: flex;
  min-height: 124px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 0.84rem;
  font-weight: 700;
}

.dashboard-loading .loading-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 0 0 rgba(23, 105, 170, 0.3);
  animation: dashboard-loading-pulse 1.25s ease-out infinite;
}

@keyframes dashboard-loading-pulse {
  70% { box-shadow: 0 0 0 8px rgba(23, 105, 170, 0); }
  100% { box-shadow: 0 0 0 0 rgba(23, 105, 170, 0); }
}

.compact-cards .metric-card {
  min-height: 108px;
  padding: 16px;
}

.compact-cards .metric-card > span {
  display: block;
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.compact-cards .metric-card > strong {
  display: block;
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

tbody tr {
  transition: background var(--transition);
}

@media (max-width: 1100px) {
  .dashboard-grid-primary,
  .dashboard-grid-context {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid-attention {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dashboard-heading {
    align-items: stretch;
  }

  .dashboard-heading-actions {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-metric-heading {
    display: block;
  }

  .dashboard-metric-heading p {
    margin-top: 4px;
    text-align: left;
  }

  .dashboard-grid-primary {
    grid-template-columns: 1fr;
  }

  .dashboard-grid-attention,
  .dashboard-grid-context {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid-attention .metric-card,
  .dashboard-grid-context .metric-card {
    min-height: 126px;
    padding: 14px;
  }

  .dashboard-grid-attention .metric-card-heading,
  .dashboard-grid-context .metric-card-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .dashboard-alert-header {
    align-items: flex-start;
  }

  .institution-banner {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: start;
    gap: 12px 14px;
  }

  .institution-banner .institution-logo-slot {
    grid-column: 1;
    grid-row: 1;
  }

  .institution-banner .institution-copy {
    grid-column: 2;
    grid-row: 1;
  }

  .institution-banner .institution-code {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    margin-left: 0;
  }
}

@media (max-width: 420px) {
  .dashboard-heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-heading-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
