:root {
  --bg: #030712;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f3f4f6;
  --muted: #9ca3af;
  --blue: #60a5fa;
  --blue-soft: #93c5fd;
  --purple: #c084fc;
  --purple-soft: #d8b4fe;
  --green: #22c55e;
  --yellow: #facc15;
  --red: #ef4444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #111827 0%, #030712 58%, #000 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  padding: 8px;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: var(--blue-soft); }

.page {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 18px 0 28px;
}

.banner {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  margin-bottom: 22px;
}

.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.panel {
  padding: 22px;
  margin-bottom: 18px;
}

.title {
  margin: 0 0 6px;
  color: var(--blue-soft);
  font-size: 1.35rem;
  font-weight: 600;
}

.subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

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

.field { margin-bottom: 14px; }

label, .label {
  display: block;
  margin-bottom: 7px;
  color: #d1d5db;
  font-size: 0.88rem;
  font-weight: 600;
}

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: rgba(3, 7, 18, 0.62);
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(96, 165, 250, 0.8);
  background: rgba(3, 7, 18, 0.84);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.14);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 16px;
}

button, input[type="button"], input[type="submit"] {
  width: auto;
  border: 1px solid rgba(96, 165, 250, 0.32);
  background: rgba(96, 165, 250, 0.14);
  color: #dbeafe;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

button:hover, input[type="button"]:hover, input[type="submit"]:hover {
  background: rgba(96, 165, 250, 0.24);
  border-color: rgba(96, 165, 250, 0.58);
}

.secondary {
  border-color: rgba(192, 132, 252, 0.32) !important;
  background: rgba(192, 132, 252, 0.13) !important;
  color: #f3e8ff !important;
}

.secondary:hover {
  border-color: rgba(192, 132, 252, 0.58) !important;
  background: rgba(192, 132, 252, 0.23) !important;
}

.danger {
  border-color: rgba(239, 68, 68, 0.34) !important;
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fecaca !important;
}

.result-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.daily {
  margin-top: 8px;
  padding: 18px;
  background: var(--panel-strong);
  border-radius: 14px;
  border: 1px solid var(--border);
}

#rahmenloserText {
  color: #d1d5db;
  font-size: 0.92rem;
  margin: 8px 0 10px;
}

.fortschrittsbalken-container {
  display: flex;
  width: 100%;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.fortschritt { height: 100%; }
#gruen { background-color: var(--green); }
#gelb { background-color: var(--yellow); }
#rot { background-color: var(--red); }
#weiss { background-color: transparent; flex-grow: 1; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer {
  color: #6b7280;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.5;
}

.coach {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--purple);
}

.external-logo {
  display: inline-block;
  margin-top: 14px;
  opacity: 0.86;
}

.external-logo img {
  max-width: 130px;
  height: auto;
}

.content-panel {
  color: #d1d5db;
  line-height: 1.6;
}

.content-panel h1, .content-panel h2, .content-panel strong { color: #f3f4f6; }
.content-panel p { margin-top: 0; }

@media (max-width: 640px) {
  body { padding: 8px; }
  .panel { padding: 18px; }
  .grid, .result-row { grid-template-columns: 1fr; }
  .actions input[type="button"], .actions input[type="submit"] { flex: 1 1 140px; }
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(3, 7, 18, 0.34);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th, td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
  color: #d1d5db;
}

th {
  color: #f3f4f6;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
}

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

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #d1d5db;
}

.list li:last-child { border-bottom: 0; }

.notice {
  padding: 12px 14px;
  margin: 0 0 16px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 12px;
  background: rgba(96, 165, 250, 0.1);
  color: #dbeafe;
}

.empty {
  color: var(--muted);
  margin: 0;
}

.action-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  white-space: nowrap;
}

.action-links .delete { color: #fca5a5; }
.action-links .delete:hover { color: #fecaca; }

.page-wide { width: min(100%, 1120px); }

.glyx-link {
  border-bottom: 1px dotted rgba(96, 165, 250, 0.55);
  cursor: pointer;
}

.glyx-link.saved {
  color: #86efac;
  border-bottom-color: rgba(134, 239, 172, 0.7);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
}

.modal-backdrop.open { display: flex; }

.modal {
  width: min(100%, 560px);
  max-height: min(90vh, 760px);
  overflow: auto;
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
  padding: 22px;
}

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

.modal-header h2 {
  margin: 0;
  color: var(--blue-soft);
  font-size: 1.25rem;
}

.icon-button {
  width: 38px !important;
  height: 38px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
}

.modal .actions { margin-bottom: 0; }

.source-line {
  word-break: break-word;
  color: var(--muted);
  font-size: 0.86rem;
}
