/* ─── ADMIN CSS ───────────────────────────────────────────────────────────────── */

/* Login */
.admin-body { background: #1a2d45; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap  { width: 100%; max-width: 420px; padding: 1rem; }
.login-box   { background: #fff; padding: 2.5rem; }
.login-logo  { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; color: var(--charcoal); margin-bottom: 0.3rem; }
.login-logo span { color: var(--blue-mid); font-style: italic; }
.login-box h1 { font-family: 'Cormorant Garamond', serif; font-size: 1.8rem; font-weight: 300; color: var(--charcoal); margin-bottom: 0.3rem; }
.login-sub   { font-size: 0.85rem; color: var(--warm-gray); margin-bottom: 1.5rem; }

/* Admin-Shell */
.admin-shell { display: flex; flex-direction: column; min-height: 100vh; }
.admin-header {
  background: var(--charcoal); border-bottom: 2px solid var(--blue);
  padding: 0 2rem; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.admin-header-logo { font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; color: #fff; font-style: italic; }
.admin-header-logo span { color: var(--blue-mid); }
.admin-header-actions { display: flex; gap: 0.75rem; align-items: center; }
.admin-header-actions a, .admin-header-actions button {
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 7px 16px; border: 1px solid rgba(255,255,255,0.2);
  background: transparent; color: rgba(255,255,255,0.7);
  transition: all 0.2s; font-family: 'Jost', sans-serif; cursor: pointer;
}
.admin-header-actions a:hover, .admin-header-actions button:hover {
  background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); color: #fff;
}
.admin-header-actions .btn-danger { border-color: rgba(180,60,60,0.5); color: rgba(255,160,160,0.9); }
.admin-header-actions .btn-danger:hover { background: #8b2020; border-color: #8b2020; color: #fff; }

/* Layout */
.admin-layout { display: flex; flex: 1; }
.admin-sidebar {
  width: 220px; flex-shrink: 0;
  background: #fff; border-right: 1px solid var(--border-light);
  padding: 1.5rem 0;
  position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto;
}
.admin-sidebar-section { margin-bottom: 0.25rem; }
.admin-sidebar-label {
  font-size: 0.65rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue); padding: 1rem 1.25rem 0.4rem;
  font-weight: 500; display: block;
}
.admin-sidebar a {
  display: block; padding: 9px 1.25rem;
  font-size: 0.87rem; color: var(--warm-gray);
  transition: all 0.15s; border-left: 2px solid transparent;
}
.admin-sidebar a:hover { background: var(--blue-pale); color: var(--blue); }
.admin-sidebar a.active { background: var(--blue-pale); color: var(--blue); border-left-color: var(--blue); }

/* Content area */
.admin-content { flex: 1; padding: 2rem; background: #f4f6f8; min-width: 0; }
.admin-content h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem; font-weight: 300; color: var(--charcoal);
  margin-bottom: 1.5rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.admin-content h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem; font-weight: 400; color: var(--charcoal);
  margin: 1.5rem 0 0.8rem;
}

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: #fff; border: 1px solid var(--border); padding: 1.2rem;
  text-align: center;
}
.stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.8rem; font-weight: 300; color: var(--blue); line-height: 1;
}
.stat-label { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--warm-gray); margin-top: 0.3rem; }

/* Admin-Karten */
.acard {
  background: #fff; border: 1px solid var(--border);
  padding: 1.25rem; margin-bottom: 1rem;
}
.acard h3 { font-size: 0.95rem; font-weight: 500; margin-bottom: 0.25rem; color: var(--charcoal); }
.acard p  { font-size: 0.83rem; color: var(--warm-gray); }
.acard-actions { margin-top: 0.8rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Tabellen */
.atable { width: 100%; border-collapse: collapse; background: #fff; }
.atable th {
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--blue); padding: 10px 12px; text-align: left;
  border-bottom: 2px solid var(--border); font-weight: 500;
  background: var(--blue-pale);
}
.atable td { padding: 10px 12px; font-size: 0.88rem; color: var(--warm-gray); border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.atable tr:hover td { background: var(--blue-pale); }
.atable img { width: 60px; height: 45px; object-fit: cover; display: block; }

/* Inline-Formular für neue Kategorie */
.inline-form { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid var(--border); font-family: 'Jost', sans-serif; font-size: 0.88rem; background: #fff; outline: none; }
.inline-form input:focus { border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(42,95,143,0.1); }

/* Upload-Zone */
.drop-zone {
  border: 2px dashed var(--border); padding: 2.5rem;
  text-align: center; cursor: pointer; transition: all 0.2s;
  background: #fff; margin-bottom: 1.5rem;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--blue-mid); background: var(--blue-pale); }
.drop-zone p { color: var(--warm-gray); font-size: 0.9rem; }
.drop-zone strong { color: var(--blue); }
#upload-file { display: none; }
#upload-preview { max-width: 320px; max-height: 220px; object-fit: contain; border: 1px solid var(--border); margin-bottom: 1rem; display: none; }

/* Upload-Raster */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Bild-Verwaltung Raster */
.img-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.img-admin-item { background: #fff; border: 1px solid var(--border); overflow: hidden; }
.img-admin-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.img-admin-info { padding: 0.6rem 0.75rem; }
.img-admin-info h4 { font-size: 0.82rem; font-weight: 500; color: var(--charcoal); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-admin-info small { font-size: 0.72rem; color: var(--warm-gray); }
.img-admin-actions { display: flex; border-top: 1px solid var(--border-light); }
.img-admin-actions a, .img-admin-actions button {
  flex: 1; padding: 7px; background: none; border: none;
  font-family: 'Jost', sans-serif; font-size: 0.72rem;
  cursor: pointer; color: var(--warm-gray); transition: all 0.15s;
  text-align: center; letter-spacing: 0.05em;
}
.img-admin-actions a:hover, .img-admin-actions button:hover { background: var(--blue-pale); color: var(--blue); }
.img-admin-actions .del:hover { background: #fdf0f0; color: var(--red); }
.img-admin-actions a + a, .img-admin-actions a + button, .img-admin-actions button + button { border-left: 1px solid var(--border-light); }

/* Admin-Buttons */
.abtn {
  display: inline-block; padding: 9px 22px;
  font-family: 'Jost', sans-serif; font-size: 0.76rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--border); background: transparent;
  color: var(--warm-gray); cursor: pointer; transition: all 0.2s;
}
.abtn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-pale); }
.abtn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.abtn.primary:hover { background: var(--accent); border-color: var(--accent); }
.abtn.danger { border-color: rgba(180,60,60,0.4); color: var(--red); }
.abtn.danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.abtn.sm { padding: 6px 14px; font-size: 0.7rem; }

/* Modal */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,24,36,0.65); z-index: 200;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; width: 520px; max-width: 100%; padding: 2rem; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-box h2 { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; font-weight: 300; margin-bottom: 1.5rem; }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--warm-gray); line-height: 1; }
.modal-close:hover { color: var(--charcoal); }

/* Filter */
.filter-bar { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; align-items: center; flex-wrap: wrap; }
.filter-bar label { font-size: 0.8rem; color: var(--warm-gray); }
.filter-bar select, .filter-bar input[type=text] {
  padding: 8px 12px; border: 1px solid var(--border); background: #fff;
  font-family: 'Jost', sans-serif; font-size: 0.85rem; outline: none;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--blue-mid); }

/* Sortier-Hinweis */
.sort-handle { cursor: grab; color: var(--warm-gray); margin-right: 8px; }

/* Responsive */
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; display: flex; flex-wrap: wrap; padding: 0.5rem; gap: 0.25rem; }
  .admin-sidebar a { padding: 7px 12px; font-size: 0.8rem; }
  .admin-sidebar-label { padding: 0.5rem 0.75rem 0.2rem; }
  .upload-grid { grid-template-columns: 1fr; }
}
