.card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 22px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 19px;
  font-weight: 850;
  letter-spacing: 0;
}

.card-description {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 850;
}

.button-primary {
  color: #ffffff;
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-dark);
}

.button-secondary {
  color: var(--text);
  background: #eceff3;
}

.button-secondary:hover {
  background: #e2e6ec;
}

.button-danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.button-warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

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

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

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

.badge-info {
  color: var(--info);
  background: var(--info-soft);
}

.badge-neutral {
  color: #344054;
  background: #eef2f7;
}

.badge-close {
  color: #7a4e00;
  background: #fff3bf;
}

.metric-card {
  min-height: 132px;
  display: grid;
  gap: 12px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-value {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
}

.metric-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.action-card {
  color: var(--text);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf3;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.data-table {
  width: 100%;
  min-width: 720px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

.data-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 850;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 12px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.timeline-title {
  font-weight: 850;
}

.timeline-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.empty-state {
  display: grid;
  gap: 10px;
  place-items: start;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.empty-state strong {
  font-size: 16px;
}

.empty-state p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

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

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.input,
.textarea,
.select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: #b9c2d0;
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.large-textarea {
  min-height: 280px;
  line-height: 1.45;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.14);
}

.select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  padding: 10px 36px 10px 12px;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 52%,
    calc(100% - 11px) 52%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  font-family: inherit;
  line-height: 1.35;
}

.select:invalid {
  color: var(--muted);
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  gap: 10px;
}

.toast {
  max-width: 360px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 750;
  text-align: left;
}

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

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

.toast-clickable {
  cursor: pointer;
}

.toast-success {
  border-color: rgba(6, 118, 71, 0.22);
}

.toast-warning {
  border-color: rgba(181, 71, 8, 0.26);
  background: #fff8ed;
}

.toast-error {
  border-color: rgba(180, 35, 24, 0.26);
  background: #fff4f3;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 19, 24, 0.42);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(560px, 100%);
}

.variables-modal-card {
  width: min(760px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;
}

.modal-title-row {
  align-items: flex-start;
  gap: 14px;
}

.modal-x-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-x-button:hover,
.modal-x-button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.14);
  outline: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.variable-list {
  display: grid;
  gap: 10px;
}

.variable-row {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #ffffff;
}

.variable-copy-row {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.variable-copy-row:hover,
.variable-copy-row:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.variable-row span {
  display: grid;
  gap: 3px;
}

.variable-row small {
  color: var(--muted);
  font-size: 12px;
}

.variable-row code {
  user-select: all;
  width: fit-content;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 850;
}

.variable-row span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}

.muted-text {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

details {
  border-top: 1px solid var(--line-soft);
  padding: 14px 0 0;
}

details + details {
  margin-top: 14px;
}

summary {
  cursor: pointer;
  font-weight: 850;
}

.table-select {
  min-height: 36px;
  padding: 6px 8px;
  font-size: 13px;
}
