:root {
  --bg: #f3f4f6;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --primary: #111827;
  --primary-text: #ffffff;
  --muted: #6b7280;
  --success: #16a34a;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.08);
  --shadow-light: 0 4px 10px rgba(15, 23, 42, 0.05);
  --gap: 16px;
  --transition-fast: 0.15s ease-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top left, #e5e7eb, #f3f4f6);
  color: #111827;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(248, 250, 252, 0.85);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

/* Tabs */

.nav-tabs {
  display: flex;
  gap: 6px;
  background: #e5e7eb;
  padding: 3px;
  border-radius: 999px;
}

.nav-tab {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  color: #111827;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.nav-tab--active {
  background: #111827;
  color: #f9fafb;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.25);
  transform: translateY(-1px);
}

/* Main Layout */

.app-main {
  flex: 1;
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.view-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 4px 0 16px 0;
}

/* Cards */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.card--compact {
  max-width: 480px;
  margin: 0 auto;
}

.card--detail {
  min-height: 260px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.card-footer {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

/* Buttons */

button {
  font-family: inherit;
}

.primary-button,
.secondary-button,
.link-button,
.success-button {
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.primary-button {
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: var(--shadow-light);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.2);
}

.secondary-button {
  background: #f9fafb;
  color: #111827;
  border-color: var(--border);
}

.secondary-button:hover {
  background: #e5e7eb;
}

.link-button {
  background: transparent;
  color: var(--muted);
  padding: 0;
  border: none;
  text-decoration: underline;
}

.link-button:hover {
  color: #111827;
}

.success-button {
  background: var(--success);
  color: #f9fafb;
  border-color: transparent;
}

.success-button:hover {
  background: #15803d;
}

/* Layout Spalten */

.layout-two-columns {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.column {
  width: 100%;
}

.column--sidebar {
  flex: 0 0 100%;
}

.column--content {
  flex: 1;
}

@media (min-width: 768px) {
  .layout-two-columns {
    flex-direction: row;
  }
  .column--sidebar {
    flex: 0 0 32%;
  }
  .column--content {
    flex: 1;
  }
}

/* Todo Liste */

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.todo-list--compact {
  max-height: none;
}

.todo-item {
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    transform var(--transition-fast);
}

.todo-item:hover {
  background: #f9fafb;
  border-color: var(--border);
  transform: translateY(-1px);
}

.todo-item--active {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

.todo-title {
  font-size: 0.9rem;
  font-weight: 500;
}

.todo-meta {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
}

.todo-item--active .todo-meta {
  color: #e5e7eb;
}

/* Detail */

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.detail-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.detail-meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
}

.detail-body {
  margin-top: 12px;
}

.detail-text {
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.detail-subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  margin: 14px 0 6px 0;
}

.image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.image-grid img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.image-grid img:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.2);
}

/* Form */

.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field label {
  font-size: 0.8rem;
  color: var(--muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 6px 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #f9fafb;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #111827;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.form-error {
  color: #b91c1c;
  font-size: 0.8rem;
  min-height: 1em;
}

/* Sonstiges */

.muted {
  font-size: 0.85rem;
  color: var(--muted);
}

.hidden {
  display: none;
}

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  background: #111827;
  color: #f9fafb;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.4);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.toast--visible {
  opacity: 1;
  transform: translate(-50%, -4px);
  pointer-events: auto;
}
