:root {
  --bg: #111214;
  --surface: #181a1f;
  --card: #1d2026;
  --border: #313644;
  --text: #f0f2f5;
  --muted: #a3abb8;
  --accent: #d2a526;
  --accent-hover: #e0b63a;
  --danger: #c94a4a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: #111214;
  color: var(--text);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem;
}

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

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

.header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-end;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  margin: 1rem 0;
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--accent);
}

.muted,
.muted-small {
  color: var(--muted);
}

.muted {
  margin: 0 0 0.8rem;
  font-size: 0.88rem;
}

.muted-small {
  font-size: 0.78rem;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 170px;
  flex: 1 1 170px;
}

.field-group label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row select {
  min-width: 150px;
  width: 100%;
  padding: 0.58rem 0.72rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #121419;
  color: var(--text);
  font-size: 0.92rem;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 0.56rem 0.82rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-primary,
.btn-accent {
  background: var(--accent);
  color: #151515;
}

.btn-primary:hover,
.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 0.36rem 0.62rem;
  font-size: 0.82rem;
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 0;
  padding-bottom: 0.25rem;
}

.section-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.7rem 0.95rem;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
}

.section-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #151515;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

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

.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

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

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

.table th,
.table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

.table tr.is-selected td {
  background: rgba(210, 165, 38, 0.12);
}

.chk-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

#anlageEditHint,
#anlagenFilterInfo,
#anlageTagHint {
  margin-bottom: 0.7rem;
}

.chk-group label,
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  font-size: 0.9rem;
}

.inline-check input {
  margin: 0;
}

.pill {
  display: inline-block;
  padding: 0.18rem 0.46rem;
  border-radius: 999px;
  background: #14161b;
  border: 1px solid var(--border);
  font-size: 0.78rem;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.status-msg {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.status-msg.ok {
  color: #7ad68d;
}

.status-msg.err {
  color: #ff8f8f;
}

.enroll-output {
  margin-bottom: 0.6rem;
  padding: 0.8rem;
  min-height: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #14161b;
  font-size: 0.9rem;
  line-height: 1.5;
}

.enroll-output code {
  word-break: break-all;
}

#remoteAssignmentCard {
  margin-top: 1rem;
  background: #17191e;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .header-top {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-box {
    align-items: stretch;
  }

  .table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 0.75rem;
  }

  .form-row input[type="text"],
  .form-row input[type="email"],
  .form-row input[type="password"],
  .form-row select,
  .btn {
    width: 100%;
  }

  .section-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.4rem;
  }

  .section-tab {
    white-space: nowrap;
  }

  .list li {
    flex-direction: column;
    align-items: flex-start;
  }
}
