/* Specialized ISO/LIMS widgets. Uses the tokens defined in lims-theme.css. */

/* Workflow stepper */
.lims-stepper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--lims-border);
  border-radius: var(--lims-radius-lg);
  background: var(--lims-bg-surface);
}

.lims-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--lims-border);
  border-radius: var(--lims-radius-pill);
  color: var(--lims-text-muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.lims-step + .lims-step::before {
  content: "→";
  margin-left: -1px;
  color: var(--lims-text-muted);
  font-weight: 400;
}

.lims-step.step-done {
  border-color: var(--lims-success-border);
  background: var(--lims-success-bg);
  color: var(--lims-success-text);
}

.lims-step.step-active {
  border-color: var(--lims-primary);
  background: var(--lims-primary-soft);
  color: var(--lims-primary-dark);
}

.lims-step.step-pending {
  background: var(--lims-bg-subtle);
}

/* Dark banner */
.lims-dark-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--lims-radius-lg);
  background: var(--lims-bg-dark-slate);
  color: #fff;
}

.lims-dark-banner::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(var(--lims-primary-rgb), 0.16);
}

.lims-dark-banner > * {
  position: relative;
  z-index: 1;
}

.lims-dark-banner-title {
  margin: 8px 0 2px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.lims-dark-banner-copy {
  max-width: 700px;
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  line-height: 1.55;
}

.lims-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid rgba(127, 240, 215, 0.25);
  border-radius: var(--lims-radius-pill);
  background: rgba(var(--lims-primary-rgb), 0.24);
  color: #8af2dc;
  font-family: var(--lims-font-mono);
  font-size: 9px;
  font-weight: 500;
}

.lims-dark-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--lims-font-mono);
  font-size: 9px;
  text-align: right;
}

.lims-dark-status strong {
  color: #8af2dc;
  font-weight: 500;
}

/* Vault and hash */
.lims-vault-card {
  padding: 16px;
  border: 1px solid var(--lims-border);
  border-radius: var(--lims-radius-md);
  background: var(--lims-bg-subtle);
}

.lims-vault-card h3 {
  margin: 0 0 10px;
  color: var(--lims-text-main);
  font-size: 11px;
  font-weight: 700;
}

.lims-hash-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  overflow-x: auto;
  border: 1px solid var(--lims-border);
  border-radius: 6px;
  background: var(--lims-bg-surface);
  color: var(--lims-text-secondary);
  font-family: var(--lims-font-mono);
  font-size: 10px;
  white-space: nowrap;
}

.lims-hash-box .hash-label {
  color: var(--lims-text-muted);
  font-size: 9px;
  text-transform: uppercase;
}

.lims-hash-box .hash-value {
  color: var(--lims-primary-dark);
  letter-spacing: 0.02em;
}

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

.lims-diff-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--lims-border);
  border-radius: var(--lims-radius-md);
  background: var(--lims-bg-surface);
}

.lims-diff-panel.is-old {
  border-left: 3px solid var(--lims-danger-border);
}

.lims-diff-panel.is-new {
  border-left: 3px solid var(--lims-success-border);
}

.lims-diff-panel h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lims-diff-panel.is-old h4 {
  color: var(--lims-danger-text);
}

.lims-diff-panel.is-new h4 {
  color: var(--lims-success-text);
}

.lims-json {
  margin: 0;
  padding: 12px;
  overflow: auto;
  border-radius: 7px;
  background: var(--lims-bg-dark-slate);
  color: #dbe7ee;
  font-family: var(--lims-font-mono);
  font-size: 10px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ISO callouts */
.lims-callout-amber,
.lims-callout-blue {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  margin: 14px 0 0;
  padding: 11px 14px;
  border: 1px solid;
  border-radius: var(--lims-radius-md);
  font-size: 11px;
  line-height: 1.55;
}

.lims-callout-amber {
  border-color: var(--lims-warning-border);
  background: var(--lims-warning-bg);
  color: #92400e;
}

.lims-callout-blue {
  border-color: var(--lims-info-border);
  background: var(--lims-info-bg);
  color: #1e40af;
}

.lims-callout-amber i,
.lims-callout-blue i {
  margin-top: 1px;
  font-size: 13px;
}

/* Mini calendar */
.lims-mini-calendar {
  width: 100%;
  max-width: 340px;
  padding: 14px;
  border: 1px solid var(--lims-border);
  border-radius: var(--lims-radius-lg);
  background: var(--lims-bg-surface);
}

.lims-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--lims-text-main);
  font-size: 11px;
  font-weight: 700;
}

.lims-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}

.lims-calendar-grid .weekday {
  padding: 3px 0;
  color: var(--lims-text-muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.lims-calendar-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border-radius: 50%;
  color: var(--lims-text-secondary);
  font-size: 9px;
  font-weight: 600;
}

.lims-calendar-day.day-muted {
  color: #cbd5e1;
}

.lims-calendar-day.day-weekend {
  color: var(--lims-text-muted);
  background: var(--lims-bg-subtle);
}

.lims-calendar-day.day-holiday {
  border: 1px solid var(--lims-danger-border);
  background: var(--lims-danger-bg);
  color: var(--lims-danger-text);
}

.lims-calendar-day.day-active {
  background: var(--lims-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--lims-primary-rgb), 0.24);
}

/* Progress */
.lims-progress {
  height: 6px;
  overflow: hidden;
  border-radius: var(--lims-radius-pill);
  background: var(--lims-bg-subtle);
}

.lims-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--lims-primary);
  transition: width 0.25s ease;
}

.lims-progress-bar.is-amber {
  background: var(--lims-warning-text);
}

.lims-progress-bar.is-blue {
  background: var(--lims-info-text);
}

.lims-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--lims-text-muted);
  font-size: 9px;
}

/* Permission matrix */
.lims-perm-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lims-perm-group {
  overflow: hidden;
  border: 1px solid var(--lims-border);
  border-radius: var(--lims-radius-lg);
  background: var(--lims-bg-surface);
  box-shadow: var(--lims-shadow-card);
}

.lims-perm-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--lims-border);
  background: var(--lims-bg-subtle);
}

.lims-perm-group-title {
  color: var(--lims-text-main);
  font-size: 12px;
  font-weight: 700;
}

.lims-perm-group-count {
  color: var(--lims-text-muted);
  font-family: var(--lims-font-mono);
  font-size: 9px;
}

.lims-perm-select-all {
  padding: 4px 8px;
  border: 1px solid var(--lims-border);
  border-radius: 6px;
  background: var(--lims-bg-surface);
  color: var(--lims-text-secondary);
  font-size: 9px;
  font-weight: 700;
}

.lims-perm-select-all:hover {
  border-color: var(--lims-primary-border);
  background: var(--lims-primary-soft);
  color: var(--lims-primary-dark);
}

.lims-perm-list {
  display: flex;
  flex-direction: column;
}

.lims-perm-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.lims-perm-item:last-child {
  border-bottom: 0;
}

.lims-perm-item:hover {
  background: #fbfdfd;
}

.lims-perm-item .form-check-input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 2px;
}

.lims-perm-item-label {
  color: var(--lims-text-main);
  font-size: 11px;
  font-weight: 700;
}

.lims-perm-item-code {
  display: block;
  margin-top: 2px;
  color: var(--lims-text-muted);
  font-family: var(--lims-font-mono);
  font-size: 9px;
}

.lims-perm-item-desc {
  display: block;
  margin-top: 2px;
  color: var(--lims-text-muted);
  font-size: 10px;
  line-height: 1.45;
}

.lims-perm-actions {
  position: sticky;
  bottom: 16px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--lims-border);
  border-radius: var(--lims-radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--lims-shadow-raised);
  backdrop-filter: blur(8px);
}

@media (max-width: 991.98px) {
  .lims-perm-matrix,
  .lims-diff-grid {
    grid-template-columns: 1fr;
  }

  .lims-dark-banner {
    align-items: flex-start;
  }

  .lims-dark-status {
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 575.98px) {
  .lims-stepper {
    align-items: flex-start;
  }

  .lims-step {
    white-space: normal;
  }

  .lims-step + .lims-step::before {
    display: none;
  }
}
