/* Blade component catalog
   Extends the PT. Alpha Teknik Pratama design tokens in style.css. */

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Shared loading feedback */

.ui-loading[hidden] {
  display: none;
}

.ui-loading {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 22px;
  position: fixed;
  z-index: 10000;
}

.ui-loading__backdrop {
  backdrop-filter: blur(4px);
  background: rgba(5, 22, 37, 0.68);
  inset: 0;
  position: absolute;
}

.ui-loading__panel {
  align-items: center;
  background: white;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(3, 18, 31, 0.3);
  color: var(--text, #102637);
  display: grid;
  gap: 15px;
  justify-items: center;
  max-width: 390px;
  padding: 28px;
  position: relative;
  text-align: center;
  width: 100%;
}

.ui-loading__brand {
  align-items: center;
  display: flex;
  height: 72px;
  justify-content: center;
  position: relative;
  width: 72px;
}

.ui-loading__brand img {
  height: 38px;
  object-fit: contain;
  width: 38px;
}

.ui-loading__spinner {
  animation: ui-loading-spin 0.85s linear infinite;
  border: 3px solid rgba(13, 45, 69, 0.13);
  border-radius: 50%;
  border-top-color: var(--orange-600, #e67622);
  inset: 0;
  position: absolute;
}

.ui-loading__copy {
  display: grid;
  gap: 6px;
}

.ui-loading__copy strong {
  color: var(--navy-900, #0a2c49);
  font-size: 19px;
  letter-spacing: -0.02em;
}

.ui-loading__copy p,
.ui-loading__panel small {
  color: var(--muted, #627482);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}

.ui-loading__panel small {
  background: #fff7ed;
  border-radius: 8px;
  color: #985218;
  padding: 9px 11px;
}

.ui-loading__progress {
  background: #e8eef2;
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
  width: 100%;
}

.ui-loading__progress span {
  background: linear-gradient(90deg, var(--orange-600, #e67622), var(--green-700, #148c61));
  display: block;
  height: 100%;
  transition: width 180ms ease;
  width: 0;
}

.ui-loading-active {
  overflow: hidden;
}

.is-loading {
  cursor: wait !important;
  opacity: 0.78;
  pointer-events: none;
}

button.is-loading::before,
a.is-loading::before {
  animation: ui-loading-spin 0.75s linear infinite;
  border: 2px solid currentColor;
  border-bottom-color: transparent;
  border-radius: 50%;
  content: "";
  display: inline-block;
  height: 14px;
  margin-right: 7px;
  vertical-align: -2px;
  width: 14px;
}

@keyframes ui-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ui-loading__spinner,
  button.is-loading::before,
  a.is-loading::before {
    animation-duration: 1.8s;
  }
}

.component-library-page .site-header {
  position: sticky;
  top: 0;
}

.component-hero {
  background:
    radial-gradient(circle at 88% 18%, rgba(32, 184, 124, 0.2), transparent 24rem),
    linear-gradient(135deg, var(--navy-950), var(--navy-800));
  color: white;
  overflow: hidden;
  padding: 76px 0 68px;
  position: relative;
}

.component-hero::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(90deg, transparent, black);
  pointer-events: none;
  position: absolute;
}

.component-hero__layout {
  align-items: end;
  display: grid;
  gap: 64px;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  position: relative;
  z-index: 1;
}

.component-hero h1 {
  font-size: clamp(38px, 5.2vw, 66px);
  letter-spacing: -0.055em;
  line-height: 0.98;
  margin-bottom: 24px;
  max-width: 820px;
}

.component-hero p {
  color: #b9c7d1;
  font-size: 15px;
  line-height: 1.75;
  max-width: 690px;
}

.component-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.component-hero__actions a {
  text-decoration: none;
}

.component-button--dark {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  color: white;
}

.component-button--dark:hover {
  background: rgba(255, 255, 255, 0.14);
}

.component-stats {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  overflow: hidden;
}

.component-stats div {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 112px;
  padding: 24px 18px;
}

.component-stats div:first-child {
  border-radius: 12px 0 0 12px;
}

.component-stats div:last-child {
  border-radius: 0 12px 12px 0;
}

.component-stats dt {
  color: white;
  font-size: 25px;
  font-weight: 850;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

.component-stats dd {
  color: #9eb0be;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  text-transform: uppercase;
}

.component-anchor-nav {
  background: white;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(6, 19, 30, 0.04);
  position: sticky;
  top: 76px;
  z-index: 30;
}

.component-anchor-nav .page-shell {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.component-anchor-nav a {
  color: var(--muted);
  flex: none;
  font-size: 14px;
  font-weight: 800;
  padding: 18px 14px;
  position: relative;
  text-decoration: none;
}

.component-anchor-nav a:hover {
  color: var(--orange-600);
}

.component-library {
  padding-bottom: 88px;
}

.component-section {
  scroll-margin-top: 150px;
  padding-top: 76px;
}

.component-section__heading {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 28px;
}

.component-section__heading h2 {
  font-size: clamp(27px, 3vw, 38px);
  letter-spacing: -0.045em;
  margin-bottom: 8px;
}

.component-section__heading p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}

.component-code {
  background: var(--navy-900);
  border-radius: 7px;
  color: #ffc29f;
  flex: none;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  padding: 9px 12px;
}

.component-stack {
  display: grid;
  gap: 12px;
}

/* Alerts */

.ui-alert {
  align-items: flex-start;
  background: white;
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue-700);
  border-radius: 10px;
  display: flex;
  gap: 13px;
  min-height: 70px;
  padding: 16px 18px;
}

.ui-alert__icon {
  align-items: center;
  background: var(--blue-100);
  border-radius: 50%;
  color: var(--blue-700);
  display: inline-flex;
  flex: 0 0 25px;
  font-size: 14px;
  font-weight: 900;
  height: 25px;
  justify-content: center;
}

.ui-alert__content {
  flex: 1;
}

.ui-alert__content strong {
  display: block;
  font-size: 14px;
  margin: 1px 0 5px;
}

.ui-alert__content div {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.ui-alert__close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 0 2px;
}

.ui-alert--success {
  border-left-color: var(--green-700);
}

.ui-alert--success .ui-alert__icon {
  background: var(--green-100);
  color: var(--green-700);
}

.ui-alert--warning {
  border-left-color: #d99000;
}

.ui-alert--warning .ui-alert__icon {
  background: var(--yellow-100);
  color: #a96800;
}

.ui-alert--danger {
  border-left-color: var(--red-600);
}

.ui-alert--danger .ui-alert__icon {
  background: var(--red-100);
  color: var(--red-600);
}

/* Form */

.ui-form-card,
.ui-data-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.ui-form-card {
  padding: 28px;
}

.ui-form-card__header {
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  margin: -2px -2px 26px;
  padding: 0 2px 22px;
}

.ui-form-card__header h3 {
  font-size: 18px;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}

.ui-form-card__header p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.ui-form-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ui-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ui-field--full {
  grid-column: 1 / -1;
}

.ui-field__label {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.ui-field__label em {
  color: var(--orange-600);
  float: right;
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ui-field input,
.ui-field select,
.ui-field textarea,
.ui-search input,
.ui-filter select {
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  min-height: 44px;
  padding: 0 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  width: 100%;
}

.ui-field textarea {
  min-height: 96px;
  padding-block: 12px;
  resize: vertical;
}

.ui-field input:focus,
.ui-field select:focus,
.ui-field textarea:focus,
.ui-search input:focus,
.ui-filter select:focus {
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px rgba(20, 140, 97, 0.12);
  outline: 0;
}

.ui-field input::placeholder,
.ui-field textarea::placeholder,
.ui-search input::placeholder {
  color: #9aa7b1;
}

.ui-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ui-form-card__footer {
  align-items: center;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin: 26px -2px -2px;
  padding: 22px 2px 0;
}

.ui-form-card__footer > div {
  display: flex;
  gap: 9px;
}

.ui-check {
  align-items: flex-start;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 9px;
  line-height: 1.5;
}

.ui-check input {
  accent-color: var(--orange-500);
  height: 15px;
  margin: 0;
  width: 15px;
}

/* File input */

.ui-file-drop {
  align-items: center;
  background: #f8fafb;
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 170px;
  padding: 24px;
  text-align: center;
  transition: background 160ms ease, border-color 160ms ease;
}

.ui-file-drop:hover,
.ui-file-drop.is-dragging {
  background: var(--orange-100);
  border-color: var(--orange-500);
}

.ui-file-drop.has-file {
  background: var(--green-100);
  border-color: #82c891;
}

.ui-file-drop input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.ui-file-drop__icon {
  align-items: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
  color: var(--orange-600);
  display: flex;
  font-size: 22px;
  height: 43px;
  justify-content: center;
  margin-bottom: 13px;
  width: 43px;
}

.ui-file-drop strong {
  font-size: 14px;
  margin-bottom: 7px;
}

.ui-file-drop small {
  color: var(--muted);
  font-size: 12px;
}

/* Data table */

.ui-table-toolbar {
  align-items: end;
  display: flex;
  gap: 12px;
  padding: 20px;
}

.ui-search {
  align-items: center;
  display: flex;
  flex: 1;
  position: relative;
}

.ui-search > span {
  color: var(--muted);
  font-size: 18px;
  left: 13px;
  position: absolute;
}

.ui-search input {
  padding-left: 38px;
}

.ui-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.ui-filter > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ui-table-shell {
  border-block: 1px solid var(--border);
  overflow-x: auto;
}

.ui-table {
  border-collapse: collapse;
  min-width: 850px;
  width: 100%;
}

.ui-table th {
  background: #f7f9fa;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 12px 18px;
  text-align: left;
  text-transform: uppercase;
}

.ui-table td {
  border-top: 1px solid var(--border);
  color: #33424f;
  font-size: 14px;
  padding: 16px 18px;
}

.ui-table tbody tr:hover {
  background: #fbfcfd;
}

.ui-table td strong {
  color: var(--text);
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.ui-table td small {
  color: var(--muted);
  font-size: 12px;
}

.ui-row-action {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  min-height: 30px;
  min-width: 34px;
}

.ui-row-action:hover {
  border-color: var(--orange-500);
  color: var(--orange-600);
}

.ui-empty-state {
  align-items: center;
  display: flex;
  flex-direction: column;
  padding: 36px;
  text-align: center;
}

.ui-empty-state > span {
  color: var(--border-strong);
  font-size: 32px;
  margin-bottom: 10px;
}

.ui-empty-state p {
  color: var(--muted);
  font-size: 13px;
  margin: 5px 0 0;
}

.ui-data-card__footer {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 17px 20px;
}

.ui-data-card__footer > p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

/* Pagination */

.ui-pagination {
  align-items: center;
  display: flex;
  gap: 7px;
}

.ui-pagination a,
.ui-pagination span {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  justify-content: center;
  min-height: 31px;
  padding: 0 10px;
  text-decoration: none;
}

.ui-pagination a:hover {
  border-color: var(--orange-500);
  color: var(--orange-600);
}

.ui-pagination__pages {
  display: flex;
  gap: 4px;
}

.ui-pagination__pages a,
.ui-pagination__pages span {
  min-width: 31px;
  padding: 0 7px;
}

.ui-pagination .is-current {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: white;
}

.ui-pagination .is-disabled {
  color: #aab4bc;
  cursor: not-allowed;
}

/* Demo cards */

.component-demo-row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.component-demo-row--compact {
  display: flex;
  flex-wrap: wrap;
}

.component-demo-card {
  align-items: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  display: grid;
  gap: 17px;
  grid-template-columns: auto 1fr auto;
  padding: 22px;
}

.component-demo-card__icon {
  align-items: center;
  background: var(--blue-100);
  border-radius: 10px;
  color: var(--blue-700);
  display: flex;
  font-size: 20px;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.component-demo-card__icon--danger {
  background: var(--red-100);
  color: var(--red-600);
}

.component-demo-card h3 {
  font-size: 14px;
  margin-bottom: 5px;
}

.component-demo-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}

.ui-button--danger {
  background: linear-gradient(135deg, #bf251b, var(--red-600));
  box-shadow: 0 6px 16px rgba(217, 45, 32, 0.2);
}

.ui-button--danger-outline {
  border-color: #efaaa4;
  color: var(--red-600);
}

/* Dialogs */

.ui-dialog {
  background: transparent;
  border: 0;
  max-height: calc(100vh - 32px);
  max-width: min(620px, calc(100vw - 32px));
  opacity: 0;
  padding: 0;
  transform: translateY(12px) scale(0.98);
  transition:
    opacity 170ms ease,
    transform 170ms ease,
    overlay 170ms ease allow-discrete,
    display 170ms ease allow-discrete;
  width: 100%;
}

.ui-dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  .ui-dialog[open] {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.ui-dialog::backdrop {
  background: rgba(3, 13, 21, 0.68);
  backdrop-filter: blur(3px);
}

.ui-dialog--small {
  max-width: min(430px, calc(100vw - 32px));
}

.ui-dialog__panel {
  background: white;
  border-radius: 16px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.ui-dialog__header {
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding: 24px 26px 20px;
}

.ui-dialog__header .eyebrow {
  margin-bottom: 8px;
}

.ui-dialog__header h2 {
  font-size: 21px;
  letter-spacing: -0.035em;
  margin-bottom: 7px;
}

.ui-dialog__header p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.ui-dialog__close {
  align-items: center;
  background: #f4f6f7;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  display: flex;
  flex: 0 0 34px;
  font-size: 22px;
  height: 34px;
  justify-content: center;
}

.ui-dialog__body {
  padding: 25px 26px;
}

.ui-dialog__footer {
  align-items: center;
  background: #f8fafb;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  padding: 17px 26px;
}

.ui-confirmation .ui-dialog__panel {
  padding: 30px;
  text-align: center;
}

.ui-confirmation__icon {
  align-items: center;
  background: var(--red-100);
  border-radius: 50%;
  color: var(--red-600);
  display: flex;
  font-size: 20px;
  font-weight: 900;
  height: 54px;
  justify-content: center;
  margin: 0 auto 18px;
  width: 54px;
}

.ui-confirmation__icon--success {
  background: var(--green-100);
  color: var(--green-700);
}

.ui-confirmation h2 {
  font-size: 20px;
  letter-spacing: -0.035em;
  margin-bottom: 10px;
}

.ui-confirmation__copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.ui-confirmation__actions {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 24px;
}

/* Toasts */

.ui-toast-stack {
  bottom: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 40px);
  pointer-events: none;
  position: fixed;
  right: 22px;
  top: 18px;
  width: min(420px, calc(100vw - 36px));
  z-index: 1000;
}

.ui-toast {
  align-items: flex-start;
  animation: toast-in 220ms ease both;
  background: var(--navy-900);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(3, 13, 21, 0.28);
  color: white;
  display: flex;
  gap: 11px;
  padding: 14px;
  pointer-events: auto;
}

.ui-toast.is-leaving {
  animation: toast-out 180ms ease both;
}

.ui-toast__icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  display: flex;
  flex: 0 0 25px;
  font-size: 14px;
  font-weight: 900;
  height: 25px;
  justify-content: center;
}

.ui-toast--success .ui-toast__icon {
  background: #1f8d44;
}

.ui-toast--warning .ui-toast__icon {
  background: #b87500;
}

.ui-toast--danger .ui-toast__icon {
  background: var(--red-600);
}

.ui-toast__copy {
  flex: 1;
  font-size: 13px;
  line-height: 1.55;
  padding-top: 5px;
}

.ui-toast__close {
  background: transparent;
  border: 0;
  color: #aebcc6;
  font-size: 18px;
  line-height: 1;
  padding: 2px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

@media (max-width: 980px) {
  .component-hero__layout {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .component-stats {
    max-width: 600px;
  }

  .component-demo-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .component-library-page .site-header {
    position: relative;
  }

  .component-anchor-nav {
    top: 0;
  }

  .component-hero {
    padding: 56px 0 50px;
  }

  .component-hero h1 {
    font-size: 42px;
  }

  .component-hero__layout {
    gap: 38px;
  }

  .component-stats {
    grid-template-columns: 1fr;
  }

  .component-stats div {
    min-height: auto;
  }

  .component-stats div:first-child {
    border-radius: 12px 12px 0 0;
  }

  .component-stats div:last-child {
    border-radius: 0 0 12px 12px;
  }

  .component-section {
    padding-top: 58px;
  }

  .component-section__heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .ui-field--full {
    grid-column: auto;
  }

  .ui-form-card {
    padding: 20px;
  }

  .ui-form-card__footer,
  .ui-data-card__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .ui-form-card__footer > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .ui-table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .ui-filter {
    min-width: 0;
  }

  .ui-pagination {
    justify-content: space-between;
  }

  .component-demo-card {
    align-items: start;
    grid-template-columns: auto 1fr;
  }

  .component-demo-card .button {
    grid-column: 1 / -1;
  }

  .ui-dialog__header,
  .ui-dialog__body {
    padding-inline: 20px;
  }
}

@media (max-width: 480px) {
  .component-hero h1 {
    font-size: 36px;
  }

  .component-hero__actions {
    display: grid;
  }

  .component-hero__actions .button {
    width: 100%;
  }

  .component-demo-row--compact {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ui-pagination__pages {
    display: none;
  }

  .ui-toast-stack {
    bottom: 14px;
    right: 14px;
    width: calc(100vw - 28px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ui-dialog,
  .ui-toast {
    animation: none;
    transition: none;
  }
}

/* Reference-aligned application components
   Uses the PT. Alpha Teknik Pratama blue and green tokens from style.css. */

.ui-icon {
  display: block;
  flex: 0 0 auto;
}

.button {
  border-radius: 7px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
  gap: 7px;
  min-height: 36px;
  padding: 7px 14px;
  transform: none;
}

.button:hover {
  transform: none;
}

.button--primary {
  background: linear-gradient(135deg, var(--orange-600), #20b87c);
  box-shadow: 0 4px 12px rgba(20, 140, 97, 0.18);
}

.button--primary:hover {
  box-shadow: 0 6px 16px rgba(20, 140, 97, 0.24);
}

.button--outline {
  border-color: var(--border-strong);
}

.badge {
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  min-height: 24px;
  padding: 5px 9px;
  text-transform: none;
}

.ui-alert {
  align-items: flex-start;
  border: 1px solid #cfe0ed;
  border-left: 3px solid var(--blue-700);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  gap: 12px;
  min-height: 62px;
  padding: 13px 15px;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.ui-alert__icon {
  background: transparent;
  border-radius: 0;
  flex-basis: 22px;
  height: 22px;
  margin-top: 1px;
  width: 22px;
}

.ui-alert__content strong {
  font-size: 14px;
  margin: 0 0 3px;
}

.ui-alert__content div {
  font-size: 14px;
  line-height: 1.5;
}

.ui-alert__close {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-size: 18px;
  height: 26px;
  justify-content: center;
  transition: background 160ms ease;
  width: 26px;
}

.ui-alert__close:hover {
  background: rgba(15, 36, 51, 0.06);
}

.ui-alert--success {
  background: #f3fbf5;
  border-color: #c9ead2;
  border-left-color: var(--green-700);
}

.ui-alert--warning {
  background: #fffaf0;
  border-color: #f0dfb9;
  border-left-color: #c57b00;
}

.ui-alert--danger {
  background: #fff6f4;
  border-color: #f0d0cb;
  border-left-color: var(--red-600);
}

.ui-form-card,
.ui-data-card {
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.ui-form-card {
  padding: 24px;
}

.ui-form-card__header {
  margin-bottom: 22px;
  padding-bottom: 18px;
}

.ui-form-card__header h3 {
  font-size: 16px;
}

.ui-form-card__header p {
  font-size: 14px;
}

.ui-form-grid {
  gap: 17px;
}

.ui-field {
  gap: 6px;
}

.ui-field__label {
  color: #526570;
  font-size: 14px;
  font-weight: 650;
}

.ui-field__label em {
  color: var(--red-600);
  float: none;
  font-size: 12px;
  margin-left: 5px;
}

.ui-field input,
.ui-field select,
.ui-field textarea,
.ui-search input,
.ui-filter select {
  border-color: var(--border-strong);
  border-radius: 7px;
  font-size: 14px;
  min-height: 40px;
  padding-inline: 11px;
}

.ui-field textarea {
  min-height: 100px;
  padding-block: 10px;
}

.ui-field small {
  font-size: 14px;
}

.ui-field .ui-field__error {
  color: var(--red-600);
  font-weight: 600;
}

.ui-field input.is-invalid,
.ui-field select.is-invalid,
.ui-field textarea.is-invalid {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.1);
}

.ui-file-drop {
  border-radius: 10px;
  min-height: 150px;
  padding: 20px;
}

.ui-file-drop.is-invalid {
  background: var(--red-100);
  border-color: var(--red-600);
}

.ui-file-drop__icon {
  height: 42px;
  width: 42px;
}

.ui-file-drop strong {
  font-size: 14px;
}

.ui-file-drop small {
  font-size: 13px;
}

.ui-table-toolbar {
  align-items: end;
  gap: 10px;
  padding: 16px 18px;
}

.ui-table-shell {
  border-bottom: 0;
}

.ui-table th {
  font-size: 14px;
  font-weight: 750;
  padding: 11px 14px;
}

.ui-table td {
  font-size: 14px;
  padding: 12px 14px;
}

.ui-table td strong {
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 2px;
}

.ui-table td small {
  font-size: 14px;
}

.ui-row-action {
  border-radius: 7px;
  min-height: 31px;
}

.ui-data-card__footer {
  padding: 14px 18px;
}

.ui-data-card__footer > p {
  font-size: 14px;
}

.ui-pagination {
  gap: 5px;
}

.ui-pagination a,
.ui-pagination span {
  border-radius: 6px;
  font-size: 14px;
  font-weight: 650;
  min-height: 30px;
  padding-inline: 9px;
}

.ui-pagination__pages a,
.ui-pagination__pages span {
  min-width: 30px;
}

.ui-pagination .is-current {
  background: var(--orange-600);
  border-color: var(--orange-600);
}

.ui-dialog {
  max-width: min(560px, calc(100vw - 30px));
}

.ui-dialog--small {
  max-width: min(410px, calc(100vw - 30px));
}

.ui-dialog--large {
  max-width: min(760px, calc(100vw - 30px));
}

.ui-dialog__panel {
  border-radius: 14px;
}

.ui-dialog__header {
  padding: 18px 20px 16px;
}

.ui-dialog__header h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.ui-dialog__header p {
  font-size: 14px;
}

.ui-dialog__close {
  border-radius: 7px;
  flex-basis: 32px;
  height: 32px;
}

.ui-dialog__body {
  padding: 20px;
}

.ui-dialog__footer {
  padding: 14px 20px;
}

.ui-confirmation .ui-dialog__panel {
  padding: 26px;
}

.ui-confirmation__icon {
  height: 52px;
  width: 52px;
}

.ui-confirmation h2 {
  font-size: 18px;
}

.ui-confirmation__copy {
  font-size: 14px;
}

.ui-toast-stack {
  bottom: auto;
  right: 18px;
  top: 18px;
  width: min(420px, calc(100vw - 36px));
}

.ui-toast {
  background: white;
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue-700);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(7, 26, 40, 0.16);
  color: var(--text);
  gap: 10px;
  padding: 12px 13px;
}

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

.ui-toast--warning {
  border-left-color: #c57b00;
}

.ui-toast--danger {
  border-left-color: var(--red-600);
}

.ui-toast__icon {
  color: white;
  flex-basis: 25px;
}

.ui-toast__copy {
  display: grid;
  font-size: 14px;
  gap: 2px;
  line-height: 1.4;
  padding-top: 1px;
}

.ui-toast__title {
  color: var(--text);
  font-size: 14px;
}

.ui-toast__message {
  color: var(--muted);
  display: block;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: normal;
}

.ui-toast__close {
  color: var(--muted);
}

@media (max-width: 720px) {
  .ui-form-card {
    padding: 18px;
  }

  .ui-table-toolbar {
    align-items: stretch;
  }

  .ui-dialog__header,
  .ui-dialog__body {
    padding-inline: 18px;
  }
}

@media (max-width: 480px) {
  .ui-toast-stack {
    left: 14px;
    right: 14px;
    top: 14px;
    width: auto;
  }
}

/* Comfortable interaction targets across public and participant pages */

button,
.button,
.login-button,
.mobile-menu-button {
  min-height: 44px;
}

.brand {
  min-height: 44px;
}

.skip-link {
  min-height: 44px;
}

.public-nav a {
  min-height: 44px;
}

.auth-tabs button,
.profile-dropdown__logout {
  font-size: 14px;
  min-height: 44px;
}

.dashboard-sidebar nav button,
.dashboard-sidebar > button {
  min-height: 44px;
}

.participant-program-record .program-code {
  color: var(--orange-600);
  inset: auto;
  position: static;
}

.ui-row-action,
.ui-dialog__close,
.ui-toast__close {
  min-height: 44px;
  min-width: 44px;
}

.ui-field input,
.ui-field select,
.ui-search input,
.ui-filter select {
  min-height: 46px;
}
