:root {
  color-scheme: light;
  font-family: 'Inter', system-ui, -apple-system, blinkmacsystemfont, 'Segoe UI',
    sans-serif;
  background-color: #f5f6fa;
  color: #111;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

.page-header {
  display: flex;
  justify-content: space-between;
  padding: 2.5rem;
  gap: 1rem;
  align-items: center;
}

.page-header h1 {
  margin: 0.3rem 0 0;
  font-size: 2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: #64748b;
  margin: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.user-name {
  font-weight: 600;
  margin: 0;
}

.user-email {
  margin: 0;
  color: #64748b;
  font-size: 0.875rem;
}

.tabs {
  display: flex;
  gap: 0.75rem;
  padding: 0 2.5rem;
  flex-wrap: wrap;
}

.tab-button {
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  background-color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #1f2937;
}

.tab-button[aria-selected='true'],
.tab-button:hover {
  background-color: #475569;
  color: white;
}

.tab-button-admin {
  position: relative;
  padding-right: 2rem;
}

.tab-button .tab-icon {
  margin-left: 0.35rem;
  font-size: 0.9rem;
}

.stack-between {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

main {
  padding: 1rem 2.5rem 3rem;
}

.tab-panel {
  display: none;
  background: white;
  padding: 2rem;
  border-radius: 1.25rem;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.08);
  margin-top: 1.5rem;
}

.tab-panel[data-active='true'] {
  display: block;
}

.subtabs {
  display: inline-flex;
  gap: 0.5rem;
  background: #f1f5f9;
  padding: 0.35rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.subtab-button {
  border: none;
  background: transparent;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}

.subtab-button[aria-selected='true'] {
  background: white;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.subtab-button[data-badge]::after {
  content: attr(data-badge);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  background: #ef4444;
  color: white;
  border-radius: 999px;
  min-width: 1.4rem;
  height: 1.4rem;
  margin-left: 0.4rem;
  padding: 0 0.25rem;
}

.subtab-panel {
  display: none;
}

.subtab-panel[data-active='true'] {
  display: block;
}

.alert {
  border-radius: 0.75rem;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert.error {
  background: #fee2e2;
  color: #b91c1c;
}

.alert.success {
  background: #dcfce7;
  color: #15803d;
}

.alert.warning {
  background: #fef9c3;
  color: #854d0e;
}

.form-intro {
  margin-bottom: 1rem;
}

.form-intro h3 {
  margin: 0.2rem 0;
}

.config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.table-actions {
  margin-top: 1rem;
}

.stacked {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.placeholder-card {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  margin: 1.5rem 0;
}

.request-form {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.supplier-form {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.emphasis {
  color: #0f172a;
  font-weight: 600;
}

.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.card.accent {
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
  color: #0b1727;
  border-color: transparent;
}

.card.accent .eyebrow,
.card.accent .small-muted,
.card.accent h4,
.card.accent label span {
  color: #0b1727;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-header h4,
.section-header h5 {
  margin: 0.1rem 0;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
}

.section-grid {
  margin-bottom: 1.5rem;
}

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

.pill-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.pill-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  font-weight: 600;
}

.pill-checkbox input {
  accent-color: #0f172a;
}

.contract-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
}

.contract-block {
  border: 1px dashed #cbd5f5;
  border-radius: 1rem;
  padding: 1rem;
  background: #f8fafc;
}

.contract-block h5 {
  margin: 0;
}

.contract-versions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.contract-version {
  padding: 0.75rem;
  border-radius: 0.85rem;
  background: white;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.risk-history {
  margin-top: 1rem;
}

.risk-history h5 {
  margin: 0;
}

.requests-table.compact th,
.requests-table.compact td {
  padding: 0.6rem;
  font-size: 0.9rem;
}

.risk-note-editor {
  margin-top: 0.75rem;
}

.risk-history .stack-between {
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.risk-history .table-scroll {
  margin-top: 0.5rem;
  max-height: 260px;
  overflow-y: auto;
}

.risk-note-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-start;
}

[data-isb-only][disabled] {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.field-grid.isb-grid label span {
  display: block;
  min-height: 1.4rem;
  line-height: 1.25;
}

.supplier-contracts-preview {
  margin-top: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
}

.supplier-contracts-preview h5 {
  margin: 0 0 0.25rem 0;
}

.badge.status-hoch {
  background: #fee2e2;
  color: #b91c1c;
}

.badge.status-mittel {
  background: #fef9c3;
  color: #854d0e;
}

.badge.status-niedrig {
  background: #dcfce7;
  color: #15803d;
}

.badge.status-none {
  background: #e2e8f0;
  color: #475569;
}

.button-group {
  display: inline-flex;
  gap: 1.75rem;
  align-items: center;
}

.button-group .danger {
  margin-left: 1rem;
}

.button-group > .button + .button {
  margin-left: 0.75rem;
}

.supplier-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.supplier-actions .button {
  display: block !important;
  width: 100%;
  text-align: left;
  margin: 0;
}

.supplier-actions .button + .button {
  margin-top: 0.4rem;
}

.form-intro {
  margin-bottom: 1rem;
}

.form-intro h3 {
  margin: 0.2rem 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.field-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 500;
}

.field-grid input,
.field-grid select {
  border-radius: 0.65rem;
  border: 1px solid #cbd5f5;
  padding: 0.7rem 0.85rem;
  font-size: 1rem;
}

.field-grid[data-hidden] {
  display: none;
}

.field-grid.single-column {
  grid-template-columns: 1fr;
}

input[readonly] {
  background: #f8fafc;
  color: #475569;
}

.table-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.table-scroll {
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: white;
}

[data-services-table][data-readonly='true'] {
  background: #f8fafc;
  opacity: 0.85;
}

.services-table,
.requests-table {
  width: 100%;
  border-collapse: collapse;
}

.services-table th,
.services-table td,
.requests-table th,
.requests-table td {
  padding: 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}

.services-table th,
.requests-table th {
  text-align: left;
  background: #f8fafc;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.service-checkbox {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-weight: 600;
}

.service-checkbox input {
  width: 1rem;
  height: 1rem;
}

[data-service-row] select,
[data-service-row] input[type='text'] {
  width: 100%;
  border-radius: 0.6rem;
  border: 1px solid #cbd5f5;
  padding: 0.65rem;
}

.services-table input[type='text'] {
  width: 100%;
  border-radius: 0.6rem;
  border: 1px solid #cbd5f5;
  padding: 0.65rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.requests-section {
  margin-top: 2rem;
}

.requests-section header h3 {
  margin: 0;
}

.empty-hint {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px dashed #cbd5f5;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge.status-open {
  background: #fef9c3;
  color: #854d0e;
}

.badge.status-in_progress {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge.status-completed {
  background: #dcfce7;
  color: #15803d;
}

.badge.action-add {
  background: #dcfce7;
  color: #15803d;
}

.badge.action-update {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge.action-remove {
  background: #fee2e2;
  color: #b91c1c;
}

.small-muted {
  color: #64748b;
  font-size: 0.85rem;
}

.button.small {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

.button.danger {
  border-color: #ef4444;
  color: #b91c1c;
}

.next-steps {
  color: #475569;
  font-size: 0.95rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.6rem 1.25rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.button.primary {
  background-color: #4b5563;
  color: white;
}

.button.ghost {
  background-color: transparent;
  border: 1px solid rgba(15, 23, 42, 0.2);
  color: #0f172a;
}

.button:hover {
  opacity: 0.9;
}

.status-bar {
  position: sticky;
  bottom: 0;
  width: 100%;
  padding: 0.75rem 2.5rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: center;
  z-index: 10;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background: radial-gradient(circle at top, #cbd5f5, transparent),
    #f5f6fa;
}

.login-card {
  max-width: 420px;
  width: 100%;
  background: white;
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.15);
}

.login-card h1 {
  margin-top: 0.5rem;
}

.small-print {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 1.5rem;
}

.detail-body {
  background: #f5f6fa;
  min-height: 100vh;
  padding: 2rem;
}

.detail-card {
  max-width: 1000px;
  margin: 0 auto;
  background: white;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.12);
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  color: #475569;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.detail-meta dt {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  color: #94a3b8;
}

.detail-meta dd {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
}

.detail-section {
  margin-top: 2rem;
}

.services-table td.center {
  text-align: center;
}

.service-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.service-modal-backdrop[hidden] {
  display: none !important;
}

.service-modal {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  width: min(480px, 90vw);
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.15);
}

.form-actions.spaced {
  justify-content: space-between;
  gap: 0.75rem;
}

.config-section ul {
  padding-left: 1.25rem;
}

.config-section li {
  margin-bottom: 0.5rem;
}

code {
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  background-color: #e2e8f0;
  padding: 0.2rem 0.35rem;
  border-radius: 0.35rem;
  font-size: 0.85em;
}

.requests-table code.event-type-selftest {
  background-color: #dcfce7;
  color: #166534;
  font-weight: 600;
}

.requests-table code.event-type-virus {
  background-color: #fee2e2;
  color: #b91c1c;
  font-weight: 600;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #0f172a;
}

.chip-success {
  background: #dcfce7;
  color: #166534;
}

.chip-muted {
  background: #e2e8f0;
  color: #475569;
}

.config-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.config-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.config-card + .config-card {
  margin-top: 0;
}

.token-result {
  margin-top: 0.75rem;
}

.token-modal-body code {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 1rem;
  word-break: break-all;
}

.token-display {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.token-form {
  margin-bottom: 1.25rem;
}

.table-actions {
  margin-bottom: 0.5rem;
}

.token-form-inline {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.token-label-inline {
  flex: 1 1 260px;
  max-width: 360px;
}

.token-copy-button {
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  margin-left: auto;
}

.inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.event-status {
  margin-top: 0.25rem;
  display: inline-block;
}

.button.icon-only {
  padding: 0.4rem 0.6rem;
  border-radius: 0.6rem;
}

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 0;
  }

  .user-info {
    width: 100%;
    justify-content: space-between;
  }

  .tabs {
    flex-wrap: wrap;
    padding: 1.5rem;
  }

  main {
    padding: 1rem;
  }

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