@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@600&display=swap');

/* ── VARIABLES ─────────────────────────────── */
:root {
  --accent:       #9C7A4C;
  --accent-light: #b08d5f;
  --accent-bg:    #f5efe8;
  --dark:         #0f0f1a;
  --dark-2:       #1a1a2e;
  --dark-3:       #252540;
  --bg:           #f4f5f7;
  --bg-card:      #ffffff;
  --text:         #1a1a1a;
  --text-muted:   #6b7280;
  --text-light:   #9ca3af;
  --border:       #e5e7eb;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.12), 0 8px 32px rgba(0,0,0,0.06);
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --status-pipeline:           #6b7280;
  --status-pipeline-bg:        #f3f4f6;
  --status-entwurf:            #7c3aed;
  --status-entwurf-bg:         #f5f3ff;
  --status-bereit:             #059669;
  --status-bereit-bg:          #ecfdf5;
  --status-veroeffentlicht:    #2563eb;
  --status-veroeffentlicht-bg: #eff6ff;
  --status-abgelehnt:          #dc2626;
  --status-abgelehnt-bg:       #fef2f2;
}

/* ── RESET ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
img { max-width: 100%; display: block; }


/* ── BUTTONS ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-light); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); border-color: #d1d5db; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text); background: var(--bg); }

.btn-success {
  background: #059669;
  color: white;
}
.btn-success:hover { background: #047857; }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

.btn.copied { background: #059669 !important; color: white !important; }


/* ── STATUS BADGES ─────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-pipeline        { color: var(--status-pipeline);           background: var(--status-pipeline-bg); }
.badge-entwurf         { color: var(--status-entwurf);            background: var(--status-entwurf-bg); }
.badge-bereit          { color: var(--status-bereit);             background: var(--status-bereit-bg); }
.badge-veroeffentlicht { color: var(--status-veroeffentlicht);    background: var(--status-veroeffentlicht-bg); }
.badge-abgelehnt       { color: var(--status-abgelehnt);          background: var(--status-abgelehnt-bg); }


/* ── LOADING ───────────────────────────────── */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 60px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-wrap { display: flex; justify-content: center; padding: 60px 0; }


/* ── EMPTY STATE ───────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state p  { font-size: 0.875rem; }


/* ════════════════════════════════════════════
   LOGIN PAGE
════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark);
  padding: 24px;
}
.login-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}
.login-logo img { height: 28px; }
.login-logo span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-card);
  transition: border-color 0.18s;
  outline: none;
}
.form-group input:focus { border-color: var(--accent); }
.login-btn {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.18s;
  margin-top: 8px;
}
.login-btn:hover { background: var(--accent-light); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-top: 16px;
  display: none;
}
.login-error.visible { display: block; }


/* ════════════════════════════════════════════
   PORTAL LAYOUT (shared header)
════════════════════════════════════════════ */
.portal-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.portal-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.portal-header-logo {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
.portal-header-logo img { height: 24px; filter: brightness(0); }
.portal-brand-social {
  font-family: 'Josefin Sans', sans-serif;
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1;
  text-align: justify;
  text-align-last: justify;
}
.portal-header-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}
.portal-header-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}
.portal-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.portal-pharmacy-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.portal-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}
.portal-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 12px 0;
  position: fixed;
  top: 64px;
  left: 0;
  height: calc(100vh - 64px);
  overflow-y: auto;
  z-index: 10;
}
.portal-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}
.portal-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.portal-sidebar-item:hover { background: var(--bg); color: var(--text); }
.portal-sidebar-item.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.portal-sidebar-item svg { flex-shrink: 0; }
.portal-main {
  margin-left: 220px;
  flex: 1;
  min-width: 0;
  padding: 40px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.portal-main > * {
  width: 100%;
  max-width: 900px;
}
.portal-main > .confirm-overlay,
.portal-main > .upload-processing-overlay,
.portal-main > #lightbox {
  width: auto;
  max-width: none;
}


/* ── PAGE HEADER ───────────────────────────── */
.page-header {
  margin-bottom: 28px;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.page-header p {
  font-size: 0.875rem;
  color: var(--text-muted);
}


/* ── STATS ROW ─────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.stat-value.accent { color: var(--accent); }
.stat-value.green  { color: #059669; }
.stat-value.blue   { color: #2563eb; }


/* ── FILTER TABS ───────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  width: fit-content;
}
.filter-tab {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-tab.active {
  background: var(--accent);
  color: white;
}
.filter-tab:not(.active):hover {
  background: var(--bg);
  color: var(--text);
}


/* ── POST GRID ─────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.post-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  border: 1px solid var(--border);
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.post-card-image {
  aspect-ratio: 1;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}
.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-card-image .img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 2rem;
}
.post-card-body { padding: 16px; }
.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.post-card-date { font-size: 0.75rem; color: var(--text-muted); }
.post-card-headline {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ════════════════════════════════════════════
   POST DETAIL
════════════════════════════════════════════ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 24px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

.post-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.post-detail-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.post-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.slides-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}
.slide-item { position: relative; }
.slide-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.slide-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.slide-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.slide-download:hover { background: var(--border); color: var(--text); }

.content-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.content-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.content-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.content-text {
  font-size: 0.925rem;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.action-bar {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

/* ── EDIT MODE ─────────────────────────────── */
.edit-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.925rem;
  line-height: 1.7;
  color: var(--text);
  resize: vertical;
  min-height: 100px;
  outline: none;
  background: var(--bg-card);
}
.edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.date-input {
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  transition: border-color 0.15s;
}
.date-input:focus { border-color: var(--accent); }

.btn-restore {
  background: transparent;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}
.btn-restore:hover { background: #fef2f2; }


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

/* Sidebar */
.admin-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo img {
  height: 24px;
  filter: brightness(0) invert(1);
  margin-bottom: 6px;
}
.sidebar-logo span {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sidebar-section-title {
  padding: 20px 24px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.sidebar-nav { list-style: none; padding: 0 12px; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  transition: all 0.15s;
}
.sidebar-nav li a:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}
.sidebar-nav li a.active {
  background: rgba(156,122,76,0.2);
  color: var(--accent-light);
}
.sidebar-customers {
  padding: 0 12px;
  flex: 1;
}
.sidebar-customer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.sidebar-customer-item:hover { background: rgba(255,255,255,0.05); }
.sidebar-customer-name {
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-customer-badge {
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  flex-shrink: 0;
}
.sidebar-bottom {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
}

/* Kunden List */
.kunden-list-header,
.kunden-list-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 1.5fr 140px;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
}
.kunden-list-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.kunden-list-row {
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.kunden-list-row:last-child { border-bottom: none; }
.kunden-list-row:hover { background: var(--bg); }
.kunden-list-arrow {
  color: var(--text-muted);
  font-size: 1rem;
  text-align: right;
}
.kunden-stat-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-right: 4px;
}
.kunden-stat-pill.green { background: #ecfdf5; color: #059669; }
.kunden-stat-pill.blue  { background: #eff6ff; color: #2563eb; }
.kunden-stat-pill.grey  { background: #f3f4f6; color: #6b7280; }

/* Admin Main */
.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-topbar h1 { font-size: 1.1rem; font-weight: 700; }
.admin-content { padding: 32px; }


/* ── QUEUE TABLE ───────────────────────────── */
.table-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}
.table-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.table-title { font-size: 0.95rem; font-weight: 700; }
.table-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg); }
tbody td {
  padding: 14px 16px;
  font-size: 0.875rem;
  vertical-align: middle;
}
.td-pharmacy { font-weight: 600; }
.td-headline {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}
.td-actions { display: flex; gap: 8px; }


/* ════════════════════════════════════════════
   CALENDAR
════════════════════════════════════════════ */
.day-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.day-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.day-btn:hover  { border-color: var(--accent); color: var(--accent); }
.day-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.calendar-month-title {
  font-size: 1rem;
  font-weight: 700;
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  margin-bottom: 0;
}
.calendar-weekday {
  text-align: center;
  padding: 10px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 130px;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

.calendar-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px;
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Andere Monats-Tage noch unauffälliger */
.calendar-cell.other-month {
  background: #fafafa;
}
.calendar-cell.other-month .cell-day {
  color: var(--text-light);
  font-size: 0.72rem;
}

/* Posting-Tag: warmer Hintergrund */
.calendar-cell.posting-day {
  background: #fdfaf6;
}

/* Heute */
.calendar-cell.today {
  background: var(--bg-card);
}
.calendar-cell.today .cell-day-number {
  background: var(--accent);
  color: white;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Datums-Zeile */
.cell-day {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.cell-day-number {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cell-day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  flex-shrink: 0;
}

/* Post-Karte füllt die restliche Zellhöhe */
.cell-posts {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

.cell-post {
  flex: 1;
  min-height: 0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
  transition: box-shadow 0.15s, transform 0.15s;
}
.cell-post:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.16);
  transform: translateY(-1px);
}
.cell-post-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Overlay-Footer über dem Bild */
.cell-post-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  display: flex;
  align-items: center;
  gap: 4px;
}
.cell-post-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.cell-post-badge {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 100px;
  flex-shrink: 0;
  white-space: nowrap;
}
.cell-post-badge.bereit        { background: #ecfdf5; color: #059669; }
.cell-post-badge.veroeffentlicht { background: #eff6ff; color: #2563eb; }

/* Zelle ohne Bild: farbiger Platzhalter */
.cell-post-no-img {
  flex: 1;
  min-height: 0;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.cell-post-no-img:hover { background: #f0f0f0; }
.cell-post.draggable       { cursor: grab; }
.cell-post-no-img.draggable { cursor: grab; }
.cell-post.dragging, .cell-post-no-img.dragging { opacity: 0.4; }
.calendar-cell.drag-over   { background: #eff6ff !important; outline: 2px dashed #2563eb; outline-offset: -2px; }
.calendar-cell.drag-over * { pointer-events: none; }
.cell-post-no-img .cell-post-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* ── CONFIRM MODAL ─────────────────────────── */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.confirm-overlay.active { display: flex; }
.confirm-box {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-md);
}
.confirm-box h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.confirm-box p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── VIEW TOGGLE ───────────────────────────── */
.view-toggle-btn {
  background: none;
  border: none;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
}
.view-toggle-btn:hover { background: var(--bg-card); color: var(--text); }
.view-toggle-btn.active { background: var(--bg-card); color: var(--accent); }

/* List view */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}
.post-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.post-row:last-child { border-bottom: none; }
.post-row:hover { background: var(--bg-surface); }

/* ════════════════════════════════════════════
   UPLOAD PAGE
════════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 56px 32px;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 220px;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-zone-icon { font-size: 2.2rem; line-height: 1; }
.upload-zone-title  { font-size: 1rem; font-weight: 700; color: var(--text); }
.upload-zone-sub    { font-size: 0.8rem; color: var(--text-muted); }

.upload-preview-wrap {
  display: none;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.upload-preview-wrap.visible { display: block; }
.upload-preview-wrap img {
  max-width: 100%;
  max-height: 380px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}
.upload-preview-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.upload-preview-remove:hover { background: rgba(0,0,0,0.85); }

.upload-multi-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.upload-thumb {
  position: relative;
  width: 160px;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.upload-thumb-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.upload-thumb-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.upload-thumb-remove:hover { background: rgba(0,0,0,0.85); }
.upload-add-btn {
  width: 160px;
  height: 120px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  background: transparent;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.upload-add-btn:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}
.upload-add-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-processing-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.88);
  z-index: 3000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.upload-processing-overlay.active { display: flex; }
.upload-processing-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.upload-processing-sub   { font-size: 0.875rem; color: var(--text-muted); }

/* Entwurf-Hinweis in post.html */
.entwurf-notice {
  background: var(--status-entwurf-bg);
  border: 1.5px solid var(--status-entwurf);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 0.875rem;
  color: var(--status-entwurf);
  font-weight: 600;
}

/* ── MOBILE NAV ─────────────────────────────── */
.mobile-nav-btn {
  display: none;
  background: none;
  border: none;
  padding: 6px;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
}
.mobile-nav-btn:hover { background: var(--bg); }

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 98;
}
.mobile-overlay.active { display: block; }

/* ── PLAN BUTTONS ──────────────────────────── */
.plan-btn {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg-card);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s;
  font-family: var(--font);
}
.plan-btn:hover:not(.active) { border-color: #d1d5db; background: var(--bg); }
.plan-btn.active { border-color: var(--accent); background: var(--accent-bg); }
.plan-btn-title { font-size: 0.875rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.plan-btn-sub   { font-size: 0.78rem; color: var(--text-muted); }
.plan-btn.active .plan-btn-title { color: var(--accent); }
.plan-btn.active .plan-btn-sub   { color: var(--accent); opacity: 0.75; }

/* ── STATS ROW 4 ───────────────────────────── */
.stats-row-4 { grid-template-columns: repeat(4, 1fr); }

/* ── RESPONSIVE ────────────────────────────── */
@media (max-width: 1024px) {
  .posts-grid  { grid-template-columns: repeat(2, 1fr); }
  .slides-row  { grid-template-columns: repeat(2, 1fr); }
  .stats-row   { grid-template-columns: repeat(2, 1fr); }
  .stats-row-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .mobile-nav-btn { display: flex; align-items: center; }

  .portal-header { padding: 0 16px; }

  .portal-sidebar {
    position: fixed;
    top: 0;
    left: -240px;
    bottom: 0;
    z-index: 99;
    width: 220px;
    padding-top: 64px;
    transition: left 0.25s ease;
  }
  .portal-sidebar.mobile-open {
    left: 0;
    box-shadow: var(--shadow-md);
  }

  .admin-sidebar { display: none; }
  .portal-main { margin-left: 0; padding: 20px 16px; }
  .admin-content { padding: 20px 16px; }
  .posts-grid { grid-template-columns: 1fr; }
  .slides-row { grid-template-columns: repeat(2, 1fr); }
  .stats-row  { grid-template-columns: 1fr; }
  .post-detail-header { flex-direction: column; }
  .action-bar { flex-direction: column; }
  .portal-header-title { display: none; }
  .portal-header-divider { display: none; }
}
