/* ─── Chäsi Eschenbach Admin ─── */

:root {
  --forest: #2d5016;
  --forest-light: #3d6b1f;
  --amber: #b8860b;
  --amber-light: #d4a017;
  --creme: #faf8f5;
  --leinen: #f0ece4;
  --anthrazit: #2c2c2c;
  --stein: #6b6b6b;
  --white: #ffffff;
  --red: #dc2626;
  --red-light: #fef2f2;
  --green: #16a34a;
  --green-light: #f0fdf4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--creme);
  color: var(--anthrazit);
  line-height: 1.6;
}

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

.sidebar {
  width: 260px;
  background: var(--forest);
  color: white;
  padding: 1.5rem 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 40;
}

.sidebar-logo {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 1rem;
}

.sidebar-logo h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.sidebar-logo p {
  font-size: 0.8rem;
  opacity: 0.6;
}

.sidebar nav { padding: 0.5rem 0; }

.sidebar a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.2s;
}

.sidebar a:hover,
.sidebar a.active {
  background: rgba(255,255,255,0.12);
  color: white;
}

.sidebar a .icon { font-size: 1.25rem; width: 1.5rem; text-align: center; }

.sidebar-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.sidebar-bottom a {
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 2rem 2.5rem;
  min-height: 100vh;
}

/* ─── Page Header ─── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 1.75rem;
  font-weight: 600;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--forest);
  color: white;
}

.btn-primary:hover { background: var(--forest-light); }

.btn-amber {
  background: var(--amber);
  color: white;
}

.btn-amber:hover { background: var(--amber-light); }

.btn-outline {
  background: transparent;
  border: 2px solid var(--forest);
  color: var(--forest);
}

.btn-outline:hover { background: var(--forest); color: white; }

.btn-danger {
  background: var(--red);
  color: white;
}

.btn-danger:hover { background: #b91c1c; }

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* ─── Cards ─── */
.card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  text-align: center;
}

.stat-card .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--forest);
}

.stat-card .stat-label {
  font-size: 0.9rem;
  color: var(--stein);
  margin-top: 0.25rem;
}

/* ─── Quick Actions ─── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: white;
  border-radius: 0.75rem;
  text-decoration: none;
  color: var(--anthrazit);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: all 0.2s;
  font-size: 1rem;
  font-weight: 500;
}

.quick-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.quick-action .icon { font-size: 2rem; }

/* ─── Table ─── */
.table-wrap {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

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

th {
  text-align: left;
  padding: 1rem 1.25rem;
  background: var(--leinen);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--stein);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--leinen);
  font-size: 0.95rem;
}

tr:hover td { background: rgba(0,0,0,0.01); }

/* ─── Status Badge ─── */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge-green { background: var(--green-light); color: var(--green); }
.badge-gray { background: var(--leinen); color: var(--stein); }
.badge-amber { background: #fffbeb; color: var(--amber); }
.badge-red { background: var(--red-light); color: var(--red); }

/* ─── Forms ─── */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-group .hint {
  font-size: 0.8rem;
  color: var(--stein);
  margin-top: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--leinen);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: white;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--forest);
}

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

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.checkbox-group input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--forest);
}

.checkbox-group label {
  font-weight: 500;
  margin-bottom: 0;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--leinen);
}

/* ─── Alerts ─── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.alert-success { background: var(--green-light); color: var(--green); border: 1px solid #bbf7d0; }
.alert-error { background: var(--red-light); color: var(--red); border: 1px solid #fecaca; }

/* ─── Login ─── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--forest);
  padding: 2rem;
}

.login-card {
  background: white;
  border-radius: 1rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.login-card h1 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.25rem;
}

.login-card .subtitle {
  text-align: center;
  color: var(--stein);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.login-card .btn { width: 100%; justify-content: center; }

/* ─── Delete Confirm ─── */
.delete-form {
  display: inline;
}

.confirm-dialog {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.confirm-dialog.show { display: flex; }

.confirm-box {
  background: white;
  border-radius: 0.75rem;
  padding: 2rem;
  max-width: 400px;
  text-align: center;
}

.confirm-box p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.confirm-box .actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* ─── Section Header ─── */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--stein);
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--stein);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: 1.05rem; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 1.25rem; }
  .page-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
  .stats-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  table { font-size: 0.85rem; }
  th, td { padding: 0.75rem; }
}
