/* Schlösslekeller Admin-Portal – hell, Orange/Weiss wie schloesslekeller.li */

:root {
  /* Palette der Original-Website */
  --sk-orange: #f56600;
  --sk-orange-dark: #d95600;
  --sk-black: #1d1d1b;
  --sk-light: #f1f1f1;

  --bg: #f1f1f1;
  --panel: #ffffff;
  --panel-2: #f7f7f7;
  --border: #dedede;
  --border-strong: #d0d0d0;
  --text: #1d1d1b;
  --muted: #5d5d5d;
  --accent: #f56600;
  --accent-hover: #d95600;
  --accent-soft: rgba(245, 102, 0, 0.08);
  --ok: #18733c;
  --warn: #d95600;
  --err: #c62828;
  --info: #3b6ea2;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(29, 29, 27, 0.07);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(1100px 420px at 85% -10%, rgba(245, 102, 0, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1 { font-size: 1.6rem; margin: 0 0 0.5rem; letter-spacing: 0.2px; }
h1 em, .brand em { color: var(--sk-orange); font-style: normal; }
h2 { font-size: 1.05rem; margin: 0 0 0.75rem; color: var(--text); }
p { margin: 0.4rem 0; }
a { color: var(--sk-orange); text-decoration: none; }
a:hover { color: var(--sk-orange-dark); }
code {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.05em 0.4em;
  font-size: 0.85em;
  color: #b34700;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0; }

.container {
  width: min(1200px, 100% - 2rem);
  margin: 0 auto;
  flex: 1;
  padding: 1.5rem 0 3rem;
}

/* ---------- Seitenlayout mit Sidebar ---------- */
.page-layout { display: block; }
.page-layout.with-sidebar {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.page-layout.with-sidebar .page-content { flex: 1; min-width: 0; }

.sidebar {
  width: 232px;
  flex: none;
  position: sticky;
  top: 74px;
}
.sidebar-group {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.55rem;
  margin-bottom: 0.9rem;
}
.sidebar-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 800;
  padding: 0.3rem 0.6rem 0.4rem;
}
.sidebar-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.93rem;
  font-weight: 600;
}
.sidebar-link:hover { background: var(--accent-soft); color: var(--sk-orange); }
.sidebar-link.active { background: var(--sk-orange); color: #fff; }
.sidebar-link.active .count-pill { background: rgba(255, 255, 255, 0.25); color: #fff; }
.sidebar-plus {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.sidebar-link.active .sidebar-plus { background: rgba(255, 255, 255, 0.25); border-color: transparent; }

@media (max-width: 900px) {
  .page-layout.with-sidebar { flex-direction: column; }
  .sidebar { width: 100%; position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; align-items: start; }
  .sidebar-group { margin-bottom: 0; }
}

/* ---------- Topbar (dunkel wie die Original-Header) ---------- */
.topbar {
  background: var(--sk-black);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  width: min(1100px, 100% - 2rem);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.7rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.02rem;
  color: #fff;
  white-space: nowrap;
}
.brand:hover { color: #fff; }
.brand-logo {
  height: 38px;
  width: auto;
  display: block;
  border-radius: 4px;
  background: #fff;
}
.brand-logo--lg { height: 96px; border-radius: 8px; }
.brand-chip {
  background: var(--sk-orange);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: 5px;
  padding: 0.18rem 0.5rem;
}
.main-nav { display: flex; gap: 0.3rem; flex: 1; }
.main-nav a {
  color: #d0d0d0;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-weight: 600;
}
.main-nav a:hover { color: #fff; }
.main-nav a.active { color: var(--sk-orange); }
.topbar-user { display: flex; align-items: center; gap: 0.7rem; }
.user-chip {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font-size: 0.85rem;
  color: #fff;
}

/* ---------- Karten & Layout ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.card--danger-zone { border-color: rgba(198, 40, 40, 0.4); }
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.card-head h2 { margin: 0; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.page-head h1 { margin: 0; }
.post-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.35rem; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 700px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.stat-card:hover { border-color: var(--sk-orange); color: var(--text); }
.stat-value { font-size: 1.9rem; font-weight: 700; color: var(--sk-orange); line-height: 1.2; }
.stat-label { color: var(--muted); font-size: 0.9rem; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--draft { background: #ededed; color: #5d5d5d; border-color: #d0d0d0; }
.badge--scheduled { background: rgba(59, 110, 162, 0.1); color: var(--info); border-color: rgba(59, 110, 162, 0.4); }
.badge--published { background: rgba(24, 115, 60, 0.1); color: var(--ok); border-color: rgba(24, 115, 60, 0.4); }
.badge--failed { background: rgba(198, 40, 40, 0.08); color: var(--err); border-color: rgba(198, 40, 40, 0.4); }

/* ---------- Buttons & Formulare ---------- */
.btn {
  display: inline-block;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  text-align: center;
}
.btn:hover { border-color: var(--sk-orange); color: var(--sk-orange); }
.btn-accent {
  background: var(--sk-orange);
  border-color: var(--sk-orange);
  color: #fff;
}
.btn-accent:hover { background: var(--sk-orange-dark); border-color: var(--sk-orange-dark); color: #fff; }
.btn-danger { background: var(--panel); border-color: rgba(198, 40, 40, 0.5); color: var(--err); }
.btn-danger:hover { background: rgba(198, 40, 40, 0.07); border-color: var(--err); color: var(--err); }
.btn-ghost { background: transparent; border-color: transparent; color: #d0d0d0; }
.btn-ghost:hover { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.83rem; }
.btn-block { width: 100%; }

.input, input[type="text"], input[type="password"], input[type="datetime-local"], textarea, select {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-size: 0.95rem;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--sk-orange);
  box-shadow: 0 0 0 3px rgba(245, 102, 0, 0.18);
}
textarea { resize: vertical; }

.field { display: block; }
.field > span {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.stack { display: flex; flex-direction: column; gap: 0.9rem; }
.inline-form { display: inline; }
.row-gap { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin: 0.5rem 0; }
.row-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

.radio {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  cursor: pointer;
  margin-right: 1rem;
}
.status-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.status-row input[type="datetime-local"] { width: auto; }

.form-actions { display: flex; gap: 0.7rem; margin: 0.5rem 0 1rem; }
.char-count { font-size: 0.8rem; color: var(--muted); }
.field .char-count { text-align: right; margin-top: 0.25rem; }

/* ---------- Flash & Notices ---------- */
.flash {
  border-radius: 8px;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid;
  font-size: 0.93rem;
}
.flash--ok { background: rgba(24, 115, 60, 0.08); border-color: rgba(24, 115, 60, 0.4); color: var(--ok); }
.flash--err { background: rgba(198, 40, 40, 0.07); border-color: rgba(198, 40, 40, 0.45); color: var(--err); }
.notice {
  border-radius: 8px;
  padding: 0.7rem 1rem;
  margin: 0.6rem 0;
  font-size: 0.92rem;
  border: 1px solid;
}
.notice--warn { background: rgba(245, 102, 0, 0.07); border-color: rgba(245, 102, 0, 0.35); color: #7a3c00; }
.notice--warn a { color: #7a3c00; text-decoration: underline; }
.notice--err { background: rgba(198, 40, 40, 0.07); border-color: rgba(198, 40, 40, 0.45); color: var(--err); }

/* ---------- Tabs & Table ---------- */
.filter-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.filter-tab {
  color: var(--muted);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  border-radius: 999px;
  padding: 0.3rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 700;
}
.filter-tab:hover { color: var(--sk-orange); border-color: var(--sk-orange); }
.filter-tab.active { color: var(--sk-orange); border-color: var(--sk-orange); background: var(--accent-soft); }
.count-pill {
  background: var(--panel-2);
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 0.05rem 0.5rem;
  margin-left: 0.25rem;
}

.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th {
  text-align: left;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 0.6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--accent-soft); }
.thumb-cell { width: 56px; }
.thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}

.text-link { font-weight: 700; }

/* ---------- Foto-Upload ---------- */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 1.6rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover {
  border-color: var(--sk-orange);
  background: var(--accent-soft);
}
.dropzone-icon { font-size: 1.8rem; display: block; margin-bottom: 0.3rem; }

.photo-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.75rem; margin: 0.9rem 0 0.2rem; }
.photo-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
}
.photo-item img { width: 100%; height: 120px; object-fit: cover; display: block; }
.photo-item .keep-label {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(29, 29, 27, 0.82);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.photo-item .remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(29, 29, 27, 0.85);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}
.photo-item .remove-btn:hover { background: var(--err); color: #fff; }
.photo-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: var(--sk-orange);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 5px;
  padding: 0.1rem 0.45rem;
}

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.photo-grid-item { margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; position: relative; }
.photo-grid-item img { width: 100%; height: 180px; object-fit: cover; display: block; }
.photo-grid-cover img { height: 260px; }

/* ---------- KI ---------- */
.ai-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.ai-status { font-size: 0.88rem; color: var(--muted); }
.ai-status.is-loading { color: var(--info); }
.ai-status.is-error { color: var(--err); }
.ai-status .spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--sk-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -1px;
  margin-right: 0.4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.login-card {
  width: min(400px, 100%);
  padding: 2rem;
  text-align: center;
}
.login-card .stack { text-align: left; margin-top: 1.25rem; }
.login-logo { display: flex; justify-content: center; margin-bottom: 0.75rem; }
.login-foot { color: var(--muted); font-size: 0.85rem; margin-top: 1.25rem; }

/* ---------- Kanäle ---------- */
.channel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  background: var(--sk-black);
  flex: none;
}
.channel-badge--instagram { background: #c13584; }
.channel-badge--facebook { background: #1877f2; }
.channel-badge--tiktok { background: #0f0f0f; }
.channel-badge--x { background: #1d1d1b; border: 1px solid #4d4d4b; }
.channel-cell { white-space: nowrap; }
.channel-cell .channel-badge { margin-right: 0.25rem; }

.channel-card { }
.channel-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.75rem;
}
.channel-head-text { flex: 1; }
.channel-head-text h2 { margin: 0; }

.channel-checks { display: flex; flex-wrap: wrap; gap: 0.4rem 1.75rem; margin: 0.4rem 0; }
.radio--disabled { color: var(--muted); opacity: 0.75; cursor: not-allowed; }

.dash-channel { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.dash-channel:first-of-type { padding-top: 0.2rem; }
.dash-channel:last-child { border-bottom: none; padding-bottom: 0.2rem; }
.dash-channel-line { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

/* Kanal-Profil-Widget */
.channel-profile { margin-top: 0.4rem; }
.cp-data { display: flex; align-items: center; gap: 0.9rem; margin: 0.5rem 0; }
.cp-avatar { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--sk-orange); }
.cp-name { font-weight: 700; }

/* ---------- Publish ---------- */
.publish-row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-top: 0.75rem; }
.schedule-form { display: flex; gap: 0.5rem; align-items: center; }
.schedule-form input { width: auto; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1rem 0 1.5rem;
  background: var(--panel);
}
.site-footer .footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0;
  flex-wrap: wrap;
}
