* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f6f8;
  color: #1a1d23;
  min-height: 100vh;
  /* iPhone Safe-Area: nichts darf hinter Notch/Dynamic Island/Statusleiste liegen */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

@media (prefers-color-scheme: dark) {
  body { background: #14161a; color: #e7e9ec; }
  .card { background: #1e2126 !important; border-color: #2c3038 !important; }
  input, select { background: #14161a !important; color: #e7e9ec !important; border-color: #2c3038 !important; }
  .muted { color: #9aa2ad !important; }
}

.topbar {
  position: sticky;
  top: 0;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  margin-top: calc(env(safe-area-inset-top) * -1);
  background: #14213d;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.topbar a { color: white; text-decoration: none; font-size: 14px; opacity: 0.85; }

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: white;
  border: 1px solid #e2e5ea;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 8px; }

label {
  display: block;
  font-size: 13px;
  margin: 12px 0 4px;
  font-weight: 600;
}

input, select {
  width: 100%;
  padding: 12px;
  font-size: 16px; /* verhindert Zoom beim Fokussieren auf iOS */
  border: 1px solid #cfd4dc;
  border-radius: 8px;
}

button {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: #14213d;
  color: white;
  margin-top: 16px;
  cursor: pointer;
}

button.secondary {
  background: transparent;
  color: #14213d;
  border: 1px solid #14213d;
}

button.small {
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
  margin-top: 0;
}

.error { color: #b3261e; font-size: 14px; margin-top: 8px; }
.muted { color: #6b7280; font-size: 13px; }

.deal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #eef0f3;
  text-decoration: none;
  color: inherit;
}
.deal-row:last-child { border-bottom: none; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 4px; border-bottom: 1px solid #eef0f3; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.pending { background: #fef3c7; color: #92400e; }
