:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6fa;
  color: #1f2937;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f5f6fa;
}

.shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.app-header {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-bottom: 22px;
  background: #5779a9;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.app-header-inner {
  width: min(1240px, calc(100vw - 32px));
  min-height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.app-header h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 800;
}

.app-header p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
}

.app-kicker {
  margin: 0 0 4px !important;
  font-size: 12px !important;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-header a,
.link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.panel {
  margin-bottom: 18px;
  background: #ffffff;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  padding: 22px 24px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.login {
  width: min(460px, 100%);
  margin: 12vh auto 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0 0 14px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
  font-weight: 800;
}

.subhead {
  margin-top: 20px;
}

.muted,
.sub {
  color: #526277;
}

.sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
}

.error {
  color: #b91c1c;
  font-weight: 700;
}

.form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 5px;
  color: #344256;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 10px;
  background: #ffffff;
  color: #1f2937;
  font: inherit;
}

input,
select {
  height: 38px;
}

select[multiple] {
  height: auto;
  min-height: 96px;
  padding: 6px 10px;
}

textarea {
  min-height: 88px;
  padding-top: 9px;
  resize: vertical;
}

input:disabled,
select:disabled {
  background: #eef2f7;
  color: #475569;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: #004aad;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: #003b8e;
}

button.secondary {
  background: #e8eef6;
  color: #23415f;
}

button.secondary:hover {
  background: #dce6f2;
}

button.danger {
  background: #b91c1c;
}

button.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

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

.section-head h2 {
  margin-bottom: 0;
}

.filters,
.inline-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

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

.process-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.wide {
  grid-column: 1 / -1;
}

.check {
  min-height: 38px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-top: 20px;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5ebf3;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.tag,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.2rem 0.6rem;
  background: #e8eef6;
  color: #23415f;
  font-size: 0.75rem;
  font-weight: 700;
}

.tag {
  margin-left: 6px;
}

.notice {
  min-height: 22px;
  color: #475569;
  font-weight: 700;
}

.notice.success {
  color: #166534;
}

.notice.error {
  color: #b91c1c;
}

.notice.strong {
  padding: 10px 12px;
  border-radius: 6px;
  background: #ecfdf5;
}

.base-g2-feedback {
  margin-top: 14px;
  color: #475569;
  font-size: 13px;
}

.base-g2-feedback.error {
  color: #b91c1c;
}

.hidden {
  display: none !important;
}

.modal-open {
  overflow: hidden;
}

.sispa-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.48);
}

.sispa-modal-card {
  width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.28);
  padding: 24px;
}

.sispa-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.sispa-modal-head h3 {
  margin: 0;
  color: #334155;
  font-size: 19px;
  font-weight: 800;
}

.modal-close {
  width: 34px;
  min-height: 34px;
  padding: 0;
  background: transparent;
  color: #64748b;
  font-size: 28px;
  line-height: 1;
}

.modal-close:hover {
  background: #f1f5f9;
  color: #334155;
}

.sispa-modal-text {
  margin: 0 0 12px;
  color: #334155;
  font-size: 14px;
}

.sispa-modal-list {
  max-height: 390px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.process-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 12px;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #f8fafc;
}

.process-option-main {
  display: grid;
  gap: 3px;
  color: #334155;
  font-size: 14px;
}

.process-option-main strong {
  color: #1f2937;
}

.process-option .status-pill {
  margin-left: 6px;
}

.status-pill.base-g2 {
  background: #dbeafe;
  color: #1e40af;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.sispa-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .filters,
  .inline-form,
  .process-form {
    grid-template-columns: 1fr;
  }

  .app-header-inner,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .process-option {
    grid-template-columns: 1fr;
  }
}
