* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #020617;
  --bg-card: #0b1220;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-strong: #2563eb;
  --border-subtle: rgba(148, 163, 184, 0.35);
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #ef4444;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.9);
  --radius-lg: 18px;
  --radius-xl: 22px;
}

/* Grundlayout */

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1e293b 0, #020617 45%);
  color: var(--text-main);
  min-height: 100vh;
}

/* Status / Hinweise */

.status,
.status-bar {
  min-height: 1.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Buttons */

button {
  font: inherit;
  cursor: pointer;
}

.btn {
  border-radius: 999px;
  border: none;
  padding: 0.6rem 1.2rem;
  font-weight: 500;
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
  transition: transform 0.08s ease, box-shadow 0.08s ease,
    background 0.15s ease;
}

.btn:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.5);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(15, 23, 42, 0.9);
}

.btn-danger {
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.8);
  color: #fecaca;
  box-shadow: none;
}

.btn-danger:hover {
  background: rgba(127, 29, 29, 0.8);
}

.btn-small {
  padding: 0.25rem 0.8rem;
  font-size: 0.75rem;
}

.btn-icon {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.98);
  color: var(--text-muted);
  padding: 0.25rem 0.45rem;
  font-size: 0.8rem;
}

.btn-icon:hover {
  background: rgba(30, 64, 175, 0.7);
  color: white;
}

/* Inputs */

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.94);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: border 0.12s ease, box-shadow 0.12s ease,
    background 0.12s ease;
}

input::placeholder {
  color: var(--text-muted);
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.5);
  background: rgba(15, 23, 42, 1);
}

label {
  display: block;
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.form-row {
  margin-bottom: 0.9rem;
}

/* Links */

a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
}

a:hover {
  text-decoration: underline;
}

/* ---------------------------------- */
/* Auth-Seiten (index.html / reset)   */
/* ---------------------------------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.6rem;
}

.auth-card {
  background: linear-gradient(145deg, #020617 0%, #020617 50%, #020617 100%);
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
  padding: 1.8rem 1.6rem 1.7rem;
  max-width: 430px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.15);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(
    circle at top,
    rgba(59, 130, 246, 0.12),
    transparent 55%
  );
  opacity: 0.7;
  pointer-events: none;
}

.auth-card-inner {
  position: relative;
  z-index: 1;
}

.app-title {
  font-size: 1.4rem;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.app-subtitle {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.app-subtitle span {
  color: var(--accent);
}

/* Tabs */

.tab-switch {
  display: inline-flex;
  margin-top: 1.2rem;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 999px;
  padding: 0.15rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.tab-button {
  border: none;
  background: transparent;
  padding: 0.4rem 0.95rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: 999px;
  transition: background 0.12s ease, color 0.12s ease;
}

.tab-button.active {
  background: var(--accent);
  color: white;
}

.forms-wrapper {
  margin-top: 1rem;
}

.form {
  display: none;
  margin-top: 0.5rem;
}

.form.active {
  display: block;
}

.form-footer {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------------------------------- */
/* App-Shell (groups.html)            */
/* ---------------------------------- */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header mit Icon links */

.app-header {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: radial-gradient(circle at top left, #0b1120, #020617 60%);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
}

.app-header-left {
  display: flex;
  align-items: center;
}

.app-header-middle {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.app-header-middle h1 {
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.app-header-middle span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.12rem;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.app-header-email {
  max-width: 150px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Sidebar-Button */

.sidebar-toggle {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
}

/* Main Layout */

.app-main {
  flex: 1;
  padding: 0.9rem 1.2rem 1.3rem;
}

.app-main-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1rem;
}

/* Panels */

.promo-panel {
  margin-top: 1rem;
}

.promo-panel h2 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.promo-panel p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  max-width: 520px;
}


.panel {
  background: rgba(15, 23, 42, 0.97);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.9);
  padding: 0.9rem 0.9rem 0.9rem;
}

.panel h2 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

/* Sidebar */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-section-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.group-list {
  font-size: 0.85rem;
}

.group-list ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.group-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  background: rgba(15, 23, 42, 0.98);
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  padding: 0.4rem 0.45rem 0.4rem 0.75rem;
}

.group-list-name {
  display: flex;
  flex-direction: column;
  margin-right: 0.4rem;
}

.group-list-name span:first-child {
  font-weight: 500;
}

.group-list-name span:last-child {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.group-list-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  margin-top: 0.2rem;
}

.btn-danger.btn-small {
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
}

/* Sidebar-Karten */

.sidebar-card {
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.sidebar-card h3 {
  font-size: 0.86rem;
  margin-bottom: 0.3rem;
}

.sidebar-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* Detailpanel */

.detail-panel-header {
  margin-bottom: 0.6rem;
}

.detail-panel-header h2 {
  margin-bottom: 0.15rem;
}

.detail-panel-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.card {
  padding: 0.75rem 0.8rem;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Meine Fehlstunden */

.my-hours {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.my-hours-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.my-hours-value {
  font-size: 1rem;
  font-weight: 550;
}

/* Mitglieder-Tabelle */

.members-table-container {
  margin-top: 0.4rem;
  max-height: 320px;
  overflow: auto;
}

.members-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.members-table thead {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 1);
  z-index: 1;
}

.members-table th,
.members-table td {
  padding: 0.4rem 0.3rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.8);
}

.members-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
}

.members-table tr:last-child td {
  border-bottom: none;
}

.members-table input[type="text"],
.members-table input[type="number"] {
  font-size: 0.76rem;
  padding: 0.3rem 0.5rem;
}

/* Verlauf */

.history-list {
  margin-top: 0.4rem;
  list-style: none;
  max-height: 200px;
  overflow: auto;
  font-size: 0.8rem;
}

.history-list li + li {
  margin-top: 0.25rem;
}

/* Overlay für mobile Sidebar */

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  z-index: 20;
}

body.sidebar-open .sidebar-backdrop {
  display: block;
}

/* Mobile */

@media (max-width: 850px) {
  .app-main-layout {
    grid-template-columns: 1fr;
  }

  .panel.sidebar {
    position: fixed;
    inset: 0 40% 0 0;
    max-width: 260px;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.15s ease;
  }

  body.sidebar-open .panel.sidebar {
    transform: translateX(0);
  }

  .group-list-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
