/* =============================================
   Glücksgriffe Admin Panel – Styles
   ============================================= */

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

:root {
  --green:        #6abf67;   /* = --color-green-dark der Startseite */
  --green-mid:    #8fd48c;   /* = --color-green */
  --green-light:  #cff0ce;   /* = --color-green-light */
  --green-pale:   #e9ffe9;   /* = --color-green-pale */
  --green-bg:     #f4fff4;   /* = --color-green-bg */
  --green-dark:   #4a9f47;   /* etwas dunkler für Hover */
  --bg:           #f4fff4;
  --sidebar-bg:   #1c3319;   /* dunkles Grün, abgeleitet von #6abf67 */
  --sidebar-w:    240px;
  --white:        #ffffff;
  --border:       #d8ebd3;   /* = --color-border der Startseite */
  --text:         #2c2c2c;
  --text-muted:   #777;
  --red:          #b8185a;
  --red-light:    #fde8ef;
  --yellow:       #a07800;
  --yellow-light: #fdf6d0;
  --radius:       10px;
  --shadow:       0 2px 12px rgba(0,0,0,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ── Login ── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1c3319, #2d5c2a);
}
.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  text-align: center;
}
.login-logo { font-size: 3rem; color: var(--green); margin-bottom: 12px; }
.login-title { font-size: 1.5rem; margin-bottom: 4px; }
.login-sub { color: var(--text-muted); margin-bottom: 28px; }
.login-form .form-group { text-align: left; }
.btn-back {
  display: inline-block;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: .85rem;
  text-decoration: none;
  transition: color .2s;
}
.btn-back:hover { color: var(--green); }

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

/* ── Sidebar ── */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #ccc;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-logo {
  padding: 24px 20px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green);
  border-bottom: 1px solid rgba(255,255,255,.08);
  letter-spacing: .5px;
}
.sidebar-nav {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: #aaa;
  text-decoration: none;
  font-size: .95rem;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.sidebar-nav li a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav li a.active {
  background: rgba(106,191,103,.18);
  color: var(--green-mid);
  border-left-color: var(--green);
}
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-link {
  color: #888;
  text-decoration: none;
  font-size: .85rem;
  transition: color .15s;
}
.sidebar-link:hover { color: #fff; }
.sidebar-link--logout { color: #e57373; }
.sidebar-link--logout:hover { color: #ff8a80; }

/* ── Main content ── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}
.page-title {
  font-size: 1.6rem;
  margin-bottom: 24px;
  color: var(--text);
}

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: .9rem;
  font-weight: 500;
}
.alert--error   { background: var(--red-light);    color: var(--red); }
.alert--success { background: var(--green-pale);  color: var(--green-dark); }
.alert--warning { background: var(--yellow-light); color: var(--yellow); }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body { padding: 20px; }

/* ── Dashboard stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-number { font-size: 2.5rem; font-weight: 700; color: var(--green); }
.stat-label  { color: var(--text-muted); font-size: .85rem; margin-top: 4px; }

/* ── Quick action grid ── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.action-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .2s, box-shadow .2s;
}
.action-card:hover { border-color: var(--green); box-shadow: 0 4px 16px rgba(106,191,103,.25); }
.action-icon { font-size: 1.8rem; }
.action-card strong { font-size: 1rem; }
.action-card p { color: var(--text-muted); font-size: .85rem; }
.action-card--warning { border-color: #f0a500; background: #fffbe6; }
.action-card--warning:hover { border-color: #c07800; box-shadow: 0 4px 16px rgba(240,165,0,.25); }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(106,191,103,.25);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group .hint { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }

/* ── Buttons ── */
.btn-primary {
  display: inline-block;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-primary.full  { width: 100%; text-align: center; padding: 12px; }

.btn-secondary {
  display: inline-block;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 22px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .2s, background .2s;
}
.btn-secondary:hover { border-color: var(--green); background: var(--green-pale); }

.btn-danger {
  display: inline-block;
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #f7c5d5;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
}
.btn-danger:hover { background: #f9d0df; }

.btn-edit {
  display: inline-block;
  background: var(--yellow-light);
  color: var(--yellow);
  border: 1px solid #f0e090;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
}
.btn-edit:hover { background: #fef0a0; }

.btn-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Content sections (accordion) ── */
.content-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.content-section__toggle {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  transition: background .15s;
}
.content-section__toggle:hover { background: #f9f9f9; }
.content-section__toggle .arrow { transition: transform .2s; font-size: .8rem; }
.content-section__toggle.open .arrow { transform: rotate(180deg); }
.content-section__body {
  padding: 20px;
  border-top: 1px solid var(--border);
  display: none;
}
.content-section__body.open { display: block; }

/* ── Image upload field ── */
.img-field {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.img-preview {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.img-placeholder {
  width: 120px;
  height: 90px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: .75rem;
  text-align: center;
  flex-shrink: 0;
}
.img-controls { flex: 1; min-width: 200px; }
.img-controls input[type="file"] { margin-top: 8px; font-size: .85rem; }
.img-remove { margin-top: 8px; }

/* ── News table ── */
.news-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.news-table th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}
.news-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.news-table tr:last-child td { border-bottom: none; }
.news-table tr:hover td { background: #fafafa; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
}
.badge--published { background: var(--green-pale); color: var(--green-dark); }
.badge--draft     { background: #f5f5f5; color: var(--text-muted); }
.badge--info      { background: #e3f2fd; color: #1565c0; }
.badge--aktion    { background: var(--yellow-light); color: var(--yellow); }
.badge--schliessung { background: var(--red-light); color: var(--red); }

/* ── Checkbox / toggle ── */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .95rem;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--green);
}

/* ── Visibility toggle button ── */
.btn-visibility {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid;
  transition: all .15s;
  margin-top: 7px;
  line-height: 1.4;
}
.btn-visibility--shown {
  color: var(--text-muted);
  border-color: var(--border);
  background: #fff;
}
.btn-visibility--shown:hover {
  color: var(--red);
  border-color: #f7c5d5;
  background: var(--red-light);
}
.btn-visibility--hidden {
  color: #d97706;
  border-color: #f59e0b;
  background: #fffbeb;
}
.btn-visibility--hidden:hover {
  background: #fef3c7;
}
.form-group.field-is-hidden {
  outline: 2px dashed #f59e0b;
  border-radius: 8px;
  padding: 8px 8px 6px;
}
.form-group.field-is-hidden input[type="text"],
.form-group.field-is-hidden textarea {
  opacity: 0.45;
}

/* ── File upload button ── */
.btn-upload {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fff !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text) !important;
  transition: border-color .15s, background .15s;
  margin-top: 8px;
  font-family: inherit;
  line-height: 1.4;
}
.btn-upload:hover {
  border-color: var(--green) !important;
  background: var(--green-pale) !important;
}
.btn-upload input[type="file"] {
  display: none !important;
  width: 0;
  height: 0;
  position: absolute;
  opacity: 0;
}
.filename-display {
  display: block;
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 5px;
  font-style: italic;
}

/* ── Remove image button ── */
.btn-remove-img {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #f7c5d5 !important;
  background: #fff !important;
  color: var(--red) !important;
  transition: all .15s;
  margin-top: 8px;
  font-family: inherit;
  line-height: 1.4;
  box-shadow: none;
}
.btn-remove-img:hover { background: var(--red-light) !important; }
.btn-remove-img.is-active {
  background: var(--red-light) !important;
  border-color: var(--red) !important;
}

/* ── Top bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── Divider ── */
.form-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .admin-sidebar { width: 100%; position: static; height: auto; }
  .admin-main { margin-left: 0; padding: 16px; }
  .admin-layout { flex-direction: column; }
}
