:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:rgba(15,23,42,.12);
  --ring:rgba(59,130,246,.28);
  --brand:#2563eb;
  --brand2:#22c55e;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:underline; }

.wrap{
  max-width: 980px;
  margin: 0 auto;
  padding: 20px;
}

/* Topbar */
.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:750;
  letter-spacing:.2px;
}
.brand .dot{
  width:10px;height:10px;border-radius:999px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}
.nav a{
  display:inline-flex;
  align-items:center;
  padding:8px 10px;
  border-radius:10px;
  color: var(--muted);
}
.nav a:hover{
  background: rgba(15,23,42,.05);
  color: var(--text);
  text-decoration:none;
}

/* Center page */
.center-page{
  min-height: calc(100vh - 74px);
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding-top: 56px;
}

.card{
  width:100%;
  max-width: 520px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15,23,42,.12);
  overflow:hidden;
}
.card-header{ padding: 20px 22px 10px 22px; }
.card-title{
  margin:0;
  font-size: 28px;
  letter-spacing: .2px;
}
.card-subtitle{
  margin: 6px 0 0 0;
  color: var(--muted);
  font-size: 14px;
}
.card-body{ padding: 16px 22px 22px 22px; }

.form-row{ margin-top: 14px; }
label{
  display:block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
input{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.14);
  background: #fff;
  color: var(--text);
  font-size: 16px;
  outline: none;
}
input:focus{
  border-color: rgba(37,99,235,.60);
  box-shadow: 0 0 0 4px var(--ring);
}

select{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.14);
  background: #fff;
  color: var(--text);
  font-size: 16px;
  outline: none;
}
select:focus{
  border-color: rgba(37,99,235,.60);
  box-shadow: 0 0 0 4px var(--ring);
}

button{
  appearance:none;
  border: 0;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--brand), #1d4ed8);
  box-shadow: 0 10px 25px rgba(37,99,235,.22);
}
button:hover{ filter: brightness(1.03); }
button:active{ transform: translateY(1px); }

.small{
  font-size: 13px;
  color: var(--muted);
}

.alert{
  background: rgba(239,68,68,.10);
  border: 1px solid rgba(239,68,68,.25);
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 12px;
}

.notice{
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.22);
  color: #065f46;
  padding: 10px 12px;
  border-radius: 12px;
}

/* spacing helpers */
.stack > * + * { margin-top: 12px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

.btn-row{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items:center;
}

@media (max-width: 520px){
  .center-page{ padding-top: 28px; }
  .card-title{ font-size: 24px; }
}

/* Responsive Tabellen */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
}

/* Standard Tabelle */
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px; /* sorgt dafür, dass Desktop sauber bleibt */
}

.table th, .table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: left;
  white-space: nowrap;
}

.table th {
  font-weight: 700;
  color: var(--muted);
  font-size: 13px;
}

/* Mobile: Tabelle wird zu Cards */
@media (max-width: 760px) {
  .table { min-width: 0; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }

  .table tr {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin: 12px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,.06);
    overflow: hidden;
  }

  .table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    white-space: normal;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
  }

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

  .table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    flex: 0 0 auto;
  }
}

.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

/* Desktop Nav */
.nav{
  display:flex;
  align-items:center;
  gap:18px;
}
.nav a{
  text-decoration:none;
  color:var(--text);
  padding:8px 10px;
  border-radius:10px;
}
.nav a:hover{
  background:rgba(0,0,0,.05);
}
.nav a.danger{
  color:#b42318;
}

/* Burger Button */
.nav-toggle{
  display:none;
  border:1px solid var(--border);
  background:var(--card);
  color:#235de5 !important;
  border-radius:12px;
  padding:8px 12px;
  font-size:18px;
  line-height:1;
  box-shadow:none !important;
}

/* Mobile */
@media (max-width: 760px){
  .nav-toggle{ display:block; }

  .nav{
    display:none;              /* default zu */
    position:absolute;
    right:14px;
    top:62px;
    z-index:50;
    flex-direction:column;
    gap:6px;
    padding:10px;
    min-width:220px;
    background:var(--card);
    border:1px solid var(--border);
    border-radius:14px;
  }
  .nav a{
    width:100%;
    padding:10px 12px;
  }
  .nav.is-open{ display:flex; }
}

.btn-copy{
  margin-left:10px;
  padding:6px 10px;
  border:1px solid var(--border);
  background:#235de5 !important;
  border-radius:10px;
  cursor:pointer;
  font-size:13px;
  box-shadow:none !important;
}
.btn-copy:hover{ background:rgba(0,0,0,.05); }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }