/* Admin Panel Styles — Anmeldern */

/* Reset & base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body.admin-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
}
a { color: #6c63ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
  width: 220px;
  background: #1a1a2e;
  color: #ccc;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid #2a2a4a;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.3px;
}
.sidebar-header span {
  color: #888;
  font-weight: 400;
  font-size: 12px;
  display: block;
  margin-top: 2px;
}
.admin-sidebar nav { padding: 8px 0; flex: 1; }
.section-label {
  padding: 16px 16px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #555;
}
.admin-sidebar nav a {
  display: block;
  padding: 8px 16px;
  color: #aaa;
  text-decoration: none;
  font-size: 13px;
  border-left: 3px solid transparent;
}
.admin-sidebar nav a:hover {
  background: #2a2a4a;
  color: #fff;
  text-decoration: none;
}
.admin-sidebar nav a.active {
  background: #2a2a4a;
  color: #fff;
  border-left-color: #6c63ff;
}
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid #2a2a4a;
  font-size: 11px;
  color: #555;
  line-height: 1.8;
}
.sidebar-footer a { color: #6c63ff; }

/* Main content */
.admin-main {
  flex: 1;
  padding: 24px 32px;
  overflow-x: auto;
  min-width: 0;
}
.admin-main h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}
.admin-subtitle {
  color: #888;
  font-size: 13px;
  margin-bottom: 24px;
}

/* Flash messages */
.admin-flash {
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 13px;
}
.admin-flash-notice { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.admin-flash-alert { background: #fbe9e7; color: #c62828; border: 1px solid #ffcdd2; }

/* Stat cards */
.stats-grid {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.stat-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px 20px;
  flex: 1;
  min-width: 120px;
}
.stat-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 4px;
}
.stat-card .value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
}

/* Panels */
.panel {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #eee;
}
.panel-header h2 { font-size: 15px; font-weight: 600; }
.panel-actions { display: flex; gap: 8px; align-items: center; }

/* Search */
.admin-search {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  width: 240px;
  font-family: inherit;
}
.admin-search:focus { outline: none; border-color: #6c63ff; }
.admin-filter {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
  font-family: inherit;
}

/* Tables */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left;
  padding: 10px 20px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  border-bottom: 1px solid #eee;
  font-weight: 500;
}
.admin-table td {
  padding: 10px 20px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafafa; }
.admin-table .text-muted { color: #888; }
.admin-table .text-right { text-align: right; }
.admin-table .actions-cell { white-space: nowrap; }
.admin-table .actions-cell a + a { margin-left: 12px; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-blue { background: #e3f2fd; color: #1565c0; }
.badge-amber { background: #fff8e1; color: #f57f17; }
.badge-red { background: #fbe9e7; color: #c62828; }
.badge-gray { background: #f5f5f5; color: #666; }
.badge-purple { background: #ede7f6; color: #6c63ff; }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* Detail view key-value table */
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table td { padding: 10px 20px; font-size: 13px; border-bottom: 1px solid #f5f5f5; }
.detail-table tr:last-child td { border-bottom: none; }
.detail-table .detail-label { color: #888; width: 160px; }

/* Pagination */
.admin-pagination {
  padding: 12px 20px;
  border-top: 1px solid #eee;
  font-size: 12px;
  color: #888;
}
.admin-pagination .series-nav { display: flex; gap: 4px; justify-content: center; }
.admin-pagination .series-nav a {
  padding: 4px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #333;
  text-decoration: none;
  font-size: 12px;
  display: inline-block;
}
.admin-pagination .series-nav a[aria-current="page"] {
  background: #6c63ff;
  color: #fff;
  border-color: #6c63ff;
}
.admin-pagination .series-nav a[aria-disabled="true"] {
  border-color: #eee;
  color: #ccc;
  pointer-events: none;
}
.admin-pagination .series-nav a[role="separator"] {
  border: none;
  padding: 4px 6px;
}
.admin-pagination .series-nav a:hover:not([aria-disabled="true"]) {
  background: #f5f5f5;
  text-decoration: none;
}

/* Forms */
.admin-form { padding: 20px; }
.admin-form .field { margin-bottom: 16px; }
.admin-form label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form textarea,
.admin-form select {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
}
.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
  outline: none;
  border-color: #6c63ff;
}
.admin-form textarea { min-height: 80px; resize: vertical; }
.admin-form .check-field { display: flex; align-items: center; gap: 8px; }
.admin-form .check-field label { display: inline; margin-bottom: 0; text-transform: none; }
.admin-form .form-errors {
  background: #fbe9e7;
  border: 1px solid #ffcdd2;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #c62828;
}
.admin-form .form-errors ul { margin: 4px 0 0 16px; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: #6c63ff; color: #fff; }
.btn-primary:hover { background: #5a52d5; }
.btn-danger { background: #c62828; color: #fff; }
.btn-danger:hover { background: #b71c1c; }
.btn-outline {
  background: transparent;
  border: 1px solid #ddd;
  color: #333;
}
.btn-outline:hover { background: #f5f5f5; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Detail page header */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.detail-header h1 { margin-bottom: 0; }
.detail-header .detail-actions { display: flex; gap: 8px; }

/* Error log */
.error-log {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 12px 16px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 12px;
  font-family: "SF Mono", "Menlo", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Inline delete forms */
.inline-delete { display: inline; }

/* Responsive */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stats-grid { flex-direction: column; }
}
